+
{{i18n.autoFillInfo}}
-
+
diff --git a/src/popup/app/vault/vaultAddLoginController.js b/src/popup/app/vault/vaultAddCipherController.js
similarity index 72%
rename from src/popup/app/vault/vaultAddLoginController.js
rename to src/popup/app/vault/vaultAddCipherController.js
index e239fe0bab..32fc95fb61 100644
--- a/src/popup/app/vault/vaultAddLoginController.js
+++ b/src/popup/app/vault/vaultAddCipherController.js
@@ -1,7 +1,7 @@
angular
.module('bit.vault')
- .controller('vaultAddLoginController', function ($scope, $state, $stateParams, loginService, folderService,
+ .controller('vaultAddCipherController', function ($scope, $state, $stateParams, loginService, folderService,
cryptoService, $q, toastr, utilsService, $analytics, i18nService, constantsService) {
$scope.i18n = i18nService;
$scope.constants = constantsService;
@@ -9,17 +9,17 @@
var from = $stateParams.from,
folderId = $stateParams.folderId;
- $scope.login = {
+ $scope.cipher = {
folderId: folderId,
name: $stateParams.name,
uri: $stateParams.uri
};
- if ($stateParams.login) {
- angular.extend($scope.login, $stateParams.login);
+ if ($stateParams.cipher) {
+ angular.extend($scope.cipher, $stateParams.cipher);
}
- if (!$stateParams.login && $scope.login.name && $scope.login.uri) {
+ if (!$stateParams.cipher && $scope.cipher.name && $scope.cipher.uri) {
$('#username').focus();
}
else {
@@ -38,10 +38,10 @@
return;
}
- $scope.savePromise = $q.when(loginService.encrypt(model)).then(function (loginModel) {
- var login = new Login(loginModel, true);
- return $q.when(loginService.saveWithServer(login)).then(function (login) {
- $analytics.eventTrack('Added Login');
+ $scope.savePromise = loginService.encrypt(model).then(function (cipherModel) {
+ var cipher = new Cipher(cipherModel, true);
+ return loginService.saveWithServer(cipher).then(function (c) {
+ $analytics.eventTrack('Added Cipher');
toastr.success(i18nService.addedLogin);
$scope.close();
});
@@ -68,11 +68,11 @@
};
$scope.addField = function (type) {
- if (!$scope.login.fields) {
- $scope.login.fields = [];
+ if (!$scope.cipher.fields) {
+ $scope.cipher.fields = [];
}
- $scope.login.fields.push({
+ $scope.cipher.fields.push({
type: parseInt(type),
name: null,
value: null
@@ -80,9 +80,9 @@
};
$scope.removeField = function (field) {
- var index = $scope.login.fields.indexOf(field);
+ var index = $scope.cipher.fields.indexOf(field);
if (index > -1) {
- $scope.login.fields.splice(index, 1);
+ $scope.cipher.fields.splice(index, 1);
}
};
@@ -92,7 +92,7 @@
animation: 'in-slide-up',
addState: {
from: from,
- login: $scope.login
+ cipher: $scope.cipher
}
});
};
diff --git a/src/popup/app/vault/vaultController.js b/src/popup/app/vault/vaultController.js
index ea5a7b3a7b..bbc63d5ca8 100644
--- a/src/popup/app/vault/vaultController.js
+++ b/src/popup/app/vault/vaultController.js
@@ -118,7 +118,7 @@
$scope.addCipher = function () {
storeState();
- $state.go('addLogin', {
+ $state.go('addCipher', {
animation: 'in-slide-up',
from: 'vault'
});
@@ -141,8 +141,8 @@
}
storeState();
- $state.go('viewLogin', {
- loginId: cipher.id,
+ $state.go('viewCipher', {
+ cipherId: cipher.id,
animation: 'in-slide-up',
from: 'vault'
});
diff --git a/src/popup/app/vault/vaultEditLoginController.js b/src/popup/app/vault/vaultEditCipherController.js
similarity index 74%
rename from src/popup/app/vault/vaultEditLoginController.js
rename to src/popup/app/vault/vaultEditCipherController.js
index 18d143a548..1d6607fa7d 100644
--- a/src/popup/app/vault/vaultEditLoginController.js
+++ b/src/popup/app/vault/vaultEditCipherController.js
@@ -1,30 +1,30 @@
angular
.module('bit.vault')
- .controller('vaultEditLoginController', function ($scope, $state, $stateParams, loginService, folderService,
+ .controller('vaultEditCipherController', function ($scope, $state, $stateParams, loginService, folderService,
cryptoService, toastr, SweetAlert, utilsService, $analytics, i18nService, constantsService) {
$scope.i18n = i18nService;
$scope.constants = constantsService;
$scope.showAttachments = !utilsService.isEdge();
$scope.addFieldType = constantsService.fieldType.text.toString();
- var loginId = $stateParams.loginId;
+ var cipherId = $stateParams.cipherId;
var fromView = $stateParams.fromView;
var from = $stateParams.from;
- $scope.login = {
+ $scope.cipher = {
folderId: null
};
$('#name').focus();
- if ($stateParams.login) {
- angular.extend($scope.login, $stateParams.login);
+ if ($stateParams.cipher) {
+ angular.extend($scope.cipher, $stateParams.cipher);
}
else {
- loginService.get(loginId).then(function (login) {
- return login.decrypt();
+ loginService.get(cipherId).then(function (cipher) {
+ return cipher.decrypt();
}).then(function (model) {
- $scope.login = model;
+ $scope.cipher = model;
});
}
@@ -41,10 +41,10 @@ angular
return;
}
- $scope.savePromise = loginService.encrypt(model).then(function (loginModel) {
- var login = new Login(loginModel, true);
- return loginService.saveWithServer(login).then(function (login) {
- $analytics.eventTrack('Edited Login');
+ $scope.savePromise = loginService.encrypt(model).then(function (cipherModel) {
+ var cipher = new Cipher(cipherModel, true);
+ return loginService.saveWithServer(cipher).then(function (c) {
+ $analytics.eventTrack('Edited Cipher');
toastr.success(i18nService.editedLogin);
$scope.close();
});
@@ -60,8 +60,8 @@ angular
cancelButtonText: i18nService.no
}, function (confirmed) {
if (confirmed) {
- loginService.deleteWithServer(loginId).then(function () {
- $analytics.eventTrack('Deleted Login');
+ loginService.deleteWithServer(cipherId).then(function () {
+ $analytics.eventTrack('Deleted Cipher');
toastr.success(i18nService.deletedLogin);
$state.go('tabs.vault', {
animation: 'out-slide-down'
@@ -73,7 +73,7 @@ angular
$scope.attachments = function () {
$state.go('attachments', {
- id: loginId,
+ id: cipherId,
animation: 'in-slide-up',
from: from,
fromView: fromView
@@ -82,8 +82,8 @@ angular
$scope.close = function () {
if (fromView) {
- $state.go('viewLogin', {
- loginId: loginId,
+ $state.go('viewCipher', {
+ cipherId: cipherId,
animation: 'out-slide-down',
from: from
});
@@ -96,11 +96,11 @@ angular
};
$scope.addField = function (type) {
- if (!$scope.login.fields) {
- $scope.login.fields = [];
+ if (!$scope.cipher.fields) {
+ $scope.cipher.fields = [];
}
- $scope.login.fields.push({
+ $scope.cipher.fields.push({
type: parseInt(type),
name: null,
value: null
@@ -108,14 +108,14 @@ angular
};
$scope.removeField = function (field) {
- var index = $scope.login.fields.indexOf(field);
+ var index = $scope.cipher.fields.indexOf(field);
if (index > -1) {
- $scope.login.fields.splice(index, 1);
+ $scope.cipher.fields.splice(index, 1);
}
};
$scope.generatePassword = function () {
- if ($scope.login.password) {
+ if ($scope.cipher.password) {
SweetAlert.swal({
title: i18nService.overwritePassword,
text: i18nService.overwritePasswordConfirmation,
@@ -140,8 +140,8 @@ angular
animation: 'in-slide-up',
editState: {
fromView: fromView,
- loginId: loginId,
- login: $scope.login,
+ cipherId: cipherId,
+ cipher: $scope.cipher,
from: from
}
});
diff --git a/src/popup/app/vault/vaultViewLoginController.js b/src/popup/app/vault/vaultViewCipherController.js
similarity index 83%
rename from src/popup/app/vault/vaultViewLoginController.js
rename to src/popup/app/vault/vaultViewCipherController.js
index 2155126861..83bf22003f 100644
--- a/src/popup/app/vault/vaultViewLoginController.js
+++ b/src/popup/app/vault/vaultViewCipherController.js
@@ -1,7 +1,7 @@
angular
.module('bit.vault')
- .controller('vaultViewLoginController', function ($scope, $state, $stateParams, loginService, toastr,
+ .controller('vaultViewCipherController', function ($scope, $state, $stateParams, loginService, toastr,
$analytics, i18nService, utilsService, totpService, $timeout, tokenService, $window, cryptoService, SweetAlert,
constantsService) {
$scope.constants = constantsService;
@@ -11,35 +11,35 @@ angular
totpInterval = null;
$scope.isPremium = tokenService.getPremium();
- $scope.login = null;
- loginService.get($stateParams.loginId).then(function (login) {
- if (!login) {
+ $scope.cipher = null;
+ loginService.get($stateParams.cipherId).then(function (cipher) {
+ if (!cipher) {
return;
}
- return login.decrypt();
+ return cipher.decrypt();
}).then(function (model) {
- $scope.login = model;
+ $scope.cipher = model;
if (model.password) {
- $scope.login.maskedPassword = $scope.maskValue(model.password);
+ $scope.cipher.maskedPassword = $scope.maskValue(model.password);
}
if (model.uri) {
- $scope.login.showLaunch = model.uri.startsWith('http://') || model.uri.startsWith('https://');
+ $scope.cipher.showLaunch = model.uri.startsWith('http://') || model.uri.startsWith('https://');
var domain = utilsService.getDomain(model.uri);
if (domain) {
- $scope.login.website = domain;
+ $scope.cipher.website = domain;
}
else {
- $scope.login.website = model.uri;
+ $scope.cipher.website = model.uri;
}
}
else {
- $scope.login.showLaunch = false;
+ $scope.cipher.showLaunch = false;
}
- if (model.totp && (login.organizationUseTotp || tokenService.getPremium())) {
+ if (model.totp && (cipher.organizationUseTotp || tokenService.getPremium())) {
totpUpdateCode();
totpTick();
@@ -53,10 +53,10 @@ angular
}
});
- $scope.edit = function (login) {
- $state.go('editLogin', {
+ $scope.edit = function (cipher) {
+ $state.go('editCipher', {
animation: 'in-slide-up',
- loginId: login.id,
+ cipherId: cipher.id,
fromView: true,
from: from
});
@@ -84,10 +84,10 @@ angular
}
};
- $scope.launchWebsite = function (login) {
- if (login.showLaunch) {
+ $scope.launchWebsite = function (cipher) {
+ if (cipher.showLaunch) {
$analytics.eventTrack('Launched Website');
- chrome.tabs.create({ url: login.uri });
+ chrome.tabs.create({ url: cipher.uri });
}
};
@@ -120,7 +120,7 @@ angular
};
$scope.download = function (attachment) {
- if (!$scope.login.organizationId && !tokenService.getPremium()) {
+ if (!$scope.cipher.organizationId && !tokenService.getPremium()) {
SweetAlert.swal({
title: i18nService.premiumRequired,
text: i18nService.premiumRequiredDesc,
@@ -152,7 +152,7 @@ angular
return;
}
- cryptoService.getOrgKey($scope.login.organizationId).then(function (key) {
+ cryptoService.getOrgKey($scope.cipher.organizationId).then(function (key) {
return cryptoService.decryptFromBytes(req.response, key);
}).then(function (decBuf) {
var blob = new Blob([decBuf]);
@@ -192,11 +192,11 @@ angular
});
function totpUpdateCode() {
- if (!$scope.login.totp) {
+ if (!$scope.cipher.totp) {
return;
}
- totpService.getCode($scope.login.totp).then(function (code) {
+ totpService.getCode($scope.cipher.totp).then(function (code) {
$timeout(function () {
if (code) {
$scope.totpCodeFormatted = code.substring(0, 3) + ' ' + code.substring(3);
diff --git a/src/popup/app/vault/vaultViewFolderController.js b/src/popup/app/vault/vaultViewFolderController.js
index 34ea64f784..63690bf2cd 100644
--- a/src/popup/app/vault/vaultViewFolderController.js
+++ b/src/popup/app/vault/vaultViewFolderController.js
@@ -190,7 +190,7 @@
storeState();
$state.go('viewLogin', {
- loginId: cipher.id,
+ cipherId: cipher.id,
animation: 'in-slide-up',
from: 'folder'
});
diff --git a/src/popup/app/vault/views/vaultAddLogin.html b/src/popup/app/vault/views/vaultAddCipher.html
similarity index 100%
rename from src/popup/app/vault/views/vaultAddLogin.html
rename to src/popup/app/vault/views/vaultAddCipher.html
diff --git a/src/popup/app/vault/views/vaultEditLogin.html b/src/popup/app/vault/views/vaultEditCipher.html
similarity index 92%
rename from src/popup/app/vault/views/vaultEditLogin.html
rename to src/popup/app/vault/views/vaultEditCipher.html
index 6cc9d4bc7f..a98779886e 100644
--- a/src/popup/app/vault/views/vaultEditLogin.html
+++ b/src/popup/app/vault/views/vaultEditCipher.html
@@ -1,4 +1,4 @@
-