mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
Feature settings. i18n of notification bar.
This commit is contained in:
@@ -622,5 +622,29 @@
|
|||||||
"noneFolder": {
|
"noneFolder": {
|
||||||
"message": "(none)",
|
"message": "(none)",
|
||||||
"description": "(none) - this is the folder for uncategorized sites"
|
"description": "(none) - this is the folder for uncategorized sites"
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"message": "Features",
|
||||||
|
"description": "Features"
|
||||||
|
},
|
||||||
|
"gaDesc": {
|
||||||
|
"message": "We use Google Analytics to better learn how the extension is being used so that we can make it better. All data collection is completely anonymous.",
|
||||||
|
"description": "We use Google Analytics to better learn how the extension is being used so that we can make it better. All data collection is completely anonymous."
|
||||||
|
},
|
||||||
|
"disableAddSiteNotification": {
|
||||||
|
"message": "Disable Add Site Notification",
|
||||||
|
"description": "Disable Add Site Notification"
|
||||||
|
},
|
||||||
|
"addSiteNotificationDesc": {
|
||||||
|
"message": "The \"Add Site Notification\" automatically prompts you to save new sites to your vault whenever you log into them for the first time.",
|
||||||
|
"description": "The \"Add Site Notification\" automatically prompts you to save new sites to your vault whenever you log into them for the first time."
|
||||||
|
},
|
||||||
|
"notificationAddDesc": {
|
||||||
|
"message": "Should bitwarden remember this password for you?",
|
||||||
|
"description": "Should bitwarden remember this password for you?"
|
||||||
|
},
|
||||||
|
"notificationAddSave": {
|
||||||
|
"message": "Yes, Save Now",
|
||||||
|
"description": "Yes, Save Now"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,12 @@
|
|||||||
formData = [],
|
formData = [],
|
||||||
barType = null;
|
barType = null;
|
||||||
|
|
||||||
chrome.runtime.sendMessage({
|
chrome.storage.local.get('disableAddSiteNotification', function (obj) {
|
||||||
command: 'bgCollectPageDetails'
|
if (!obj || !obj['disableAddSiteNotification']) {
|
||||||
|
chrome.runtime.sendMessage({
|
||||||
|
command: 'bgCollectPageDetails'
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="24">
|
<td width="24">
|
||||||
<a href="https://vault.bitwarden.com" target="_blank" title="bitwarden">
|
<a href="https://vault.bitwarden.com" target="_blank" id="logo-link">
|
||||||
<img id="logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAclBMVEUAAAAzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzOkbymMAAAAJXRSTlMAAQIICQsMGBkaKkJYWWl0dXeMjpWXm6WmtcXM0dPr7fH3+fv9KIjKuwAAAIRJREFUKM/dzUkCgkAMBdHfCArOIypBW4S6/xVdNCqDJ7BWSd4iknKG5ZIkMW4AdzMzs+cI1mG3f4N6ADfqMJR9cFAG2PVhDtsAWQ8igyyAzl3Yw6W9K/YfcAfw8RuUVS1MrlCl+pZ6gM3iAX6mbknR/ikS9XOrBmiWTqOmR05T/SzqLi/Z3CbrA3nnNwAAAABJRU5ErkJggg==" />
|
<img id="logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAclBMVEUAAAAzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzOkbymMAAAAJXRSTlMAAQIICQsMGBkaKkJYWWl0dXeMjpWXm6WmtcXM0dPr7fH3+fv9KIjKuwAAAIRJREFUKM/dzUkCgkAMBdHfCArOIypBW4S6/xVdNCqDJ7BWSd4iknKG5ZIkMW4AdzMzs+cI1mG3f4N6ADfqMJR9cFAG2PVhDtsAWQ8igyyAzl3Yw6W9K/YfcAfw8RuUVS1MrlCl+pZ6gM3iAX6mbknR/ikS9XOrBmiWTqOmR05T/SzqLi/Z3CbrA3nnNwAAAABJRU5ErkJggg==" />
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td id="content"></td>
|
<td id="content"></td>
|
||||||
<td align="right" width="15">
|
<td align="right" width="15">
|
||||||
<a href="#" title="Close" id="close-button">
|
<a href="#" id="close-button">
|
||||||
<img id="close" alt="X" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAilBMVEUAAAAzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzORiUCaAAAALXRSTlMAAQMHCCMkJicsLjQ6PEJFUFVYW11fYWlscXR7fIOFi4yOkZSVmqDAw9Pc+/0n8J+EAAAAdElEQVQIHQXBhyLDAABAwUuJVVtqU0Wt9P3/77kzfFwDjD97bGoCxrnfhdtqgnGur4FVNTHOtR3gppoO5vocgKuqegdwWbUG4LDqDsDxrqoHwLJ6vaiewFn1zGn1gvPqEZbVG9u6B052/S0MmxXA0fc+AIB/vAoPdfukIW0AAAAASUVORK5CYII=" />
|
<img id="close" alt="X" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAAilBMVEUAAAAzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzORiUCaAAAALXRSTlMAAQMHCCMkJicsLjQ6PEJFUFVYW11fYWlscXR7fIOFi4yOkZSVmqDAw9Pc+/0n8J+EAAAAdElEQVQIHQXBhyLDAABAwUuJVVtqU0Wt9P3/77kzfFwDjD97bGoCxrnfhdtqgnGur4FVNTHOtR3gppoO5vocgKuqegdwWbUG4LDqDsDxrqoHwLJ6vaiewFn1zGn1gvPqEZbVG9u6B052/S0MmxXA0fc+AIB/vAoPdfukIW0AAAAASUVORK5CYII=" />
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
@@ -27,9 +27,9 @@
|
|||||||
<table class="inner-table" cellpadding="0" cellspacing="0" id="template-add">
|
<table class="inner-table" cellpadding="0" cellspacing="0" id="template-add">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Should bitwarden remember this password for you?</td>
|
<td class="add-text"></td>
|
||||||
<td align="right" width="150">
|
<td align="right" width="150">
|
||||||
<button class="add-save">Yes, Save Now</button>
|
<button class="add-save"></button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
var content = document.getElementById('content'),
|
var content = document.getElementById('content'),
|
||||||
template_add = document.getElementById('template-add'),
|
closeButton = $('#close-button');
|
||||||
template_alert = document.getElementById('template-alert');
|
|
||||||
|
// i18n
|
||||||
|
$('#logo-link').attr('title', chrome.i18n.getMessage('appName'));
|
||||||
|
closeButton.attr('title', chrome.i18n.getMessage('close'));
|
||||||
|
$('#template-add .add-save').text(chrome.i18n.getMessage('notificationAddSave'));
|
||||||
|
$('#template-add .add-text').text(chrome.i18n.getMessage('notificationAddDesc'));
|
||||||
|
|
||||||
if (getQueryVariable('add')) {
|
if (getQueryVariable('add')) {
|
||||||
setContent(template_add);
|
setContent(document.getElementById('template-add'));
|
||||||
|
|
||||||
var add = $('#template-add-clone'),
|
var add = $('#template-add-clone'),
|
||||||
addButton = $('#template-add-clone .add-save');
|
addButton = $('#template-add-clone .add-save');
|
||||||
@@ -17,11 +22,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (getQueryVariable('info')) {
|
else if (getQueryVariable('info')) {
|
||||||
setContent(template_alert);
|
setContent(document.getElementById('template-alert'));
|
||||||
$('#template-alert-clone').text(getQueryVariable('info'));
|
$('#template-alert-clone').text(getQueryVariable('info'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#close-button').click(function (e) {
|
closeButton.click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
chrome.runtime.sendMessage({
|
chrome.runtime.sendMessage({
|
||||||
command: 'bgCloseNotificationBar'
|
command: 'bgCloseNotificationBar'
|
||||||
|
|||||||
@@ -139,6 +139,13 @@
|
|||||||
data: { authorize: true },
|
data: { authorize: true },
|
||||||
params: { animation: null }
|
params: { animation: null }
|
||||||
})
|
})
|
||||||
|
.state('features', {
|
||||||
|
url: '/features',
|
||||||
|
templateUrl: 'app/settings/views/settingsFeatures.html',
|
||||||
|
controller: 'settingsFeaturesController',
|
||||||
|
data: { authorize: true },
|
||||||
|
params: { animation: null }
|
||||||
|
})
|
||||||
.state('help', {
|
.state('help', {
|
||||||
url: '/help',
|
url: '/help',
|
||||||
templateUrl: 'app/settings/views/settingsHelp.html',
|
templateUrl: 'app/settings/views/settingsHelp.html',
|
||||||
|
|||||||
@@ -4,19 +4,9 @@
|
|||||||
.controller('settingsController', function ($scope, loginService, $state, SweetAlert, utilsService, $analytics,
|
.controller('settingsController', function ($scope, loginService, $state, SweetAlert, utilsService, $analytics,
|
||||||
i18nService, constantsService, cryptoService) {
|
i18nService, constantsService, cryptoService) {
|
||||||
utilsService.initListSectionItemListeners($(document), angular);
|
utilsService.initListSectionItemListeners($(document), angular);
|
||||||
$scope.disableGa = false;
|
|
||||||
$scope.lockOption = '';
|
$scope.lockOption = '';
|
||||||
$scope.i18n = i18nService;
|
$scope.i18n = i18nService;
|
||||||
|
|
||||||
chrome.storage.local.get(constantsService.disableGaKey, function (obj) {
|
|
||||||
if (obj && obj[constantsService.disableGaKey]) {
|
|
||||||
$scope.disableGa = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$scope.disableGa = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
chrome.storage.local.get(constantsService.lockOptionKey, function (obj) {
|
chrome.storage.local.get(constantsService.lockOptionKey, function (obj) {
|
||||||
if (obj && (obj[constantsService.lockOptionKey] || obj[constantsService.lockOptionKey] === 0)) {
|
if (obj && (obj[constantsService.lockOptionKey] || obj[constantsService.lockOptionKey] === 0)) {
|
||||||
$scope.lockOption = obj[constantsService.lockOptionKey].toString();
|
$scope.lockOption = obj[constantsService.lockOptionKey].toString();
|
||||||
@@ -121,27 +111,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.updateGa = function () {
|
|
||||||
chrome.storage.local.get(constantsService.disableGaKey, function (obj) {
|
|
||||||
if (obj[constantsService.disableGaKey]) {
|
|
||||||
// enable
|
|
||||||
obj[constantsService.disableGaKey] = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// disable
|
|
||||||
$analytics.eventTrack('Disabled Google Analytics');
|
|
||||||
obj[constantsService.disableGaKey] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
chrome.storage.local.set(obj, function () {
|
|
||||||
$scope.disableGa = obj[constantsService.disableGaKey];
|
|
||||||
if (!obj[constantsService.disableGaKey]) {
|
|
||||||
$analytics.eventTrack('Enabled Google Analytics');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.rate = function () {
|
$scope.rate = function () {
|
||||||
$analytics.eventTrack('Rate Extension');
|
$analytics.eventTrack('Rate Extension');
|
||||||
|
|
||||||
|
|||||||
68
src/popup/app/settings/settingsFeaturesController.js
Normal file
68
src/popup/app/settings/settingsFeaturesController.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
angular
|
||||||
|
.module('bit.settings')
|
||||||
|
|
||||||
|
.controller('settingsFeaturesController', function ($scope, i18nService, $analytics, constantsService) {
|
||||||
|
$scope.i18n = i18nService;
|
||||||
|
$scope.disableGa = false;
|
||||||
|
$scope.disableAddSiteNotification = false;
|
||||||
|
|
||||||
|
chrome.storage.local.get(constantsService.disableGaKey, function (obj) {
|
||||||
|
if (obj && obj[constantsService.disableGaKey]) {
|
||||||
|
$scope.disableGa = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$scope.disableGa = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
chrome.storage.local.get(constantsService.disableAddSiteNotificationKey, function (obj) {
|
||||||
|
if (obj && obj[constantsService.disableAddSiteNotificationKey]) {
|
||||||
|
$scope.disableAddSiteNotification = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$scope.disableAddSiteNotification = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.updateGa = function () {
|
||||||
|
chrome.storage.local.get(constantsService.disableGaKey, function (obj) {
|
||||||
|
if (obj[constantsService.disableGaKey]) {
|
||||||
|
// enable
|
||||||
|
obj[constantsService.disableGaKey] = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// disable
|
||||||
|
$analytics.eventTrack('Disabled Google Analytics');
|
||||||
|
obj[constantsService.disableGaKey] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
chrome.storage.local.set(obj, function () {
|
||||||
|
$scope.disableGa = obj[constantsService.disableGaKey];
|
||||||
|
if (!obj[constantsService.disableGaKey]) {
|
||||||
|
$analytics.eventTrack('Enabled Google Analytics');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.updateAddSiteNotification = function () {
|
||||||
|
chrome.storage.local.get(constantsService.disableAddSiteNotificationKey, function (obj) {
|
||||||
|
if (obj[constantsService.disableAddSiteNotificationKey]) {
|
||||||
|
// enable
|
||||||
|
obj[constantsService.disableAddSiteNotificationKey] = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// disable
|
||||||
|
$analytics.eventTrack('Disabled Add Site Notification');
|
||||||
|
obj[constantsService.disableAddSiteNotificationKey] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
chrome.storage.local.set(obj, function () {
|
||||||
|
$scope.disableAddSiteNotification = obj[constantsService.disableAddSiteNotificationKey];
|
||||||
|
if (!obj[constantsService.disableAddSiteNotificationKey]) {
|
||||||
|
$analytics.eventTrack('Enabled Add Site Notification');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
@@ -66,10 +66,10 @@
|
|||||||
{{i18n.other}}
|
{{i18n.other}}
|
||||||
</div>
|
</div>
|
||||||
<div class="list-section-items">
|
<div class="list-section-items">
|
||||||
<div class="list-section-item list-section-item-checkbox">
|
<a class="list-section-item" ui-sref="features({animation: 'in-slide-left'})">
|
||||||
<label for="ga">{{i18n.disableGa}}</label>
|
{{i18n.features}}
|
||||||
<input id="ga" type="checkbox" ng-model="disableGa" ng-change="updateGa()">
|
<i class="fa fa-chevron-right fa-lg"></i>
|
||||||
</div>
|
</a>
|
||||||
<a class="list-section-item" ui-sref="about({animation: 'in-slide-left'})">
|
<a class="list-section-item" ui-sref="about({animation: 'in-slide-left'})">
|
||||||
{{i18n.about}}
|
{{i18n.about}}
|
||||||
<i class="fa fa-chevron-right fa-lg"></i>
|
<i class="fa fa-chevron-right fa-lg"></i>
|
||||||
|
|||||||
33
src/popup/app/settings/views/settingsFeatures.html
Normal file
33
src/popup/app/settings/views/settingsFeatures.html
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<div class="header">
|
||||||
|
<div class="left">
|
||||||
|
<a ui-sref="tabs.settings({animation: 'out-slide-right'})"><i class="fa fa-chevron-left"></i> {{i18n.settings}}</a>
|
||||||
|
</div>
|
||||||
|
<div class="title">{{i18n.features}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<div class="list">
|
||||||
|
<div class="list-section">
|
||||||
|
<div class="list-section-items">
|
||||||
|
<div class="list-section-item list-section-item-checkbox">
|
||||||
|
<label for="ga">{{i18n.disableGa}}</label>
|
||||||
|
<input id="ga" type="checkbox" ng-model="disableGa" ng-change="updateGa()">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="list-section-footer">
|
||||||
|
{{i18n.gaDesc}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="list-section">
|
||||||
|
<div class="list-section-items">
|
||||||
|
<div class="list-section-item list-section-item-checkbox">
|
||||||
|
<label for="notification-bar">{{i18n.disableAddSiteNotification}}</label>
|
||||||
|
<input id="notification-bar" type="checkbox" ng-model="disableAddSiteNotification"
|
||||||
|
ng-change="updateAddSiteNotification()">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="list-section-footer">
|
||||||
|
{{i18n.addSiteNotificationDesc}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -73,6 +73,7 @@
|
|||||||
<script src="app/settings/settingsHelpController.js"></script>
|
<script src="app/settings/settingsHelpController.js"></script>
|
||||||
<script src="app/settings/settingsAboutController.js"></script>
|
<script src="app/settings/settingsAboutController.js"></script>
|
||||||
<script src="app/settings/settingsCreditsController.js"></script>
|
<script src="app/settings/settingsCreditsController.js"></script>
|
||||||
|
<script src="app/settings/settingsFeaturesController.js"></script>
|
||||||
<script src="app/settings/settingsSyncController.js"></script>
|
<script src="app/settings/settingsSyncController.js"></script>
|
||||||
<script src="app/settings/settingsFoldersController.js"></script>
|
<script src="app/settings/settingsFoldersController.js"></script>
|
||||||
<script src="app/settings/settingsAddFolderController.js"></script>
|
<script src="app/settings/settingsAddFolderController.js"></script>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
function ConstantsService() {
|
function ConstantsService() {
|
||||||
return {
|
return {
|
||||||
disableGaKey: 'disableGa',
|
disableGaKey: 'disableGa',
|
||||||
|
disableAddSiteNotificationKey: 'disableAddSiteNotification',
|
||||||
lockOptionKey: 'lockOption',
|
lockOptionKey: 'lockOption',
|
||||||
lastActiveKey: 'lastActive'
|
lastActiveKey: 'lastActive'
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user