Folder restructuring (#86)
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,8 +1,6 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
.vscode
|
||||
build
|
||||
bundle
|
||||
css
|
||||
dist
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
@@ -13,7 +13,7 @@ before_script:
|
||||
- npm run lint
|
||||
|
||||
script:
|
||||
- cd ./config-serializer && node ./test-serializer.js
|
||||
- cd ./test-serializer && node ./test-serializer.js
|
||||
|
||||
cache:
|
||||
directories:
|
||||
|
||||
@@ -14,8 +14,8 @@ First up, make sure that Node.js 4.x.x is installed on your system.
|
||||
git clone git@github.com:UltimateHackingKeyboard/agent.git
|
||||
cd agent
|
||||
npm install
|
||||
npm run build
|
||||
npm run webpack-dev-server
|
||||
npm run build sass
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Webpack dev server exposes Agent at `localhost:8080`
|
||||
|
||||
@@ -6,8 +6,8 @@ var sourcemaps = require('gulp-sourcemaps');
|
||||
var webpackStream = require('webpack-stream');
|
||||
|
||||
var paths = {
|
||||
sassAll: 'sass/**/*.scss',
|
||||
cssDest: 'css'
|
||||
sassAll: 'src/sass/**/*.scss',
|
||||
cssDest: 'dist/css'
|
||||
}
|
||||
|
||||
gulp.task('sass', function () {
|
||||
@@ -24,12 +24,12 @@ gulp.task('watch', function () {
|
||||
|
||||
gulp.task('webpack', function () {
|
||||
return gulp.src('./src/boot.ts')
|
||||
.pipe(webpackStream(require('./webpack.config.js'))
|
||||
.pipe(webpackStream(require('./src/webpack.config.js'))
|
||||
.on('error', function (error) {
|
||||
// console.error(error.message);
|
||||
this.emit('end');
|
||||
}))
|
||||
.pipe(gulp.dest('build/'));
|
||||
.pipe(gulp.dest('dist/'));
|
||||
});
|
||||
|
||||
gulp.task('default', ['sass', 'webpack']);
|
||||
|
||||
11
package.json
11
package.json
@@ -8,12 +8,14 @@
|
||||
},
|
||||
"license": "GPL-3.0",
|
||||
"devDependencies": {
|
||||
"copy-webpack-plugin": "^3.0.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-if": "^2.0.1",
|
||||
"gulp-sass": "^2.3.2",
|
||||
"gulp-sourcemaps": "^1.6.0",
|
||||
"html-loader": "0.4.3",
|
||||
"npm-run-all": "^2.3.0",
|
||||
"path": "^0.12.7",
|
||||
"raw-loader": "^0.5.1",
|
||||
"sass-loader": "^4.0.0",
|
||||
"string-replace-loader": "^1.0.3",
|
||||
@@ -54,12 +56,11 @@
|
||||
"zone.js": "^0.6.12"
|
||||
},
|
||||
"scripts": {
|
||||
"tslint": "tslint \"src/**/*.ts\" \"config-serializer/**/*.ts\"",
|
||||
"stylelint": "stylelint \"src/**/*.scss\" \"sass/**/*.scss\" --syntax scss",
|
||||
"tslint": "tslint \"src/**/*.ts\" \"test-serializer/**/*.ts\"",
|
||||
"stylelint": "stylelint \"src/**/*.scss\" --syntax scss",
|
||||
"lint": "run-s -scn tslint stylelint",
|
||||
"build": "gulp",
|
||||
"build:test": "webpack --config \"config-serializer/webpack.config.js\"",
|
||||
"webpack": "webpack",
|
||||
"webpack-dev-server": "webpack-dev-server"
|
||||
"build:test": "webpack --config \"test-serializer/webpack.config.js\"",
|
||||
"dev": "webpack-dev-server --config \"src/webpack.config.js\" --content-base \"./dist\""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@ import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
|
||||
|
||||
import { APP_ROUTER_PROVIDERS } from './main-app.routes';
|
||||
|
||||
import { DataProviderService } from './services/data-provider.service';
|
||||
import { MapperService } from './services/mapper.service';
|
||||
|
||||
import { MainAppComponent } from './main-app.component';
|
||||
import { MainAppComponent, APP_ROUTER_PROVIDERS } from './main-app';
|
||||
import { KeymapComponent } from './components/keymap';
|
||||
import { MacroComponent } from './components/macro';
|
||||
import { LegacyLoaderComponent } from './components/legacy-loader';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { Layers } from '../../../config-serializer/config-items/Layers';
|
||||
import { Layers } from '../../config-serializer/config-items/Layers';
|
||||
import { UhkConfigurationService } from '../../services/uhk-configuration.service';
|
||||
import { Keymap } from '../../../config-serializer/config-items/Keymap';
|
||||
import { Keymap } from '../../config-serializer/config-items/Keymap';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Component, OnInit, Input, Output, EventEmitter, ViewChild} from '@angular/core';
|
||||
import {NgSwitch, NgSwitchCase} from '@angular/common';
|
||||
|
||||
import {KeyAction} from '../../../config-serializer/config-items/KeyAction';
|
||||
import {KeyAction} from '../../config-serializer/config-items/KeyAction';
|
||||
|
||||
import {KeypressTabComponent} from './tab/keypress/keypress-tab.component';
|
||||
import {LayerTabComponent} from './tab/layer/layer-tab.component';
|
||||
@@ -11,11 +11,11 @@ import {KeymapTabComponent} from './tab/keymap/keymap-tab.component';
|
||||
import {NoneTabComponent} from './tab/none/none-tab.component';
|
||||
|
||||
import {Tab} from './tab/tab';
|
||||
import {KeystrokeAction} from '../../../config-serializer/config-items/KeystrokeAction';
|
||||
import {SwitchLayerAction} from '../../../config-serializer/config-items/SwitchLayerAction';
|
||||
import {MouseAction} from '../../../config-serializer/config-items/MouseAction';
|
||||
import {PlayMacroAction} from '../../../config-serializer/config-items/PlayMacroAction';
|
||||
import {SwitchKeymapAction} from '../../../config-serializer/config-items/SwitchKeymapAction';
|
||||
import {KeystrokeAction} from '../../config-serializer/config-items/KeystrokeAction';
|
||||
import {SwitchLayerAction} from '../../config-serializer/config-items/SwitchLayerAction';
|
||||
import {MouseAction} from '../../config-serializer/config-items/MouseAction';
|
||||
import {PlayMacroAction} from '../../config-serializer/config-items/PlayMacroAction';
|
||||
import {SwitchKeymapAction} from '../../config-serializer/config-items/SwitchKeymapAction';
|
||||
|
||||
enum TabName {
|
||||
Keypress,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {Component, OnInit, Input} from '@angular/core';
|
||||
|
||||
import {UhkConfigurationService} from '../../../../services/uhk-configuration.service';
|
||||
import {Keymap} from '../../../../../config-serializer/config-items/Keymap';
|
||||
import {KeyAction} from '../../../../../config-serializer/config-items/KeyAction';
|
||||
import {Keymap} from '../../../../config-serializer/config-items/Keymap';
|
||||
import {KeyAction} from '../../../../config-serializer/config-items/KeyAction';
|
||||
import {SvgKeyboardComponent} from '../../../svg/keyboard';
|
||||
import {Tab} from '../tab';
|
||||
import {SwitchKeymapAction} from '../../../../../config-serializer/config-items/SwitchKeymapAction';
|
||||
import {SwitchKeymapAction} from '../../../../config-serializer/config-items/SwitchKeymapAction';
|
||||
|
||||
import {Select2Component, Select2OptionData} from 'ng2-select2/ng2-select2';
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import {Component, OnInit, Input} from '@angular/core';
|
||||
|
||||
import {Select2Component, Select2OptionData} from 'ng2-select2/ng2-select2';
|
||||
|
||||
import {KeyAction} from '../../../../../config-serializer/config-items/KeyAction';
|
||||
import {KeystrokeAction} from '../../../../../config-serializer/config-items/KeystrokeAction';
|
||||
import {KeyAction} from '../../../../config-serializer/config-items/KeyAction';
|
||||
import {KeystrokeAction} from '../../../../config-serializer/config-items/KeystrokeAction';
|
||||
|
||||
import {IconComponent} from '../../widgets/icon';
|
||||
import {CaptureKeystrokeButtonComponent} from '../../widgets/capture-keystroke';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {Component, OnInit, Input, ViewChild} from '@angular/core';
|
||||
import {NgSwitch, NgSwitchCase, NgSwitchDefault} from '@angular/common';
|
||||
|
||||
import {LayerName, SwitchLayerAction} from '../../../../../config-serializer/config-items/SwitchLayerAction';
|
||||
import {KeyAction} from '../../../../../config-serializer/config-items/KeyAction';
|
||||
import {LayerName, SwitchLayerAction} from '../../../../config-serializer/config-items/SwitchLayerAction';
|
||||
import {KeyAction} from '../../../../config-serializer/config-items/KeyAction';
|
||||
|
||||
import {Select2Component, Select2OptionData} from 'ng2-select2/ng2-select2';
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
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 {HoldModifiersMacroAction} from '../../../../../config-serializer/config-items/HoldModifiersMacroAction';
|
||||
import {MoveMouseMacroAction} from '../../../../../config-serializer/config-items/MoveMouseMacroAction';
|
||||
import {PressModifiersMacroAction} from '../../../../../config-serializer/config-items/PressModifiersMacroAction';
|
||||
import {ReleaseModifiersMacroAction} from '../../../../../config-serializer/config-items/ReleaseModifiersMacroAction';
|
||||
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 {HoldModifiersMacroAction} from '../../../../config-serializer/config-items/HoldModifiersMacroAction';
|
||||
import {MoveMouseMacroAction} from '../../../../config-serializer/config-items/MoveMouseMacroAction';
|
||||
import {PressModifiersMacroAction} from '../../../../config-serializer/config-items/PressModifiersMacroAction';
|
||||
import {ReleaseModifiersMacroAction} from '../../../../config-serializer/config-items/ReleaseModifiersMacroAction';
|
||||
import {ScrollMouseMacroAction} from '../../../../config-serializer/config-items/ScrollMouseMacroAction';
|
||||
import {TextMacroAction} from '../../../../config-serializer/config-items/TextMacroAction';
|
||||
|
||||
import {IconComponent} from '../../widgets/icon';
|
||||
|
||||
import {KeyModifiers} from '../../../../../config-serializer/config-items/KeyModifiers';
|
||||
import {KeyModifiers} from '../../../../config-serializer/config-items/KeyModifiers';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {Component, OnInit, Input} from '@angular/core';
|
||||
|
||||
import {UhkConfigurationService} from '../../../../services/uhk-configuration.service';
|
||||
import {Macro} from '../../../../../config-serializer/config-items/Macro';
|
||||
import {KeyAction} from '../../../../../config-serializer/config-items/KeyAction';
|
||||
import {PlayMacroAction} from '../../../../../config-serializer/config-items/PlayMacroAction';
|
||||
import {Macro} from '../../../../config-serializer/config-items/Macro';
|
||||
import {KeyAction} from '../../../../config-serializer/config-items/KeyAction';
|
||||
import {PlayMacroAction} from '../../../../config-serializer/config-items/PlayMacroAction';
|
||||
|
||||
import {Tab} from '../tab';
|
||||
import {MacroItemComponent} from './macro-item.component';
|
||||
|
||||
@@ -2,8 +2,8 @@ import {Component, OnInit, Input} from '@angular/core';
|
||||
import {NgSwitch, NgSwitchCase, NgSwitchDefault} from '@angular/common';
|
||||
|
||||
import {Tab} from '../tab';
|
||||
import {KeyAction} from '../../../../../config-serializer/config-items/KeyAction';
|
||||
import {MouseAction, MouseActionParam} from '../../../../../config-serializer/config-items/MouseAction';
|
||||
import {KeyAction} from '../../../../config-serializer/config-items/KeyAction';
|
||||
import {MouseAction, MouseActionParam} from '../../../../config-serializer/config-items/MouseAction';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Component, OnInit } from '@angular/core';
|
||||
|
||||
import {Tab} from '../tab';
|
||||
import {NoneAction} from '../../../../../config-serializer/config-items/NoneAction';
|
||||
import {NoneAction} from '../../../../config-serializer/config-items/NoneAction';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {KeyAction} from '../../../../config-serializer/config-items/KeyAction';
|
||||
import {KeyAction} from '../../../config-serializer/config-items/KeyAction';
|
||||
|
||||
export interface Tab {
|
||||
keyActionValid(): boolean;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { Keymap } from '../../../config-serializer/config-items/Keymap';
|
||||
import { Keymap } from '../../config-serializer/config-items/Keymap';
|
||||
import { UhkConfigurationService } from '../../services/uhk-configuration.service';
|
||||
import { Macro } from '../../../config-serializer/config-items/Macro';
|
||||
import { Macro } from '../../config-serializer/config-items/Macro';
|
||||
import { ROUTER_DIRECTIVES } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, Input, Output, EventEmitter} from '@angular/core';
|
||||
|
||||
import {Module} from '../../../../config-serializer/config-items/Module';
|
||||
import {Module} from '../../../config-serializer/config-items/Module';
|
||||
import {SvgModule, SvgModuleComponent} from '../module';
|
||||
import {DataProviderService} from '../../../services/data-provider.service';
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Component, OnInit, Input, OnChanges, SimpleChange } from '@angular/core';
|
||||
|
||||
import {KeyAction} from '../../../../../config-serializer/config-items/KeyAction';
|
||||
import {KeystrokeAction} from '../../../../../config-serializer/config-items/KeystrokeAction';
|
||||
import {KeyModifiers} from '../../../../../config-serializer/config-items/KeyModifiers';
|
||||
import {PlayMacroAction} from '../../../../../config-serializer/config-items/PlayMacroAction';
|
||||
import {SwitchLayerAction, LayerName} from '../../../../../config-serializer/config-items/SwitchLayerAction';
|
||||
import {SwitchKeymapAction} from '../../../../../config-serializer/config-items/SwitchKeymapAction';
|
||||
import {UhkConfiguration} from '../../../../../config-serializer/config-items/UhkConfiguration';
|
||||
import {KeyAction} from '../../../../config-serializer/config-items/KeyAction';
|
||||
import {KeystrokeAction} from '../../../../config-serializer/config-items/KeystrokeAction';
|
||||
import {KeyModifiers} from '../../../../config-serializer/config-items/KeyModifiers';
|
||||
import {PlayMacroAction} from '../../../../config-serializer/config-items/PlayMacroAction';
|
||||
import {SwitchLayerAction, LayerName} from '../../../../config-serializer/config-items/SwitchLayerAction';
|
||||
import {SwitchKeymapAction} from '../../../../config-serializer/config-items/SwitchKeymapAction';
|
||||
import {UhkConfiguration} from '../../../../config-serializer/config-items/UhkConfiguration';
|
||||
import {UhkConfigurationService} from '../../../../services/uhk-configuration.service';
|
||||
import {MapperService} from '../../../../services/mapper.service';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit, OnChanges, Input } from '@angular/core';
|
||||
|
||||
import { KeystrokeAction } from '../../../../../config-serializer/config-items/KeystrokeAction';
|
||||
import { KeyModifiers } from '../../../../../config-serializer/config-items/KeyModifiers';
|
||||
import { KeystrokeAction } from '../../../../config-serializer/config-items/KeystrokeAction';
|
||||
import { KeyModifiers } from '../../../../config-serializer/config-items/KeyModifiers';
|
||||
import { MapperService } from '../../../../services/mapper.service';
|
||||
|
||||
class SvgAttributes {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
|
||||
import { SvgKeyboardKey, SvgKeyboardKeyComponent } from '../keys';
|
||||
import {KeyAction} from '../../../../config-serializer/config-items/KeyAction';
|
||||
import {KeyAction} from '../../../config-serializer/config-items/KeyAction';
|
||||
|
||||
@Component({
|
||||
selector: 'g[svg-module]',
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
state, animate, transition, trigger
|
||||
} from '@angular/core';
|
||||
|
||||
import { KeyAction } from '../../../../config-serializer/config-items/KeyAction';
|
||||
import { Layer } from '../../../../config-serializer/config-items/Layer';
|
||||
import { KeyAction } from '../../../config-serializer/config-items/KeyAction';
|
||||
import { Layer } from '../../../config-serializer/config-items/Layer';
|
||||
|
||||
@Component({
|
||||
selector: 'svg-keyboard-wrap',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Serializable } from '../Serializable';
|
||||
import { Modules } from './Modules';
|
||||
import { UhkBuffer } from '../UhkBuffer';
|
||||
import { AnimationKeyboard } from '../../src/components/svg/wrap';
|
||||
import { AnimationKeyboard } from '../../components/svg/wrap';
|
||||
|
||||
export class Layer extends Serializable<Layer> {
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ultimate Hacking Keyboard Configurator</title>
|
||||
<link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<script src="node_modules/jquery/dist/jquery.min.js"></script>
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Google Tag Manager -->
|
||||
@@ -24,10 +24,10 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
|
||||
<main-app></main-app>
|
||||
|
||||
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> <!-- TODO remove in near future -->
|
||||
<script src="node_modules/sortablejs/Sortable.js"></script>
|
||||
<script src="node_modules/select2/dist/js/select2.min.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.min.js"></script> <!-- TODO remove in near future -->
|
||||
<script src="vendor/sortablejs/Sortable.min.js"></script>
|
||||
<script src="vendor/select2/js/select2.min.js"></script>
|
||||
<script src="app.js"></script> <!-- TODO move to typescript and components -->
|
||||
<script src="build/uhk.js"></script>
|
||||
<script src="uhk.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,12 +3,12 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ultimate Hacking Keyboard Configurator</title>
|
||||
<link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/app.css" rel="stylesheet">
|
||||
<link href="css/macro.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<script src="node_modules/jquery/dist/jquery.min.js"></script>
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
<script>
|
||||
// This js function is here to make sure it loads before any iframe content on the page.
|
||||
function resizeIframe(ifr) {
|
||||
@@ -72,8 +72,8 @@
|
||||
</div>
|
||||
|
||||
|
||||
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="node_modules/sortablejs/Sortable.js"></script>
|
||||
<script src="node_modules/select2/dist/js/select2.min.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="vendor/sortablejs/Sortable.min.js"></script>
|
||||
<script src="vendor/select2/js/select2.min.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
@@ -3,12 +3,12 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ultimate Hacking Keyboard Configurator</title>
|
||||
<link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/app.css" rel="stylesheet">
|
||||
<link href="css/macro.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<script src="node_modules/jquery/dist/jquery.min.js"></script>
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="macro--edit main-content__inner">
|
||||
@@ -89,9 +89,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="node_modules/sortablejs/Sortable.js"></script>
|
||||
<script src="node_modules/select2/dist/js/select2.min.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="vendor/sortablejs/Sortable.min.js"></script>
|
||||
<script src="vendor/select2/js/select2.min.js"></script>
|
||||
<script src="macro.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
2
src/main-app/index.ts
Normal file
2
src/main-app/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './main-app.component';
|
||||
export * from './main-app.routes';
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Component, ViewEncapsulation} from '@angular/core';
|
||||
import { ROUTER_DIRECTIVES } from '@angular/router';
|
||||
|
||||
import { SideMenuComponent } from './components/side-menu';
|
||||
import { SideMenuComponent } from '../components/side-menu';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
@@ -1,7 +1,7 @@
|
||||
import { provideRouter, RouterConfig } from '@angular/router';
|
||||
import { keymapRoutes } from './components/keymap';
|
||||
import { macroRoutes } from './components/macro';
|
||||
import { legacyRoutes } from './components/legacy-loader';
|
||||
import { keymapRoutes } from '../components/keymap';
|
||||
import { macroRoutes } from '../components/macro';
|
||||
import { legacyRoutes } from '../components/legacy-loader';
|
||||
|
||||
export const routes: RouterConfig = [
|
||||
...keymapRoutes,
|
||||
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="node_modules/select2/dist/css/select2.min.css" rel="stylesheet">
|
||||
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="vendor/select2/css/select2.min.css" rel="stylesheet">
|
||||
<link href="style.css" rel="stylesheet">
|
||||
<meta charset="utf-8">
|
||||
<title>Ultimate Hacking Keyboard - Agent mockups</title>
|
||||
@@ -44,10 +44,10 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="node_modules/jquery/dist/jquery.min.js"></script>
|
||||
<script src="node_modules/handlebars/dist/handlebars.js"></script>
|
||||
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="node_modules/select2/dist/js/select2.min.js"></script>
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
<script src="vendor/handlebars/handlebars.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="vendor/select2/js/select2.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
|
||||
<!--
|
||||
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="node_modules/select2/dist/css/select2.min.css" rel="stylesheet">
|
||||
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="vendor/select2/css/select2.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<meta charset="utf-8">
|
||||
<title>Ultimate Hacking Keyboard - Agent mockups</title>
|
||||
@@ -28,10 +28,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="node_modules/jquery/dist/jquery.min.js"></script>
|
||||
<script src="node_modules/handlebars/dist/handlebars.js"></script>
|
||||
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="node_modules/select2/dist/js/select2.min.js"></script>
|
||||
<script src="vendor/jquery/jquery.min.js"></script>
|
||||
<script src="vendor/handlebars/handlebars.min.js"></script>
|
||||
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="vendor/select2/js/select2.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
|
||||
<!--
|
||||
@@ -8,7 +8,7 @@ export class DataProviderService {
|
||||
constructor() { }
|
||||
|
||||
getUHKConfig(): any {
|
||||
return require('json!../../config-serializer/uhk-config.json');
|
||||
return require('json!../config-serializer/uhk-config.json');
|
||||
}
|
||||
|
||||
getKeyboardSvgAttributes(): { viewBox: string, transform: string, fill: string } {
|
||||
|
||||
@@ -105,13 +105,13 @@ export class MapperService {
|
||||
public scanCodeToSvgImagePath(scanCode: number): string {
|
||||
let fileName: string = this.scanCodeFileName[scanCode];
|
||||
if (fileName) {
|
||||
return 'build/compiled_sprite.svg#' + fileName;
|
||||
return 'assets/compiled_sprite.svg#' + fileName;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getIcon(iconName: string): string {
|
||||
return 'build/compiled_sprite.svg#' + this.nameToFileName.get(iconName);
|
||||
return 'assets/compiled_sprite.svg#' + this.nameToFileName.get(iconName);
|
||||
}
|
||||
|
||||
private initScanCodeTextMap(): void {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {DataProviderService} from './data-provider.service';
|
||||
|
||||
import {UhkConfiguration} from '../../config-serializer/config-items/UhkConfiguration';
|
||||
import {UhkConfiguration} from '../config-serializer/config-items/UhkConfiguration';
|
||||
|
||||
@Injectable()
|
||||
export class UhkConfigurationService {
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
"removeComments": false,
|
||||
"noImplicitAny": true,
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"baseUrl": "./src",
|
||||
"typeRoots": [
|
||||
"../node_modules/@types"
|
||||
],
|
||||
"types": [
|
||||
"node",
|
||||
"jquery",
|
||||
101
src/webpack.config.js
Normal file
101
src/webpack.config.js
Normal file
@@ -0,0 +1,101 @@
|
||||
// var webpack = require("webpack");
|
||||
var SvgStore = require('webpack-svgstore-plugin');
|
||||
var webpackFailPlugin = require('webpack-fail-plugin');
|
||||
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
var path = require('path');
|
||||
|
||||
var rootDir = path.resolve(__dirname, '../');
|
||||
|
||||
module.exports = {
|
||||
entry: ['es6-shim', 'zone.js', 'reflect-metadata', './src/boot.ts'],
|
||||
output: {
|
||||
path: rootDir + "/dist",
|
||||
filename: "uhk.js"
|
||||
},
|
||||
devtool: 'source-map',
|
||||
resolve: {
|
||||
extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'],
|
||||
modulesDirectories: ['node_modules']
|
||||
},
|
||||
module: {
|
||||
preLoaders: [
|
||||
{
|
||||
test: /(.js|.ts)$/,
|
||||
loader: 'string-replace-loader',
|
||||
query: {
|
||||
search: 'moduleId: module.id,',
|
||||
replace: '',
|
||||
flags: 'g'
|
||||
}
|
||||
}
|
||||
],
|
||||
loaders: [
|
||||
{ test: /\.ts$/, loader: 'ts-loader', exclude: /node_modules/ },
|
||||
{ test: /\.html$/, loader: 'html-loader' },
|
||||
{
|
||||
test: /\.scss$/,
|
||||
exclude: /node_modules/,
|
||||
loaders: ['raw-loader', 'sass-loader']
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
// new webpack.optimize.UglifyJsPlugin({ minimize: true })
|
||||
new SvgStore(
|
||||
[
|
||||
rootDir + '/images/icons/**/*.svg'
|
||||
],
|
||||
'./',
|
||||
{
|
||||
name: 'assets/compiled_sprite.svg',
|
||||
chunk: 'app',
|
||||
svgoOptions: {
|
||||
plugins: [
|
||||
{ removeTitle: true }
|
||||
]
|
||||
}
|
||||
}
|
||||
),
|
||||
webpackFailPlugin,
|
||||
new CopyWebpackPlugin([
|
||||
{ from: './src/*.html', flatten: true },
|
||||
{ from: './src/*.js', flatten: true },
|
||||
{
|
||||
from: 'node_modules/font-awesome/css/font-awesome.min.css',
|
||||
to: 'vendor/font-awesome/css/font-awesome.min.css'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/font-awesome/fonts',
|
||||
to: 'vendor/font-awesome/fonts'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/bootstrap/dist',
|
||||
to: 'vendor/bootstrap'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/jquery/dist/jquery.min.*',
|
||||
to: 'vendor/jquery',
|
||||
flatten: true
|
||||
},
|
||||
{
|
||||
from: 'node_modules/sortablejs/Sortable.min.js',
|
||||
to: 'vendor/sortablejs/Sortable.min.js'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/select2/dist',
|
||||
to: 'vendor/select2'
|
||||
},
|
||||
{
|
||||
from: 'images',
|
||||
to: 'images'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/handlebars/dist/handlebars.min.js',
|
||||
to: 'vendor/handlebars/handlebars.min.js'
|
||||
},
|
||||
], {
|
||||
ignore: ['*.config.js']
|
||||
})
|
||||
]
|
||||
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
typings
|
||||
uhk-config.bin
|
||||
uhk-config-serialized.json
|
||||
uhk-config-serialized.bin
|
||||
test-serializer.js
|
||||
*.sw*
|
||||
@@ -1,11 +1,11 @@
|
||||
import {Serializable} from './Serializable';
|
||||
import {UhkBuffer} from './UhkBuffer';
|
||||
import {UhkConfiguration} from './config-items/UhkConfiguration';
|
||||
import {Serializable} from '../src/config-serializer/Serializable';
|
||||
import {UhkBuffer} from '../src/config-serializer/UhkBuffer';
|
||||
import {UhkConfiguration} from '../src/config-serializer/config-items/UhkConfiguration';
|
||||
|
||||
let assert = require('assert');
|
||||
let fs = require('fs');
|
||||
|
||||
let uhkConfig = JSON.parse(fs.readFileSync('uhk-config.json'));
|
||||
let uhkConfig = JSON.parse(fs.readFileSync('../src/config-serializer/uhk-config.json'));
|
||||
|
||||
let config1Js = uhkConfig;
|
||||
let config1Ts: Serializable<UhkConfiguration> = new UhkConfiguration().fromJsObject(config1Js);
|
||||
@@ -1,65 +0,0 @@
|
||||
// var webpack = require("webpack");
|
||||
var SvgStore = require('webpack-svgstore-plugin');
|
||||
var webpackFailPlugin = require('webpack-fail-plugin');
|
||||
|
||||
module.exports = {
|
||||
entry: ['es6-shim', 'zone.js', 'reflect-metadata', './src/boot.ts'],
|
||||
output: {
|
||||
path: __dirname + "/build",
|
||||
publicPath: "/build/",
|
||||
filename: "uhk.js"
|
||||
},
|
||||
devtool: 'source-map',
|
||||
resolve: {
|
||||
extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'],
|
||||
alias: {
|
||||
|
||||
},
|
||||
modulesDirectories: [
|
||||
'node_modules',
|
||||
'bower_components'
|
||||
]
|
||||
},
|
||||
module: {
|
||||
preLoaders: [
|
||||
{
|
||||
test: /(.js|.ts)$/,
|
||||
loader: 'string-replace-loader',
|
||||
query: {
|
||||
search: 'moduleId: module.id,',
|
||||
replace: '',
|
||||
flags: 'g'
|
||||
}
|
||||
}
|
||||
],
|
||||
loaders: [
|
||||
{ test: /\.ts$/, loader: 'ts-loader', exclude: /node_modules/ },
|
||||
{ test: /\.html$/, loader: 'html-loader' },
|
||||
{
|
||||
test: /\.scss$/,
|
||||
exclude: /node_modules/,
|
||||
loaders: ['raw-loader', 'sass-loader']
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
// new webpack.optimize.UglifyJsPlugin({ minimize: true })
|
||||
new SvgStore(
|
||||
[
|
||||
'images/icons/**/*.svg'
|
||||
],
|
||||
'./',
|
||||
{
|
||||
name: 'compiled_sprite.svg',
|
||||
chunk: 'app',
|
||||
svgoOptions: {
|
||||
plugins: [
|
||||
{ removeTitle: true }
|
||||
]
|
||||
}
|
||||
}
|
||||
),
|
||||
webpackFailPlugin
|
||||
]
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user