Bug 1573896 - Port Bug 418517 |Add "Select All" button to Page Info "Media" tab| to SeaMonkey. r=frg a=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Tue, 03 Sep 2019 21:30:28 +0200
changeset 32294 491968cbaa99ae2e59d9100304deb2a6db527e1b
parent 32293 7df22fd675a09804bc39fe54614ca7a68ffdcd68
child 32295 52d8ca8b2435fd47b344fbb1ec1b0f616695d8c8
push id216
push userfrgrahl@gmx.net
push dateTue, 03 Sep 2019 19:31:33 +0000
treeherdercomm-esr60@106eee2e069a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg, frg
bugs1573896, 418517
Bug 1573896 - Port Bug 418517 |Add "Select All" button to Page Info "Media" tab| to SeaMonkey. r=frg a=frg
suite/browser/pageinfo/pageInfo.js
suite/browser/pageinfo/pageInfo.xul
--- a/suite/browser/pageinfo/pageInfo.js
+++ b/suite/browser/pageinfo/pageInfo.js
@@ -1392,16 +1392,24 @@ function doCopy(isLinkMode)
 {
   var text = getSelectedItems(isLinkMode);
 
   Cc["@mozilla.org/widget/clipboardhelper;1"]
     .getService(Ci.nsIClipboardHelper)
     .copyString(text.join("\n"));
 }
 
+function doSelectAllMedia()
+{
+  var tree = document.getElementById("imagetree");
+
+  if (tree)
+    tree.view.selection.selectAll();
+}
+
 function doSelectAll()
 {
   var elem = document.commandDispatcher.focusedElement;
 
   if (elem && "treeBoxObject" in elem)
     elem.view.selection.selectAll();
 }
 
--- a/suite/browser/pageinfo/pageInfo.xul
+++ b/suite/browser/pageinfo/pageInfo.xul
@@ -279,16 +279,19 @@
             <vbox>
               <checkbox id="blockImage"
                         hidden="true"
                         oncommand="onBlockImage(this.checked);"
                         accesskey="&mediaBlockImage.accesskey;"/>
               <label control="thepreviewimage" value="&mediaPreview;" class="header"/>
             </vbox>
             <spacer flex="1"/>
+            <button label="&selectall.label;" accesskey="&selectall.accesskey;"
+                    id="selectallbutton"
+                    oncommand="doSelectAllMedia();"/>
             <button label="&mediaSaveAs;" accesskey="&mediaSaveAs.accesskey;"
                     icon="save" id="imagesaveasbutton" disabled="true"
                     oncommand="saveMedia();"/>
           </hbox>
           <vbox class="inset iframe" flex="1" pack="center">
             <hbox id="theimagecontainer" pack="center">
               <image id="thepreviewimage"/>
             </hbox>