Changeset 9877
- Timestamp:
- 07/31/07 01:33:20 (18 months ago)
- Files:
-
- 1 modified
-
dojo/trunk/back.js (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/back.js
r9848 r9877 29 29 last = initialState; 30 30 } 31 if (last){31 if(last){ 32 32 if(last.kwArgs["back"]){ 33 33 last.kwArgs["back"](); … … 87 87 }; 88 88 }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){ 93 93 if(!h) { h = "" }; 94 if(h.charAt(0) == "#") { h = h.substring(1); }94 if(h.charAt(0) == "#"){ h = h.substring(1); } 95 95 window.location.hash = h; 96 96 historyCounter = history.length; … … 99 99 function loadIframeHistory(){ 100 100 //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(); 102 102 moveForward = true; 103 103 if (historyIframe) { … … 109 109 } 110 110 111 function checkLocation() {111 function checkLocation(){ 112 112 console.debug("checking url"); 113 113 if(!changingUrl){ … … 150 150 //summary: Initializes the undo stack. This must be called from a <script> 151 151 // block that lives inside the <body> tag to prevent bugs on IE. 152 153 // FIXME: should this function prevent re-init? 152 154 var src = djConfig["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html"); 153 155 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>'); … … 163 165 }; 164 166 167 // FIXME: it looks like the doc comments are old, inaccurate, or both 165 168 //FIXME: Would like to support arbitrary back/forward jumps. Have to rework iframeLoaded among other things. 166 169 //FIXME: is there a slight race condition in moz using change URL with the timer check and when … … 184 187 // if changeUrl: 'page1', then the URL will look like: http://some.domain.com/path#page1 185 188 // Full example: 186 // dojo.undo.browser.addToHistory({187 // back: function() { alert('back pressed'); },188 // forward: function() { alert('forward pressed'); },189 // changeUrl: true190 // });189 // dojo.undo.browser.addToHistory({ 190 // back: function() { alert('back pressed'); }, 191 // forward: function() { alert('forward pressed'); }, 192 // changeUrl: true 193 // }); 191 194 // 192 195 // BROWSER NOTES: