\ No newline at end of file
diff --git a/src/components/popover/popover.component.ts b/src/components/popover/popover.component.ts
index e0edce8b..3abb700f 100644
--- a/src/components/popover/popover.component.ts
+++ b/src/components/popover/popover.component.ts
@@ -16,79 +16,19 @@ import {NgSwitch, NgSwitchCase} from '@angular/common';
import {KeyAction} from '../../../config-serializer/config-items/KeyAction';
-import {KeypressTabComponent} from './tab/keypress-tab.component';
-import {LayerTabComponent} from './tab/layer-tab.component';
-import {MouseTabComponent} from './tab/mouse-tab.component';
-import {MacroTabComponent} from './tab/macro-tab.component';
-import {KeymapTabComponent} from './tab/keymap-tab.component';
-import {NoneTabComponent} from './tab/none-tab.component';
+import {KeypressTabComponent} from './tab/keypress/keypress-tab.component';
+import {LayerTabComponent} from './tab/layer/layer-tab.component';
+import {MouseTabComponent} from './tab/mouse/mouse-tab.component';
+import {MacroTabComponent} from './tab/macro/macro-tab.component';
+import {KeymapTabComponent} from './tab/keymap/keymap-tab.component';
+import {NoneTabComponent} from './tab/none/none-tab.component';
import {KeyActionSaver} from './key-action-saver';
@Component({
moduleId: module.id,
selector: 'popover',
- template:
- `
-
\ No newline at end of file
diff --git a/src/components/popover/tab/keymap-tab.component.scss b/src/components/popover/tab/keymap/keymap-tab.component.scss
similarity index 100%
rename from src/components/popover/tab/keymap-tab.component.scss
rename to src/components/popover/tab/keymap/keymap-tab.component.scss
diff --git a/src/components/popover/tab/keymap-tab.component.ts b/src/components/popover/tab/keymap/keymap-tab.component.ts
similarity index 65%
rename from src/components/popover/tab/keymap-tab.component.ts
rename to src/components/popover/tab/keymap/keymap-tab.component.ts
index 90b06242..b623201f 100644
--- a/src/components/popover/tab/keymap-tab.component.ts
+++ b/src/components/popover/tab/keymap/keymap-tab.component.ts
@@ -1,10 +1,10 @@
import { Component, OnInit } from '@angular/core';
-import {UhkConfigurationService} from '../../../services/uhk-configuration.service';
-import {Keymap} from '../../../../config-serializer/config-items/Keymap';
-import {SvgKeyboardComponent} from '../../svg-keyboard.component';
-import {KeyActionSaver} from '../key-action-saver';
-import {SwitchKeymapAction} from '../../../../config-serializer/config-items/SwitchKeymapAction';
+import {UhkConfigurationService} from '../../../../services/uhk-configuration.service';
+import {Keymap} from '../../../../../config-serializer/config-items/Keymap';
+import {SvgKeyboardComponent} from '../../../svg/keyboard/svg-keyboard.component';
+import {KeyActionSaver} from '../../key-action-saver';
+import {SwitchKeymapAction} from '../../../../../config-serializer/config-items/SwitchKeymapAction';
import {OptionData} from 'ng2-select2/dist/select2';
import {SELECT2_DIRECTIVES} from 'ng2-select2/dist/ng2-select2';
@@ -12,21 +12,7 @@ import {SELECT2_DIRECTIVES} from 'ng2-select2/dist/ng2-select2';
@Component({
moduleId: module.id,
selector: 'keymap-tab',
- template:
- `
-
- Switch to keymap:
-
-
-
-
-
-
-
-
-
- `,
+ template: require('./keymap-tab.component.html'),
styles: [require('./keymap-tab.component.scss')],
directives: [SvgKeyboardComponent, SELECT2_DIRECTIVES]
})
diff --git a/src/components/popover/tab/keypress-tab.component.ts b/src/components/popover/tab/keypress-tab.component.ts
deleted file mode 100644
index bc9c99da..00000000
--- a/src/components/popover/tab/keypress-tab.component.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-import { CaptureKeystrokeButtonComponent } from '../widgets/capture-keystroke-button.component';
-
-import { KeyAction } from '../../../../config-serializer/config-items/KeyAction';
-import { KeystrokeAction } from '../../../../config-serializer/config-items/KeystrokeAction';
-import { KeyActionSaver } from '../key-action-saver';
-
-import {IconComponent} from '../widgets/icon.component';
-
-import {SELECT2_DIRECTIVES} from 'ng2-select2/dist/ng2-select2';
-import {OptionData} from 'ng2-select2/dist/select2';
-
-@Component({
- moduleId: module.id,
- selector: 'keypress-tab',
- template:
- `
-
\ No newline at end of file
diff --git a/src/components/popover/tab/keypress-tab.component.scss b/src/components/popover/tab/keypress/keypress-tab.component.scss
similarity index 100%
rename from src/components/popover/tab/keypress-tab.component.scss
rename to src/components/popover/tab/keypress/keypress-tab.component.scss
diff --git a/src/components/popover/tab/keypress/keypress-tab.component.ts b/src/components/popover/tab/keypress/keypress-tab.component.ts
new file mode 100644
index 00000000..c5486862
--- /dev/null
+++ b/src/components/popover/tab/keypress/keypress-tab.component.ts
@@ -0,0 +1,69 @@
+import { Component, OnInit } from '@angular/core';
+
+import { CaptureKeystrokeButtonComponent } from '../../widgets/capture-keystroke/capture-keystroke-button.component';
+
+import { KeyAction } from '../../../../../config-serializer/config-items/KeyAction';
+import { KeystrokeAction } from '../../../../../config-serializer/config-items/KeystrokeAction';
+import { KeyActionSaver } from '../../key-action-saver';
+
+import {IconComponent} from '../../widgets/icon/icon.component';
+
+import {SELECT2_DIRECTIVES} from 'ng2-select2/dist/ng2-select2';
+import {OptionData} from 'ng2-select2/dist/select2';
+
+@Component({
+ moduleId: module.id,
+ selector: 'keypress-tab',
+ template: require('./keypress-tab.component.html'),
+ styles: [require('./keypress-tab.component.scss')],
+ directives: [CaptureKeystrokeButtonComponent, IconComponent, SELECT2_DIRECTIVES]
+})
+export class KeypressTabComponent implements OnInit, KeyActionSaver {
+ private leftModifiers: string[];
+ private rightModifiers: string[];
+
+ private leftModifierSelects: boolean[];
+ private rightModifierSelects: boolean[];
+
+ private scanCodeGroups: Array;
+ private longPressGroups: Array;
+
+ constructor() {
+ this.leftModifiers = ['LShift', 'LCtrl', 'LSuper', 'LAlt'];
+ this.rightModifiers = ['RShift', 'RCtrl', 'RSuper', 'RAlt'];
+ this.scanCodeGroups = require('json!./scancodes.json');
+ this.longPressGroups = require('json!./longPress.json');
+ }
+
+ ngOnInit() { }
+
+ getKeyAction(): KeystrokeAction {
+ return undefined;
+ }
+
+ keyActionValid(): boolean {
+ return false;
+ }
+
+ toKeyAction(): KeyAction {
+ return undefined;
+ }
+
+ scanCodeTemplateResult: Function = (state: any) => {
+ if (!state.id) {
+ return state.text;
+ }
+
+ if (state.additional && state.additional.explanation) {
+ return jQuery(
+ ''
+ + state.text
+ + ' '
+ + state.additional.explanation
+ + ''
+ );
+ } else {
+ return jQuery('' + state.text + '');
+ }
+ }
+}
diff --git a/src/components/popover/tab/longPress.json b/src/components/popover/tab/keypress/longPress.json
similarity index 100%
rename from src/components/popover/tab/longPress.json
rename to src/components/popover/tab/keypress/longPress.json
diff --git a/src/components/popover/tab/scancodes.json b/src/components/popover/tab/keypress/scancodes.json
similarity index 100%
rename from src/components/popover/tab/scancodes.json
rename to src/components/popover/tab/keypress/scancodes.json
diff --git a/src/components/popover/tab/layer/layer-tab.component.html b/src/components/popover/tab/layer/layer-tab.component.html
new file mode 100644
index 00000000..21e7e8d4
--- /dev/null
+++ b/src/components/popover/tab/layer/layer-tab.component.html
@@ -0,0 +1,7 @@
+
+the
+
+
+ layer by pressing this key.
+ layer by holding this key.
+
\ No newline at end of file
diff --git a/src/components/popover/tab/layer-tab.component.scss b/src/components/popover/tab/layer/layer-tab.component.scss
similarity index 100%
rename from src/components/popover/tab/layer-tab.component.scss
rename to src/components/popover/tab/layer/layer-tab.component.scss
diff --git a/src/components/popover/tab/layer-tab.component.ts b/src/components/popover/tab/layer/layer-tab.component.ts
similarity index 73%
rename from src/components/popover/tab/layer-tab.component.ts
rename to src/components/popover/tab/layer/layer-tab.component.ts
index 138b8633..2dcaa678 100644
--- a/src/components/popover/tab/layer-tab.component.ts
+++ b/src/components/popover/tab/layer/layer-tab.component.ts
@@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core';
import {NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';
-import { LayerName, SwitchLayerAction } from '../../../../config-serializer/config-items/SwitchLayerAction';
-import { KeyActionSaver } from '../key-action-saver';
+import { LayerName, SwitchLayerAction } from '../../../../../config-serializer/config-items/SwitchLayerAction';
+import { KeyActionSaver } from '../../key-action-saver';
import {SELECT2_DIRECTIVES} from 'ng2-select2/dist/ng2-select2';
import {OptionData} from 'ng2-select2/dist/select2';
@@ -11,16 +11,7 @@ import {OptionData} from 'ng2-select2/dist/select2';
@Component({
moduleId: module.id,
selector: 'layer-tab',
- template:
- `
-
- the
-
-
- layer by pressing this key.
- layer by holding this key.
-
- `,
+ template: require('./layer-tab.component.html'),
styles: [require('./layer-tab.component.scss')],
directives: [SELECT2_DIRECTIVES, NgSwitch, NgSwitchCase, NgSwitchDefault]
})
diff --git a/src/components/popover/tab/macro/macro-item.component.html b/src/components/popover/tab/macro/macro-item.component.html
new file mode 100644
index 00000000..06ed0384
--- /dev/null
+++ b/src/components/popover/tab/macro/macro-item.component.html
@@ -0,0 +1,5 @@
+
+
+
{{ title }}
+
+
\ No newline at end of file
diff --git a/src/components/popover/tab/macro-item.component.scss b/src/components/popover/tab/macro/macro-item.component.scss
similarity index 100%
rename from src/components/popover/tab/macro-item.component.scss
rename to src/components/popover/tab/macro/macro-item.component.scss
diff --git a/src/components/popover/tab/macro-item.component.ts b/src/components/popover/tab/macro/macro-item.component.ts
similarity index 70%
rename from src/components/popover/tab/macro-item.component.ts
rename to src/components/popover/tab/macro/macro-item.component.ts
index 358aeeb3..4f4610c6 100644
--- a/src/components/popover/tab/macro-item.component.ts
+++ b/src/components/popover/tab/macro/macro-item.component.ts
@@ -1,35 +1,28 @@
import { Component, OnInit, OnChanges, Input } from '@angular/core';
-import {MacroAction} from '../../../../config-serializer/config-items/MacroAction';
-import {DelayMacroAction} from '../../../../config-serializer/config-items/DelayMacroAction';
-import {HoldKeyMacroAction} from '../../../../config-serializer/config-items/HoldKeyMacroAction';
-import {HoldModifiersMacroAction} from '../../../../config-serializer/config-items/HoldModifiersMacroAction';
-import {HoldMouseButtonsMacroAction} from '../../../../config-serializer/config-items/HoldMouseButtonsMacroAction';
-import {MoveMouseMacroAction} from '../../../../config-serializer/config-items/MoveMouseMacroAction';
-import {PressKeyMacroAction} from '../../../../config-serializer/config-items/PressKeyMacroAction';
-import {PressModifiersMacroAction} from '../../../../config-serializer/config-items/PressModifiersMacroAction';
-import {PressMouseButtonsMacroAction} from '../../../../config-serializer/config-items/PressMouseButtonsMacroAction';
-import {ReleaseKeyMacroAction} from '../../../../config-serializer/config-items/ReleaseKeyMacroAction';
-import {ReleaseModifiersMacroAction} from '../../../../config-serializer/config-items/ReleaseModifiersMacroAction';
-import {ReleaseMouseButtonsMacroAction} from '../../../../config-serializer/config-items/ReleaseMouseButtonsMacroAction';
-import {ScrollMouseMacroAction} from '../../../../config-serializer/config-items/ScrollMouseMacroAction';
-import {TextMacroAction} from '../../../../config-serializer/config-items/TextMacroAction';
+import {MacroAction} from '../../../../../config-serializer/config-items/MacroAction';
+import {DelayMacroAction} from '../../../../../config-serializer/config-items/DelayMacroAction';
+import {HoldKeyMacroAction} from '../../../../../config-serializer/config-items/HoldKeyMacroAction';
+import {HoldModifiersMacroAction} from '../../../../../config-serializer/config-items/HoldModifiersMacroAction';
+import {HoldMouseButtonsMacroAction} from '../../../../../config-serializer/config-items/HoldMouseButtonsMacroAction';
+import {MoveMouseMacroAction} from '../../../../../config-serializer/config-items/MoveMouseMacroAction';
+import {PressKeyMacroAction} from '../../../../../config-serializer/config-items/PressKeyMacroAction';
+import {PressModifiersMacroAction} from '../../../../../config-serializer/config-items/PressModifiersMacroAction';
+import {PressMouseButtonsMacroAction} from '../../../../../config-serializer/config-items/PressMouseButtonsMacroAction';
+import {ReleaseKeyMacroAction} from '../../../../../config-serializer/config-items/ReleaseKeyMacroAction';
+import {ReleaseModifiersMacroAction} from '../../../../../config-serializer/config-items/ReleaseModifiersMacroAction';
+import {ReleaseMouseButtonsMacroAction} from '../../../../../config-serializer/config-items/ReleaseMouseButtonsMacroAction';
+import {ScrollMouseMacroAction} from '../../../../../config-serializer/config-items/ScrollMouseMacroAction';
+import {TextMacroAction} from '../../../../../config-serializer/config-items/TextMacroAction';
-import {IconComponent} from '../widgets/icon.component';
+import {IconComponent} from '../../widgets/icon/icon.component';
-import {KeyModifiers} from '../../../../config-serializer/config-items/KeyModifiers';
+import {KeyModifiers} from '../../../../../config-serializer/config-items/KeyModifiers';
@Component({
moduleId: module.id,
selector: 'macro-item',
- template:
- `
-
-
-