X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fapp.component.ts;h=0ebd628fce46b1f5da440a7276cefa813323f820;hb=503c6f440abc8f5924c38c4bd63591cb6cefacec;hp=915466af73a38c331a1de34f2b7cbbbbee011572;hpb=722bca907b6aa69c3b617221870451ccf436921a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 915466af7..0ebd628fc 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -9,6 +9,7 @@ import { Hotkey, HotkeysService } from 'angular2-hotkeys' import { I18n } from '@ngx-translate/i18n-polyfill' import { fromEvent } from 'rxjs' import { ViewportScroller } from '@angular/common' +import { PluginService } from '@app/core/plugins/plugin.service' @Component({ selector: 'my-app', @@ -27,6 +28,7 @@ export class AppComponent implements OnInit { private router: Router, private authService: AuthService, private serverService: ServerService, + private pluginService: PluginService, private domSanitizer: DomSanitizer, private redirectService: RedirectService, private screenService: ScreenService, @@ -69,6 +71,9 @@ export class AppComponent implements OnInit { this.serverService.loadVideoPrivacies() this.serverService.loadVideoPlaylistPrivacies() + this.loadPlugins() + this.themeService.initialize() + // Do not display menu on small screens if (this.screenService.isInSmallView()) { this.isMenuDisplayed = false @@ -196,6 +201,14 @@ export class AppComponent implements OnInit { }) } + private async loadPlugins () { + this.pluginService.initializePlugins() + + await this.pluginService.loadPluginsByScope('common') + + this.pluginService.runHook('action:application.loaded') + } + private initHotkeys () { this.hotkeysService.add([ new Hotkey(['/', 's'], (event: KeyboardEvent): boolean => { @@ -225,11 +238,7 @@ export class AppComponent implements OnInit { new Hotkey('g u', (event: KeyboardEvent): boolean => { this.router.navigate([ '/videos/upload' ]) return false - }, undefined, this.i18n('Go to the videos upload page')), - new Hotkey('shift+t', (event: KeyboardEvent): boolean => { - this.themeService.toggleDarkTheme() - return false - }, undefined, this.i18n('Toggle Dark theme')) + }, undefined, this.i18n('Go to the videos upload page')) ]) } }