1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-07 09:31:31 +01:00

lint fixes

This commit is contained in:
Kyle Spearrin 2017-10-06 10:36:45 -04:00
parent 7394cec986
commit 79f20f09cb
8 changed files with 20 additions and 17 deletions

View File

@ -631,6 +631,8 @@ var bg_isBackground = true,
var tabDomain = bg_utilsService.getDomain(tab.url); var tabDomain = bg_utilsService.getDomain(tab.url);
if (tabDomain && tabDomain === loginToAdd.domain) { if (tabDomain && tabDomain === loginToAdd.domain) {
bg_loginsToAdd.splice(i, 1); bg_loginsToAdd.splice(i, 1);
/* jshint ignore:start */
bg_loginService.encrypt({ bg_loginService.encrypt({
id: null, id: null,
folderId: null, folderId: null,
@ -649,6 +651,8 @@ var bg_isBackground = true,
}); });
}); });
}); });
/* jshint ignore:end */
messageTab(tab.id, 'closeNotificationBar'); messageTab(tab.id, 'closeNotificationBar');
} }
} }
@ -671,11 +675,8 @@ var bg_isBackground = true,
} }
} }
function checkbg_loginsToAdd(tab, callback) { function checkbg_loginsToAdd(tab) {
if (!bg_loginsToAdd.length) { if (!bg_loginsToAdd.length) {
if (callback) {
callback();
}
return; return;
} }
@ -693,17 +694,11 @@ var bg_isBackground = true,
function check() { function check() {
if (!tab) { if (!tab) {
if (callback) {
callback();
}
return; return;
} }
var tabDomain = bg_utilsService.getDomain(tab.url); var tabDomain = bg_utilsService.getDomain(tab.url);
if (!tabDomain) { if (!tabDomain) {
if (callback) {
callback();
}
return; return;
} }
@ -711,11 +706,7 @@ var bg_isBackground = true,
if (bg_loginsToAdd[i].tabId === tab.id && bg_loginsToAdd[i].domain === tabDomain) { if (bg_loginsToAdd[i].tabId === tab.id && bg_loginsToAdd[i].domain === tabDomain) {
messageTab(tab.id, 'openNotificationBar', { messageTab(tab.id, 'openNotificationBar', {
type: 'add' type: 'add'
}, function () { }, function () { });
if (callback) {
callback();
}
});
break; break;
} }
} }

View File

@ -41,7 +41,7 @@
if (paramIndex > -1) { if (paramIndex > -1) {
pagePath = pagePath.substring(0, paramIndex); pagePath = pagePath.substring(0, paramIndex);
} }
return encodeURIComponent(pagePath) return encodeURIComponent(pagePath);
} }
bgPage.bg_appIdService.getAnonymousAppId(function (gaAnonAppId) { bgPage.bg_appIdService.getAnonymousAppId(function (gaAnonAppId) {

View File

@ -11,7 +11,9 @@
var thisU2f = null; var thisU2f = null;
U2f.prototype.init = function (data) { U2f.prototype.init = function (data) {
/* jshint ignore:start */
var self = thisU2f = this; var self = thisU2f = this;
/* jshint ignore:end */
self.connectorLink.href = self.webVaultUrl + '/u2f-connector.html' + self.connectorLink.href = self.webVaultUrl + '/u2f-connector.html' +
'?data=' + this.base64Encode(JSON.stringify(data)) + '?data=' + this.base64Encode(JSON.stringify(data)) +

View File

@ -240,13 +240,17 @@ function initAutofill() {
totpPromise = self.totpService.isAutoCopyEnabled().then(function (enabled) { totpPromise = self.totpService.isAutoCopyEnabled().then(function (enabled) {
if (enabled) { if (enabled) {
/* jshint ignore:start */
return self.totpService.getCode(login.totp); return self.totpService.getCode(login.totp);
/* jshint ignore:end */
} }
return null; return null;
}).then(function (code) { }).then(function (code) {
if (code) { if (code) {
/* jshint ignore:start */
self.utilsService.copyToClipboard(code); self.utilsService.copyToClipboard(code);
/* jshint ignore:end */
} }
return code; return code;

View File

@ -220,6 +220,7 @@ function initCryptoService(constantsService) {
var decPromises = []; var decPromises = [];
for (var orgId in obj.encOrgKeys) { for (var orgId in obj.encOrgKeys) {
if (obj.encOrgKeys.hasOwnProperty(orgId)) { if (obj.encOrgKeys.hasOwnProperty(orgId)) {
/* jshint ignore:start */
(function (orgIdInstance) { (function (orgIdInstance) {
var promise = self.rsaDecrypt(obj.encOrgKeys[orgIdInstance]).then(function (decValueB64) { var promise = self.rsaDecrypt(obj.encOrgKeys[orgIdInstance]).then(function (decValueB64) {
orgKeys[orgIdInstance] = new SymmetricCryptoKey(decValueB64, true); orgKeys[orgIdInstance] = new SymmetricCryptoKey(decValueB64, true);
@ -229,6 +230,7 @@ function initCryptoService(constantsService) {
}); });
decPromises.push(promise); decPromises.push(promise);
})(orgId); })(orgId);
/* jshint ignore:end */
} }
} }

View File

@ -87,9 +87,11 @@ function initFolderService() {
}]; }];
self.getAll(function (folders) { self.getAll(function (folders) {
for (var i = 0; i < folders.length; i++) { for (var i = 0; i < folders.length; i++) {
/* jshint ignore:start */
promises.push(folders[i].decrypt().then(function (folder) { promises.push(folders[i].decrypt().then(function (folder) {
decFolders.push(folder); decFolders.push(folder);
})); }));
/* jshint ignore:end */
} }
Q.all(promises).then(function () { Q.all(promises).then(function () {

View File

@ -144,5 +144,5 @@ function initLockService(self) {
} }
return null; return null;
}; }
} }

View File

@ -172,9 +172,11 @@ function initLoginService() {
var decLogins = []; var decLogins = [];
self.getAll(function (logins) { self.getAll(function (logins) {
for (var i = 0; i < logins.length; i++) { for (var i = 0; i < logins.length; i++) {
/* jshint ignore:start */
promises.push(logins[i].decrypt().then(function (login) { promises.push(logins[i].decrypt().then(function (login) {
decLogins.push(login); decLogins.push(login);
})); }));
/* jshint ignore:end */
} }
Q.all(promises).then(function () { Q.all(promises).then(function () {