diff --git a/src/popup/app/settings/settingsController.js b/src/popup/app/settings/settingsController.js index 44fc2dde8b..66218fb9cf 100644 --- a/src/popup/app/settings/settingsController.js +++ b/src/popup/app/settings/settingsController.js @@ -1,16 +1,60 @@ angular .module('bit.settings') - .controller('settingsController', function ($scope, loginService, $state, syncService) { + .controller('settingsController', function ($scope, loginService, $state, syncService, SweetAlert) { $scope.sync = function () { syncService.fullSync(function () { alert('Sync done!'); }); }; - $scope.logOut = function (model) { + $scope.logOut = function () { loginService.logOut(function () { $state.go('login'); }); }; + + $scope.changePassword = function () { + SweetAlert.swal({ + title: 'Change Master Password', + text: 'You can change your master password on the bitwarden.com web vault. Do you want to visit the website now?', + type: 'info', + showCancelButton: true, + confirmButtonText: 'Yes', + cancelButtonText: 'Cancel' + }, alertCallback); + }; + + $scope.changeEmail = function () { + SweetAlert.swal({ + title: 'Change Email', + text: 'You can change your email address on the bitwarden.com web vault. Do you want to visit the website now?', + type: 'info', + showCancelButton: true, + confirmButtonText: 'Yes', + cancelButtonText: 'Cancel' + }, alertCallback); + }; + + $scope.twoStep = function () { + SweetAlert.swal({ + title: 'Two-step Login', + text: 'Two-step login makes your account more secure by requiring you to enter a security code from an authenticator app whenever you log in. Two-step login can be enabled on the bitwarden.com web vault. Do you want to visit the website now?', + type: 'info', + showCancelButton: true, + confirmButtonText: 'Yes', + cancelButtonText: 'Cancel' + }, alertCallback); + }; + + function alertCallback(confirmed) { + if (confirmed) { + chrome.tabs.create({ url: 'https://vault.bitwarden.com' }); + } + } + + $scope.rate = function () { + // TODO: detect which extension store to send them to + chrome.tabs.create({ url: 'https://google.com' }); + }; }); diff --git a/src/popup/app/settings/settingsModule.js b/src/popup/app/settings/settingsModule.js index efddc81eb8..087cba1448 100644 --- a/src/popup/app/settings/settingsModule.js +++ b/src/popup/app/settings/settingsModule.js @@ -1,2 +1,2 @@ angular - .module('bit.settings', []); + .module('bit.settings', ['oitozero.ngSweetAlert']); diff --git a/src/popup/app/settings/views/settings.html b/src/popup/app/settings/views/settings.html index ed05d2b61c..6feec6a6e9 100644 --- a/src/popup/app/settings/views/settings.html +++ b/src/popup/app/settings/views/settings.html @@ -3,36 +3,26 @@