From 9ffbd0bb695def91fe38b3868078402ec24656c8 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 1 Nov 2017 13:40:38 -0400 Subject: [PATCH] lint fixes --- src/models/request/tokenRequest.ts | 2 +- .../components/action-buttons.component.ts | 2 +- .../app/components/actionButtonsComponent.js | 41 ------------------- src/popup/app/components/icon.component.ts | 18 +++----- src/services/utils.service.ts | 6 ++- 5 files changed, 12 insertions(+), 57 deletions(-) delete mode 100644 src/popup/app/components/actionButtonsComponent.js diff --git a/src/models/request/tokenRequest.ts b/src/models/request/tokenRequest.ts index b24bd9c35be..084652126b0 100644 --- a/src/models/request/tokenRequest.ts +++ b/src/models/request/tokenRequest.ts @@ -7,7 +7,7 @@ class TokenRequest { device?: any; constructor(email: string, masterPasswordHash: string, provider: number, - token: string, remember: boolean, device?: any) { + token: string, remember: boolean, device?: any) { this.email = email; this.masterPasswordHash = masterPasswordHash; this.token = token; diff --git a/src/popup/app/components/action-buttons.component.ts b/src/popup/app/components/action-buttons.component.ts index 73170f5324d..f5ad0cddbcd 100644 --- a/src/popup/app/components/action-buttons.component.ts +++ b/src/popup/app/components/action-buttons.component.ts @@ -9,7 +9,7 @@ class ActionButtonsController implements ng.IController { constants: any; constructor(private i18nService: any, private $analytics: any, private constantsService: any, private toastr: any, - private $timeout: any, private $window: any, private utilsService: any) { + private $timeout: any, private $window: any, private utilsService: any) { this.i18n = i18nService; this.constants = constantsService; } diff --git a/src/popup/app/components/actionButtonsComponent.js b/src/popup/app/components/actionButtonsComponent.js deleted file mode 100644 index 1bb70e645aa..00000000000 --- a/src/popup/app/components/actionButtonsComponent.js +++ /dev/null @@ -1,41 +0,0 @@ -angular - .module('bit.components') - - .component('actionButtons', { - bindings: { - cipher: '<', - showView: '<', - onView: '&' - }, - templateUrl: 'app/components/views/actionButtons.html', - controller: function (i18nService, $analytics, constantsService, toastr, $timeout, $window, utilsService) { - var ctrl = this; - - ctrl.$onInit = function () { - ctrl.i18n = i18nService; - ctrl.constants = constantsService; - - ctrl.launch = function () { - $timeout(function () { - if (ctrl.cipher.login.uri.startsWith('http://') || ctrl.cipher.login.uri.startsWith('https://')) { - $analytics.eventTrack('Launched Website From Listing'); - chrome.tabs.create({ url: ctrl.cipher.login.uri }); - if (utilsService.inPopup($window)) { - $window.close(); - } - } - }); - }; - - ctrl.clipboardError = function (e) { - toastr.info(i18nService.browserNotSupportClipboard); - }; - - ctrl.clipboardSuccess = function (e, type, aType) { - e.clearSelection(); - $analytics.eventTrack('Copied ' + aType); - toastr.info(type + i18nService.valueCopied); - }; - }; - } - }); diff --git a/src/popup/app/components/icon.component.ts b/src/popup/app/components/icon.component.ts index 0e5276c5cbd..1d7d472dbe3 100644 --- a/src/popup/app/components/icon.component.ts +++ b/src/popup/app/components/icon.component.ts @@ -16,8 +16,7 @@ class IconController implements ng.IController { if (!this.iconsUrl) { if (environmentService.baseUrl) { this.iconsUrl = environmentService.baseUrl + '/icons'; - } - else { + } else { this.iconsUrl = 'https://icons.bitwarden.com'; } } @@ -51,16 +50,13 @@ class IconController implements ng.IController { if (hostnameUri.indexOf('androidapp://') === 0) { this.icon = 'fa-android'; this.image = null; - } - else if (hostnameUri.indexOf('iosapp://') === 0) { + } else if (hostnameUri.indexOf('iosapp://') === 0) { this.icon = 'fa-apple'; this.image = null; - } - else if (this.imageEnabled && hostnameUri.indexOf('://') === -1 && hostnameUri.indexOf('.') > -1) { + } else if (this.imageEnabled && hostnameUri.indexOf('://') === -1 && hostnameUri.indexOf('.') > -1) { hostnameUri = 'http://' + hostnameUri; isWebsite = true; - } - else if (this.imageEnabled) { + } else if (this.imageEnabled) { isWebsite = hostnameUri.indexOf('http') === 0 && hostnameUri.indexOf('.') > -1; } @@ -69,11 +65,9 @@ class IconController implements ng.IController { const url = new URL(hostnameUri); this.image = this.iconsUrl + '/' + url.hostname + '/icon.png'; this.fallbackImage = chrome.extension.getURL('images/fa-globe.png'); - } - catch (e) { } + } catch (e) { } } - } - else { + } else { this.image = null; } } diff --git a/src/services/utils.service.ts b/src/services/utils.service.ts index fd1f5c77070..21ee0f76ba6 100644 --- a/src/services/utils.service.ts +++ b/src/services/utils.service.ts @@ -23,7 +23,8 @@ export default class UtilsService { if (navigator.userAgent.indexOf('Firefox') !== -1 || navigator.userAgent.indexOf('Gecko/') !== -1) { this.browserCache = Browser.Firefox; - } else if ((!!(window as any).opr && !!(window as any).opr.addons) || !!(window as any).opera || navigator.userAgent.indexOf(' OPR/') >= 0) { + } else if ((!!(window as any).opr && !!(window as any).opr.addons) || !!(window as any).opera || + navigator.userAgent.indexOf(' OPR/') >= 0) { this.browserCache = Browser.Opera; } else if (navigator.userAgent.indexOf(' Edge/') !== -1) { this.browserCache = Browser.Edge; @@ -74,7 +75,8 @@ export default class UtilsService { return; } - const text = $(this).find('input, textarea').not('input[type="checkbox"], input[type="radio"], input[type="hidden"]'); + const text = $(this).find('input, textarea') + .not('input[type="checkbox"], input[type="radio"], input[type="hidden"]'); const checkbox = $(this).find('input[type="checkbox"]'); const select = $(this).find('select');