Author: max
Date: 2007-09-07 13:08:13 -0700 (Fri, 07 Sep 2007)
New Revision: 6401

Added:
   openlaszlo/branches/wafflecone/lps/includes/source/lzhistory.js
Modified:
   
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
   
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
   openlaszlo/branches/wafflecone/lps/includes/source/embed-library.lzs
   openlaszlo/branches/wafflecone/lps/includes/source/embednew.js
   openlaszlo/branches/wafflecone/test/history/simple-states.lzx
Log:
Change 20070906-maxcarlson-m by [EMAIL PROTECTED] on 2007-09-06 19:07:18 PDT
    in /Users/maxcarlson/openlaszlo/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Add history support for IE

New Features:

Bugs Fixed: LPP-4655 (partial)

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

Documentation:

Release Notes:

Details: LzHistory.as - Update to use Lz.history.set().

LzHistory.rs - Update to use Lz.history.set().

embednew.js - Use Lz.history._store() for setCanvasAttribute() calls with 
history.  Refactored history-related methods to lzhistory.js.

lzhistory.js - Refectored history-related methods from embednew.js.  Added 
support for IE, initial support for Safari.

Tests: 
http://localhost:8080/wafflecone/test/history/history.lzx?lzr=dhtml&lzt=html 
and http://localhost:8080/wafflecone/test/history/history.lzx?lzr=swf7&lzt=html 
work as before in Firefox, and now work in IE 6 and 7.



Modified: 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
===================================================================
--- 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
 2007-09-07 19:44:24 UTC (rev 6400)
+++ 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
 2007-09-07 20:08:13 UTC (rev 6401)
@@ -36,7 +36,7 @@
   */
 LzHistory.setHistory = function(s) {
     //Debug.write('setHistory', s);
-    Lz._setHash(s);
+    Lz.history.set(s);
     this.__lzloading = true;
 }
 

Modified: 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
===================================================================
--- 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
   2007-09-07 19:44:24 UTC (rev 6400)
+++ 
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
   2007-09-07 20:08:13 UTC (rev 6401)
@@ -37,7 +37,7 @@
 LzHistory.__setHistory = function(s) {
     //Debug.write('__setHistory', s);
     LzBrowser._jsreset();
-    LzBrowser.callJS('Lz._setHash("' + s + '")', false);
+    LzBrowser.callJS('Lz.history.set("' + s + '")', false);
     this.__lzloading = true;
 }
 

Modified: openlaszlo/branches/wafflecone/lps/includes/source/embed-library.lzs
===================================================================
--- openlaszlo/branches/wafflecone/lps/includes/source/embed-library.lzs        
2007-09-07 19:44:24 UTC (rev 6400)
+++ openlaszlo/branches/wafflecone/lps/includes/source/embed-library.lzs        
2007-09-07 20:08:13 UTC (rev 6401)
@@ -8,6 +8,7 @@
 #include "flash.js"
 #include "embednew.js"
 #include "iframemanager.js"
+#include "lzhistory.js"
 // Copyright 2007 Laszlo Systems, Inc.  All Rights Reserved.  Use is
 // subject to license terms.
 

Modified: openlaszlo/branches/wafflecone/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/branches/wafflecone/lps/includes/source/embednew.js      
2007-09-07 19:44:24 UTC (rev 6400)
+++ openlaszlo/branches/wafflecone/lps/includes/source/embednew.js      
2007-09-07 20:08:13 UTC (rev 6401)
@@ -332,17 +332,7 @@
     _setCanvasAttributeSWF: function (name, value, hist) {
         if (dojo.flash.ready) {
             if (hist) {
-                if (name instanceof Array) {
-                    var o = '';
-                    for (var i = 0; i < name.length; i = i + 2) {
-                        o += escape(name[i]) + '=' + escape(name[i + 1]) +'';
-                        if (i < name.length - 2) o += ',';
-                    }
-                } else {
-                    var o = escape(name) + '=' + escape(value) +'';
-                }
-                window.top.location.hash = '_lz' + o;
-                //window.frames['_lzhist'].location = newurl;
+                Lz.history._store(name, value);
             } else {
                 dojo.flash.comm.setCanvasAttribute(name, value + '');
             }
@@ -366,17 +356,7 @@
      */
     _setCanvasAttributeDHTML: function (name, value, hist) {
         if (hist) {
-            if (name instanceof Array) {
-                var o = '';
-                for (var i = 0; i < name.length; i = i + 2) {
-                    o += escape(name[i]) + '=' + escape(name[i + 1]) +'';
-                    if (i < name.length - 2) o += ',';
-                }
-            } else {
-                var o = escape(name) + '=' + escape(value) +'';
-            }
-            window.top.location.hash = '_lz' + o;
-            //window.frames['_lzhist'].location = newurl;
+            Lz.history._store(name, value);
         } else if (canvas) {
             canvas.setAttribute(name, value);
         }
@@ -553,60 +533,7 @@
             return dojo.flash.comm.callMethod(js);
         }
     }
-
     ,/** @access private */
-    _historyEvent: function (value) {
-        if (dojo.flash.ready) {
-            //alert(value);
-            dojo.flash.comm.receiveHistory(value + '');
-            return true;
-        } else {
-            //alert('dojo.flash is not ready: _historyEvent' + value);
-        }
-    }
-
-    ,/** @access private */
-    _checklocationhash: function() {
-        var h = window.top.location.hash;
-        // Make sure initial history event is sent even if the hash is empty
-        if (h == '') h = '#0';
-        if (h != this.__lasthash && h.length > 1) {
-            if (h.indexOf('_lz') != -1) {
-                this.__lasthash = h;
-                h = h.substring(4);
-                var a = h.split(',');
-                for (var j = 0; j < a.length; j++) {
-                    var v = a[j];
-                    var i = v.indexOf('=');
-                    var name = unescape(v.substring(0, i));
-                    var val = unescape(v.substring(i + 1));
-                    this.setCanvasAttribute(name, val);
-                    if (Lz.__dhtmlhistoryready) canvas.setAttribute(name, val);
-                }
-            } else {
-                //history id
-                var ev = h.substring(1);
-                if (Lz._historyEvent(ev)) {
-                    // if successful, don't send again 
-                    Lz.__lasthash = h;
-                }
-                if (Lz.__dhtmlhistoryready) {
-                    LzHistory.receiveHistory(ev + '');
-                    Lz.__lasthash = h;
-                }
-            }
-        }
-    }
-    ,/** @access private */
-    _callHistoryEvent: function(ev, h) {
-        //alert(ev + ', ' + h);
-        
-    }
-    ,/** @access private */
-    _setHash: function(s) {
-        window.top.location.hash = s;
-    }
-    ,/** @access private */
     _getAppendDiv: function(id, appenddivid) {
         var divid = appenddivid ? appenddivid : id + 'Container';
         var root = document.getElementById(divid);
@@ -616,9 +543,4 @@
         }
         return root;
     }
-    ,/** @access private */
-    _checkHistory: function() {
-        window.setInterval('Lz._checklocationhash()', 300)
-    }
-};
-window.onload = Lz._checkHistory;
+}

Added: openlaszlo/branches/wafflecone/lps/includes/source/lzhistory.js


Property changes on: 
openlaszlo/branches/wafflecone/lps/includes/source/lzhistory.js
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: openlaszlo/branches/wafflecone/test/history/simple-states.lzx
===================================================================
--- openlaszlo/branches/wafflecone/test/history/simple-states.lzx       
2007-09-07 19:44:24 UTC (rev 6400)
+++ openlaszlo/branches/wafflecone/test/history/simple-states.lzx       
2007-09-07 20:08:13 UTC (rev 6401)
@@ -68,7 +68,7 @@
 
     <method name="recordState" args="newstate">
       this.mystate = newstate;
-      LzHistory.save(this,'mystate', this.mystate);
+      LzHistory.save('main','mystate', this.mystate);
       Debug.write("recordState", newstate, "LzHistory.offset 
"+LzHistory.offset)
     </method>
 
@@ -91,3 +91,7 @@
   <text text="${LzHistory.offset}"/>
 
 </canvas>
+<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
+* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Use is subject to license terms.                                            *
+* X_LZ_COPYRIGHT_END ****************************************************** -->


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

Reply via email to