/** * Communicator Shared Utility Library * for shared application glue for the Communicator suite of applications **/ /** * Go into online/offline mode **/ function setOfflineStatus(aToggleFlag) { var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}", "nsIIOService"); var broadcaster = document.getElementById("Communicator:WorkMode"); if (aToggleFlag) ioService.offline = !ioService.offline; var bundle = srGetStrBundle("chrome://communicator/locale/utilityOverlay.properties"); if (ioService.offline && broadcaster) { broadcaster.setAttribute("offline", "true"); broadcaster.setAttribute("tooltiptext", bundle.GetStringFromName("offlineTooltip")); broadcaster.setAttribute("value", bundle.GetStringFromName("goonline")); FillInTooltip(broadcaster); } else if (broadcaster) { broadcaster.removeAttribute("offline"); broadcaster.setAttribute("tooltiptext", bundle.GetStringFromName("onlineTooltip")); broadcaster.setAttribute("value", bundle.GetStringFromName("gooffline")); FillInTooltip(broadcaster); } } var goPrefWindow = 0; function getBrowserURL() { try { var prefs = Components.classes["@mozilla.org/preferences;1"]; if (prefs) { prefs = prefs.getService(); if (prefs) prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } if (prefs) { var url = prefs.CopyCharPref("browser.chromeURL"); if (url) return url; } } catch(e) { } return "chrome://navigator/content/navigator.xul"; } function goPageSetup() { } function goEditCardDialog(abURI, card, okCallback) { window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul", "", "chrome,resizeable=no,modal,titlebar", {abURI:abURI, card:card, okCallback:okCallback}); } function goPreferences(id, paneURL, paneID) { var prefWindowModalityPref; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); if( pref ) prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal"); } catch(e) { prefWindowModalityPref = true; } var modality = prefWindowModalityPref ? "yes" : "no"; var prefWindow = window.openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,titlebar,modal=" + modality+ ",resizable=yes", paneURL, paneID); } function okToCapture() { var capture = document.getElementById("menu_capture"); if (!capture) { return; } if (!window._content || !window._content.document) { capture.setAttribute("disabled", "true"); return; } var formsArray = window._content.document.forms; if (!formsArray) { capture.setAttribute("disabled", "true"); return; } var form; for (form=0; form