Forgot to rename KeyActionType to keyActionType which I done now.

This commit is contained in:
László Monda
2016-04-08 23:41:47 +02:00
parent 7d17cba390
commit a3b83dfb36
9 changed files with 25 additions and 25 deletions

View File

@@ -21,7 +21,7 @@ class DualRoleKeystrokeAction extends KeyAction {
private longPressAction: LongPressAction; private longPressAction: LongPressAction;
_fromJsObject(jsObject: any): DualRoleKeystrokeAction { _fromJsObject(jsObject: any): DualRoleKeystrokeAction {
this.assertKeyActionType(jsObject, KeyActionType.DualRoleKeystrokeAction, 'DualRoleKeystrokeAction'); this.assertKeyActionType(jsObject, keyActionType.DualRoleKeystrokeAction, 'DualRoleKeystrokeAction');
this.scancode = jsObject.scancode; this.scancode = jsObject.scancode;
this.longPressAction = LongPressAction[<string> jsObject.longPressAction]; this.longPressAction = LongPressAction[<string> jsObject.longPressAction];
return this; return this;
@@ -36,7 +36,7 @@ class DualRoleKeystrokeAction extends KeyAction {
_toJsObject(): any { _toJsObject(): any {
return { return {
keyActionType: KeyActionType.DualRoleKeystrokeAction, keyActionType: keyActionType.DualRoleKeystrokeAction,
scancode: this.scancode, scancode: this.scancode,
longPressAction: LongPressAction[this.longPressAction] longPressAction: LongPressAction[this.longPressAction]
}; };

View File

@@ -2,23 +2,23 @@ class KeyActions extends ClassArray<KeyAction> {
jsObjectToClass(jsObject: any): Serializable<KeyAction> { jsObjectToClass(jsObject: any): Serializable<KeyAction> {
switch (jsObject.keyActionType) { switch (jsObject.keyActionType) {
case KeyActionType.NoneAction: case keyActionType.NoneAction:
return new NoneAction().fromJsObject(jsObject); return new NoneAction().fromJsObject(jsObject);
case KeyActionType.KeystrokeAction: case keyActionType.KeystrokeAction:
return new KeystrokeAction().fromJsObject(jsObject); return new KeystrokeAction().fromJsObject(jsObject);
case KeyActionType.KeystrokeModifiersAction: case keyActionType.KeystrokeModifiersAction:
return new KeystrokeModifiersAction().fromJsObject(jsObject); return new KeystrokeModifiersAction().fromJsObject(jsObject);
case KeyActionType.KeystrokeWithModifiersAction: case keyActionType.KeystrokeWithModifiersAction:
return new KeystrokeWithModifiersAction().fromJsObject(jsObject); return new KeystrokeWithModifiersAction().fromJsObject(jsObject);
case KeyActionType.DualRoleKeystrokeAction: case keyActionType.DualRoleKeystrokeAction:
return new DualRoleKeystrokeAction().fromJsObject(jsObject); return new DualRoleKeystrokeAction().fromJsObject(jsObject);
case KeyActionType.SwitchLayerAction: case keyActionType.SwitchLayerAction:
return new SwitchLayerAction().fromJsObject(jsObject); return new SwitchLayerAction().fromJsObject(jsObject);
case KeyActionType.SwitchKeymapAction: case keyActionType.SwitchKeymapAction:
return new SwitchKeymapAction().fromJsObject(jsObject); return new SwitchKeymapAction().fromJsObject(jsObject);
case KeyActionType.MouseAction: case keyActionType.MouseAction:
return new MouseAction().fromJsObject(jsObject); return new MouseAction().fromJsObject(jsObject);
case KeyActionType.PlayMacroAction: case keyActionType.PlayMacroAction:
return new PlayMacroAction().fromJsObject(jsObject); return new PlayMacroAction().fromJsObject(jsObject);
default: default:
throw `Invalid KeyAction.keyActionType: "${jsObject.actionType}"`; throw `Invalid KeyAction.keyActionType: "${jsObject.actionType}"`;

View File

@@ -4,7 +4,7 @@ class KeystrokeAction extends KeyAction {
scancode: number; scancode: number;
_fromJsObject(jsObject: any): KeystrokeAction { _fromJsObject(jsObject: any): KeystrokeAction {
this.assertKeyActionType(jsObject, KeyActionType.KeystrokeAction, 'KeystrokeAction'); this.assertKeyActionType(jsObject, keyActionType.KeystrokeAction, 'KeystrokeAction');
this.scancode = jsObject.scancode; this.scancode = jsObject.scancode;
return this; return this;
} }
@@ -17,7 +17,7 @@ class KeystrokeAction extends KeyAction {
_toJsObject(): any { _toJsObject(): any {
return { return {
keyActionType: KeyActionType.KeystrokeAction, keyActionType: keyActionType.KeystrokeAction,
scancode: this.scancode scancode: this.scancode
}; };
} }

View File

@@ -5,7 +5,7 @@ class KeystrokeModifiersAction extends KeyAction {
_fromJsObject(jsObject: any): KeystrokeModifiersAction { _fromJsObject(jsObject: any): KeystrokeModifiersAction {
this.assertKeyActionType( this.assertKeyActionType(
jsObject, KeyActionType.KeystrokeModifiersAction, 'KeystrokeModifiersAction'); jsObject, keyActionType.KeystrokeModifiersAction, 'KeystrokeModifiersAction');
this.modifierMask = jsObject.modifierMask; this.modifierMask = jsObject.modifierMask;
return this; return this;
} }
@@ -18,7 +18,7 @@ class KeystrokeModifiersAction extends KeyAction {
_toJsObject(): any { _toJsObject(): any {
return { return {
keyActionType: KeyActionType.KeystrokeModifiersAction, keyActionType: keyActionType.KeystrokeModifiersAction,
modifierMask: this.modifierMask modifierMask: this.modifierMask
}; };
} }

View File

@@ -8,7 +8,7 @@ class KeystrokeWithModifiersAction extends KeyAction {
_fromJsObject(jsObject: any): KeystrokeWithModifiersAction { _fromJsObject(jsObject: any): KeystrokeWithModifiersAction {
this.assertKeyActionType( this.assertKeyActionType(
jsObject, KeyActionType.KeystrokeWithModifiersAction, 'KeystrokeWithModifiersAction'); jsObject, keyActionType.KeystrokeWithModifiersAction, 'KeystrokeWithModifiersAction');
this.scancode = jsObject.scancode; this.scancode = jsObject.scancode;
this.modifierMask = jsObject.modifierMask; this.modifierMask = jsObject.modifierMask;
return this; return this;
@@ -23,7 +23,7 @@ class KeystrokeWithModifiersAction extends KeyAction {
_toJsObject(): any { _toJsObject(): any {
return { return {
keyActionType: KeyActionType.KeystrokeWithModifiersAction, keyActionType: keyActionType.KeystrokeWithModifiersAction,
scancode: this.scancode, scancode: this.scancode,
modifierMask: this.modifierMask modifierMask: this.modifierMask
}; };

View File

@@ -20,7 +20,7 @@ class MouseAction extends KeyAction {
mouseAction: MouseActionParam; mouseAction: MouseActionParam;
_fromJsObject(jsObject: any): MouseAction { _fromJsObject(jsObject: any): MouseAction {
this.assertKeyActionType(jsObject, KeyActionType.MouseAction, 'MouseAction'); this.assertKeyActionType(jsObject, keyActionType.MouseAction, 'MouseAction');
this.mouseAction = MouseActionParam[<string> jsObject.mouseAction]; this.mouseAction = MouseActionParam[<string> jsObject.mouseAction];
return this; return this;
} }
@@ -33,7 +33,7 @@ class MouseAction extends KeyAction {
_toJsObject(): any { _toJsObject(): any {
return { return {
keyActionType: KeyActionType.MouseAction, keyActionType: keyActionType.MouseAction,
mouseAction: MouseActionParam[this.mouseAction] mouseAction: MouseActionParam[this.mouseAction]
}; };
} }

View File

@@ -4,7 +4,7 @@ class PlayMacroAction extends KeyAction {
macroId: number; macroId: number;
_fromJsObject(jsObject: any): PlayMacroAction { _fromJsObject(jsObject: any): PlayMacroAction {
this.assertKeyActionType(jsObject, KeyActionType.PlayMacroAction, 'PlayMacroAction'); this.assertKeyActionType(jsObject, keyActionType.PlayMacroAction, 'PlayMacroAction');
this.macroId = jsObject.macroId; this.macroId = jsObject.macroId;
return this; return this;
} }
@@ -17,7 +17,7 @@ class PlayMacroAction extends KeyAction {
_toJsObject(): any { _toJsObject(): any {
return { return {
keyActionType: KeyActionType.PlayMacroAction, keyActionType: keyActionType.PlayMacroAction,
macroId: this.macroId macroId: this.macroId
}; };
} }

View File

@@ -4,7 +4,7 @@ class SwitchKeymapAction extends KeyAction {
keymapId: number; keymapId: number;
_fromJsObject(jsObject: any): SwitchKeymapAction { _fromJsObject(jsObject: any): SwitchKeymapAction {
this.assertKeyActionType(jsObject, KeyActionType.SwitchKeymapAction, 'SwitchKeymapAction'); this.assertKeyActionType(jsObject, keyActionType.SwitchKeymapAction, 'SwitchKeymapAction');
this.keymapId = jsObject.keymapId; this.keymapId = jsObject.keymapId;
return this; return this;
} }
@@ -17,7 +17,7 @@ class SwitchKeymapAction extends KeyAction {
_toJsObject(): any { _toJsObject(): any {
return { return {
keyActionType: KeyActionType.SwitchKeymapAction, keyActionType: keyActionType.SwitchKeymapAction,
keymapId: this.keymapId keymapId: this.keymapId
}; };
} }

View File

@@ -18,7 +18,7 @@ class SwitchLayerAction extends KeyAction {
} }
_fromJsObject(jsObject: any): SwitchLayerAction { _fromJsObject(jsObject: any): SwitchLayerAction {
this.assertKeyActionType(jsObject, KeyActionType.SwitchLayerAction, 'SwitchLayerAction'); this.assertKeyActionType(jsObject, keyActionType.SwitchLayerAction, 'SwitchLayerAction');
this.layer = Layer[<string> jsObject.layer]; this.layer = Layer[<string> jsObject.layer];
this.isLayerToggleable = jsObject.toggle; this.isLayerToggleable = jsObject.toggle;
return this; return this;
@@ -35,7 +35,7 @@ class SwitchLayerAction extends KeyAction {
_toJsObject(): any { _toJsObject(): any {
return { return {
keyActionType: KeyActionType.SwitchLayerAction, keyActionType: keyActionType.SwitchLayerAction,
layer: Layer[this.layer], layer: Layer[this.layer],
toggle: this.isLayerToggleable toggle: this.isLayerToggleable
}; };