pref for disabling accesskeys on tabs
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 22 Feb 2009 06:34:10 +0000 (06:34 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 22 Feb 2009 06:34:10 +0000 (06:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12261 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/main.js
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/defaults/preferences/prefs.js

index 95267d1..b59198a 100644 (file)
@@ -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(
index 581d45a..996058f 100644 (file)
@@ -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 = {
index a7948eb..47a9b8b 100644 (file)
@@ -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);