[open-ils-commits] r12254 - trunk/Open-ILS/xul/staff_client/server/cat (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Feb 21 20:07:50 EST 2009
Author: phasefx
Date: 2009-02-21 20:07:49 -0500 (Sat, 21 Feb 2009)
New Revision: 12254
Added:
trunk/Open-ILS/xul/staff_client/server/cat/opac.js
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/opac.xul
Log:
backporting from staff-client-experiment: refactor the remote xul opac wrapper. But sadly, a browser element in remote xul can't utilize back/forward history navigation, so we're still using the chrome version for now
Added: trunk/Open-ILS/xul/staff_client/server/cat/opac.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/opac.js (rev 0)
+++ trunk/Open-ILS/xul/staff_client/server/cat/opac.js 2009-02-22 01:07:49 UTC (rev 12254)
@@ -0,0 +1,341 @@
+var docid; var marc_html; var top_pane; var bottom_pane; var opac_frame; var opac_url;
+
+var marc_view_reset = true;
+var marc_edit_reset = true;
+var copy_browser_reset = true;
+var hold_browser_reset = true;
+
+function $(id) { return document.getElementById(id); }
+
+function my_init() {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ if (typeof JSAN == 'undefined') { throw(document.getElementById('offlineStrings').getString('common.jsan.missing')); }
+ JSAN.errorLevel = "die"; // none, warn, or die
+ JSAN.addRepository('..');
+ JSAN.use('util.error'); g.error = new util.error();
+ g.error.sdump('D_TRACE','my_init() for cat/opac.xul');
+
+ JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
+ XML_HTTP_SERVER = g.data.server_unadorned;
+
+ JSAN.use('util.network'); g.network = new util.network();
+
+ g.cgi = new CGI();
+ try { authtime = g.cgi.param('authtime') || xulG.authtime; } catch(E) { g.error.sdump('D_ERROR',E); }
+ try { docid = g.cgi.param('docid') || xulG.docid; } catch(E) { g.error.sdump('D_ERROR',E); }
+ try { opac_url = g.cgi.param('opac_url') || xulG.opac_url; } catch(E) { g.error.sdump('D_ERROR',E); }
+
+ JSAN.use('util.deck');
+ top_pane = new util.deck('top_pane');
+ bottom_pane = new util.deck('bottom_pane');
+
+ set_opac();
+
+ } catch(E) {
+ var err_msg = document.getElementById("offlineStrings").getFormattedString("common.exception", ["cat/opac.xul", E]);
+ try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
+ alert(err_msg);
+ }
+}
+
+function set_brief_view() {
+ var url = xulG.url_prefix( urls.XUL_BIB_BRIEF ) + '?docid=' + window.escape(docid);
+ dump('spawning ' + url + '\n');
+ top_pane.set_iframe(
+ url,
+ {},
+ {
+ 'set_tab_name' : function(n) {
+ if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
+ try { window.xulG.set_tab_name(document.getElementById('offlineStrings').getFormattedString("cat.bib_record", [n])); } catch(E) { alert(E); }
+ } else {
+ dump('no set_tab_name\n');
+ }
+ }
+ }
+ );
+}
+
+function set_marc_view() {
+ g.view = 'marc_view';
+ if (marc_view_reset) {
+ bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_MARC_VIEW ) + '?docid=' + window.escape(docid),{},xulG);
+ marc_view_reset = false;
+ } else {
+ bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_MARC_VIEW ) + '?docid=' + window.escape(docid),{},xulG);
+ }
+}
+
+function set_marc_edit() {
+ g.view = 'marc_edit';
+ var a = xulG.url_prefix( urls.XUL_MARC_EDIT );
+ var b = {};
+ var c = {
+ 'record' : { 'url' : '/opac/extras/supercat/retrieve/marcxml/record/' + docid },
+ 'save' : {
+ 'label' : document.getElementById('offlineStrings').getString('cat.save_record'),
+ 'func' : function (new_marcxml) {
+ try {
+ var r = g.network.simple_request('MARC_XML_RECORD_UPDATE', [ ses(), docid, new_marcxml ]);
+ marc_view_reset = true;
+ copy_browser_reset = true;
+ hold_browser_reset = true;
+ if (typeof r.ilsevent != 'undefined') {
+ throw(r);
+ } else {
+ alert(document.getElementById('offlineStrings').getString("cat.save.success"));
+ }
+ } catch(E) {
+ g.error.standard_unexpected_error_alert(document.getElementById('offlineStrings').getString("cat.save.failure"), E);
+ }
+ }
+ }
+ };
+ if (marc_edit_reset) {
+ bottom_pane.reset_iframe( a,b,c );
+ marc_edit_reset = false;
+ } else {
+ bottom_pane.set_iframe( a,b,c );
+ }
+}
+
+function set_copy_browser() {
+ g.view = 'copy_browser';
+ if (copy_browser_reset) {
+ bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_COPY_VOLUME_BROWSE ) + '?docid=' + window.escape(docid),{},xulG);
+ copy_browser_reset =false;
+ } else {
+ bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_COPY_VOLUME_BROWSE ) + '?docid=' + window.escape(docid),{},xulG);
+ }
+}
+
+function set_hold_browser() {
+ g.view = 'hold_browser';
+ if (hold_browser_reset) {
+ bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_HOLDS_BROWSER ) + '?docid=' + window.escape(docid),{},xulG);
+ hold_browser_reset = false;
+ } else {
+ bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_HOLDS_BROWSER ) + '?docid=' + window.escape(docid),{},xulG);
+ }
+}
+
+function set_opac() {
+ g.view = 'opac';
+ try {
+ var content_params = {
+ 'show_nav_buttons' : true,
+ 'show_print_button' : true,
+ 'passthru_content_params' : {
+ 'authtoken' : ses(),
+ 'authtime' : ses('authtime'),
+ 'window_open' : function(a,b,c) {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
+ return window.open(a,b,c);
+ } catch(E) {
+ g.error.standard_unexpected_error_alert('window_open',E);
+ }
+ }
+ },
+ 'on_url_load' : function(f) {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var win;
+ try {
+ if (typeof f.contentWindow.wrappedJSObject.attachEvt != 'undefined') {
+ win = f.contentWindow.wrappedJSObject;
+ } else {
+ win = f.contentWindow;
+ }
+ } catch(E) {
+ win = f.contentWindow;
+ }
+ win.attachEvt("rdetail", "recordRetrieved",
+ function(id){
+ try {
+ if (docid == id) return;
+ docid = id;
+ refresh_display(id);
+ } catch(E) {
+ g.error.standard_unexpected_error_alert('rdetail -> recordRetrieved',E);
+ }
+ }
+ );
+
+ g.f_record_start = null; g.f_record_prev = null; g.f_record_next = null; g.f_record_end = null;
+ $('record_start').disabled = true; $('record_next').disabled = true;
+ $('record_prev').disabled = true; $('record_end').disabled = true;
+ $('record_pos').setAttribute('value','');
+
+ win.attachEvt("rdetail", "nextPrevDrawn",
+ function(rIndex,rCount){
+ $('record_pos').setAttribute('value', document.getElementById('offlineStrings').getFormattedString('cat.record.counter', [(1+rIndex), rCount]));
+ if (win.rdetailNext) {
+ g.f_record_next = function() {
+ g.view_override = g.view;
+ win.rdetailNext();
+ }
+ $('record_next').disabled = false;
+ }
+ if (win.rdetailPrev) {
+ g.f_record_prev = function() {
+ g.view_override = g.view;
+ win.rdetailPrev();
+ }
+ $('record_prev').disabled = false;
+ }
+ if (win.rdetailStart) {
+ g.f_record_start = function() {
+ g.view_override = g.view;
+ win.rdetailStart();
+ }
+ $('record_start').disabled = false;
+ }
+ if (win.rdetailEnd) {
+ g.f_record_end = function() {
+ g.view_override = g.view;
+ win.rdetailEnd();
+ }
+ $('record_end').disabled = false;
+ }
+ }
+ );
+ },
+ 'url_prefix' : xulG.url_prefix,
+ };
+ if (opac_url) { content_params.url = opac_url; } else { content_params.url = xulG.url_prefix( urls.browser ); }
+ browser_frame = bottom_pane.set_iframe( xulG.url_prefix(urls.XUL_REMOTE_BROWSER) + '?name=Catalog', {}, content_params);
+ } catch(E) {
+ g.error.sdump('D_ERROR','set_opac: ' + E);
+ }
+}
+
+function bib_in_new_tab() {
+ try {
+ var url = browser_frame.contentWindow.g.browser.controller.view.browser_browser.contentWindow.wrappedJSObject.location.href;
+ var content_params = { 'session' : ses(), 'authtime' : ses('authtime'), 'opac_url' : url };
+ xulG.new_tab(xulG.url_prefix(urls.XUL_OPAC_WRAPPER), {}, content_params);
+ } catch(E) {
+ g.error.sdump('D_ERROR',E);
+ }
+}
+
+function remove_me() {
+ var url = xulG.url_prefix( urls.XUL_BIB_BRIEF ) + '?docid=' + window.escape(docid);
+ dump('removing ' + url + '\n');
+ try { top_pane.remove_iframe( url ); } catch(E) { dump(E + '\n'); }
+ $('nav').setAttribute('hidden','true');
+}
+
+function add_to_bucket() {
+ JSAN.use('util.window'); var win = new util.window();
+ win.open(
+ xulG.url_prefix(urls.XUL_RECORD_BUCKETS_QUICK)
+ + '?record_ids=' + js2JSON( [ docid ] ),
+ 'sel_bucket_win' + win.window_name_increment(),
+ 'chrome,resizable,modal,center'
+ );
+}
+
+function mark_for_overlay() {
+ g.data.marked_record = docid;
+ g.data.stash('marked_record');
+ var robj = g.network.simple_request('MODS_SLIM_RECORD_RETRIEVE.authoritative',[docid]);
+ if (typeof robj.ilsevent == 'undefined') {
+ g.data.marked_record_mvr = robj;
+ } else {
+ g.data.marked_record_mvr = null;
+ g.error.standard_unexpected_error_alert('in mark_for_overlay',robj);
+ }
+ g.data.stash('marked_record_mvr');
+ if (g.data.marked_record_mvr) {
+ alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_marked_for_overlay.tcn.alert',[ g.data.marked_record_mvr.tcn() ]));
+ } else {
+ alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_marked_for_overlay.record_id.alert',[ g.data.marked_record ]));
+ }
+}
+
+function delete_record() {
+ if (g.error.yns_alert(
+ document.getElementById('offlineStrings').getFormattedString('cat.opac.delete_record.confirm', [docid]),
+ document.getElementById('offlineStrings').getString('cat.opac.delete_record'),
+ document.getElementById('offlineStrings').getString('cat.opac.delete'),
+ document.getElementById('offlineStrings').getString('cat.opac.cancel'),
+ null,
+ document.getElementById('offlineStrings').getString('cat.opac.record_deleted.confirm')) == 0) {
+ var robj = g.network.simple_request('FM_BRE_DELETE',[ses(),docid]);
+ if (typeof robj.ilsevent != 'undefined') {
+ alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_deleted.error', [docid, robj.textcode, robj.desc]) + '\n');
+ } else {
+ alert(document.getElementById('offlineStrings').getString('cat.opac.record_deleted'));
+ refresh_display(docid);
+ }
+ }
+}
+
+function undelete_record() {
+ if (g.error.yns_alert(
+ document.getElementById('offlineStrings').getFormattedString('cat.opac.undelete_record.confirm', [docid]),
+ document.getElementById('offlineStrings').getString('cat.opac.undelete_record'),
+ document.getElementById('offlineStrings').getString('cat.opac.undelete'),
+ document.getElementById('offlineStrings').getString('cat.opac.cancel'),
+ null,
+ document.getElementById('offlineStrings').getString('cat.opac.record_undeleted.confirm')) == 0) {
+
+ var robj = g.network.simple_request('FM_BRE_UNDELETE',[ses(),docid]);
+ if (typeof robj.ilsevent != 'undefined') {
+ alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_undeleted.error', [docid, robj.textcode, robj.desc]) + '\n');
+ } else {
+ alert(document.getElementById('offlineStrings').getString('cat.opac.record_undeleted'));
+ refresh_display(docid);
+ }
+ }
+}
+
+function refresh_display(id) {
+ try {
+ marc_view_reset = true;
+ marc_edit_reset = true;
+ copy_browser_reset = true;
+ hold_browser_reset = true;
+ while(top_pane.node.lastChild) top_pane.node.removeChild( top_pane.node.lastChild );
+ var children = bottom_pane.node.childNodes;
+ for (var i = 0; i < children.length; i++) {
+ if (children[i] != browser_frame) bottom_pane.node.removeChild(children[i]);
+ }
+
+ set_brief_view();
+ $('nav').setAttribute('hidden','false');
+ var settings = g.network.simple_request(
+ 'FM_AUS_RETRIEVE',
+ [ ses(), g.data.list.au[0].id() ]
+ );
+ var view = settings['staff_client.catalog.record_view.default'];
+ if (g.view_override) {
+ view = g.view_override;
+ g.view_override = null;
+ }
+ switch(view) {
+ case 'marc_view' : set_marc_view(); break;
+ case 'marc_edit' : set_marc_edit(); break;
+ case 'copy_browser' : set_copy_browser(); break;
+ case 'hold_browser' : set_hold_browser(); break;
+ case 'opac' :
+ default: set_opac(); break;
+ }
+ } catch(E) {
+ g.error.standard_unexpected_error_alert('in refresh_display',E);
+ }
+}
+
+function set_default() {
+ var robj = g.network.simple_request(
+ 'FM_AUS_UPDATE',
+ [ ses(), g.data.list.au[0].id(), { 'staff_client.catalog.record_view.default' : g.view } ]
+ )
+ if (typeof robj.ilsevent != 'undefined') {
+ if (robj.ilsevent != 0) g.error.standard_unexpected_error_alert(document.getElementById('offlineStrings').getString('cat.preference.error'), robj);
+ }
+}
+
+
Modified: trunk/Open-ILS/xul/staff_client/server/cat/opac.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/opac.xul 2009-02-22 01:06:37 UTC (rev 12253)
+++ trunk/Open-ILS/xul/staff_client/server/cat/opac.xul 2009-02-22 01:07:49 UTC (rev 12254)
@@ -5,12 +5,12 @@
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- STYLESHEETS -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- LOCALIZATION -->
-<!DOCTYPE window PUBLIC "" ""[
- <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+<!DOCTYPE window PUBLIC "" "" [
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
]>
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
@@ -30,333 +30,41 @@
<scripts id="openils_util_scripts"/>
<script type="text/javascript" src="/xul/server/main/JSAN.js"/>
- <script>
- <![CDATA[
- function $(id) { return document.getElementById(id); }
- function $w(id,text) { if ($(id)) util.widgets.set_text($(id),text); }
-
- var docid; var marc_html; var top_pane; var bottom_pane; var opac_frame;
- var browser_frame; var browser_obj; var browser_win;
- var editor_obj;
- var holdings_obj;
- var holds_obj;
-
- var iframe_method = 'reset_iframe'; // set_iframe
-
- function my_init() {
- try {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- if (typeof JSAN == 'undefined') { throw( $("commonStrings").getString('common.jsan.missing') ); }
- JSAN.errorLevel = "die"; // none, warn, or die
- JSAN.addRepository('/xul/server/');
- JSAN.use('util.error'); g.error = new util.error();
- g.error.sdump('D_TRACE','my_init() for cat/opac.xul');
-
- JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
- XML_HTTP_SERVER = data.server_unadorned;
-
- JSAN.use('util.network'); g.network = new util.network();
-
- try { authtime = xul_param('authtime'); } catch(E) { g.error.sdump('D_ERROR',E); }
- try { docid = xul_param('docid'); } catch(E) { g.error.sdump('D_ERROR',E); }
- try { opac_url = xul_param('opac_url'); } catch(E) { g.error.sdump('D_ERROR',E); }
-
- JSAN.use('util.deck');
- top_pane = new util.deck('top_pane');
- bottom_pane = new util.deck('bottom_pane');
-
- set_opac();
-
- } catch(E) {
- var err_msg = $("commonStrings").getFormattedString('common.exception', ['cat/opac.xul', E]);
- try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
- alert(err_msg);
- }
- }
-
- function set_brief_view() {
- try {
- var url = xulG.url_prefix( urls.XUL_BIB_BRIEF ); // + '?docid=' + window.escape(docid);
- dump('spawning ' + url + '\n');
- top_pane[iframe_method](
- url,
- {},
- {
- 'docid' : docid,
- 'set_tab_name' : function(n) {
- if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
- try { window.xulG.set_tab_name($("catStrings").getFormattedString('staff.cat.opac.set_tab_name', [n])); } catch(E) { alert(E); }
- } else {
- dump('no set_tab_name\n');
- }
- }
- }
- );
- } catch(E) {
- alert(E);
- }
- }
-
- function set_marc_view() {
- try {
- bottom_pane[iframe_method](
- xulG.url_prefix( urls.XUL_MARC_VIEW ), // + '?docid=' + window.escape(docid),
- {},
- {
- 'docid' : docid,
- }
- );
- } catch(E) {
- alert(E);
- }
- }
-
- function set_marc_edit() {
- try {
- bottom_pane.node.selectedIndex = 1;
- var content_params = {
- 'show_nav_buttons' : false,
- 'show_print_button' : false,
- 'passthru_content_params' : {
- 'record' : { 'url' : '/opac/extras/supercat/retrieve/marcxml/record/' + docid },
- 'save' : {
- 'label' : 'Save Record',
- 'func' : function (new_marcxml) {
- try {
- var r = g.network.simple_request('MARC_XML_RECORD_UPDATE', [ ses(), docid, new_marcxml ]);
- if (typeof r.ilsevent != 'undefined') {
- throw(r);
- } else {
- alert( $("catStrings").getString('staff.cat.opac.set_marc_edit.alert') );
- }
- } catch(E) {
- g.error.standard_unexpected_error_alert( $("catStrings").getString('staff.cat.opac.set_marc_edit.std_unexpected_error'), E );
- }
- }
- },
- },
- 'url' : xulG.url_prefix( urls.XUL_MARC_EDIT ),
- 'name' : 'MarcEditor',
- };
- if (editor_obj) return;
- JSAN.use('util.browser');
- editor_obj = new util.browser();
- editor_obj.init(
- {
- 'url' : xulG.url_prefix(urls.XUL_REMOTE_BROWSER), // + '?name=MarcEditor',
- 'push_xulG' : true,
- 'alt_print' : false,
- 'browser_id' : 'editor',
- 'passthru_content_params' : content_params,
- }
- );
- } catch(E) {
- g.error.sdump('D_ERROR','set_marc_edit: ' + E);
- alert('set_marc_edit: ' + E);
- }
- }
-
- function set_copy_browser() {
- try {
- bottom_pane.node.selectedIndex = 2;
- xulG.docid = docid;
- var content_params = {
- 'show_nav_buttons' : false,
- 'show_print_button' : false,
- 'passthru_content_params' : xulG,
- 'url' : xulG.url_prefix( urls.XUL_COPY_VOLUME_BROWSE ), // + '?docid=' + window.escape(docid),
- 'name' : 'HoldingsMaintenance',
- };
- if (holdings_obj) return;
- JSAN.use('util.browser');
- holdings_obj = new util.browser();
- holdings_obj.init(
- {
- 'url' : xulG.url_prefix(urls.XUL_REMOTE_BROWSER), // + '?name=HoldingsMaintenance',
- 'push_xulG' : true,
- 'alt_print' : false,
- 'browser_id' : 'holdings',
- 'passthru_content_params' : content_params,
- }
- );
-
- //bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_COPY_VOLUME_BROWSE ) + '?docid=' + window.escape(docid),{},xulG);
- } catch(E) {
- alert(E);
- }
- }
-
- function set_hold_browser() {
- try {
- bottom_pane.node.selectedIndex = 3;
- xulG.docid = docid;
- var content_params = {
- 'show_nav_buttons' : false,
- 'show_print_button' : false,
- 'passthru_content_params' : xulG,
- 'url' : xulG.url_prefix( urls.XUL_HOLDS_BROWSER ), // + '?docid=' + window.escape(docid),
- 'name' : 'Holds',
- };
- if (holds_obj) return;
- JSAN.use('util.browser');
- holds_obj = new util.browser();
- holds_obj.init(
- {
- 'url' : xulG.url_prefix(urls.XUL_REMOTE_BROWSER), // + '?name=Holds',
- 'push_xulG' : true,
- 'alt_print' : false,
- 'browser_id' : 'holds',
- 'passthru_content_params' : content_params,
- }
- );
- //bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_HOLDS_BROWSER ) + '?docid=' + window.escape(docid),{},xulG);
- } catch(E) {
- alert(E);
- }
- }
-
- function set_opac() {
- try {
- bottom_pane.node.selectedIndex = 0;
- var content_params = {
- 'show_nav_buttons' : true,
- 'show_print_button' : true,
- 'passthru_content_params' : {
- 'authtoken' : ses(),
- 'authtime' : ses('authtime'),
- 'window_open' : function(a,b,c) {
- try {
- netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
- return window.open(a,b,c);
- } catch(E) {
- g.error.standard_unexpected_error_alert('window_open',E);
- }
- }
- },
- 'on_url_load' : function(f) {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- var win;
- try {
- if (typeof f.contentWindow.wrappedJSObject.attachEvt != 'undefined') {
- win = f.contentWindow.wrappedJSObject;
- } else {
- win = f.contentWindow;
- }
- } catch(E) {
- win = f.contentWindow;
- }
- browser_win = win;
- win.attachEvt("rdetail", "recordRetrieved",
- function(id){
- try {
- docid = id;
- browser_obj = null; editor_obj = null; holdings_obj = null; holds_obj = null;
- top_pane.clear(); bottom_pane.clear();
- set_brief_view();
- document.getElementById('nav').setAttribute('hidden','false');
- } catch(E) {
- g.error.standard_unexpected_error_alert('rdetail -> recordRetrieved',E);
- }
- }
- );
- },
- 'url_prefix' : xulG.url_prefix,
- 'name' : 'Catalog',
- };
- if (opac_url) content_params.url = opac_url;
- if (browser_obj) return;
- JSAN.use('util.browser');
- browser_obj = new util.browser();
- browser_obj.init(
- {
- 'url' : xulG.url_prefix(urls.XUL_REMOTE_BROWSER), // + '?name=Catalog',
- 'push_xulG' : true,
- 'alt_print' : false,
- 'browser_id' : 'browser',
- 'passthru_content_params' : content_params,
- }
- );
- //browser_frame = bottom_pane.set_browser( xulG.url_prefix(urls.XUL_REMOTE_BROWSER) + '?name=Catalog', {}, content_params);
- } catch(E) {
- g.error.sdump('D_ERROR','set_opac: ' + E);
- alert('set_opac: ' + E);
- }
- }
-
- function bib_in_new_tab() {
- try {
- netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
- var url = browser_win.location.href;
- var content_params = { 'session' : ses(), 'authtime' : ses('authtime'), 'opac_url' : url };
- xulG.new_tab(xulG.url_prefix(urls.XUL_OPAC_WRAPPER), {}, content_params);
- } catch(E) {
- g.error.sdump('D_ERROR',E);
- alert(E);
- }
- }
-
- function remove_me() {
- try {
- browser_obj = null; editor_obj = null; holdings_obj = null; holds_obj = null;
- top_pane.clear(); bottom_pane.clear();
- document.getElementById('nav').setAttribute('hidden','true');
- } catch(E) {
- alert(E);
- }
- }
-
- function add_to_bucket() {
- try {
- JSAN.use('util.window'); var win = new util.window();
- win.open(
- xulG.url_prefix(urls.XUL_RECORD_BUCKETS),
- //+ '?record_ids=' + js2JSON( [ docid ] ),
- 'sel_bucket_win' + win.window_name_increment(),
- 'chrome,resizable,modal,center',
- { 'record_ids' : [ docid ] }
- );
- } catch(E) {
- alert(E);
- }
- }
-
- function refresh() {
- alert( $("catStrings").getString('staff.cat.opac.refresh.function_not_implemented.alert') );
- }
- ]]>
- </script>
+ <script type="text/javascript" src="/xul/server/cat/opac.js"/>
- <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
- <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
-
- <commandset><command id="cmd_forward"/><command id="cmd_back"/></commandset>
-
<vbox flex="1">
<deck id="top_pane"/>
- <splitter><grippy/></splitter>
- <menubar id="nav" hidden="true">
- <menu label="&staff.cat.opac.menu.label;" accesskey="&staff.cat.opac.menu.accesskey;">
- <menupopup>
- <menuitem label="&staff.cat.opac.menuitem.opacview.label;" accesskey="&staff.cat.opac.menuitem.opacview.accesskey;" id="opac_view" oncommand="set_opac();"/>
- <menuitem label="&staff.cat.opac.menuitem.marcview.label;" accesskey="&staff.cat.opac.menuitem.marcview.accesskey;" id="marc_view" oncommand="set_marc_view();"/>
- <menuitem label="&staff.cat.opac.menuitem.marcedit.label;" accesskey="&staff.cat.opac.menuitem.marcedit.accesskey;" id="marc_edit" oncommand="set_marc_edit();"/>
- <menuitem label="&staff.cat.opac.menuitem.holding.label;" accesskey="&staff.cat.opac.menuitem.holding.accesskey;" id="copy_browse" oncommand="set_copy_browser();"/>
- <menuitem label="&staff.cat.opac.menuitem.viewholds.label;" accesskey="&staff.cat.opac.menuitem.viewholds.accesskey;" id="view_holds" oncommand="set_hold_browser();"/>
- <menuseparator/>
- <menuitem label="&staff.cat.opac.menuitem.addtobucket.label;" accesskey="&staff.cat.opac.menuitem.addtobucket.accesskey;" id="add_bucket" oncommand="add_to_bucket();"/>
- <menuseparator/>
- <menuitem label="&staff.cat.opac.menuitem.refreshinterfaces.label;" id="refresh" oncommand="refresh();"/>
- <menuitem label="&staff.cat.opac.menuitem.dupnewtab.label;" id="bib_in_new_tab" oncommand="bib_in_new_tab();"/>
- <menuitem label="&staff.cat.opac.menuitem.removeframe.label;" id="remove_me" oncommand="remove_me();"/>
- </menupopup>
- </menu>
- </menubar>
- <deck id="bottom_pane" flex="1">
- <browser id="browser"/>
- <browser id="editor"/>
- <browser id="holdings"/>
- <browser id="holds"/>
- </deck>
+ <hbox id="nav" hidden="true">
+ <label id="record_pos"/>
+ <button id="record_start" accesskey="&staff.cat.opac.record_start.accesskey;" label="&staff.cat.opac.record_start.label;" oncommand="if (g.f_record_start) g.f_record_start();"/>
+ <button id="record_prev" accesskey="&staff.cat.opac.record_prev.accesskey;" label="&staff.cat.opac.record_prev.label;" oncommand="if (g.f_record_prev) g.f_record_prev();"/>
+ <button id="record_next" accesskey="&staff.cat.opac.record_next.accesskey;" label="&staff.cat.opac.record_next.label;" oncommand="if (g.f_record_next) g.f_record_next();"/>
+ <button id="record_end" accesskey="&staff.cat.opac.record_end.accesskey;" label="&staff.cat.opac.record_end.label;" oncommand="if (g.f_record_end) g.f_record_end();"/>
+ <spacer flex="1"/>
+ <menubar>
+ <menu label="&staff.cat.opac.menu.label;" accesskey="&staff.cat.opac.menu.accesskey;">
+ <menupopup>
+ <menuitem label="&staff.cat.opac.opac_view.label;" accesskey="" id="opac_view" oncommand="set_opac();"/>
+ <menuitem label="&staff.cat.opac.marc_view.label;" accesskey="&staff.cat.opac.marc_view.accesskey;" id="marc_view" oncommand="set_marc_view();"/>
+ <menuitem label="&staff.cat.opac.marc_edit.label;" accesskey="&staff.cat.opac.marc_edit.accesskey;" id="marc_edit" oncommand="set_marc_edit();"/>
+ <menuitem label="&staff.cat.opac.copy_browse.label;" accesskey="&staff.cat.opac.copy_browse.accesskey;" id="copy_browse" oncommand="set_copy_browser();"/>
+ <menuitem label="&staff.cat.opac.view_holds.label;" accesskey="&staff.cat.opac.view_holds.accesskey;" id="view_holds" oncommand="set_hold_browser();"/>
+ <menuseparator/>
+ <menuitem label="&staff.cat.opac.add_bucket.label;" accesskey="&staff.cat.opac.add_bucket.accesskey;" id="add_bucket" oncommand="add_to_bucket();"/>
+ <menuitem label="&staff.cat.opac.mark_for_overlay.label;" accesskey="&staff.cat.opac.mark_for_overlay.accesskey;" id="mark_for_overlay" oncommand="mark_for_overlay();"/>
+ <menuitem label="&staff.cat.opac.delete_record.label;" accesskey="&staff.cat.opac.delete_record.accesskey;" id="delete_record" oncommand="delete_record();"/>
+ <menuitem label="&staff.cat.opac.undelete_record.label;" accesskey="&staff.cat.opac.undelete_record.accesskey;" id="undelete_record" oncommand="undelete_record();"/>
+ <menuseparator/>
+ <menuitem label="&staff.cat.opac.bib_in_new_tab.label;" id="bib_in_new_tab" oncommand="bib_in_new_tab();"/>
+ <menuitem label="&staff.cat.opac.remove_me.label;" id="remove_me" oncommand="remove_me();"/>
+ <menuseparator/>
+ <menuitem label="&staff.cat.opac.default.label;" id="default" oncommand="set_default();"/>
+ <menuitem label="&staff.cat.opac.refresh_me.label;" id="refresh_me" oncommand="refresh_display(docid);"/>
+ </menupopup>
+ </menu>
+ </menubar>
+ </hbox>
+ <deck id="bottom_pane" flex="1"/>
</vbox>
</window>
More information about the open-ils-commits
mailing list