diff --git a/jslib b/jslib index 8aa2f0fb18..d4fab1c697 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 8aa2f0fb183ad8f30a9fb5396b63e6fff5b87e12 +Subproject commit d4fab1c6976f6b47fff89ef89404d6fcc7583021 diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 2f54129096..295b81527f 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -319,9 +319,21 @@ "immediately": { "message": "Immediately" }, + "tenSeconds": { + "message": "10 seconds" + }, + "twentySeconds": { + "message": "20 seconds" + }, + "thirtySeconds": { + "message": "30 seconds" + }, "oneMinute": { "message": "1 minute" }, + "twoMinutes": { + "message": "2 minutes" + }, "fiveMinutes": { "message": "5 minutes" }, @@ -511,6 +523,14 @@ "dontShowIdentitiesCurrentTabDesc": { "message": "Identity items from your vault are listed on the 'Current Tab' page for easy auto-fill access." }, + "clearClipboard": { + "message": "Clear Clipboard", + "description": "Clipboard is the operating system thing where you copy/paste data to on your device." + }, + "clearClipboardDesc": { + "message": "Automatically clear copied values from your clipboard.", + "description": "Clipboard is the operating system thing where you copy/paste data to on your device." + }, "notificationAddDesc": { "message": "Should Bitwarden remember this password for you?" }, diff --git a/src/popup/settings/options.component.html b/src/popup/settings/options.component.html index ffca9c4937..66a8e1c20c 100644 --- a/src/popup/settings/options.component.html +++ b/src/popup/settings/options.component.html @@ -36,6 +36,18 @@ +
+
+
+ + +
+
+ +
diff --git a/src/popup/settings/options.component.ts b/src/popup/settings/options.component.ts index 4f7992a10c..2d42ff319c 100644 --- a/src/popup/settings/options.component.ts +++ b/src/popup/settings/options.component.ts @@ -34,6 +34,8 @@ export class OptionsComponent implements OnInit { themeOptions: any[]; defaultUriMatch = UriMatchType.Domain; uriMatchOptions: any[]; + clearClipboard: number; + clearClipboardOptions: any[]; constructor(private analytics: Angulartics2, private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService, private storageService: StorageService, @@ -52,6 +54,15 @@ export class OptionsComponent implements OnInit { { name: i18nService.t('exact'), value: UriMatchType.Exact }, { name: i18nService.t('never'), value: UriMatchType.Never }, ]; + this.clearClipboardOptions = [ + { name: i18nService.t('never'), value: null }, + { name: i18nService.t('tenSeconds'), value: 10 }, + { name: i18nService.t('twentySeconds'), value: 20 }, + { name: i18nService.t('thirtySeconds'), value: 30 }, + { name: i18nService.t('oneMinute'), value: 60 }, + { name: i18nService.t('twoMinutes'), value: 120 }, + { name: i18nService.t('fiveMinutes'), value: 300 }, + ]; } async ngOnInit() { @@ -80,6 +91,8 @@ export class OptionsComponent implements OnInit { const defaultUriMatch = await this.storageService.get(ConstantsService.defaultUriMatch); this.defaultUriMatch = defaultUriMatch == null ? UriMatchType.Domain : defaultUriMatch; + + this.clearClipboard = await this.storageService.get(ConstantsService.clearClipboardKey); } async updateAddLoginNotification() { @@ -140,6 +153,13 @@ export class OptionsComponent implements OnInit { this.analytics.eventTrack.next({ action: 'Set Default URI Match ' + this.defaultUriMatch }); } + async saveClearClipboard() { + await this.storageService.save(ConstantsService.clearClipboardKey, this.clearClipboard); + this.analytics.eventTrack.next({ + action: 'Set Clear Clipboard ' + (this.clearClipboard == null ? 'disabled' : this.clearClipboard), + }); + } + private callAnalytics(name: string, enabled: boolean) { const status = enabled ? 'Enabled' : 'Disabled'; this.analytics.eventTrack.next({ action: `${status} ${name}` });