Author: max
Date: 2007-01-23 18:36:57 -0800 (Tue, 23 Jan 2007)
New Revision: 3500

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs
   openlaszlo/branches/legals/test/smoke/lztext.lzl
Log:
Change 20070123-maxcarlson-r by [EMAIL PROTECTED] on 2007-01-23 15:29:34 PST
    in /Users/maxcarlson/openlaszlo/legals

Summary: Fix getText() for inputtext

New Features:

Bugs Fixed:

Technical Reviewer: promanik
QA Reviewer: hminsky
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: I broke this - serious brain-oh.  I shouldn't have removed getText() 
from intputtext...

lztext.lzl - changed inputtext to multiline, fixed test to handle different 
vlaues for dhtml and swf

LzInputTextSprite.as - added back getText()

LzInputTextSprite.js - added back getText()

LzInputText.lzs - added back getText()

Tests: http://localhost:8080/legals/test/smoke/smokecheck.lzx?lzr=swf7 and 
http://localhost:8080/legals/test/smoke/smokecheck.lzx?lzr=dhtml both pass, can 
type search terms into lzpix again.

Files:
M      test/smoke/lztext.lzl
M      WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as
M      WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
M      WEB-INF/lps/lfc/views/LzInputText.lzs

Changeset: 
http://svn.openlaszlo.org/openlaszlo/patches/20070123-maxcarlson-r.tar

Modified: 
openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
===================================================================
--- 
openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js    
    2007-01-24 00:24:43 UTC (rev 3499)
+++ 
openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js    
    2007-01-24 02:36:57 UTC (rev 3500)
@@ -277,6 +277,10 @@
     this.__LzInputDiv.style.color = this.getColor(c);
 }
 
+LzInputTextSprite.prototype.getText = function () {
+    return this.__LzInputDiv.value;
+}
+
 LzInputTextSprite.prototype.getTextfieldHeight = function () {
     if (this.fieldHeight != null) return this.fieldHeight
     if (this.text == null || this.text == '') {

Modified: 
openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as  
2007-01-24 00:24:43 UTC (rev 3499)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as  
2007-01-24 02:36:57 UTC (rev 3500)
@@ -335,3 +335,7 @@
     //@event ontext: Sent whenever the text in the field changes.
     //this.owner.ontext.sendEvent(t);
 }
+
+LzTextSprite.prototype.getText = function ( ){
+    return this.__LZtextclip.text;
+}

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs    
2007-01-24 00:24:43 UTC (rev 3499)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs    
2007-01-24 02:36:57 UTC (rev 3500)
@@ -233,4 +233,8 @@
     this.ontext.sendEvent(t);
 }
 
+function getText ( ){
+    return this.sprite.getText();    
+}
+
 } // End of LzInputText

Modified: openlaszlo/branches/legals/test/smoke/lztext.lzl
===================================================================
--- openlaszlo/branches/legals/test/smoke/lztext.lzl    2007-01-24 00:24:43 UTC 
(rev 3499)
+++ openlaszlo/branches/legals/test/smoke/lztext.lzl    2007-01-24 02:36:57 UTC 
(rev 3500)
@@ -5,12 +5,20 @@
 * X_LZ_COPYRIGHT_END ****************************************************** -->
   <class name="LzTextTest" extends="TestCase">
     <method name="testInputText">
-    var inp = new LzInputText(canvas, {x: 100, y: 100, width: 200});
+    // must be multiline for multiline getText() to work in DHTML 
+    var inp = new LzInputText(canvas, {x: 100, y: 100, width: 200, multiline: 
true});
     inp.setText("foo\n\nbar");
     // test getText() not eating newlines
+    if ($dhtml) {
         assertEquals("foo\n\nbar", inp.getText());    
         inp.setText(inp.getText() + "\nbaz\nfoo    whitespace\nbar.");
         assertEquals("foo\n\nbar\nbaz\nfoo    whitespace\nbar.", 
inp.getText());
+    } else {
+        // SWF returns \r instead of \n...
+        assertEquals("foo\r\rbar", inp.getText());    
+        inp.setText(inp.getText() + "\nbaz\nfoo    whitespace\nbar.");
+        assertEquals("foo\r\rbar\rbaz\rfoo    whitespace\rbar.", 
inp.getText());
+    }
     </method>
   </class>
 </library>


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to