[Pkg-mozext-commits] [tabmixplus] 28/56: Update Eslint globals for other extensions

David Prévot taffit at moszumanska.debian.org
Mon Jun 6 00:02:35 UTC 2016


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 7600bd81afd11f079ed8afd0b4350d0f738b08a3
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Apr 9 12:18:37 2016 +0300

    Update Eslint globals for other extensions
---
 .eslintrc.js                           | 39 ----------------------------------
 chrome/content/click/click.js          | 24 ++++++++++++++-------
 chrome/content/extensions/.eslintrc.js | 31 +++++++++++++++++++++++++++
 chrome/content/links/setup.js          |  8 +++++--
 chrome/content/links/userInterface.js  |  9 +++++---
 chrome/content/minit/tablib.js         | 12 ++++++-----
 chrome/content/places/places.js        |  8 ++++++-
 chrome/content/session/session.js      |  5 +++--
 chrome/content/session/sessionStore.js |  4 ++--
 chrome/content/tab/tab.js              |  2 +-
 modules/ContentClick.jsm               |  2 +-
 11 files changed, 80 insertions(+), 64 deletions(-)

diff --git a/.eslintrc.js b/.eslintrc.js
index f0fe690..61478fb 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -258,44 +258,5 @@ module.exports = {
     // Firefox defining these in placesOverlay.xul
     "PlacesUtils": false,
     "PlacesUIUtils": false,
-
-    // other
-    "bgSaverPref": false,
-    "CHROMATABS": false,
-    "classiccompactoptions": false,
-    "closeallOverlay": false,
-    "colorfulTabs": false,
-    "com": false,
-    "contentAreaDNDObserver": false,
-    "cookiepieContextMenu": false,
-    "esteban_torres": false,
-    "faviconize": false,
-    "Fd": false,
-    "FdTabLoader": false,
-    "FdUtils": false,
-    "FireGestures": false,
-    "foxTab": false,
-    "gFxWeaveGlue": false,
-    "IeTab": false,
-    "IeTab2": false,
-    "IeView": false,
-    "ieview": false,
-    "Local_Install": false,
-    "mgBuiltInFunctions": false,
-    "MouseControl": false,
-    "objLinkify": false,
-    "PersonaController": false,
-    "privateTab": false,
-    "rdrb": false,
-    "readPref": false,
-    "RSSTICKER": false,
-    "SecondSearchBrowser": false,
-    "SessionSaver": false,
-    "SpeedDial": false,
-    "SubmitToTab": false,
-    "SwitchThemesModule": false,
-    "tileTabs": false,
-    "TreeStyleTabBrowser": false,
-    "TreeStyleTabWindowHelper": false
   }
 };
diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index c7a6c78..69784b6 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -182,10 +182,12 @@ var TabmixTabClickOptions = {
       case 11:
         Tabmix.renameTab.editTitle(aTab);
         break;
-      case 12: // taken from tco
+      case 12: { // taken from tco
+        let SessionSaver = window.SessionSaver;
         if (SessionSaver && SessionSaver.snapBackTab)
           SessionSaver.snapBackTab(SessionSaver.snapback_noFX, SessionSaver.snapback_willFocus);
         break;
+      }
       case 13:
         TMP_ClosedTabs.restoreTab("original", -2);
         break;
@@ -210,11 +212,11 @@ var TabmixTabClickOptions = {
       case 20:
         gBrowser._reloadRightTabs(aTab);
         break;
-      case 21: // taken from tco
-        var href;
+      case 21: { // taken from tco
+        let href;
         if (window.IeView && window.IeView.ieViewLaunch) {
           href = gBrowser.getBrowserForTab(aTab).currentURI.spec;
-          IeView.ieViewLaunch("Internet Explorer.lnk", href);
+          window.IeView.ieViewLaunch("Internet Explorer.lnk", href);
         } else if (Tabmix.extensions.gIeTab) {
           let ieTab = Tabmix.extensions.gIeTab;
           let gIeTabObj = window[ieTab.obj];
@@ -225,9 +227,10 @@ var TabmixTabClickOptions = {
           }
         } else if (window.ieview && window.ieview.launch) {
           href = gBrowser.getBrowserForTab(aTab).currentURI.spec;
-          ieview.launch(href);
+          window.ieview.launch(href);
         }
         break;
+      }
       case 22:
         gBrowser.SelectToMerge(aTab);
         break;
@@ -336,6 +339,7 @@ var TabmixContext = {
 
     // insert IE Tab menu-items before Bookmarks menu-items
     if ("gIeTab" in window) { // no need to do this fix for IE Tab 2
+      let IeTab = window.IeTab;
       var aFunction = "createTabbarMenu" in IeTab.prototype ? "createTabbarMenu" : "init";
       if (aFunction in IeTab.prototype) {
         Tabmix.changeCode(IeTab.prototype, "IeTab.prototype." + aFunction)._replace(
@@ -346,8 +350,12 @@ var TabmixContext = {
     }
 
     // fix conflict with CookiePie extension
-    if ("cookiepieContextMenu" in window && !cookiepieContextMenu.initialized)
-      cookiepieContextMenu.init();
+    if ("cookiepieContextMenu" in window) {
+      let cookiepieContextMenu = window.cookiepieContextMenu;
+      if (!cookiepieContextMenu.initialized) {
+        cookiepieContextMenu.init();
+      }
+    }
 
     if (Tabmix.prefs.getBoolPref("showTabContextMenuOnTabbar"))
       this.updateTabbarContextMenu(true);
@@ -1004,7 +1012,7 @@ var TabmixAllTabs = {
     // for ColorfulTabs 6.0+
     if (typeof colorfulTabs == "object") {
       let rule = "none";
-      if (colorfulTabs.clrAllTabsPopPref) {
+      if (window.colorfulTabs.clrAllTabsPopPref) {
         let tabClr = TabmixSessionData.getTabValue(tab, "tabClr");
         if (tabClr)
           rule = "linear-gradient(rgba(255,255,255,.7),rgba(#1,.5),rgb(#1)),linear-gradient(rgb(#1),rgb(#1))"
diff --git a/chrome/content/extensions/.eslintrc.js b/chrome/content/extensions/.eslintrc.js
new file mode 100644
index 0000000..14a60ad
--- /dev/null
+++ b/chrome/content/extensions/.eslintrc.js
@@ -0,0 +1,31 @@
+/* eslint strict: 0, object-curly-spacing: 0 */
+/* global module */
+module.exports = {
+  "globals": {
+    "abcdefghijklmnsopqrstuxyz": true,
+    "bgSaverPref": false,
+    "CHROMATABS": false,
+    "closeallOverlay": false,
+    "com": false,
+    "contentAreaDNDObserver": false,
+    "faviconize": false,
+    "FdUtils": false,
+    "FireGestures": false,
+    "foxTab": false,
+    "gFxWeaveGlue": false,
+    "IeTab2": false,
+    "Local_Install": false,
+    "mgBuiltInFunctions": false,
+    "MouseControl": false,
+    "objLinkify": false,
+    "PersonaController": false,
+    "rdrb": false,
+    "readPref": false,
+    "RSSTICKER": false,
+    "SecondSearchBrowser": false,
+    "SpeedDial": false,
+    "tileTabs": false,
+    "TreeStyleTabWindowHelper": false,
+    "TreeStyleTabBrowser": false,
+  }
+};
diff --git a/chrome/content/links/setup.js b/chrome/content/links/setup.js
index 85a52f1..a9f8851 100644
--- a/chrome/content/links/setup.js
+++ b/chrome/content/links/setup.js
@@ -264,8 +264,12 @@ Tabmix.beforeStartup = function TMP_beforeStartup(tabBrowser, aTabContainer) {
   TabmixTabbar.flowing = ["singlebar", "scrollbutton", "multibar", "scrollbutton"][tabscroll];
 
   // add flag that we are after SwitchThemes, we use it in Tabmix.isWindowAfterSessionRestore
-  if ("SwitchThemesModule" in window && SwitchThemesModule.windowsStates && SwitchThemesModule.windowsStates.length)
-    TMP_SessionStore.afterSwitchThemes = true;
+  if ("SwitchThemesModule" in window) {
+    let SwitchThemesModule = window.SwitchThemesModule;
+    if (SwitchThemesModule.windowsStates && SwitchThemesModule.windowsStates.length) {
+      TMP_SessionStore.afterSwitchThemes = true;
+    }
+  }
 
   TMP_extensionsCompatibility.preInit();
 };
diff --git a/chrome/content/links/userInterface.js b/chrome/content/links/userInterface.js
index 821ec45..be292fa 100644
--- a/chrome/content/links/userInterface.js
+++ b/chrome/content/links/userInterface.js
@@ -90,9 +90,12 @@ function TMP_BrowserOpenTab(aTab, replaceLastTab) {
   Tabmix.prefs.getBoolPref("loadNewInBackground");
   var loadBlank = isBlankPageURL(url);
   if (!TabmixSessionManager.isPrivateWindow && replaceLastTab && !loadBlank &&
-      typeof privateTab == "object" && privateTab.isTabPrivate(selectedTab) &&
-      TabmixSvc.prefs.get("extensions.privateTab.makeNewEmptyTabsPrivate", 0) === 0) {
-    privateTab.readyToOpenTab(false);
+      typeof privateTab == "object") {
+    let privateTab = window.privateTab;
+    if (privateTab.isTabPrivate(selectedTab) &&
+        TabmixSvc.prefs.get("extensions.privateTab.makeNewEmptyTabsPrivate", 0) === 0) {
+      privateTab.readyToOpenTab(false);
+    }
   }
 
   let baseTab = aTab && aTab.localName == "tab" ? aTab : null;
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 8abe77b..5dc20ca 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -739,11 +739,13 @@ var tablib = { // eslint-disable-line
     };
     Tabmix.setNewFunction(window, "FillHistoryMenu", fillHistoryMenu);
 
-    // Fix for Fast Dial
-    if ("BrowserGoHome" in window || "BrowserGoHome" in FdTabLoader) {
-      let loader = "FdTabLoader" in window && "BrowserGoHome" in FdTabLoader;
-      let obj = loader ? FdTabLoader : window;
-      fnName = loader ? "FdTabLoader.BrowserGoHome" : "window.BrowserGoHome";
+    // Fix for old Fast Dial versions before 4.6.1
+    // https://addons.mozilla.org/en-us/firefox/addon/fast-dial/
+    let fastDial = window.FdTabLoader,
+        fdGoHome = fastDial && fastDial.BrowserGoHome;
+    if (window.BrowserGoHome || fdGoHome) {
+      let obj = fdGoHome ? window.FdTabLoader : window;
+      fnName = fdGoHome ? "FdTabLoader.BrowserGoHome" : "window.BrowserGoHome";
       Tabmix.changeCode(obj, fnName)._replace(
         'var where = whereToOpenLink(aEvent, false, true);',
         '$&' +
diff --git a/chrome/content/places/places.js b/chrome/content/places/places.js
index 9f5aa85..acdf76e 100644
--- a/chrome/content/places/places.js
+++ b/chrome/content/places/places.js
@@ -768,13 +768,19 @@ Tabmix.onContentLoaded = {
   // update compatibility with X-notifier(aka WebMail Notifier) 2.9.13+
   // object name wmn replace with xnotifier for version 3.0+
   getXnotifierFunction: function(aName) {
+    let com = window.com;
     if (typeof com == "object" && typeof com.tobwithu == "object") {
       let fn = ["wmn", "xnotifier"].filter(function(f) {
+        let t = Tabmix.obj(com.tobwithu[f] || {}, "name " + f, false, true);
+        Tabmix.trace();
+        Tabmix.xlog(t);
         return typeof com.tobwithu[f] == "object" &&
           typeof com.tobwithu[f][aName] == "function";
       });
-      if (fn.length)
+      if (fn.length) {
+        Tabmix.obj(fn[0], aName);
         return [com.tobwithu[fn[0]], aName];
+      }
     }
     return [window, aName];
   }
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 0a56f8b..cf9df35 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -165,6 +165,7 @@ TabmixSessionData = {
     tabProperties += " hidden=" + aTab.hidden;
 
     if ("colorfulTabs" in window) {
+      let colorfulTabs = window.colorfulTabs;
       try {
         let ctreadonly = colorfulTabs.clrSession.getTabValue(aTab, "ctreadonly");
         if (ctreadonly)
@@ -1444,7 +1445,7 @@ TabmixSessionManager = {
     if (gBrowser.isBlankWindow())
       return false;
     return typeof privateTab != "object" ||
-      Array.prototype.some.call(gBrowser.tabs, tab => !privateTab.isTabPrivate(tab));
+      Array.prototype.some.call(gBrowser.tabs, tab => !window.privateTab.isTabPrivate(tab));
   },
 
   saveOneOrAll: function(action, path, saveClosedTabs) {
@@ -2836,7 +2837,7 @@ TabmixSessionManager = {
   },
 
   isTabPrivate: function(aTab) {
-    return typeof privateTab == "object" && privateTab.isTabPrivate(aTab);
+    return typeof privateTab == "object" && window.privateTab.isTabPrivate(aTab);
   },
 
   privateTabChanged: function(aEvent) {
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index 65d6aee..709c652 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -664,8 +664,8 @@ var TabmixConvertSession = {
       let tmp = {};
       Cu.import("chrome://sessionmanager/content/modules/session_convert.jsm", tmp);
       tmp.SessionConverter.convertTMP(aFileUri, aSilent);
-    } else {
-      let sm = com.morac.SessionManagerAddon.gSessionManagerWindowObject;
+    } else if ("com" in window && window.com.morac) {
+      let sm = window.com.morac.SessionManagerAddon.gSessionManagerWindowObject;
       sm.doTMPConvertFile(aFileUri, aSilent);
     }
   },
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index e229b9e..ee045d1 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -1379,7 +1379,7 @@ gTMPprefObserver = {
         // fix bug in classiccompact
         if (typeof classiccompactoptions == "object" &&
             Services.prefs.getCharPref("general.skins.selectedSkin") == "classiccompact") {
-          classiccompactoptions.setTabWidths(document);
+          window.classiccompactoptions.setTabWidths(document);
         }
         TabmixTabbar.updateSettings(false);
         // we need this timeout when there are many tabs
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 0c02d5a..168e331 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -334,7 +334,7 @@ ContentClickInternal = {
       let target = event.target;
       if (target instanceof HTMLButtonElement ||
           target instanceof HTMLInputElement) {
-        if (SubmitToTab.contentAreaClick(event) === false) {
+        if (this._window.SubmitToTab.SubmitToTab.contentAreaClick(event) === false) {
           return ["default at 1"];
         }
       }

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