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',
private router: Router,
private authService: AuthService,
private serverService: ServerService,
+ private pluginService: PluginService,
private domSanitizer: DomSanitizer,
private redirectService: RedirectService,
private screenService: ScreenService,
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
})
}
+ 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 => {
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'))
])
}
}