-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');
+}
<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 -->
<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 -->
<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 -->
<!-- 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"?>
<title>JavaScript Shell 1.3.1</title>
<script type="text/javascript">
+// Modified by Jason for Evergreen
var
histList = [""],
histPos = 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>
</body>
-</html>
\ No newline at end of file
+</html>
<?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()"