Bug 841686 - Update strings, order, and options for image context menu. Also includes tab fix for bug 841688. r=mbrubeck
authorJim Mathies <jmathies@mozilla.com>
Tue, 19 Feb 2013 19:51:02 -0600
changeset 122440 8b45c32b6028a944c3dddd538d5d9320c089c306
parent 122439 efae9ff1466263b5a5c85e80cfd7cdb28ea5c011
child 122441 d3ee65f9f8c80f3d5cb7872b18d26b73df9be616
push id24342
push userryanvm@gmail.com
push dateThu, 21 Feb 2013 13:05:06 +0000
treeherdermozilla-central@702d2814efbf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs841686, 841688
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 841686 - Update strings, order, and options for image context menu. Also includes tab fix for bug 841688. r=mbrubeck
browser/metro/base/content/ContextCommands.js
browser/metro/base/content/browser.xul
browser/metro/locales/en-US/chrome/browser.dtd
--- a/browser/metro/base/content/ContextCommands.js
+++ b/browser/metro/base/content/ContextCommands.js
@@ -72,18 +72,17 @@ var ContextCommands = {
       target.messageManager.sendAsyncMessage("Browser:ContextCommand", json);
     } else {
       target.editor.selectAll();
       target.focus();
     }
   },
 
   openInNewTab: function cc_openInNewTab() {
-    Browser.addTab(ContextMenuUI.popupState.linkURL, false, Browser.selectedTab);
-    ContextUI.peekTabs();
+    BrowserUI.newTab(ContextMenuUI.popupState.linkURL, Browser.selectedTab);
   },
 
   saveToWinLibrary: function cc_saveToWinLibrary(aType) {
     let popupState = ContextMenuUI.popupState;
     let browser = popupState.target;
 
     // ContentAreaUtils internalSave relies on various desktop related prefs,
     // values, and functionality. We want to be more direct by saving the
@@ -111,30 +110,44 @@ var ContextCommands = {
       targetFile        : saveLocationPath,
       sourceCacheKey    : null,
       sourcePostData    : null,
       bypassCache       : false,
       initiatingWindow  : this.docRef.defaultView
     });
   },
 
+  // Video specific
+
   saveVideo: function cc_saveVideo() {
     this.saveToWinLibrary("Vids");
   },
 
   saveVideoTo: function cc_saveVideoTo() {
     this.saveFileAs(ContextMenuUI.popupState);
   },
 
-  saveImage: function cc_saveImage() {
+  // Image specific
+
+  saveImageToLib: function cc_saveImageToLib() {
     this.saveToWinLibrary("Pict");
   },
 
-  saveImageTo: function cc_saveImageTo() {
-    this.saveFileAs(ContextMenuUI.popupState);
+  copyImage: function cc_copyImage() {
+    // copy to clibboard
+    this.sendCommand("copy-image-contents");
+  },
+
+  copyImageLink: function cc_copyImage() {
+    this.clipboard.copyString(ContextMenuUI.popupState.mediaURL,
+                              this.docRef);
+  },
+
+  openImageInNewTab: function cc_openImageInNewTab() {
+    BrowserUI.newTab(ContextMenuUI.popupState.mediaURL, Browser.selectedTab);
   },
 
   copyLink: function cc_copyLink() {
     this.clipboard.copyString(ContextMenuUI.popupState.linkURL,
                               this.docRef);
   },
 
   copyEmail: function cc_copyEmail() {
@@ -142,20 +155,16 @@ var ContextCommands = {
                               this.docRef);
   },
 
   copyPhone: function cc_copyPhone() {
     this.clipboard.copyString(ContextMenuUI.popupState.linkURL.substr(ContextMenuUI.popupState.linkURL.indexOf(':')+1),
                               this.docRef);
   },
 
-  copyImage: function cc_copyImage() {
-    this.sendCommand("copy-image-contents");
-  },
-
   bookmarkLink: function cc_bookmarkLink() {
     let state = ContextMenuUI.popupState;
     let uri = Util.makeURI(state.linkURL);
     let title = state.linkTitle || state.linkURL;
 
     try {
       Bookmarks.addForURI(uri, title);
     } catch (e) {
--- a/browser/metro/base/content/browser.xul
+++ b/browser/metro/base/content/browser.xul
@@ -572,27 +572,27 @@
           <richlistitem id="context-paste-n-go" type="paste-url" onclick="ContextCommands.pasteAndGo();">
             <label value="&pasteAndGo.label;"/>
           </richlistitem>
           <richlistitem id="context-select-all" type="select-all" onclick="ContextCommands.selectAll();">
             <label value="&selectAll.label;"/>
           </richlistitem>
 
           <!-- Image related -->
-          <richlistitem id="context-viewinnewtab" type="image" onclick="ContextCommands.openInNewTab();">
-            <label value="&contextViewInNewTab.label;"/>
+          <richlistitem id="context-save-image-lib" type="image" onclick="ContextCommands.saveImageToLib();">
+            <label value="&contextSaveImageLib.label;"/>
           </richlistitem>
-          <richlistitem id="context-copy-image" type="image-loaded" onclick="ContextCommands.copyImage();">
+          <richlistitem id="context-copy-image" type="image" onclick="ContextCommands.copyImage();">
             <label value="&contextCopyImage.label;"/>
           </richlistitem>
-          <richlistitem id="context-save-image" type="image-loaded" onclick="ContextCommands.saveImage();">
-            <label value="&contextSaveImage.label;"/>
+          <richlistitem id="context-copy-image-loc" type="image" onclick="ContextCommands.copyImageLink();">
+            <label value="&contextCopyImageLocation.label;"/>
           </richlistitem>
-          <richlistitem id="context-save-image-to" type="image-loaded" onclick="ContextCommands.saveImageTo();">
-            <label value="&contextSaveImageTo.label;"/>
+          <richlistitem id="context-open-image-tab" type="image" onclick="ContextCommands.openImageInNewTab();">
+            <label value="&contextOpenImageTab.label;"/>
           </richlistitem>
 
           <!-- Link related -->
           <richlistitem id="context-openinnewtab" type="link-openable" onclick="ContextCommands.openInNewTab();">
             <label value="&contextOpenInNewTab.label;"/>
           </richlistitem>
           <richlistitem id="context-bookmark-link" type="link" onclick="ContextCommands.bookmarkLink();">
             <label value="&contextBookmarkLink.label;"/>
--- a/browser/metro/locales/en-US/chrome/browser.dtd
+++ b/browser/metro/locales/en-US/chrome/browser.dtd
@@ -73,18 +73,16 @@
 <!ENTITY consoleClear.label        "Clear">
 <!ENTITY consoleEvaluate.label     "…">
 <!ENTITY consoleErrFile.label      "Source File:">
 <!ENTITY consoleErrLine.label      "Line:">
 <!ENTITY consoleErrColumn.label    "Column:">
 
 <!ENTITY contextOpenInNewTab.label    "Open Link in New Tab">
 <!ENTITY contextViewInNewTab.label    "View in New Tab">
-<!ENTITY contextSaveImage.label       "Save Image">
-<!ENTITY contextSaveImageTo.label     "Save Image To">
 <!ENTITY contextCopyLink.label        "Copy Link">
 <!ENTITY contextCopyEmail.label       "Copy Email Address">
 <!ENTITY contextCopyPhone.label       "Copy Phone Number">
 <!ENTITY contextCopyImage.label       "Copy Image">
 <!ENTITY contextShareLink.label       "Share Link">
 <!ENTITY contextShareImage.label      "Share Image">
 <!ENTITY contextBookmarkLink.label    "Bookmark Link">
 <!ENTITY contextSaveVideo.label       "Save Video">
@@ -92,11 +90,19 @@
 <!ENTITY contextShareVideo.label      "Share Video">
 <!ENTITY contextPlayMedia.label       "Play">
 <!ENTITY contextPauseMedia.label      "Pause">
 <!ENTITY contextVideoTab.label        "Open In New Tab">
 <!ENTITY contextEditBookmark.label    "Edit">
 <!ENTITY contextRemoveBookmark.label  "Remove">
 <!ENTITY contextShortcutBookmark.label "Add to Home Screen">
 
+<!-- * image context menu * -->
+<!-- l10n: contextSaveImageLib saves an image to the users "pictures library"
+     (Explorer -> left hand side navigation ppane -> Libraries -> Pictures) -->
+<!ENTITY contextSaveImageLib.label        "Save to pictures library">
+<!ENTITY contextCopyImage.label           "Copy image">
+<!ENTITY contextCopyImageLocation.label   "Copy image location">
+<!ENTITY contextOpenImageTab.label        "Open image in new tab">
+
 <!ENTITY pageactions.password.forget "Forget Password">
 <!ENTITY pageactions.reset           "Clear Site Preferences">
 <!ENTITY pageactions.charEncoding    "Character Encoding">