import { AuthService, AuthStatus, RedirectService, ServerService } from '../core'
import { User } from '../shared/users/user.model'
import { LanguageChooserComponent } from '@app/menu/language-chooser.component'
+import { Hotkey, HotkeysService } from 'angular2-hotkeys'
@Component({
selector: 'my-menu',
user: User
isLoggedIn: boolean
userHasAdminAccess = false
+ hotkeys: Hotkey[]
private routesPerRight = {
[UserRight.MANAGE_USERS]: '/admin/users',
constructor (
private authService: AuthService,
private serverService: ServerService,
- private redirectService: RedirectService
+ private redirectService: RedirectService,
+ private hotkeysService: HotkeysService
) {}
ngOnInit () {
this.previousTheme['submenuColor'] = 'rgb(32,32,32)'
this.previousTheme['inputColor'] = 'gray'
this.previousTheme['inputPlaceholderColor'] = '#fff'
+
+ this.hotkeys = [
+ new Hotkey('T', (event: KeyboardEvent): boolean => {
+ this.toggleDarkTheme()
+ return false
+ }, undefined, 'Toggle Dark theme')
+ ]
+ this.hotkeysService.add(this.hotkeys)
}
isRegistrationAllowed () {