Bug 447833 - Port bug 428371 - Use separate accesskey for 'Search Web for <text>' menu-item. r+sr=Neil.
authorVlado Valastiak (wladow, Mozilla.sk) <wladow@gmail.com>
Sun, 27 Jul 2008 13:27:31 +0200
changeset 27 0230976a71ebc7730c9973b6ff107b5a5d672494
parent 26 fe01bd29503e370fbddd62a7a2860dc48fc94bd0
child 28 a8b6674189023bf27bc1ed2facdbad7a4d8ff87f
push idunknown
push userunknown
push dateunknown
bugs447833, 428371
Bug 447833 - Port bug 428371 - Use separate accesskey for 'Search Web for <text>' menu-item. r+sr=Neil.
suite/common/contentAreaContextOverlay.xul
suite/common/nsContextMenu.js
suite/locales/en-US/chrome/common/contentAreaCommands.properties
--- a/suite/common/contentAreaContextOverlay.xul
+++ b/suite/common/contentAreaContextOverlay.xul
@@ -201,17 +201,16 @@
                 command="cmd_delete"/>
       <menuseparator id="context-sep-paste"/>
       <menuitem id="context-selectall"
                 label="&selectAllCmd.label;"
                 accesskey="&selectAllCmd.accesskey;"
                 command="cmd_selectAll"/>      
       <menuseparator id="context-sep-selectall"/>
       <menuitem id="context-searchselect"
-                accesskey="&search.accesskey;"
                 oncommand="OpenSearch('internet', gContextMenu.searchSelected(), true, event.shiftKey);"/>
       <menuseparator id="frame-sep"/>
       <menu id="frame" label="&thisFrameMenu.label;" accesskey="&thisFrameMenu.accesskey;">
         <menupopup id="frame_popup">
           <menuitem label="&showOnlyThisFrameCmd.label;"
                     accesskey="&showOnlyThisFrameCmd.accesskey;"
                     oncommand="gContextMenu.showOnlyThisFrame();"/>
           <menuitem label="&openFrameCmd.label;"
--- a/suite/common/nsContextMenu.js
+++ b/suite/common/nsContextMenu.js
@@ -895,16 +895,18 @@ nsContextMenu.prototype = {
             if (searchSelectText.length > 15)
                 searchSelectText = searchSelectText.substr(0,15) + "...";
             result = true;
 
           // format "Search for <selection>" string to show in menu
           searchSelectText = bundle.formatStringFromName("searchText",
                                                          [searchSelectText], 1);
           this.setItemAttr("context-searchselect", "label", searchSelectText);
+          this.setItemAttr("context-searchselect", "accesskey", 
+                            bundle.GetStringFromName("searchText.accesskey"));
         } 
         return result;
     },
     
     searchSelected : function( charlen ) {
         var focusedWindow = document.commandDispatcher.focusedWindow;
         var searchStr = focusedWindow.getSelection();
         searchStr = searchStr.toString();
--- a/suite/locales/en-US/chrome/common/contentAreaCommands.properties
+++ b/suite/locales/en-US/chrome/common/contentAreaCommands.properties
@@ -1,11 +1,12 @@
 # context menu strings
 
 searchText=Search Web for "%S"
+searchText.accesskey=W
 
 blockImage=Block Images from %S
 blockImage.accesskey=B
 unblockImage=Unblock Images from %S
 unblockImage.accesskey=b
 
 SavePageTitle=Save Web Page
 SaveImageTitle=Save Image