[Laszlo-checkins] r8982 - in openlaszlo/trunk: WEB-INF/lps/lfc/kernel/dhtml WEB-INF/lps/lfc/kernel/swf WEB-INF/lps/lfc/kernel/swf9 WEB-INF/lps/lfc/services WEB-INF/lps/lfc/services/platform/dhtml WEB-INF/lps/lfc/services/platform/swf docs/src/nav lps/includes/source
max@openlaszlo.org
max at openlaszlo.org
Fri May 2 17:16:44 PDT 2008
Author: max
Date: 2008-05-02 17:16:37 -0700 (Fri, 02 May 2008)
New Revision: 8982
Added:
openlaszlo/trunk/WEB-INF/lps/lfc/services/LzHistory.lzs
Removed:
openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzBrowserKernel.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzBrowserKernel.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
openlaszlo/trunk/WEB-INF/lps/lfc/services/Library.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/services/LzKeys.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTrack.lzs
openlaszlo/trunk/docs/src/nav/toc.xml
openlaszlo/trunk/lps/includes/source/lzhistory.js
Log:
Change 20080502-maxcarlson-w by maxcarlson at Roboto on 2008-05-02 14:16:21 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Remodularize LzHistory, fix LzHistory docs.
New Features:
Bugs Fixed: LPP-5558 - LzHistory (swf7 swf8 swf9) reference page problems, LPP-5557 - LzHistory (dhtml) reference page problems
Technical Reviewer: promanik
QA Reviewer: hminsky
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: swf/LzBrowserKernel.lzs - Move/implement getPersistedObject(), receivedHistory(), setHistory() and callMethod() APIs from platform/swf/LzHistory.as.
swf/LzSprite.as - Set persistence capability to true, set LzHistory.isReady to true after callbacks are ready.
dhtml/LzSprite.js - Set persistence capability to false, set LzHistory.isReady to true after callbacks are ready.
dhtml/LzBrowserKernel.lzs - Fix loadJS() to call loadURL() in the correct scope. Move/implement receivedHistory(), setHistory() and callMethod() APIs from platform/dhtml/LzHistory.js.
swf9/LzBrowserKernel.lzs - Add getPersistedObject(),
receivedHistory(), setHistory() and callMethod() APIs from platform/swf/LzHistory.as.
swf9/LzSprite.as - Set persistence capability to true.
LzTrack.lzs - Fix broken initialization of LzTrack.
Remove old platform-specific LzHistory implementations.
LzKeys.lzs - Change from a static to a service class, move extra keyCode definitions to constructor to make swf9 happy. Add LzKeys declaration with docs.
Library.lzs - Use the shared LzHistory class for all runtimes.
LzHistory.lzs - Move from swf/LzHistory.as, change from a static to a service class, delegate platform-specific parts to LzBrowserKernel. Add/update docs. Add LzHistory declaration with docs.
toc.xml - Update toc to point to LzIdle, LzModeManager, LzTimer and LzHistory entries to point to shortcut declarations. Use shared LzHistory docs.
lzhistory.js - Use LzHistory.isReady flag to decide when to start sending history messages.
Tests: cd docs/src;ant reference; produces correct docs. /test/history/history.lzx passes for swf7, 8 and dhtml. test/lfc/legals/keyboardandmouse.lzx passes for dhtml, swf8 and swf9.
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs 2008-05-03 00:16:37 UTC (rev 8982)
@@ -40,7 +40,7 @@
* browser frame .
*/
static function loadJS ( js, target ){
- this.loadURL('javascript:' + js + ';void(0);', target);
+ LzBrowserKernel.loadURL('javascript:' + js + ';void(0);', target);
}
@@ -55,6 +55,30 @@
}
/**
+ * Notify the browser we received the history state - not required in dhtml.
+ * @access private
+ */
+static function receivedHistory(n) {
+}
+
+/**
+ * Sets the browser history to a specified offset.
+ * @access private
+ */
+static function setHistory(n) {
+ //Debug.write('setHistory', n);
+ Lz.history.set(n);
+}
+
+/**
+ * Invoked by browser JavaScript to call a method
+ * @access private
+ */
+static function callMethod(js) {
+ return eval(js);
+}
+
+/**
* Returns version information about the browser
*/
static function getVersion () {
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-05-03 00:16:37 UTC (rev 8982)
@@ -248,6 +248,7 @@
,htmlinputtext: false
,advancedfonts: false
,bitmapcaching: false
+ ,persistence: false
}
LzSprite.prototype.__updateQuirks = function () {
@@ -411,9 +412,12 @@
if (this.quirks['safari_visibility_instead_of_display']) {
this.__LZdiv.style.visibility = 'visible';
}
+ // Register the canvas for callbacks
if (this._id) {
Lz[this._id]._ready(this.owner);
}
+ // Tell LzHistory we're ready to send/receive events
+ LzHistory.isReady = true;
}
}
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzBrowserKernel.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzBrowserKernel.lzs 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzBrowserKernel.lzs 2008-05-03 00:16:37 UTC (rev 8982)
@@ -124,8 +124,92 @@
LzBrowserKernel.__jscallq = [];
}
+static function getPersistedObject(n) {
+ return SharedObject.getLocal(n);
+}
+/**
+ * Notify the browser we received the history state
+ * @access private
+ */
+static function receivedHistory(n) {
+ if ($swf7) {
+ _root._currenthistory = n + '';
+ } else {
+ LzBrowserKernel.callJS('Lz.history.__receivedhistory', false, n + '');
+ }
+}
+/**
+ * Sets the browser history to a specified offset.
+ * @access private
+ */
+static function setHistory(n) {
+ //Debug.write('__setHistory', n);
+ LzBrowserKernel._jsreset();
+ LzBrowserKernel.callJS('Lz.history.set', null, n);
+}
+
+/**
+ * Invoked by browser JavaScript to call a method
+ * @access private
+ */
+static function callMethod(js) {
+ if (LzBrowserKernel.__jslocked) LzBrowserKernel._jsreset();
+ var scope = canvas;
+ //Debug.write('callMethod', js);
+ var s = js.indexOf('(')
+ if (s != -1) {
+ var e = js.indexOf(')')
+ var args = (js.substring(s + 1, e)).split(',');
+ js = js.substring(0, s);
+ }
+
+ var path = js.split('.');
+ for (var i = 0; i < path.length; i++) {
+ var n = path[i];
+ if (i == 0 && ! scope[n]) {
+ // look in global scope if canvas lookup fails
+ scope = global;
+ }
+ var lastscope = scope;
+ scope = scope[n];
+ //Debug.write('found', n, 'in scope', scope);
+ }
+
+ // cast arguments to type
+ for (var i = 0; i < args.length; i++) {
+ var a = args[i];
+
+ // strip whitespace
+ while (a.charAt(0) == ' ') {
+ a = a.substring(1, a.length);
+ }
+
+ var n = parseFloat(a);
+ if (! isNaN(n)) {
+ //number
+ args[i] = n;
+ //Debug.write('found number', args[i], a);
+ } else if (a.indexOf("'") != -1) {
+ // TODO - handle "
+ var s = a.indexOf("'") + 1;
+ var e = a.lastIndexOf("'");
+ args[i] = a.substring(s, e);
+ //Debug.write('found string', args[i], a);
+ } else if (a == 'true' || a == 'false'){
+ args[i] = a == 'true';
+ //Debug.write('found boolean', args[i], a);
+ } else if (lastscope[a]) {
+ args[i] = lastscope[a];
+ //Debug.write('found property', args[i], a);
+ }
+ }
+
+ //Debug.write('found scope', scope, 'args', args, 'for path', path);
+ return scope.apply(lastscope, args);
+}
+
static var _os = null;
static var _ver = null;
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2008-05-03 00:16:37 UTC (rev 8982)
@@ -64,6 +64,7 @@
,htmlinputtext: true
,advancedfonts: true
,bitmapcaching: true
+ ,persistence: true
}
/**
@@ -262,6 +263,9 @@
// Tell JavaScript that you are ready to have method calls
DojoExternalInterface.loaded();
+
+ // Tell LzHistory we're ready to send events
+ LzHistory.isReady = true;
}
}
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzBrowserKernel.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzBrowserKernel.lzs 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzBrowserKernel.lzs 2008-05-03 00:16:37 UTC (rev 8982)
@@ -56,6 +56,83 @@
throw new Error("callJS not implemented");
}
+/**
+ * Sets the browser history to a specified offset.
+ * @access private
+ */
+static function setHistory(n) {
+ //Debug.write('__setHistory', n);
+ LzBrowserKernel.callJS('Lz.history.set', null, n);
+}
+
+static function getPersistedObject(n) {
+ return SharedObject.getLocal(n);
+}
+
+/**
+ * Invoked by browser JavaScript to call a method
+ * @access private
+ */
+static function callMethod(js) {
+ var scope = canvas;
+ //Debug.write('callMethod', js);
+ var s = js.indexOf('(')
+ if (s != -1) {
+ var e = js.indexOf(')')
+ var args = (js.substring(s + 1, e)).split(',');
+ js = js.substring(0, s);
+ }
+
+ var path = js.split('.');
+ for (var i = 0; i < path.length; i++) {
+ var n = path[i];
+ if (i == 0 && ! scope[n]) {
+ // look in global scope if canvas lookup fails
+ scope = global;
+ }
+ var lastscope = scope;
+ scope = scope[n];
+ //Debug.write('found', n, 'in scope', scope);
+ }
+
+ // cast arguments to type
+ for (var i = 0; i < args.length; i++) {
+ var a = args[i];
+
+ // strip whitespace
+ while (a.charAt(0) == ' ') {
+ a = a.substring(1, a.length);
+ }
+
+ var n = parseFloat(a);
+ if (! isNaN(n)) {
+ //number
+ args[i] = n;
+ //Debug.write('found number', args[i], a);
+ } else if (a.indexOf("'") != -1) {
+ // TODO - handle "
+ var s = a.indexOf("'") + 1;
+ var e = a.lastIndexOf("'");
+ args[i] = a.substring(s, e);
+ //Debug.write('found string', args[i], a);
+ } else if (a == 'true' || a == 'false'){
+ args[i] = a == 'true';
+ //Debug.write('found boolean', args[i], a);
+ } else if (lastscope[a]) {
+ args[i] = lastscope[a];
+ //Debug.write('found property', args[i], a);
+ }
+ }
+
+ //Debug.write('found scope', scope, 'args', args, 'for path', path);
+ return scope.apply(lastscope, args);
+}
+
+static function receivedHistory(n) {
+ //TODO Not implemented
+ throw new Error("receivedHistory not implemented");
+}
+
static var _os = null;
static var _ver = null;
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as 2008-05-03 00:16:37 UTC (rev 8982)
@@ -84,6 +84,7 @@
,htmlinputtext: true
,advancedfonts: true
,bitmapcaching: true
+ ,persistence: true
}
public function LzSprite (newowner = null, isroot = null, args = null) {
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/Library.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/services/Library.lzs 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/services/Library.lzs 2008-05-03 00:16:37 UTC (rev 8982)
@@ -25,14 +25,13 @@
#include "services/LzKeys.lzs"
if ($js1) {
- #include "services/platform/dhtml/LzHistory.js"
} else if ($swf9) {
} else if ($as2) {
- #include "services/platform/swf/LzHistory.as"
} else {
Debug.error('services/Library.lzs unsupported runtime %s', $runtime);
}
+#include "services/LzHistory.lzs"
#include "services/LzTrack.lzs"
#include "services/LzIdle.lzs"
#include "services/LzCSSStyle.lzs"
Copied: openlaszlo/trunk/WEB-INF/lps/lfc/services/LzHistory.lzs (from rev 8978, openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as)
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/LzKeys.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/services/LzKeys.lzs 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/services/LzKeys.lzs 2008-05-03 00:16:37 UTC (rev 8982)
@@ -34,28 +34,86 @@
*
* @shortdesc Keyboard input service.
*/
-public class LzKeys {
+public class LzKeysService extends LzNode {
+ /** @access private */
+ function LzKeysService() {
+ super();
+
+ // add additional codes
+ this.keyCodes['add'] = 107;
+ // Backspace doesn't work in the Authoring tool player...
+ this.keyCodes['delete'] = 46;
+ this.keyCodes['0'] = 48 ;
+ this.keyCodes['1'] = 49 ;
+ this.keyCodes['2'] = 50 ;
+ this.keyCodes['3'] = 51 ;
+ this.keyCodes['4'] = 52 ;
+ this.keyCodes['5'] = 53 ;
+ this.keyCodes['6'] = 54 ;
+ this.keyCodes['7'] = 55 ;
+ this.keyCodes['8'] = 56 ;
+ this.keyCodes['9'] = 57 ;
+
+ this.keyCodes[')'] = 48 ;
+ this.keyCodes['!'] = 49 ;
+ this.keyCodes['@'] = 50 ;
+ this.keyCodes['#'] = 51 ;
+ this.keyCodes['$'] = 52 ;
+ this.keyCodes['%'] = 53 ;
+ this.keyCodes['^'] = 54 ;
+ this.keyCodes['&'] = 55 ;
+ this.keyCodes['*'] = 56 ;
+ this.keyCodes['('] = 57 ;
+
+ this.keyCodes[';'] = 186 ;
+ this.keyCodes[':'] = 186 ;
+ this.keyCodes['='] = 187 ;
+ this.keyCodes['+'] = 187 ;
+
+ this.keyCodes['<'] = 188 ;
+ this.keyCodes[','] = 188 ;
+ this.keyCodes['-'] = 189 ;
+ this.keyCodes['_'] = 189;
+ this.keyCodes['>'] = 190 ;
+ this.keyCodes['.'] = 190 ;
+ this.keyCodes['/'] = 191 ;
+ this.keyCodes['?'] = 191 ;
+
+ this.keyCodes['`'] = 192 ;
+ this.keyCodes['~'] = 192 ;
+ this.keyCodes['['] = 219 ;
+ this.keyCodes['{'] = 219 ;
+ this.keyCodes['\\'] = 220 ;
+ this.keyCodes['|'] = 220;
+ this.keyCodes[']'] = 221 ;
+ this.keyCodes['}'] = 221 ;
+ this.keyCodes['\"'] = 222 ;
+ this.keyCodes['\''] = 222 ;
+
+ this.keyCodes['IME'] = 229 ;
+ }
+
/**
* A hash where each of the keys that is currently
* down on the keyboard is set to true.
* @type Object
* @access private
*/
- static var downKeysHash = {};
+ var downKeysHash = {};
/**
* An array of currently pressed key codes.
* @type Array
* @access private
*/
- static var downKeysArray = [];
+ var downKeysArray = [];
/**
* An object used by callOnKeyCombo() to track kep combinations
* @type Object
* @access private
*/
- static var keycombos = {};
+ var keycombos = {};
/**
* Sent when a key is pressed; sent with keycode
@@ -81,16 +139,16 @@
/** @access private */
- static static function __keyEvent ( delta, k, type ){
+ function __keyEvent ( delta, k, type ){
//Debug.write('LzKeys.__keyEvent', delta, k, type);
//for each key change, send the corresponding event
for (var key in delta) {
var down = delta[key];
if (down) {
- LzKeys.gotKeyDown(k);
+ this.gotKeyDown(k);
} else {
- LzKeys.gotKeyUp(k);
+ this.gotKeyUp(k);
}
}
}
@@ -103,19 +161,19 @@
* @param Number kC: The Flash keycode for the key that is down.
* @param String info: if "extra" then ignore if you already got one
*/
- static function gotKeyDown ( kC, info = null ){
- if ( LzKeys.downKeysArray.length > 0 ){
+ function gotKeyDown ( kC, info = null ){
+ if ( this.downKeysArray.length > 0 ){
var badkeys = null;
- for ( var i = LzKeys.downKeysArray.length-1 ; i >=0; i-- ){
- var dkC = LzKeys.downKeysArray[ i ];
+ for ( var i = this.downKeysArray.length-1 ; i >=0; i-- ){
+ var dkC = this.downKeysArray[ i ];
if ( dkC == kC ) continue;
}
}
- var firstkeydown = !LzKeys.downKeysHash[ kC ];
+ var firstkeydown = !this.downKeysHash[ kC ];
if (firstkeydown) {
- LzKeys.downKeysHash[ kC ] = true;
- LzKeys.downKeysArray.push ( kC );
+ this.downKeysHash[ kC ] = true;
+ this.downKeysArray.push ( kC );
}
// send key down event first, so inputtext will get key event
// before a command that may change the focus
@@ -124,14 +182,14 @@
// won't send repeated key events in player XXX ?
// check for IME
- if (LzKeys.downKeysHash[229] != true) {
- if (LzKeys['onkeydown'].ready) LzKeys['onkeydown'].sendEvent( kC );
+ if (this.downKeysHash[229] != true) {
+ if (LzKeys.onkeydown.ready) LzKeys.onkeydown.sendEvent( kC );
}
}
if ( firstkeydown ){
- var cp = LzKeys.keycombos;
- var dkeys = LzKeys.downKeysArray;
+ var cp = this.keycombos;
+ var dkeys = this.downKeysArray;
dkeys.sort();
for ( var i = 0 ; i < dkeys.length && cp != null ; i++ ){
cp = cp[ dkeys[ i ] ];
@@ -139,7 +197,7 @@
if (cp != null && 'delegates' in cp) {
for ( var i = 0 ; i < cp.delegates.length ; i++ ){
- cp.delegates[ i ].execute( LzKeys.downKeysArray );
+ cp.delegates[ i ].execute( this.downKeysArray );
}
}
}
@@ -157,24 +215,24 @@
* @access private
* @param Number kC: The Flash keycode for the key that was released.
*/
- static function gotKeyUp ( kC ){
+ function gotKeyUp ( kC ){
- if (!LzKeys.downKeysHash[ kC ]) {
+ if (!this.downKeysHash[ kC ]) {
// Debug.write("derived keyDown", kC);
}
- if ( LzKeys.downKeysHash[229] != true && !LzKeys.downKeysHash[ kC ]) {
+ if ( this.downKeysHash[229] != true && !this.downKeysHash[ kC ]) {
// in FP5 some keys don't get a keydown event, but do get a keyup
- LzKeys.gotKeyDown( kC );
+ this.gotKeyDown( kC );
}
- delete LzKeys.downKeysHash[ kC ];
+ delete this.downKeysHash[ kC ];
- LzKeys.downKeysArray = [];
- for ( var k in LzKeys.downKeysHash ){
- LzKeys.downKeysArray.push( k );
+ this.downKeysArray = [];
+ for ( var k in this.downKeysHash ){
+ this.downKeysArray.push( k );
}
- if (LzKeys['onkeyup'].ready) LzKeys['onkeyup'].sendEvent( kC );
+ if (LzKeys.onkeyup.ready) LzKeys.onkeyup.sendEvent( kC );
}
@@ -183,14 +241,14 @@
* @param k: The name of the key to check for downness or an array of
* key names, e.g. ['shift', 'tab']
*/
- static function isKeyDown ( k ){
+ function isKeyDown ( k ){
if (typeof(k) == "string") {
- return (LzKeys.downKeysHash[ LzKeys.keyCodes[ k.toLowerCase() ] ] == true);
+ return (this.downKeysHash[ this.keyCodes[ k.toLowerCase() ] ] == true);
} else {
// an array of keys was passed
var down = true;
for (var i=0; i < k.length; i++) {
- down = down && (LzKeys.downKeysHash[LzKeys.keyCodes[k[i].toLowerCase()]]
+ down = down && (this.downKeysHash[this.keyCodes[k[i].toLowerCase()]]
== true);
}
return down;
@@ -295,16 +353,16 @@
* @param Array kCArr: Array of strings indicating which keys constitute the
* keycombo. This array may be in any order.
*/
- static function callOnKeyCombo ( d , kCArr ){
+ function callOnKeyCombo ( d , kCArr ){
var kcSorted = [];
for (var i = 0; i < kCArr.length; i++ ){
- kcSorted.push( LzKeys.keyCodes[ kCArr[ i ].toLowerCase() ] );
+ kcSorted.push( this.keyCodes[ kCArr[ i ].toLowerCase() ] );
}
kcSorted.sort();
- var cp = LzKeys.keycombos;
+ var cp = this.keycombos;
for ( var i = 0 ; i < kcSorted.length; i++ ){
if ( cp[ kcSorted[ i ] ] == null ){
@@ -323,14 +381,14 @@
* @param Array kCArr: An array of strings indicating which keys
* constituted the keycombo.
*/
- static function removeKeyComboCall ( d , kCArr ){
+ function removeKeyComboCall ( d , kCArr ){
var kcSorted = [];
for (var i = 0; i < kCArr.length; i++ ){
- kcSorted.push( LzKeys.keyCodes[ kCArr[ i ].toLowerCase() ] );
+ kcSorted.push( this.keyCodes[ kCArr[ i ].toLowerCase() ] );
}
kcSorted.sort();
- var cp = LzKeys.keycombos;
+ var cp = this.keycombos;
for ( var i = 0 ; i < kcSorted.length; i++ ){
if ( cp[ kcSorted[ i ] ] == null ){
return false; //error
@@ -347,7 +405,7 @@
/**
* @access private
*/
- static function enableEnter ( onroff ){
+ function enableEnter ( onroff ){
//Debug.write("enableEnter: "+onroff);
// SWF-specific
Debug.write('LzKeys.enableEnter not yet defined');
@@ -364,13 +422,13 @@
* @default 0
* @keywords readonly
*/
- static var mousewheeldelta = 0;
+ var mousewheeldelta = 0;
/** @access private */
- static function __mousewheelEvent(d) {
+ function __mousewheelEvent(d) {
//Debug.write('__mousewheelEvent', d);
- LzKeys.mousewheeldelta = d;
- if (LzKeys['onmousewheeldelta'].ready) LzKeys['onmousewheeldelta'].sendEvent(d);
+ this.mousewheeldelta = d;
+ if (LzKeys.onmousewheeldelta.ready) LzKeys.onmousewheeldelta.sendEvent(d);
}
/**
@@ -378,7 +436,7 @@
* @type Object
* @access private
*/
- static var keyCodes = {
+ var keyCodes = {
a : 65 ,
b : 66 ,
c : 67 ,
@@ -455,63 +513,13 @@
numlock : 144
}
- keyCodes['add'] = 107;
- // Backspace doesn't work in the Authoring tool player...
- keyCodes['delete'] = 46;
- keyCodes['0'] = 48 ;
- keyCodes['1'] = 49 ;
- keyCodes['2'] = 50 ;
- keyCodes['3'] = 51 ;
- keyCodes['4'] = 52 ;
- keyCodes['5'] = 53 ;
- keyCodes['6'] = 54 ;
- keyCodes['7'] = 55 ;
- keyCodes['8'] = 56 ;
- keyCodes['9'] = 57 ;
+}
- keyCodes[')'] = 48 ;
- keyCodes['!'] = 49 ;
- keyCodes['@'] = 50 ;
- keyCodes['#'] = 51 ;
- keyCodes['$'] = 52 ;
- keyCodes['%'] = 53 ;
- keyCodes['^'] = 54 ;
- keyCodes['&'] = 55 ;
- keyCodes['*'] = 56 ;
- keyCodes['('] = 57 ;
+/**
+ * LzKeys is a shortcut for <a href="LzKeysService.html">LzKeysService</a>.
+ */
+var LzKeys = new LzKeysService();
- keyCodes[';'] = 186 ;
- keyCodes[':'] = 186 ;
- keyCodes['='] = 187 ;
- keyCodes['+'] = 187 ;
-
- keyCodes['<'] = 188 ;
- keyCodes[','] = 188 ;
- keyCodes['-'] = 189 ;
- keyCodes['_'] = 189;
- keyCodes['>'] = 190 ;
- keyCodes['.'] = 190 ;
- keyCodes['/'] = 191 ;
- keyCodes['?'] = 191 ;
-
- keyCodes['`'] = 192 ;
- keyCodes['~'] = 192 ;
- keyCodes['['] = 219 ;
- keyCodes['{'] = 219 ;
- keyCodes['\\'] = 220 ;
- keyCodes['|'] = 220;
- keyCodes[']'] = 221 ;
- keyCodes['}'] = 221 ;
- keyCodes['\"'] = 222 ;
- keyCodes['\''] = 222 ;
-
- keyCodes['IME'] = 229 ;
-
- //for ( ks in keyCodes ){
- // trace ( ks add " : " add keyCodes[ ks ] );
- //}
-}
-
if ($swf9) {
} else {
LzKeyboardKernel.setCallback(LzKeys, '__keyEvent');
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTrack.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTrack.lzs 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTrack.lzs 2008-05-03 00:16:37 UTC (rev 8982)
@@ -365,4 +365,4 @@
/** The single instance of this class
* @access private
*/
-var LzTrack = new LzTrackClass;
+var LzTrack = new LzTrackClass();
Deleted: openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
Deleted: openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
Modified: openlaszlo/trunk/docs/src/nav/toc.xml
===================================================================
--- openlaszlo/trunk/docs/src/nav/toc.xml 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/docs/src/nav/toc.xml 2008-05-03 00:16:37 UTC (rev 8982)
@@ -90,13 +90,12 @@
<item title="handler (LzDelegate)" href="LzDelegate.html" />
<item title="event (LzEvent)" href="LzEvent.html" />
<item title="LzGlobalMouse" href="LzGlobalMouse.html" />
- <item title="LzIdleClass" href="LzIdleClass.html" />
+ <item title="LzIdle" href="LzIdle.html" />
<item title="LzKeys" href="LzKeys.html" />
- <item title="LzModeManager" href="LzModeManagerService.html" />
- <item title="LzTimer" href="LzTimerClass.html" />
- <item title="LzTrackClass" href="LzTrackClass.html" />
- <item title="LzHistory (dhtml)" href="LzHistory+dhtml.html" />
- <item title="LzHistory (swf7+swf8+swf9)" href="LzHistory+swf7+swf8+swf9.html" />
+ <item title="LzModeManager" href="LzModeManager.html" />
+ <item title="LzTimer" href="LzTimer.html" />
+ <item title="LzTrack" href="LzTrackClass.html" />
+ <item title="LzHistory" href="LzHistory.html" />
</category>
Modified: openlaszlo/trunk/lps/includes/source/lzhistory.js
===================================================================
--- openlaszlo/trunk/lps/includes/source/lzhistory.js 2008-05-02 21:37:54 UTC (rev 8981)
+++ openlaszlo/trunk/lps/includes/source/lzhistory.js 2008-05-03 00:16:37 UTC (rev 8982)
@@ -200,7 +200,7 @@
if (Lz.loaded && Lz.callMethod && h != Lz.history._lasthash) {
_this.__setFlash(h);
}
- if (Lz.__dhtmlhistoryready && LzHistory && LzHistory['receiveHistory']) {
+ if (window['LzHistory'] && LzHistory['isReady'] && LzHistory['receiveHistory']) {
//alert('dhtml ' + h);
LzHistory.receiveHistory(h);
_this._lasthash = h;
More information about the Laszlo-checkins
mailing list