<!ENTITY staff.main.menu.admin.client.toolbars.label_position "Label Position">
<!ENTITY staff.main.menu.admin.client.toolbars.label_position.side "Next to icons">
<!ENTITY staff.main.menu.admin.client.toolbars.label_position.under "Under icons">
+<!ENTITY staff.main.menu.admin.client.copy_editor.copy_location.label "Copy Editor: Copy Location Name First">
<!ENTITY staff.main.menu.admin.non_cat_type_edit.accesskey "n">
<!ENTITY staff.main.menu.admin.non_cat_type_edit.label "Non-Cataloged Type Editor">
<!ENTITY staff.main.menu.admin.offline_xacts.accesskey "T">
G = {};
G.pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
+ G.pref.QueryInterface(Components.interfaces.nsIPrefBranch2);
if (! G.pref.prefHasUserValue('general.useragent.override')) {
G.pref.setCharPref('general.useragent.override',navigator.userAgent + ' oils_xulrunner /xul/server/');
}
}
}
+ var cl_first = xulG.pref.getBoolPref('oils.copy_editor.copy_location_name_first');
+ var menuitems = document.getElementsByAttribute('command','cmd_copy_editor_copy_location_first_toggle');
+ for(var i = 0; i < menuitems.length; i++)
+ menuitems[i].setAttribute('checked', cl_first ? 'true' : 'false');
+
+ xulG.pref.addObserver('', this, false);
+ window.addEventListener("unload", function(e) { this.stop_observing(); }, false);
+
var network_meter = String( obj.data.hash.aous['ui.network.progress_meter'] ) == 'true';
if (! network_meter) {
var x = document.getElementById('network_progress');
}
}
],
+ 'cmd_copy_editor_copy_location_first_toggle' : [
+ ['oncommand'],
+ function() {
+ var curvalue = xulG.pref.getBoolPref('oils.copy_editor.copy_location_name_first');
+ xulG.pref.setBoolPref('oils.copy_editor.copy_location_name_first', !curvalue);
+ }
+ ],
};
JSAN.use('util.controller');
else
// user_false is used to indicate the user said "None of the above" to avoid fall-through erroring later.
return "user_false";
+ },
+
+ 'observe' : function(subject, topic, data) {
+ if (topic != "nsPref:changed") {
+ return;
+ }
+
+ switch(data) {
+ case 'oils.copy_editor.copy_location_name_first':
+ var cl_first = xulG.pref.getBoolPref('oils.copy_editor.copy_location_name_first');
+ var menuitems = document.getElementsByAttribute('command','cmd_copy_editor_copy_location_first_toggle');
+ for(var i = 0; i < menuitems.length; i++)
+ menuitems[i].setAttribute('checked', cl_first ? 'true' : 'false');
+ break;
+ }
+ },
+
+ 'stop_observing' : function() {
+ xulG.pref.removeObserver('oils.copy_editor.*', this);
}
}
<command id="cmd_debug_chrome_shell"
perm="DEBUG_CLIENT"
/>
+ <command id="cmd_copy_editor_copy_location_first_toggle" />
</commandset>
<!-- The File menu on the main menu -->
<menuitem label="&staff.server.admin.index.printer;" command="cmd_local_admin_printer"/>
<menuitem label="&staff.main.menu.admin.template_edit.label;" accesskey="&staff.main.menu.admin.template_edit.accesskey;" command="cmd_print_list_template_edit"/>
<menuitem label="&staff.server.admin.index.fonts_and_sounds;" command="cmd_local_admin_fonts_and_sounds"/>
+ <menuitem type="checkbox" label="&staff.main.menu.admin.client.copy_editor.copy_location.label;" command="cmd_copy_editor_copy_location_first_toggle"/>
<menu id="main.menu.admin.client.hotkeys" label="&staff.main.menu.admin.client.hotkeys;">
<menupopup id="main.menu.admin.client.hotkeys.popup">
<menuitem label="&staff.main.menu.admin.client.hotkeys.toggle.label;" accesskey="&staff.main.menu.admin.client.hotkeys.toggle.accesskey;" type="checkbox" autocheck="false" command="cmd_hotkeys_toggle"/>
// Template Toolkit Opac Enabled in Staff Client
pref("oils.use_tpac", false);
+
+// Copy location name first in copy editor
+pref("oils.copy_editor.copy_location_name_first", false);
g.callnumbers = xul_param('callnumbers',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_callnumbers','clear_xpcom':true,'modal_xulG':true});
+ /******************************************************************************************************/
+ /* Get preference (if it exists) for copy location label order */
+
+ g.cl_first = false; // Default to legacy OU first mode
+ var prefs = Components.classes['@mozilla.org/preferences-service;1']
+ .getService(Components.interfaces['nsIPrefBranch']);
+ try {
+ g.cl_first = prefs.getBoolPref('oils.copy_editor.copy_location_name_first');
+ } catch(E) { }
/******************************************************************************************************/
/* Quick fix, this was defined inline in the global scope but now needs g.error and g.copies from my_init */
$('catStrings').getString('staff.cat.copy_editor.field.location.label'),
{
render: 'typeof fm.location() == "object" ? fm.location().name() : g.data.lookup("acpl",fm.location()).name()',
- input: 'c = function(v){ g.apply("location",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( g.get_acpl_list(), function(obj) { return [ g.data.hash.aou[ obj.owning_lib() ].shortname() + " : " + obj.name(), obj.id() ]; }).sort()); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+ input: 'c = function(v){ g.apply("location",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( g.get_acpl_list(), function(obj) { return [ ' + (g.cl_first ? 'obj.name() + " : " + g.data.hash.aou[ obj.owning_lib() ].shortname()' : 'g.data.hash.aou[ obj.owning_lib() ].shortname() + " : " + obj.name()') + ', obj.id() ]; }).sort()); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
}
],