[Pkg-mozext-commits] [tabmixplus] 03/22: Hinting chrome/content/preferences folder

David Prévot taffit at moszumanska.debian.org
Sun Jan 4 16:46:35 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 7682f43820d7bb1346f1a86ba58d7d30cd0d4af2
Author: onemen <tabmix.onemen at gmail.com>
Date:   Wed Dec 3 01:59:09 2014 +0200

    Hinting chrome/content/preferences folder
---
 chrome/content/preferences/appearance.js           |  6 ++---
 chrome/content/preferences/events.js               |  5 ++--
 chrome/content/preferences/links.js                |  2 +-
 chrome/content/preferences/menu.js                 |  8 +++---
 chrome/content/preferences/mouse.js                |  4 +--
 .../preferences/overlay/overlaySanitizeUI.js       | 14 ++++++-----
 .../preferences/overlay/preferencesOverlay.js      | 10 ++++----
 chrome/content/preferences/preferences.js          | 29 +++++++++++-----------
 chrome/content/preferences/session.js              | 12 ++++-----
 chrome/content/preferences/shortcuts.js            | 11 ++++----
 .../preferences/subdialogs/pref-appearance.js      |  6 ++---
 .../preferences/subdialogs/pref-filetype.js        |  4 +--
 12 files changed, 57 insertions(+), 54 deletions(-)

diff --git a/chrome/content/preferences/appearance.js b/chrome/content/preferences/appearance.js
index 21927fe..2697f53 100644
--- a/chrome/content/preferences/appearance.js
+++ b/chrome/content/preferences/appearance.js
@@ -1,6 +1,6 @@
 "use strict";
 
-var gAppearancePane = {
+var gAppearancePane = { // jshint ignore:line
   init: function () {
     var browserWindow = Tabmix.getTopWin();
     // disable options for position the tabbar and scroll mode if TreeStyleTab extension installed
@@ -130,7 +130,7 @@ var gAppearancePane = {
   // user is force to hit apply
   userchangedWidth: function(item) {
     gPrefWindow.widthChanged = $("minWidth").value != $("pref_minWidth").valueFromPreferences ||
-                        $("maxWidth").value != $("pref_maxWidth").valueFromPreferences
+                        $("maxWidth").value != $("pref_maxWidth").valueFromPreferences;
     if (!gPrefWindow.instantApply)
       return undefined;
     gPrefWindow.setButtons(!gPrefWindow.widthChanged);
@@ -159,4 +159,4 @@ var gAppearancePane = {
     window.openDialog(url, "advanceAppearanceDialog", "modal,titlebar,toolbar,centerscreen");
   }
 
-}
+};
diff --git a/chrome/content/preferences/events.js b/chrome/content/preferences/events.js
index 7469ff9..18d6d4e 100644
--- a/chrome/content/preferences/events.js
+++ b/chrome/content/preferences/events.js
@@ -1,3 +1,4 @@
+/* global gMenuPane */
 "use strict";
 
 var gEventsPane = {
@@ -85,7 +86,7 @@ var gEventsPane = {
 
   syncToNewTabUrlPref: function (value) {
     // If the value is "", use about:newtab.
-    if (value == "")
+    if (value === "")
       return "about:newtab";
 
     // Otherwise, use the actual textbox value.
@@ -104,4 +105,4 @@ var gEventsPane = {
     else
       $("paneMenu").setAttribute("editSlideShowKey", true);
   }
-}
+};
diff --git a/chrome/content/preferences/links.js b/chrome/content/preferences/links.js
index 353e232..589204f 100644
--- a/chrome/content/preferences/links.js
+++ b/chrome/content/preferences/links.js
@@ -55,4 +55,4 @@ var gLinksPane = {
     let url = "chrome://tabmixplus/content/preferences/subdialogs/pref-filetype.xul";
     window.openDialog(url, "filetypePrefsDialog", "modal,titlebar,toolbar,centerscreen");
   }
-}
+};
diff --git a/chrome/content/preferences/menu.js b/chrome/content/preferences/menu.js
index a06658e..9e66bea 100644
--- a/chrome/content/preferences/menu.js
+++ b/chrome/content/preferences/menu.js
@@ -1,6 +1,6 @@
 "use strict";
 
-var gMenuPane = {
+var gMenuPane = { // jshint ignore:line
   init: function () {
     $("pinTab").label = gPrefWindow.pinTabLabel;
     $("togglePinTab").setAttribute("label", gPrefWindow.pinTabLabel);
@@ -39,7 +39,7 @@ var gMenuPane = {
     this.setSlideShowLabel();
     let paneMenu = $("paneMenu");
     if (paneMenu.hasAttribute("editSlideShowKey")) {
-      paneMenu.removeAttribute("editSlideShowKey")
+      paneMenu.removeAttribute("editSlideShowKey");
       setTimeout(function(self) {self.editSlideShowKey();},0, this);
     }
 
@@ -57,7 +57,7 @@ var gMenuPane = {
     shortcuts.value = newValue;
     shortcuts.keys = TabmixSvc.JSON.parse(newValue);
     let callBack = function(shortcut) shortcut.id && shortcut.valueFromPreferences(Shortcuts.keys[shortcut.id]);
-    this.updateShortcuts(shortcuts, callBack)
+    this.updateShortcuts(shortcuts, callBack);
   },
 
   _slideShow: "",
@@ -112,4 +112,4 @@ var gMenuPane = {
     var label = showInverseLink.getAttribute((val ? "bg" : "fg") + "label");
     showInverseLink.setAttribute("label", label);
   }
-}
+};
diff --git a/chrome/content/preferences/mouse.js b/chrome/content/preferences/mouse.js
index d3bdc9f..075a345 100644
--- a/chrome/content/preferences/mouse.js
+++ b/chrome/content/preferences/mouse.js
@@ -86,8 +86,8 @@ var gMousePane = {
     if (pref.value && !dblClickTabbar.value)
       dblClickTabbar.value = pref.value;
     let checkbox = $("dblclick_changesize")._checkbox;
-    let image = document.getAnonymousElementByAttribute(checkbox, "class", "checkbox-check")
+    let image = document.getAnonymousElementByAttribute(checkbox, "class", "checkbox-check");
     Tabmix.setItem(image, "disabled", pref.value || null);
   }
 
-}
+};
diff --git a/chrome/content/preferences/overlay/overlaySanitizeUI.js b/chrome/content/preferences/overlay/overlaySanitizeUI.js
index 9b70910..1b31e16 100644
--- a/chrome/content/preferences/overlay/overlaySanitizeUI.js
+++ b/chrome/content/preferences/overlay/overlaySanitizeUI.js
@@ -24,14 +24,14 @@ Tabmix.setSanitizer = {
           let win = Tabmix.getTopWin();
           win.Tabmix.Sanitizer.sanitize();
         } catch (ex) {
-          try { Components.utils.reportError(ex); } catch(ex) {}
+          try { Components.utils.reportError(ex); } catch(e) {}
         }
       },
       get canClear() {
         // only sanitize when user selects to sanitize everything
         return !this.range;
       }
-    }
+    };
   },
 
   addMenuItem: function () {
@@ -84,7 +84,9 @@ Tabmix.setSanitizer = {
       if (this.isPromptDialog) {
         Tabmix.setSanitizer.disableMenuItem();
         pref.setAttribute("readonly", "true");
-        check.setAttribute("onsyncfrompreference", "Tabmix.setSanitizer.checked = this.checked; return gSanitizePromptDialog.onReadGeneric();");
+        check.setAttribute("onsyncfrompreference",
+                           "Tabmix.setSanitizer.checked = this.checked; " +
+                           "return gSanitizePromptDialog.onReadGeneric();");
       }
     }
   },
@@ -111,10 +113,10 @@ Tabmix.setSanitizer = {
     var buttonPressed = promptService.confirmEx(null,
                     title,
                     msg,
-                    (promptService.BUTTON_TITLE_YES * promptService.BUTTON_POS_0)
-                    + (promptService.BUTTON_TITLE_NO * promptService.BUTTON_POS_1),
+                    (promptService.BUTTON_TITLE_YES * promptService.BUTTON_POS_0) +
+                    (promptService.BUTTON_TITLE_NO * promptService.BUTTON_POS_1),
                     null, null, null, null, {});
     if (buttonPressed == 1)
       aCheckbox.checked = false;
   }
-}
\ No newline at end of file
+};
diff --git a/chrome/content/preferences/overlay/preferencesOverlay.js b/chrome/content/preferences/overlay/preferencesOverlay.js
index b0ae0ed..6036d49 100644
--- a/chrome/content/preferences/overlay/preferencesOverlay.js
+++ b/chrome/content/preferences/overlay/preferencesOverlay.js
@@ -2,7 +2,7 @@
 
 Components.utils.import("resource://tabmixplus/Services.jsm");
 
-var gTabMix_preferencesOverlay = {
+var gTabMix_preferencesOverlay = { // jshint ignore:line
   id: function(id) {return document.getElementById(id);},
 
   incontentInit: function gTabMix_preferencesOverlay_incontentInit() {
@@ -29,9 +29,9 @@ var gTabMix_preferencesOverlay = {
         let item = this.id(id);
         item.removeAttribute("data-category");
         item.hidden = false;
-        item.classList.remove("indent")
-        item.classList.add("incontent_paneGeneral")
-      }, this)
+        item.classList.remove("indent");
+        item.classList.add("incontent_paneGeneral");
+      }, this);
     }
 
     this.initMainPane();
@@ -93,4 +93,4 @@ var gTabMix_preferencesOverlay = {
        this.id("whenBrowserStartBox").removeAttribute("tabmixSession");
    }
 
-}
+};
diff --git a/chrome/content/preferences/preferences.js b/chrome/content/preferences/preferences.js
index 16e4880..14fd883 100644
--- a/chrome/content/preferences/preferences.js
+++ b/chrome/content/preferences/preferences.js
@@ -1,13 +1,13 @@
+/* globals _sminstalled, gPreferenceList */
 "use strict";
 
 /***** Preference Dialog Functions *****/
-const Cc = Components.classes;
-const Ci = Components.interfaces;
+const {classes: Cc, interfaces: Ci} = Components; // jshint ignore:line
 const PrefFn = {0: "", 32: "CharPref", 64: "IntPref", 128: "BoolPref"};
 
-function $(id) document.getElementById(id);
+function $(id) document.getElementById(id)
 
-var gPrefWindow = {
+var gPrefWindow = { // jshint ignore:line
   widthChanged: false,
   _initialized: false,
   init: function() {
@@ -31,7 +31,6 @@ var gPrefWindow = {
     if (navigator.userAgent.toLowerCase().indexOf("ubuntu") > -1)
       prefWindow.setAttribute("ubuntu", true);
 
-    var browserWindow = Tabmix.getTopWin();
     var docElt = document.documentElement;
 
     // don't use browser.preferences.animateFadeIn
@@ -166,7 +165,7 @@ var gPrefWindow = {
     applyButton.hidden = this.instantApply && disable;
     docElt.getButton("accept").hidden = disable;
 
-    var action = disable ? "close" : "cancel"
+    var action = disable ? "close" : "cancel";
     var cancelButton = docElt.getButton("cancel");
     cancelButton.label = docElt.getAttribute(action + "buttonlabel");
     cancelButton.setAttribute("icon", action);
@@ -198,7 +197,7 @@ var gPrefWindow = {
                       $(aPreference.id.replace("pref_", "obs_"));
     if (broadcaster) {
       let disable = aPreference.type == "bool" ? !aPreference.value :
-          aPreference.value == parseInt(aPreference.getAttribute("notChecked"))
+          aPreference.value == parseInt(aPreference.getAttribute("notChecked"));
       this.setDisabled(broadcaster, disable);
     }
   },
@@ -220,7 +219,7 @@ var gPrefWindow = {
     let preference = $("pref_" + tabs.id);
     if (!tabs._inited) {
       tabs._inited = true;
-      if (preference.value != null)
+      if (preference.value !== null)
         tabs.selectedIndex = preference.value;
     }
     else if (preference.value != tabs.selectedIndex)
@@ -249,7 +248,7 @@ var gPrefWindow = {
     preference._lastValue = control.value;
     return val;
   }
-}
+};
 
 function getPrefByType(prefName) {
   try {
@@ -266,7 +265,7 @@ function getPrefByType(prefName) {
 
 function setPrefByType(prefName, newValue, atImport) {
   let pref = {name: prefName, value: newValue,
-              type: Services.prefs.getPrefType(prefName)}
+              type: Services.prefs.getPrefType(prefName)};
   try {
     if (!atImport || !setPrefAfterImport(pref))
       setPref(pref);
@@ -362,7 +361,7 @@ XPCOMUtils.defineLazyGetter(window, "gPreferenceList", function() {
   // filter out preference without default value
   tabmixPrefs = otherPrefs.concat(tabmixPrefs).filter(function(pref){
     try {
-      return prefs["get" + PrefFn[prefs.getPrefType(pref)]](pref) != undefined;
+      return prefs["get" + PrefFn[prefs.getPrefType(pref)]](pref) !== undefined;
     } catch (ex) { }
     return false;
   });
@@ -526,7 +525,7 @@ function showPane(paneID) {
 }
 
 function openHelp(helpTopic) {
-  var helpPage = "http://tmp.garyr.net/help/#"
+  var helpPage = "http://tmp.garyr.net/help/#";
   // Check if the help page already open in the top window
   var recentWindow = Tabmix.getTopWin();
   var tabBrowser = recentWindow.gBrowser;
@@ -580,7 +579,7 @@ var gIncompatiblePane = {
   checkForIncompatible: function (aShowList) {
      let tmp = { };
      Components.utils.import("resource://tabmixplus/extensions/CompatibilityCheck.jsm", tmp);
-     new tmp.CompatibilityCheck(window, aShowList, true);
+     tmp = new tmp.CompatibilityCheck(window, aShowList, true);
   },
 
   // call back function from CompatibilityCheck.jsm
@@ -589,7 +588,7 @@ var gIncompatiblePane = {
       this.paneButton.collapsed = aHide;
       $("paneIncompatible").collapsed = aHide;
     }
-    Tabmix.setItem(this.paneButton, "show", !aHide)
+    Tabmix.setItem(this.paneButton, "show", !aHide);
 
     if (aHide && document.documentElement.lastSelected == "paneIncompatible")
       document.documentElement.showPane($(this.lastSelected));
@@ -598,7 +597,7 @@ var gIncompatiblePane = {
       window.focus();
   }
 
-}
+};
 
 XPCOMUtils.defineLazyGetter(gPrefWindow, "pinTabLabel", function() {
   let win = Tabmix.getTopWin();
diff --git a/chrome/content/preferences/session.js b/chrome/content/preferences/session.js
index 72048a0..d69952e 100644
--- a/chrome/content/preferences/session.js
+++ b/chrome/content/preferences/session.js
@@ -38,7 +38,7 @@ var gSessionPane = {
   },
 
   setSessionsOptions: function (item) {
-    let instantApply = document.documentElement.instantApply
+    let instantApply = document.documentElement.instantApply;
     var useSessionManager = !item.checked;
     $("sesionsPanel").setAttribute("manager", useSessionManager ? "tabmix" : "firefox");
 
@@ -60,7 +60,7 @@ var gSessionPane = {
     let sessionPrefs = function() {
       updatePrefs("sessionManager", useSessionManager);
       updatePrefs("sessionCrashRecovery", useSessionManager);
-    }
+    };
 
     // sessionstore pref
     function sessionstorePrefs() {
@@ -80,7 +80,7 @@ var gSessionPane = {
     }
     else {
       sessionPrefs();
-      sessionstorePrefs()
+      sessionstorePrefs();
     }
     TabmixSvc.sm.settingPreference = false;
 
@@ -97,7 +97,7 @@ var gSessionPane = {
 
   get sessionManagerAddon() {
     if (TabmixSvc.sessionManagerAddonInstalled) {
-      let tmp = {}
+      let tmp = {};
       Components.utils.import("chrome://sessionmanager/content/modules/session_manager.jsm", tmp);
       return tmp.gSessionManager;
     }
@@ -132,7 +132,7 @@ var gSessionPane = {
 
   convertSession: function () {
     var browserWindow = Tabmix.getTopWin();
-    if ($("chooseFile").selectedItem.value == 0)
+    if ($("chooseFile").selectedItem.value === 0)
       browserWindow.TabmixConvertSession.selectFile(window);
     else
       browserWindow.TabmixConvertSession.convertFile();
@@ -140,4 +140,4 @@ var gSessionPane = {
     window.focus();
   }
 
-}
+};
diff --git a/chrome/content/preferences/shortcuts.js b/chrome/content/preferences/shortcuts.js
index 5db6dda..0b12dc1 100644
--- a/chrome/content/preferences/shortcuts.js
+++ b/chrome/content/preferences/shortcuts.js
@@ -16,7 +16,7 @@ function getKeysForShortcut(shortcut, id, win) {
   if (isDisabled(ourKey))
     return null;
 
-  let dots = "…"
+  let dots = "…";
   let keys = win.document.getElementsByTagName("key");
   let usedKeys = Array.filter(keys, function(key) {
     if (ourKey == key)
@@ -27,7 +27,7 @@ function getKeysForShortcut(shortcut, id, win) {
       modifiers: key.getAttribute("modifiers"),
       key: key.getAttribute("key"),
       keycode: key.getAttribute("keycode")
-    }
+    };
     if (getFormattedKey(_key) == shortcut)
       return true;
     return false;
@@ -81,7 +81,7 @@ function _getKeyName(win, aKey) {
     goForwardKb2: "goForwardKb",
     get cmd_handleBackspace() this.action < 2 && ["goBackKb", "cmd_scrollPageUp"][this.action],
     get cmd_handleShiftBackspace() this.action < 2 && ["goForwardKb", "cmd_scrollPageDown"][this.action]
-  }
+  };
   if (keyname[id]) {
     let key = doc.getElementById(keyname[id]);
     if (key)
@@ -106,7 +106,8 @@ function _getLabel(elm, attr, value) {
 
 function _getPath(elm){
   let names = [];
-  while (elm && elm.localName && elm.localName != "toolbaritem" && elm.localName != "popupset" && elm.id != "titlebar-content") {
+  while (elm && elm.localName && elm.localName != "toolbaritem" &&
+         elm.localName != "popupset" && elm.id != "titlebar-content") {
     if (elm.hasAttribute("label"))
       names.unshift(elm.getAttribute("label"));
     elm = elm.parentNode;
@@ -114,4 +115,4 @@ function _getPath(elm){
   return names.join(" > ");
 }
 
-function getFormattedKey(key) Shortcuts.getFormattedKey(key);
+function getFormattedKey(key) Shortcuts.getFormattedKey(key)
diff --git a/chrome/content/preferences/subdialogs/pref-appearance.js b/chrome/content/preferences/subdialogs/pref-appearance.js
index 7d86ffe..c049485 100644
--- a/chrome/content/preferences/subdialogs/pref-appearance.js
+++ b/chrome/content/preferences/subdialogs/pref-appearance.js
@@ -1,8 +1,8 @@
 "use strict";
 
-function $(id) document.getElementById(id);
+function $(id) document.getElementById(id)
 
-let tabstyles = {
+let tabstyles = { // jshint ignore:line
   pref: "appearance_tab",
   init: function () {
     $("stylestabs").selectedIndex = Tabmix.prefs.prefHasUserValue(this.pref) ?
@@ -52,4 +52,4 @@ let tabstyles = {
     extra.label = item.value = item.getAttribute(wasShow ? 'show' : 'hide');
     doc.setAttribute("hide-RGB", wasShow);
   }
-}
+};
diff --git a/chrome/content/preferences/subdialogs/pref-filetype.js b/chrome/content/preferences/subdialogs/pref-filetype.js
index ca1e9e2..a8771b2 100644
--- a/chrome/content/preferences/subdialogs/pref-filetype.js
+++ b/chrome/content/preferences/subdialogs/pref-filetype.js
@@ -34,7 +34,7 @@ function FillData()
 
    items = data.split(' ');
    for (var i = 0; i < items.length; ++i) {
-      if (items[i] == "") continue;
+      if (items[i] === "") continue;
       item = items[i].trim();
       list.appendItem(item, item.toLowerCase());
    }
@@ -128,7 +128,7 @@ function Del()
    var index = list.getIndexOfItem(item);
    // if the list is not empty select next item or if we at the end the last item
    if (list.getRowCount() > 1)
-      SelectItemAt(index == list.getRowCount() - 1  ? index - 1 : index + 1, true)
+      SelectItemAt(index == list.getRowCount() - 1  ? index - 1 : index + 1, true);
    else
       entry.value = null;
    list.removeChild(item);

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