From: phasefx Date: Sun, 22 Feb 2009 06:34:10 +0000 (+0000) Subject: pref for disabling accesskeys on tabs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4da49be0526a66fb2266a12356a96728830dc705;p=evergreen%2Ftadl.git pref for disabling accesskeys on tabs git-svn-id: svn://svn.open-ils.org/ILS/trunk@12261 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.js b/Open-ILS/xul/staff_client/chrome/content/main/main.js index 95267d1522..b59198a8d3 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js @@ -8,15 +8,13 @@ var authStrings; function grant_perms(url) { var perms = "UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead"; dump('Granting ' + perms + ' to ' + url + '\n'); - var pref = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch); - if (pref) { - pref.setCharPref("capability.principal.codebase.p0.granted", perms); - pref.setCharPref("capability.principal.codebase.p0.id", url); - pref.setCharPref("capability.principal.codebase.p1.granted", perms); - pref.setCharPref("capability.principal.codebase.p1.id", url.replace('http:','https:')); - pref.setBoolPref("dom.disable_open_during_load",false); - pref.setBoolPref("browser.popups.showPopupBlocker",false); + if (G.pref) { + G.pref.setCharPref("capability.principal.codebase.p0.granted", perms); + G.pref.setCharPref("capability.principal.codebase.p0.id", url); + G.pref.setCharPref("capability.principal.codebase.p1.granted", perms); + G.pref.setCharPref("capability.principal.codebase.p1.id", url.replace('http:','https:')); + G.pref.setBoolPref("dom.disable_open_during_load",false); + G.pref.setBoolPref("browser.popups.showPopupBlocker",false); } } @@ -89,8 +87,6 @@ function main_init() { } ///////////////////////////////////////////////////////////////////////////// - var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); - JSAN.errorLevel = "die"; // none, warn, or die JSAN.addRepository('..'); @@ -98,6 +94,8 @@ function main_init() { var mw = self; G = {}; + + G.pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); JSAN.use('util.error'); G.error = new util.error(); @@ -153,7 +151,8 @@ function main_init() { 'auth' : G.auth, 'url' : url, 'window' : G.window, - 'data' : G.data + 'data' : G.data, + 'pref' : G.pref }; if (G.data.ws_info && G.data.ws_info[G.auth.controller.view.server_prompt.value]) { @@ -296,7 +295,7 @@ function main_init() { document.getElementById('debug_gb').hidden = false; } - if (pref && pref.getBoolPref('open-ils.debug_options')) { + if (G.pref && G.pref.getBoolPref('open-ils.debug_options')) { document.getElementById('debug_gb').hidden = false; } @@ -377,7 +376,7 @@ function main_init() { false ); - if ( found_ws_info_in_Achrome() && pref && pref.getBoolPref("open-ils.write_in_user_chrome_directory") ) { + if ( found_ws_info_in_Achrome() && G.pref && G.pref.getBoolPref("open-ils.write_in_user_chrome_directory") ) { //var hbox = x.parentNode; var b = document.createElement('button'); //b.setAttribute('label','Migrate legacy settings'); hbox.appendChild(b); //b.addEventListener( diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 581d45a7c5..996058f840 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -26,6 +26,13 @@ main.menu = function () { }, false ); + + if (xulG.pref.getBoolPref('open-ils.disable_accesskeys_on_tabs')) { + var tabs = document.getElementById('main_tabs'); + for (var i = 0; i < tabs.childNodes.length; i++) { + tabs.childNodes[i].setAttribute('accesskey',''); + } + } } main.menu.prototype = { diff --git a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js index a7948eba24..47a9b8b197 100644 --- a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js +++ b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js @@ -5,6 +5,10 @@ // This one is required for XUL Runner pref("toolkit.defaultChromeURI", "chrome://open_ils_staff_client/content/main/main.xul"); +// These are specific to Evergreen +pref("open-ils.write_in_user_chrome_directory", true); +pref("open-ils.disable_accesskeys_on_tabs", false); + // Let's try to enable tracemonkey pref("javascript.options.jit.chrome", true); pref("javascript.options.jit.content", true); @@ -23,9 +27,6 @@ pref("general.useragent.locale", "en-US"); // navigator.xul not being registered. But is about:blank the best value to use here? pref("browser.chromeURL","about:blank"); -// This one is specific for Open-ILS -pref("open-ils.write_in_user_chrome_directory", true); - // This one just makes things speedier. We use a lot of XMLHttpRequest pref("network.http.max-persistent-connections-per-server",8);