[Pkg-mozext-commits] [tabmixplus] 02/05: Imported Upstream version 0.4.1.4~140613a1

David Prévot taffit at moszumanska.debian.org
Sat Jun 14 16:12:04 UTC 2014


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 84614e886575977a120a4067ab736b72e629601e
Author: David Prévot <taffit at debian.org>
Date:   Sat Jun 14 11:53:28 2014 -0400

    Imported Upstream version 0.4.1.4~140613a1
---
 chrome/content/links/contentLinks.js |  6 +--
 chrome/content/minit/tablib.js       | 24 ++++++------
 chrome/content/overlay/browsr.css    |  9 +++++
 chrome/content/tab/tab.js            | 76 +++++++++++++++++++++++++-----------
 chrome/content/tab/tabbrowser_4.xml  |  3 +-
 chrome/content/tabmix.js             |  1 +
 install.rdf                          |  4 +-
 7 files changed, 84 insertions(+), 39 deletions(-)

diff --git a/chrome/content/links/contentLinks.js b/chrome/content/links/contentLinks.js
index f5b72cf..ec4e109 100644
--- a/chrome/content/links/contentLinks.js
+++ b/chrome/content/links/contentLinks.js
@@ -758,12 +758,12 @@ Tabmix.contentAreaClick = {
   isLinkToExternalDomain: function TMP_isLinkToExternalDomain(curpage, target) {
     var self = this;
     function getDomain(url) {
-      if (url.match(/auth\?/))
-        return;
-
       if (typeof(url) != "string")
         url = url.toString();
 
+      if (url.match(/auth\?/))
+        return;
+
       if (url.match(/^file:/))
         return "local_file";
 
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index ecd58cf..173113e 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -317,6 +317,7 @@ var tablib = {
     ).toCode();
 
     // we use our own preferences observer
+    if (!Tabmix.isVersion(310))
     Tabmix.changeCode(tabBar._prefObserver, "gBrowser.tabContainer._prefObserver.observe")._replace(
       'this.tabContainer.mCloseButtons = Services.prefs.getIntPref(data);',
       'break;'
@@ -558,16 +559,16 @@ var tablib = {
     // inverse focus of middle/ctrl/meta clicked links
     // Firefox check for "browser.tabs.loadInBackground" in openLinkIn
     Tabmix.changeCode(fnObj, fnName)._replace(
-      'var originCharset = aDocument && aDocument.characterSet;',
-      '  var loadInBackground = false;' +
-      '  if (aEvent) {' +
-      '    if (aEvent.shiftKey)' +
-      '      loadInBackground = !loadInBackground;' +
-      '    if (getBoolPref("extensions.tabmix.inversefocusLinks")' +
-      '        && (aEvent.button == 1 || aEvent.button == 0 && (aEvent.ctrlKey || aEvent.metaKey)))' +
-      '      loadInBackground = !loadInBackground;' +
-      '  }' +
-      '  var where = loadInBackground ? "tabshifted" : "tab";' +
+      'openLinkIn(',
+      'var loadInBackground = false;\n' +
+      '  if (aEvent) {\n' +
+      '    if (aEvent.shiftKey)\n' +
+      '      loadInBackground = !loadInBackground;\n' +
+      '    if (getBoolPref("extensions.tabmix.inversefocusLinks")\n' +
+      '        && (aEvent.button == 1 || aEvent.button == 0 && (aEvent.ctrlKey || aEvent.metaKey)))\n' +
+      '      loadInBackground = !loadInBackground;\n' +
+      '  }\n' +
+      '  var where = loadInBackground ? "tabshifted" : "tab";\n' +
       '  $&'
     )._replace(
       'aEvent && aEvent.shiftKey ? "tabshifted" : "tab"',
@@ -706,13 +707,14 @@ var tablib = {
     if (popup)
       popup.setAttribute("context", "tm_undocloseWindowContextMenu");
 
+    if (!Tabmix.isVersion(290))
     Tabmix.changeCode(window, "switchToTabHavingURI")._replace(
       'function switchIfURIInWindow',
       'let switchIfURIInWindow = $&', {check: Tabmix._debugMode}
     )._replace(
       'gBrowser.selectedBrowser.loadURI(aURI.spec);',
       '{$& \
-       gBrowser.ensureTabIsVisible(gBrowser.selectedTab);}', {check: !Tabmix.isVersion(300)}
+       gBrowser.ensureTabIsVisible(gBrowser.selectedTab);}'
     ).toCode();
 
     if (Tabmix.isVersion(300)) {
diff --git a/chrome/content/overlay/browsr.css b/chrome/content/overlay/browsr.css
index cd7f334..b7a8537 100644
--- a/chrome/content/overlay/browsr.css
+++ b/chrome/content/overlay/browsr.css
@@ -331,3 +331,12 @@ so display: none !important; does not hide the button */
 .tabbrowser-tabs[movingBackgroundTab] > .tabbrowser-tab[fadein]:not([dragged]) {
   transition: transform 200ms ease-out;
 }
+
+/* Firefox 31+ */
+.tabs-closebutton.tabmix {
+  -moz-appearance: none;
+  height: 16px;
+  width: 16px;
+  padding-top: 0px !important;
+  padding-bottom: 0px !important;
+}
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 0de9950..dcbd8a0 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -179,6 +179,32 @@ var TabmixTabbar = {
     }
   },
 
+  addCloseButton: function () {
+    if (!Tabmix.isVersion(310))
+      return;
+    var button = document.getElementById("tabs-closebutton");
+    if (!button && !Tabmix.prefs.getBoolPref("hideTabBarButton")) {
+      button = document.createElement("toolbarbutton");
+      button.id = "tabs-closebutton";
+      button.className = "tabs-closebutton close-icon toolbarbutton-1 chromeclass-toolbar-additional tabmix";
+      button.setAttribute("command", "cmd_close");
+      button.setAttribute("cui-areatype", "toolbar");
+      var label = gBrowser.selectedTab.getAttribute("closetabtext");
+      button.setAttribute("label", label);
+      button.setAttribute("tooltiptext", label);
+
+      let tabsToolbar = document.getElementById("TabsToolbar");
+      let cSet = (tabsToolbar.getAttribute("currentset") || tabsToolbar.getAttribute("defaultset")).split(",");
+      let index = cSet.indexOf("tabs-closebutton");
+      let elm = null;
+      if (index > -1 && index < cSet.length - 1)
+        elm = document.getElementById(cSet[index + 1]);
+      else if (index == -1)
+        tabsToolbar.setAttribute("currentset", cSet.join(",") + ",tabs-closebutton");
+      gBrowser.tabContainer.parentNode.insertBefore(button, elm);
+    }
+  },
+
   setScrollButtonBox: function TMP_setScrollButtonBox(useTabmixButtons, insertAfterTabs, update) {
     let newBox, box = document.getElementById("tabmixScrollBox");
     if (useTabmixButtons && !box) {
@@ -412,7 +438,7 @@ var TabmixTabbar = {
     let tabBar = gBrowser.tabContainer;
     let multibar = tabBar.hasAttribute("multibar");
     let selected = tabBar.selectedItem;
-    let tabRow, top = tabBar.topTabY;
+    let tabRow, top;
     // Firefox don't have beforeselected-visible attribute (bug 585558 didn't
     // include it), we add tabmix-beforeselected-visible here and use it for
     // Firefox with australis UI
@@ -435,7 +461,10 @@ var TabmixTabbar = {
     }
 
     if (tabBar._hoveredTab && !tabBar._hoveredTab.closing) {
-      tabRow = tabBar.getTabRowNumber(tabBar._hoveredTab, top);
+      if (multibar) {
+        top = tabBar.topTabY;
+        tabRow = tabBar.getTabRowNumber(tabBar._hoveredTab, top);
+      }
       updateAtt(tabBar._beforeHoveredTab, "beforeHoveredTab", "beforehovered");
       updateAtt(tabBar._afterHoveredTab, "afterHoveredTab", "afterhovered");
     }
@@ -457,7 +486,10 @@ var TabmixTabbar = {
           next = visibleTabs[selectedIndex + 1];
     }
 
-    tabRow = tabBar.getTabRowNumber(selected, top);
+    if (multibar) {
+      top = top || tabBar.topTabY;
+      tabRow = tabBar.getTabRowNumber(selected, top);
+    }
     updateAtt(prev, "beforeSelectedTab", "beforeselected", TabmixSvc.australis, "tabmix-");
     updateAtt(next, "afterSelectedTab", "afterselected", Tabmix.isVersion(220), "");
   },
@@ -890,9 +922,10 @@ var gTMPprefObserver = {
           gBrowser.tabContainer.updateVerticalTabStrip();
         }
         break;
+      case "extensions.tabmix.hideTabBarButton":
+        TabmixTabbar.addCloseButton();
       case "extensions.tabmix.tabBarMode":
       case "extensions.tabmix.tabBarSpace":
-      case "extensions.tabmix.hideTabBarButton":
       case "extensions.tabmix.hideAllTabsButton":
       case "extensions.tabmix.newTabButton":
       case "extensions.tabmix.flexTabs":
@@ -1099,6 +1132,23 @@ var gTMPprefObserver = {
       [url, region] = ["newtab.png", "auto"];
     this.insertRule(newRule.replace("#URL", url).replace("#REGION", region));
 
+    if (!TabmixSvc.australis)
+      return;
+
+    // Workaround bug 943308 - tab-background not fully overlap the tab curves
+    // when layout.css.devPixelsPerPx is not 1.
+    let bgMiddle = document.getAnonymousElementByAttribute(gBrowser.selectedTab, "class", "tab-background-middle");
+    let margin = (-parseFloat(window.getComputedStyle(bgMiddle).borderLeftWidth)) + "px";
+    let bgMiddleMargin = this.dynamicRules["bgMiddleMargin"];
+    if (bgMiddleMargin) {
+      bgMiddleMargin.style.MozMarginStart = margin;
+      bgMiddleMargin.style.MozMarginEnd = margin;
+    }
+    else {
+      let newRule = '.tab-background-middle, .tab-background, .tabs-newtab-button {' +
+                    '-moz-margin-end: %PX; -moz-margin-start: %PX;}'
+      this.insertRule(newRule.replace(/%PX/g, margin), "bgMiddleMargin");
+    }
   },
 
   addDynamicRules: function() {
@@ -1129,24 +1179,6 @@ var gTMPprefObserver = {
         newRule.style.setProperty("padding-bottom", (padding + 1) + "px", "important");
       }, true);
     }
-
-    if (!TabmixSvc.australis)
-      return;
-
-    // Workaround bug 943308 - tab-background not fully overlap the tab curves
-    // when layout.css.devPixelsPerPx is not 1.
-    let bgMiddle = document.getAnonymousElementByAttribute(gBrowser.selectedTab, "class", "tab-background-middle");
-    let margin = (-parseFloat(window.getComputedStyle(bgMiddle).borderLeftWidth)) + "px";
-    let bgMiddleMargin = this.dynamicRules["bgMiddleMargin"];
-    if (bgMiddleMargin) {
-      bgMiddleMargin.style.MozMarginStart = margin;
-      bgMiddleMargin.style.MozMarginEnd = margin;
-    }
-    else {
-      let newRule = '.tab-background-middle, .tab-background, .tabs-newtab-button {' +
-                    '-moz-margin-end: %PX; -moz-margin-start: %PX;}'
-      this.insertRule(newRule.replace(/%PX/g, margin), "bgMiddleMargin");
-    }
   },
 
   updateTabsStyle: function(ruleName, toggle) {
diff --git a/chrome/content/tab/tabbrowser_4.xml b/chrome/content/tab/tabbrowser_4.xml
index 00ccc3c..bb5affa 100644
--- a/chrome/content/tab/tabbrowser_4.xml
+++ b/chrome/content/tab/tabbrowser_4.xml
@@ -386,7 +386,8 @@
               TMP_tabDNDObserver.onDragOver(aEvent);
           }
           this.parentNode.addEventListener("dragover", this.parentNode.tabmix_handleDragover, true);
-          Services.prefs.removeObserver("browser.tabs.closeButtons", this._prefObserver);
+          if (!Tabmix.isVersion(310))
+            Services.prefs.removeObserver("browser.tabs.closeButtons", this._prefObserver);
 
           if (this.tabmix_inited) {
             Tabmix.log("initializeTabmixUI - some extension initialize tabbrowser-tabs binding again");
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index 89adee0..0ae81b2 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -184,6 +184,7 @@ Tabmix.delayedStartup = function TMP_delayedStartup() {
   gTMPprefObserver.setMenuIcons();
 
   TabmixTabbar.updateSettings(true);
+  TabmixTabbar.addCloseButton();
   gTMPprefObserver.setTabIconMargin();
   gTMPprefObserver.setCloseButtonMargin();
   gTMPprefObserver.miscellaneousRules();
diff --git a/install.rdf b/install.rdf
index ef1b001..ea66f7d 100644
--- a/install.rdf
+++ b/install.rdf
@@ -5,7 +5,7 @@
   <RDF:Description RDF:about="urn:mozilla:install-manifest"
                    NS1:id="{dc572301-7619-498c-a57d-39143191b318}"
                    NS1:name="Tab Mix Plus"
-                   NS1:version="0.4.1.4pre.140414a1"
+                   NS1:version="0.4.1.4pre.140613a1"
                    NS1:type="2"
                    NS1:description="Tab browsing with an added boost."
                    NS1:iconURL="chrome://tabmixplus/skin/tmp.png"
@@ -19,5 +19,5 @@
   <RDF:Description RDF:about="rdf:#$n83In3"
                    NS1:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
                    NS1:minVersion="17.0"
-                   NS1:maxVersion="31.0a1" />
+                   NS1:maxVersion="32.0a1" />
 </RDF:RDF>

-- 
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