Bug 445387 – In </suite/*>, "use a xul <stringbundle/> instead of including the strres.js code"
authorSerge Gautherie <sgautherie.bz@free.fr>
Sun, 27 Jul 2008 21:14:04 +0100
changeset 33 dd2b64479966e7c7452fb45a9d142517af906384
parent 32 b247c1a31380b4d40d06fa671d64c00b0ade2933
child 34 5a71d1e8b08659cadd0347b72e8e4c4af1e8e291
push idunknown
push userunknown
push dateunknown
bugs445387
Bug 445387 – In </suite/*>, "use a xul <stringbundle/> instead of including the strres.js code" p=sgautherie r=iann
suite/common/permissions/cookieViewer.xul
suite/common/permissions/imageContextOverlay.xul
--- a/suite/common/permissions/cookieViewer.xul
+++ b/suite/common/permissions/cookieViewer.xul
@@ -51,17 +51,16 @@
         windowtype="mozilla:cookieviewer"
         style="width: 30em;"
         onload="Startup()"
         onunload="Shutdown()"
         ondialoghelp="doHelpButton();"
         persist="screenX screenY width height">
 
   <script src="chrome://communicator/content/permissions/cookieViewer.js"/>
-  <script src="chrome://global/content/strres.js"/>
   <script src="chrome://communicator/content/permissions/treeUtils.js"/>
   <script type="application/x-javascript" src="chrome://help/content/contextHelp.js" />
 
   <keyset id="dialogKeys"/>
   <stringbundle id="cookieBundle"
                 src="chrome://communicator/locale/permissions/cookieViewer.properties"/>
            
   <tabbox id="tabbox" flex="1">
--- a/suite/common/permissions/imageContextOverlay.xul
+++ b/suite/common/permissions/imageContextOverlay.xul
@@ -85,17 +85,16 @@
         try {
         
         //Hide Block and Unblock menuitems
         gContextMenu.showItem("context-blockimage", false);
         gContextMenu.showItem("context-unblockimage", false);
 
         // Block image depends on whether an image was clicked on
         if (gContextMenu.onImage) {
-          var bundle = srGetStrBundle("chrome://communicator/locale/contentAreaCommands.properties");
           var IOService = Components.classes["@mozilla.org/network/io-service;1"]
                                     .getService(Components.interfaces.nsIIOService);
 
           var uri = IOService.newURI(gContextMenu.imageURL, null, null);
           try {
             var serverLabel = uri.host;
             if (serverLabel) {
   
@@ -110,16 +109,18 @@
               }
               
               // Set label and accesskey for appropriate action and unhide menuitem
               var action = "block";
               var permissionmanager = Components.classes["@mozilla.org/permissionmanager;1"]
                                                 .getService(Components.interfaces.nsIPermissionManager);
               if (permissionmanager.testPermission(uri, "image") == nsIPermissionManager.DENY_ACTION) 
                 action = "unblock";
+              // Use |getStringBundle()| from <contentAreaUtils.js>.
+              const bundle = getStringBundle();
               var blockImageMenuItem = document.getElementById("context-" + action + "image");
               blockImageMenuItem.setAttribute("label", bundle.formatStringFromName(action + "Image", [serverLabel], 1));
               blockImageMenuItem.setAttribute("accesskey", bundle.GetStringFromName(action + "Image.accesskey"));
               gContextMenu.showItem("context-" + action + "image", true);
             }
           } catch (ex) { }           
         }
         } catch (e) {}