diff --git a/js/app/controllers/bookmarklet.js b/js/app/controllers/bookmarklet.js index 0c2f8f3b..825d041b 100644 --- a/js/app/controllers/bookmarklet.js +++ b/js/app/controllers/bookmarklet.js @@ -89,7 +89,6 @@ $scope.sharing_keys = {}; $scope.newVault = function () { $scope.creating_vault = true; - var _vault = {}; var key_size = 1024; ShareService.generateRSAKeys(key_size).progress(function (progress) { var p = progress > 0 ? 2 : 1; @@ -121,7 +120,7 @@ VaultService.setActiveVault(_vault); try { - var c = EncryptService.decryptString(vault.challenge_password); + EncryptService.decryptString(vault.challenge_password); if ($scope.remember_vault_password) { SettingsService.setSetting('defaultVaultPass', vault_key); } @@ -149,10 +148,10 @@ test_credential.hidden = true; test_credential.vault_id = vault.vault_id; test_credential.password = 'lorum ipsum'; - CredentialService.createCredential(test_credential).then(function (result) { + CredentialService.createCredential(test_credential).then(function () { _vault.public_sharing_key = angular.copy($scope.sharing_keys.public_sharing_key); _vault.private_sharing_key = EncryptService.encryptString(angular.copy($scope.sharing_keys.private_sharing_key)); - VaultService.updateSharingKeys(_vault).then(function (result) { + VaultService.updateSharingKeys(_vault).then(function () { _loginToVault(vault, vault_key); }); }); @@ -351,7 +350,7 @@ if (!$scope.storedCredential.credential_id) { $scope.storedCredential.vault_id = $scope.active_vault.vault_id; - CredentialService.createCredential($scope.storedCredential).then(function (result) { + CredentialService.createCredential($scope.storedCredential).then(function () { NotificationService.showNotification('Credential created!', 5000); }); } diff --git a/js/app/controllers/credential.js b/js/app/controllers/credential.js index 5457d17b..1e3629f7 100644 --- a/js/app/controllers/credential.js +++ b/js/app/controllers/credential.js @@ -138,7 +138,7 @@ crypted_shared_key = private_key.decrypt(forge.util.decode64(crypted_shared_key)); crypted_shared_key = EncryptService.encryptString(crypted_shared_key); - ShareService.saveSharingRequest(share_request, crypted_shared_key).then(function (result) { + ShareService.saveSharingRequest(share_request, crypted_shared_key).then(function () { var idx = $scope.incoming_share_requests.indexOf(share_request); $scope.incoming_share_requests.splice(idx, 1); var active_share_requests = false; @@ -249,7 +249,7 @@ } NotificationService.showNotification('Credential recovered', 5000, function () { - CredentialService.updateCredential(_credential).then(function (result) { + CredentialService.updateCredential(_credential).then(function () { notification = false; }); @@ -259,7 +259,7 @@ $scope.destroyCredential = function (credential) { var _credential = angular.copy(credential); - CredentialService.destroyCredential(_credential.credential_id).then(function (result) { + CredentialService.destroyCredential(_credential.credential_id).then(function () { for (var i = 0; i < $scope.active_vault.credentials.length; i++) { if ($scope.active_vault.credentials[i].credential_id === credential.credential_id) { $scope.active_vault.credentials.splice(i, 1); diff --git a/js/app/controllers/edit_credential.js b/js/app/controllers/edit_credential.js index 18a60da4..e89b5536 100644 --- a/js/app/controllers/edit_credential.js +++ b/js/app/controllers/edit_credential.js @@ -231,7 +231,7 @@ if (!$scope.storedCredential.credential_id) { $scope.storedCredential.vault_id = $scope.active_vault.vault_id; - CredentialService.createCredential($scope.storedCredential).then(function (result) { + CredentialService.createCredential($scope.storedCredential).then(function () { $location.path('/vault/' + $routeParams.vault_id); NotificationService.showNotification('Credential created!', 5000); }); @@ -259,7 +259,7 @@ var _useKey = (key != null); var regex = /(<([^>]+)>)/ig; _credential.description = _credential.description.replace(regex, ""); - CredentialService.updateCredential(_credential, _useKey).then(function (result) { + CredentialService.updateCredential(_credential, _useKey).then(function () { SettingsService.setSetting('edit_credential', null); $location.path('/vault/' + $routeParams.vault_id); NotificationService.showNotification('Credential updated!', 5000); diff --git a/js/app/controllers/import.js b/js/app/controllers/import.js index 59edf5de..7a1a07e5 100644 --- a/js/app/controllers/import.js +++ b/js/app/controllers/import.js @@ -42,9 +42,9 @@ }; $scope.fileLoadError = function (file) { - console.error('Error loading file'); + console.error('Error loading file', file); }; - $scope.fileSelectProgress = function (progress) { + $scope.fileSelectProgress = function () { }; diff --git a/js/app/controllers/public_shared_credential.js b/js/app/controllers/public_shared_credential.js index 20e18afd..68c95146 100644 --- a/js/app/controllers/public_shared_credential.js +++ b/js/app/controllers/public_shared_credential.js @@ -31,7 +31,6 @@ $scope.downloadFile = function (credential, file) { ShareService.downloadSharedFile(credential, file).then(function (result) { - var key = null; if (!result.hasOwnProperty('file_data')) { NotificationService.showNotification('Error downloading file, you probably don\'t have enough permissions', 5000); return; diff --git a/js/app/controllers/revision.js b/js/app/controllers/revision.js index 78c601df..1d3ceafb 100644 --- a/js/app/controllers/revision.js +++ b/js/app/controllers/revision.js @@ -111,7 +111,7 @@ //Used in activity _credential.revision_created = $filter('date')(_revision.created * 1000, "dd-MM-yyyy @ HH:mm:ss"); - CredentialService.updateCredential(_credential, (key)).then(function (result) { + CredentialService.updateCredential(_credential, (key)).then(function () { SettingsService.setSetting('revision_credential', null); $rootScope.$emit('app_menu', false); $location.path('/vault/' + $routeParams.vault_id); diff --git a/js/app/controllers/share.js b/js/app/controllers/share.js index e4cb51a3..00454b16 100644 --- a/js/app/controllers/share.js +++ b/js/app/controllers/share.js @@ -10,8 +10,8 @@ * This file is part of passman, licensed under AGPLv3 */ angular.module('passmanApp') - .controller('ShareCtrl', ['$scope', 'VaultService', 'CredentialService', 'SettingsService', '$location', '$routeParams', 'ShareService', 'NotificationService', 'SharingACL', 'EncryptService', 'FileService', - function ($scope, VaultService, CredentialService, SettingsService, $location, $routeParams, ShareService, NotificationService, SharingACL, EncryptService, FileService) { + .controller('ShareCtrl', ['$scope', 'VaultService', 'CredentialService', 'SettingsService', '$location', '$routeParams', 'ShareService', 'NotificationService', 'SharingACL', 'EncryptService', + function ($scope, VaultService, CredentialService, SettingsService, $location, $routeParams, ShareService, NotificationService, SharingACL, EncryptService) { $scope.active_vault = VaultService.getActiveVault(); $scope.tabs = [{ @@ -144,7 +144,6 @@ }); $scope.inputSharedWith = []; - $scope.selectedAccessLevel = '1'; $scope.searchUsers = function ($query) { return ShareService.search($query); @@ -157,7 +156,7 @@ $scope.setPermission = function (acl, permission) { acl.togglePermission(permission); }; - $scope.shareWith = function (shareWith, selectedAccessLevel) { + $scope.shareWith = function (shareWith) { $scope.inputSharedWith = []; if (shareWith.length > 0) { for (var i = 0; i < shareWith.length; i++) { @@ -203,7 +202,7 @@ _credential = CredentialService.encryptCredential(_credential, old_key); CredentialService.updateCredential(_credential, true).then(function () { NotificationService.showNotification('Credential unshared', 4000); - CredentialService.reencryptCredential(_credential.guid, old_key, new_key).then(function (data) { + CredentialService.reencryptCredential(_credential.guid, old_key, new_key).then(function () { getAcl(); }); }); @@ -292,7 +291,7 @@ var encryptedSharedCredential = angular.copy($scope.storedCredential); var old_key = VaultService.getActiveVault().vaultKey; - CredentialService.reencryptCredential(encryptedSharedCredential.guid, old_key, key).progress(function (data) { + CredentialService.reencryptCredential(encryptedSharedCredential.guid, old_key, key).progress(function () { }).then(function (data) { var _credential = data.cryptogram; _credential.set_share_key = true; @@ -336,7 +335,7 @@ user.accessLevel = angular.copy(user.acl.getAccessLevel()); ShareService.shareWithUser(storedCredential, user) - .then(function (data) { + .then(function () { $scope.share_settings.upload_progress.done++; $scope.share_settings.upload_progress.percent = $scope.share_settings.upload_progress.done / $scope.share_settings.upload_progress.total * 100; }); diff --git a/js/app/controllers/share_settings.js b/js/app/controllers/share_settings.js index aa07ccec..71b7eada 100644 --- a/js/app/controllers/share_settings.js +++ b/js/app/controllers/share_settings.js @@ -54,7 +54,7 @@ $scope.active_vault.private_sharing_key = EncryptService.encryptString(pem.privateKey); $scope.active_vault.public_sharing_key = pem.publicKey; - VaultService.updateSharingKeys($scope.active_vault).then(function (result) { + VaultService.updateSharingKeys($scope.active_vault).then(function () { $scope.sharing_keys = ShareService.getSharingKeys(); }); }); diff --git a/js/app/controllers/vault.js b/js/app/controllers/vault.js index beb9f545..d179851c 100644 --- a/js/app/controllers/vault.js +++ b/js/app/controllers/vault.js @@ -71,7 +71,6 @@ $scope.sharing_keys = {}; $scope.newVault = function () { $scope.creating_vault = true; - var _vault = {}; var key_size = 1024; ShareService.generateRSAKeys(key_size).progress(function (progress) { var p = progress > 0 ? 2 : 1; @@ -103,7 +102,7 @@ VaultService.setActiveVault(_vault); try { - var c = EncryptService.decryptString(vault.challenge_password); + EncryptService.decryptString(vault.challenge_password); if ($scope.remember_vault_password) { SettingsService.setSetting('defaultVaultPass', vault_key); } @@ -133,10 +132,10 @@ test_credential.hidden = true; test_credential.vault_id = vault.vault_id; test_credential.password = 'lorum ipsum'; - CredentialService.createCredential(test_credential).then(function (result) { + CredentialService.createCredential(test_credential).then(function () { _vault.public_sharing_key = angular.copy($scope.sharing_keys.public_sharing_key); _vault.private_sharing_key = EncryptService.encryptString(angular.copy($scope.sharing_keys.private_sharing_key)); - VaultService.updateSharingKeys(_vault).then(function (result) { + VaultService.updateSharingKeys(_vault).then(function () { _loginToVault(vault, vault_key); }); }); diff --git a/js/app/directives/autoscroll.js b/js/app/directives/autoscroll.js index b30fd2ef..6f03b701 100644 --- a/js/app/directives/autoscroll.js +++ b/js/app/directives/autoscroll.js @@ -13,7 +13,7 @@ scope: { autoScroll: '=' }, - link: function postLink (scope, element, attrs) { + link: function postLink (scope) { scope.$watch('autoScroll', function () { $('#import_log').scrollTop($('#import_log')[0].scrollHeight); }, true); diff --git a/js/app/directives/clickselect.js b/js/app/directives/clickselect.js index 86220e00..dbd014e8 100644 --- a/js/app/directives/clickselect.js +++ b/js/app/directives/clickselect.js @@ -10,7 +10,7 @@ .directive('selectOnClick', ['$window', function ($window) { return { restrict: 'A', - link: function (scope, element, attrs) { + link: function (scope, element) { element.on('click', function () { if (!$window.getSelection().toString()) { // Required for mobile Safari diff --git a/js/app/directives/colorfromstring.js b/js/app/directives/colorfromstring.js index 62127749..ec9314f1 100644 --- a/js/app/directives/colorfromstring.js +++ b/js/app/directives/colorfromstring.js @@ -7,13 +7,13 @@ * # passwordGen */ angular.module('passmanApp') - .directive('colorFromString', ['$window', function ($window) { + .directive('colorFromString', [function () { return { restrict: 'A', scope:{ string: '=colorFromString' }, - link: function (scope, el, attr, ctrl) { + link: function (scope, el) { function genColor(str) { // java String#hashCode var hash = 0; for (var i = 0; i < str.length; i++) { diff --git a/js/app/directives/credentialfield.js b/js/app/directives/credentialfield.js index 0d040aa7..4725beae 100644 --- a/js/app/directives/credentialfield.js +++ b/js/app/directives/credentialfield.js @@ -27,7 +27,7 @@ '
' + '