6 lines
1.9 KiB
JavaScript
6 lines
1.9 KiB
JavaScript
//>>built
|
|
define("dojo/hash","./_base/kernel require ./_base/config ./aspect ./_base/lang ./topic ./domReady ./sniff".split(" "),function(d,y,v,z,h,A,B,k){function t(a,b){b=a.indexOf(b);return 0<=b?a.substring(b+1):""}function e(){return t(location.href,"#")}function n(){A.publish("/dojo/hashchange",e())}function l(){e()!==c&&(c=e(),n())}function w(a){if(f)if(f.isTransitioning())setTimeout(h.hitch(null,w,a),p);else{var b=f.iframe.location.href,c=b.indexOf("?");f.iframe.location.replace(b.substring(0,c)+"?"+
|
|
a)}else location.replace("#"+a),!x&&l()}function C(){function a(){c=e();k=g?c:t(u.href,"?");q=!1;r=null}var b=document.createElement("iframe"),f=v.dojoBlankHtmlUrl||y.toUrl("./resources/blank.html");b.id="dojo-hash-iframe";b.src=f+"?"+e();b.style.display="none";document.body.appendChild(b);this.iframe=d.global["dojo-hash-iframe"];var k,q,r,l,g,u=this.iframe.location;this.isTransitioning=function(){return q};this.pollLocation=function(){if(!g)try{var d=t(u.href,"?");document.title!=l&&(l=this.iframe.document.title=
|
|
document.title)}catch(D){g=!0,console.error("dojo/hash: Error adding history entry. Server unreachable.")}var m=e();if(q&&c===m)if(g||d===r)a(),n();else{setTimeout(h.hitch(this,this.pollLocation),0);return}else if(c!==m||!g&&k!==d){if(c!==m){c=m;q=!0;r=m;b.src=f+"?"+r;g=!1;setTimeout(h.hitch(this,this.pollLocation),0);return}g||(location.href="#"+u.search.substring(1),a(),n())}setTimeout(h.hitch(this,this.pollLocation),p)};a();setTimeout(h.hitch(this,this.pollLocation),p)}d.hash=function(a,b){if(!arguments.length)return e();
|
|
"#"==a.charAt(0)&&(a=a.substring(1));b?w(a):location.href="#"+a;return a};var c,f,x,p=v.hashPollFrequency||100;B(function(){"onhashchange"in d.global&&(!k("ie")||8<=k("ie")&&"BackCompat"!=document.compatMode)?x=z.after(d.global,"onhashchange",n,!0):document.addEventListener?(c=e(),setInterval(l,p)):document.attachEvent&&(f=new C)});return d.hash});
|
|
//# sourceMappingURL=hash.js.map
|