[Laszlo-checkins] r14068 - in openlaszlo/branches/4.4: . WEB-INF/lps/lfc/kernel/dhtml WEB-INF/lps/lfc/views
ptw@openlaszlo.org
ptw at openlaszlo.org
Fri Jun 5 12:10:42 PDT 2009
Author: ptw
Date: 2009-06-05 12:10:37 -0700 (Fri, 05 Jun 2009)
New Revision: 14068
Modified:
openlaszlo/branches/4.4/
openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js
openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
openlaszlo/branches/4.4/WEB-INF/lps/lfc/views/LzText.lzs
Log:
Merged revisions 14021-14025,14027-14032,14034,14036-14044,14046-14051,14053-14067 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk
.......
r14021 | max | 2009-05-28 14:19:38 -0400 (Thu, 28 May 2009) | 18 lines
Change 20090526-maxcarlson-v by maxcarlson at Bank on 2009-05-26 14:35:12 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Prevent stuck keys in OS X DHTML
Bugs Fixed: LPP-8210 - phantom keys marked as down in DHTML lz.Keys.downKeysArray if you use the Apple key in OSX
Technical Reviewer: hminsky
QA Reviewer: ptw
Details: LzKeyboardKernel - Track meta (apple) key in __downKeysHash. Add __keyCodes hash to store original key codes for use later - so they can be retrieved based on the string value. Prevent sending 224 - meta key events. If detectstuckkeys quirk is on (currently only OS X) detect keys that may still be down when the meta key goes up. If a stuck key was found, generate an appropriate keyup event.
LzSprite - Add detectstuckkeys quirk, enable for OS X.
Tests: lz.Keys.downKeysArray no longer has extra entries for meta keys, e.g. 'a' after pressing/releasing apple-a.
.......
r14043 | bargull | 2009-06-02 13:34:30 -0400 (Tue, 02 Jun 2009) | 29 lines
Change 20090602-bargull-GPN by bargull at dell--p4--2-53 on 2009-06-02 15:54:52
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: DHTML: add "updateControlKeys" to LzKeyboardKernel
New Features:
Bugs Fixed: LPP-8218 - DHTML: issues with contextmenu onmenuopen, dragging (partial)
Technical Reviewer: max, ptw
QA Reviewer: hqm
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Call "updateControlKeys()" instead of "__keyboardEvent()" for mouse-events.
Set "cancelBubble" and "returnValue" after invoking "updateControlKeys()" to mimic old behaviour (this is actually wrong, see LPP-8200, but reduces testing effort right now). "keyCode" is set to 0 for mouse-events in IE, Opera, Safari, so you only need to test for keyCode==0 (Firefox is irrelevant in this case, because it sets keyCode to `undefined` for mouse-events).
Tests:
test/lfc/legals/keyboardandmouse.lzx?lzr=dhtml still works as expected
.......
r14047 | bargull | 2009-06-02 16:51:27 -0400 (Tue, 02 Jun 2009) | 25 lines
Change 20090602-bargull-fI3 by bargull at dell--p4--2-53 on 2009-06-02 21:58:33
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: move stuck-key detection to updateControlKeys()
New Features:
Bugs Fixed: LPP-8218 - DHTML: issues with contextmenu onmenuopen, dragging (partial)
Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Moved stuck-key detection from keyboardEvent() to updateControlKeys().
Tests:
.......
r14067 | hqm | 2009-06-05 11:34:49 -0400 (Fri, 05 Jun 2009) | 58 lines
Change 20090605-hqm-Q by hqm at badtzmaru.home on 2009-06-05 11:30:43 EDT
in /Users/hqm/openlaszlo/trunk5
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: fix for text selection in DHTML
New Features:
Bugs Fixed: LPP-8200
Technical Reviewer: max
QA Reviewer: andre
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
+ LzSprite.js: only toggle the focus in focus_on_mouseover quirk when there is some text selected.
+ LzKeyboardKernel.js: Instead of cancelling a mouse event completely,
just cancel bubbling. This lets the div handle the event, and allows
text selection to work, but should disable it from propagating to
global handlers.
+ LzTextSprite.js: use correct CSS properties for toggling selectability, in Safari
+ LzInputTextSprite.js: do not bind the global document.onselectstart handler, that prevents
text selection from working in some browsers
+ LzText.lzs: add the 'onselectable' event, not required for this
patch, but I noticed it was missing when writing a test case
Tests:
+ added lpp-8200.lzx test, try selecting a region in each the text
fields, except for the last (non-selectable) one.
+ text selection should work in DHTML on selectable text or input text, all
browsers
+ tested tabbing behavior of examples/components/component_sampler.lzx?lzt=html&lzr=dhtml
in IE7, FF3(OSX), Safari(OSX). You can tab to all input text elements. This is based on the
original comment from [r2943 | max | 2006-12-06 23:49:36 -0500 (Wed, 06 Dec 2006) ]
Tests: Tabbing to select inputtexts and typing now works for for the
testcase for LPP-3197 and
http://localhost:8080/legals/examples/components/style_example.lzx?lzr=dhtml.
LzKeyboardKernel.js prevents bubbling for tab key events.
LzMouseKernel.js has more safety checking. LzInputTextSprite.js now
implements focusing and blurringi, selection and deselection properly.
LzTextSprite.js and LzInputTextSprite.js now track global UID
properly.
.......
Property changes on: openlaszlo/branches/4.4
___________________________________________________________________
Name: svnmerge-integrated
- /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/4.2:1-12154,12181,13205,13778 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554,13476,13629 /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-13937,13948-13952,13954-13968,13970,13972-13980,13982-13985,13987-14002,14026,14052
+ /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/4.2:1-12154,12181,13205,13778 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554,13476,13629 /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-13937,13948-13952,13954-13968,13970,13972-13980,13982-13985,13987-14002,14021-14032,14034,14036-14044,14046-14067
Modified: openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js 2009-06-05 15:34:49 UTC (rev 14067)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js 2009-06-05 19:10:37 UTC (rev 14068)
@@ -244,7 +244,11 @@
//Debug.warn('__show', this.owner);
// turn on text selection in IE
// can't use lz.embed.attachEventHandler because we need to cancel events selectively
- document.onselectstart = null;
+ if (lz.embed.browser.isIE) {
+ //this.__LZdiv.onselectstart = null;
+ this.__LZdiv.onselectstart = null;
+ }
+
}
LzInputTextSprite.prototype.__hideIfNotFocused = function(eventname, target) {
@@ -343,7 +347,9 @@
// turn off text selection in IE
// can't use lz.embed.attachEventHandler because we need to cancel events selectively
if (LzInputTextSprite.prototype.__lastshown == null) {
- document.onselectstart = LzTextSprite.prototype.__cancelhandler;
+ if (lz.embed.browser.isIE) {
+ this.__LZdiv.onselectstart = LzTextSprite.prototype.__cancelhandler
+ }
}
}
@@ -1061,7 +1067,3 @@
}
}
-// prevent text selection in IE
-// can't use lz.embed.attachEventHandler because we need to cancel events
-document.onselectstart = LzTextSprite.prototype.__cancelhandler;
-document.ondrag = LzTextSprite.prototype.__cancelhandler;
Modified: openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js 2009-06-05 15:34:49 UTC (rev 14067)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzKeyboardKernel.js 2009-06-05 19:10:37 UTC (rev 14068)
@@ -10,75 +10,138 @@
*/
// Receives keyboard events from the runtime
-var LzKeyboardKernel = {
- __downKeysHash: {alt: false, control: false, shift: false}
- ,__keyboardEvent: function ( e ){
+var LzKeyboardKernel = {
+ __downKeysHash: {alt: false, control: false, shift: false, meta: false}
+ ,__keyCodes: {}
+ ,__keyboardEvent: function ( e ){
if (!e) e = window.event;
var delta = {};
var dirty = false;
var k = e['keyCode'];
- var t = e.type;
+ var t = e.type;
var dh = LzKeyboardKernel.__downKeysHash;
// TODO: really, all control characters should be skipped...
// skip shift, ctrl, option keys to prevent duplicate sending - see LPP-4267
- if (k >= 0 && k != 16 && k != 17 && k != 18) {
+ if (k >= 0 && k != 16 && k != 17 && k != 18 && k != 224) {
// TODO: add mapping to flash character codes?
var s = String.fromCharCode(k).toLowerCase();
+ LzKeyboardKernel.__keyCodes[s] = k;
if (t == 'keyup') {
if (dh[s] != false) {
delta[s] = false;
dirty = true;
- }
+ }
dh[s] = false;
} else if (t == 'keydown') {
if (dh[s] != true) {
- delta[s] = true;
+ delta[s] = true;
dirty = true;
- }
+ }
dh[s] = true;
- }
- }
- if (dh['alt'] != e['altKey']) {
- delta['alt'] = e['altKey'];
- dirty = true;
- if (LzSprite.prototype.quirks['alt_key_sends_control']) {
- delta['control'] = delta['alt'];
}
- }
- if (dh['control'] != e['ctrlKey']) {
- delta['control'] = e['ctrlKey'];
+ }
+
+ if (LzKeyboardKernel.__updateControlKeys(e, delta)) {
dirty = true;
- }
- if (dh['shift'] != e['shiftKey']) {
- delta['shift'] = e['shiftKey'];
- dirty = true;
- }
+ }
- dh['alt'] = e['altKey']
- dh['control'] = e['ctrlKey']
- dh['shift'] = e['shiftKey']
- if (dirty && LzKeyboardKernel.__scope && LzKeyboardKernel.__scope[LzKeyboardKernel.__callback]) {
- LzKeyboardKernel.__scope[LzKeyboardKernel.__callback](delta, k, 'on' + t);
- }
-
+ if (dirty) {
+ var scope = LzKeyboardKernel.__scope;
+ var callback = LzKeyboardKernel.__callback;
+ if (scope && scope[callback]) {
+ scope[callback](delta, k, 'on' + t);
+ }
+ }
+
// cancel bubbling
if (k >= 0) {
if (k == 9) {
//Debug.write('canceling tab');
e.cancelBubble = true;
- e.returnValue = false;
return false;
} else if (LzKeyboardKernel.__cancelKeys && (k == 13 || k == 0 || k == 37 || k == 38 || k == 39 || k == 40) ) {
//Debug.write('canceling key', k, t);
// cancel event bubbling for enter, space(scroll) and arrow keys
e.cancelBubble = true;
- e.returnValue = false;
return false;
- }
- }
+ }
+ }
//Debug.write('downKeysHash', t, k, dh, delta);
}
+ ,__updateControlKeys: function (e, delta) {
+ var quirks = LzSprite.prototype.quirks;
+ var dh = LzKeyboardKernel.__downKeysHash;
+ var dirty = false;
+ if (delta) {
+ var send = false;
+ } else {
+ // Called with mouse-event, see LzSprite, LzMouseKernel
+ delta = {};
+ var send = true;
+ }
+ var alt = e['altKey'];
+ if (dh['alt'] != alt) {
+ delta['alt'] = alt;
+ dirty = true;
+ if (quirks['alt_key_sends_control']) {
+ delta['control'] = delta['alt'];
+ }
+ }
+ var ctrl = e['ctrlKey'];
+ if (dh['control'] != ctrl) {
+ delta['control'] = ctrl;
+ dirty = true;
+ }
+ var shift = e['shiftKey'];
+ if (dh['shift'] != shift) {
+ delta['shift'] = shift;
+ dirty = true;
+ }
+ var stuck;
+ var meta = e['metaKey'];
+ if (quirks['detectstuckkeys']) {
+ // see LPP-8210
+ if (dh['meta'] != meta) {
+ // look for stuck keys
+ delta['control'] = meta;
+ dirty = true;
+ if (! meta) {
+ for (var key in dh) {
+ if (key == 'control' || key == 'shift' || key == 'alt' || key == 'meta') continue;
+ stuck = key;
+ delete dh[key];
+ }
+ }
+ }
+ }
+ dh['alt'] = alt;
+ dh['control'] = ctrl;
+ dh['shift'] = shift;
+ dh['meta'] = meta;
+
+ if (dirty && (send || stuck)) {
+ var scope = LzKeyboardKernel.__scope;
+ var callback = LzKeyboardKernel.__callback;
+ if (scope && scope[callback]) {
+ //console.log(t, s, k, delta, e.metaKey, e.ctrlKey, dh);
+ if (stuck) {
+ // console.log('stuck key', key, keycode);
+ var keycode = LzKeyboardKernel.__keyCodes[stuck];
+ var fakedelta = {};
+ // FIXME: [20090602 anba] 'key' seems to be a typo, should it be 'stuck'?
+ fakedelta[key] = false;
+ scope[callback](fakedelta, keycode, 'onkeyup');
+ }
+
+ if (send) {
+ scope[callback](delta, 0, 'on' + e.type);
+ }
+ }
+ }
+
+ return dirty;
+ }
,__callback: null
,__scope: null
,__cancelKeys: true
@@ -86,7 +149,7 @@
,setCallback: function (scope, keyboardcallback) {
this.__scope = scope;
this.__callback = keyboardcallback;
- }
+ }
,setKeyboardControl: function (dhtmlKeyboardControl, force) {
if (! force && LzKeyboardKernel.__lockFocus) {
dhtmlKeyboardControl = true;
@@ -97,9 +160,10 @@
//console.log('setKeyboardControl' + dhtmlKeyboardControl);
handler = LzKeyboardKernel.__keyboardEvent;
}
- if ( LzInputTextSprite.prototype.__focusedSprite ) {
+ var lzinputproto = LzInputTextSprite.prototype;
+ if (lzinputproto.__focusedSprite) {
// hide any focused inputtexts
- LzInputTextSprite.prototype.__focusedSprite.__hideIfNotFocused();
+ lzinputproto.__hideIfNotFocused();
}
// can't use lz.embed.attachEventHandler because we need to cancel events selectively
if (LzSprite.prototype.quirks.keyboardlistentotop) {
Modified: openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js 2009-06-05 15:34:49 UTC (rev 14067)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js 2009-06-05 19:10:37 UTC (rev 14068)
@@ -26,20 +26,26 @@
var targ = e.target;
}
var eventname = 'on' + e.type;
- if (window['LzKeyboardKernel'] && LzKeyboardKernel['__keyboardEvent']) LzKeyboardKernel.__keyboardEvent(e);
- if (window['LzInputTextSprite'] && LzInputTextSprite.prototype.__lastshown != null) {
+
+ // send option/shift/ctrl key events
+ if (window['LzKeyboardKernel'] && LzKeyboardKernel['__updateControlKeys']) {
+ LzKeyboardKernel.__updateControlKeys(e);
+ }
+
+ // check source.owner of event, see if textfield and selectable, then don't cancel event
+
+ var lzinputproto = window['LzInputTextSprite'] && LzInputTextSprite.prototype;
+ if (lzinputproto && lzinputproto.__lastshown != null) {
if (LzSprite.prototype.quirks.fix_ie_clickable) {
- LzInputTextSprite.prototype.__lastshown.__hideIfNotFocused(eventname, targ);
+ lzinputproto.__hideIfNotFocused(eventname, targ);
} else if (eventname != 'onmousemove') {
- LzInputTextSprite.prototype.__lastshown.__hideIfNotFocused();
+ lzinputproto.__hideIfNotFocused();
}
}
+
if (eventname == 'onmousemove') {
LzMouseKernel.__sendMouseMove(e);
- return;
- }
-
- if (eventname == 'oncontextmenu' || (e.button == 2 && eventname == 'onmouseup') ) {
+ } else if (eventname == 'oncontextmenu' || (e.button == 2 && eventname == 'onmouseup') ) {
if (targ) {
// update mouse position, required for Safari
LzMouseKernel.__sendMouseMove(e);
@@ -72,7 +78,7 @@
// handles global mouseup events
,__mouseupEvent: function (e) {
if (LzMouseKernel.__lastMouseDown != null) {
- // call mouseup on the sprite that got the last mouse down
+ // call mouseup on the sprite that got the last mouse down
LzMouseKernel.__lastMouseDown.__globalmouseup(e);
} else {
LzMouseKernel.__mouseEvent(e);
Modified: openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2009-06-05 15:34:49 UTC (rev 14067)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2009-06-05 19:10:37 UTC (rev 14068)
@@ -100,7 +100,9 @@
div.mouseisover = false;
div.onmouseover = function(e) {
if (LzSprite.prototype.quirks.focus_on_mouseover) {
- div.focus();
+ if (LzSprite.prototype.getSelectedText() == null) {
+ div.focus();
+ }
}
if (LzInputTextSprite.prototype.__focusedSprite == null) LzKeyboardKernel.setKeyboardControl(true);
LzMouseKernel.setMouseControl(true);
@@ -142,7 +144,11 @@
LzInputTextSprite.prototype.__setglobalclickable(true);
}
if (quirks.focus_on_mouseover) {
- if (LzInputTextSprite.prototype.__lastshown == null) div.focus();
+ if (LzInputTextSprite.prototype.__lastshown == null) {
+ if (LzSprite.prototype.getSelectedText() == null) {
+ div.focus();
+ }
+ }
}
LzKeyboardKernel.setKeyboardControl(true);
LzMouseKernel.setMouseControl(true);
@@ -150,7 +156,11 @@
this.mouseisover = true;
} else {
if (quirks.focus_on_mouseover) {
- if (LzInputTextSprite.prototype.__lastshown == null) div.blur();
+ if (LzInputTextSprite.prototype.__lastshown == null) {
+ if (LzSprite.prototype.getSelectedText() == null) {
+ div.blur();
+ }
+ }
}
LzKeyboardKernel.setKeyboardControl(false);
LzMouseKernel.setMouseControl(false);
@@ -498,6 +508,7 @@
,inputtext_anonymous_div: false
,clipped_scrollbar_causes_display_turd: false
,textgrabsinputtextfocus: false
+ ,detectstuckkeys: false
}
LzSprite.prototype.capabilities = {
@@ -695,6 +706,11 @@
}
}
+ if (browser.OS == 'Mac') {
+ // see LPP-8210
+ quirks['detectstuckkeys'] = true;
+ }
+
// Adjust styles for quirks
var defaultStyles = LzSprite.prototype.__defaultStyles;
var tc = defaultStyles.lztextcontainer;
@@ -1161,9 +1177,17 @@
var eventname = e;
e = {};
} else {
+ var eventname = 'on' + e.type;
// send option/shift/ctrl key events
- var eventname = 'on' + e.type;
- if (LzKeyboardKernel && LzKeyboardKernel['__keyboardEvent']) LzKeyboardKernel.__keyboardEvent(e);
+ if (LzKeyboardKernel && LzKeyboardKernel['__updateControlKeys']) {
+ LzKeyboardKernel.__updateControlKeys(e);
+
+ // FIXME: [20090602 anba] this prevents text selection, see LPP-8200
+ if (LzKeyboardKernel.__cancelKeys && e.keyCode == 0) {
+ e.cancelBubble = true;
+ e.returnValue = false;
+ }
+ }
}
if (this.quirks.ie_mouse_events) {
@@ -2340,3 +2364,17 @@
}
lz.embed.attachEventHandler(window, 'beforeunload', window, '__cleanUpForIE');
}
+
+// Get any selected text
+LzSprite.prototype.getSelectedText = function () {
+ var txt = '';
+ if (window.getSelection) { // FF/Safari/Opera/Chrome
+ return window.getSelection();
+ } else if (document.selection) { // IE7
+ return document.selection.createRange().text;
+ } else if (document.getSelection) { // others
+ return document.getSelection();
+ } else {
+ return null;
+ }
+}
Modified: openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js 2009-06-05 15:34:49 UTC (rev 14067)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js 2009-06-05 19:10:37 UTC (rev 14068)
@@ -540,16 +540,28 @@
LzTextSprite.prototype.setSelectable = function (s) {
this.selectable = s;
//Debug.write('setSelectable', s, this.__LZdiv.style);
+ var browser = lz.embed.browser;
+
if (s) {
- this.__LZdiv.onselectstart = null;
- this.__LZdiv.style['MozUserSelect'] = 'normal';
- this.__LZdiv.style['KHTMLUserSelect'] = 'normal';
- this.__LZdiv.style['UserSelect'] = 'normal';
+ if (browser.isIE) {
+ this.__LZdiv.onselectstart = null;
+ } else if (browser.isFirefox) {
+ this.__LZdiv.style['MozUserSelect'] = 'text';
+ } else if (browser.isSafari) {
+ this.__LZdiv.style['WebkitUserSelect'] = 'text';
+ } else {
+ this.__LZdiv.style['UserSelect'] = 'text';
+ }
} else {
- this.__LZdiv.onselectstart = LzTextSprite.prototype.__cancelhandler;
- this.__LZdiv.style['MozUserSelect'] = 'none';
- this.__LZdiv.style['KHTMLUserSelect'] = 'none';
- this.__LZdiv.style['UserSelect'] = 'none';
+ if (browser.isIE) {
+ this.__LZdiv.onselectstart = LzTextSprite.prototype.__cancelhandler;
+ } else if (browser.isFirefox) {
+ this.__LZdiv.style['MozUserSelect'] = 'none';
+ } else if (browser.isSafari) {
+ this.__LZdiv.style['WebkitUserSelect'] = 'none';
+ } else {
+ this.__LZdiv.style['UserSelect'] = 'none';
+ }
}
}
Modified: openlaszlo/branches/4.4/WEB-INF/lps/lfc/views/LzText.lzs
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/views/LzText.lzs 2009-06-05 15:34:49 UTC (rev 14067)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/views/LzText.lzs 2009-06-05 19:10:37 UTC (rev 14068)
@@ -142,10 +142,15 @@
* @type Boolean
*/
var selectable = false;
+
+ /** @lzxtype event */
+ var onselectable:LzDeclaredEventClass = LzDeclaredEvent;
+
/** @access private */
function $lzc$set_selectable(isSel) {
this.selectable = isSel;
this.tsprite.setSelectable(isSel);
+ if (this.onselectable.ready) this.onselectable.sendEvent(isSel);
}
/*
More information about the Laszlo-checkins
mailing list