]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojo/resources/iframe_history.html
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dojo / resources / iframe_history.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6         <title></title>
7         <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
8         <script type="text/javascript">
9         // <!--
10         var noInit = false;
11         
12         function defineParams(sparams){
13                 if(sparams){
14                         var ss = (sparams.indexOf("&amp;") >= 0) ? "&amp;" : "&";
15                         sparams = sparams.split(ss);
16                         for(var x=0; x<sparams.length; x++){
17                                 var tp = sparams[x].split("=");
18                                 if(typeof window[tp[0]] != "undefined"){
19                                         window[tp[0]] = ((tp[1]=="true")||(tp[1]=="false")) ? eval(tp[1]) : tp[1];
20                                 }
21                         }
22                 }
23         }
24         
25         function init(){
26                 // parse the query string if there is one to try to get params that
27                 // we can act on. Also allow params to be in a fragment identifier.
28                 var query = null;
29                 var frag = null;
30                 var url = document.location.href;
31                 var hashIndex = url.indexOf("#");
32                 
33                 //Extract fragment identifier
34                 if(hashIndex != -1){
35                         frag = url.substring(hashIndex + 1, url.length);
36                         url = url.substring(0, hashIndex);
37                 }
38
39                 //Extract querystring
40                 var parts = url.split("?");
41                 if(parts.length == 2){
42                         query = parts[1];
43                 }
44
45                 defineParams(query);
46                 defineParams(frag);
47
48                 if(noInit){ return; }
49                 var hasParentDojo = false;
50                 try{
51                         hasParentDojo = window.parent != window && window.parent["dojo"];
52                 }catch(e){
53                         alert("Initializing iframe_history.html failed. If you are using a cross-domain Dojo build,"
54                                 + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
55                                 + " to the path on your domain to iframe_history.html");
56                         throw e;
57                 }
58
59                 if(hasParentDojo){
60                         //Set the page title so IE history shows up with a somewhat correct name.
61                         document.title = window.parent.document.title;
62                         
63                         //Notify parent that we are loaded.
64                         var pdj = window.parent.dojo;
65                         if(pdj["back"]){
66                                 pdj.back._iframeLoaded(null, window.location);
67                         }
68                 }
69
70         }
71         // -->
72         </script>
73 </head>
74 <body onload="try{ init(); }catch(e){ alert(e); }">
75         <h4>The Dojo Toolkit -- iframe_history.html</h4>
76
77         <p>This file is used in Dojo's back/fwd button management.</p>
78 </body>
79 </html>