[Pkg-mozext-commits] [tabmixplus] 53/107: Apply Eslint rules brace-style and space-after-keywords
David Prévot
taffit at moszumanska.debian.org
Tue Dec 29 19:02:50 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 5da91a057296b59d6873f4eee0e932df76d61259
Author: onemen <tabmix.onemen at gmail.com>
Date: Thu Nov 5 11:16:39 2015 +0200
Apply Eslint rules brace-style and space-after-keywords
---
.eslintrc | 4 +-
chrome/content/changecode.js | 3 +-
chrome/content/click/click.js | 44 ++++------
chrome/content/extensions/extensions.js | 34 ++++----
chrome/content/extensions/sage.js | 3 +-
chrome/content/flst/lasttab.js | 21 ++---
chrome/content/links/setup.js | 25 +++---
chrome/content/links/userInterface.js | 15 ++--
chrome/content/minit/minit.js | 55 +++++-------
chrome/content/minit/tabView.js | 10 +--
chrome/content/minit/tablib.js | 75 +++++++++--------
chrome/content/places/places.js | 6 +-
chrome/content/preferences/menu.js | 3 +-
.../preferences/overlay/overlaySanitizeUI.js | 7 +-
.../preferences/overlay/preferencesOverlay.js | 4 +-
chrome/content/preferences/session.js | 6 +-
.../preferences/subdialogs/pref-filetype.js | 6 +-
chrome/content/tab/tab.js | 97 ++++++++++------------
chrome/content/tabmix.js | 82 ++++++++++--------
chrome/content/utils.js | 12 ++-
modules/AutoReload.jsm | 3 +-
modules/ContentClick.jsm | 10 +--
modules/ContextMenu.jsm | 3 +-
modules/Decode.jsm | 6 +-
modules/DynamicRules.jsm | 9 +-
modules/MergeWindows.jsm | 9 +-
modules/Places.jsm | 3 +-
modules/Services.jsm | 11 ++-
modules/Shortcuts.jsm | 26 +++---
modules/SingleWindowModeUtils.jsm | 14 ++--
modules/Slideshow.jsm | 13 ++-
modules/extensions/AddonManager.jsm | 3 +-
modules/extensions/CompatibilityCheck.jsm | 7 +-
modules/log.jsm | 7 +-
34 files changed, 311 insertions(+), 325 deletions(-)
diff --git a/.eslintrc b/.eslintrc
index c6b713b..c5bce09 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -142,7 +142,7 @@
"no-with": 2,
"block-scoped-var": 0,
- "brace-style": 0, // TODO change to [2, "1tbs"] or [2, "stroustrup"]
+ "brace-style": [2, "1tbs"],
"camelcase": 0,
// TODO - maybe in the future
// "comma-dangle": [2, "always-multiline"],
@@ -185,7 +185,7 @@
"semi": 2,
"semi-spacing": [0, {"before": false, "after": true}],
"sort-vars": 0,
- "space-after-keywords": [0, "always"], // TODO change to [2, "always"]
+ "space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"object-curly-spacing": [2, "never"],
diff --git a/chrome/content/changecode.js b/chrome/content/changecode.js
index 3390fab..0ff79ee 100644
--- a/chrome/content/changecode.js
+++ b/chrome/content/changecode.js
@@ -39,8 +39,7 @@ Tabmix.changeCode = function(aParent, aName, aOptions) {
doReplace = "check" in aParams ? aParams.check : true;
flags = aParams.flags;
silent = aParams.silent;
- }
- else if (typeof aParams == "boolean") {
+ } else if (typeof aParams == "boolean") {
doReplace = aParams;
}
if (!doReplace)
diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index 3649905..4248c72 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -75,27 +75,21 @@ var TabmixTabClickOptions = {
}
var prefName;
- /* middle click*/
- if (aEvent.button == 1)
- prefName = "middle";
- /* shift click*/
- else if (leftClick && aEvent.shiftKey && !aEvent.ctrlKey &&
+ if (aEvent.button == 1) {
+ prefName = "middle"; /* middle click*/
+ } else if (leftClick && aEvent.shiftKey && !aEvent.ctrlKey &&
!aEvent.altKey && !aEvent.metaKey) {
- prefName = "shift";
- }
- /* alt click*/
- else if (leftClick && aEvent.altKey && !aEvent.ctrlKey &&
+ prefName = "shift"; /* shift click*/
+ } else if (leftClick && aEvent.altKey && !aEvent.ctrlKey &&
!aEvent.shiftKey && !aEvent.metaKey) {
- prefName = "alt";
+ prefName = "alt"; /* alt click*/
window.addEventListener("keyup", function TMP_onKeyup_onTabClick(aEvent) {
aEvent.currentTarget.removeEventListener("keyup", TMP_onKeyup_onTabClick, true);
aEvent.stopPropagation();
}, true);
- }
- /* ctrl click*/
- else if (leftClick && (aEvent.ctrlKey && !aEvent.metaKey ||
+ } else if (leftClick && (aEvent.ctrlKey && !aEvent.metaKey ||
!aEvent.ctrlKey && aEvent.metaKey) && !aEvent.shiftKey && !aEvent.altKey) {
- prefName = "ctrl";
+ prefName = "ctrl"; /* ctrl click*/
}
if (prefName)
@@ -221,8 +215,7 @@ var TabmixTabClickOptions = {
if (window.IeView && window.IeView.ieViewLaunch) {
href = gBrowser.getBrowserForTab(aTab).currentURI.spec;
IeView.ieViewLaunch("Internet Explorer.lnk", href);
- }
- else if (Tabmix.extensions.gIeTab) {
+ } else if (Tabmix.extensions.gIeTab) {
let ieTab = Tabmix.extensions.gIeTab;
let gIeTabObj = window[ieTab.obj];
if (typeof gIeTabObj.switchTabEngine == "function") {
@@ -230,8 +223,7 @@ var TabmixTabClickOptions = {
gBrowser.selectedTab = aTab;
gIeTabObj.switchTabEngine(aTab, gIeTabObj.getBoolPref(ieTab.folder + ".alwaysNewTab", false));
}
- }
- else if (window.ieview && window.ieview.launch) {
+ } else if (window.ieview && window.ieview.launch) {
href = gBrowser.getBrowserForTab(aTab).currentURI.spec;
ieview.launch(href);
}
@@ -438,8 +430,7 @@ var TabmixContext = {
if (clickOutTabs) {
Tabmix.setItem(newTab, "label", newTab.getAttribute("_newtab"));
Tabmix.setItem(newTab, "oncommand", "TMP_BrowserOpenTab();");
- }
- else {
+ } else {
Tabmix.setItem(newTab, "label", newTab.getAttribute("_newtab") + " " + newTab.getAttribute("_afterthis"));
Tabmix.setItem(newTab, "oncommand", "TMP_BrowserOpenTab(TabContextMenu.contextTab);");
}
@@ -588,8 +579,7 @@ var TabmixContext = {
hideNextSeparator = true;
lastVisible = mi;
}
- }
- else if (hideNextSeparator) {
+ } else if (hideNextSeparator) {
if (lastVisible.getAttribute("type") == "tabmix" && mi.getAttribute("type") != "tabmix") {
mi.hidden = false;
lastVisible.hidden = true;
@@ -598,8 +588,7 @@ var TabmixContext = {
else
mi.hidden = true;
}
- }
- else if (!mi.hidden && !mi.collapsed) {
+ } else if (!mi.hidden && !mi.collapsed) {
hideNextSeparator = false;
hideMenu = false;
}
@@ -728,7 +717,9 @@ var TabmixContext = {
duplicateTabMenu.hidden && duplicateWinMenu.hidden && closeTabMenu.hidden &&
lockTabMenu.hidden && protectTabMenu.hidden && tabsListMenu.hidden &&
freezeTabMenu.hidden && undoCloseTabMenu.hidden && undoCloseListMenu.hidden;
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
return true;
},
@@ -1055,8 +1046,7 @@ var TabmixAllTabs = {
if (aTab.hasAttribute("busy")) {
aMenuitem.setAttribute("busy", aTab.getAttribute("busy"));
aMenuitem.removeAttribute("image");
- }
- else {
+ } else {
aMenuitem.setAttribute("image", gBrowser.getIcon(aTab));
aMenuitem.removeAttribute("busy");
}
diff --git a/chrome/content/extensions/extensions.js b/chrome/content/extensions/extensions.js
index ec79095..8d8b5cc 100644
--- a/chrome/content/extensions/extensions.js
+++ b/chrome/content/extensions/extensions.js
@@ -51,7 +51,9 @@ var TMP_extensionsCompatibility = {
tmp.TMP_TabGroupsManager.changeCode = Tabmix.changeCode;
tmp.TMP_TabGroupsManager.init(window, gBrowser.tabContainer);
}
- } catch (ex) {Tabmix.assert(ex, "error in TabGroupsManager.jsm");}
+ } catch (ex) {
+ Tabmix.assert(ex, "error in TabGroupsManager.jsm");
+ }
// fix for Cluster Tabs - Cluster Tab look for TM_init
// https://addons.mozilla.org/en-US/firefox/addon/cluster-tabs-for-firefox/
@@ -78,7 +80,9 @@ var TMP_extensionsCompatibility = {
Tabmix.extensions.treeStyleTab = true;
Tabmix.extensions.verticalTabBar = true;
}
- } catch (ex) {Tabmix.assert(ex, this.treeStyleTab.errorMsg);}
+ } catch (ex) {
+ Tabmix.assert(ex, this.treeStyleTab.errorMsg);
+ }
// https://addons.mozilla.org/en-US/firefox/addon/second-search/
if ("SecondSearchBrowser" in window && SecondSearchBrowser.prototype) {
@@ -101,13 +105,11 @@ var TMP_extensionsCompatibility = {
window.getBoolPref = function getBoolPref(prefname, def) {
try {
return Services.prefs.getBoolPref(prefname);
- }
- catch (ex) {
+ } catch (ex) {
try {
return (bgSaverPref.prefHasUserValue(prefname) &&
bgSaverPref.getBoolPref(prefname));
- }
- catch (e) {}
+ } catch (e) {}
}
return def;
};
@@ -320,7 +322,9 @@ var TMP_extensionsCompatibility = {
try {
if ("TreeStyleTabService" in window)
this.treeStyleTab.onWindowLoaded();
- } catch (ex) {Tabmix.assert(ex, this.treeStyleTab.errorMsg);}
+ } catch (ex) {
+ Tabmix.assert(ex, this.treeStyleTab.errorMsg);
+ }
/* fast dial FdUtils*/
if ("FdUtils" in window && FdUtils.whereToOpenLink) {
@@ -387,11 +391,11 @@ var TMP_extensionsCompatibility = {
// override some of All-in-One Gestures function
// override the duplicate tab function
if (typeof aioDupTab == 'function')
- window.aioDupTab = function() { gBrowser.duplicateTab(gBrowser.mCurrentTab); };
+ window.aioDupTab = () => gBrowser.duplicateTab(gBrowser.mCurrentTab);
// override the duplicate in new window function
if (typeof aioDupWindow == 'function')
- window.aioDupWindow = function() { gBrowser.duplicateTabToWindow(gBrowser.mCurrentTab); };
+ window.aioDupWindow = () => gBrowser.duplicateTabToWindow(gBrowser.mCurrentTab);
// override the aioCloseWindow function
if (typeof aioCloseWindow == 'function')
@@ -485,11 +489,9 @@ TMP_extensionsCompatibility.RSSTICKER = {
onClick: function(event) {
if (event.ctrlKey) {
this.markAsRead(true);
- }
- else if ((this.parent.alwaysOpenInNewTab && (event.which == 1)) || (event.which == 2)) {
+ } else if ((this.parent.alwaysOpenInNewTab && (event.which == 1)) || (event.which == 2)) {
this.onContextOpen("tab");
- }
- else if (event.which == 1) {
+ } else if (event.which == 1) {
this.onContextOpen();
}
},
@@ -500,14 +502,12 @@ TMP_extensionsCompatibility.RSSTICKER = {
this.parent.browser.openInNewTab(this.href);
else
window.loadURI(this.href);
- }
- else if (target == "window") {
+ } else if (target == "window") {
if (Tabmix.singleWindowMode)
this.parent.browser.openInNewTab(this.href);
else
window.open(this.href);
- }
- else if (target == "tab") {
+ } else if (target == "tab") {
this.parent.browser.openInNewTab(this.href);
}
diff --git a/chrome/content/extensions/sage.js b/chrome/content/extensions/sage.js
index b5cd1aa..8469ed5 100644
--- a/chrome/content/extensions/sage.js
+++ b/chrome/content/extensions/sage.js
@@ -36,8 +36,7 @@ var TMP_Sage = {
'windowType = TMP_Places.fixWhereToOpen((oType instanceof Event)? oType : null, !windowType ? "current" : windowType, TMP_Sage.openTabPref); \
$&'
).toCode();
- }
- else {
+ } else {
Tabmix.changeCode(window, "openURI")._replace(
'switch (getWindowType(aEvent))',
'var windowType = getWindowType(aEvent);\
diff --git a/chrome/content/flst/lasttab.js b/chrome/content/flst/lasttab.js
index 11d0031..7de0406 100644
--- a/chrome/content/flst/lasttab.js
+++ b/chrome/content/flst/lasttab.js
@@ -59,8 +59,7 @@ var TMP_LastTab = {
.getService(Ci.nsIEventListenerService);
if (Tabmix.isVersion(320)) {
els.removeSystemEventListener(tabBox._eventNode, "keydown", tabBox, false);
- }
- else {
+ } else {
tabBox._eventNode.removeEventListener("keypress", tabBox, false);
els.addSystemEventListener(tabBox._eventNode, "keypress", this, false);
}
@@ -121,8 +120,7 @@ var TMP_LastTab = {
this.KeyboardNavigating = false;
}
this.TabIndex = this.inverseIndex(event.target.value);
- }
- else if (event.target.value != this.inverseIndex(this.TabIndex)) {
+ } else if (event.target.value != this.inverseIndex(this.TabIndex)) {
event.target.setAttribute("_moz-menuactive", "false");
}
},
@@ -202,8 +200,7 @@ var TMP_LastTab = {
this.TabIndex++;
if (this.TabIndex >= tabCount)
this.TabIndex = 0;
- }
- else {
+ } else {
this.TabIndex--;
if (this.TabIndex < 0)
this.TabIndex = tabCount - 1;
@@ -223,8 +220,7 @@ var TMP_LastTab = {
else
this.DisplayTabList();
}
- }
- else {
+ } else {
let item = this.tabs[this.TabIndex].mCorrespondingMenuitem;
item.setAttribute("_moz-menuactive", "true");
TabmixAllTabs.updateMenuItemActive(null, item);
@@ -234,13 +230,11 @@ var TMP_LastTab = {
TabmixAllTabs._tabSelectedFromList(this.tabs[this.TabIndex]);
event.stopPropagation();
event.preventDefault();
- }
- else if (this.TabListLock && this.CtrlKey &&
+ } else if (this.TabListLock && this.CtrlKey &&
event.keyCode == Ci.nsIDOMKeyEvent.DOM_VK_SHIFT) {
// don't hide the tabs list popup when user press shift
return;
- }
- else {
+ } else {
if (this.TabListLock)
this.TabList.hidePopup();
@@ -327,8 +321,7 @@ var TMP_LastTab = {
}
}
this.PushSelectedTab();
- }
- else if (!this.KeyLock) {
+ } else if (!this.KeyLock) {
if (this.CtrlKey)
this.KeyLock = true; // allow other tab navigation methods to work
else
diff --git a/chrome/content/links/setup.js b/chrome/content/links/setup.js
index 801112e..f7ffc62 100644
--- a/chrome/content/links/setup.js
+++ b/chrome/content/links/setup.js
@@ -49,11 +49,15 @@ Tabmix.linkHandling_init = function TMP_TBP_init(aWindowType) {
Tabmix.beforeBrowserInitOnLoad = function() {
try {
TabmixSvc.windowStartup.init(window);
- } catch (ex) {this.assert(ex);}
+ } catch (ex) {
+ this.assert(ex);
+ }
try {
gTMPprefObserver.init();
- } catch (ex) {this.assert(ex);}
+ } catch (ex) {
+ this.assert(ex);
+ }
try {
var SM = TabmixSessionManager;
@@ -71,8 +75,7 @@ Tabmix.beforeBrowserInitOnLoad = function() {
SM.firstNonPrivateWindow = TabmixSvc.sm.private && !SM.isPrivateWindow;
if (SM.firstNonPrivateWindow)
TabmixSvc.sm.private = false;
- }
- else {
+ } else {
let pbs = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
SM.globalPrivateBrowsing = pbs.privateBrowsingEnabled;
@@ -89,12 +92,13 @@ Tabmix.beforeBrowserInitOnLoad = function() {
// make tabmix compatible with ezsidebar extension
var fnContainer, TMP_BrowserStartup;
- if ("__ezsidebar__BrowserStartup" in window) // need to test this on firefox 16+
+ if ("__ezsidebar__BrowserStartup" in window) {// need to test this on firefox 16+
[fnContainer, TMP_BrowserStartup] = [window, "__ezsidebar__BrowserStartup"];
- else if ("gBrowserInit" in window)
+ } else if ("gBrowserInit" in window) {
[fnContainer, TMP_BrowserStartup] = [gBrowserInit, "onLoad"];
- else // we probably never get here
+ } else { // we probably never get here
[fnContainer, TMP_BrowserStartup] = [window, "BrowserStartup"];
+ }
var bowserStartup = this.changeCode(fnContainer, TMP_BrowserStartup);
// Bug 756313 - Don't load homepage URI before first paint
@@ -236,7 +240,9 @@ Tabmix.beforeBrowserInitOnLoad = function() {
fnContainer[TMP_BrowserStartup].bind(fnContainer);
- } catch (ex) {this.assert(ex);}
+ } catch (ex) {
+ this.assert(ex);
+ }
};
// this must run before all
@@ -413,8 +419,7 @@ Tabmix.adjustTabstrip = function tabContainer_adjustTabstrip(skipUpdateScrollSta
this.setAttribute("closebuttons", "noclose");
this.removeAttribute("closebuttons-hover");
}
- }
- else if ((!skipUpdateScrollStatus && oldValue != this.getAttribute("closebuttons")) ||
+ } else if ((!skipUpdateScrollStatus && oldValue != this.getAttribute("closebuttons")) ||
("faviconize" in window && Tabmix.callerName() == "onxbltransitionend")) {
TabmixTabbar.updateScrollStatus();
TabmixTabbar.updateBeforeAndAfter();
diff --git a/chrome/content/links/userInterface.js b/chrome/content/links/userInterface.js
index 87ead75..16a7622 100644
--- a/chrome/content/links/userInterface.js
+++ b/chrome/content/links/userInterface.js
@@ -26,8 +26,7 @@ Tabmix.openOptionsDialog = function TMP_openDialog(panel) {
tabmixOptionsWin.gIncompatiblePane.checkForIncompatible(false);
(appearanceWin || filetypeWin || promptWin || tabmixOptionsWin).focus();
- }
- else {
+ } else {
window.openDialog("chrome://tabmixplus/content/preferences/preferences.xul", "Tab Mix Plus",
"chrome,titlebar,toolbar,close,dialog=no,centerscreen", panel || null);
}
@@ -48,8 +47,7 @@ Tabmix.openURL = function TMP_openURL(aURL, event) {
var linkTarget;
try {
linkTarget = Services.prefs.getIntPref("browser.link.open_newwindow");
- }
- catch (e) {
+ } catch (e) {
linkTarget = 1;
}
@@ -129,7 +127,9 @@ function TMP_BrowserOpenTab(aTab, replaceLastTab) {
url = Services.prefs.getComplexValue(prefName, Ci.nsISupportsString).data;
if (newTabUrl == "about:privatebrowsing" && url == TabmixSvc.aboutNewtab)
url = "about:privatebrowsing";
- } catch (ex) { Tabmix.assert(ex); }
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
// use this if we can't find the pref
if (!url)
url = newTabUrl;
@@ -217,7 +217,7 @@ Tabmix.clearUrlBar = function TMP_clearUrlBar(aTab, aUrl, aTimeOut, replaceLastT
if (this.isVersion(340) && gMultiProcessBrowser)
aTab._skipContentFocus = true;
if (aTimeOut)
- setTimeout(function() {focusAndSelectUrlBar();}, 30);
+ setTimeout(() => focusAndSelectUrlBar(), 30);
else
focusAndSelectUrlBar();
}
@@ -319,8 +319,7 @@ Tabmix.checkCurrent = function TMP_checkCurrent(url) {
let isBlankTab = gBrowser.isBlankNotBusyTab(gBrowser.mCurrentTab);
if (!isBlankTab)
return "tab";
- }
- else if (opentabforLinks == 2) {
+ } else if (opentabforLinks == 2) {
// Get current page url
let curpage = gBrowser.currentURI.spec;
if (this.ContentClick.isLinkToExternalDomain(curpage, url))
diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index 56d02c2..25ce5be 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -212,7 +212,9 @@ var TMP_tabDNDObserver = {
url = null;
disAllowDrop = url ? !Tabmix.ContentClick.isUrlForDownload(url) : true;
- } catch (ex) { Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
if (disAllowDrop)
dt.effectAllowed = "none";
@@ -229,9 +231,8 @@ var TMP_tabDNDObserver = {
if (canDrop && !isCopy && draggeType == this.DRAG_TAB_IN_SAME_WINDOW && oldIndex == newIndex) {
canDrop = false;
dt.effectAllowed = "none";
- }
- // if we don't set effectAllowed to none then the drop indicator stay
- else if (TabmixTabbar.scrollButtonsMode == TabmixTabbar.SCROLL_BUTTONS_LEFT_RIGHT &&
+ } else if (TabmixTabbar.scrollButtonsMode == TabmixTabbar.SCROLL_BUTTONS_LEFT_RIGHT &&
+ // if we don't set effectAllowed to none then the drop indicator stay
gBrowser.tabs[0].pinned &&
Tabmix.compare(event.screenX, Tabmix.itemEnd(gBrowser.tabs[0], !Tabmix.ltr), Tabmix.ltr)) {
canDrop = false;
@@ -253,8 +254,7 @@ var TMP_tabDNDObserver = {
this.gBackupLabel = statusTextFld.getAttribute("label");
statusTextFld.label = this.gMsg;
this.statusFieldChanged = true;
- }
- else if (!statusTextFld) {
+ } else if (!statusTextFld) {
let tooltip = document.getElementById("tabmix-tooltip");
if (tooltip.state == "closed") {
tooltip.label = this.gMsg;
@@ -355,8 +355,7 @@ var TMP_tabDNDObserver = {
if (draggeType == this.DRAG_TAB_TO_NEW_WINDOW || event.shiftKey)
gBrowser.selectedTab = newTab;
- }
- else {
+ } else {
// move the dropped tab
newIndex += left_right - (newIndex > oldIndex);
@@ -376,8 +375,7 @@ var TMP_tabDNDObserver = {
gBrowser.ensureTabIsVisible(gBrowser.tabs.item(newIndex));
TabmixTabbar.updateBeforeAndAfter();
- }
- else if (draggedTab) {
+ } else if (draggedTab) {
// swap the dropped tab with a new one we create and then close
// it in the other window (making it seem to have moved between
// windows)
@@ -407,8 +405,7 @@ var TMP_tabDNDObserver = {
gBrowser.selectedTab = newTab;
gBrowser.swapBrowsersAndCloseOther(newTab, draggedTab);
gBrowser.updateCurrentBrowser(true);
- }
- else {
+ } else {
// Pass true to disallow dropping javascript: or data: urls
let url;
try {
@@ -427,8 +424,7 @@ var TMP_tabDNDObserver = {
// We're adding a new tab.
let newTab = gBrowser.loadOneTab(url, {inBackground: bgLoad, allowThirdPartyFixup: true});
gBrowser.moveTabTo(newTab, newIndex + left_right);
- }
- else {
+ } else {
// Load in an existing tab.
let tab = event.target.localName == "tab" ? event.target : gBrowser.tabs[newIndex];
try {
@@ -498,8 +494,7 @@ var TMP_tabDNDObserver = {
aEvent.stopPropagation();
return;
}
- }
- else {// bottom
+ } else {// bottom
var tb = gNavToolbox.boxObject;
var toolboxEndScreenY = tb.screenY + tb.height;
var startScreenY = bo.screenY - 0.5 * rowHeight;
@@ -603,8 +598,7 @@ var TMP_tabDNDObserver = {
if (Tabmix.compare(mX, Tabmix.itemEnd(tab, Tabmix.ltr), Tabmix.ltr))
return i;
}
- }
- else {
+ } else {
let topY = Tabmix.tabsUtils.topTabY;
for (let i = 0; i < numTabs; i++) {
let tab = tabs[i];
@@ -637,8 +631,7 @@ var TMP_tabDNDObserver = {
left_right = (mX < tabBo.screenX + tabBo.width / 4) ? _left : _right;
if (left_right == _right && mX < tabBo.screenX + tabBo.width * 3 / 4)
left_right = -1;
- }
- else {
+ } else {
left_right = (mX < tabBo.screenX + tabBo.width / 2) ? _left : _right;
if (!isCtrlKey && draggeType == this.DRAG_TAB_IN_SAME_WINDOW) {
if (newIndex == oldIndex - 1)
@@ -677,8 +670,7 @@ var TMP_tabDNDObserver = {
this.setDragmarkAttribute(gBrowser.tabs[newIndex], "atLeft");
if (sameRow || left_right == 1)
this.setDragmarkAttribute(gBrowser.tabs[newIndex - 1], "atRight");
- }
- else {
+ } else {
// code for firefox indicator
var ind = gBrowser.tabContainer._tabDropIndicator;
var minMargin, maxMargin, newMargin;
@@ -710,8 +702,7 @@ var TMP_tabDNDObserver = {
let addOnBar = document.getElementById("addon-bar");
fixMargin = (Tabmix.isVersion(280) || addOnBar && addOnBar.collapsed) &&
(Math.abs(newMarginY) < 0.5);
- }
- else {
+ } else {
newMarginY = tabRect.bottom - rect.bottom;
fixMargin = this.onLastToolbar && (Math.abs(newMarginY) < 0.5);
}
@@ -838,7 +829,7 @@ var TMP_undocloseTabButtonObserver = {
var sourceNode = TMP_tabDNDObserver.getSourceNode(dt) || this.NEW_getSourceNode(dt);
if (sourceNode && sourceNode.localName == "tab")
// let tabbrowser drag event time to end before we remove the sourceNode
- setTimeout(function(b, aTab) {b.removeTab(aTab, {animate: true});}, 0, gBrowser, sourceNode);
+ setTimeout((b, aTab) => b.removeTab(aTab, {animate: true}), 0, gBrowser, sourceNode);
this.onDragExit(aEvent);
},
@@ -891,7 +882,9 @@ Tabmix.whereToOpen = function TMP_whereToOpen(pref, altKey) {
Tabmix.getStyle = function TMP_getStyle(aObj, aStyle) {
try {
return parseInt(window.getComputedStyle(aObj, null)[aStyle]) || 0;
- } catch (ex) {this.assert(ex);}
+ } catch (ex) {
+ this.assert(ex);
+ }
return 0;
};
@@ -1052,8 +1045,7 @@ Tabmix.navToolbox = {
TabmixTabbar.visibleRows = 1;
TabmixTabbar.updateSettings(false);
this.resetUI = false;
- }
- else if (aToolboxChanged) {
+ } else if (aToolboxChanged) {
TabmixTabbar.updateScrollStatus();
TabmixTabbar.updateBeforeAndAfter();
}
@@ -1345,10 +1337,9 @@ Tabmix.navToolbox = {
let position = Tabmix.prefs.getIntPref(pref);
Tabmix.prefs.clearUserPref(pref);
CustomizableUI.moveWidgetWithinArea("tabmix-tabs-closebutton", position);
- }
- // try to restore button position from tabs-closebutton position
- // if item with tabs-closebutton id exist, some other extension add it
- else if (!document.getElementById("tabs-closebutton")) {
+ } else if (!document.getElementById("tabs-closebutton")) {
+ // try to restore button position from tabs-closebutton position
+ // if item with tabs-closebutton id exist, some other extension add it
// will throw if called too early (before placements have been fetched)
let currentset = CustomizableUI.getWidgetIdsInArea("TabsToolbar");
let position = currentset.indexOf("tabs-closebutton");
diff --git a/chrome/content/minit/tabView.js b/chrome/content/minit/tabView.js
index 4ca8038..ea29892 100644
--- a/chrome/content/minit/tabView.js
+++ b/chrome/content/minit/tabView.js
@@ -66,7 +66,9 @@
try {
TabmixSessionManager._groupItemPushAway();
this._patchTabviewFrame();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
}.bind(this);
if (TabView._window)
@@ -287,8 +289,7 @@
// We are here only when the restored session did not have tabview data
// we creat new group and fill all the data
tabviewData = setData(update.newGroupID);
- }
- else {
+ } else {
tabviewData = tabdata.extData && tabdata.extData["tabview-tab"] || null;
// make sure data is not "null"
if (!tabviewData || tabviewData == "null") {
@@ -489,8 +490,7 @@
groupItems[newID].id = newID;
// we will update tabview-tab data later
IDs[id] = newID;
- }
- else {
+ } else {
groupItems[id] = newGroupItems[id];
if (id > groupsData.nextID)
groupsData.nextID = id;
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index cd192e1..cf5b7e1 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -28,9 +28,9 @@ var tablib = { // eslint-disable-line
return;
this._loadURIWithFlagsinitialized = true;
[obj, name] = [window, "window._loadURIWithFlags"];
- }
- else
+ } else {
[obj, name] = [aBrowser, "browser.loadURIWithFlags"];
+ }
Tabmix.changeCode(obj, name)._replace(
'{',
'$&\n' +
@@ -125,16 +125,16 @@ var tablib = { // eslint-disable-line
if (typeof rp == "object" && typeof rp.addTab == "object" &&
typeof rp.addTab.main == "function") {
[obj, fnName] = [rp.addTab, "rpcontinuedWrappedFunctions.addTab.main"];
- } else if (typeof Fd == "object" && typeof Fd.addTab == "function")
+ } else if (typeof Fd == "object" && typeof Fd.addTab == "function") {
[obj, fnName] = [Fd, "Fd.addTab"];
- else if (Tabmix.extensions.ieTab2)
+ } else if (Tabmix.extensions.ieTab2) {
[obj, fnName] = [Tabmix.originalFunctions, "oldAddTab"];
// NRA-ILA toolbar extension raplce the original addTab function
- else if ("origAddTab7c3de167ed6f494aa652f11a71ecb40c" in gBrowser) {
+ } else if ("origAddTab7c3de167ed6f494aa652f11a71ecb40c" in gBrowser) {
[obj, fnName] = [gBrowser, "origAddTab7c3de167ed6f494aa652f11a71ecb40c"];
- }
- else
+ } else {
[obj, fnName] = [gBrowser, "addTab"];
+ }
Tabmix.changeCode(obj, "gBrowser." + fnName)._replace(
'{', '{\n\
@@ -283,10 +283,11 @@ var tablib = { // eslint-disable-line
).toCode();
}
- if (Tabmix.extensions.ieTab2)
+ if (Tabmix.extensions.ieTab2) {
[obj, fnName] = [Tabmix.originalFunctions, "oldSetTabTitle"];
- else
+ } else {
[obj, fnName] = [gBrowser, "setTabTitle"];
+ }
Tabmix.changeCode(obj, "gBrowser." + fnName)._replace(
'var title = browser.contentTitle;',
'$&\
@@ -893,7 +894,9 @@ var tablib = { // eslint-disable-line
let menuLabelString = gNavigatorBundle.getString("menuUndoCloseWindowLabel");
let menuLabelStringSingleTab =
gNavigatorBundle.getString("menuUndoCloseWindowSingleTabLabel");
- let checkForMiddleClick = function(e) {this.checkForMiddleClick(e);}.bind(TabmixSessionManager);
+ let checkForMiddleClick = function(e) {
+ this.checkForMiddleClick(e);
+ }.bind(TabmixSessionManager);
for (let i = 0; i < undoPopup.childNodes.length; i++) {
let m = undoPopup.childNodes[i];
let undoItem = undoItems[i];
@@ -973,7 +976,9 @@ var tablib = { // eslint-disable-line
var newEntry = {url: aHref}; // we don't know the page title at this moment
tabState.entries.splice(activeIndex + 1, entriesToRemove, newEntry);
tabState.index++;
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
}
// we need to update history title after the new page loaded for use in back/forword button
function updateNewHistoryTitle() {
@@ -987,7 +992,9 @@ var tablib = { // eslint-disable-line
let history = browser.webNavigation.sessionHistory;
Tabmix.Utils.updateHistoryTitle(history, this.label);
}
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
}
function urlForDownload() {
/* jshint validthis: true */
@@ -996,7 +1003,9 @@ var tablib = { // eslint-disable-line
let browser = this.linkedBrowser;
browser.tabmix_allowLoad = true;
browser.loadURI(aHref);
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
}
try {
tabState = aTabData ? aTabData.state : TabmixSvc.JSON.parse(TabmixSvc.ss.getTabState(aTab));
@@ -1012,7 +1021,9 @@ var tablib = { // eslint-disable-line
}
tabState.pinned = false;
TabmixSvc.ss.setTabState(newTab, TabmixSvc.JSON.stringify(tabState));
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
return newTab;
};
@@ -1024,11 +1035,9 @@ var tablib = { // eslint-disable-line
if (Tabmix.singleWindowMode) {
if (!aMoveTab)
this.duplicateTab(aTab, null, aTabData);
- }
- else if (aMoveTab) {
+ } else if (aMoveTab) {
this.replaceTabWithWindow(aTab);
- }
- else {
+ } else {
aTab._tabmixCopyToWindow = {data: aTabData};
// replaceTabWithWindow not working if there is only one tab in the the window
window.openDialog("chrome://browser/content/browser.xul",
@@ -1048,8 +1057,7 @@ var tablib = { // eslint-disable-line
// Firefox 26-37
let doc = target.ownerDocument;
urlSecurityCheck(url, gContextMenu._unremotePrincipal(doc.nodePrincipal));
- }
- else {
+ } else {
// Firefox 17-25
let doc = target.ownerDocument;
urlSecurityCheck(url, doc.nodePrincipal);
@@ -1272,8 +1280,7 @@ var tablib = { // eslint-disable-line
aTab.removeAttribute("_lockedAppTabs"); // we only have this if we locked AppTab
aTab.removeAttribute("locked");
aTab.setAttribute("_locked", "false");
- }
- else {
+ } else {
aTab.setAttribute("locked", "true");
aTab.setAttribute("_locked", "true");
}
@@ -1500,8 +1507,7 @@ var tablib = { // eslint-disable-line
shouldPrompt = 3;
else if (numProtected > 0 && Services.prefs.getBoolPref(prefs[1]))
shouldPrompt = 2;
- }
- else if (numTabs > 1) {
+ } else if (numTabs > 1) {
if (Services.prefs.getBoolPref(prefs[0]))
shouldPrompt = 1;
// when we close window with last tab and we don't have protected tabs
@@ -1599,8 +1605,7 @@ var tablib = { // eslint-disable-line
message = bundle.getFormattedString("tabs.closeWarningMultipleTabs", [tabsToClose]);
chkBoxLabel = shouldPrompt == 1 ? bundle.getString("tabs.closeWarningPromptMe") :
TabmixSvc.getString("window.closeWarning.1");
- }
- else {
+ } else {
let messageKey = "protectedtabs.closeWarning.";
messageKey += (numProtected < tabsToClose) ? "3" : (numProtected == 1) ? "1" : "2";
message = TabmixSvc.getFormattedString(messageKey, [tabsToClose, numProtected]);
@@ -1708,8 +1713,7 @@ var tablib = { // eslint-disable-line
return;
this.numberOfTabsClosedLast++;
};
- }
- else {
+ } else {
Tabmix.startCountingClosedTabs = function() { };
Tabmix.setNumberOfTabsClosedLast = function() { };
Tabmix.countClosedTabs = function() { };
@@ -1717,13 +1721,13 @@ var tablib = { // eslint-disable-line
/** DEPRECATED **/
// we keep this function to saty compatible with other extensions that use it
- gBrowser.undoRemoveTab = function() {TMP_ClosedTabs.undoCloseTab();};
+ gBrowser.undoRemoveTab = () => TMP_ClosedTabs.undoCloseTab();
// Tabmix don't use this function anymore
// but treeStyleTab extension look for it
gBrowser.restoreTab = function() { };
- gBrowser.closeTab = function(aTab) {this.removeTab(aTab);};
+ gBrowser.closeTab = aTab => this.removeTab(aTab);
gBrowser.TMmoveTabTo = gBrowser.moveTabTo;
- gBrowser.renameTab = function(aTab) {Tabmix.renameTab.editTitle(aTab);};
+ gBrowser.renameTab = aTab => Tabmix.renameTab.editTitle(aTab);
},
// prevent 'ReferenceError: reference to undefined property params'
@@ -1786,18 +1790,21 @@ var tablib = { // eslint-disable-line
try {
TMP_ClosedTabs.setButtonDisableState();
+ } catch (ex) {
+ Tabmix.assert(ex, "ERROR in saveClosedTab");
}
- catch (ex) { Tabmix.assert(ex, "ERROR in saveClosedTab"); }
try {
TabmixSessionManager.tabScrolled(tab);
+ } catch (ex) {
+ Tabmix.assert(ex, "ERROR in TabmixSessionManager.tabScrolled");
}
- catch (ex) { Tabmix.assert(ex, "ERROR in TabmixSessionManager.tabScrolled"); }
try {
TabmixSessionManager.tabClosed(tab);
+ } catch (ex) {
+ Tabmix.assert(ex, "ERROR in TabmixSessionManager.tabClosed");
}
- catch (ex) { Tabmix.assert(ex, "ERROR in TabmixSessionManager.tabClosed"); }
},
closeLastTab: function TMP_closeLastTab() {
diff --git a/chrome/content/places/places.js b/chrome/content/places/places.js
index 62f9b9b..53a3666 100644
--- a/chrome/content/places/places.js
+++ b/chrome/content/places/places.js
@@ -408,8 +408,7 @@ var TMP_Places = {
this.setTabTitle(tab);
}, this);
this.startObserver();
- }
- else {
+ } else {
let tabs = gBrowser.tabContainer.getElementsByAttribute("tabmix_bookmarkId", "*");
Array.slice(tabs).forEach(function(tab) {
if (tab.hasAttribute("pending"))
@@ -588,8 +587,7 @@ TMP_Places.contextMenu = {
open.hidden = where.lock;
if (!open.hidden)
Tabmix.setItem(open, "default", !where.inNew ? "true" : null);
- }
- else {
+ } else {
open.hidden = true;
openInTab.hidden = true;
openInWindow.hidden = false;
diff --git a/chrome/content/preferences/menu.js b/chrome/content/preferences/menu.js
index 03dce4e..b3110ad 100644
--- a/chrome/content/preferences/menu.js
+++ b/chrome/content/preferences/menu.js
@@ -19,8 +19,7 @@ var gMenuPane = { // jshint ignore:line
if (browserWindow.TMP_TabView.installed) {
let label = browserWindow.document.getElementById("context_tabViewMenu").getAttribute("label");
$("moveToGroup").label = label;
- }
- else {
+ } else {
gPrefWindow.removeChild("pref_showMoveToGroup");
gPrefWindow.removeChild("moveToGroup");
}
diff --git a/chrome/content/preferences/overlay/overlaySanitizeUI.js b/chrome/content/preferences/overlay/overlaySanitizeUI.js
index 9ae6ba3..c2b8685 100644
--- a/chrome/content/preferences/overlay/overlaySanitizeUI.js
+++ b/chrome/content/preferences/overlay/overlaySanitizeUI.js
@@ -24,7 +24,9 @@ Tabmix.setSanitizer = {
let win = Tabmix.getTopWin();
win.Tabmix.Sanitizer.sanitize();
} catch (ex) {
- try {Tabmix.reportError(ex);} catch (e) { }
+ try {
+ Tabmix.reportError(ex);
+ } catch (e) { }
}
},
get canClear() {
@@ -72,8 +74,7 @@ Tabmix.setSanitizer = {
check.setAttribute("type", "checkbox");
check.setAttribute("noduration", "true");
itemList.setAttribute("rows", parseInt(itemList.getAttribute("rows")) + 1);
- }
- else if (container.childNodes.length > 1) {
+ } else if (container.childNodes.length > 1) {
// don't add our checkbox to a row that already have 2 items
let row = document.createElement("row");
container.parentNode.appendChild(row);
diff --git a/chrome/content/preferences/overlay/preferencesOverlay.js b/chrome/content/preferences/overlay/preferencesOverlay.js
index 6756363..5711e14 100644
--- a/chrome/content/preferences/overlay/preferencesOverlay.js
+++ b/chrome/content/preferences/overlay/preferencesOverlay.js
@@ -3,7 +3,9 @@
Components.utils.import("resource://tabmixplus/Services.jsm");
var gTabMix_preferencesOverlay = { // jshint ignore:line
- id: function(id) {return document.getElementById(id);},
+ id: function(id) {
+ return document.getElementById(id);
+ },
incontentInit: function gTabMix_preferencesOverlay_incontentInit() {
var box = this.id("linkTargeting");
diff --git a/chrome/content/preferences/session.js b/chrome/content/preferences/session.js
index da2066e..76c57b3 100644
--- a/chrome/content/preferences/session.js
+++ b/chrome/content/preferences/session.js
@@ -78,8 +78,7 @@ var gSessionPane = {
if (useSessionManager) {
sessionstorePrefs();
sessionPrefs();
- }
- else {
+ } else {
sessionPrefs();
sessionstorePrefs();
}
@@ -119,8 +118,7 @@ var gSessionPane = {
$("sessionmanager_button").setAttribute("image", "chrome://sessionmanager/skin/icon.png");
if (onStart)
$("chooseFile").selectedIndex = 1;
- }
- else {
+ } else {
this.isSessionStoreEnabled(onStart);
TabmixSessionManager.createMenuForDialog($("onStart.popup"));
$("onStart.loadsession").value = $("pref_onStart.loadsession").value;
diff --git a/chrome/content/preferences/subdialogs/pref-filetype.js b/chrome/content/preferences/subdialogs/pref-filetype.js
index 418bc23..31ea563 100644
--- a/chrome/content/preferences/subdialogs/pref-filetype.js
+++ b/chrome/content/preferences/subdialogs/pref-filetype.js
@@ -23,8 +23,7 @@ function FillData() {
var data, items, item;
try {
data = Services.prefs.getCharPref(list.getAttribute('prefstring'));
- }
- catch (e) {}
+ } catch (e) {}
if (!data.length) {
setButtonDisable(del, true);
@@ -50,8 +49,9 @@ function Save() {
try {
Services.prefs.setCharPref(list.getAttribute('prefstring'), filetype.join(" "));
+ } catch (ex) {
+ Tabmix.assert(ex, "error in filetype: " + filetype);
}
- catch (ex) {Tabmix.assert(ex, "error in filetype: " + filetype);}
return true;
}
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 13d8f46..6b7a5ac 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -92,8 +92,7 @@ var TabmixTabbar = {
if (prevTabscroll == this.SCROLL_BUTTONS_MULTIROW) {
tabBar.mTabstrip.resetFirstTabInRow();
Tabmix.tabsUtils.updateVerticalTabStrip(true);
- }
- else if (isMultiRow && overflow) {
+ } else if (isMultiRow && overflow) {
// if we are in overflow in one line we will have more then one line
// in multi-row. we try to prevent extra over/underflow events by setting
// the height in front.
@@ -115,7 +114,7 @@ var TabmixTabbar = {
// Don't change tabstip orient on start before sessionStore ends.
// if we set orient to vertical before sessionStore finish
// sessionStore don't select the selected tab from last session.
- setTimeout(function() {Tabmix.tabsUtils.setTabStripOrient();}, 0);
+ setTimeout(() => Tabmix.tabsUtils.setTabStripOrient(), 0);
}
else
Tabmix.tabsUtils.setTabStripOrient();
@@ -183,9 +182,8 @@ var TabmixTabbar = {
if (tabBar.mTabstrip.orient == "vertical") {
this.setFirstTabInRow();
Tabmix.tabsUtils.updateVerticalTabStrip();
- }
- // with Australis overflow not always trigger when tab changed width
- else if (TabmixSvc.australis && !this.widthFitTitle) {
+ } else if (TabmixSvc.australis && !this.widthFitTitle) {
+ // with Australis overflow not always trigger when tab changed width
tabBar.mTabstrip._enterVerticalMode();
this.setFirstTabInRow();
}
@@ -351,7 +349,7 @@ var TabmixTabbar = {
Tabmix.tabsUtils.updateVerticalTabStrip();
if (this.position == 1)
- setTimeout(function() {Tabmix.tabsUtils.updateVerticalTabStrip();}, 0);
+ setTimeout(() => Tabmix.tabsUtils.updateVerticalTabStrip(), 0);
this.updateBeforeAndAfter();
}
@@ -458,8 +456,7 @@ var TabmixTabbar = {
return lastTab.boxObject.height;
else
return firstTab.boxObject.height;
- }
- else if (lastTabRow == 2) { // multi-row
+ } else if (lastTabRow == 2) { // multi-row
let newRowHeight;
if (lastTab.getAttribute("selected") == "true") {
// check if previous to last tab in the 1st row
@@ -469,8 +466,7 @@ var TabmixTabbar = {
return lastTab.boxObject.height;
else
newRowHeight = prev.baseY - firstTab.baseY;
- }
- else if (firstTab.getAttribute("selected") == "true") {
+ } else if (firstTab.getAttribute("selected") == "true") {
// check if 2nd visible tab is in the 2nd row
// (not likely that user set tab width to more then half screen width)
var next = Tabmix.visibleTabs.next(firstTab);
@@ -592,7 +588,9 @@ Tabmix.tabsUtils = {
XPCOMUtils.defineLazyGetter(Tabmix, "rtl", function() {
return window.getComputedStyle(tabbrowser, null).direction == "rtl";
});
- XPCOMUtils.defineLazyGetter(Tabmix, "ltr", function() {return !Tabmix.rtl;});
+ XPCOMUtils.defineLazyGetter(Tabmix, "ltr", function() {
+ return !Tabmix.rtl;
+ });
// don't set button to left side if it is not inside tab-content
let button = document.getAnonymousElementByAttribute(tab, "anonid", "tmp-close-button") ||
@@ -854,14 +852,13 @@ Tabmix.tabsUtils = {
else
this.disAllowNewtabbutton = true;
return;
- }
- // button is NOT visible
- // A: 2 last tabs are in the same row:
- // check if we have room for the button in this row
- // B: 2 last tabs are NOT in the same row:
- // check if we have room for the last tab + button after
- // previous to last tab.
- else {
+ } else {
+ // button is NOT visible
+ // A: 2 last tabs are in the same row:
+ // check if we have room for the button in this row
+ // B: 2 last tabs are NOT in the same row:
+ // check if we have room for the last tab + button after
+ // previous to last tab.
// ignor the case that this tab width is larger then the tabbar
let previousTab = Tabmix.visibleTabs.previous(lastTab);
if (!previousTab) {
@@ -889,8 +886,7 @@ Tabmix.tabsUtils = {
newTabButtonWidth();
this.disAllowNewtabbutton = buttonEnd > tsboEnd;
return;
- }
- else {
+ } else {
let lastTabEnd = previousTab.boxObject.screenX +
previousTab.boxObject.width + lastTab.boxObject.width;
// both last tab and new tab button are in the next row
@@ -940,8 +936,7 @@ Tabmix.tabsUtils = {
tabBar._positionPinnedTabs();
if (Tabmix.isVersion(190))
tabBar._handleTabSelect(false);
- }
- else {
+ } else {
if (tabBar._lastTabClosedByMouse)
tabBar._expandSpacerBy(tabstrip._scrollButtonDown.clientWidth);
gBrowser._removingTabs.forEach(gBrowser.removeTab, gBrowser);
@@ -1132,8 +1127,7 @@ var gTMPprefObserver = {
// add Observer
for (var i = 0; i < this.OBSERVING.length; ++i)
Services.prefs.addObserver(this.OBSERVING[i], this, false);
- }
- catch (e) {
+ } catch (e) {
Tabmix.log("prefs-Observer failed to attach:" + "\n" + e);
Tabmix.prefs.setBoolPref("PrefObserver.error", true);
}
@@ -1206,8 +1200,7 @@ var gTMPprefObserver = {
// regardless if they were lock and unlocked before by the user
if (updatePinned ? lockAppTabs : TabmixTabbar.lockallTabs) {
tab.setAttribute("locked", "true");
- }
- else {
+ } else {
tab.removeAttribute("locked");
}
if (updatePinned) {
@@ -1628,8 +1621,7 @@ var gTMPprefObserver = {
newRule = iconRule.replace(/%favhideclose%/g, '[favhideclose="true"]')
.replace(/%faviconized%/g, ':not([faviconized="true"])');
tabmix_setRule(newRule);
- }
- else {
+ } else {
let newRule = iconRule.replace(/%favhideclose%/g, '').replace(/%faviconized%/g, '');
tabmix_setRule(newRule);
}
@@ -1681,8 +1673,7 @@ var gTMPprefObserver = {
this.insertRule(newRule);
newRule = '.tabbrowser-tab[faviconized="true"][protected]:not([pinned]) {max-width: 36px !important;}';
this.insertRule(newRule);
- }
- else {
+ } else {
let newRule = iconRule.replace(/%favhideclose%/g, '')
.replace(/%faviconized%/g, '').replace(/%faviconized1%/g, '');
this.insertRule(newRule);
@@ -1749,9 +1740,9 @@ var gTMPprefObserver = {
else
region = TabmixSvc.australis ? "rect(0px, 360px, 18px, 342px)" :
"rect(0pt, 180px, 18px, 162px)";
- }
- else
+ } else {
[url, region] = ["newtab.png", "auto"];
+ }
this.insertRule(newRule.replace("#URL", url).replace("#REGION", region));
if (!TabmixSvc.australis)
@@ -1767,8 +1758,7 @@ var gTMPprefObserver = {
if (bgMiddleMargin) {
bgMiddleMargin.style.MozMarginStart = margin;
bgMiddleMargin.style.MozMarginEnd = margin;
- }
- else {
+ } 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");
@@ -1885,8 +1875,9 @@ var gTMPprefObserver = {
try {
var prefValue = Services.prefs.getIntPref(pref);
test = test ? prefValue == testVal : prefValue != testVal;
+ } catch (e) {
+ test = true;
}
- catch (e) { test = true; }
if (test)
Services.prefs.setIntPref(pref, newVal);
@@ -1939,8 +1930,7 @@ var gTMPprefObserver = {
if (hideIcons) {
for (let i = 0; i < items.length; ++i)
items[i].removeAttribute("class");
- }
- else {
+ } else {
for (let i = 0; i < items.length; ++i)
items[i].setAttribute("class", items[i].getAttribute("tmp_iconic"));
}
@@ -2038,8 +2028,7 @@ var gTMPprefObserver = {
tabsToolbar.setAttribute("currentset", cSet.join(","));
document.persist("TabsToolbar", "currentset");
}
- }
- else {
+ } else {
this.setShowNewTabButtonAttr(false);
Tabmix.sideNewTabButton = null;
}
@@ -2128,8 +2117,7 @@ var gTMPprefObserver = {
gNavToolbox.tabmix_tabsontop = true;
TabsOnTop.enabled = false;
}
- }
- else if (gNavToolbox.tabmix_tabsontop) {
+ } else if (gNavToolbox.tabmix_tabsontop) {
TabsOnTop.enabled = true;
gNavToolbox.tabmix_tabsontop = false;
}
@@ -2280,11 +2268,10 @@ var gTMPprefObserver = {
if (Tabmix.prefs.prefHasUserValue("tabXMode")) {
let val = getPrefByType("extensions.tabmix.tabXMode", 1, "IntPref");
Tabmix.prefs.setIntPref("tabs.closeButtons", val);
- }
- // partly fix a bug from version 0.3.8.3
- else if (Services.prefs.prefHasUserValue("browser.tabs.closeButtons") &&
- !Tabmix.prefs.prefHasUserValue("version") &&
- !Tabmix.prefs.prefHasUserValue("tabs.closeButtons")) {
+ } else if (Services.prefs.prefHasUserValue("browser.tabs.closeButtons") &&
+ !Tabmix.prefs.prefHasUserValue("version") &&
+ !Tabmix.prefs.prefHasUserValue("tabs.closeButtons")) {
+ // partly fix a bug from version 0.3.8.3
let value = getPrefByType("browser.tabs.closeButtons", 1, "IntPref");
// these value are from 0.3.8.3. we don't know if 0,1 are also from 0.3.8.3 so we don't use 0,1.
if (value > 1 && value <= 6) {
@@ -2382,7 +2369,9 @@ var gTMPprefObserver = {
Services.prefs.setIntPref("browser.tabs.tabMaxWidth", val);
Tabmix.prefs.clearUserPref("tabMaxWidth");
}
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
// 2013-01-21 - lock hideIcons to true in mac
if (Services.appinfo.OS == "Darwin" && !Tabmix.prefs.prefIsLocked("hideIcons")) {
Tabmix.defaultPrefs.setBoolPref("hideIcons", true);
@@ -2496,7 +2485,9 @@ var gTMPprefObserver = {
try {
let shouldAutoUpdate = AddonManager.shouldAutoUpdate(aAddon);
getVersion(aAddon.version, shouldAutoUpdate);
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
});
// block item in tabclicking options that are not in use
@@ -2600,8 +2591,7 @@ var TabmixProgressListener = {
tab.removeAttribute("busy");
tab.removeAttribute("progress");
this.mTabBrowser.setTabTitle(tab);
- }
- else if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING)) {
+ } else if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING)) {
if (tab.hasAttribute("tabmix_pending"))
tab.removeAttribute("tabmix_pending");
Tabmix.setTabStyle(tab);
@@ -2615,8 +2605,7 @@ var TabmixProgressListener = {
if (tab.hasAttribute("tabmix_bookmarkId"))
TMP_Places.setTabTitle(tab, url);
}
- }
- else if (aStateFlags & nsIWebProgressListener.STATE_STOP &&
+ } else if (aStateFlags & nsIWebProgressListener.STATE_STOP &&
aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
let uri = aRequest.QueryInterface(Ci.nsIChannel).URI.spec;
// remove blank tab that created by downloading a file.
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index b419aa6..9019266 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -77,8 +77,7 @@ Tabmix.sessionInitialized = function() {
if (this.isVersion(200)) {
this.setItem("Browser:RestoreLastSession", "disabled",
!SM.canRestoreLastSession || SM.isPrivateWindow);
- }
- else {
+ } else {
this.changeCode(HistoryMenu.prototype, "HistoryMenu.prototype.toggleRestoreLastSession")._replace(
'this._ss', 'TabmixSessionManager'
).toCode();
@@ -211,7 +210,7 @@ Tabmix.delayedStartup = function TMP_delayedStartup() {
TMP_extensionsCompatibility.onDelayedStartup();
if (this.isVersion(280))
- setTimeout(function() {Tabmix.getAfterTabsButtonsWidth();}, 100);
+ setTimeout(() => Tabmix.getAfterTabsButtonsWidth(), 100);
gTMPprefObserver.setMenuIcons();
@@ -232,7 +231,9 @@ Tabmix.delayedStartup = function TMP_delayedStartup() {
try {
TMP_LastTab.init();
- } catch (ex) {this.assert(ex);}
+ } catch (ex) {
+ this.assert(ex);
+ }
// starting with Fireofox 17.0+ we calculate TMP_tabDNDObserver.paddingLeft
// in gBrowser.tabContainer._positionPinnedTabs
@@ -363,7 +364,9 @@ var TMP_eventListener = {
Tabmix.lazy_import(Tabmix, "docShellCapabilities",
"DocShellCapabilities", "DocShellCapabilities");
Tabmix.lazy_import(Tabmix, "Utils", "Utils", "TabmixUtils");
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
this._tabEvents = ["SSTabRestoring", "PrivateTab:PrivateChanged",
"TabOpen", "TabClose", "TabSelect", "TabMove", "TabUnpinned",
@@ -372,11 +375,15 @@ var TMP_eventListener = {
try {
TMP_extensionsCompatibility.onContentLoaded();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
try {
Tabmix.onContentLoaded.changeCode();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
Tabmix.contentAreaClick.init();
@@ -396,7 +403,9 @@ var TMP_eventListener = {
try {
if (TMP_TabView.installed)
TMP_TabView._patchBrowserTabview();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
},
onWindowOpen: function TMP_EL_onWindowOpen() {
@@ -414,29 +423,43 @@ var TMP_eventListener = {
try {
TabmixProgressListener.startup(gBrowser);
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
gBrowser.mPanelContainer.addEventListener("click", Tabmix.contentAreaClick._contentLinkClick, true);
// init tabmix functions
try {
TMP_extensionsCompatibility.onWindowOpen();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
try {
tablib.init();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
try {
TMP_Places.init();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
try {
Tabmix.startup();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
try {
Tabmix.linkHandling_init();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
try {
TMP_tabDNDObserver.init();
- } catch (ex) {Tabmix.assert(ex);}
+ } catch (ex) {
+ Tabmix.assert(ex);
+ }
if (TabmixSvc.isMac) {
tabBar.setAttribute("Mac", "true");
@@ -466,14 +489,12 @@ var TMP_eventListener = {
///XXX test if this is still the case
TMP_tabDNDObserver.LinuxMarginEnd = -2;
Tabmix.setItem(tabsToolbar, "tabmix_skin", "classic");
- }
- else {
+ } else {
let version = navigator.oscpu.startsWith("Windows NT 6.1") ? "v40aero" : "v40";
tabBar.setAttribute("classic40", version);
Tabmix.setItem(tabsToolbar, "classic40", version);
}
- }
- else {
+ } else {
/**
* some theme like Vista-aero 3.0.0.91 and BlueSky 3.0.0.91
* use TMP_TBP_Startup in stylesheet window[onload="TMP_TBP_Startup()"]
@@ -603,7 +624,7 @@ var TMP_eventListener = {
this.tabWidthCache.set(tab, width);
TabmixTabbar.updateScrollStatus();
- setTimeout(function() {TabmixTabbar.updateScrollStatus();}, 2500);
+ setTimeout(() => TabmixTabbar.updateScrollStatus(), 2500);
},
onSSTabRestoring: function TMP_EL_onSSTabRestoring(aEvent) {
@@ -655,8 +676,7 @@ var TMP_eventListener = {
if (!document.mozFullScreen) {
fullScrToggler.hidden = false;
}
- }
- else if (fullScrToggler && !enterFS) {
+ } else if (fullScrToggler && !enterFS) {
this._updateMarginBottom("");
fullScrToggler.hidden = true;
}
@@ -698,8 +718,7 @@ var TMP_eventListener = {
if (aShow) {
bottomToolbox.style.marginBottom = "";
gTMPprefObserver.updateTabbarBottomPosition();
- }
- else {
+ } else {
let bottombox = document.getElementById("browser-bottombox");
bottomToolbox.style.marginBottom =
-(bottomToolbox.getBoundingClientRect().height +
@@ -758,8 +777,7 @@ var TMP_eventListener = {
if (Tabmix.tabsUtils.overflow || newTime - this.lastTimeTabOpened > 200) {
this.onTabOpen_updateTabBar(aTab);
this.lastTimeTabOpened = newTime;
- }
- else if (!this._onOpenTimeout) {
+ } else if (!this._onOpenTimeout) {
let self = this;
let timeout = Tabmix.tabsUtils.disAllowNewtabbutton &&
Services.prefs.getBoolPref("browser.tabs.animate") ? 0 : 200;
@@ -868,7 +886,7 @@ var TMP_eventListener = {
Tabmix.tabsUtils.adjustNewtabButtonvisibility();
if (TabmixTabbar.isMultiRow && tabBar.hasAttribute("multibar")) {
_updateTabstrip();
- setTimeout(function() {_updateTabstrip();}, 0);
+ setTimeout(() => _updateTabstrip(), 0);
}
},
@@ -975,8 +993,7 @@ var TMP_eventListener = {
tabBar.advanceSelectedTab(direction, true);
aEvent.stopPropagation();
aEvent.preventDefault();
- }
- else if (direction !== 0 && !Tabmix.extensions.treeStyleTab) {
+ } else if (direction !== 0 && !Tabmix.extensions.treeStyleTab) {
// this code is based on scrollbox.xml DOMMouseScroll event handler
let tabsSrip = tabBar.mTabstrip;
let orient = tabsSrip.orient;
@@ -989,8 +1006,7 @@ var TMP_eventListener = {
if (aEvent.axis == aEvent.HORIZONTAL_AXIS)
return;
tabsSrip.scrollByIndex(direction);
- }
- else {
+ } else {
let isVertical = aEvent.axis == aEvent.VERTICAL_AXIS;
if (tabsSrip._prevMouseScrolls.every(prev => prev == isVertical)) {
tabsSrip.scrollByIndex(isVertical && tabsSrip._isRTLScrollbox ? -direction : direction);
@@ -1019,7 +1035,7 @@ var TMP_eventListener = {
if (aID != "tabmixopt")
win.close();
else
- win.setTimeout(function() {win.close();}, 0);
+ win.setTimeout(() => win.close(), 0);
}
});
}
@@ -1140,7 +1156,7 @@ Tabmix.initialization = {
let result, currentPhase = this[aPhase].id;
let getObj = function(list) {
let obj = window;
- list.split(".").forEach(function(prop) {obj = obj[prop];});
+ list.split(".").forEach(prop => obj = obj[prop]);
return obj;
};
for (let key of Object.keys(this)) {
diff --git a/chrome/content/utils.js b/chrome/content/utils.js
index 0f99227..3a288df 100644
--- a/chrome/content/utils.js
+++ b/chrome/content/utils.js
@@ -153,9 +153,10 @@ var Tabmix = { // jshint ignore:line
dpb.SetString(i, strParam[i]);
if (typeof (aWindow) == "undefined") {
- try { aWindow = window;
- }
- catch (e) { aWindow = null;
+ try {
+ aWindow = window;
+ } catch (e) {
+ aWindow = null;
}
}
@@ -202,7 +203,10 @@ var Tabmix = { // jshint ignore:line
return window;
},
- compare: function TMP_utils_compare(a, b, lessThan) {return lessThan ? a < b : a > b;},
+ compare: function TMP_utils_compare(a, b, lessThan) {
+ return lessThan ? a < b : a > b;
+ },
+
itemEnd: function TMP_utils_itemEnd(item, end) {
return item.boxObject.screenX + (end ? item.getBoundingClientRect().width : 0);
},
diff --git a/modules/AutoReload.jsm b/modules/AutoReload.jsm
index 985ae19..224e265 100644
--- a/modules/AutoReload.jsm
+++ b/modules/AutoReload.jsm
@@ -237,8 +237,7 @@ this.AutoReload = {
aBrowser.messageManager
.sendAsyncMessage("Tabmix:setScrollPosition",
aBrowser.__tabmixScrollPosition);
- }
- else {
+ } else {
let {x, y} = aBrowser.__tabmixScrollPosition;
aBrowser.contentWindow.scrollTo(x, y);
}
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 9e3f13e..1b1545b 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -597,7 +597,9 @@ var ContentClickInternal = {
blocked = host == "developer.mozilla.org" && linkNode.host != host &&
linkNode.classList.contains("external");
}
- } catch (ex) {blocked = false;}
+ } catch (ex) {
+ blocked = false;
+ }
if (!blocked)
return "16";
@@ -754,8 +756,7 @@ var ContentClickInternal = {
// add \ before first ?
testString = filetype[l].substring(1, filetype[l].length - 1).replace(/^\?/, "\\?");
hrefExt = linkHref;
- }
- else {
+ } else {
testString = "\\." + filetype[l];
hrefExt = linkHrefExt;
try {
@@ -1044,8 +1045,7 @@ var ContentClickInternal = {
if (browser.getAttribute("remote") == "true") {
browser.messageManager
.sendAsyncMessage("Tabmix:isFrameInContent", this.frameData);
- }
- else {
+ } else {
let result = LinkNodeUtils.isFrameInContent(browser.contentWindow,
this.frameData.href, this.frameData.name);
this.result(browser, {result: result});
diff --git a/modules/ContextMenu.jsm b/modules/ContextMenu.jsm
index 75fcc24..9633509 100644
--- a/modules/ContextMenu.jsm
+++ b/modules/ContextMenu.jsm
@@ -24,8 +24,7 @@ this.ContextMenu = {
acceptNode: function(n) {
if (n.nodeName == 'A' || n.nodeName == 'li') {
return Ci.nsIDOMNodeFilter.FILTER_ACCEPT;
- }
- else {
+ } else {
return Ci.nsIDOMNodeFilter.FILTER_SKIP;
}
}
diff --git a/modules/Decode.jsm b/modules/Decode.jsm
index 64fd381..4bb0436 100644
--- a/modules/Decode.jsm
+++ b/modules/Decode.jsm
@@ -35,8 +35,7 @@ function getReturnValue(input) {
if (input.length - 1) {
let code = parseInt(input.substring(input.length - 3 ? 2 : 1), 16);
ret = fixedFromCharCode(code);
- }
- else {
+ } else {
let code = input.charCodeAt(0);
ret = code < 256 ?
"%" + ("0" + code.toString(16)).slice(-2).toUpperCase() :
@@ -58,8 +57,7 @@ function fixedFromCharCode(codePt) {
if (codePt > 0xFFFF) {
codePt -= 0x10000;
return String.fromCharCode(0xD800 + (codePt >> 10), 0xDC00 + (codePt & 0x3FF));
- }
- else {
+ } else {
return String.fromCharCode(codePt);
}
}
diff --git a/modules/DynamicRules.jsm b/modules/DynamicRules.jsm
index 8ea1dde..670ba6e 100644
--- a/modules/DynamicRules.jsm
+++ b/modules/DynamicRules.jsm
@@ -364,8 +364,7 @@ this.DynamicRules = {
currentPrefValues = TabmixSvc.JSON.parse(prefString);
if (currentPrefValues === null)
throw Error(ruleName + " value is invalid\n" + prefString);
- }
- catch (ex) {
+ } catch (ex) {
TabmixSvc.console.log(ex);
TabmixSvc.console.log('Error in preference "' + ruleName + '", value was reset to default');
Prefs.clearUserPref(ruleName);
@@ -381,8 +380,7 @@ this.DynamicRules = {
let opacity = item.replace("Color", "Opacity");
let opacityValue = opacity in currentPrefValues ? currentPrefValues[opacity] : null;
value = getRGBcolor(value, opacityValue);
- }
- else if (value !== undefined && typeof value != "boolean") {
+ } else if (value !== undefined && typeof value != "boolean") {
if (/^true$|^false$/.test(value.replace(/[\s]/g, "")))
value = value == "true";
else
@@ -416,8 +414,7 @@ function getRGBcolor(aColorCode, aOpacity) {
if (isNaN(newRGB[i].replace(/[\s]/g, "") * 1))
return null;
}
- }
- else if (/^#/.test(aColorCode) && _length == 4 || _length == 7) {
+ } else if (/^#/.test(aColorCode) && _length == 4 || _length == 7) {
aColorCode = aColorCode.replace("#", "");
let subLength = _length == 7 ? 2 : 1;
for (let i = 0; i < 3; i++) {
diff --git a/modules/MergeWindows.jsm b/modules/MergeWindows.jsm
index d512d14..2af5397 100644
--- a/modules/MergeWindows.jsm
+++ b/modules/MergeWindows.jsm
@@ -43,12 +43,10 @@ this.MergeWindows = {
else if (!normalWindowsCount && this.isPopupWindow(aWindow)) {
windows.unshift(aWindow);
this.mergePopUpsToNewWindow(windows, options.private);
- }
- else if (options.multiple) {
+ } else if (options.multiple) {
options.normalWindowsCount = normalWindowsCount;
this.mergeMultipleWindows(aWindow, windows, options);
- }
- else {
+ } else {
let tabsToMove = Array.slice(options.tabsSelected ? selectedTabs : tabbrowser.tabs);
this.mergeTwoWindows(windows[0], aWindow, tabsToMove, options);
}
@@ -183,8 +181,7 @@ this.MergeWindows = {
openerWindow = browser.contentWindow.opener;
}
this.moveTabsFromPopups(newTab, tab, openerWindow, tabbrowser);
- }
- else {
+ } else {
// we don't keep tab attributs: visited, tabmix_selectedID
// see in Tabmix.copyTabData list of attributs we copy to the new tab
tabbrowser.swapBrowsersAndCloseOther(newTab, tab);
diff --git a/modules/Places.jsm b/modules/Places.jsm
index 28f301d..35ef528 100644
--- a/modules/Places.jsm
+++ b/modules/Places.jsm
@@ -129,8 +129,7 @@ var PlacesUtilsInternal = {
updateOpenTabset();
}
}.bind(this), 50, Ci.nsITimer.TYPE_REPEATING_SLACK);
- }
- else { // TreeStyleTab not installed
+ } else { // TreeStyleTab not installed
updateOpenTabset();
Tabmix.changeCode(PlacesUIUtils, "PlacesUIUtils.openURINodesInTabs")._replace(
diff --git a/modules/Services.jsm b/modules/Services.jsm
index 8a4b35f..d5ab27a 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -75,8 +75,7 @@ this.TabmixSvc = {
if (property.startsWith("sm.")) {
label = this.getSMString(property + ".label");
key = this.getSMString(property + ".accesskey");
- }
- else {
+ } else {
label = this.getString(property + ".label");
key = this.getString(property + ".accesskey");
}
@@ -161,7 +160,9 @@ this.TabmixSvc = {
// replace old Settings.
// we must call this before any other tabmix function
aWindow.gTMPprefObserver.updateSettings();
- } catch (ex) {TabmixSvc.console.assert(ex);}
+ } catch (ex) {
+ TabmixSvc.console.assert(ex);
+ }
this.addMissingPrefs();
@@ -211,7 +212,9 @@ this.TabmixSvc = {
case "browser-delayed-startup-finished":
try {
aSubject.Tabmix.initialization.run("delayedStartup");
- } catch (ex) {TabmixSvc.console.assert(ex);}
+ } catch (ex) {
+ TabmixSvc.console.assert(ex);
+ }
break;
}
}
diff --git a/modules/Shortcuts.jsm b/modules/Shortcuts.jsm
index 376c210..1421fb2 100644
--- a/modules/Shortcuts.jsm
+++ b/modules/Shortcuts.jsm
@@ -41,7 +41,9 @@ this.Shortcuts = {
undoClose: {default: "VK_F12 accel"},
undoCloseTab: {id: "key_undoCloseTab", default: "T accel,shift"},
clearClosedTabs: {
- command: function() {this.TMP_ClosedTabs.restoreTab('original', -1);}
+ command: function() {
+ this.TMP_ClosedTabs.restoreTab('original', -1);
+ }
},
ucatab: {command: 13},
saveWindow: {id: "key_tm-sm-saveone", default: "VK_F1 accel", sessionKey: true},
@@ -153,7 +155,9 @@ this.Shortcuts = {
}
this.updatingShortcuts = false;
- } catch (ex) {TabmixSvc.console.assert(ex);}
+ } catch (ex) {
+ TabmixSvc.console.assert(ex);
+ }
},
/* ........ Window Event Handlers .............. */
@@ -178,7 +182,9 @@ this.Shortcuts = {
} else {
win.TabmixTabClickOptions.doCommand(command, win.gBrowser.selectedTab);
}
- } catch (ex) {TabmixSvc.console.assert(ex);}
+ } catch (ex) {
+ TabmixSvc.console.assert(ex);
+ }
},
onUnload: function TMP_SC_onUnload(aWindow) {
@@ -240,8 +246,7 @@ this.Shortcuts = {
aWindow.Tabmix.removedShortcuts.appendChild(keyItem);
else if (keyItem.parentNode != keyset)
keyset.appendChild(keyItem);
- }
- else {
+ } else {
// don't add disabled key
if (!keyset || disabled)
return;
@@ -319,12 +324,10 @@ this.Shortcuts = {
(val == "d&" && (!keyData.default || /^d&/.test(keyData.default)))) {
delete shortcuts[key];
updatePreference = true;
- }
- else if (keyData.default && (val == "d&" + keyData.default)) {
+ } else if (keyData.default && (val == "d&" + keyData.default)) {
shortcuts[key] = "d&";
updatePreference = true;
- }
- else if (val != "d&" && !this.prefBackup) {
+ } else if (val != "d&" && !this.prefBackup) {
// make sure user didn't changed the preference in prefs.js
let newValue = this._userChangedKeyPref(val) || keyData.value;
if (newValue != val) {
@@ -390,10 +393,9 @@ this.Shortcuts = {
if ((key.keycode && key.keycode == "VK_SCROLL_LOCK" || key.keycode == "VK_CONTEXT_MENU") ||
(!key.key && !key.keycode)) {
key = null;
- }
- // block ALT + TAB
- else if (key.modifiers && /alt/.test(key.modifiers) && key.keycode &&
+ } else if (key.modifiers && /alt/.test(key.modifiers) && key.keycode &&
(key.keycode == "VK_BACK_QUOTE" || key.keycode == "VK_TAB")) {
+ // block ALT + TAB
key = null;
}
diff --git a/modules/SingleWindowModeUtils.jsm b/modules/SingleWindowModeUtils.jsm
index bf30c2f..3ea4632 100644
--- a/modules/SingleWindowModeUtils.jsm
+++ b/modules/SingleWindowModeUtils.jsm
@@ -120,13 +120,11 @@ this.SingleWindowModeUtils = {
let urisstring = uriToLoad.GetElementAt(i).QueryInterface(Ci.nsISupportsString);
urls.push(urisstring.data);
}
- }
- else if (uriToLoad instanceof newWindow.XULElement || uriToLoad instanceof Ci.nsIDOMXULElement) {
+ } else if (uriToLoad instanceof newWindow.XULElement || uriToLoad instanceof Ci.nsIDOMXULElement) {
// some extension try to swap a tab to new window
// we don't do anything in this case.
// just close the new window
- }
- else if (args.length >= 3) {
+ } else if (args.length >= 3) {
params.referrerURI = args[2];
if (TabmixSvc.version(390)) {
if (typeof (params.referrerURI) == "string") {
@@ -182,7 +180,9 @@ this.SingleWindowModeUtils = {
obs.addObserver(newWindow.gPluginHandler[pluginCrashed], "plugin-crashed", false);
}
newWindow.gPrivateBrowsingUI.uninit = function() {};
- } catch (ex) {existingWindow.Tabmix.obj(ex);}
+ } catch (ex) {
+ existingWindow.Tabmix.obj(ex);
+ }
existingWindow.setTimeout(function() {
try {
// restore window dimensions, to prevent flickring in the next restart
@@ -198,7 +198,9 @@ this.SingleWindowModeUtils = {
}
// for the case the window is minimized or not in focus
existingWindow.focus();
- } catch (ex) {existingWindow.Tabmix.obj(ex);}
+ } catch (ex) {
+ existingWindow.Tabmix.obj(ex);
+ }
}, 0);
}
};
diff --git a/modules/Slideshow.jsm b/modules/Slideshow.jsm
index 52d2ba3..d8b9304 100644
--- a/modules/Slideshow.jsm
+++ b/modules/Slideshow.jsm
@@ -14,7 +14,9 @@ function flst() {
this.flstOff = TabmixSvc.getString("flstOff.label");
this.slideshowOn = TabmixSvc.getString("slideshowOn.label");
this.slideshowOff = TabmixSvc.getString("slideshowOff.label");
- XPCOMUtils.defineLazyGetter(this, "tabContainer", function() {return TabmixSvc.topWin().gBrowser.tabContainer;});
+ XPCOMUtils.defineLazyGetter(this, "tabContainer", function() {
+ return TabmixSvc.topWin().gBrowser.tabContainer;
+ });
}
flst.prototype = {
@@ -23,8 +25,7 @@ flst.prototype = {
msg = msg.replace(/F8|F9/, Shortcuts.getFormattedKeyForID(id));
let alerts = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
alerts.showAlertNotification("chrome://tabmixplus/skin/tmp.png", "Tab Mix Plus", msg, false, "", null);
- }
- catch (e) { }
+ } catch (e) { }
},
// toggle flst on/off
@@ -32,8 +33,7 @@ flst.prototype = {
if (TabmixSvc.prefBranch.getIntPref("focusTab") != 4) {
TabmixSvc.prefBranch.setIntPref("focusTab", 4);
this.showAlert(this.flstOn, "toggleFLST");
- }
- else {
+ } else {
TabmixSvc.prefBranch.setIntPref("focusTab", 2);
this.showAlert(this.flstOff, "toggleFLST");
}
@@ -42,8 +42,7 @@ flst.prototype = {
toggleSlideshow: function() {
if (this.slideShowTimer) {
this.cancel();
- }
- else if (this.moreThenOneTab) {
+ } else if (this.moreThenOneTab) {
let timerInterval = TabmixSvc.prefBranch.getIntPref("slideDelay") * 1000;
this.slideShowTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
this.slideShowTimer.initWithCallback(this, timerInterval,
diff --git a/modules/extensions/AddonManager.jsm b/modules/extensions/AddonManager.jsm
index 9b463b4..b67fbc9 100644
--- a/modules/extensions/AddonManager.jsm
+++ b/modules/extensions/AddonManager.jsm
@@ -35,8 +35,7 @@ var SessionManager = {
let tmp = {};
Cu.import("chrome://sessionmanager/content/modules/session_manager.jsm", tmp);
TabmixSvc.sessionManagerAddonInstalled = true;
- }
- catch (ex) {
+ } catch (ex) {
TabmixSvc.sessionManagerAddonInstalled = false;
}
},
diff --git a/modules/extensions/CompatibilityCheck.jsm b/modules/extensions/CompatibilityCheck.jsm
index 08af627..ab92a39 100644
--- a/modules/extensions/CompatibilityCheck.jsm
+++ b/modules/extensions/CompatibilityCheck.jsm
@@ -62,7 +62,9 @@ CompatibilityCheck.prototype = {
this._version = addon.version;
}
AddOn.prototype = {
- toString: function() {return this._name.toLowerCase();}
+ toString: function() {
+ return this._name.toLowerCase();
+ }
};
var guid_list = this.getList();
@@ -157,8 +159,7 @@ CompatibilityCheck.prototype = {
var appStartup = Ci.nsIAppStartup;
Cc["@mozilla.org/toolkit/app-startup;1"]
.getService(appStartup).quit(appStartup.eRestart | appStartup.eAttemptQuit);
- }
- else {
+ } else {
let title = TabmixSvc.getString("incompatible.title");
let msg = TabmixSvc.getString("incompatible.msg2");
let button = TabmixSvc.setLabel("sm.button.continue");
diff --git a/modules/log.jsm b/modules/log.jsm
index 8b87b3d..3c902b9 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -82,7 +82,9 @@ this.console = {
else
logMethod();
- } catch (ex) {this.assert(ex, "Error we can't show " + aMethod + " in Tabmix.show");}
+ } catch (ex) {
+ this.assert(ex, "Error we can't show " + aMethod + " in Tabmix.show");
+ }
},
// get functions names from Error().stack
@@ -311,8 +313,7 @@ options = {
if (typeof ex != "object" || ex instanceof OS.File.Error ||
typeof ex.message != "string") {
this._logMessage(msg + ex.toString(), "errorFlag");
- }
- else {
+ } else {
if (typeof ex.filename == "undefined") {
ex.filename = ex.fileName;
}
--
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