more thorough registering of windows
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 30 Jun 2005 04:15:52 +0000 (04:15 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 30 Jun 2005 04:15:52 +0000 (04:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@997 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/Open-ILS/OpenILS.js
Evergreen/staff_client/chrome/content/evergreen/auth/auth.xul
Evergreen/staff_client/chrome/content/evergreen/main/app_shell.js
Evergreen/staff_client/chrome/content/evergreen/main/app_shell.xul
Evergreen/staff_client/chrome/content/evergreen/main/clam_shell.js
Evergreen/staff_client/chrome/content/evergreen/main/clam_shell.xul
Evergreen/staff_client/chrome/content/evergreen/opac/opac.xul
Evergreen/staff_client/chrome/content/evergreen/util/shell.html
Evergreen/staff_client/chrome/content/evergreen/util/win.js
Evergreen/staff_client/chrome/content/evergreen/util/xuledit.xul

index f232667..c5ebcf6 100644 (file)
@@ -1,5 +1,5 @@
 function OpenILS_init(params) { 
-       sdump( 'D_TRACE', arg_dump( arguments, { '0':'js2JSON( map_object( arg, function (i,o) { if (i=="d") return [i,o.toString()]; else return [i,o]; }))' }));
+       sdump( 'D_TRACE', arg_dump( arguments, { '0':'js2JSON( map_object( arg, function (i,o) { if (i=="d"||i=="w") return [i,o.toString()]; else return [i,o]; }))' }));
 
        try {
 
@@ -11,13 +11,14 @@ function OpenILS_init(params) {
                }
 
                register_document(params.d);
+               register_window(params.w);
 
-       } catch(E) {}
+       } catch(E) { dump(js2JSON(E)+'\n'); }
 
 }
 
 function OpenILS_exit(params) {
-       sdump( 'D_TRACE', arg_dump( arguments, { '0':'js2JSON( map_object( arg, function (i,o) { if (i=="d") return [i,o.toString()]; else return [i,o]; }))' }));
+       sdump( 'D_TRACE', arg_dump( arguments, { '0':'js2JSON( map_object( arg, function (i,o) { if (i=="d"||i=="w") return [i,o.toString()]; else return [i,o]; }))' }));
 
        try {
        
@@ -29,8 +30,9 @@ function OpenILS_exit(params) {
                }
 
                unregister_document(params.d);
+               unregister_window(params.w);
 
-       } catch(E) {}
+       } catch(E) { dump(js2JSON(E)+'\n'); }
 
        sdump('D_TRACE','Exiting OpenILS_exit\n');
 }
index 4276738..736185a 100644 (file)
@@ -9,8 +9,8 @@
 
 <window id="auth_win" title="&auth.title;" 
        orient="vertical" style="overflow: auto"  persist="width height"
-       onload="mw.OpenILS_init({ 'd' : document, 'app' : 'Auth' });"
-       onunload="mw.OpenILS_exit({ 'd' : document, 'app' : 'Auth' });"
+       onload="mw.OpenILS_init({ 'w' : window, 'd' : document, 'app' : 'Auth' });"
+       onunload="mw.OpenILS_exit({ 'w' : window, 'd' : document, 'app' : 'Auth' });"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
        <!-- Stylesheets -->
index 41b7c6d..5d97886 100644 (file)
@@ -3,7 +3,6 @@ sdump('D_TRACE','Loading app_shell.js\n');
 function app_shell_init(params) {
        dump("TESTING: app_shell.js: " + mw.G['main_test_variable'] + '\n');
        replace_tab(params.d,'main_tabbox','Tab','chrome://evergreen/content/main/about.xul');
-       mw.G.sound.beep();
 }
 
 function close_tab( d, t1, t2 ) {
index e7adf5b..72f8deb 100644 (file)
@@ -7,7 +7,7 @@
 <window id="app_shell_win"
        orient="vertical" style="overflow: auto" width="800" height="500"
        sizemode="maximized" persist="width height" 
-       onload="params.d = document; params.app = 'AppShell'; mw.OpenILS_init(params);"
+       onload="params.w = window; params.d = document; params.app = 'AppShell'; mw.OpenILS_init(params);"
        onunload="mw.OpenILS_exit(params);"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
index c581cef..a902298 100644 (file)
@@ -11,3 +11,10 @@ function clam_shell_init(p) {
        }
 }
 
+function clam_shell_set_first_deck(d,i) {
+       set_decks(d,{ 'ClamShell_first_deck' : i });
+}
+
+function clam_shell_set_second_deck(d,i) {
+       set_decks(d,{ 'ClamShell_second_deck' : i });
+}
index 4e46a87..6827840 100644 (file)
@@ -7,7 +7,7 @@
 <page id="clam_shell_win"
        orient="vertical" style="overflow: auto" width="800" height="500"
        sizemode="maximized" persist="width height" 
-       onload="params.d = document; params.app = 'ClamShell'; mw.OpenILS_init(params);"
+       onload="params.w = window; params.d = document; params.app = 'ClamShell'; mw.OpenILS_init(params);"
        onunload="mw.OpenILS_exit(params);"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
index 926ccf8..5a958c4 100644 (file)
@@ -2,7 +2,7 @@
 <!-- Application: Evergreen Staff Client -->
 
 <page id="opac_win" orient="vertical" style="overflow: auto;" persist="width height"
-       onload="params.d = document; params.app = 'Opac'; mw.OpenILS_init(params);" 
+       onload="params.w = window; params.d = document; params.app = 'Opac'; mw.OpenILS_init(params);" 
        onunload="mw.OpenILS_exit(params);" 
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
index 655872a..c662c41 100644 (file)
@@ -674,7 +674,7 @@ form { margin: 0; padding: 0; }
 </style>
 </head>
 
-<body onload="params.d = document; params.app = 'Shell'; mw.OpenILS_init(params); init();" onunload="mw.OpenILS_exit(params);">
+<body onload="params.w = window; params.d = document; params.app = 'Shell'; mw.OpenILS_init(params); init();" onunload="mw.OpenILS_exit(params);">
 
  <div id="output"><h3>JavaScript Shell 1.3.1</h3><div>Features: autocompletion of property names with Tab, multiline input with Shift+Enter, input history with (Ctrl+) Up/Down, <a accesskey=M href="javascript:go('scope(Math); mathHelp();');">Math</a>, <a accesskey=H href="http://www.squarefree.com/shell/?ignoreReferrerFrom=shell1.3.1">help</a></div><div>Values and functions: ans, print(string), <a accesskey=P href="javascript:go('props(ans)')">props(object)</a>, <a accesskey=B href="javascript:go('blink(ans)')">blink(node)</a>, load(scriptURL), scope(object)</div></div>
 
index c7a68c2..00ba5b4 100644 (file)
@@ -54,7 +54,7 @@ function new_window(chrome,params) {
                if (w != self) { 
                        w.parentWindow = self;
                        w.mw = mw;
-                       register_window(w); 
+                       //register_window(w); 
                }
                w.am_i_a_top_level_tab = false;
                if (params) {
index b7dc9bd..1ee9396 100644 (file)
@@ -3,7 +3,7 @@
 <!-- Edited by Jason for Evergreen -->
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <window id="xuledit" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Live XUL Editor"
-onload="params.d = document; params.app = 'Xuledit'; mw.OpenILS_init(params); init();" onunload="mw.OpenILS_exit(params);">
+onload="params.w = window; params.d = document; params.app = 'Xuledit'; mw.OpenILS_init(params); init();" onunload="mw.OpenILS_exit(params);">
 <script type="application/x-javascript" src="xuledit.js"/>
 <vbox flex="1">
 <textbox id="ta" multiline="true" wrap="true" flex="1" onkeydown="resetTimeout()"