data stash through remote xul
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Jan 2006 21:39:21 +0000 (21:39 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Jan 2006 21:39:21 +0000 (21:39 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2868 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/main.js
Open-ILS/xul/staff_client/chrome/content/main/main.xul

index 00fccbb..feb6303 100644 (file)
@@ -29,8 +29,6 @@ function main_init() {
 
                var mw = self;
                G =  {};
-               G.OpenILS = {};
-               G.OpenSRF = {};
 
                JSAN.use('util.error');
                G.error = new util.error();
@@ -45,30 +43,27 @@ function main_init() {
                G.auth = new auth.controller( { 'window' : mw } );
 
                JSAN.use('OpenILS.data');
-               G.OpenILS.data = new OpenILS.data()
-               G.OpenILS.data.on_error = G.auth.logoff;
-               G.OpenILS.data.entities = entities;
-               G.OpenILS.data.stash('entities');
+               G.data = new OpenILS.data()
+               G.data.on_error = G.auth.logoff;
+               G.data.entities = entities;
+               G.data.stash('entities');
 
                G.auth.on_login = function() {
 
-                       G.OpenILS.data.session = G.auth.session.key;
-                       G.OpenILS.data.on_complete = function () {
-
-                               var url = G.auth.controller.view.server_prompt.value || urls.remote;
-                               if (! url.match( '^http://' ) ) url = 'http://' + url;
-                               grant_perms(url);
-                               
-                               G.OpenILS.data.stash('list','hash','tree','temp');
-                               G.OpenILS.data._debug_stash();
-
-                               G.window.open(urls.XUL_MENU_FRAME 
-                                       + '?session='+mw.escape(G.auth.session.key)
-                                       + '&authtime='+mw.escape(G.auth.session.authtime)
-                                       + '&server='+mw.escape(url),
-                                       'test','chrome,resizable');
+                       var url = G.auth.controller.view.server_prompt.value || urls.remote;
+                       if (! url.match( '^http://' ) ) url = 'http://' + url;
+
+                       grant_perms(url);
+
+                       var deck = document.getElementById('main_deck');
+                       var iframe = document.createElement('iframe'); deck.appendChild(iframe);
+                       iframe.setAttribute( 'src', url + '/xul/server/main/data.xul' );
+                       var xulG = {
+                               'auth' : G.auth,
+                               'url' : url,
+                               'window' : G.window,
                        }
-                       G.OpenILS.data.init();
+                       iframe.contentWindow.xulG = xulG;
                }
 
                G.auth.init();
index 649ad11..df65ff5 100644 (file)
@@ -14,7 +14,9 @@
 
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- OVERLAYS -->
+<!--
 <?xul-overlay href="chrome://open_ils_staff_client/content/OpenILS/util_overlay.xul"?>
+-->
 
 <window id="main_win" 
        onload="try { main_init(); } catch(E) { alert(E); }"
        <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
        <!-- BEHAVIOR -->
        <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var G;</script>
-       <scripts id="openils_util_scripts"/>
+       <script>dump('Loading OpenILS/util_overlay.xul\n');</script>
+       <scripts id="openils_util_scripts">
+               <script type="text/javascript" src="constants.js" />
+               <script type="text/javascript" src="../OpenILS/util/utils.js" />
+               <script type="text/javascript" src="../OpenILS/util/CGI.js" />
+               <script type="text/javascript" src="../OpenILS/util/md5.js" />
+               <script type="text/javascript" src="../OpenILS/util/JSON.js" />
+               <!--
+               <script type="text/javascript" src="../OpenILS/util/fmall.js" />
+               <script type="text/javascript" src="../OpenILS/util/fmgen.js" />
+               -->
+               <script type="text/javascript" src="../OpenILS/util/RemoteRequest.js" />
+               <!--
+               <script type="text/javascript" src="../OpenILS/util/OrgTree.js" />
+               -->
+               <script type="text/javascript" src="../OpenILS/util/org_utils.js" />   
+       </scripts>
+       <script>dump('Loaded OpenILS/util_overlay.xul\n');</script>
+
 
        <script type="text/javascript" src="chrome://open_ils_staff_client/content/main/lang.js"/>
        <!--