change in onload and onunload handlers
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Jun 2005 22:23:14 +0000 (22:23 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Jun 2005 22:23:14 +0000 (22:23 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@984 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.xul
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/xuledit.xul

index 0783ccd..b9fd583 100644 (file)
@@ -1,12 +1,37 @@
-function OpenILS_init(screen,params) { 
+function OpenILS_init(params) { 
        sdump('D_TRACE','Entering OpenILS_init with ' + screen + '\n');
 
-       switch(screen) {
-               case 'Auth' : auth_init(params); break;
-               case 'AppShell' : app_shell_init(params); break;
-               case 'Opac' : opac_init(params); break;
-       }
+       try {
+
+               switch(params.app) {
+                       case 'Auth' : auth_init(params); break;
+                       case 'AppShell' : app_shell_init(params); break;
+                       case 'ClamShell' : clam_shell_init(params); break;
+                       case 'Opac' : opac_init(params); break;
+               }
+
+               register_document(params.d);
+
+       } catch(E) {}
 
        sdump('D_TRACE','Exiting OpenILS_init\n');
 }
 
+function OpenILS_exit(params) {
+       sdump('D_TRACE','Entering OpenILS_exit with ' + screen + '\n');
+
+       try {
+       
+               switch(params.app) {
+                       case 'Auth' : auth_exit(params); break;
+                       case 'AppShell' : app_shell_exit(params); break;
+                       case 'ClamShell' : clam_shell_exit(params); break;
+                       case 'Opac' : opac_exit(params); break;
+               }
+
+               unregister_document(params.d);
+
+       } catch(E) {}
+
+       sdump('D_TRACE','Exiting OpenILS_exit\n');
+}
index f8a5dbf..4276738 100644 (file)
@@ -9,7 +9,8 @@
 
 <window id="auth_win" title="&auth.title;" 
        orient="vertical" style="overflow: auto"  persist="width height"
-       onload="mw.OpenILS_init('Auth');"
+       onload="mw.OpenILS_init({ 'd' : document, 'app' : 'Auth' });"
+       onunload="mw.OpenILS_exit({ 'd' : document, 'app' : 'Auth' });"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
        <!-- Stylesheets -->
index 84a81a4..e7adf5b 100644 (file)
@@ -7,7 +7,8 @@
 <window id="app_shell_win"
        orient="vertical" style="overflow: auto" width="800" height="500"
        sizemode="maximized" persist="width height" 
-       onload="mw.OpenILS_init('AppShell',{ 'd' : document });"
+       onload="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">
 
        <!-- Stylesheets -->
index 468554e..4e46a87 100644 (file)
@@ -7,7 +7,8 @@
 <page id="clam_shell_win"
        orient="vertical" style="overflow: auto" width="800" height="500"
        sizemode="maximized" persist="width height" 
-       onload="mw.OpenILS_init('ClamShell',{ 'd' : document });"
+       onload="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">
 
        <!-- Stylesheets -->
index 6a5c86a..926ccf8 100644 (file)
@@ -2,7 +2,9 @@
 <!-- Application: Evergreen Staff Client -->
 
 <page id="opac_win" orient="vertical" style="overflow: auto;" persist="width height"
-       onload="mw.OpenILS_init('Opac',{'d':document});" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+       onload="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">
 
        <!-- Stylesheets -->
        <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
index e7c300d..655872a 100644 (file)
@@ -6,6 +6,7 @@
 <title>JavaScript Shell 1.3.1</title>
 
 <script type="text/javascript">
+// Modified by Jason for Evergreen
 var 
 histList = [""], 
 histPos = 0, 
@@ -673,7 +674,7 @@ form { margin: 0; padding: 0; }
 </style>
 </head>
 
-<body onload="init()">
+<body onload="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>
 
@@ -681,4 +682,4 @@ form { margin: 0; padding: 0; }
 
 </body>
 
-</html>
\ No newline at end of file
+</html>
index 90df235..b7dc9bd 100644 (file)
@@ -1,8 +1,9 @@
 <?xml version="1.0"?>
 <!-- From Ted's Mozilla page: http://ted.mielczarek.org/code/mozilla/index.html -->
+<!-- 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="init()">
+onload="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()"