1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-30 13:03:53 +01:00

lint fixes

This commit is contained in:
Kyle Spearrin 2017-07-14 14:32:01 -04:00
parent 0242de9145
commit 715835c12f
7 changed files with 15 additions and 14 deletions

View File

@ -61,7 +61,7 @@ angular
$httpProvider.defaults.headers.get = {}; $httpProvider.defaults.headers.get = {};
} }
$httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache'; $httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache';
$httpProvider.defaults.headers.get['Pragma'] = 'no-cache'; $httpProvider.defaults.headers.get.Pragma = 'no-cache';
} }
$httpProvider.interceptors.push('apiInterceptor'); $httpProvider.interceptors.push('apiInterceptor');

View File

@ -43,7 +43,7 @@ angular
bytes[i / 2] = parseInt(s.substr(i, 2), 16); bytes[i / 2] = parseInt(s.substr(i, 2), 16);
} }
return bytes; return bytes;
} };
var buff2hex = function (buff) { var buff2hex = function (buff) {
var bytes = new Uint8Array(buff); var bytes = new Uint8Array(buff);
@ -53,12 +53,13 @@ angular
hex.push((bytes[i] & 0xF).toString(16)); hex.push((bytes[i] & 0xF).toString(16));
} }
return hex.join(''); return hex.join('');
} };
var b32tohex = function (s) { var b32tohex = function (s) {
s = s.toUpperCase(); s = s.toUpperCase();
var cleanedInput = ''; var cleanedInput = '';
for (var i = 0; i < s.length; i++) { var i;
for (i = 0; i < s.length; i++) {
if (b32Chars.indexOf(s[i]) < 0) { if (b32Chars.indexOf(s[i]) < 0) {
continue; continue;
} }
@ -69,14 +70,14 @@ angular
var bits = ''; var bits = '';
var hex = ''; var hex = '';
for (var i = 0; i < s.length; i++) { for (i = 0; i < s.length; i++) {
var byteIndex = b32Chars.indexOf(s.charAt(i)); var byteIndex = b32Chars.indexOf(s.charAt(i));
if (byteIndex < 0) { if (byteIndex < 0) {
continue; continue;
} }
bits += leftpad(byteIndex.toString(2), 5, '0'); bits += leftpad(byteIndex.toString(2), 5, '0');
} }
for (var i = 0; i + 4 <= bits.length; i += 4) { for (i = 0; i + 4 <= bits.length; i += 4) {
var chunk = bits.substr(i, 4); var chunk = bits.substr(i, 4);
hex = hex + parseInt(chunk, 2).toString(16); hex = hex + parseInt(chunk, 2).toString(16);
} }
@ -121,7 +122,7 @@ angular
return otp; return otp;
}); });
}; };
} };
var totp = new Totp(); var totp = new Totp();
@ -151,7 +152,7 @@ angular
scope.sec = sec; scope.sec = sec;
scope.dash = (2.62 * mod).toFixed(2); scope.dash = (2.62 * mod).toFixed(2);
scope.low = sec <= 7; scope.low = sec <= 7;
if (mod == 0) { if (mod === 0) {
updateCode(scope); updateCode(scope);
} }
}); });

View File

@ -6,7 +6,7 @@ angular
$analytics.eventTrack('paidOrgRequiredController', { category: 'Modal' }); $analytics.eventTrack('paidOrgRequiredController', { category: 'Modal' });
authService.getUserProfile().then(function (profile) { authService.getUserProfile().then(function (profile) {
$scope.admin = profile.organizations[orgId].type !== constants.orgUserType.user $scope.admin = profile.organizations[orgId].type !== constants.orgUserType.user;
}); });
$scope.go = function () { $scope.go = function () {

View File

@ -41,7 +41,7 @@
validationService.addError(form, 'file', 'Something went wrong.', true); validationService.addError(form, 'file', 'Something went wrong.', true);
} }
}); });
} };
$scope.download = function (attachment) { $scope.download = function (attachment) {
attachment.loading = true; attachment.loading = true;

View File

@ -351,7 +351,7 @@ angular
var cipherString = iv + '|' + ct; var cipherString = iv + '|' + ct;
if (encValue.mac) { if (encValue.mac) {
var mac = forge.util.encode64(encValue.mac) var mac = forge.util.encode64(encValue.mac);
cipherString = cipherString + '|' + mac; cipherString = cipherString + '|' + mac;
} }
@ -362,7 +362,7 @@ angular
return aesEncryptWC(plainValue, key).then(function (encValue) { return aesEncryptWC(plainValue, key).then(function (encValue) {
var macLen = 0; var macLen = 0;
if (encValue.mac) { if (encValue.mac) {
macLen = encValue.mac.length macLen = encValue.mac.length;
} }
var encBytes = new Uint8Array(1 + encValue.iv.length + macLen + encValue.ct.length); var encBytes = new Uint8Array(1 + encValue.iv.length + macLen + encValue.ct.length);

View File

@ -2504,7 +2504,7 @@
if (item.attributes.hasOwnProperty(attr) && attr !== 'username_value' && if (item.attributes.hasOwnProperty(attr) && attr !== 'username_value' &&
attr !== 'xdg:schema') { attr !== 'xdg:schema') {
if (login.notes !== '') { if (login.notes !== '') {
login.notes += '\n' login.notes += '\n';
} }
login.notes += (attr + ': ' + item.attributes[attr]); login.notes += (attr + ': ' + item.attributes[attr]);
} }

View File

@ -47,7 +47,7 @@
validationService.addError(form, 'file', 'Something went wrong.', true); validationService.addError(form, 'file', 'Something went wrong.', true);
} }
}); });
} };
$scope.download = function (attachment) { $scope.download = function (attachment) {
attachment.loading = true; attachment.loading = true;