From e0d8dbf11299207399fd471afeca45cd1bb8346b Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Wed, 21 Sep 2011 13:25:38 -0400 Subject: [PATCH] Add Toggle option to portal for TPac use In testing I didn't have to restart the staff client, but as constants.js is loaded pretty much everywhere I have no clue where the URL array may be stale. Signed-off-by: Thomas Berezansky Signed-off-by: Dan Scott --- Open-ILS/web/opac/locale/en-US/lang.dtd | 3 +++ Open-ILS/xul/staff_client/server/index.xhtml | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 16b3325f71..a63abdf749 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -3642,6 +3642,9 @@ + + + diff --git a/Open-ILS/xul/staff_client/server/index.xhtml b/Open-ILS/xul/staff_client/server/index.xhtml index 0068c4d1a4..b60be0d7b3 100644 --- a/Open-ILS/xul/staff_client/server/index.xhtml +++ b/Open-ILS/xul/staff_client/server/index.xhtml @@ -257,6 +257,24 @@ else xulG.set_tab(loc, {}, content_params); } + function toggle_tpac(mode) { + var use_tpac = false; + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']); + try { + use_tpac = prefs.getBoolPref('oils.use_tpac'); + } catch (E) { + dump('Failed to get current use_tpac setting - Assuming false: ' + E); + } + use_tpac = !use_tpac; + prefs.setBoolPref('oils.use_tpac', use_tpac); + var message = document.getElementById('tpac_toggled_on'); + if(!use_tpac) { + message = document.getElementById('tpac_toggled_off'); + } + message = message.textContent; + alert(message); + } // ]]>