aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--client/src/app/app.module.ts5
-rw-r--r--client/src/app/core/core.module.ts14
-rw-r--r--client/src/app/core/hotkeys/hotkeys.component.ts2
-rw-r--r--client/src/app/core/hotkeys/hotkeys.module.ts23
-rw-r--r--client/src/app/core/hotkeys/index.ts2
5 files changed, 13 insertions, 33 deletions
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index e5a188321..34e890b40 100644
--- a/client/src/app/app.module.ts
+++ b/client/src/app/app.module.ts
@@ -5,8 +5,6 @@ import { ResetPasswordModule } from '@app/reset-password'
5 5
6import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' 6import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
7import { ClipboardModule } from 'ngx-clipboard' 7import { ClipboardModule } from 'ngx-clipboard'
8import { HotkeyModule } from '@app/core/hotkeys'
9import { IHotkeyOptions } from 'angular2-hotkeys'
10import 'focus-visible' 8import 'focus-visible'
11 9
12import { AppRoutingModule } from './app-routing.module' 10import { AppRoutingModule } from './app-routing.module'
@@ -48,9 +46,6 @@ export function metaFactory (serverService: ServerService): MetaLoader {
48 BrowserModule, 46 BrowserModule,
49 // FIXME: https://github.com/maxisam/ngx-clipboard/issues/133 47 // FIXME: https://github.com/maxisam/ngx-clipboard/issues/133
50 ClipboardModule, 48 ClipboardModule,
51 HotkeyModule.forRoot({
52 cheatSheetCloseEsc: true
53 } as IHotkeyOptions),
54 49
55 CoreModule, 50 CoreModule,
56 SharedModule, 51 SharedModule,
diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts
index d4917f902..df2ec696d 100644
--- a/client/src/app/core/core.module.ts
+++ b/client/src/app/core/core.module.ts
@@ -15,6 +15,8 @@ import { throwIfAlreadyLoaded } from './module-import-guard'
15import { LoginGuard, RedirectService, UserRightGuard } from './routing' 15import { LoginGuard, RedirectService, UserRightGuard } from './routing'
16import { ServerService } from './server' 16import { ServerService } from './server'
17import { ThemeService } from './theme' 17import { ThemeService } from './theme'
18import { HotkeyModule } from 'angular2-hotkeys'
19import { CheatSheetComponent } from '@app/core/hotkeys'
18 20
19@NgModule({ 21@NgModule({
20 imports: [ 22 imports: [
@@ -27,11 +29,16 @@ import { ThemeService } from './theme'
27 29
28 LoadingBarHttpClientModule, 30 LoadingBarHttpClientModule,
29 LoadingBarRouterModule, 31 LoadingBarRouterModule,
30 LoadingBarModule.forRoot() 32 LoadingBarModule.forRoot(),
33
34 HotkeyModule.forRoot({
35 cheatSheetCloseEsc: true
36 })
31 ], 37 ],
32 38
33 declarations: [ 39 declarations: [
34 ConfirmComponent 40 ConfirmComponent,
41 CheatSheetComponent
35 ], 42 ],
36 43
37 exports: [ 44 exports: [
@@ -39,7 +46,8 @@ import { ThemeService } from './theme'
39 LoadingBarHttpClientModule, 46 LoadingBarHttpClientModule,
40 LoadingBarModule, 47 LoadingBarModule,
41 48
42 ConfirmComponent 49 ConfirmComponent,
50 CheatSheetComponent
43 ], 51 ],
44 52
45 providers: [ 53 providers: [
diff --git a/client/src/app/core/hotkeys/hotkeys.component.ts b/client/src/app/core/hotkeys/hotkeys.component.ts
index f6f299965..fd62289fa 100644
--- a/client/src/app/core/hotkeys/hotkeys.component.ts
+++ b/client/src/app/core/hotkeys/hotkeys.component.ts
@@ -9,8 +9,8 @@ import { HotkeysService, Hotkey } from 'angular2-hotkeys'
9 styleUrls: [ './hotkeys.component.scss' ] 9 styleUrls: [ './hotkeys.component.scss' ]
10}) 10})
11export class CheatSheetComponent implements OnInit, OnDestroy { 11export class CheatSheetComponent implements OnInit, OnDestroy {
12 helpVisible = false
13 @Input() title = this.i18n('Keyboard Shortcuts:') 12 @Input() title = this.i18n('Keyboard Shortcuts:')
13 helpVisible = false
14 subscription: Subscription 14 subscription: Subscription
15 15
16 hotkeys: Hotkey[] 16 hotkeys: Hotkey[]
diff --git a/client/src/app/core/hotkeys/hotkeys.module.ts b/client/src/app/core/hotkeys/hotkeys.module.ts
deleted file mode 100644
index 7d420587e..000000000
--- a/client/src/app/core/hotkeys/hotkeys.module.ts
+++ /dev/null
@@ -1,23 +0,0 @@
1import { NgModule, ModuleWithProviders } from '@angular/core'
2import { CommonModule } from '@angular/common'
3import { HotkeysDirective, IHotkeyOptions, HotkeyOptions, HotkeysService } from 'angular2-hotkeys'
4import { CheatSheetComponent } from './hotkeys.component'
5
6export * from './hotkeys.component'
7
8@NgModule({
9 imports : [CommonModule],
10 exports : [HotkeysDirective, CheatSheetComponent],
11 declarations : [HotkeysDirective, CheatSheetComponent]
12})
13export class HotkeyModule {
14 static forRoot (options: IHotkeyOptions = {}): ModuleWithProviders {
15 return {
16 ngModule : HotkeyModule,
17 providers : [
18 HotkeysService,
19 { provide : HotkeyOptions, useValue : options }
20 ]
21 }
22 }
23}
diff --git a/client/src/app/core/hotkeys/index.ts b/client/src/app/core/hotkeys/index.ts
index 4f2796766..bd2ab5b7a 100644
--- a/client/src/app/core/hotkeys/index.ts
+++ b/client/src/app/core/hotkeys/index.ts
@@ -1 +1 @@
export * from './hotkeys.module' export * from './hotkeys.component' \ No newline at end of file