moved main menu/tab interface from remote to chrome
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Jan 2006 16:46:12 +0000 (16:46 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Jan 2006 16:46:12 +0000 (16:46 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2600 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/Makefile
Open-ILS/xul/staff_client/chrome/content/evergreen/OpenILS/util_overlay.xul
Open-ILS/xul/staff_client/chrome/content/evergreen/main/constants.js
Open-ILS/xul/staff_client/chrome/content/evergreen/main/main.js
Open-ILS/xul/staff_client/chrome/content/evergreen/main/main.xul
Open-ILS/xul/staff_client/server/main/menu.js
Open-ILS/xul/staff_client/server/main/menu_frame.xul
Open-ILS/xul/staff_client/server/main/menu_frame_overlay.xul

index 28e8354..aba3dbc 100644 (file)
@@ -46,6 +46,7 @@ generated:
 open-ils:
        cp ../../../OpenSRF/src/javascript/*.js chrome/content/evergreen/OpenSRF/
        cp ../../../Open-ILS/web/opac/common/js/*.js chrome/content/evergreen/OpenILS/util/
+       cp server/main/menu* chrome/content/evergreen/main/
 
 patron:
        (cat chrome/content/evergreen/main/paged_tree_overlay.xul | sed s/paged_tree/patron_items/g | sed s/PagedTree/PatronItems/g > chrome/content/evergreen/patron/patron_items_overlay.xul )
@@ -82,6 +83,7 @@ clean:
        @echo delete derived files
        rm -f evergreen.xpi
        rm -f chrome/evergreen.jar
+       rm -f chrome/content/evergreen/main/menu.js chrome/content/evergreen/menu_frame*
        rm -f chrome/content/evergreen/patron/patron_items_overlay.xul chrome/locale/en-US/evergreen/patron_items.dtd
        rm -f chrome/content/evergreen/patron/patron_search_results_overlay.xul chrome/locale/en-US/evergreen/patron_search_results.dtd
        rm -f chrome/content/evergreen/patron/patron_checkout_items_overlay.xul chrome/locale/en-US/evergreen/patron_checkout_items.dtd
index 3516172..64f60e2 100644 (file)
@@ -7,6 +7,7 @@
        <scripts id="openils_util_scripts">
                <script type="text/javascript" src="../main/constants.js" />
                <script type="text/javascript" src="util/utils.js" />
+               <script type="text/javascript" src="util/CGI.js" />
                <script type="text/javascript" src="util/md5.js" />
                <script type="text/javascript" src="util/JSON.js" />
                <script type="text/javascript" src="util/fmall.js" />
index e3519a4..2267499 100644 (file)
@@ -45,7 +45,7 @@ var urls = {
        'remote_debug_shell' : '/xul/server/util/shell.html',
        'remote_debug_xuleditor' : '/xul/server/util/xuledit.xul',
        'remote_hold_capture' : '/xul/server/circ/hold_capture.xul',
-       'remote_menu_frame' : '/xul/server/main/menu_frame.xul',
+       'remote_menu_frame' : 'chrome://evergreen/content/main/menu_frame.xul',
        'remote_patron_barcode_entry' : '/xul/server/patron/barcode_entry.xul',
        'remote_patron_bills' : '/xul/server/patron/bills.xul',
        'remote_patron_bill_cc_info' : '/xul/server/patron/bill_cc_info.xul',
index c54083c..83efa3d 100644 (file)
@@ -60,9 +60,10 @@ function main_init() {
                                G.OpenILS.data.stash('list','hash','temp');
                                G.OpenILS.data._debug_stash();
 
-                               G.window.open(url + urls.remote_menu_frame 
+                               G.window.open(urls.remote_menu_frame 
                                        + '?session='+mw.escape(G.auth.session.key)
-                                       + '&authtime='+mw.escape(G.auth.session.authtime),
+                                       + '&authtime='+mw.escape(G.auth.session.authtime)
+                                       + '&server='+mw.escape(url),
                                        'test','chrome,resizable');
                        }
                        G.OpenILS.data.init();
index 71d9cfa..0e7b35e 100644 (file)
@@ -17,7 +17,7 @@
 <?xul-overlay href="chrome://evergreen/content/OpenILS/util_overlay.xul"?>
 
 <window id="main_win" 
-       onload="main_init()"
+       onload="try { main_init(); } catch(E) { alert(E); }"
        title="&staff.auth.title;"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
index 802b4d2..3e09d6e 100644 (file)
@@ -15,6 +15,7 @@ main.menu.prototype = {
 
                var session = params['session'];
                var authtime = params['authtime'];
+               urls.remote = params['server'];
 
                var obj = this;
 
@@ -32,7 +33,7 @@ main.menu.prototype = {
                        'cmd_new_window' : [
                                ['oncommand'],
                                function() {
-                                       obj.window.open(urls.remote_menu_frame,'test' + 
+                                       obj.window.open(urls.remote + urls.remote_menu_frame,'test' + 
                                                obj.window.appshell_name_increment++ ,'chrome'); 
                                }
                        ],
@@ -49,7 +50,7 @@ main.menu.prototype = {
                        'cmd_patron_search' : [
                                ['oncommand'],
                                function() {
-                                       obj.set_tab(urls.remote_patron_display 
+                                       obj.set_tab(urls.remote + urls.remote_patron_display 
                                                + '?session='+obj.w.escape(session),{},{});
                                }
                        ],
@@ -57,7 +58,7 @@ main.menu.prototype = {
                                ['oncommand'],
                                function() {
                                        var content_params = { 'authtoken' : session, 'authtime' : authtime };
-                                       obj.set_tab(urls.xul_opac_wrapper,{},content_params);
+                                       obj.set_tab(urls.remote + urls.xul_opac_wrapper,{},content_params);
                                }
                        ],
 
@@ -66,19 +67,19 @@ main.menu.prototype = {
                        'cmd_circ_checkin' : [
                                ['oncommand'],
                                function() { 
-                                       obj.set_tab(urls.remote_checkin + '?session='+obj.w.escape(session),{},{});
+                                       obj.set_tab(urls.remote + urls.remote_checkin + '?session='+obj.w.escape(session),{},{});
                                }
                        ],
                        'cmd_circ_checkout' : [
                                ['oncommand'],
                                function() { 
-                                       obj.set_tab(urls.remote_patron_barcode_entry + '?session='+obj.w.escape(session),{},{});
+                                       obj.set_tab(urls.remote + urls.remote_patron_barcode_entry + '?session='+obj.w.escape(session),{},{});
                                }
                        ],
                        'cmd_circ_hold_capture' : [
                                ['oncommand'],
                                function() { 
-                                       obj.set_tab(urls.remote_hold_capture + '?session='+obj.w.escape(session),{},{});
+                                       obj.set_tab(urls.remote + urls.remote_hold_capture + '?session='+obj.w.escape(session),{},{});
                                }
                        ],
 
@@ -87,13 +88,13 @@ main.menu.prototype = {
                        'cmd_test_html' : [
                                ['oncommand'],
                                function() {
-                                       obj.set_tab(urls.test_html + '?session='+obj.w.escape(session),{},{});
+                                       obj.set_tab(urls.remote + urls.test_html + '?session='+obj.w.escape(session),{},{});
                                }
                        ],
                        'cmd_test_xul' : [
                                ['oncommand'],
                                function() {
-                                       obj.set_tab(urls.test_xul + '?session='+obj.w.escape(session),{},{});
+                                       obj.set_tab(urls.remote + urls.test_xul + '?session='+obj.w.escape(session),{},{});
                                }
                        ],
                        'cmd_console' : [
@@ -105,19 +106,19 @@ main.menu.prototype = {
                        'cmd_shell' : [
                                ['oncommand'],
                                function() {
-                                       obj.set_tab(urls.remote_debug_shell,{},{});
+                                       obj.set_tab(urls.remote + urls.remote_debug_shell,{},{});
                                }
                        ],
                        'cmd_xuleditor' : [
                                ['oncommand'],
                                function() {
-                                       obj.set_tab(urls.remote_debug_xuleditor,{},{});
+                                       obj.set_tab(urls.remote + urls.remote_debug_xuleditor,{},{});
                                }
                        ],
                        'cmd_fieldmapper' : [
                                ['oncommand'],
                                function() {
-                                       obj.set_tab(urls.remote_debug_fieldmapper,{},{});
+                                       obj.set_tab(urls.remote + urls.remote_debug_fieldmapper,{},{});
                                }
                        ],
 
@@ -223,7 +224,8 @@ main.menu.prototype = {
        },
 
        'set_tab' : function(url,params,content_params) {
-               if (!url) url = 'data:text/html,<h1>Hello World</h1>'
+               if (!url) url = 'data:text/html,<h1>Hello World</h1>';
+               if (!url.match(/:\/\//) && !url.match(/^data:/)) url = urls.remote + url;
                if (!params) params = {};
                if (!content_params) content_params = {};
                var obj = this;
index 9489868..1747d21 100644 (file)
 
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- OVERLAYS -->
+<?xul-overlay href="chrome://evergreen/content/main/menu_frame_overlay.xul"?>
+<?xul-overlay href="chrome://evergreen/content/OpenILS/util_overlay.xul"?>
+<!--
 <?xul-overlay href="/xul/server/main/menu_frame_overlay.xul"?>
 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+-->
 
 <window id="menu_frame_win"
        onload="my_init()"
@@ -28,7 +32,7 @@
         <script type="text/javascript">var myPackageDir = 'evergreen'; var IAMXUL = true; var g = {};</script>
         <scripts id="openils_util_scripts"/>
 
-       <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
+       <script type="text/javascript" src="JSAN.js"/>
        <script type="text/javascript">
        <![CDATA[
                function my_init() {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
                                JSAN.errorLevel = "die"; // none, warn, or die
+                               /*
                                JSAN.addRepository('/xul/server/');
+                               */
+                               JSAN.addRepository('..');
                                JSAN.use('util.error'); g.error = new util.error();
                                g.error.sdump('D_TRACE','my_init() for menu_frame.xul');
 
                                g.cgi = new CGI();
 
                                JSAN.use('main.menu'); g.menu = new main.menu();
-                               g.menu.init( { 'session' : g.cgi.param('session'), 'authtime' : g.cgi.param('authtime') } );
+                               g.menu.init( { 
+                                       'session' : g.cgi.param('session'), 
+                                       'authtime' : g.cgi.param('authtime'),
+                                       'server' : g.cgi.param('server'),
+                               } );
        
                        } catch(E) {
                                var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
index ba0eac7..9af6a61 100644 (file)
@@ -1,6 +1,9 @@
 <?xml version="1.0"?>
 <!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/lang.dtd">
+<?xul-overlay href="chrome://evergreen/content/main/menu_frame_menus.xul"?>
+<!--
 <?xul-overlay href="/xul/server/main/menu_frame_menus.xul"?>
+-->
 <overlay id="menu_frame_overlay" 
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">