Changeset 9877

Show
Ignore:
Timestamp:
07/31/07 01:33:20 (18 months ago)
Author:
alex
Message:

style nits. comments and docs need fixing badly. Fixes #1837

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/back.js

    r9848 r9877  
    2929                        last = initialState; 
    3030                } 
    31                 if (last){ 
     31                if(last){ 
    3232                        if(last.kwArgs["back"]){ 
    3333                                last.kwArgs["back"](); 
     
    8787                }; 
    8888        }else{ 
    89                 getHash = function() { return window.location.hash; }; 
    90         } 
    91  
    92         function setHash(h) { 
     89                getHash = function(){ return window.location.hash; }; 
     90        } 
     91 
     92        function setHash(h){ 
    9393                if(!h) { h = "" }; 
    94                 if(h.charAt(0) == "#") { h = h.substring(1); } 
     94                if(h.charAt(0) == "#"){ h = h.substring(1); } 
    9595                window.location.hash = h; 
    9696                historyCounter = history.length; 
     
    9999        function loadIframeHistory(){ 
    100100                //summary: private method. Do not call this directly. 
    101                 var url = (djConfig["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html")) + "?" + (new Date()).getTime(); 
     101                var url = (djConfig["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html")) + "?domain="+encodeURIComponent(document.domain) + "&" + (new Date()).getTime(); 
    102102                moveForward = true; 
    103103        if (historyIframe) { 
     
    109109        } 
    110110 
    111         function checkLocation() { 
     111        function checkLocation(){ 
    112112                console.debug("checking url"); 
    113113                if(!changingUrl){ 
     
    150150                //summary: Initializes the undo stack. This must be called from a <script>  
    151151                //         block that lives inside the <body> tag to prevent bugs on IE. 
     152 
     153                // FIXME: should this function prevent re-init? 
    152154                var src = djConfig["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html"); 
    153155                document.write('<iframe style="border:0;width:1px;height:1px;position:absolute;visibility:hidden;bottom:0;right:0;" name="dj_history" id="dj_history" src="' + src + '"></iframe>'); 
     
    163165        }; 
    164166 
     167        // FIXME: it looks like the doc comments are old, inaccurate, or both 
    165168        //FIXME: Would like to support arbitrary back/forward jumps. Have to rework iframeLoaded among other things. 
    166169        //FIXME: is there a slight race condition in moz using change URL with the timer check and when 
     
    184187                //              if changeUrl: 'page1', then the URL will look like: http://some.domain.com/path#page1 
    185188                //              Full example: 
    186                 //              dojo.undo.browser.addToHistory({ 
    187                 //                back: function() { alert('back pressed'); }, 
    188                 //                forward: function() { alert('forward pressed'); }, 
    189                 //                changeUrl: true 
    190                 //              }); 
     189                //                      dojo.undo.browser.addToHistory({ 
     190                //                              back: function() { alert('back pressed'); }, 
     191                //                              forward: function() { alert('forward pressed'); }, 
     192                //                              changeUrl: true 
     193                //                      }); 
    191194                // 
    192195                //      BROWSER NOTES: