mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-20 02:01:47 +01:00
lint fixes
This commit is contained in:
parent
51f2c9a30c
commit
9ffbd0bb69
@ -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);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
@ -16,8 +16,7 @@ class IconController implements ng.IController {
|
|||||||
if (!this.iconsUrl) {
|
if (!this.iconsUrl) {
|
||||||
if (environmentService.baseUrl) {
|
if (environmentService.baseUrl) {
|
||||||
this.iconsUrl = environmentService.baseUrl + '/icons';
|
this.iconsUrl = environmentService.baseUrl + '/icons';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
this.iconsUrl = 'https://icons.bitwarden.com';
|
this.iconsUrl = 'https://icons.bitwarden.com';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -51,16 +50,13 @@ class IconController implements ng.IController {
|
|||||||
if (hostnameUri.indexOf('androidapp://') === 0) {
|
if (hostnameUri.indexOf('androidapp://') === 0) {
|
||||||
this.icon = 'fa-android';
|
this.icon = 'fa-android';
|
||||||
this.image = null;
|
this.image = null;
|
||||||
}
|
} else if (hostnameUri.indexOf('iosapp://') === 0) {
|
||||||
else if (hostnameUri.indexOf('iosapp://') === 0) {
|
|
||||||
this.icon = 'fa-apple';
|
this.icon = 'fa-apple';
|
||||||
this.image = null;
|
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;
|
hostnameUri = 'http://' + hostnameUri;
|
||||||
isWebsite = true;
|
isWebsite = true;
|
||||||
}
|
} else if (this.imageEnabled) {
|
||||||
else if (this.imageEnabled) {
|
|
||||||
isWebsite = hostnameUri.indexOf('http') === 0 && hostnameUri.indexOf('.') > -1;
|
isWebsite = hostnameUri.indexOf('http') === 0 && hostnameUri.indexOf('.') > -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,11 +65,9 @@ class IconController implements ng.IController {
|
|||||||
const url = new URL(hostnameUri);
|
const url = new URL(hostnameUri);
|
||||||
this.image = this.iconsUrl + '/' + url.hostname + '/icon.png';
|
this.image = this.iconsUrl + '/' + url.hostname + '/icon.png';
|
||||||
this.fallbackImage = chrome.extension.getURL('images/fa-globe.png');
|
this.fallbackImage = chrome.extension.getURL('images/fa-globe.png');
|
||||||
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
catch (e) { }
|
} else {
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.image = null;
|
this.image = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,8 @@ export default class UtilsService {
|
|||||||
|
|
||||||
if (navigator.userAgent.indexOf('Firefox') !== -1 || navigator.userAgent.indexOf('Gecko/') !== -1) {
|
if (navigator.userAgent.indexOf('Firefox') !== -1 || navigator.userAgent.indexOf('Gecko/') !== -1) {
|
||||||
this.browserCache = Browser.Firefox;
|
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;
|
this.browserCache = Browser.Opera;
|
||||||
} else if (navigator.userAgent.indexOf(' Edge/') !== -1) {
|
} else if (navigator.userAgent.indexOf(' Edge/') !== -1) {
|
||||||
this.browserCache = Browser.Edge;
|
this.browserCache = Browser.Edge;
|
||||||
@ -74,7 +75,8 @@ export default class UtilsService {
|
|||||||
return;
|
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 checkbox = $(this).find('input[type="checkbox"]');
|
||||||
const select = $(this).find('select');
|
const select = $(this).find('select');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user