mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
add option to disable website icons in web vault
This commit is contained in:
parent
d53187935b
commit
52a4317d09
@ -1,8 +1,10 @@
|
|||||||
angular
|
angular
|
||||||
.module('bit.services')
|
.module('bit.services')
|
||||||
|
|
||||||
.factory('cipherService', function (cryptoService, apiService, $q, $window, constants, appSettings) {
|
.factory('cipherService', function (cryptoService, apiService, $q, $window, constants, appSettings, $localStorage) {
|
||||||
var _service = {};
|
var _service = {
|
||||||
|
disableWebsiteIcons: $localStorage.disableWebsiteIcons
|
||||||
|
};
|
||||||
|
|
||||||
_service.decryptCiphers = function (encryptedCiphers) {
|
_service.decryptCiphers = function (encryptedCiphers) {
|
||||||
if (!encryptedCiphers) throw "encryptedCiphers is undefined or null";
|
if (!encryptedCiphers) throw "encryptedCiphers is undefined or null";
|
||||||
@ -187,7 +189,7 @@ angular
|
|||||||
};
|
};
|
||||||
|
|
||||||
function setLoginIcon(cipher, uri, setImage) {
|
function setLoginIcon(cipher, uri, setImage) {
|
||||||
if (!appSettings.selfHosted && uri) {
|
if (!appSettings.selfHosted && !_service.disableWebsiteIcons && uri) {
|
||||||
var hostnameUri = uri,
|
var hostnameUri = uri,
|
||||||
isWebsite = false;
|
isWebsite = false;
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
angular
|
angular
|
||||||
.module('bit.settings')
|
.module('bit.settings')
|
||||||
|
|
||||||
.controller('settingsController', function ($scope, $state, $uibModal, apiService, toastr, authService) {
|
.controller('settingsController', function ($scope, $state, $uibModal, apiService, toastr, authService, $localStorage,
|
||||||
|
appSettings, $rootScope, cipherService) {
|
||||||
|
$scope.selfHosted = appSettings.selfHosted;
|
||||||
$scope.model = {
|
$scope.model = {
|
||||||
profile: {},
|
profile: {},
|
||||||
twoFactorEnabled: false,
|
email: null,
|
||||||
email: null
|
disableWebsiteIcons: false
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.$on('$viewContentLoaded', function () {
|
$scope.$on('$viewContentLoaded', function () {
|
||||||
@ -17,7 +19,7 @@
|
|||||||
culture: user.Culture
|
culture: user.Culture
|
||||||
},
|
},
|
||||||
email: user.Email,
|
email: user.Email,
|
||||||
twoFactorEnabled: user.TwoFactorEnabled
|
disableWebsiteIcons: $localStorage.disableWebsiteIcons
|
||||||
};
|
};
|
||||||
|
|
||||||
if (user.Organizations) {
|
if (user.Organizations) {
|
||||||
@ -58,6 +60,15 @@
|
|||||||
}).$promise;
|
}).$promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.optionsSave = function () {
|
||||||
|
if (!$scope.selfHosted) {
|
||||||
|
$localStorage.disableWebsiteIcons = cipherService.disableWebsiteIcons = $scope.model.disableWebsiteIcons;
|
||||||
|
$rootScope.vaultCiphers = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
toastr.success('Options have been updated.', 'Success!');
|
||||||
|
};
|
||||||
|
|
||||||
$scope.changePassword = function () {
|
$scope.changePassword = function () {
|
||||||
$uibModal.open({
|
$uibModal.open({
|
||||||
animation: true,
|
animation: true,
|
||||||
|
@ -86,6 +86,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="box box-default" ng-if="!selfHosted">
|
||||||
|
<div class="box-header with-border">
|
||||||
|
<h3 class="box-title">Options</h3>
|
||||||
|
</div>
|
||||||
|
<form role="form" name="optionsForm" ng-submit="optionsForm.$valid && optionsSave()" autocomplete="off">
|
||||||
|
<div class="box-body">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" ng-model="model.disableWebsiteIcons">
|
||||||
|
Disable Website Icons
|
||||||
|
</label>
|
||||||
|
<p class="help-block">Website Icons provide a recognizable image next to each login item in your vault.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box-footer">
|
||||||
|
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="optionsForm.$loading">
|
||||||
|
<i class="fa fa-refresh fa-spin loading-icon" ng-show="optionsForm.$loading"></i>Save
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
<div class="box box-default">
|
<div class="box box-default">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Organizations</h3>
|
<h3 class="box-title">Organizations</h3>
|
||||||
|
Loading…
Reference in New Issue
Block a user