From aa893af3e676a7ba749d62025f2a21b561956446 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 3 Oct 2017 14:59:52 -0400 Subject: [PATCH] add launch website button to vault listing --- src/popup/app/vault/vaultController.js | 7 +++++++ src/popup/app/vault/vaultViewFolderController.js | 7 +++++++ src/popup/app/vault/views/vault.html | 8 ++++++++ src/popup/app/vault/views/vaultViewFolder.html | 4 ++++ 4 files changed, 26 insertions(+) diff --git a/src/popup/app/vault/vaultController.js b/src/popup/app/vault/vaultController.js index 8142ace3fa..6be9be4d68 100644 --- a/src/popup/app/vault/vaultController.js +++ b/src/popup/app/vault/vaultController.js @@ -153,6 +153,13 @@ toastr.info(type + i18nService.valueCopied); }; + $scope.launchWebsite = function (login) { + if (login.uri.startsWith('http://') || login.uri.startsWith('https://')) { + $analytics.eventTrack('Launched Website From Listing'); + chrome.tabs.create({ url: login.uri }); + } + }; + $scope.$on('syncCompleted', function (event, successfully) { $timeout(loadVault, 500); }); diff --git a/src/popup/app/vault/vaultViewFolderController.js b/src/popup/app/vault/vaultViewFolderController.js index 438570191b..d207faad3e 100644 --- a/src/popup/app/vault/vaultViewFolderController.js +++ b/src/popup/app/vault/vaultViewFolderController.js @@ -131,6 +131,13 @@ resetList(matchedLogins); }; + $scope.launchWebsite = function (login) { + if (login.uri.startsWith('http://') || login.uri.startsWith('https://')) { + $analytics.eventTrack('Launched Website From Listing'); + chrome.tabs.create({ url: login.uri }); + } + }; + function resetList(logins) { $scope.vaultLogins = logins; $scope.pagedVaultLogins = []; diff --git a/src/popup/app/vault/views/vault.html b/src/popup/app/vault/views/vault.html index 640ad54162..6a9785b8a4 100644 --- a/src/popup/app/vault/views/vault.html +++ b/src/popup/app/vault/views/vault.html @@ -51,6 +51,10 @@ data-clipboard-text="{{login.username}}" ng-class="{'disabled': !login.username}"> + + + {{login.name}} @@ -79,6 +83,10 @@ data-clipboard-text="{{login.username}}" ng-class="{'disabled': !login.username}"> + + + {{login.name}} diff --git a/src/popup/app/vault/views/vaultViewFolder.html b/src/popup/app/vault/views/vaultViewFolder.html index c9f92361f4..713ac53036 100644 --- a/src/popup/app/vault/views/vaultViewFolder.html +++ b/src/popup/app/vault/views/vaultViewFolder.html @@ -32,6 +32,10 @@ data-clipboard-text="{{login.username}}" ng-class="{'disabled': !login.username}"> + + + {{login.name}}