<OpenILS id="OpenILS_js">
<script src="OpenILS.js" />
+ <script src="chrome://evergreen/content/main/AppShell.js" />
</OpenILS>
</overlay>
--- /dev/null
+var tab_count = [ false, false, false, false, false, false, false, false, false, false ];
+
+function app_shell_init() {
+ dump("TESTING: app_shell.js: " + mw.G['main_test_variable'] + '\n');
+ replace_tab('main_tabbox','Tab','chrome://evergreen/content/main/about.xul');
+ mw.G.sound.beep();
+}
+
+function close_tab( d, tabbox ) {
+ var tbox = d.getElementById(tabbox);
+ var tabs = tbox.firstChild;
+ var panels = tbox.lastChild;
+ if (tabs.childNodes.length == 0) { return 0; }
+ try {
+ var tab = tabs.selectedItem;
+ var panel = tbox.selectedPanel;
+ tab_count[ tab.getAttribute('count') ] = false;
+ tabs.advanceSelectedTab(-1);
+ tabs.removeChild( tab );
+ panels.removeChild( panel );
+ } catch(E) {
+ alert(E);
+ }
+ if (tabs.childNodes.length == 0) {
+ new_tab('main_tabbox');
+ }
+}
+
+function delete_tab_contents( tab, panel ) {
+ try {
+ while (tab.lastChild) { tab.removeChild(tab.lastChild); }
+ while (panel.lastChild) { panel.removeChild(panel.lastChild); }
+ } catch(E) {
+ alert(E);
+ }
+}
+
+function first_free_tab_count() {
+ for (var i = 0; i<10; i++) {
+ if (! tab_count[i]) {
+ tab_count[i] = true;
+ return i;
+ }
+ }
+ return -1;
+}
+
+function new_tab( d, tabbox ) {
+ var tbox = d.getElementById(tabbox);
+ var tabs = tbox.firstChild;
+ var panels = tbox.lastChild;
+ var tc = first_free_tab_count();
+ if (tc == -1) { return; } // let's only have up to 10 tabs
+ var panel = d.createElement('tabpanel');
+ var pl = d.createElement('label');
+ pl.setAttribute('value','Panel ' + tc);
+ panel.setAttribute('flex','1');
+ //panel.setAttribute('style','overflow: auto; min-width: 500px; min-height: 500px;');
+ panel.setAttribute('id','panel'+tc);
+ panel.appendChild(pl);
+ panels.appendChild(panel);
+
+ var tab = d.createElement('tab');
+ tab.setAttribute('label','Tab ' + tc );
+ tab.setAttribute('count',tc);
+ tab.setAttribute('accesskey',tc);
+ tab.setAttribute('linkedpanel','panel'+tc);
+ tabs.appendChild(tab);
+ try {
+ tbox.selectedIndex = tc;
+ tabs.selectedIndex = tc;
+ //tbox.selectedIndex = tabs.childNodes.length - 1;
+ //tabs.selectedIndex = tabs.childNodes.length - 1;
+ replace_tab(tabbox,'Tab','chrome://evergreen/content/about.xul');
+ } catch(E) {
+ alert(E);
+ }
+}
+
+function replace_tab( d, tabbox, label, chrome, params ) {
+ var tbox = d.getElementById(tabbox);
+ var tabs = tbox.firstChild;
+ var panels = tbox.lastChild;
+ if (tabs.childNodes.length == 0) { new_tab(tabbox); }
+ try {
+ var tab = tabs.selectedItem;
+ var panel = tbox.selectedPanel;
+ delete_tab_contents(tab,panel);
+
+ tab.setAttribute('label',label + ' ' + tab.getAttribute('count') );
+
+ var frame = d.createElement('iframe');
+ frame.setAttribute('flex','1');
+ //frame.setAttribute('style','overflow: scroll; min-height: 500px; min-width: 500px;');
+ frame.setAttribute('src',chrome);
+ panel.appendChild(frame);
+ frame.contentWindow.parentWindow = parentWindow;
+ frame.contentWindow.tabWindow = this;
+ dump('replace_tab.tabWindow = ' + this + '\n');
+ frame.contentWindow.mw = mw;
+ frame.contentWindow.am_i_a_top_level_tab = true;
+ if (params) {
+ frame.contentWindow.params = params;
+ }
+ return frame.contentWindow;
+ } catch(E) {
+ alert(E);
+ }
+
+}
--- /dev/null
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+
+<!-- Localization -->
+<!DOCTYPE window SYSTEM "chrome://evergreen/locale/app_shell.dtd">
+
+<window id="app_shell_win"
+ orient="vertical" style="overflow: auto" width="800" height="500"
+ sizemode="maximized" persist="width height"
+ onload="mw.OpenILS_init('AppShell');"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <!-- More Localization -->
+ <stringbundle id="strings" src="chrome://evergreen/locale/app_shell.properties"/>
+
+ <!-- Stylesheets -->
+ <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+ <?xml-stylesheet href="chrome://evergreen/skin/evergreen.css" type="text/css"?>
+ <?xml-stylesheet href="chrome://evergreen/skin/app_shell.css" type="text/css"?>
+
+ <!-- Overlays for this XUL file -->
+ <?xul-overlay href="chrome://evergreen/content/main/app_shell_overlay.xul"?>
+
+ <!-- XUL'ified abstraction for logic to attach to widgets -->
+ <commandset id="AppShell_cmds" />
+
+ <!-- Accelerator Keys (Accessor Keys are in DTD's) -->
+ <keyset id="AppShell_keys" />
+
+ <!-- Layout to be filled in by overlays and javascript -->
+ <box id="AppShell_main" />
+
+</window>
+
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE overlay SYSTEM "chrome://evergreen/locale/app_shell.dtd">
+<overlay id="app_shell_overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+<commandset id="AppShell_cmds">
+
+ <command id="cmd_close_window" oncommand="
+ window.close();"/>
+
+ <command id="cmd_new_window" oncommand="
+ spawn_main_window();"/>
+
+ <command id="cmd_new_tab" oncommand="
+ new_tab(document,'main_tabbox');"/>
+
+ <command id="cmd_close_tab" oncommand="
+ close_tab(document,'main_tabbox');"/>
+
+ <command id="cmd_cat_main" oncommand="
+ replace_tab(document,'main_tabbox','Navigator','chrome://evergreen/content/opac/opac.xul'); "/>
+
+ <command id="cmd_circ_checkout" oncommand="
+ replace_tab(document,'main_tabbox','Check Out','chrome://evergreen/content/circ/circ_deck_checkout.xul'); "/>
+
+ <command id="cmd_circ_search" oncommand="
+ replace_tab(document,'main_tabbox','Patron Search','chrome://evergreen/content/circ/circ_deck_search.xul'); "/>
+
+ <command id="cmd_circ_display" oncommand="
+ replace_tab(document,'main_tabbox','Display Patron','chrome://evergreen/content/circ/circ_deck_patron.xul'); "/>
+
+ <command id="cmd_circ_checkin" oncommand="
+ replace_tab(document,'main_tabbox','Check In','chrome://evergreen/content/circ/checkin.xul'); "/>
+
+ <command id="cmd_search_opac" oncommand="
+ replace_tab(document,'main_tabbox','Navigator','chrome://evergreen/content/opac/opac.xul'); "/>
+
+ <command id="cmd_patron_register" oncommand="
+ replace_tab(document,'main_tabbox','NEW PATRON','chrome://evergreen/content/patron/patron_new.xul'); "/>
+
+ <command id="cmd_survey_wizard" oncommand="
+ mw.new_window(document,'chrome://evergreen/content/survey/survey_wizard.xul'); "/>
+
+ <command id="cmd_copy_stat_cat_edit" oncommand="
+ replace_tab(document,'main_tabbox','Copy Stat-Cats','chrome://evergreen/content/stat_cat/copy_stat_cat_editor.xul'); "/>
+
+ <command id="cmd_patron_stat_cat_edit" oncommand="
+ replace_tab(document,'main_tabbox','Patron Stat-Cats','chrome://evergreen/content/stat_cat/patron_stat_cat_editor.xul'); "/>
+
+ <command id="cmd_z39_50_import_old" oncommand="
+ replace_tab(document,'main_tabbox','Z39.50 Import','chrome://evergreen/content/z39_50/z39_50.xul'); "/>
+
+ <command id="cmd_test" oncommand="
+ "/>
+
+ <command id="cmd_z39_50_import" oncommand="
+ alert('Not Yet Implemented'); "/>
+
+ <command id="cmd_broken" oncommand="
+ alert('Not Yet Implemented'); "/>
+
+</commandset>
+
+<!-- The top level widget for the staff client -->
+<vbox id="main_vbox" flex="1">
+ <toolbox id="main_toolbox"/>
+ <tabbox id="main_tabbox" flex="1" eventnode="window" handleCtrlTab="true">
+ <tabs id="main_tabs"/>
+ <tabpanels id="main_panels" flex="1"/>
+ </tabbox>
+ <toolbox id="entity_toolbox"/>
+</vbox>
+
+<!-- The main top level menubar -->
+<toolbox id="main_toolbox">
+ <menubar id="main_menubar">
+ <menu id="file-menu" label="&evergreen.file;" accesskey="&evergreen.file.key;"/>
+ <menu id="edit-menu" label="&evergreen.edit;" accesskey="&evergreen.edit.key;"/>
+ <menu id="search-menu" label="&evergreen.search;" accesskey="&evergreen.search.key;"/>
+ <menu id="circ-menu" label="&evergreen.circ;" accesskey="&evergreen.circ.key;"/>
+ <menu id="cat-menu" label="&evergreen.cat;" accesskey="&evergreen.cat.key;"/>
+ <menu id="serials-menu" label="&evergreen.serials;" accesskey="&evergreen.serials.key;"/>
+ <menu id="acquisitions-menu" label="&evergreen.acquisitions;" accesskey="&evergreen.acquisitions.key;"/>
+ <menu id="reports-menu" label="&evergreen.reports;" accesskey="&evergreen.reports.key;"/>
+ <spacer flex="1" />
+ <menu id="admin-menu" label="&evergreen.admin;" accesskey="&evergreen.admin.key;"/>
+ <menu id="help-menu" label="&evergreen.help;" accesskey="&evergreen.help.key;"/>
+ </menubar>
+</toolbox>
+
+<!-- The File menu on the main menu -->
+<menu id="file-menu">
+ <menupopup id="file-popup">
+ <menuitem label="&evergreen.file.new;" accesskey="&evergreen.file.new.key;" key="file-new-key" command="cmd_new_window"/>
+ <menuitem label="&evergreen.file.new_tab;" accesskey="&evergreen.file.new_tab.key;" key="file-new-tab-key" command="cmd_new_tab"/>
+ <menuseparator />
+ <menuitem label="&evergreen.file.open;" accesskey="&evergreen.file.open.key;" key="file-open-key" command="cmd_broken"/>
+ <menuitem label="&evergreen.file.save;" accesskey="&evergreen.file.save.key;" key="file-save-key" command="cmd_broken"/>
+ <menuseparator />
+ <menuitem label="&evergreen.file.close_tab;" accesskey="&evergreen.file.close_tab.key;" key="file-close-tab-key" command="cmd_close_tab"/>
+ <menuitem label="&evergreen.file.close;" accesskey="&evergreen.file.close.key;" key="file-close-key" command="cmd_close_window"/>
+ </menupopup>
+</menu>
+
+<!-- The Edit menu on the main menu -->
+<menu id="edit-menu">
+ <menupopup id="edit-popup">
+ <menuitem label="&evergreen.edit.undo;" accesskey="&evergreen.edit.undo.key;" key="edit-undo-key" command="cmd_broken"/>
+ <menuitem label="&evergreen.edit.redo;" accesskey="&evergreen.edit.redo.key;" key="edit-redo-key" command="cmd_broken"/>
+ <menuseparator />
+ <menuitem label="&evergreen.edit.cut;" accesskey="&evergreen.edit.cut.key;" key="edit-cut-key" command="cmd_broken"/>
+ <menuitem label="&evergreen.edit.copy;" accesskey="&evergreen.edit.copy.key;" key="edit-copy-key" command="cmd_broken"/>
+ <menuitem label="&evergreen.edit.paste;" accesskey="&evergreen.edit.paste.key;" key="edit-paste-key" command="cmd_broken"/>
+ <menuitem label="&evergreen.edit.delete;" accesskey="&evergreen.edit.delete.key;" key="edit-delete-key" command="cmd_broken"/>
+ <menuseparator />
+ <menuitem label="&evergreen.edit.buckets;" accesskey="&evergreen.edit.buckets.key;" command="cmd_broken"/>
+ <menuseparator />
+ <menuitem label="&evergreen.edit.select_all;" accesskey="&evergreen.edit.select_all.key;" key="edit-select-all-key" command="cmd_broken"/>
+ <menuseparator />
+ <menuitem label="&evergreen.edit.find;" accesskey="&evergreen.edit.find.key;" key="edit-find-key" command="cmd_broken"/>
+ <menuitem label="&evergreen.edit.find_again;" accesskey="&evergreen.edit.find_again.key;" key="edit-find-again-key" command="cmd_broken"/>
+ </menupopup>
+</menu>
+
+<!-- The Circulation menu on the main menu -->
+<menu id="circ-menu">
+ <menupopup id="circ-popup">
+ <menuitem label="&evergreen.circ.checkout;" accesskey="&evergreen.circ.checkout.key;" key="circ-check-out-key" command="cmd_circ_checkout"/>
+ <menuitem label="&evergreen.circ.checkin;" accesskey="&evergreen.circ.checkin.key;" key="circ-check-in-key" command="cmd_circ_checkin"/>
+ <menuitem label="&evergreen.circ.renew;" accesskey="&evergreen.circ.renew.key;" key="circ-renew-key" command="cmd_broken"/>
+ <menu id="special-circ-menu" label="&evergreen.circ.special;" accesskey="&evergreen.circ.special.key;" command="cmd_broken"/>
+ <menuseparator />
+ <menuitem label="&evergreen.circ.place_hold;" accesskey="&evergreen.circ.place_hold.key;" key="circ-place-hold-key" command="cmd_broken"/>
+ <menuseparator />
+ <menuitem label="&evergreen.circ.copy_status;" accesskey="&evergreen.circ.copy_status.key;" key="circ-copy-status-key" command="cmd_broken"/>
+ <menuitem label="&evergreen.circ.patron_status;" accesskey="&evergreen.circ.patron_status.key;" key="circ-patron-status-key" command="cmd_circ_display"/>
+ <menuseparator />
+ <menuitem label="&evergreen.circ.patron_registration;" accesskey="&evergreen.circ.patron_registration.key;" key="circ-patron-registration-key" command="cmd_patron_register"/>
+ </menupopup>
+</menu>
+
+<!-- The Special Circulation submenu in the Circulation menu -->
+<menu id="special-circ-menu">
+ <menupopup id="special-circ-popup">
+ <menuitem label="&evergreen.circ.mark_used;" accesskey="&evergreen.circ.mark_used.key;" key="circ-mark-used-key" command="cmd_broken"/>
+ <menuitem label="&evergreen.circ.lost;" accesskey="&evergreen.circ.lost.key;" command="cmd_broken"/>
+ <menuitem label="&evergreen.circ.missing;" accesskey="&evergreen.circ.missing.key;" command="cmd_broken"/>
+ <menuitem label="&evergreen.circ.found;" accesskey="&evergreen.circ.found.key;" command="cmd_broken"/>
+ <menuitem label="&evergreen.circ.claimed_returned;" accesskey="&evergreen.circ.claimed_returned.key;" command="cmd_broken"/>
+ <menuitem label="&evergreen.circ.quick_add;" accesskey="&evergreen.circ.quick_add.key;" command="cmd_broken"/>
+ </menupopup>
+</menu>
+
+<!-- The Cataloging menu on the main menu -->
+<menu id="cat-menu">
+ <menupopup id="cat-popup">
+ <menuitem label="&evergreen.cat.bib_search;" accesskey="&evergreen.cat.bib_search.key;" command="cmd_cat_main"/>
+ <menuseparator />
+ <menuitem disabled="true" label="&evergreen.cat.dedup;" accesskey="&evergreen.cat.dedup.key;" command="cmd_broken"/>
+ <menuitem label="Z39.50 Import" accesskey="Z" command="cmd_z39_50_import"/>
+ </menupopup>
+</menu>
+
+<!-- The Search menu on the main menu -->
+<menu id="search-menu">
+ <menupopup id="search-popup">
+ <menuitem label="Catalog" accesskey="C" command="cmd_search_opac" />
+ <menuitem label="Patrons" accesskey="P" command="cmd_circ_search" />
+ </menupopup>
+</menu>
+
+<!-- The Serials menu on the main menu -->
+<menu id="serials-menu">
+ <menupopup id="serials-popup">
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ </menupopup>
+</menu>
+
+<!-- The Acquisitions menu on the main menu -->
+<menu id="acquisitions-menu">
+ <menupopup id="acquisitions-popup">
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ </menupopup>
+</menu>
+
+<!-- The Reports menu on the main menu -->
+<menu id="reports-menu">
+ <menupopup id="reports-popup">
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ </menupopup>
+</menu>
+
+<!-- The Help menu on the main menu -->
+<menu id="help-menu">
+ <menupopup id="help-popup">
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ </menupopup>
+</menu>
+
+<!-- The Help menu on the main menu -->
+<menu id="admin-menu">
+ <menupopup id="admin-popup">
+ <menuitem label="Survey Wizard" accesskey="S" command="cmd_survey_wizard"/>
+ <menuitem label="Copy Stat-Cat Editor" accesskey="C" command="cmd_copy_stat_cat_edit"/>
+ <menuitem label="Patron Stat-Cat Editor" accesskey="P" command="cmd_patron_stat_cat_edit"/>
+ <menuitem label="stub" />
+ <menuitem label="Test Module" command="cmd_test"/>
+ </menupopup>
+</menu>
+
+<!-- The Entity top level menubar -->
+<toolbox id="entity_toolbox">
+ <menubar id="entity_menubar">
+ <menu id="patron-menu" label="&evergreen.entity.patron;" accesskey="&evergreen.entity.patron.key;" command="cmd_broken"/>
+ <menu id="copy-menu" label="&evergreen.entity.copy;" accesskey="&evergreen.entity.copy.key;" command="cmd_broken"/>
+ <menu id="volume-menu" label="&evergreen.entity.volume;" accesskey="&evergreen.entity.volume.key;" command="cmd_broken"/>
+ <menu id="bib-menu" label="&evergreen.entity.bib;" accesskey="&evergreen.entity.bib.key;" command="cmd_broken"/>
+ </menubar>
+</toolbox>
+
+<!-- The Patron menu on the Entity menubar -->
+<menu id="patron-menu">
+ <menupopup id="patron-popup">
+ <menuitem label="&evergreen.circ.patron_registration;" accesskey="&evergreen.entity.patron.register.key;" command="cmd_patron_register"/>
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ </menupopup>
+</menu>
+
+<!-- The Items menu on the Entity menubar -->
+<menu id="copy-menu">
+ <menupopup id="copy-popup">
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ </menupopup>
+</menu>
+
+<!-- The Volumes menu on the Entity menubar -->
+<menu id="volume-menu">
+ <menupopup id="volume-popup">
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ </menupopup>
+</menu>
+
+<!-- The Bib Records menu on the Entity menubar -->
+<menu id="bib-menu">
+ <menupopup id="bib-popup">
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ <menuitem label="stub" />
+ </menupopup>
+</menu>
+
+<!-- Accelerator Keys (Accessor Keys are in DTD's) -->
+<keyset id="evergreen_keys">
+ <key id="file-new-key" modifiers="accel" key="N" command="cmd_new_window"/>
+ <key id="file-new-tab-key" modifiers="accel" key="T" command="cmd_new_tab"/>
+ <key id="file-open-key" modifiers="accel" key="O" command=""/>
+ <key id="file-save-key" modifiers="accel" key="S" command=""/>
+ <key id="file-close-tab-key" modifiers="accel" key="W" command="cmd_close_tab"/>
+ <key id="file-close-key" modifiers="accel" key="Q" command="cmd_close_window"/>
+
+ <key id="edit-undo-key" modifiers="accel" key="Z" command=""/>
+ <key id="edit-redo-key" modifiers="accel" key="Y" command=""/>
+ <key id="edit-cut-key" modifiers="accel" key="X" command=""/>
+ <key id="edit-copy-key" modifiers="accel" key="C" command=""/>
+ <key id="edit-paste-key" modifiers="accel" key="V" command=""/>
+ <key id="edit-delete-key" modifiers="" keycode="VK_DELETE" command=""/>
+ <key id="edit-select-all-key" modifiers="accel" key="A" command=""/>
+ <key id="edit-find-key" modifiers="accel" key="F" command=""/>
+ <key id="edit-find-again-key" modifiers="accel" key="G" command=""/>
+
+ <key id="circ-patron-status-key" keycode="VK_F11" command="cmd_circ_display"/>
+ <key id="circ-copy-status-key" keycode="VK_F9" command=""/>
+ <key id="circ-check-out-key" keycode="VK_F1" command="cmd_circ_checkout"/>
+ <key id="circ-check-in-key" keycode="VK_F2" command="cmd_circ_checkin"/>
+ <key id="circ-renew-key" keycode="VK_F3" command=""/>
+ <key id="circ-mark-used-key" keycode="VK_F4" command=""/>
+ <key id="circ-place-hold-key" keycode="VK_F5" command=""/>
+ <key id="circ-patron-registration-key" keycode="VK_F12" command=""/>
+</keyset>
+
+</overlay>
-function spawn_main() {
- try {
- var w = new_window('chrome://evergreen/content/evergreen/main/app_shell.xul');
- if (!w) { throw('window ref == null'); }
- try {
- w.document.title = mw.G.user.usrname() + '@' + mw.G.user_ou.name();
- } catch(E) {
- alert('Hrmm. ' + pretty_print( js2JSON(E) ) );
- }
- } catch(E) {
- incr_progressmeter('auth_meter',-100);
- alert('Login failed on new_window: ' + js2JSON(E)); enable_login_prompts(); return;
+function spawn_batch_copy_editor(d,tab,params) {
+ sdump('D_SPAWN','trying to spawn_copy_editor(' + params + ')');
+ var w;
+ var chrome = 'chrome://evergreen/content/cat/copy_edit.xul';
+ if (tab) {
+ if (tab != 'replace') { new_tab(d,'main_tabbox'); }
+ w = replace_tab(d,'main_tabbox','COPIES EDITOR',chrome);
+ } else {
+ w = mw.new_window( chrome );
+ }
+ w.params = params;
+}
+
+function spawn_bill_pay(d,tab,patron,params) {
+ sdump('D_SPAWN','trying to spawn_bill_pay('+js2JSON(patron)+')\n');
+ sdump('D_SPAWN','barcode: ' + patron.barcode() + '\n');
+ var w;
+ var chrome = 'chrome://evergreen/content/bill/bill.xul';
+ var params = { 'barcode' : patron.barcode() };
+ if (tab) {
+ if (tab != 'replace') { new_tab(d,'main_tabbox'); }
+ w = replace_tab(d,'main_tabbox','BILLS',chrome,params);
+ } else {
+ w = mw.new_window( chrome,params );
}
- incr_progressmeter('auth_meter',100);
}
-function spawn_copy_browser(tab,params) {
+function spawn_check_out(d,tab,patron,params) {
+ sdump('D_SPAWN','trying to spawn_check_out('+js2JSON(patron)+')\n');
+ sdump('D_SPAWN','barcode: ' + patron.barcode() + '\n');
+ var w;
+ var chrome = 'chrome://evergreen/content/circ/checkout.xul';
+ var params = { 'barcode' : patron.barcode() };
+ if (tab) {
+ if (tab != 'replace') { new_tab(d,'main_tabbox'); }
+ w = replace_tab(d,'main_tabbox','CHECK OUT',chrome,params);
+ } else {
+ w = mw.new_window( chrome,params );
+ }
+}
+
+function spawn_circ_list(d,tab,patron,params) {
+ sdump('D_SPAWN','trying to spawn_circ_list('+js2JSON(patron)+')\n');
+ sdump('D_SPAWN','barcode: ' + patron.barcode() + '\n');
+ var w;
+ var chrome = 'chrome://evergreen/content/circ/circ_list.xul';
+ var params = { 'barcode' : patron.barcode() };
+ if (tab) {
+ if (tab != 'replace') { new_tab(d,'main_tabbox'); }
+ w = replace_tab(d,'main_tabbox','ITEMS OUT',chrome,params);
+ } else {
+ w = mw.new_window( chrome,params );
+ }
+}
+
+
+function spawn_copy_browser(d,tab,params) {
sdump('D_SPAWN','trying to spawn_copy_browser('+js2JSON(params)+')\n');
var w;
var chrome = 'chrome://evergreen/content/cat/browse_list.xul';
if (tab) {
- if (tab != 'replace') { tabWindow.new_tab('main_tabbox'); }
- w = tabWindow.replace_tab('main_tabbox','COPIES',chrome);
+ if (tab != 'replace') { new_tab(d,'main_tabbox'); }
+ w = replace_tab(d,'main_tabbox','COPIES',chrome);
} else {
w = mw.new_window( chrome );
}
w.record_columns = params;
}
-function spawn_batch_copy_editor(tab,params) {
- sdump('D_SPAWN','trying to spawn_copy_editor(' + params + ')');
- var w;
- var chrome = 'chrome://evergreen/content/cat/copy_edit.xul';
- if (tab) {
- if (tab != 'replace') { tabWindow.new_tab('main_tabbox'); }
- w = tabWindow.replace_tab('main_tabbox','COPIES EDITOR',chrome);
- } else {
- w = mw.new_window( chrome );
+function spawn_main() {
+ try {
+ var w = new_window('chrome://evergreen/content/evergreen/main/app_shell.xul');
+ if (!w) { throw('window ref == null'); }
+ try {
+ w.document.title = mw.G.user.usrname() + '@' + mw.G.user_ou.name();
+ } catch(E) {
+ alert('Hrmm. ' + pretty_print( js2JSON(E) ) );
+ }
+ } catch(E) {
+ incr_progressmeter('auth_meter',-100);
+ alert('Login failed on new_window: ' + js2JSON(E)); enable_login_prompts(); return;
}
- w.params = params;
+ incr_progressmeter('auth_meter',100);
}
-function spawn_marc_editor(tab,params) {
+
+function spawn_marc_editor(d,tab,params) {
sdump('D_SPAWN','trying to spawn_marc_editor('+js2JSON(params)+')\n');
var w;
var chrome = 'chrome://evergreen/content/cat/marc.xul';
if (tab) {
- if (tab != 'replace') { tabWindow.new_tab('main_tabbox'); }
- w = tabWindow.replace_tab('main_tabbox','MARC',chrome);
+ if (tab != 'replace') { new_tab(d,'main_tabbox'); }
+ w = replace_tab(d,'main_tabbox','MARC',chrome);
} else {
w = mw.new_window( chrome );
}
w.params = params;
}
-function spawn_oclc_import(tab,params) {
+function spawn_oclc_import(d,tab,params) {
sdump('D_SPAWN','trying to spawn_marc_editor('+js2JSON(params)+')\n');
// sample TCN: 03715963
try {
var w;
var chrome = 'chrome://evergreen/content/cat/marc.xul';
if (tab) {
- if (tab != 'replace') { tabWindow.new_tab('main_tabbox'); }
- w = tabWindow.replace_tab('main_tabbox','MARC',chrome);
+ if (tab != 'replace') { new_tab(d,'main_tabbox'); }
+ w = replace_tab(d,'main_tabbox','MARC',chrome);
} else {
w = mw.new_window( chrome );
}
}
-function spawn_bill_pay(tab,patron,params) {
- sdump('D_SPAWN','trying to spawn_bill_pay('+js2JSON(patron)+')\n');
- sdump('D_SPAWN','barcode: ' + patron.barcode() + '\n');
- var w;
- var chrome = 'chrome://evergreen/content/bill/bill.xul';
- var params = { 'barcode' : patron.barcode() };
- if (tab) {
- if (tab != 'replace') { tabWindow.new_tab('main_tabbox'); }
- w = tabWindow.replace_tab('main_tabbox','BILLS',chrome,params);
- } else {
- w = mw.new_window( chrome,params );
- }
-}
-
-function spawn_check_out(tab,patron,params) {
- sdump('D_SPAWN','trying to spawn_check_out('+js2JSON(patron)+')\n');
- sdump('D_SPAWN','barcode: ' + patron.barcode() + '\n');
- var w;
- var chrome = 'chrome://evergreen/content/circ/checkout.xul';
- var params = { 'barcode' : patron.barcode() };
- if (tab) {
- if (tab != 'replace') { tabWindow.new_tab('main_tabbox'); }
- w = tabWindow.replace_tab('main_tabbox','CHECK OUT',chrome,params);
- } else {
- w = mw.new_window( chrome,params );
- }
-}
-
-function spawn_circ_list(tab,patron,params) {
- sdump('D_SPAWN','trying to spawn_circ_list('+js2JSON(patron)+')\n');
- sdump('D_SPAWN','barcode: ' + patron.barcode() + '\n');
- var w;
- var chrome = 'chrome://evergreen/content/circ/circ_list.xul';
- var params = { 'barcode' : patron.barcode() };
- if (tab) {
- if (tab != 'replace') { tabWindow.new_tab('main_tabbox'); }
- w = tabWindow.replace_tab('main_tabbox','ITEMS OUT',chrome,params);
- } else {
- w = mw.new_window( chrome,params );
- }
-}
-
-function spawn_patron_edit(tab,patron,params) {
+function spawn_patron_edit(d,tab,patron,params) {
sdump('D_SPAWN','trying to spawn_patron_edit('+js2JSON(patron)+')\n');
sdump('D_SPAWN','barcode: ' + patron.barcode() + '\n');
var w;
var chrome = 'chrome://evergreen/content/patron/patron_edit.xul';
var params = { 'barcode' : patron.barcode() };
if (tab) {
- if (tab != 'replace') { tabWindow.new_tab('main_tabbox'); }
- w = tabWindow.replace_tab('main_tabbox','PATRON EDIT',chrome,params);
+ if (tab != 'replace') { new_tab(d,'main_tabbox'); }
+ w = replace_tab(d,'main_tabbox','PATRON EDIT',chrome,params);
} else {
w = mw.new_window( chrome, params );
}
}
-function spawn_test() {
+function spawn_test(d) {
var chrome = 'chrome://evergreen/content/patron/patron_edit.xul';
var params = { 'barcode':'101010101010101' };
- var w = tabWindow.replace_tab('main_tabbox','TEST',chrome,params);
+ var w = replace_tab(d,'main_tabbox','TEST',chrome,params);
}