[Pkg-mozext-commits] [tabmixplus] 28/61: Follow up bug 486262 - Provide visual indicator as to which tab is causing sound, remove all use of tabbrowser.dtd

David Prévot taffit at moszumanska.debian.org
Fri Aug 28 19:09:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit fc7264d979229cd15ef179e30ddcaf8ad9fc96aa
Author: onemen <tabmix.onemen at gmail.com>
Date:   Fri Jul 31 22:25:41 2015 +0300

    Follow up bug 486262 - Provide visual indicator as to which tab is causing sound, remove all use of tabbrowser.dtd
---
 chrome/content/click/click.js             | 13 +++++----
 chrome/content/overlay/tabContextMenu.xul |  4 +--
 chrome/content/overlay/tabstoolbar.xul    |  6 ++--
 chrome/content/tab/tab.js                 |  5 ++++
 chrome/content/tab/tabbrowser_4.xml       | 48 ++++++++++++++++++++++---------
 chrome/content/tabmix.xul                 |  2 --
 6 files changed, 50 insertions(+), 28 deletions(-)

diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index 65b8e02..03874df 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -30,10 +30,10 @@ var TabmixTabClickOptions = {
     this._blockDblClick = target.classList.contains("tabs-newtab-button") ||
       !Tabmix.isVersion(270) && leftClick && anonid == "tmp-close-button";
 
-    // don't do anything if user left click on close tab button, or on any
-    // other button on tab or tabbar
-    if (leftClick && (anonid == "tmp-close-button" ||
-                      target.localName == "toolbarbutton")) {
+    // don't do anything if user left click on tab or tabbar button
+    if (leftClick &&
+        (anonid == "tmp-close-button" || anonid == "soundplaying-icon" ||
+         target.localName == "toolbarbutton")) {
       return;
     }
 
@@ -112,9 +112,10 @@ var TabmixTabClickOptions = {
       return;
     }
 
-    // don't do anything if user click on close tab button , or on any other button on tab or tabbar
     var target = aEvent.originalTarget;
-    if (target.getAttribute("anonid") == "tmp-close-button" ||
+    var anonid = target.getAttribute("anonid");
+    // don't do anything if user left click on tab or tabbar button
+    if (anonid == "tmp-close-button" || anonid == "soundplaying-icon" ||
         target.localName == "toolbarbutton") {
       return;
     }
diff --git a/chrome/content/overlay/tabContextMenu.xul b/chrome/content/overlay/tabContextMenu.xul
index 50bcd59..58c16c5 100644
--- a/chrome/content/overlay/tabContextMenu.xul
+++ b/chrome/content/overlay/tabContextMenu.xul
@@ -3,8 +3,6 @@
 <!DOCTYPE overlay [
 <!ENTITY % tabmixDTD SYSTEM "chrome://tabmixplus/locale/tabmix.dtd" >
 %tabmixDTD;
-<!ENTITY % tabBrowserDTD SYSTEM "chrome://browser/locale/tabbrowser.dtd" >
-%tabBrowserDTD;
 <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
 %browserDTD;
 ]>
@@ -128,4 +126,4 @@
     </menupopup>
   </popupset>
 
-</overlay>
\ No newline at end of file
+</overlay>
diff --git a/chrome/content/overlay/tabstoolbar.xul b/chrome/content/overlay/tabstoolbar.xul
index 10f4a93..9e66ea0 100644
--- a/chrome/content/overlay/tabstoolbar.xul
+++ b/chrome/content/overlay/tabstoolbar.xul
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>
 
 <!DOCTYPE overlay [
-<!ENTITY % tabBrowserDTD SYSTEM "chrome://browser/locale/tabbrowser.dtd" >
-%tabBrowserDTD;
+<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
+%browserDTD;
 ]>
 
 <overlay id="tabmix-tabstoolbar-overlay"
@@ -18,4 +18,4 @@
                      removable="false"/>
     </toolbar>
 
-</overlay>
\ No newline at end of file
+</overlay>
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 30b9a87..f07e8dd 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -1678,6 +1678,11 @@ var gTMPprefObserver = {
     if (!Tabmix.isVersion(380))
       this.insertRule('.tab-icon-overlay {display: none;}');
 
+    /* tab-icon-sound added by Bug 486262, Firefox 42+ */
+    if (!Tabmix.isVersion(420)) {
+      this.insertRule('.tab-icon-sound {display: none;}');
+    }
+
     // height shrink to actual size when the tabbar is in display: block (multi-row)
     let newRule = '#TabsToolbar[tabmix-show-newtabbutton*="aftertabs"] >' +
                   '#tabbrowser-tabs:not([overflow="true"]) > .tabbrowser-arrowscrollbox[flowing="multibar"]' +
diff --git a/chrome/content/tab/tabbrowser_4.xml b/chrome/content/tab/tabbrowser_4.xml
index 46e5577..9543010 100644
--- a/chrome/content/tab/tabbrowser_4.xml
+++ b/chrome/content/tab/tabbrowser_4.xml
@@ -5,8 +5,6 @@
 %identityDTD;
 <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
 %globalDTD;
-<!ENTITY % tabBrowserDTD SYSTEM "chrome://browser/locale/tabbrowser.dtd" >
-%tabBrowserDTD;
 ]>
 
 <bindings id="tabmixbindings"
@@ -39,7 +37,7 @@
 
   <binding id="tabmix-tabbrowser-tab" display="xul:hbox"
             extends="chrome://tabmixplus/content/tab/tabbrowser_proxy.xml#tabmix-tabbrowser-tab-proxy">
-    <content context="tabContextMenu" closetabtext="&closeTab.label;">
+    <content context="tabContextMenu">
       <xul:hbox class="tab-image-left tab-startcap tab-left tab-left-border" xbl:inherits="selected,hover"/>
       <xul:hbox class="tab-drag-indicator-left"/>
       <xul:stack class="tab-stack" flex="1">
@@ -67,7 +65,8 @@
                          class="tab-icon-image"
                          validate="never"
                          role="presentation"/>
-              <xul:image xbl:inherits="crashed,busy"
+              <xul:image xbl:inherits="crashed,busy,soundplaying,pinned,muted"
+                         anonid="overlay-icon"
                          class="tab-icon-overlay"
                          role="presentation"/>
               <xul:image class="tab-protect-icon" />
@@ -79,6 +78,10 @@
                      xbl:inherits="value=visibleLabel,labelvalue=label,crop,accesskey,fadein,pinned,selected,visuallyselected"
                      class="tab-text tab-label"
                      role="presentation"/>
+          <xul:image xbl:inherits="soundplaying,pinned,muted"
+                     anonid="soundplaying-icon"
+                     class="tab-icon-sound"
+                     role="presentation"/>
           <xul:toolbarbutton anonid="tmp-close-button"
                              xbl:inherits="fadein,pinned,selected,visuallyselected"
                              class="tab-close-button close-icon"/>
@@ -91,8 +94,13 @@
     <implementation>
     <constructor>
       <![CDATA[
-        if ("tabmix_inited" in this)
+        if ('tabmix_inited' in this) {
           return;
+        }
+        if (!Tabmix.isVersion(420)) {
+          let context = document.getElementById('context_closeTab');
+          this.setAttribute('closetabtext', context.getAttribute('label'));
+        }
         this.tabmix_inited = true;
       ]]>
     </constructor>
@@ -167,10 +175,7 @@
     <method name="onMouseOver">
       <parameter name="aEvent"/>
       <body><![CDATA[
-        var anonid = aEvent.originalTarget.getAttribute("anonid");
-        if (anonid == "tmp-close-button")
-          this.mOverCloseButton = true;
-        this.mIsHover = true;
+        this.setHoverState(aEvent, true);
         this.mButtonId = window.setTimeout(this.setShowButton, this.tabXDelay, this);
         if (this.mouseHoverSelect)
           this.mFocusId = window.setTimeout(this.doMouseHoverSelect, this.mouseHoverSelectDelay, this);
@@ -221,10 +226,7 @@
     <method name="onMouseOut">
       <parameter name="aEvent"/>
       <body><![CDATA[
-        var anonid = aEvent.originalTarget.getAttribute("anonid");
-        if (anonid == "tmp-close-button")
-          this.mOverCloseButton = false;
-        this.mIsHover = false;
+        this.setHoverState(aEvent, false);
         clearTimeout(this.mButtonId);
         this.mButtonId = window.setTimeout(this.removeShowButton, this.tabXDelay, this);
         if (this.mouseHoverSelect && this.mFocusId)
@@ -245,6 +247,23 @@
       ]]></body>
     </method>
 
+    <method name="setHoverState">
+      <parameter name="aEvent"/>
+      <parameter name="aOver"/>
+      <body><![CDATA[
+        var anonid = aEvent.originalTarget.getAttribute("anonid");
+        if (anonid == "tmp-close-button") {
+          this.mOverCloseButton = aOver;
+        }
+        else if ((anonid == "soundplaying-icon") ||
+                 ((anonid == "overlay-icon") && this.hasAttribute("soundplaying"))) {
+          this._overPlayingIcon = aOver;
+        }
+        this.mIsHover = aOver;
+      ]]></body>
+    </method>
+
+
     <method name="removeShowButton">
       <parameter name="aTab"/>
       <body><![CDATA[
@@ -330,8 +349,9 @@
           this.clientTop; // just using this to flush style updates
         }
         // prevent chrome://global/content/bindings/tabbox.xml#tab mousedown handler
-        if (this.mOverCloseButton)
+        if (this.mOverCloseButton || this._overPlayingIcon) {
           event.stopPropagation();
+        }
         else {
           if (this.mouseDownSelect)
             this.onMouseCommand(event);
diff --git a/chrome/content/tabmix.xul b/chrome/content/tabmix.xul
index ec21f07..1399c43 100644
--- a/chrome/content/tabmix.xul
+++ b/chrome/content/tabmix.xul
@@ -10,8 +10,6 @@
 <!DOCTYPE overlay [
 <!ENTITY % tabmixDTD SYSTEM "chrome://tabmixplus/locale/tabmix.dtd" >
 %tabmixDTD;
-<!ENTITY % tabBrowserDTD SYSTEM "chrome://browser/locale/tabbrowser.dtd" >
-%tabBrowserDTD;
 <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
 %browserDTD;
 ]>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list