<!ENTITY staff.search_prefs.search_lib.description "The default search library setting determines what library is searched from the advanced search screen and portal page by default. Manual selection of a search library will override it. One recommendation is to set the search library to the highest point you would normally want to search.">
<!ENTITY staff.search_prefs.pref_lib.caption "Preferred Library">
<!ENTITY staff.search_prefs.pref_lib.description "The preferred library is used to show copies and URIs regardless of the library searched. One recommendation is to set this to your workstation library so that local copies show up first in search results.">
+<!ENTITY staff.search_prefs.adv_pane.caption "Advanced Search Default Pane">
+<!ENTITY staff.search_prefs.adv_pane.description "Advanced search has secondary panes for Numeric and MARC Expert searching. You can change which one is loaded by default when opening a new catalog window here.">
+<!ENTITY staff.search_prefs.adv_pane.advanced "Advanced (default)">
+<!ENTITY staff.search_prefs.adv_pane.numeric "Numeric">
+<!ENTITY staff.search_prefs.adv_pane.expert "MARC Expert">
<!ENTITY staff.search_prefs.save.label "Save">
<!ENTITY staff.search_prefs.save.accesskey "S">
<!ENTITY staff.search_prefs.saved_message "Preferences saved">
+<!ENTITY staff.search_prefs.clear.label "Clear All">
+<!ENTITY staff.search_prefs.clear.accesskey "C">
+<!ENTITY staff.search_prefs.cleared_message "Preferences cleared">
} else {
content_params.url = xulG.url_prefix( 'browser', secure_opac );
}
+ if (g.data.adv_pane) {
+ // For fun, we can have no extra params, extra params with &, or extra params with ;.
+ if (content_params.url.indexOf('?') < 0)
+ content_params.url += '?';
+ else if (content_params.url.indexOf('&') >= 0)
+ content_params.url += '&';
+ else
+ content_params.url += ';';
+ content_params.url += 'pane=' + g.data.adv_pane;
+ }
browser_frame = bottom_pane.set_iframe( xulG.url_prefix('XUL_BROWSER?name=Catalog'), {}, content_params);
/* // Remember to use the REMOTE_BROWSER if we ever try to move this to remote xul again
browser_frame = bottom_pane.set_iframe( xulG.url_prefix('XUL_REMOTE_BROWSER?name=Catalog'), {}, content_params);
G.data.server_unadorned = url; G.data.stash('server_unadorned'); G.data.stash_retrieve();
try {
G.data.search_lib = G.pref.getIntPref('open-ils.' + url + '.search_lib');
- G.data.pref_lib = G.pref.getIntPref('open-ils.' + url + '.pref_lib');
} catch(E) {
G.data.search_lib = null;
+ }
+ try {
+ G.data.pref_lib = G.pref.getIntPref('open-ils.' + url + '.pref_lib');
+ } catch(E) {
G.data.pref_lib = null;
}
+ try {
+ G.data.adv_pane = G.pref.getCharPref('open-ils.' + url + '.adv_pane');
+ } catch(E) {
+ G.data.adv_pane = null;
+ }
G.data.stash('search_lib');
G.data.stash('pref_lib');
+ G.data.stash('adv_pane');
if (! url.match( '^(http|https)://' ) ) { url = 'http://' + url; }
var g = {};
var search_lib_box;
var pref_lib_box;
+ var adv_pane_box;
var prefSvc;
var data;
var saved_message;
+ var cleared_message;
function my_init() {
JSAN.use('OpenILS.data');
data = new OpenILS.data();
data.init({'via':'stash'});
search_lib_box = document.getElementById('search_lib');
pref_lib_box = document.getElementById('pref_lib');
+ adv_pane_box = document.getElementById('adv_pane');
// NOTE: If this ever deals with custom trees, this is where you likely want to mess with things.
add_aou(data.tree.aou, '');
prefSvc = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch).QueryInterface(Components.interfaces.nsIPrefBranch2);
saved_message = document.getElementById('saved_message').textContent;
+ cleared_message = document.getElementById('cleared_message').textContent;
if (data.search_lib) {
search_lib_box.value = data.search_lib;
- pref_lib_box.value = data.pref_lib;
} else {
search_lib_box.selectedIndex = 0;
+ }
+ if (data.pref_lib) {
+ pref_lib_box.value = data.pref_lib;
+ } else {
pref_lib_box.selectedIndex = 0;;
}
+ if (data.adv_pane) {
+ adv_pane_box.value = data.adv_pane;
+ } else {
+ adv_pane_box.selectedIndex = 0;
+ }
}
function add_aou(aou, depth) {
search_lib_box.appendItem(depth + aou.name(), aou.id(), '');
function update_prefs() {
prefSvc.setIntPref('open-ils.' + data.server_unadorned + '.search_lib', search_lib_box.value);
prefSvc.setIntPref('open-ils.' + data.server_unadorned + '.pref_lib', pref_lib_box.value);
+ prefSvc.setCharPref('open-ils.' + data.server_unadorned + '.adv_pane', adv_pane_box.value);
data.search_lib = search_lib_box.value;
data.pref_lib = pref_lib_box.value;
+ data.adv_pane = adv_pane_box.value;
data.stash('search_lib');
data.stash('pref_lib');
+ data.stash('adv_pane');
alert(saved_message);
}
+ function clear_prefs() {
+ prefSvc.clearUserPref('open-ils.' + data.server_unadorned + '.search_lib');
+ prefSvc.clearUserPref('open-ils.' + data.server_unadorned + '.pref_lib');
+ prefSvc.clearUserPref('open-ils.' + data.server_unadorned + '.adv_pane');
+ data.search_lib = null;
+ data.pref_lib = null;
+ data.adv_pane = null;
+ data.stash('search_lib');
+ data.stash('pref_lib');
+ data.stash('adv_pane');
+ alert(cleared_message);
+ }
]]>
</script>
<commandset id="search_prefs_cmds">
<command id="save_search_prefs" oncommand="update_prefs()" />
+ <command id="clear_search_prefs" oncommand="clear_prefs()" />
</commandset>
<vbox id="search_prefs_main">
<groupbox>
</menupopup>
</menulist>
</groupbox>
+ <groupbox>
+ <caption label="&staff.search_prefs.adv_pane.caption;"/>
+ <description>&staff.search_prefs.adv_pane.description;</description>
+ <menulist id="adv_pane">
+ <menupopup>
+ <menuitem label="&staff.search_prefs.adv_pane.advanced;" value="advanced" />
+ <menuitem label="&staff.search_prefs.adv_pane.numeric;" value="numeric" />
+ <menuitem label="&staff.search_prefs.adv_pane.expert;" value="expert" />
+ </menupopup>
+ </menulist>
+ </groupbox>
<button id="save_button" command="save_search_prefs" label="&staff.search_prefs.save.label;" accesskey="&staff.search_prefs.save.accesskey;"/>
+ <button id="clear_button" command="clear_search_prefs" label="&staff.search_prefs.clear.label;" accesskey="&staff.search_prefs.clear.accesskey;"/>
</vbox>
<description id="saved_message" style="display:none">&staff.search_prefs.saved_message;</description>
+ <description id="cleared_message" style="display:none">&staff.search_prefs.cleared_message;</description>
</window>