diff options
author | brantje <brantje@gmail.com> | 2016-10-09 16:58:53 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2016-10-09 17:35:05 +0300 |
commit | d4ffb6d7ab5d196408516aa5f9b5b1d608b3247d (patch) | |
tree | 677c4f8e0bdaeecb2bc10c98fb6dcf34edfe3d78 /js | |
parent | ad7bcf04e310034bcdd6f16d9e0213a251a78ff3 (diff) |
Remove console.logs
Better to log a warning, remove unused parameters
Add missing semicolon
Diffstat (limited to 'js')
-rw-r--r-- | js/app/controllers/bookmarklet.js | 4 | ||||
-rw-r--r-- | js/app/controllers/credential.js | 4 | ||||
-rw-r--r-- | js/app/controllers/edit_credential.js | 6 | ||||
-rw-r--r-- | js/app/controllers/settings.js | 2 | ||||
-rw-r--r-- | js/app/controllers/share.js | 20 | ||||
-rw-r--r-- | js/app/controllers/share_settings.js | 1 | ||||
-rw-r--r-- | js/app/services/credentialservice.js | 3 | ||||
-rw-r--r-- | js/app/services/shareservice.js | 4 |
8 files changed, 13 insertions, 31 deletions
diff --git a/js/app/controllers/bookmarklet.js b/js/app/controllers/bookmarklet.js index 3e41c275..0c2f8f3b 100644 --- a/js/app/controllers/bookmarklet.js +++ b/js/app/controllers/bookmarklet.js @@ -305,8 +305,8 @@ $scope.$digest(); }; - $scope.fileLoadError = function (error, file) { - console.log(error, file); + $scope.fileLoadError = function (error) { + console.log('Error loading file', error); }; $scope.selected_file = ''; diff --git a/js/app/controllers/credential.js b/js/app/controllers/credential.js index 7e0f9acb..4c885576 100644 --- a/js/app/controllers/credential.js +++ b/js/app/controllers/credential.js @@ -64,7 +64,6 @@ } ShareService.getCredendialsSharedWithUs(vault.guid).then(function (shared_credentials) { - console.log('Shared credentials', shared_credentials); for (var c = 0; c < shared_credentials.length; c++) { var _shared_credential = shared_credentials[c]; var decrypted_key = EncryptService.decryptString(_shared_credential.shared_key); @@ -132,7 +131,6 @@ }; $scope.acceptShareRequest = function (share_request) { - console.log('Accepted share request', share_request); var crypted_shared_key = share_request.shared_key; var private_key = EncryptService.decryptString(VaultService.getActiveVault().private_sharing_key); @@ -356,7 +354,6 @@ }; $rootScope.$on('logout', function () { - console.log('Logout received, clean up'); $scope.active_vault = null; $scope.credentials = []; // $scope.$parent.selectedVault = false; @@ -365,7 +362,6 @@ $scope.downloadFile = function (credential, file) { - console.log(credential, file); var callback = function (result) { var key = null; if (!result.hasOwnProperty('file_data')) { diff --git a/js/app/controllers/edit_credential.js b/js/app/controllers/edit_credential.js index 66c32389..d96894df 100644 --- a/js/app/controllers/edit_credential.js +++ b/js/app/controllers/edit_credential.js @@ -178,8 +178,8 @@ $scope.$digest(); }; - $scope.fileLoadError = function (error, file) { - console.log(error, file); + $scope.fileLoadError = function (error) { + console.log('Error loading file', error); }; $scope.selected_file = ''; @@ -228,7 +228,7 @@ //@TODO validation //@TODO When credential is expired and has renew interval set, calc new expire time. delete $scope.storedCredential.password_repeat; - console.log($scope.storedCredential); + if (!$scope.storedCredential.credential_id) { $scope.storedCredential.vault_id = $scope.active_vault.vault_id; CredentialService.createCredential($scope.storedCredential).then(function (result) { diff --git a/js/app/controllers/settings.js b/js/app/controllers/settings.js index fe150202..043ee713 100644 --- a/js/app/controllers/settings.js +++ b/js/app/controllers/settings.js @@ -199,8 +199,6 @@ if (index < _selected_credentials.length - 1) { changeCredential(index + 1, oldVaultPass, newVaultPass); } else { - console.log('Update complete!'); - vault.private_sharing_key = EncryptService.decryptString(angular.copy(vault.private_sharing_key), oldVaultPass); vault.private_sharing_key = EncryptService.encryptString(vault.private_sharing_key, newVaultPass); VaultService.updateSharingKeys(vault).then(function (result) { diff --git a/js/app/controllers/share.js b/js/app/controllers/share.js index 8e65c77e..e4cb51a3 100644 --- a/js/app/controllers/share.js +++ b/js/app/controllers/share.js @@ -138,8 +138,7 @@ $scope.$watch('share_settings.upload_progress.done', function () { - console.log(); - if ($scope.share_settings.upload_progress.done === $scope.share_settings.upload_progress.total && $scope.share_settings.upload_progress.total > 0) { + if ($scope.share_settings.upload_progress.done === $scope.share_settings.upload_progress.total && $scope.share_settings.upload_progress.total > 0) { getAcl(); } }); @@ -204,9 +203,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).progress(function (data) { - console.log(data); - }).then(function (data) { + CredentialService.reencryptCredential(_credential.guid, old_key, new_key).then(function (data) { getAcl(); }); }); @@ -224,14 +221,13 @@ user.vaults = data; var start = new Date().getTime() / 1000; ShareService.cypherRSAStringWithPublicKeyBulkAsync(user.vaults, enc_key) - .progress(function (data) { + .progress(function () { $scope.share_settings.cypher_progress.done++; $scope.share_settings.cypher_progress.percent = $scope.share_settings.cypher_progress.done / $scope.share_settings.cypher_progress.total * 100; $scope.$digest(); }) .then(function (result) { - console.log("Took: " + ((new Date().getTime() / 1000) - start) + "s to cypher the string for user [" + data[0].user_id + "]"); - $scope.share_settings.cypher_progress.times.push({ + $scope.share_settings.cypher_progress.times.push({ time: ((new Date().getTime() / 1000) - start), user: data[0].user_id }); @@ -257,8 +253,7 @@ $scope.share_settings.upload_progress.total = 0; //Credential is already shared if ($scope.storedCredential.shared_key && $scope.storedCredential.shared_key !== '' && $scope.storedCredential.shared_key !== null) { - console.log('Shared key found'); - var enc_key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key)); + var enc_key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key)); if ($scope.share_settings.linkSharing.enabled) { var expire_time = new Date(angular.copy($scope.share_settings.linkSharing.settings.expire_time)).getTime() / 1000; var shareObj = { @@ -298,10 +293,7 @@ var old_key = VaultService.getActiveVault().vaultKey; CredentialService.reencryptCredential(encryptedSharedCredential.guid, old_key, key).progress(function (data) { - console.log(data); - }).then(function (data) { - console.log(data); - //This is here is not called + }).then(function (data) { var _credential = data.cryptogram; _credential.set_share_key = true; _credential.skip_revision = true; diff --git a/js/app/controllers/share_settings.js b/js/app/controllers/share_settings.js index cfeda758..aa07ccec 100644 --- a/js/app/controllers/share_settings.js +++ b/js/app/controllers/share_settings.js @@ -47,7 +47,6 @@ $scope.progress = progress > 0 ? 2 : 1; $scope.$digest(); }).then(function (kp) { - console.log('stuff done'); $scope.generating = false; var pem = ShareService.rsaKeyPairToPEM(kp); diff --git a/js/app/services/credentialservice.js b/js/app/services/credentialservice.js index 1cefb7a4..517b5162 100644 --- a/js/app/services/credentialservice.js +++ b/js/app/services/credentialservice.js @@ -116,13 +116,12 @@ try { field_decrypted_value = EncryptService.decryptString(fieldValue, key); } catch (e) { - console.log(e); throw e; } try { credential[field] = JSON.parse(field_decrypted_value); } catch (e) { - console.log('Field' + field + ' in ' + credential.label + ' could not be parsed! Value:' + fieldValue); + console.warn('Field' + field + ' in ' + credential.label + ' could not be parsed! Value:' + fieldValue); } diff --git a/js/app/services/shareservice.js b/js/app/services/shareservice.js index e48a652d..268ef34a 100644 --- a/js/app/services/shareservice.js +++ b/js/app/services/shareservice.js @@ -165,13 +165,12 @@ try { field_decrypted_value = EncryptService.decryptString(fieldValue, sharedKey); } catch (e) { - console.log(e); throw e; } try { _credential[field] = JSON.parse(field_decrypted_value); } catch (e) { - console.log('Field' + field + ' in ' + _credential.label + ' could not be parsed! Value:' + fieldValue); + console.warn('Field' + field + ' in ' + _credential.label + ' could not be parsed! Value:' + fieldValue); throw e; } } @@ -185,7 +184,6 @@ var step = function () { // run for 100 ms if (!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) { - // console.log(state); if (state.p !== null) { // progress(50); this.call_progress(50); |