[Laszlo-checkins] r8638 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel
hqm@openlaszlo.org
hqm at openlaszlo.org
Fri Apr 11 13:45:05 PDT 2008
Author: hqm
Date: 2008-04-11 13:45:03 -0700 (Fri, 11 Apr 2008)
New Revision: 8638
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/Library.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/LzUtils.lzs
Log:
Change 20080411-hqm-O by hqm at badtzmaru.home on 2008-04-11 16:23:52 EDT
in /Users/hqm/openlaszlo/trunk4/WEB-INF/lps/lfc
for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc
Summary: fix up LzUtils to compile in swf9
New Features:
Bugs Fixed:
Technical Reviewer: pbr
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/Library.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/Library.lzs 2008-04-11 19:57:49 UTC (rev 8637)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/Library.lzs 2008-04-11 20:45:03 UTC (rev 8638)
@@ -7,22 +7,20 @@
* @access private
*/
-if ($swf9) {
- #include "kernel/LzUtils.js"
+ #include "kernel/LzUtils.lzs"
- #include "kernel/swf9/Library.lzs"
- // TODO [hqm 01 2008] Note: we should be able to merge
- // the LzIdleKernel swf9 version with the default version
+if ($swf9) {
} else {
#include "kernel/LzIdleKernel.lzs"
- #include "kernel/LzUtils.lzs"
#include "kernel/LzLibraryCleanup.lzs"
}
//#include "kernel/LzRequires.lzs"
-if ($dhtml) {
+if ($swf9) {
+ #include "kernel/swf9/Library.lzs"
+} else if ($dhtml) {
#include "kernel/dhtml/Library.lzs"
} else if ($svg) {
#include "kernel/svg/Library.lzs"
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/LzUtils.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/LzUtils.lzs 2008-04-11 19:57:49 UTC (rev 8637)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/LzUtils.lzs 2008-04-11 20:45:03 UTC (rev 8638)
@@ -9,16 +9,34 @@
* @author Max Carlson <max at openlaszlo.org>
*/
-class LzUtils {
+class ColorUtilsClass {
+
+ function hextoint (value) {
+ Debug.info("LzUtils.color.hextoint is deprecated, use Lzutils.hextoint");
+ return LzUtils.hextoint(value);
+ }
+
+ function inttohex (c) {
+ Debug.info("LzUtils.color.inttohex is deprecated, use Lzutils.inttohex");
+ return LzUtils.inttohex(c);
+ }
+
+ function torgb (s) {
+ Debug.info("LzUtils.color.torgb is deprecated, use Lzutils.torgb");
+ return LzUtils.torgb(s);
+ }
+}
+
+class LzUtilsClass {
// ***** callback *****
// Provides weak links for global callbacks
- static var __scopeid:* = 0;
- static var __scopes:* = [];
+ var __scopeid:* = 0;
+ var __scopes:* = [];
/**
* Returns a callback as a string, suitable for setTimeout
*/
- public static function getcallbackstr(scope:*, name:*) {
+ public function getcallbackstr(scope:*, name:*) {
var sc = LzUtils.__scopeid++;
if (scope.__callbacks == null) {
scope.__callbacks = {sc: sc}
@@ -32,7 +50,7 @@
/**
* Returns a callback function
*/
- public static function getcallbackfunc(scope, name, args) {
+ public function getcallbackfunc(scope, name, args) {
var sc = LzUtils.__scopeid++;
if (scope.__callbacks == null) {
scope.__callbacks = {sc: sc}
@@ -40,16 +58,14 @@
scope.__callbacks[sc] = sc;
}
LzUtils.__scopes[sc] = scope;
-//TODO pbr
- return null;
-/*
- return function () {
+ var val = function () {
var s = LzUtils.__scopes[sc];
if (s) return s[name].apply(s, args);
- }
-*/
+ };
+ return val;
+
}
- public static function removecallback(scope) {
+ public function removecallback(scope) {
if (scope.__callbacks != null) {
for (var i in scope.__callbacks) {
var sc = scope.__callbacks[i]
@@ -61,7 +77,7 @@
}
- public static function dectohex(c:*, p:*) {
+ public function dectohex(c:*, p:*) {
if (typeof c == 'number') {
// convert from decimal to hex
var hex = c.toString(16);
@@ -76,8 +92,11 @@
}
}
+ // For back compatibility
+ var color = new ColorUtilsClass();
+
// ***** color *****
- public static function hextoint(value:*) {
+ public function hextoint(value:*) {
if (typeof value != 'string') return value;
if (value.charAt(0) == '#') {
var n = parseInt(value.slice(1), 16);
@@ -101,7 +120,7 @@
}
return 0;
}
- public static function inttohex(c:*) {
+ public function inttohex(c:*) {
if (typeof c == 'string') {
c = c * 1;
}
@@ -112,7 +131,7 @@
}
return c;
}
- public static function torgb(s:*) {
+ public function torgb(s:*) {
if (typeof s == 'number') s = LzUtils.inttohex(s);
if (typeof s != 'string') return s;
if (s.length < 6) {
@@ -130,3 +149,6 @@
')';
}
}
+
+var LzUtils:LzUtilsClass = new LzUtilsClass();
+
More information about the Laszlo-checkins
mailing list