[Pale-Moon] Remove excess whitespace.

This commit is contained in:
athenian200 2020-02-06 09:46:16 -06:00 committed by Roy Tam
commit b6b33a6b2a
73 changed files with 1883 additions and 1883 deletions

View file

@ -17,7 +17,7 @@ const DEVICE_CONNECTED_PAGE = 2;
var gSyncAddDevice = {
init: function () {
init: function() {
this.pin1.setAttribute("maxlength", PIN_PART_LENGTH);
this.pin2.setAttribute("maxlength", PIN_PART_LENGTH);
this.pin3.setAttribute("maxlength", PIN_PART_LENGTH);
@ -34,7 +34,7 @@ var gSyncAddDevice = {
Weave.Service.scheduler.scheduleNextSync(0);
},
onPageShow: function () {
onPageShow: function() {
this.wizard.getButton("back").hidden = true;
switch (this.wizard.pageIndex) {
@ -60,7 +60,7 @@ var gSyncAddDevice = {
}
},
onWizardAdvance: function () {
onWizardAdvance: function() {
switch (this.wizard.pageIndex) {
case ADD_DEVICE_PAGE:
this.startTransfer();
@ -72,21 +72,21 @@ var gSyncAddDevice = {
return true;
},
startTransfer: function () {
startTransfer: function() {
this.errorRow.hidden = true;
// When onAbort is called, Weave may already be gone.
const JPAKE_ERROR_USERABORT = Weave.JPAKE_ERROR_USERABORT;
let self = this;
let jpakeclient = this._jpakeclient = new Weave.JPAKEClient({
onPaired: function () {
onPaired: function() {
let credentials = {account: Weave.Service.identity.account,
password: Weave.Service.identity.basicPassword,
synckey: Weave.Service.identity.syncKey,
serverURL: Weave.Service.serverURL};
jpakeclient.sendAndComplete(credentials);
},
onComplete: function () {
onComplete: function() {
delete self._jpakeclient;
self.wizard.pageIndex = DEVICE_CONNECTED_PAGE;
@ -94,7 +94,7 @@ var gSyncAddDevice = {
// device with which we just paired.
Weave.Service.scheduler.scheduleNextSync(Weave.Service.scheduler.activeInterval);
},
onAbort: function (error) {
onAbort: function(error) {
delete self._jpakeclient;
// Aborted by user, ignore.
@ -118,7 +118,7 @@ var gSyncAddDevice = {
jpakeclient.pairWithPIN(pin, expectDelay);
},
onWizardBack: function () {
onWizardBack: function() {
if (this.wizard.pageIndex != SYNC_KEY_PAGE)
return true;
@ -126,7 +126,7 @@ var gSyncAddDevice = {
return false;
},
onWizardCancel: function () {
onWizardCancel: function() {
if (this._jpakeclient) {
this._jpakeclient.abort();
delete this._jpakeclient;
@ -134,7 +134,7 @@ var gSyncAddDevice = {
return true;
},
onTextBoxInput: function (textbox) {
onTextBoxInput: function(textbox) {
if (textbox && textbox.value.length == PIN_PART_LENGTH)
this.nextFocusEl[textbox.id].focus();
@ -143,14 +143,14 @@ var gSyncAddDevice = {
&& this.pin3.value.length == PIN_PART_LENGTH);
},
goToSyncKeyPage: function () {
goToSyncKeyPage: function() {
this.wizard.pageIndex = SYNC_KEY_PAGE;
}
};
// onWizardAdvance() and onPageShow() are run before init() so we'll set
// these up as lazy getters.
["wizard", "pin1", "pin2", "pin3"].forEach(function (id) {
["wizard", "pin1", "pin2", "pin3"].forEach(function(id) {
XPCOMUtils.defineLazyGetter(gSyncAddDevice, id, function() {
return document.getElementById(id);
});

View file

@ -29,7 +29,7 @@ var Change = {
return this._dialogType == "UpdatePassphrase";
},
onLoad: function () {
onLoad: function() {
/* Load labels */
let introText = document.getElementById("introText");
let introText2 = document.getElementById("introText2");
@ -112,16 +112,16 @@ var Change = {
.setAttribute("label", document.title);
},
_clearStatus: function () {
_clearStatus: function() {
this._status.value = "";
this._statusIcon.removeAttribute("status");
},
_updateStatus: function (str, state) {
_updateStatus: function(str, state) {
this._updateStatusWithString(this._str(str), state);
},
_updateStatusWithString: function (string, state) {
_updateStatusWithString: function(string, state) {
this._statusRow.hidden = false;
this._status.value = string;
this._statusIcon.setAttribute("status", state);
@ -148,13 +148,13 @@ var Change = {
}
},
doGeneratePassphrase: function () {
doGeneratePassphrase: function() {
let passphrase = Weave.Utils.generatePassphrase();
this._passphraseBox.value = Weave.Utils.hyphenatePassphrase(passphrase);
this._dialog.getButton("finish").disabled = false;
},
doChangePassphrase: function () {
doChangePassphrase: function() {
let pp = Weave.Utils.normalizePassphrase(this._passphraseBox.value);
if (this._updatingPassphrase) {
Weave.Service.identity.syncKey = pp;
@ -179,7 +179,7 @@ var Change = {
return false;
},
doChangePassword: function () {
doChangePassword: function() {
if (this._currentPasswordInvalid) {
Weave.Service.identity.basicPassword = this._firstBox.value;
if (Weave.Service.login()) {
@ -202,7 +202,7 @@ var Change = {
return false;
},
validate: function (event) {
validate: function(event) {
let valid = false;
let errorString = "";
@ -228,7 +228,7 @@ var Change = {
this._dialog.getButton("finish").disabled = !valid;
},
_str: function (str) {
_str: function(str) {
return this._stringBundle.GetStringFromName(str);
}
};

View file

@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/DownloadUtils.jsm");
var gSyncQuota = {
init: function () {
init: function() {
this.bundle = document.getElementById("quotaStrings");
let caption = document.getElementById("treeCaption");
caption.firstChild.nodeValue = this.bundle.getString("quota.treeCaption.label");
@ -24,9 +24,9 @@ var gSyncQuota = {
this.loadData();
},
loadData: function () {
loadData: function() {
this._usage_req = Weave.Service.getStorageInfo(Weave.INFO_COLLECTION_USAGE,
function (error, usage) {
function(error, usage) {
delete gSyncQuota._usage_req;
// displayUsageData handles null values, so no need to check 'error'.
gUsageTreeView.displayUsageData(usage);
@ -36,7 +36,7 @@ var gSyncQuota = {
let bundle = this.bundle;
this._quota_req = Weave.Service.getStorageInfo(Weave.INFO_QUOTA,
function (error, quota) {
function(error, quota) {
delete gSyncQuota._quota_req;
if (error) {
@ -57,7 +57,7 @@ var gSyncQuota = {
});
},
onCancel: function () {
onCancel: function() {
if (this._usage_req) {
this._usage_req.abort();
}
@ -67,7 +67,7 @@ var gSyncQuota = {
return true;
},
onAccept: function () {
onAccept: function() {
let engines = gUsageTreeView.getEnginesToDisable();
for each (let engine in engines) {
Weave.Service.engineManager.get(engine).enabled = false;
@ -80,7 +80,7 @@ var gSyncQuota = {
return this.onCancel();
},
convertKB: function (value) {
convertKB: function(value) {
return DownloadUtils.convertByteUnits(value * 1024);
}
@ -98,7 +98,7 @@ var gUsageTreeView = {
_collections: [],
_byname: {},
init: function () {
init: function() {
let retrievingLabel = gSyncQuota.bundle.getString("quota.retrieving.label");
for each (let engine in Weave.Service.engineManager.getEnabled()) {
if (this._ignored[engine.name])
@ -122,7 +122,7 @@ var gUsageTreeView = {
}
},
_collectionTitle: function (engine) {
_collectionTitle: function(engine) {
try {
return gSyncQuota.bundle.getString(
"collection." + engine.prefName + ".label");
@ -134,7 +134,7 @@ var gUsageTreeView = {
/*
* Process the quota information as returned by info/collection_usage.
*/
displayUsageData: function (data) {
displayUsageData: function(data) {
for each (let coll in this._collections) {
coll.size = 0;
// If we couldn't retrieve any data, just blank out the label.
@ -157,7 +157,7 @@ var gUsageTreeView = {
/*
* Handle click events on the tree.
*/
onTreeClick: function (event) {
onTreeClick: function(event) {
if (event.button == 2)
return;
@ -169,7 +169,7 @@ var gUsageTreeView = {
/*
* Toggle enabled state of an engine.
*/
toggle: function (row) {
toggle: function(row) {
// Update the tree
let collection = this._collections[row];
collection.enabled = !collection.enabled;
@ -180,7 +180,7 @@ var gUsageTreeView = {
* Return a list of engines (or rather their pref names) that should be
* disabled.
*/
getEnginesToDisable: function () {
getEnginesToDisable: function() {
// Tycho: return [coll.name for each (coll in this._collections) if (!coll.enabled)];
let engines = [];
for each (let coll in this._collections) {
@ -216,7 +216,7 @@ var gUsageTreeView = {
return this._collections[row].enabled;
},
getCellText: function (row, col) {
getCellText: function(row, col) {
let collection = this._collections[row];
switch (col.id) {
case "collection":
@ -228,7 +228,7 @@ var gUsageTreeView = {
}
},
setTree: function (tree) {
setTree: function(tree) {
this.treeBox = tree;
},
@ -237,7 +237,7 @@ var gUsageTreeView = {
selectionChanged: function() {},
cycleCell: function(row, col) {},
isEditable: function(row, col) { return false; },
isSelectable: function (row, col) { return false; },
isSelectable: function(row, col) { return false; },
setCellValue: function(row, col, value) {},
setCellText: function(row, col, value) {},
performAction: function(action) {},

View file

@ -58,7 +58,7 @@ var gSyncSetup = {
return document.getElementById("existingServer").selectedIndex == 0;
},
init: function () {
init: function() {
let obs = [
["weave:service:change-passphrase", "onResetPassphrase"],
["weave:service:login:start", "onLoginStart"],
@ -80,7 +80,7 @@ var gSyncSetup = {
addRem(true);
window.addEventListener("unload", function() addRem(false), false);
window.setTimeout(function () {
window.setTimeout(function() {
// Force Service to be loaded so that engines are registered.
// See Bug 670082.
Weave.Service;
@ -118,14 +118,14 @@ var gSyncSetup = {
.getAttribute("accesskey");
},
startNewAccountSetup: function () {
startNewAccountSetup: function() {
if (!Weave.Utils.ensureMPUnlocked())
return false;
this._settingUpNew = true;
this.wizard.pageIndex = NEW_ACCOUNT_START_PAGE;
},
useExistingAccount: function () {
useExistingAccount: function() {
if (!Weave.Utils.ensureMPUnlocked())
return false;
this._settingUpNew = false;
@ -138,7 +138,7 @@ var gSyncSetup = {
}
},
resetPassphrase: function () {
resetPassphrase: function() {
// Apply the existing form fields so that
// Weave.Service.changePassphrase() has the necessary credentials.
Weave.Service.identity.account = document.getElementById("existingAccountName").value;
@ -170,22 +170,22 @@ var gSyncSetup = {
gSyncUtils.resetPassphrase(true);
},
onResetPassphrase: function () {
onResetPassphrase: function() {
document.getElementById("existingPassphrase").value =
Weave.Utils.hyphenatePassphrase(Weave.Service.identity.syncKey);
this.checkFields();
this.wizard.advance();
},
onLoginStart: function () {
onLoginStart: function() {
this.toggleLoginFeedback(false);
},
onLoginEnd: function () {
onLoginEnd: function() {
this.toggleLoginFeedback(true);
},
sendCredentialsAfterSync: function () {
sendCredentialsAfterSync: function() {
let send = function() {
Services.obs.removeObserver("weave:service:sync:finish", send);
Services.obs.removeObserver("weave:service:sync:error", send);
@ -199,7 +199,7 @@ var gSyncSetup = {
Services.obs.addObserver("weave:service:sync:error", send, false);
},
toggleLoginFeedback: function (stop) {
toggleLoginFeedback: function(stop) {
document.getElementById("login-throbber").hidden = stop;
let password = document.getElementById("existingPasswordFeedbackRow");
let server = document.getElementById("existingServerFeedbackRow");
@ -228,7 +228,7 @@ var gSyncSetup = {
this._setFeedbackMessage(feedback, false, Weave.Status.login);
},
setupInitialSync: function () {
setupInitialSync: function() {
let action = document.getElementById("mergeChoiceRadio").selectedItem.id;
switch (action) {
case "resetClient":
@ -245,11 +245,11 @@ var gSyncSetup = {
},
// fun with validation!
checkFields: function () {
checkFields: function() {
this.wizard.canAdvance = this.readyToAdvance();
},
readyToAdvance: function () {
readyToAdvance: function() {
switch (this.wizard.pageIndex) {
case INTRO_PAGE:
return false;
@ -290,11 +290,11 @@ var gSyncSetup = {
this.pin3.value.length == PIN_PART_LENGTH);
},
onEmailInput: function () {
onEmailInput: function() {
// Check account validity when the user stops typing for 1 second.
if (this._checkAccountTimer)
window.clearTimeout(this._checkAccountTimer);
this._checkAccountTimer = window.setTimeout(function () {
this._checkAccountTimer = window.setTimeout(function() {
gSyncSetup.checkAccount();
}, 1000);
},
@ -334,7 +334,7 @@ var gSyncSetup = {
this.checkFields();
},
onPasswordChange: function () {
onPasswordChange: function() {
let password = document.getElementById("weavePassword");
let pwconfirm = document.getElementById("weavePasswordConfirm");
let [valid, errorString] = gSyncUtils.validatePassword(password, pwconfirm);
@ -417,7 +417,7 @@ var gSyncSetup = {
}
},
onWizardAdvance: function () {
onWizardAdvance: function() {
// Check pageIndex so we don't prompt before the Sync setup wizard appears.
// This is a fallback in case the Master Password gets locked mid-wizard.
if ((this.wizard.pageIndex >= 0) &&
@ -506,7 +506,7 @@ var gSyncSetup = {
return true;
},
onWizardBack: function () {
onWizardBack: function() {
switch (this.wizard.pageIndex) {
case NEW_ACCOUNT_START_PAGE:
case EXISTING_ACCOUNT_LOGIN_PAGE:
@ -533,7 +533,7 @@ var gSyncSetup = {
return true;
},
wizardFinish: function () {
wizardFinish: function() {
this.setupInitialSync();
if (this.wizardType == "pair") {
@ -568,7 +568,7 @@ var gSyncSetup = {
window.close();
},
onWizardCancel: function () {
onWizardCancel: function() {
if (this._resettingSync)
return;
@ -577,7 +577,7 @@ var gSyncSetup = {
Weave.Service.startOver();
},
onSyncOptions: function () {
onSyncOptions: function() {
this._beforeOptionsPage = this.wizard.pageIndex;
this.wizard.pageIndex = OPTIONS_PAGE;
},
@ -595,7 +595,7 @@ var gSyncSetup = {
return false;
},
startPairing: function () {
startPairing: function() {
this.pairDeviceErrorRow.hidden = true;
// When onAbort is called, Weave may already be gone.
const JPAKE_ERROR_USERABORT = Weave.JPAKE_ERROR_USERABORT;
@ -605,11 +605,11 @@ var gSyncSetup = {
onPaired: function onPaired() {
self.wizard.pageIndex = INTRO_PAGE;
},
onComplete: function () {
onComplete: function() {
// This method will never be called since SendCredentialsController
// will take over after the wizard completes.
},
onAbort: function (error) {
onAbort: function(error) {
delete self._jpakeclient;
// Aborted by user, ignore. The window is almost certainly going to close
@ -636,7 +636,7 @@ var gSyncSetup = {
jpakeclient.pairWithPIN(pin, expectDelay);
},
completePairing: function () {
completePairing: function() {
if (!this._jpakeclient) {
// The channel was aborted while we were setting up the account
// locally. XXX TODO should we do anything here, e.g. tell
@ -649,7 +649,7 @@ var gSyncSetup = {
this._jpakeclient.controller = controller;
},
startEasySetup: function () {
startEasySetup: function() {
// Don't do anything if we have a client already (e.g. we went to
// Sync Options and just came back).
if (this._jpakeclient)
@ -660,15 +660,15 @@ var gSyncSetup = {
let self = this;
this._jpakeclient = new Weave.JPAKEClient({
displayPIN: function (pin) {
displayPIN: function(pin) {
document.getElementById("easySetupPIN1").value = pin.slice(0, 4);
document.getElementById("easySetupPIN2").value = pin.slice(4, 8);
document.getElementById("easySetupPIN3").value = pin.slice(8);
},
onPairingStart: function () {},
onPairingStart: function() {},
onComplete: function (credentials) {
onComplete: function(credentials) {
Weave.Service.identity.account = credentials.account;
Weave.Service.identity.basicPassword = credentials.password;
Weave.Service.identity.syncKey = credentials.synckey;
@ -676,7 +676,7 @@ var gSyncSetup = {
gSyncSetup.wizardFinish();
},
onAbort: function (error) {
onAbort: function(error) {
delete self._jpakeclient;
// Ignore if wizard is aborted.
@ -696,7 +696,7 @@ var gSyncSetup = {
this._jpakeclient.receiveNoPIN();
},
abortEasySetup: function () {
abortEasySetup: function() {
document.getElementById("easySetupPIN1").value = "";
document.getElementById("easySetupPIN2").value = "";
document.getElementById("easySetupPIN3").value = "";
@ -707,7 +707,7 @@ var gSyncSetup = {
delete this._jpakeclient;
},
manualSetup: function () {
manualSetup: function() {
this.abortEasySetup();
this.wizard.pageIndex = EXISTING_ACCOUNT_LOGIN_PAGE;
},
@ -715,7 +715,7 @@ var gSyncSetup = {
// _handleNoScript is needed because it blocks the captcha. So we temporarily
// allow the necessary sites so that we can verify the user is in fact a human.
// This was done with the help of Giorgio (NoScript author). See bug 508112.
_handleNoScript: function (addExceptions) {
_handleNoScript: function(addExceptions) {
// if NoScript isn't installed, or is disabled, bail out.
let ns = Cc["@maone.net/noscript-service;1"];
if (ns == null)
@ -739,7 +739,7 @@ var gSyncSetup = {
}
},
onExistingServerCommand: function () {
onExistingServerCommand: function() {
let control = document.getElementById("existingServer");
if (control.selectedIndex == 0) {
control.removeAttribute("editable");
@ -755,16 +755,16 @@ var gSyncSetup = {
this.checkFields();
},
onExistingServerInput: function () {
onExistingServerInput: function() {
// Check custom server validity when the user stops typing for 1 second.
if (this._existingServerTimer)
window.clearTimeout(this._existingServerTimer);
this._existingServerTimer = window.setTimeout(function () {
this._existingServerTimer = window.setTimeout(function() {
gSyncSetup.checkFields();
}, 1000);
},
onServerCommand: function () {
onServerCommand: function() {
setVisibility(document.getElementById("TOSRow"), this._usingMainServers);
let control = document.getElementById("server");
if (!this._usingMainServers) {
@ -788,16 +788,16 @@ var gSyncSetup = {
this.checkFields();
},
onServerInput: function () {
onServerInput: function() {
// Check custom server validity when the user stops typing for 1 second.
if (this._checkServerTimer)
window.clearTimeout(this._checkServerTimer);
this._checkServerTimer = window.setTimeout(function () {
this._checkServerTimer = window.setTimeout(function() {
gSyncSetup.checkServer();
}, 1000);
},
checkServer: function () {
checkServer: function() {
delete this._checkServerTimer;
let el = document.getElementById("server");
let valid = false;
@ -819,7 +819,7 @@ var gSyncSetup = {
this.checkFields();
},
_validateServer: function (element) {
_validateServer: function(element) {
let valid = false;
let val = element.value;
if (!val)
@ -865,7 +865,7 @@ var gSyncSetup = {
return valid;
},
_handleChoice: function () {
_handleChoice: function() {
let desc = document.getElementById("mergeChoiceRadio").selectedIndex;
document.getElementById("chosenActionDeck").selectedIndex = desc;
switch (desc) {
@ -994,7 +994,7 @@ var gSyncSetup = {
// sets class and string on a feedback element
// if no property string is passed in, we clear label/style
_setFeedback: function (element, success, string) {
_setFeedback: function(element, success, string) {
element.hidden = success || !string;
let classname = success ? "success" : "error";
let image = element.getElementsByAttribute("class", "statusIcon")[0];
@ -1004,7 +1004,7 @@ var gSyncSetup = {
},
// shim
_setFeedbackMessage: function (element, success, string) {
_setFeedbackMessage: function(element, success, string) {
let str = "";
if (string) {
try {
@ -1017,7 +1017,7 @@ var gSyncSetup = {
this._setFeedback(element, success, str);
},
loadCaptcha: function () {
loadCaptcha: function() {
let captchaURI = Weave.Service.miscAPI + "captcha_html";
// First check for NoScript and whitelist the right sites.
this._handleNoScript(true);
@ -1043,7 +1043,7 @@ var gSyncSetup = {
onProgressChange: function() {},
onStatusChange: function() {},
onSecurityChange: function() {},
onLocationChange: function () {}
onLocationChange: function() {}
};
// Define lazy getters for various XUL elements.
@ -1056,12 +1056,12 @@ var gSyncSetup = {
"pin2",
"pin3",
"pairDeviceErrorRow",
"pairDeviceThrobber"].forEach(function (id) {
"pairDeviceThrobber"].forEach(function(id) {
XPCOMUtils.defineLazyGetter(gSyncSetup, id, function() {
return document.getElementById(id);
});
});
XPCOMUtils.defineLazyGetter(gSyncSetup, "nextFocusEl", function () {
XPCOMUtils.defineLazyGetter(gSyncSetup, "nextFocusEl", function() {
return {pin1: this.pin2,
pin2: this.pin3,
pin3: this.wizard.getButton("next")};

View file

@ -15,7 +15,7 @@ var gSyncUtils = {
},
// opens in a new window if we're in a modal prefwindow world, in a new tab otherwise
_openLink: function (url) {
_openLink: function(url) {
let thisDocEl = document.documentElement,
openerDocEl = window.opener && window.opener.document.documentElement;
if (thisDocEl.id == "accountSetup" && window.opener &&
@ -30,13 +30,13 @@ var gSyncUtils = {
openUILinkIn(url, "tab");
},
changeName: function (input) {
changeName: function(input) {
// Make sure to update to a modified name, e.g., empty-string -> default
Weave.Service.clientsEngine.localName = input.value;
input.value = Weave.Service.clientsEngine.localName;
},
openChange: function (type, duringSetup) {
openChange: function(type, duringSetup) {
// Just re-show the dialog if it's already open
let openedDialog = Services.wm.getMostRecentWindow("Sync:" + type);
if (openedDialog != null) {
@ -51,34 +51,34 @@ var gSyncUtils = {
type, duringSetup);
},
changePassword: function () {
changePassword: function() {
if (Weave.Utils.ensureMPUnlocked())
this.openChange("ChangePassword");
},
resetPassphrase: function (duringSetup) {
resetPassphrase: function(duringSetup) {
if (Weave.Utils.ensureMPUnlocked())
this.openChange("ResetPassphrase", duringSetup);
},
updatePassphrase: function () {
updatePassphrase: function() {
if (Weave.Utils.ensureMPUnlocked())
this.openChange("UpdatePassphrase");
},
resetPassword: function () {
resetPassword: function() {
this._openLink(Weave.Service.pwResetURL);
},
openToS: function () {
openToS: function() {
this._openLink(Weave.Svc.Prefs.get("termsURL"));
},
openPrivacyPolicy: function () {
openPrivacyPolicy: function() {
this._openLink(Weave.Svc.Prefs.get("privacyURL"));
},
openFirstSyncProgressPage: function () {
openFirstSyncProgressPage: function() {
this._openLink("about:sync-progress");
},
@ -190,7 +190,7 @@ var gSyncUtils = {
*
* returns [valid, errorString]
*/
validatePassword: function (el1, el2) {
validatePassword: function(el1, el2) {
let valid = false;
let val1 = el1.value;
let val2 = el2 ? el2.value : "";