www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 697e840d4e78b5ca76ca244d9c392a1590b10364
parent 9da1a2b9e06211b9e25aa635a15db99344b51631
Author: Simon Kornblith <simon@simonster.com>
Date:   Fri, 14 Jan 2011 07:48:42 +0000

set label on Report Errors... menu option properly


Diffstat:
Mchrome/content/zotero/overlay.xul | 34+++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul @@ -470,16 +470,27 @@ <script> <![CDATA[ window.addEventListener('load', function(e){ - var iconPref = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService) - .getBranch('extensions.zotero.').getIntPref('statusBarIcon'); + // Set label for "Report Errors..." + if(Zotero && Zotero.initialized) { + // Set "Report Errors..." label via property rather than DTD entity, + // since we need to reference it in script elsewhere + document.getElementById('zotero-tb-actions-reportErrors').setAttribute('label', + Zotero.getString('errorReport.reportErrors')); + } + + // Check whether standalone is running, and return if so var appInfo = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULAppInfo); - - // no need to add to any status bars in standalone var isStandalone = appInfo.ID === "zotero@chnm.gmu.edu"; if(isStandalone) return; + // THE FOLLOWING CODE IS NOT APPLIED IN STANDALONE + // (It relates almost entirely to the Zotero icon) + + var iconPref = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefService) + .getBranch('extensions.zotero.').getIntPref('statusBarIcon'); + var isFx36 = appInfo.platformVersion.indexOf('1.9') === 0; // Status bar in Fx3.6 if (isFx36) { @@ -511,11 +522,6 @@ icon.setAttribute('compact', true); break; } - - // Set "Report Errors..." label via property rather than DTD entity, - // since we need to reference it in script elsewhere - document.getElementById('zotero-tb-actions-reportErrors').setAttribute('label', - Zotero.getString('errorReport.reportErrors')); } else { if (Zotero) { @@ -536,11 +542,9 @@ var errMsg = stringBundle.GetStringFromName('startupError'); } - if(icon) { - icon.setAttribute('tooltiptext', errMsg); - icon.setAttribute('error', 'true'); - icon.setAttribute('hidden', false); - } + icon.setAttribute('tooltiptext', errMsg); + icon.setAttribute('error', 'true'); + icon.setAttribute('hidden', false); } // Used for loading pages from upgrade wizard