mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-29 22:31:29 +01:00
$inject strings for all controllers/services
This commit is contained in:
parent
3ec7768a13
commit
fda077cccd
@ -4,7 +4,7 @@ import { BrowserApi } from '../../../browser/browserApi';
|
||||
|
||||
import { ConstantsService } from 'jslib/services/constants.service';
|
||||
|
||||
import PopupUtilsService from '../services/popupUtils.service';
|
||||
import { PopupUtilsService } from '../services/popupUtils.service';
|
||||
|
||||
export class ActionButtonsController implements ng.IController {
|
||||
onView: Function;
|
||||
@ -44,7 +44,6 @@ export class ActionButtonsController implements ng.IController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ActionButtonsController.$inject = ['i18nService', '$analytics', 'constantsService', 'toastr', '$timeout', '$window'];
|
||||
|
||||
export const ActionButtonsComponent = {
|
||||
|
@ -4,7 +4,7 @@ import { BrowserApi } from '../../../browser/browserApi';
|
||||
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
|
||||
import PopupUtilsService from '../services/popupUtils.service';
|
||||
import { PopupUtilsService } from '../services/popupUtils.service';
|
||||
|
||||
export class PopOutController implements ng.IController {
|
||||
i18n: any;
|
||||
@ -59,6 +59,8 @@ export class PopOutController implements ng.IController {
|
||||
}
|
||||
}
|
||||
|
||||
PopOutController.$inject = ['$analytics', '$window', 'platformUtilsService', 'i18nService'];
|
||||
|
||||
export const PopOutComponent = {
|
||||
bindings: {},
|
||||
controller: PopOutController,
|
||||
|
@ -10,7 +10,7 @@ import { UtilsService } from 'jslib/abstractions/utils.service';
|
||||
|
||||
import { AutofillService } from '../../../services/abstractions/autofill.service';
|
||||
|
||||
import PopupUtilsService from '../services/popupUtils.service';
|
||||
import { PopupUtilsService } from '../services/popupUtils.service';
|
||||
|
||||
export class CurrentController {
|
||||
i18n: any;
|
||||
|
@ -1,11 +1,10 @@
|
||||
import { ValidationService } from '../services/validation.service';
|
||||
import { ValidationService } from '../services/validation.service';
|
||||
|
||||
export function BitFormDirective($rootScope: ng.IRootScopeService, validationService: ValidationService) {
|
||||
return {
|
||||
require: 'form',
|
||||
restrict: 'A',
|
||||
link: (scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes,
|
||||
formCtrl: ng.IFormController) => {
|
||||
link: (scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, formCtrl: ng.IFormController) => {
|
||||
const watchPromise = attrs.bitForm || null;
|
||||
if (watchPromise) {
|
||||
scope.$watch(watchPromise, formSubmitted.bind(null, formCtrl, scope));
|
||||
|
@ -1,5 +1,7 @@
|
||||
export class BaseController implements ng.IController {
|
||||
export class BaseController implements ng.IController {
|
||||
constructor($scope: any, i18nService: any) {
|
||||
$scope.i18n = i18nService;
|
||||
}
|
||||
}
|
||||
|
||||
BaseController.$inject = ['$scope', 'i18nService'];
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { BrowserApi } from '../../../browser/browserApi';
|
||||
|
||||
import AuthService from '../services/auth.service';
|
||||
import { AuthService } from '../services/auth.service';
|
||||
|
||||
import { UtilsService } from 'jslib/abstractions/utils.service';
|
||||
|
||||
@ -51,3 +51,6 @@ export class MainController implements ng.IController {
|
||||
BrowserApi.messageListener($window.bitwardenPopupMainMessageListener);
|
||||
}
|
||||
}
|
||||
|
||||
MainController.$inject = ['$scope', '$transitions', '$state', 'authService', 'toastr', 'i18nService', '$analytics',
|
||||
'utilsService', '$window'];
|
||||
|
@ -9,3 +9,5 @@ export class PrivateModeController implements ng.IController {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
PrivateModeController.$inject = ['$scope'];
|
||||
|
@ -5,7 +5,7 @@ import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
|
||||
import PopupUtilsService from '../services/popupUtils.service';
|
||||
import { PopupUtilsService } from '../services/popupUtils.service';
|
||||
|
||||
export class LockController {
|
||||
i18n: any;
|
||||
@ -59,6 +59,9 @@ export class LockController {
|
||||
}
|
||||
}
|
||||
|
||||
LockController.$inject = ['$state', 'i18nService', '$timeout', 'cryptoService', 'toastr', 'userService',
|
||||
'messagingService', 'SweetAlert'];
|
||||
|
||||
export const LockComponent = {
|
||||
bindings: {},
|
||||
controller: LockController,
|
||||
|
@ -11,7 +11,7 @@ import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { TokenService } from 'jslib/abstractions/token.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
|
||||
class AuthService {
|
||||
export class AuthService {
|
||||
constructor(public cryptoService: CryptoService, public apiService: ApiService, public userService: UserService,
|
||||
public tokenService: TokenService, public $rootScope: any, public appIdService: AppIdService,
|
||||
public platformUtilsService: PlatformUtilsService, public constantsService: ConstantsService,
|
||||
@ -80,4 +80,5 @@ class AuthService {
|
||||
}
|
||||
}
|
||||
|
||||
export default AuthService;
|
||||
AuthService.$inject = ['cryptoService', 'apiService', 'userService', 'tokenService', '$rootScope', 'appIdService',
|
||||
'platformUtilsService', 'constantsService', 'messagingService'];
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default class PopupUtilsService {
|
||||
export class PopupUtilsService {
|
||||
static initListSectionItemListeners(doc: Document, angular: any): void {
|
||||
if (!doc) {
|
||||
throw new Error('doc parameter required');
|
||||
|
@ -1,8 +1,8 @@
|
||||
import * as angular from 'angular';
|
||||
import AuthService from './auth.service';
|
||||
import { AuthService } from './auth.service';
|
||||
import * as backgroundServices from './background.service';
|
||||
import PopupUtilsService from './popupUtils.service';
|
||||
import StateService from './state.service';
|
||||
import { PopupUtilsService } from './popupUtils.service';
|
||||
import { StateService } from './state.service';
|
||||
import { ValidationService } from './validation.service';
|
||||
|
||||
import BrowserMessagingService from '../../../services/browserMessaging.service';
|
||||
|
@ -2,7 +2,7 @@ import { ConstantsService } from 'jslib/services/constants.service';
|
||||
|
||||
import { StorageService } from 'jslib/abstractions/storage.service';
|
||||
|
||||
class StateService {
|
||||
export class StateService {
|
||||
private state: any = {};
|
||||
|
||||
constructor(private storageService: StorageService, private constantsService: ConstantsService) {
|
||||
@ -34,4 +34,4 @@ class StateService {
|
||||
}
|
||||
}
|
||||
|
||||
export default StateService;
|
||||
StateService.$inject = ['storageService', 'constantsService'];
|
||||
|
@ -32,3 +32,5 @@ export class ValidationService {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ValidationService.$inject = ['toastr', 'i18nService'];
|
||||
|
@ -14,6 +14,8 @@ export class AboutController {
|
||||
}
|
||||
}
|
||||
|
||||
AboutController.$inject = ['i18nService'];
|
||||
|
||||
export const AboutComponent = {
|
||||
bindings: {},
|
||||
controller: AboutController,
|
||||
|
@ -15,6 +15,8 @@ export class CreditsController {
|
||||
}
|
||||
}
|
||||
|
||||
CreditsController.$inject = ['i18nService', '$analytics'];
|
||||
|
||||
export const CreditsComponent = {
|
||||
bindings: {},
|
||||
controller: CreditsController,
|
||||
|
@ -3,7 +3,7 @@ import * as template from './environment.component.html';
|
||||
|
||||
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
||||
|
||||
import PopupUtilsService from '../services/popupUtils.service';
|
||||
import { PopupUtilsService } from '../services/popupUtils.service';
|
||||
|
||||
export class EnvironmentController {
|
||||
iconsUrl: string;
|
||||
@ -13,8 +13,8 @@ export class EnvironmentController {
|
||||
baseUrl: string;
|
||||
i18n: any;
|
||||
|
||||
constructor(private i18nService: any, private $analytics: any,
|
||||
private environmentService: EnvironmentService, private toastr: any, private $timeout: ng.ITimeoutService) {
|
||||
constructor(private i18nService: any, private $analytics: any, private environmentService: EnvironmentService,
|
||||
private toastr: any, private $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
$timeout(() => {
|
||||
@ -51,6 +51,8 @@ export class EnvironmentController {
|
||||
}
|
||||
}
|
||||
|
||||
EnvironmentController.$inject = ['i18nService', '$analytics', 'environmentService', 'toastr', '$timeout'];
|
||||
|
||||
export const EnvironmentComponent = {
|
||||
bindings: {},
|
||||
controller: EnvironmentController,
|
||||
|
@ -5,7 +5,7 @@ import { Folder } from 'jslib/models/domain/folder';
|
||||
|
||||
import { FolderService } from 'jslib/abstractions/folder.service';
|
||||
|
||||
import PopupUtilsService from '../../services/popupUtils.service';
|
||||
import { PopupUtilsService } from '../../services/popupUtils.service';
|
||||
|
||||
export class AddFolderController {
|
||||
savePromise: any;
|
||||
@ -40,6 +40,8 @@ export class AddFolderController {
|
||||
}
|
||||
}
|
||||
|
||||
AddFolderController.$inject = ['folderService', '$state', 'toastr', '$analytics', 'i18nService', '$timeout'];
|
||||
|
||||
export const AddFolderComponent = {
|
||||
bindings: {},
|
||||
controller: AddFolderController,
|
||||
|
@ -5,7 +5,7 @@ import { Folder } from 'jslib/models/domain/folder';
|
||||
|
||||
import { FolderService } from 'jslib/abstractions/folder.service';
|
||||
|
||||
import PopupUtilsService from '../../services/popupUtils.service';
|
||||
import { PopupUtilsService } from '../../services/popupUtils.service';
|
||||
|
||||
export class EditFolderController {
|
||||
$transition$: any;
|
||||
@ -72,6 +72,9 @@ export class EditFolderController {
|
||||
}
|
||||
}
|
||||
|
||||
EditFolderController.$inject = ['$scope', '$stateParams', 'folderService', 'toastr', '$state', 'SweetAlert',
|
||||
'$analytics', 'i18nService', '$timeout'];
|
||||
|
||||
export const EditFolderComponent = {
|
||||
bindings: {
|
||||
$transition$: '<',
|
||||
|
@ -35,6 +35,8 @@ export class FoldersController {
|
||||
}
|
||||
}
|
||||
|
||||
FoldersController.$inject = ['folderService', '$state', 'i18nService'];
|
||||
|
||||
export const FoldersComponent = {
|
||||
bindings: {},
|
||||
controller: FoldersController,
|
||||
|
@ -30,6 +30,8 @@ export class HelpController {
|
||||
}
|
||||
}
|
||||
|
||||
HelpController.$inject = ['i18nService', '$analytics'];
|
||||
|
||||
export const HelpComponent = {
|
||||
bindings: {},
|
||||
controller: HelpController,
|
||||
|
@ -8,8 +8,8 @@ import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { StorageService } from 'jslib/abstractions/storage.service';
|
||||
import { TotpService } from 'jslib/abstractions/totp.service';
|
||||
|
||||
import PopupUtilsService from '../services/popupUtils.service';
|
||||
import StateService from '../services/state.service';
|
||||
import { PopupUtilsService } from '../services/popupUtils.service';
|
||||
import { StateService } from '../services/state.service';
|
||||
|
||||
export class OptionsController {
|
||||
disableFavicon = false;
|
||||
@ -95,6 +95,9 @@ export class OptionsController {
|
||||
}
|
||||
}
|
||||
|
||||
OptionsController.$inject = ['i18nService', '$analytics', 'constantsService', 'platformUtilsService', 'totpService',
|
||||
'stateService', 'storageService', 'messagingService', '$timeout'];
|
||||
|
||||
export const OptionsComponent = {
|
||||
bindings: {},
|
||||
controller: OptionsController,
|
||||
|
@ -58,6 +58,9 @@ export class PremiumController {
|
||||
}
|
||||
}
|
||||
|
||||
PremiumController.$inject = ['i18nService', 'tokenService', 'apiService', 'toastr', 'SweetAlert', '$analytics',
|
||||
'$timeout'];
|
||||
|
||||
export const PremiumComponent = {
|
||||
bindings: {},
|
||||
controller: PremiumController,
|
||||
|
@ -13,7 +13,7 @@ import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { StorageService } from 'jslib/abstractions/storage.service';
|
||||
|
||||
import PopupUtilsService from '../services/popupUtils.service';
|
||||
import { PopupUtilsService } from '../services/popupUtils.service';
|
||||
|
||||
const RateUrls = {
|
||||
[DeviceType.Chrome]:
|
||||
@ -161,6 +161,9 @@ export class SettingsController {
|
||||
}
|
||||
}
|
||||
|
||||
SettingsController.$inject = ['$state', 'SweetAlert', 'platformUtilsService', '$analytics', 'i18nService',
|
||||
'constantsService', 'cryptoService', 'lockService', 'storageService', 'messagingService', '$timeout'];
|
||||
|
||||
export const SettingsComponent = {
|
||||
bindings: {},
|
||||
controller: SettingsController,
|
||||
|
@ -154,6 +154,9 @@ export class ExportController {
|
||||
}
|
||||
}
|
||||
|
||||
ExportController.$inject = ['$state', 'cryptoService', 'toastr', 'utilsService', '$analytics', 'i18nService',
|
||||
'folderService', 'cipherService', '$window', 'userService'];
|
||||
|
||||
export const ExportComponent = {
|
||||
bindings: {},
|
||||
controller: ExportController,
|
||||
|
@ -47,6 +47,9 @@ export class PasswordGeneratorHistoryController {
|
||||
}
|
||||
}
|
||||
|
||||
PasswordGeneratorHistoryController.$inject = ['$state', 'passwordGenerationService', 'toastr', '$analytics',
|
||||
'i18nService'];
|
||||
|
||||
export const PasswordGeneratorHistoryComponent = {
|
||||
bindings: {
|
||||
$transition$: '<',
|
||||
|
@ -3,7 +3,7 @@ import * as template from './password-generator.component.html';
|
||||
|
||||
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
|
||||
|
||||
import PopupUtilsService from '../services/popupUtils.service';
|
||||
import { PopupUtilsService } from '../services/popupUtils.service';
|
||||
|
||||
export class PasswordGeneratorController {
|
||||
$transition$: any;
|
||||
@ -15,8 +15,7 @@ export class PasswordGeneratorController {
|
||||
i18n: any;
|
||||
|
||||
constructor(private $state: any, private passwordGenerationService: PasswordGenerationService,
|
||||
private toastr: any, private $analytics: any, private i18nService: any,
|
||||
private $timeout: ng.ITimeoutService) {
|
||||
private toastr: any, private $analytics: any, private i18nService: any, private $timeout: ng.ITimeoutService) {
|
||||
this.i18n = i18nService;
|
||||
|
||||
passwordGenerationService.getOptions().then((options: any) => {
|
||||
@ -136,6 +135,9 @@ export class PasswordGeneratorController {
|
||||
}
|
||||
}
|
||||
|
||||
PasswordGeneratorController.$inject = ['$state', 'passwordGenerationService', 'toastr', '$analytics', 'i18nService',
|
||||
'$timeout'];
|
||||
|
||||
export const PasswordGeneratorComponent = {
|
||||
bindings: {
|
||||
$transition$: '<',
|
||||
|
@ -11,9 +11,8 @@ export class ToolsController {
|
||||
i18n: any;
|
||||
private webVaultBaseUrl: string = 'https://vault.bitwarden.com';
|
||||
|
||||
constructor(private SweetAlert: any, private i18nService: any,
|
||||
private $analytics: any, private platformUtilsService: PlatformUtilsService,
|
||||
private environmentService: EnvironmentService) {
|
||||
constructor(private SweetAlert: any, private i18nService: any, private $analytics: any,
|
||||
private platformUtilsService: PlatformUtilsService, private environmentService: EnvironmentService) {
|
||||
this.i18n = i18nService;
|
||||
this.showExport = !platformUtilsService.isEdge();
|
||||
this.showPopout = !platformUtilsService.isSafari();
|
||||
@ -56,6 +55,8 @@ export class ToolsController {
|
||||
}
|
||||
}
|
||||
|
||||
ToolsController.$inject = ['SweetAlert', 'i18nService', '$analytics', 'platformUtilsService', 'environmentService'];
|
||||
|
||||
export const ToolsComponent = {
|
||||
bindings: {},
|
||||
controller: ToolsController,
|
||||
|
Loading…
Reference in New Issue
Block a user