mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
rename browser utils to platform utils
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
angular
|
||||
.module('bit.accounts')
|
||||
|
||||
.controller('accountsHintController', function ($scope, $state, apiService, toastr, $q, browserUtilsService,
|
||||
.controller('accountsHintController', function ($scope, $state, apiService, toastr, $q, platformUtilsService,
|
||||
$analytics, i18nService, $timeout) {
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
document.getElementById('email').focus();
|
||||
}, 500);
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ angular
|
||||
.module('bit.accounts')
|
||||
|
||||
.controller('accountsLoginController', function ($scope, $state, $stateParams, authService, userService, toastr,
|
||||
browserUtilsService, $analytics, i18nService, $timeout) {
|
||||
platformUtilsService, $analytics, i18nService, $timeout) {
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
if ($stateParams.email) {
|
||||
document.getElementById('master-password').focus();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
angular
|
||||
.module('bit.accounts')
|
||||
|
||||
.controller('accountsLoginTwoFactorController', function ($scope, $state, authService, toastr, browserUtilsService, SweetAlert,
|
||||
.controller('accountsLoginTwoFactorController', function ($scope, $state, authService, toastr, platformUtilsService,
|
||||
$analytics, i18nService, $stateParams, $filter, constantsService, $timeout, $window, cryptoService, apiService,
|
||||
environmentService) {
|
||||
environmentService, SweetAlert) {
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
|
||||
$scope.i18n = i18nService;
|
||||
@@ -130,7 +130,7 @@ angular
|
||||
var provider = $filter('filter')(constants.twoFactorProviderInfo, { type: keys[i], active: true });
|
||||
if (provider.length && provider[0].priority > providerPriority) {
|
||||
if (provider[0].type == constants.twoFactorProvider.u2f && (typeof $window.u2f === 'undefined') &&
|
||||
!browserUtilsService.isChrome() && !browserUtilsService.isOpera()) {
|
||||
!platformUtilsService.isChrome() && !platformUtilsService.isOpera()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -183,8 +183,9 @@ angular
|
||||
params = providers[constants.twoFactorProvider.email];
|
||||
$scope.twoFactorEmail = params.Email;
|
||||
|
||||
if (chrome.extension.getViews({ type: 'popup' }).length > 0 && !browserUtilsService.inSidebar($window) &&
|
||||
!browserUtilsService.inTab($window) && !browserUtilsService.inPopout($window)) {
|
||||
if (chrome.extension.getViews({ type: 'popup' }).length > 0 &&
|
||||
!platformUtilsService.inSidebar($window) && !platformUtilsService.inTab($window) &&
|
||||
!platformUtilsService.inPopout($window)) {
|
||||
SweetAlert.swal({
|
||||
title: i18nService.twoStepLogin,
|
||||
text: i18nService.popup2faCloseMessage,
|
||||
|
||||
@@ -3,9 +3,10 @@ angular
|
||||
|
||||
.controller(
|
||||
'accountsRegisterController',
|
||||
function ($scope, $state, cryptoService, toastr, $q, apiService, browserUtilsService, $analytics, i18nService, $timeout) {
|
||||
function ($scope, $state, cryptoService, toastr, $q, apiService, platformUtilsService, $analytics,
|
||||
i18nService, $timeout) {
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
document.getElementById('email').focus();
|
||||
}, 500);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ angular
|
||||
add(constants.twoFactorProvider.duo);
|
||||
}
|
||||
if (providers.hasOwnProperty(constants.twoFactorProvider.u2f) &&
|
||||
(browserUtilsService.isChrome() || browserUtilsService.isOpera())) {
|
||||
(platformUtilsService.isChrome() || platformUtilsService.isOpera())) {
|
||||
add(constants.twoFactorProvider.u2f);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as template from './action-buttons.component.html';
|
||||
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
|
||||
export class ActionButtonsController implements ng.IController {
|
||||
onView: Function;
|
||||
@@ -11,7 +11,7 @@ export 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 browserUtilsService: BrowserUtilsService) {
|
||||
private $timeout: any, private $window: any, private platformUtilsService: PlatformUtilsService) {
|
||||
this.i18n = i18nService;
|
||||
this.constants = constantsService;
|
||||
}
|
||||
@@ -22,7 +22,7 @@ export class ActionButtonsController implements ng.IController {
|
||||
if (self.cipher.login.uri.startsWith('http://') || self.cipher.login.uri.startsWith('https://')) {
|
||||
self.$analytics.eventTrack('Launched Website From Listing');
|
||||
chrome.tabs.create({ url: self.cipher.login.uri });
|
||||
if (self.browserUtilsService.inPopup(self.$window)) {
|
||||
if (self.platformUtilsService.inPopup(self.$window)) {
|
||||
self.$window.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import * as template from './pop-out.component.html';
|
||||
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
|
||||
export class PopOutController implements ng.IController {
|
||||
i18n: any;
|
||||
|
||||
constructor(private $analytics: any, private $window: any, private browserUtilsService: BrowserUtilsService,
|
||||
constructor(private $analytics: any, private $window: any, private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: any) {
|
||||
this.i18n = i18nService;
|
||||
}
|
||||
@@ -14,7 +14,7 @@ export class PopOutController implements ng.IController {
|
||||
this.$analytics.eventTrack('Expand Vault');
|
||||
|
||||
let href = this.$window.location.href;
|
||||
if (this.browserUtilsService.isEdge()) {
|
||||
if (this.platformUtilsService.isEdge()) {
|
||||
const popupIndex = href.indexOf('/popup/');
|
||||
if (popupIndex > -1) {
|
||||
href = href.substring(popupIndex);
|
||||
@@ -39,7 +39,7 @@ export class PopOutController implements ng.IController {
|
||||
height: bodyRect.height,
|
||||
});
|
||||
|
||||
if (this.browserUtilsService.inPopup(this.$window)) {
|
||||
if (this.platformUtilsService.inPopup(this.$window)) {
|
||||
this.$window.close();
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CipherType } from '../../../enums/cipherType.enum';
|
||||
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
import { UtilsService } from '../../../services/abstractions/utils.service';
|
||||
import * as template from './current.component.html';
|
||||
|
||||
@@ -18,13 +18,13 @@ export class CurrentController {
|
||||
inSidebar: boolean = false;
|
||||
disableSearch: boolean = false;
|
||||
|
||||
constructor($scope: any, private cipherService: any, private browserUtilsService: BrowserUtilsService,
|
||||
constructor($scope: any, private cipherService: any, private platformUtilsService: PlatformUtilsService,
|
||||
private utilsService: UtilsService, private toastr: any, private $window: any, private $state: any,
|
||||
private $timeout: any, private autofillService: any, private $analytics: any, private i18nService: any,
|
||||
private $filter: any) {
|
||||
this.i18n = i18nService;
|
||||
this.inSidebar = browserUtilsService.inSidebar($window);
|
||||
this.disableSearch = browserUtilsService.isEdge();
|
||||
this.inSidebar = platformUtilsService.inSidebar($window);
|
||||
this.disableSearch = platformUtilsService.isEdge();
|
||||
|
||||
$scope.$on('syncCompleted', (event: any, successfully: boolean) => {
|
||||
if (this.loaded) {
|
||||
@@ -78,10 +78,10 @@ export class CurrentController {
|
||||
fromBackground: false,
|
||||
}).then((totpCode: string) => {
|
||||
this.$analytics.eventTrack('Autofilled');
|
||||
if (totpCode && this.browserUtilsService.isFirefox()) {
|
||||
if (totpCode && this.platformUtilsService.isFirefox()) {
|
||||
this.utilsService.copyToClipboard(totpCode, document);
|
||||
}
|
||||
if (this.browserUtilsService.inPopup(this.$window)) {
|
||||
if (this.platformUtilsService.inPopup(this.$window)) {
|
||||
this.$window.close();
|
||||
}
|
||||
}).catch(() => {
|
||||
@@ -107,7 +107,7 @@ export class CurrentController {
|
||||
return;
|
||||
}
|
||||
|
||||
this.domain = this.browserUtilsService.getDomain(this.url);
|
||||
this.domain = this.platformUtilsService.getDomain(this.url);
|
||||
|
||||
chrome.tabs.sendMessage(tabs[0].id, {
|
||||
command: 'collectPageDetails',
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
import * as angular from 'angular';
|
||||
import * as template from './lock.component.html';
|
||||
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { CryptoService } from '../../../services/abstractions/crypto.service';
|
||||
import { MessagingService } from '../../../services/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
|
||||
export class LockController {
|
||||
i18n: any;
|
||||
masterPassword: string;
|
||||
|
||||
constructor(public $state: any, public i18nService: any, private $timeout: any,
|
||||
private browserUtilsService: BrowserUtilsService, public cryptoService: CryptoService, public toastr: any,
|
||||
private platformUtilsService: PlatformUtilsService, public cryptoService: CryptoService, public toastr: any,
|
||||
public userService: any, public messagingService: MessagingService, public SweetAlert: any) {
|
||||
this.i18n = i18nService;
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
this.$timeout(() => {
|
||||
this.browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
this.platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
document.getElementById('master-password').focus();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { DeviceRequest } from '../../../models/request/deviceRequest';
|
||||
import { TokenRequest } from '../../../models/request/tokenRequest';
|
||||
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { CryptoService } from '../../../services/abstractions/crypto.service';
|
||||
import { MessagingService } from '../../../services/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
|
||||
class AuthService {
|
||||
constructor(public cryptoService: CryptoService, public apiService: any, public userService: any,
|
||||
public tokenService: any, public $rootScope: any, public appIdService: any,
|
||||
public browserUtilsService: BrowserUtilsService, public constantsService: any,
|
||||
public platformUtilsService: PlatformUtilsService, public constantsService: any,
|
||||
public messagingService: MessagingService) {
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class AuthService {
|
||||
const storedTwoFactorToken = await this.tokenService.getTwoFactorToken(email);
|
||||
const hashedPassword = await this.cryptoService.hashPassword(masterPassword, key);
|
||||
|
||||
const deviceRequest = new DeviceRequest(appId, this.browserUtilsService);
|
||||
const deviceRequest = new DeviceRequest(appId, this.platformUtilsService);
|
||||
|
||||
let request: TokenRequest;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { CryptoService } from '../../../services/abstractions/crypto.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
import { StorageService } from '../../../services/abstractions/storage.service';
|
||||
import { UtilsService } from '../../../services/abstractions/utils.service';
|
||||
|
||||
@@ -20,7 +20,7 @@ export const cipherService = getBackgroundService<CryptoService>('cipherService'
|
||||
export const syncService = getBackgroundService<any>('syncService');
|
||||
export const autofillService = getBackgroundService<any>('autofillService');
|
||||
export const passwordGenerationService = getBackgroundService<any>('passwordGenerationService');
|
||||
export const browserUtilsService = getBackgroundService<BrowserUtilsService>('browserUtilsService');
|
||||
export const platformUtilsService = getBackgroundService<PlatformUtilsService>('platformUtilsService');
|
||||
export const utilsService = getBackgroundService<UtilsService>('utilsService');
|
||||
export const appIdService = getBackgroundService<any>('appIdService');
|
||||
export const i18nService = getBackgroundService<any>('i18nService');
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ValidationService } from './validation.service';
|
||||
|
||||
import BrowserMessagingService from '../../../services/browserMessaging.service';
|
||||
|
||||
const messagingService = new BrowserMessagingService(backgroundServices.browserUtilsService());
|
||||
const messagingService = new BrowserMessagingService(backgroundServices.platformUtilsService());
|
||||
|
||||
export default angular
|
||||
.module('bit.services', ['toastr'])
|
||||
@@ -25,7 +25,7 @@ export default angular
|
||||
.factory('syncService', backgroundServices.syncService)
|
||||
.factory('autofillService', backgroundServices.autofillService)
|
||||
.factory('passwordGenerationService', backgroundServices.passwordGenerationService)
|
||||
.factory('browserUtilsService', backgroundServices.browserUtilsService)
|
||||
.factory('platformUtilsService', backgroundServices.platformUtilsService)
|
||||
.factory('utilsService', backgroundServices.utilsService)
|
||||
.factory('appIdService', backgroundServices.appIdService)
|
||||
.factory('i18nService', backgroundServices.i18nService)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import * as angular from 'angular';
|
||||
import BrowserUtilsService from '../../../services/browserUtils.service';
|
||||
import * as template from './environment.component.html';
|
||||
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
|
||||
export class EnvironmentController {
|
||||
iconsUrl: string;
|
||||
identityUrl: string;
|
||||
@@ -10,12 +11,12 @@ export class EnvironmentController {
|
||||
baseUrl: string;
|
||||
i18n: any;
|
||||
|
||||
constructor(private i18nService: any, private $analytics: any, browserUtilsService: BrowserUtilsService,
|
||||
constructor(private i18nService: any, private $analytics: any, platformUtilsService: PlatformUtilsService,
|
||||
private environmentService: any, private toastr: any, private $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
$timeout(() => {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
|
||||
this.baseUrl = environmentService.baseUrl || '';
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as angular from 'angular';
|
||||
import { Folder } from '../../../../models/domain/folder';
|
||||
import * as template from './add-folder.component.html';
|
||||
|
||||
import { BrowserUtilsService } from '../../../../services/abstractions/browserUtils.service';
|
||||
import { PlatformUtilsService } from '../../../../services/abstractions/platformUtils.service';
|
||||
|
||||
export class AddFolderController {
|
||||
savePromise: any;
|
||||
@@ -10,9 +10,10 @@ export class AddFolderController {
|
||||
i18n: any;
|
||||
|
||||
constructor(private folderService: any, private $state: any, private toastr: any,
|
||||
browserUtilsService: BrowserUtilsService, private $analytics: any, private i18nService: any, $timeout: any) {
|
||||
platformUtilsService: PlatformUtilsService, private $analytics: any, private i18nService: any,
|
||||
$timeout: any) {
|
||||
$timeout(() => {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
document.getElementById('name').focus();
|
||||
}, 500);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as angular from 'angular';
|
||||
import { Folder } from '../../../../models/domain/folder';
|
||||
import * as template from './edit-folder.component.html';
|
||||
|
||||
import { BrowserUtilsService } from '../../../../services/abstractions/browserUtils.service';
|
||||
import { PlatformUtilsService } from '../../../../services/abstractions/platformUtils.service';
|
||||
|
||||
export class EditFolderController {
|
||||
$transition$: any;
|
||||
@@ -12,12 +12,12 @@ export class EditFolderController {
|
||||
folder: Folder;
|
||||
|
||||
constructor($scope: any, $stateParams: any, private folderService: any, private toastr: any, private $state: any,
|
||||
private SweetAlert: any, browserUtilsService: BrowserUtilsService, private $analytics: any,
|
||||
private SweetAlert: any, platformUtilsService: PlatformUtilsService, private $analytics: any,
|
||||
private i18nService: any, $timeout: any) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
$timeout(() => {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
document.getElementById('name').focus();
|
||||
}, 500);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as angular from 'angular';
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { MessagingService } from '../../../services/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
import { StorageService } from '../../../services/abstractions/storage.service';
|
||||
import StateService from '../services/state.service';
|
||||
import * as template from './options.component.html';
|
||||
@@ -15,13 +15,13 @@ export class OptionsController {
|
||||
i18n: any;
|
||||
|
||||
constructor(private i18nService: any, private $analytics: any, private constantsService: any,
|
||||
private browserUtilsService: BrowserUtilsService, private totpService: any, private stateService: StateService,
|
||||
private storageService: StorageService, public messagingService: MessagingService,
|
||||
private $timeout: ng.ITimeoutService) {
|
||||
private platformUtilsService: PlatformUtilsService, private totpService: any,
|
||||
private stateService: StateService, private storageService: StorageService,
|
||||
public messagingService: MessagingService, private $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
$timeout(() => {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
|
||||
this.loadSettings();
|
||||
@@ -33,7 +33,7 @@ export class OptionsController {
|
||||
|
||||
const disableGa = await this.storageService.get<boolean>(
|
||||
this.constantsService.disableGaKey);
|
||||
this.disableGa = disableGa || (this.browserUtilsService.isFirefox() && disableGa === undefined);
|
||||
this.disableGa = disableGa || (this.platformUtilsService.isFirefox() && disableGa === undefined);
|
||||
|
||||
this.disableAddLoginNotification = await this.storageService.get<boolean>(
|
||||
this.constantsService.disableAddLoginNotificationKey);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as angular from 'angular';
|
||||
import { DeviceType } from '../../../enums/deviceType.enum';
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { CryptoService } from '../../../services/abstractions/crypto.service';
|
||||
import { MessagingService } from '../../../services/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
import { StorageService } from '../../../services/abstractions/storage.service';
|
||||
import ConstantsService from '../../../services/constants.service';
|
||||
|
||||
@@ -28,17 +28,17 @@ export class SettingsController {
|
||||
i18n: any;
|
||||
showOnLocked: boolean;
|
||||
|
||||
constructor(private $state: any, private SweetAlert: any, private browserUtilsService: BrowserUtilsService,
|
||||
constructor(private $state: any, private SweetAlert: any, private platformUtilsService: PlatformUtilsService,
|
||||
private $analytics: any, private i18nService: any, private constantsService: ConstantsService,
|
||||
private cryptoService: CryptoService, private lockService: any, private storageService: StorageService,
|
||||
public messagingService: MessagingService, private $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
$timeout(() => {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
|
||||
this.showOnLocked = !browserUtilsService.isFirefox() && !browserUtilsService.isEdge();
|
||||
this.showOnLocked = !platformUtilsService.isFirefox() && !platformUtilsService.isEdge();
|
||||
this.storageService.get(constantsService.lockOptionKey).then((lockOption: number) => {
|
||||
if (lockOption != null) {
|
||||
let option = lockOption.toString();
|
||||
@@ -147,7 +147,7 @@ export class SettingsController {
|
||||
rate() {
|
||||
this.$analytics.eventTrack('Rate Extension');
|
||||
chrome.tabs.create({
|
||||
url: RateUrls[this.browserUtilsService.getDevice()],
|
||||
url: RateUrls[this.platformUtilsService.getDevice()],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as angular from 'angular';
|
||||
import * as template from './password-generator.component.html';
|
||||
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
|
||||
export class PasswordGeneratorController {
|
||||
$transition$: any;
|
||||
@@ -13,8 +13,8 @@ export class PasswordGeneratorController {
|
||||
i18n: any;
|
||||
|
||||
constructor(private $state: any, private passwordGenerationService: any,
|
||||
private toastr: any, private browserUtilsService: BrowserUtilsService, private $analytics: any,
|
||||
private i18nService: any, private $timeout: any) {
|
||||
private toastr: any, private platformUtilsService: PlatformUtilsService, private $analytics: any,
|
||||
private i18nService: any, private $timeout: any) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
passwordGenerationService.getOptions().then((options: any) => {
|
||||
@@ -42,7 +42,7 @@ export class PasswordGeneratorController {
|
||||
this.showSelect = this.addState || this.editState;
|
||||
|
||||
this.$timeout(() => {
|
||||
this.browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
this.platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as template from './tools.component.html';
|
||||
|
||||
import { BrowserUtilsService } from '../../../services/abstractions/browserUtils.service';
|
||||
import { PlatformUtilsService } from '../../../services/abstractions/platformUtils.service';
|
||||
|
||||
export class ToolsController {
|
||||
showExport: boolean;
|
||||
@@ -8,10 +8,10 @@ export class ToolsController {
|
||||
private webVaultBaseUrl: string = 'https://vault.bitwarden.com';
|
||||
|
||||
constructor(private SweetAlert: any, private i18nService: any,
|
||||
private $analytics: any, private browserUtilsService: BrowserUtilsService,
|
||||
private $analytics: any, private platformUtilsService: PlatformUtilsService,
|
||||
private environmentService: any) {
|
||||
this.i18n = i18nService;
|
||||
this.showExport = !browserUtilsService.isEdge();
|
||||
this.showExport = !platformUtilsService.isEdge();
|
||||
if (environmentService.baseUrl) {
|
||||
this.webVaultBaseUrl = environmentService.baseUrl;
|
||||
} else if (environmentService.webVaultUrl) {
|
||||
|
||||
@@ -2,7 +2,7 @@ angular
|
||||
.module('bit.vault')
|
||||
|
||||
.controller('vaultAddCipherController', function ($scope, $state, $stateParams, cipherService, folderService,
|
||||
cryptoService, toastr, browserUtilsService, $analytics, i18nService, constantsService, $timeout) {
|
||||
cryptoService, toastr, platformUtilsService, $analytics, i18nService, constantsService, $timeout) {
|
||||
$scope.i18n = i18nService;
|
||||
$scope.constants = constantsService;
|
||||
$scope.addFieldType = constantsService.fieldType.text.toString();
|
||||
@@ -31,7 +31,7 @@ angular
|
||||
}
|
||||
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
|
||||
if (!$stateParams.cipher && $scope.cipher.name && $scope.cipher.login && $scope.cipher.login.uri) {
|
||||
document.getElementById('loginUsername').focus();
|
||||
@@ -49,7 +49,7 @@ angular
|
||||
$scope.cipher.type = parseInt($scope.selectedType);
|
||||
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
@@ -106,7 +106,7 @@ angular
|
||||
});
|
||||
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ angular
|
||||
.module('bit.vault')
|
||||
|
||||
.controller('vaultAttachmentsController', function ($scope, $state, $stateParams, cipherService, toastr,
|
||||
SweetAlert, browserUtilsService, $analytics, i18nService, cryptoService, tokenService, $timeout) {
|
||||
SweetAlert, platformUtilsService, $analytics, i18nService, cryptoService, tokenService, $timeout) {
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
|
||||
$scope.i18n = i18nService;
|
||||
|
||||
@@ -2,14 +2,14 @@ angular
|
||||
.module('bit.vault')
|
||||
|
||||
.controller('vaultController', function ($scope, $rootScope, cipherService, folderService, $q, $state, $stateParams, toastr,
|
||||
syncService, browserUtilsService, $analytics, i18nService, stateService, $timeout, $window, collectionService, $filter) {
|
||||
syncService, platformUtilsService, $analytics, i18nService, stateService, $timeout, $window, collectionService, $filter) {
|
||||
var stateKey = 'vault',
|
||||
state = stateService.getState(stateKey) || {};
|
||||
stateService.removeState('viewGrouping');
|
||||
|
||||
$scope.i18n = i18nService;
|
||||
$scope.showGroupingCounts = !browserUtilsService.isEdge();
|
||||
$scope.disableSearch = browserUtilsService.isEdge();
|
||||
$scope.showGroupingCounts = !platformUtilsService.isEdge();
|
||||
$scope.disableSearch = platformUtilsService.isEdge();
|
||||
document.getElementById('search').focus();
|
||||
|
||||
var syncOnLoad = $stateParams.syncOnLoad;
|
||||
|
||||
@@ -2,15 +2,15 @@ angular
|
||||
.module('bit.vault')
|
||||
|
||||
.controller('vaultEditCipherController', function ($scope, $state, $stateParams, cipherService, folderService,
|
||||
cryptoService, toastr, SweetAlert, browserUtilsService, $analytics, i18nService, constantsService, $timeout) {
|
||||
cryptoService, toastr, SweetAlert, platformUtilsService, $analytics, i18nService, constantsService, $timeout) {
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
document.getElementById('name').focus();
|
||||
}, 500);
|
||||
|
||||
$scope.i18n = i18nService;
|
||||
$scope.constants = constantsService;
|
||||
$scope.showAttachments = !browserUtilsService.isEdge();
|
||||
$scope.showAttachments = !platformUtilsService.isEdge();
|
||||
$scope.addFieldType = constantsService.fieldType.text.toString();
|
||||
$scope.selectedType = constantsService.cipherType.login.toString();
|
||||
var cipherId = $stateParams.cipherId;
|
||||
@@ -40,7 +40,7 @@ angular
|
||||
$scope.cipher.type = parseInt($scope.selectedType);
|
||||
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
@@ -123,7 +123,7 @@ angular
|
||||
});
|
||||
|
||||
$timeout(function () {
|
||||
browserUtilsService.initListSectionItemListeners(document, angular);
|
||||
platformUtilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ angular
|
||||
.module('bit.vault')
|
||||
|
||||
.controller('vaultViewCipherController', function ($scope, $state, $stateParams, cipherService, toastr,
|
||||
$analytics, i18nService, browserUtilsService, totpService, $timeout, tokenService, $window, cryptoService, SweetAlert,
|
||||
$analytics, i18nService, platformUtilsService, totpService, $timeout, tokenService, $window, cryptoService, SweetAlert,
|
||||
constantsService) {
|
||||
$scope.constants = constantsService;
|
||||
$scope.i18n = i18nService;
|
||||
$scope.showAttachments = !browserUtilsService.isEdge();
|
||||
$scope.showAttachments = !platformUtilsService.isEdge();
|
||||
var from = $stateParams.from,
|
||||
totpInterval = null;
|
||||
|
||||
@@ -30,7 +30,7 @@ angular
|
||||
|
||||
if (model.login.uri) {
|
||||
$scope.cipher.showLaunch = model.login.uri.startsWith('http://') || model.login.uri.startsWith('https://');
|
||||
var domain = browserUtilsService.getDomain(model.login.uri);
|
||||
var domain = platformUtilsService.getDomain(model.login.uri);
|
||||
if (domain) {
|
||||
$scope.cipher.login.website = domain;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ angular
|
||||
.module('bit.vault')
|
||||
|
||||
.controller('vaultViewGroupingController', function ($scope, cipherService, folderService, $q, $state, $stateParams, toastr,
|
||||
syncService, $analytics, i18nService, stateService, browserUtilsService, $timeout, $window, collectionService) {
|
||||
syncService, $analytics, i18nService, stateService, platformUtilsService, $timeout, $window, collectionService) {
|
||||
var stateKey = 'viewGrouping',
|
||||
state = stateService.getState(stateKey) || {};
|
||||
|
||||
@@ -60,7 +60,7 @@ angular
|
||||
|
||||
var cipherPromise = cipherService.getAllDecryptedForGrouping($scope.grouping.id, $scope.folderGrouping)
|
||||
.then(function (ciphers) {
|
||||
if (browserUtilsService.isEdge()) {
|
||||
if (platformUtilsService.isEdge()) {
|
||||
// Edge is super slow at sorting
|
||||
decCiphers = ciphers;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user