diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 5c29bd96f8..a3cc555bfc 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -622,5 +622,29 @@ "noneFolder": { "message": "(none)", "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" } } diff --git a/src/content/notificationBar.js b/src/content/notificationBar.js index dad51cf864..df6c356970 100644 --- a/src/content/notificationBar.js +++ b/src/content/notificationBar.js @@ -3,8 +3,12 @@ formData = [], barType = null; - chrome.runtime.sendMessage({ - command: 'bgCollectPageDetails' + chrome.storage.local.get('disableAddSiteNotification', function (obj) { + if (!obj || !obj['disableAddSiteNotification']) { + chrome.runtime.sendMessage({ + command: 'bgCollectPageDetails' + }); + } }); chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) { diff --git a/src/notification/bar.html b/src/notification/bar.html index 3172d88547..55194ea5e5 100644 --- a/src/notification/bar.html +++ b/src/notification/bar.html @@ -10,13 +10,13 @@ - + - + X @@ -27,9 +27,9 @@ - + diff --git a/src/notification/bar.js b/src/notification/bar.js index 94cb8186cc..072ef71a14 100644 --- a/src/notification/bar.js +++ b/src/notification/bar.js @@ -1,10 +1,15 @@ $(function () { var content = document.getElementById('content'), - template_add = document.getElementById('template-add'), - template_alert = document.getElementById('template-alert'); + closeButton = $('#close-button'); + + // 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')) { - setContent(template_add); + setContent(document.getElementById('template-add')); var add = $('#template-add-clone'), addButton = $('#template-add-clone .add-save'); @@ -17,11 +22,11 @@ }); } else if (getQueryVariable('info')) { - setContent(template_alert); + setContent(document.getElementById('template-alert')); $('#template-alert-clone').text(getQueryVariable('info')); } - $('#close-button').click(function (e) { + closeButton.click(function (e) { e.preventDefault(); chrome.runtime.sendMessage({ command: 'bgCloseNotificationBar' diff --git a/src/popup/app/config.js b/src/popup/app/config.js index 94de0519df..d45d59c0ef 100644 --- a/src/popup/app/config.js +++ b/src/popup/app/config.js @@ -139,6 +139,13 @@ data: { authorize: true }, params: { animation: null } }) + .state('features', { + url: '/features', + templateUrl: 'app/settings/views/settingsFeatures.html', + controller: 'settingsFeaturesController', + data: { authorize: true }, + params: { animation: null } + }) .state('help', { url: '/help', templateUrl: 'app/settings/views/settingsHelp.html', diff --git a/src/popup/app/settings/settingsController.js b/src/popup/app/settings/settingsController.js index 2b16df416e..10efb38eb8 100644 --- a/src/popup/app/settings/settingsController.js +++ b/src/popup/app/settings/settingsController.js @@ -4,19 +4,9 @@ .controller('settingsController', function ($scope, loginService, $state, SweetAlert, utilsService, $analytics, i18nService, constantsService, cryptoService) { utilsService.initListSectionItemListeners($(document), angular); - $scope.disableGa = false; $scope.lockOption = ''; $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) { if (obj && (obj[constantsService.lockOptionKey] || obj[constantsService.lockOptionKey] === 0)) { $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 () { $analytics.eventTrack('Rate Extension'); diff --git a/src/popup/app/settings/settingsFeaturesController.js b/src/popup/app/settings/settingsFeaturesController.js new file mode 100644 index 0000000000..2810b4d07f --- /dev/null +++ b/src/popup/app/settings/settingsFeaturesController.js @@ -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'); + } + }); + }); + }; + }); diff --git a/src/popup/app/settings/views/settings.html b/src/popup/app/settings/views/settings.html index ba5c9dbad7..cc78573350 100644 --- a/src/popup/app/settings/views/settings.html +++ b/src/popup/app/settings/views/settings.html @@ -66,10 +66,10 @@ {{i18n.other}}
-
- - -
+ + {{i18n.features}} + + {{i18n.about}} diff --git a/src/popup/app/settings/views/settingsFeatures.html b/src/popup/app/settings/views/settingsFeatures.html new file mode 100644 index 0000000000..a21a7db604 --- /dev/null +++ b/src/popup/app/settings/views/settingsFeatures.html @@ -0,0 +1,33 @@ +
+ +
{{i18n.features}}
+
+
+
+
+
+
+ + +
+
+ +
+
+
+
+ + +
+
+ +
+
+
diff --git a/src/popup/index.html b/src/popup/index.html index 6b7ee42366..f45ce9a331 100644 --- a/src/popup/index.html +++ b/src/popup/index.html @@ -73,6 +73,7 @@ + diff --git a/src/services/constantsService.js b/src/services/constantsService.js index 4a00b25470..a63055ce04 100644 --- a/src/services/constantsService.js +++ b/src/services/constantsService.js @@ -1,6 +1,7 @@ function ConstantsService() { return { disableGaKey: 'disableGa', + disableAddSiteNotificationKey: 'disableAddSiteNotification', lockOptionKey: 'lockOption', lastActiveKey: 'lastActive' };
Should bitwarden remember this password for you? - +