]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/pages/chunks/init.ttk
removing old opac images and css
[working/Evergreen.git] / Open-ILS / src / templates / opac / pages / chunks / init.ttk
1 [%      
2         url             = cgi.server_name();
3         port            = cgi.server_port();
4         target  = cgi.param("target");  
5         ssl             = cgi.https;
6
7         IF !target; target = "start"; END;
8
9         # --------------------------------------------------------------------------------- 
10         # push the cgi params into the javascript
11         # --------------------------------------------------------------------------------- 
12         #js( src='/js/util/webutils.js' );
13
14         IF cgi.param("no_frame");
15                 PROCESS opac/pages/chunks/javascript.ttk; 
16                 INCLUDE ALL_JS;
17         END;
18
19         WRAPPER html/js;
20                 '
21                 if(!parent || !parent.frames["appframe"]) { 
22                         /* redirect to the outer frame */
23                         location.href = location.href + "&sub_frame=1"; 
24                 }
25
26                 logicNode = parent;
27                 logicNode.paramObj = new Object();
28                 ';
29                 FOR pname IN cgi.param();
30                         param = cgi.param(pname).replace("\"","\\\"");
31                         'logicNode.paramObj["__' _  pname _ '"] = decodeURIComponent("'; param; '");'; "\n";
32                 END;
33         END;
34
35
36         # --------------------------------------------------------------------------------- 
37         # Load up the necessary global variables
38         # --------------------------------------------------------------------------------- 
39         WRAPPER html/js;
40                 '
41                 var globalPage;
42                 var globalAppFrame;
43                 var webFXTreeHandler = logicNode.webFXTreeHandler;
44
45                 function pageInit() {
46
47                         if(logicNode) {  /* defined above */
48
49                                 if(logicNode.paramObj["__no_frame"]) 
50                                         logicNode.globalAppFrame                = logicNode;
51                                 else
52                                         logicNode.globalAppFrame                = logicNode.frames["appframe"];
53
54                                 if(logicNode.globalAppFrame) {
55                                         logicNode.globalRootURL         = "' _ url _ '";
56                                         logicNode.globalRootPath        = "/opac/";
57                                         logicNode.globalPort                    = "' _ port _ '";
58                                         logicNode.globalPageTarget      = "' _ target _ '";
59                                         logicNode.isSSL                         = "' _ ssl _ '";
60                                         logicNode.globalInit();
61                                 } else {
62                                         alert("logicNode.globalAppFrame is undefined.  Why?");
63                                 }
64                         } else {
65                                 alert("Something is really broken.  No logicNode");
66                         }
67
68                         globalAppFrame = window;
69                         globalPage = logicNode.globalPage;
70                         //setDeepLink();
71                 }
72
73                 function setDeepLink() {
74                         var node = document.getElementById("deep_link_div");
75                         if(node) {
76                                 var org = logicNode.globalSelectedLocation;
77                                 if(org == null)
78                                         org = logicNode.globalLocation;
79                                 org = org.id();
80
81                                 var depth = logicNode.globalSearchDepth;
82
83                                 var a = document.createElement("a");
84                                 a.setAttribute("href", location.href + 
85                                         "&sub_frame=1&location=" + org + "&depth=" + depth);
86
87                                 a.setAttribute("target", "_blank");
88                                 a.appendChild(document.createTextNode("Link to this page"));
89                                 node.appendChild(a);
90                         } 
91                 }
92                 ';
93         END;
94
95 %]
96