[Laszlo-checkins] r12782 - in openlaszlo/branches/4.2: . WEB-INF/lps/lfc/compiler WEB-INF/lps/lfc/kernel/swf9 WEB-INF/lps/lfc/services lps/includes/source
max@openlaszlo.org
max at openlaszlo.org
Sat Feb 7 06:45:51 PST 2009
Author: max
Date: 2009-02-07 06:45:45 -0800 (Sat, 07 Feb 2009)
New Revision: 12782
Modified:
openlaszlo/branches/4.2/
openlaszlo/branches/4.2/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
openlaszlo/branches/4.2/WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as
openlaszlo/branches/4.2/WEB-INF/lps/lfc/services/LzUtils.lzs
openlaszlo/branches/4.2/lps/includes/source/embednew.js
Log:
Merged revisions 12781 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk
.......
r12781 | max | 2009-02-07 05:27:34 -0800 (Sat, 07 Feb 2009) | 22 lines
Change 20090207-maxcarlson-v by maxcarlson at Bank.local on 2009-02-07 04:48:08 PST
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Send mouseup events when mouse goes up outside the app in swf9 for Firefox on Windows
Bugs Fixed: LPP-7724 - Mouse events behave wrong in opaque mode (FireFox)
Technical Reviewer: andre.bargull at udo.edu
QA Reviewer: hminsky
Details: LzMouseKernel - Refactor processing code to separate __mouseUpOutsideHandler() method so it can be called from the browser.
LzUtils - Fix safeEval() to handle method calls with no arguments properly.
LzRuntime - Add lookup for global LzMouseKernel so safeEval() can find it in swf9.
embednew - When the mouse goes up outside the app, call LzMouseKernel.__mouseUpOutsideHandler() from the browser DOM.
Tests: See LPP-7724 on Firefox Windows
.......
Property changes on: openlaszlo/branches/4.2
___________________________________________________________________
Name: svnmerge-integrated
- /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-12154,12172-12175,12177-12185,12187-12194,12196,12201,12208,12229,12251-12252,12254-12255,12257-12258,12260,12262-12266,12268-12269,12271-12275,12278-12285,12303,12318-12323,12345,12360,12403,12420,12424,12429,12457,12473,12477,12508,12594,12596,12603,12664,12669,12675,12677,12719,12737,12752,12757,12771
+ /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-12154,12172-12175,12177-12185,12187-12194,12196,12201,12208,12229,12251-12252,12254-12255,12257-12258,12260,12262-12266,12268-12269,12271-12275,12278-12285,12303,12318-12323,12345,12360,12403,12420,12424,12429,12457,12473,12477,12508,12594,12596,12603,12664,12669,12675,12677,12719,12737,12752,12757,12771,12781
Modified: openlaszlo/branches/4.2/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
===================================================================
--- openlaszlo/branches/4.2/WEB-INF/lps/lfc/compiler/LzRuntime.lzs 2009-02-07 13:27:34 UTC (rev 12781)
+++ openlaszlo/branches/4.2/WEB-INF/lps/lfc/compiler/LzRuntime.lzs 2009-02-07 14:45:45 UTC (rev 12782)
@@ -141,8 +141,9 @@
* of the LFCApplication.
*/
var globalValue = function (name:String) {
- // remove this when LPP-7574 is fixed
+ // remove these when LPP-7574 is fixed
if (name == 'lz') return lz;
+ if (name == 'LzMouseKernel') return LzMouseKernel;
// Semi-kludge: We name our tag classes <tagname>. Since <> are
// not valid symbol constituents, there is no confusion here
if (name.charAt(0) == '<' && name.charAt(name.length-1) == '>') {
Modified: openlaszlo/branches/4.2/WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as
===================================================================
--- openlaszlo/branches/4.2/WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as 2009-02-07 13:27:34 UTC (rev 12781)
+++ openlaszlo/branches/4.2/WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as 2009-02-07 14:45:45 UTC (rev 12782)
@@ -54,18 +54,24 @@
LzMouseKernel.__lastMouseDown.__globalmouseup(event);
__lastMouseDown = null;
} else {
- if (__mouseLeft && event.buttonDown && LzMouseKernel.__lastMouseDown != null) {
+ if (__mouseLeft && event.buttonDown) {
__mouseLeft = false;
- //Debug.write(eventname, event.buttonDown, LzMouseKernel.__lastMouseDown);
- var ev = new MouseEvent('mouseup');
- LzMouseKernel.__lastMouseDown.__globalmouseup(ev);
- LzMouseKernel.__lastMouseDown = null;
+ LzMouseKernel.__mouseUpOutsideHandler();
}
LzMouseKernel.__sendEvent(null, eventname);
}
}
- // handles MOUSE_LEAVES event
+ // sends mouseup and calls __globalmouseup when the mouse goes up outside the app - see LPP-7724
+ static function __mouseUpOutsideHandler():void {
+ if (LzMouseKernel.__lastMouseDown != null) {
+ var ev = new MouseEvent('mouseup');
+ LzMouseKernel.__lastMouseDown.__globalmouseup(ev);
+ LzMouseKernel.__lastMouseDown = null;
+ }
+ }
+
+ // handles MOUSE_LEAVE event
static function __mouseLeavesHandler(event:Event):void {
var eventname = 'on' + event.type.toLowerCase();
LzMouseKernel.__mouseLeft = true;
Modified: openlaszlo/branches/4.2/WEB-INF/lps/lfc/services/LzUtils.lzs
===================================================================
--- openlaszlo/branches/4.2/WEB-INF/lps/lfc/services/LzUtils.lzs 2009-02-07 13:27:34 UTC (rev 12781)
+++ openlaszlo/branches/4.2/WEB-INF/lps/lfc/services/LzUtils.lzs 2009-02-07 14:45:45 UTC (rev 12782)
@@ -1,7 +1,7 @@
/**
* LzUtils.lzs
*
- * @copyright Copyright 2007-2008 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2007-2009 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @topic Services
@@ -248,6 +248,7 @@
// Unpack a javascript list from a string, giving each item the appropriate type
function __unpackList(argstr, scope) {
+ if (argstr == '') return [];
if (scope == null) scope = canvas;
var args = argstr.split(',');
// cast arguments to type
@@ -278,6 +279,7 @@
//Debug.write('found property', args[i], a);
}
}
+ //Debug.write('__unpackList', argstr, args);
return args;
}
@@ -286,29 +288,34 @@
var scope = canvas;
//Debug.write('callMethod', js);
var s = js.indexOf('(')
+ var argstr = null;
if (s != -1) {
var e = js.indexOf(')')
- var args = (js.substring(s + 1, e))
+ argstr = (js.substring(s + 1, e))
js = js.substring(0, s);
}
var path = js.split('.');
for (var i = 0; i < path.length; i++) {
var lastscope = scope;
- var n = path[i];
+ var val = path[i];
// look in global scope if canvas lookup fails
- if (i == 0 && ! scope[n]) {
- scope = globalValue(n);
+ if (i == 0 && ! scope[val]) {
+ scope = globalValue(val);
} else {
- scope = scope[n];
+ scope = scope[val];
}
- //Debug.write('found', n, 'in scope', scope);
+ //Debug.write('found', val, 'in scope', scope);
}
- var args = arglist == null ? lz.Utils.__unpackList(args, lastscope) : arglist;
- //var args = lz.Utils.__unpackList(args, lastscope);
+ if (argstr == null) {
+ //Debug.write('no args, found val', val);
+ return val;
+ }
- //Debug.write('found scope', scope,'in', lastscope, 'args', args, 'for path', path, arglist);
+ var args = lz.Utils.__unpackList(argstr, scope);
+
+ //Debug.write('found val', val,'in', scope, 'args', args);
// return values don't work for global scopes in swf9, e.g. 'lz.Browser.getVersion()' - see LPP-7008
var result = scope.apply(lastscope, args);
//Debug.write('result', result);
Modified: openlaszlo/branches/4.2/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/branches/4.2/lps/includes/source/embednew.js 2009-02-07 13:27:34 UTC (rev 12781)
+++ openlaszlo/branches/4.2/lps/includes/source/embednew.js 2009-02-07 14:45:45 UTC (rev 12782)
@@ -154,6 +154,24 @@
lz.embed.mousewheel.setCallback(app, '_sendMouseWheel');
}
}
+ if ((swfargs.wmode == 'transparent' || swfargs.wmode == 'opaque') && lz.embed.browser.OS == 'Windows' && (lz.embed.browser.isOpera || lz.embed.browser.isFirefox)) {
+ // fix for LPP-7724
+ var div = swfargs.appenddiv;
+ div.onmouseout = function(e) {
+ div.mouseisoutside = true;
+ }
+ div.onmouseover = function(e) {
+ div.mouseisoutside = false;
+ }
+ //lz.embed.attachEventHandler(document, 'mouseup', div, '_gotmouseup');
+ div._gotmouseup = document.onmouseup = function(e) {
+ if (div.mouseisoutside) {
+ // tell flash that the button went up outside
+ app.callMethod('LzMouseKernel.__mouseUpOutsideHandler()');
+ //console.log('mouseup ', lz.embed[app._id]);
+ }
+ }
+ }
}
,/**
More information about the Laszlo-checkins
mailing list