Changeset 6981
- Timestamp:
- 01/04/07 14:36:01 (23 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
iframe_history.html (modified) (4 diffs)
-
src/io/IframeIO.js (modified) (1 diff)
-
src/undo/browser.js (modified) (3 diffs)
-
src/widget/RichText.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/iframe_history.html
r4226 r6981 11 11 var domain = ""; 12 12 // document.domain = "localhost"; 13 function init(){ 14 // parse the query string if there is one to try to get args that 15 // we can act on 16 var sparams = document.location.search; 17 if(sparams.length >= 0){ 18 if(sparams.charAt(0) == "?"){ 19 sparams = sparams.substring(1); 20 } 13 14 function defineParams(sparams){ 15 if(sparams){ 21 16 var ss = (sparams.indexOf("&") >= 0) ? "&" : "&"; 22 17 sparams = sparams.split(ss); … … 28 23 } 29 24 } 25 } 26 27 function init(){ 28 // parse the query string if there is one to try to get params that 29 // we can act on. Also allow params to be in a fragment identifier. 30 var query = null; 31 var frag = null; 32 var url = document.location.href; 33 var hashIndex = url.indexOf("#"); 34 35 //Extract fragment identifier 36 if(hashIndex != -1){ 37 frag = url.substring(hashIndex + 1, url.length); 38 url = url.substring(0, hashIndex); 39 } 40 41 //Extract querystring 42 var parts = url.split("?"); 43 if(parts.length == 2){ 44 query = parts[1]; 45 } 46 47 defineParams(query); 48 defineParams(frag); 30 49 31 50 if(noInit){ return; } … … 33 52 document.domain = domain; 34 53 } 35 if((window.parent != window)&&(window.parent["dojo"])){ 54 var hasParentDojo = false; 55 try{ 56 hasParentDojo = window.parent != window && window.parent["dojo"]; 57 }catch(e){ 58 alert("Initializing iframe_history.html failed. If you are using a cross-domain Dojo build," 59 + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl" 60 + " to the path on your domain to iframe_history.html"); 61 throw e; 62 } 63 64 if(hasParentDojo){ 36 65 //Set the page title so IE history shows up with a somewhat correct name. 37 66 document.title = window.parent.document.title; … … 43 72 } 44 73 } 74 45 75 } 46 76 // --> -
trunk/src/io/IframeIO.js
r6973 r6981 19 19 var r = dojo.render.html; 20 20 var cframe = null; 21 var turi = uri||dojo.uri.moduleUri("dojo", "../iframe_history.html?noInit=true"); 21 var turi = uri; 22 if(!turi){ 23 if(djConfig["useXDomain"] && !djConfig["dojoIframeHistoryUrl"]){ 24 dojo.debug("dojo.io.createIFrame: When using cross-domain Dojo builds," 25 + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl" 26 + " to the path on your domain to iframe_history.html"); 27 } 28 turi = (djConfig["dojoIframeHistoryUrl"]||dojo.uri.moduleUri("dojo", "../iframe_history.html")) + "#noInit=true"; 29 } 22 30 var ifrstr = ((r.ie)&&(dojo.render.os.win)) ? '<iframe name="'+fname+'" src="'+turi+'" onload="'+onloadstr+'">' : 'iframe'; 23 31 cframe = document.createElement(ifrstr); -
trunk/src/undo/browser.js
r6747 r6981 4 4 try{ 5 5 if((!djConfig["preventBackButtonFix"])&&(!dojo.hostenv.post_load_)){ 6 document.write("<iframe style='border: 0px; width: 1px; height: 1px; position: absolute; bottom: 0px; right: 0px; visibility: visible;' name='djhistory' id='djhistory' src='" +(dojo.hostenv.getBaseScriptUri()+'iframe_history.html')+"'></iframe>");6 document.write("<iframe style='border: 0px; width: 1px; height: 1px; position: absolute; bottom: 0px; right: 0px; visibility: visible;' name='djhistory' id='djhistory' src='" + (djConfig["dojoIframeHistoryUrl"] || dojo.hostenv.getBaseScriptUri()+'iframe_history.html') + "'></iframe>"); 7 7 } 8 8 }catch(e){/* squelch */} … … 97 97 var url = null; 98 98 if(!this.historyIframe){ 99 if(djConfig["useXDomain"] && !djConfig["dojoIframeHistoryUrl"]){ 100 dojo.debug("dojo.undo.browser: When using cross-domain Dojo builds," 101 + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl" 102 + " to the path on your domain to iframe_history.html"); 103 } 99 104 this.historyIframe = window.frames["djhistory"]; 100 105 } … … 305 310 _loadIframeHistory: function(){ 306 311 //summary: private method. Do not call this directly. 307 var url = dojo.hostenv.getBaseScriptUri()+"iframe_history.html?"+(new Date()).getTime(); 312 var url = (djConfig["dojoIframeHistoryUrl"] || dojo.hostenv.getBaseScriptUri()+'iframe_history.html') 313 + "?" + (new Date()).getTime(); 308 314 this.moveForward = true; 309 315 dojo.io.setIFrameSrc(this.historyIframe, url, false); -
trunk/src/widget/RichText.js
r6973 r6981 511 511 } 512 512 // opera likes this to be outside the with block 513 this.iframe.src = dojo.uri.moduleUri("dojo", "widget/templates/richtextframe.html") + ((dojo.doc().domain != currentDomain) ? ("#"+dojo.doc().domain) : ""); 513 if(djConfig["useXDomain"] && !djConfig["dojoRichTextFrameUrl"]){ 514 dojo.debug("dojo.widget.RichText: When using cross-domain Dojo builds," 515 + " please save src/widget/templates/richtextframe.html to your domain and set djConfig.dojoRichTextFrameUrl" 516 + " to the path on your domain to richtextframe.html"); 517 } 518 this.iframe.src = (djConfig["dojoRichTextFrameUrl"] || dojo.uri.moduleUri("dojo", "widget/templates/richtextframe.html")) 519 + ((dojo.doc().domain != currentDomain) ? ("#"+dojo.doc().domain) : ""); 514 520 this.iframe.width = this.inheritWidth ? this._oldWidth : "100%"; 515 521 if(this.height){