[Pkg-mozext-commits] [tabmixplus] 80/147: Add option "Move tab from 'Switch to tab' next to current one"

David Prévot taffit at moszumanska.debian.org
Sat Aug 5 15:27:39 UTC 2017


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 81471ef02a86aba5ae5cc64f93e13e3231ecac1c
Author: onemen <tabmix.onemen at gmail.com>
Date:   Thu Dec 29 10:05:08 2016 +0200

    Add option "Move tab from 'Switch to tab' next to current one"
---
 chrome/content/minit/minit.js         | 5 +++--
 chrome/content/preferences/events.xul | 3 +++
 chrome/locale/en-US/pref-tabmix.dtd   | 1 +
 defaults/preferences/tabmix.js        | 1 +
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index 1b924d8..876862c 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -1279,7 +1279,8 @@ Tabmix.navToolbox = {
   handleCommand: function(event, openUILinkWhere, openUILinkParams = {}) {
     let prevTab, prevTabPos;
     let action = this._parseActionUrl(this.value) || {};
-    if (action.type == "switchtab" && this.hasAttribute("actiontype")) {
+    if (Tabmix.prefs.getBoolPref("moveSwitchToTabNext") &&
+        action.type == "switchtab" && this.hasAttribute("actiontype")) {
       prevTab = gBrowser.selectedTab;
       prevTabPos = prevTab._tPos;
     }
@@ -1309,7 +1310,7 @@ Tabmix.navToolbox = {
     Tabmix.originalFunctions.gURLBar_handleCommand.call(gURLBar, event, openUILinkWhere, openUILinkParams);
 
     // move the tab that was switched to after the previously selected tab
-    if (prevTabPos) {
+    if (typeof prevTabPos == "number") {
       let pos = prevTabPos + Number(gBrowser.selectedTab._tPos > prevTabPos) -
           Number(!prevTab || !prevTab.parentNode);
       gBrowser.moveTabTo(gBrowser.selectedTab, pos);
diff --git a/chrome/content/preferences/events.xul b/chrome/content/preferences/events.xul
index 9961f84..25a2ce3 100644
--- a/chrome/content/preferences/events.xul
+++ b/chrome/content/preferences/events.xul
@@ -31,6 +31,7 @@
       <preference id="pref_openTabNextInverse"  name="extensions.tabmix.openTabNextInverse"   type="bool"/>
       <preference id="pref_relatedAfterCurrent" name="browser.tabs.insertRelatedAfterCurrent" type="bool"/>
       <preference id="pref_openDuplicateNext"   name="extensions.tabmix.openDuplicateNext"    type="bool"/>
+      <preference id="pref_moveSwitchToTabNext" name="extensions.tabmix.moveSwitchToTabNext"  type="bool"/>
       <preference id="pref_loadProgressively"   name="extensions.tabmix.load_tabs_progressively"
                   type="int" notChecked=""/>
       <preference id="pref_restoreOnDemand"     name="extensions.tabmix.restore_on_demand"    type="int"/>
@@ -168,6 +169,8 @@
             <separator class="groove"/>
             <checkbox_tmp id="openDuplicateNext" label="&openDuplicateNext.label;"
                       preference="pref_openDuplicateNext"/>
+            <checkbox_tmp id="moveSwitchToTabNext" label="&moveSwitchToTabNext.label;"
+                      preference="pref_moveSwitchToTabNext"/>
           </groupbox>
           <groupbox flex="1">
             <!-- Load Bookmarks/History progressively -->
diff --git a/chrome/locale/en-US/pref-tabmix.dtd b/chrome/locale/en-US/pref-tabmix.dtd
index 4696a01..1b0cfc9 100644
--- a/chrome/locale/en-US/pref-tabmix.dtd
+++ b/chrome/locale/en-US/pref-tabmix.dtd
@@ -56,6 +56,7 @@
 <!ENTITY openTabNextInverse.label "Change opening order">
 <!ENTITY openTabNextInverse.tooltip "[a][3][2][1][b][c] -> [a][1][2][3][b][c]">
 <!ENTITY openTabNextInverse.tooltip1 "Open new tab next to the tab last opened from the current tab (since it was last selected)">
+<!ENTITY moveSwitchToTabNext.label "Move tab from 'Switch to tab' next to current one">
 <!ENTITY loadTabsProgressively.label "Load tabs progressively">
 <!ENTITY restoreOnDemand.label "Don't load tabs until selected">
 <!ENTITY moreThan.label "when I open more than">
diff --git a/defaults/preferences/tabmix.js b/defaults/preferences/tabmix.js
index 7bbbc24..a228929 100644
--- a/defaults/preferences/tabmix.js
+++ b/defaults/preferences/tabmix.js
@@ -41,6 +41,7 @@ pref("extensions.tabmix.openNewTabNext", false);
 pref("extensions.tabmix.openTabNext", false);
 pref("extensions.tabmix.openTabNextInverse", true);
 pref("extensions.tabmix.openDuplicateNext", true);
+pref("extensions.tabmix.moveSwitchToTabNext", false);
 pref("extensions.tabmix.focusTab", 2);
 pref("extensions.tabmix.protectedtabs.warnOnClose", true);
 /*

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