[Laszlo-checkins] r12010 - in openlaszlo/trunk/WEB-INF/lps/lfc/kernel: dhtml swf swf9

hqm@openlaszlo.org hqm at openlaszlo.org
Mon Dec 8 11:53:56 PST 2008


Author: hqm
Date: 2008-12-08 11:53:54 -0800 (Mon, 08 Dec 2008)
New Revision: 12010

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzLibrary.js
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLibraryLoader.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLibrary.as
Log:
Change 20081208-hqm-x by hqm at badtzmaru.home on 2008-12-08 14:48:50 EST
    in /Users/hqm/openlaszlo/trunk4
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: support for appending query string to attribute 'href' when loading  of an import library

New Features:

Bugs Fixed: LPP-7402

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

Documentation:

Release Notes:

Details:

+ this supports the previously unsupported feature of adding a query string to the
href property of a loadable library. This feature is used by a customer to support versioning
of libraries
    

Tests:

test case attached in bug, in swf8,swf9,dhtml



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzLibrary.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzLibrary.js	2008-12-08 19:51:24 UTC (rev 12009)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzLibrary.js	2008-12-08 19:53:54 UTC (rev 12010)
@@ -130,16 +130,28 @@
   if (this.onload.ready) this.onload.sendEvent(true);
 }
 
+/** @access private
+ */
+static function stripQueryString(str:String):String {
+    if (str.indexOf('?') > 0) {
+        str = str.substring(0,str.indexOf('?'));
+    }
+    return str;
+}
+
 /**
   * Callback for runtime loaded libraries
   * @access private
   */
 static function __LZsnippetLoaded (url){
     // find the lib with this url
+    // Strip out query string
+    url = LzLibrary.stripQueryString(url);
     var lib = null;
     var libs = LzLibrary.libraries;
     for (var l in libs ) {
-        if (libs[l].href == url) {
+        var libhref = LzLibrary.stripQueryString(libs[l].href);
+        if (libhref == url) {
             lib = libs[l];
             break;
         }
@@ -149,7 +161,7 @@
         Debug.error("could not find library with href", url);
     } else {
         lib.loaded = true;
-        canvas.LzInstantiateView({attrs: {libname: lib.name}, "class": LzLibraryCleanup}, 1);
+        canvas.initiatorAddNode({attrs: {libname: lib.name}, "class": LzLibraryCleanup}, 1);
         // Run the queue to instantiate all pending LzInstantiateView calls.
         canvas.initDone();
     }

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLibraryLoader.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLibraryLoader.lzs	2008-12-08 19:51:24 UTC (rev 12009)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLibraryLoader.lzs	2008-12-08 19:53:54 UTC (rev 12010)
@@ -79,8 +79,7 @@
         lib.loaded = true;
     }
 
-    canvas.LzInstantiateView({attrs: {libname: lib.name}, "class": LzLibraryCleanup}, 1);
-    
+    canvas.initiatorAddNode({attrs: {libname: lib.name}, "class": LzLibraryCleanup}, 1);
     // Run the queue to instantiate all pending LzInstantiateView calls.
     canvas.initDone();
 }

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLibrary.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLibrary.as	2008-12-08 19:51:24 UTC (rev 12009)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzLibrary.as	2008-12-08 19:53:54 UTC (rev 12010)
@@ -183,16 +183,28 @@
   if (this.onload.ready) this.onload.sendEvent(true);
 }
 
+/** @access private
+ */
+static function stripQueryString(str:String):String {
+    if (str.indexOf('?') > 0) {
+        str = str.substring(0,str.indexOf('?'));
+    }
+    return str;
+}
+
 /**
   * Callback for runtime loaded libraries
   * @access private
   */
 static function __LZsnippetLoaded (url){
     // find the lib with this url
+    // Strip out query string
+    url = LzLibrary.stripQueryString(url);
     var lib = null;
     var libs = LzLibrary.libraries;
     for (var l in libs ) {
-        if (libs[l].href == url) {
+        var libhref = LzLibrary.stripQueryString(libs[l].href);
+        if (libhref == url) {
             lib = libs[l];
             break;
         }



More information about the Laszlo-checkins mailing list