mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 15:27:30 +09:00
[Pale-Moon] Remove excess whitespace.
This commit is contained in:
parent
fcab070621
commit
b6b33a6b2a
73 changed files with 1883 additions and 1883 deletions
|
|
@ -19,7 +19,7 @@ const BROWSER_SUGGEST_PREF = "browser.search.suggest.enabled";
|
|||
var gEngineView = null;
|
||||
|
||||
var gEngineManagerDialog = {
|
||||
init: function () {
|
||||
init: function() {
|
||||
gEngineView = new EngineView(new EngineStore());
|
||||
|
||||
var suggestEnabled = Services.prefs.getBoolPref(BROWSER_SUGGEST_PREF);
|
||||
|
|
@ -31,12 +31,12 @@ var gEngineManagerDialog = {
|
|||
Services.obs.addObserver(this, "browser-search-engine-modified", false);
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
destroy: function() {
|
||||
// Remove the observer
|
||||
Services.obs.removeObserver(this, "browser-search-engine-modified");
|
||||
},
|
||||
|
||||
observe: function (aEngine, aTopic, aVerb) {
|
||||
observe: function(aEngine, aTopic, aVerb) {
|
||||
if (aTopic == "browser-search-engine-modified") {
|
||||
aEngine.QueryInterface(Ci.nsISearchEngine);
|
||||
switch (aVerb) {
|
||||
|
|
@ -57,7 +57,7 @@ var gEngineManagerDialog = {
|
|||
}
|
||||
},
|
||||
|
||||
onOK: function () {
|
||||
onOK: function() {
|
||||
// Set the preference
|
||||
var newSuggestEnabled = document.getElementById("enableSuggest").checked;
|
||||
Services.prefs.setBoolPref(BROWSER_SUGGEST_PREF, newSuggestEnabled);
|
||||
|
|
@ -66,23 +66,23 @@ var gEngineManagerDialog = {
|
|||
gEngineView._engineStore.commit();
|
||||
},
|
||||
|
||||
onRestoreDefaults: function () {
|
||||
onRestoreDefaults: function() {
|
||||
var num = gEngineView._engineStore.restoreDefaultEngines();
|
||||
gEngineView.rowCountChanged(0, num);
|
||||
gEngineView.invalidate();
|
||||
},
|
||||
|
||||
showRestoreDefaults: function (val) {
|
||||
showRestoreDefaults: function(val) {
|
||||
document.documentElement.getButton("extra2").disabled = !val;
|
||||
},
|
||||
|
||||
loadAddEngines: function () {
|
||||
loadAddEngines: function() {
|
||||
this.onOK();
|
||||
window.opener.BrowserSearch.loadAddEngines();
|
||||
window.close();
|
||||
},
|
||||
|
||||
remove: function () {
|
||||
remove: function() {
|
||||
gEngineView._engineStore.removeEngine(gEngineView.selectedEngine);
|
||||
var index = gEngineView.selectedIndex;
|
||||
gEngineView.rowCountChanged(index, -1);
|
||||
|
|
@ -97,7 +97,7 @@ var gEngineManagerDialog = {
|
|||
* @param aDir
|
||||
* -1 to move the selected engine down, +1 to move it up.
|
||||
*/
|
||||
bump: function (aDir) {
|
||||
bump: function(aDir) {
|
||||
var selectedEngine = gEngineView.selectedEngine;
|
||||
var newIndex = gEngineView.selectedIndex - aDir;
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ var gEngineManagerDialog = {
|
|||
}
|
||||
}),
|
||||
|
||||
onSelect: function () {
|
||||
onSelect: function() {
|
||||
// Buttons only work if an engine is selected and it's not the last engine,
|
||||
// the latter is true when the selected is first and last at the same time.
|
||||
var lastSelected = (gEngineView.selectedIndex == gEngineView.lastIndex);
|
||||
|
|
@ -197,7 +197,7 @@ function EngineMoveOp(aEngineClone, aNewIndex) {
|
|||
EngineMoveOp.prototype = {
|
||||
_engine: null,
|
||||
_newIndex: null,
|
||||
commit: function () {
|
||||
commit: function() {
|
||||
Services.search.moveEngine(this._engine, this._newIndex);
|
||||
}
|
||||
}
|
||||
|
|
@ -209,7 +209,7 @@ function EngineRemoveOp(aEngineClone) {
|
|||
}
|
||||
EngineRemoveOp.prototype = {
|
||||
_engine: null,
|
||||
commit: function () {
|
||||
commit: function() {
|
||||
Services.search.removeEngine(this._engine);
|
||||
}
|
||||
}
|
||||
|
|
@ -223,7 +223,7 @@ function EngineUnhideOp(aEngineClone, aNewIndex) {
|
|||
EngineUnhideOp.prototype = {
|
||||
_engine: null,
|
||||
_newIndex: null,
|
||||
commit: function () {
|
||||
commit: function() {
|
||||
this._engine.hidden = false;
|
||||
Services.search.moveEngine(this._engine, this._newIndex);
|
||||
}
|
||||
|
|
@ -241,7 +241,7 @@ EngineChangeOp.prototype = {
|
|||
_engine: null,
|
||||
_prop: null,
|
||||
_newValue: null,
|
||||
commit: function () {
|
||||
commit: function() {
|
||||
this._engine[this._prop] = this._newValue;
|
||||
}
|
||||
}
|
||||
|
|
@ -253,7 +253,7 @@ function EngineStore() {
|
|||
this._ops = [];
|
||||
|
||||
// check if we need to disable the restore defaults button
|
||||
var someHidden = this._defaultEngines.some(function (e) e.hidden);
|
||||
var someHidden = this._defaultEngines.some(function(e) e.hidden);
|
||||
gEngineManagerDialog.showRestoreDefaults(someHidden);
|
||||
}
|
||||
EngineStore.prototype = {
|
||||
|
|
@ -269,11 +269,11 @@ EngineStore.prototype = {
|
|||
return val;
|
||||
},
|
||||
|
||||
_getIndexForEngine: function (aEngine) {
|
||||
_getIndexForEngine: function(aEngine) {
|
||||
return this._engines.indexOf(aEngine);
|
||||
},
|
||||
|
||||
_getEngineByName: function (aName) {
|
||||
_getEngineByName: function(aName) {
|
||||
for each (var engine in this._engines)
|
||||
if (engine.name == aName)
|
||||
return engine;
|
||||
|
|
@ -281,7 +281,7 @@ EngineStore.prototype = {
|
|||
return null;
|
||||
},
|
||||
|
||||
_cloneEngine: function (aEngine) {
|
||||
_cloneEngine: function(aEngine) {
|
||||
var clonedObj={};
|
||||
for (var i in aEngine)
|
||||
clonedObj[i] = aEngine[i];
|
||||
|
|
@ -290,11 +290,11 @@ EngineStore.prototype = {
|
|||
},
|
||||
|
||||
// Callback for Array's some(). A thisObj must be passed to some()
|
||||
_isSameEngine: function (aEngineClone) {
|
||||
_isSameEngine: function(aEngineClone) {
|
||||
return aEngineClone.originalEngine == this.originalEngine;
|
||||
},
|
||||
|
||||
commit: function () {
|
||||
commit: function() {
|
||||
var currentEngine = this._cloneEngine(Services.search.currentEngine);
|
||||
for (var i = 0; i < this._ops.length; i++)
|
||||
this._ops[i].commit();
|
||||
|
|
@ -306,11 +306,11 @@ EngineStore.prototype = {
|
|||
Services.search.currentEngine = currentEngine.originalEngine;
|
||||
},
|
||||
|
||||
addEngine: function (aEngine) {
|
||||
addEngine: function(aEngine) {
|
||||
this._engines.push(this._cloneEngine(aEngine));
|
||||
},
|
||||
|
||||
moveEngine: function (aEngine, aNewIndex) {
|
||||
moveEngine: function(aEngine, aNewIndex) {
|
||||
if (aNewIndex < 0 || aNewIndex > this._engines.length - 1)
|
||||
throw new Error("ES_moveEngine: invalid aNewIndex!");
|
||||
var index = this._getIndexForEngine(aEngine);
|
||||
|
|
@ -327,7 +327,7 @@ EngineStore.prototype = {
|
|||
this._ops.push(new EngineMoveOp(aEngine, aNewIndex));
|
||||
},
|
||||
|
||||
removeEngine: function (aEngine) {
|
||||
removeEngine: function(aEngine) {
|
||||
var index = this._getIndexForEngine(aEngine);
|
||||
if (index == -1)
|
||||
throw new Error("invalid engine?");
|
||||
|
|
@ -338,7 +338,7 @@ EngineStore.prototype = {
|
|||
gEngineManagerDialog.showRestoreDefaults(true);
|
||||
},
|
||||
|
||||
restoreDefaultEngines: function () {
|
||||
restoreDefaultEngines: function() {
|
||||
var added = 0;
|
||||
|
||||
for (var i = 0; i < this._defaultEngines.length; ++i) {
|
||||
|
|
@ -358,7 +358,7 @@ EngineStore.prototype = {
|
|||
return added;
|
||||
},
|
||||
|
||||
changeEngine: function (aEngine, aProp, aNewValue) {
|
||||
changeEngine: function(aEngine, aProp, aNewValue) {
|
||||
var index = this._getIndexForEngine(aEngine);
|
||||
if (index == -1)
|
||||
throw new Error("invalid engine?");
|
||||
|
|
@ -367,8 +367,8 @@ EngineStore.prototype = {
|
|||
this._ops.push(new EngineChangeOp(aEngine, aProp, aNewValue));
|
||||
},
|
||||
|
||||
reloadIcons: function () {
|
||||
this._engines.forEach(function (e) {
|
||||
reloadIcons: function() {
|
||||
this._engines.forEach(function(e) {
|
||||
e.uri = e.originalEngine.uri;
|
||||
});
|
||||
}
|
||||
|
|
@ -398,19 +398,19 @@ EngineView.prototype = {
|
|||
},
|
||||
|
||||
// Helpers
|
||||
rowCountChanged: function (index, count) {
|
||||
rowCountChanged: function(index, count) {
|
||||
this.tree.rowCountChanged(index, count);
|
||||
},
|
||||
|
||||
invalidate: function () {
|
||||
invalidate: function() {
|
||||
this.tree.invalidate();
|
||||
},
|
||||
|
||||
ensureRowIsVisible: function (index) {
|
||||
ensureRowIsVisible: function(index) {
|
||||
this.tree.ensureRowIsVisible(index);
|
||||
},
|
||||
|
||||
getSourceIndexFromDrag: function (dataTransfer) {
|
||||
getSourceIndexFromDrag: function(dataTransfer) {
|
||||
return parseInt(dataTransfer.getData(ENGINE_FLAVOR));
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue