Browse Source

Re-initialized the project with angular-cli and set it up as the build tool chain.

tags/v1.1.0^2
Manuel Friedli 2 years ago
parent
commit
17afa92bfe
80 changed files with 6584 additions and 621 deletions
  1. 57
    0
      .angular-cli.json
  2. 13
    0
      .editorconfig
  3. 42
    9
      .gitignore
  4. 10
    6
      .gitlab-ci.yml
  5. 29
    0
      README.md
  6. 0
    7
      config/helpers.js
  7. 0
    21
      config/karma-test-shim.js
  8. 0
    44
      config/karma.conf.js
  9. 0
    76
      config/webpack.common.js
  10. 0
    24
      config/webpack.dev.js
  11. 0
    39
      config/webpack.prod.js
  12. 0
    52
      config/webpack.test.js
  13. 14
    0
      e2e/app.e2e-spec.ts
  14. 11
    0
      e2e/app.po.ts
  15. 12
    0
      e2e/tsconfig.e2e.json
  16. 44
    1
      karma.conf.js
  17. 36
    41
      package.json
  18. 30
    0
      protractor.conf.js
  19. 27
    0
      src/app/app-routing.module.js
  20. 15
    0
      src/app/app-routing.module.ts
  21. 0
    118
      src/app/app.component.css
  22. 12
    11
      src/app/app.component.html
  23. 65
    0
      src/app/app.component.js
  24. 107
    0
      src/app/app.component.scss
  25. 21
    0
      src/app/app.component.spec.js
  26. 22
    15
      src/app/app.component.spec.ts
  27. 43
    45
      src/app/app.component.ts
  28. 34
    0
      src/app/app.module.js
  29. 19
    14
      src/app/app.module.ts
  30. 21
    0
      src/app/converter/base64decoder.js
  31. 22
    0
      src/app/converter/base64encoder.js
  32. 13
    12
      src/app/converter/base64encoder.ts
  33. 20
    0
      src/app/converter/bintodecconverter.js
  34. 1
    0
      src/app/converter/converter.js
  35. 20
    0
      src/app/converter/dectobinconverter.js
  36. 20
    0
      src/app/converter/dectohexconverter.js
  37. 20
    0
      src/app/converter/hextodecconverter.js
  38. 20
    0
      src/app/converter/htmlentitiesdecoder.js
  39. 20
    0
      src/app/converter/htmlentitiesencoder.js
  40. 17
    0
      src/app/converter/punycodedecoder.js
  41. 17
    0
      src/app/converter/punycodeencoder.js
  42. 22
    0
      src/app/converter/quotedprintabledecoder.js
  43. 17
    0
      src/app/converter/quotedprintableencoder.js
  44. 16
    0
      src/app/converter/uricomponentdecoder.js
  45. 18
    0
      src/app/converter/uricomponentencoder.js
  46. 16
    0
      src/app/converter/uridecoder.js
  47. 16
    0
      src/app/converter/uriencoder.js
  48. 22
    0
      src/app/converter/utf8decoder.js
  49. 22
    0
      src/app/converter/utf8encoder.js
  50. 77
    0
      src/app/converterregistry.service.js
  51. 41
    0
      src/app/inputcomponentmanager.service.js
  52. 23
    0
      src/app/nativelibrarywrapper.service.js
  53. 11
    8
      src/app/nativelibrarywrapper.service.ts
  54. 1
    0
      src/app/punycode.js
  55. 1
    0
      src/app/quotedprintable.js
  56. 12
    0
      src/app/step.js
  57. 1
    0
      src/app/utf8.js
  58. 0
    0
      src/assets/.gitkeep
  59. 0
    37
      src/assets/css/style.css
  60. 8
    0
      src/environments/environment.js
  61. 4
    0
      src/environments/environment.prod.js
  62. 3
    0
      src/environments/environment.prod.ts
  63. 8
    0
      src/environments/environment.ts
  64. BIN
      src/favicon.ico
  65. 12
    9
      src/index.html
  66. 9
    0
      src/main.js
  67. 7
    5
      src/main.ts
  68. 54
    0
      src/polyfills.js
  69. 68
    11
      src/polyfills.ts
  70. 38
    0
      src/styles.scss
  71. 20
    0
      src/test.js
  72. 32
    0
      src/test.ts
  73. 13
    0
      src/tsconfig.app.json
  74. 20
    0
      src/tsconfig.spec.json
  75. 5
    0
      src/typings.d.ts
  76. 0
    5
      src/vendor.ts
  77. 10
    10
      tsconfig.json
  78. 116
    0
      tslint.json
  79. 0
    1
      webpack.config.js
  80. 4967
    0
      yarn.lock

+ 57
- 0
.angular-cli.json View File

@@ -0,0 +1,57 @@
1
+{
2
+  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+  "project": {
4
+    "name": "conv.friedli.info"
5
+  },
6
+  "apps": [
7
+    {
8
+      "root": "src",
9
+      "outDir": "dist",
10
+      "assets": [
11
+        "assets",
12
+        "favicon.ico"
13
+      ],
14
+      "index": "index.html",
15
+      "main": "main.ts",
16
+      "polyfills": "polyfills.ts",
17
+      "test": "test.ts",
18
+      "tsconfig": "tsconfig.app.json",
19
+      "testTsconfig": "tsconfig.spec.json",
20
+      "prefix": "app",
21
+      "styles": [
22
+        "styles.scss"
23
+      ],
24
+      "scripts": [],
25
+      "environmentSource": "environments/environment.ts",
26
+      "environments": {
27
+        "dev": "environments/environment.ts",
28
+        "prod": "environments/environment.prod.ts"
29
+      }
30
+    }
31
+  ],
32
+  "e2e": {
33
+    "protractor": {
34
+      "config": "./protractor.conf.js"
35
+    }
36
+  },
37
+  "lint": [
38
+    {
39
+      "project": "src/tsconfig.app.json"
40
+    },
41
+    {
42
+      "project": "src/tsconfig.spec.json"
43
+    },
44
+    {
45
+      "project": "e2e/tsconfig.e2e.json"
46
+    }
47
+  ],
48
+  "test": {
49
+    "karma": {
50
+      "config": "./karma.conf.js"
51
+    }
52
+  },
53
+  "defaults": {
54
+    "styleExt": "scss",
55
+    "component": {}
56
+  }
57
+}

+ 13
- 0
.editorconfig View File

@@ -0,0 +1,13 @@
1
+# Editor configuration, see http://editorconfig.org
2
+root = true
3
+
4
+[*]
5
+charset = utf-8
6
+indent_style = space
7
+indent_size = 2
8
+insert_final_newline = true
9
+trim_trailing_whitespace = true
10
+
11
+[*.md]
12
+max_line_length = off
13
+trim_trailing_whitespace = false

+ 42
- 9
.gitignore View File

@@ -1,10 +1,43 @@
1
-*~
2
-.idea/
3
-*.iml
4
-atlassian-ide-plugin.xml
5
-node_modules/
6
-typings/
7
-src/**/*.js
8
-src/**/*.js.map
1
+# See http://help.github.com/ignore-files/ for more about ignoring files.
2
+
3
+# compiled output
4
+/dist
5
+/tmp
6
+/out-tsc
7
+
8
+# dependencies
9
+/node_modules
10
+
11
+# IDEs and editors
12
+/.idea
13
+.project
14
+.classpath
15
+.c9/
16
+*.launch
17
+.settings/
18
+*.sublime-workspace
19
+
20
+# IDE - VSCode
21
+.vscode/*
22
+!.vscode/settings.json
23
+!.vscode/tasks.json
24
+!.vscode/launch.json
25
+!.vscode/extensions.json
26
+
27
+# misc
28
+/.sass-cache
29
+/connect.lock
30
+/coverage
31
+/libpeerconnection.log
9 32
 npm-debug.log
10
-dist/
33
+testem.log
34
+/typings
35
+
36
+# e2e
37
+/e2e/*.js
38
+/e2e/*.map
39
+
40
+# System Files
41
+.DS_Store
42
+Thumbs.db
43
+*~

+ 10
- 6
.gitlab-ci.yml View File

@@ -7,9 +7,11 @@ stages:
7 7
 build_job:
8 8
   stage: build
9 9
   script:
10
-    - npm install
11
-    - npm run build-dev
12
-    - npm run test
10
+    - yarn install
11
+    - yarn run build
12
+    - yarn run lint
13
+    - yarn run test
14
+    - yarn run e2e
13 15
   tags:
14 16
     - javascript
15 17
   except:
@@ -23,9 +25,11 @@ build_job:
23 25
 build_job_production:
24 26
   stage: build
25 27
   script:
26
-    - npm install
27
-    - npm run build
28
-    - npm run test
28
+    - yarn install
29
+    - yarn run build-prod
30
+    - yarn run lint
31
+    - yarn run test
32
+    - yarn run e2e
29 33
   tags:
30 34
     - javascript
31 35
   only:

+ 29
- 0
README.md View File

@@ -7,3 +7,32 @@ Deployment is automated with Gitlab CI. Usage is self-explanatory. What else do
7 7
 Contact the author at manuel-conv.friedli.info|at|fritteli.ch.
8 8
 
9 9
 Cheers!
10
+
11
+# AngularCliTestproject
12
+
13
+This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0.
14
+
15
+## Development server
16
+
17
+Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
18
+
19
+## Code scaffolding
20
+
21
+Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
22
+
23
+## Build
24
+
25
+Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
26
+
27
+## Running unit tests
28
+
29
+Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
30
+
31
+## Running end-to-end tests
32
+
33
+Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
34
+Before running the tests make sure you are serving the app via `ng serve`.
35
+
36
+## Further help
37
+
38
+To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

+ 0
- 7
config/helpers.js View File

@@ -1,7 +0,0 @@
1
-var path = require('path');
2
-var _root = path.resolve(__dirname, '..');
3
-function root(args) {
4
-    args = Array.prototype.slice.call(arguments, 0);
5
-    return path.join.apply(path, [_root].concat(args));
6
-}
7
-exports.root = root;

+ 0
- 21
config/karma-test-shim.js View File

@@ -1,21 +0,0 @@
1
-Error.stackTraceLimit = Infinity;
2
-
3
-require('core-js/es6');
4
-require('core-js/es7/reflect');
5
-
6
-require('zone.js/dist/zone');
7
-require('zone.js/dist/long-stack-trace-zone');
8
-require('zone.js/dist/proxy');
9
-require('zone.js/dist/sync-test');
10
-require('zone.js/dist/jasmine-patch');
11
-require('zone.js/dist/async-test');
12
-require('zone.js/dist/fake-async-test');
13
-
14
-var appContext = require.context('../src', true, /\.spec\.ts/);
15
-
16
-appContext.keys().forEach(appContext);
17
-
18
-var testing = require('@angular/core/testing');
19
-var browser = require('@angular/platform-browser-dynamic/testing');
20
-
21
-testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());

+ 0
- 44
config/karma.conf.js View File

@@ -1,44 +0,0 @@
1
-var webpackConfig = require('./webpack.test');
2
-
3
-module.exports = function (config) {
4
-    var _config = {
5
-        basePath: '',
6
-
7
-        frameworks: ['jasmine'],
8
-
9
-        files: [
10
-            {
11
-                pattern: './config/karma-test-shim.js',
12
-                watched: false
13
-            }
14
-        ],
15
-
16
-        preprocessors: {
17
-            './config/karma-test-shim.js': ['webpack', 'sourcemap']
18
-        },
19
-
20
-        webpack: webpackConfig,
21
-
22
-        webpackMiddleware: {
23
-            stats: 'errors-only'
24
-        },
25
-
26
-        webpackServer: {
27
-            noInfo: true
28
-        },
29
-
30
-        reporters: ['kjhtml'],
31
-        port: 9876,
32
-        colors: true,
33
-        logLevel: config.LOG_INFO,
34
-        autoWatch: false,
35
-        browsers: ['PhantomJS'],
36
-        singleRun: true,
37
-        phantomjsLauncher: {
38
-            // Have phantomjs exit if a ResourceError is encountered (useful if karma exits without killing phantom) 
39
-            exitOnResourceError: true
40
-        }
41
-    };
42
-
43
-    config.set(_config);
44
-};

+ 0
- 76
config/webpack.common.js View File

@@ -1,76 +0,0 @@
1
-var webpack = require('webpack');
2
-var HtmlWebpackPlugin = require('html-webpack-plugin');
3
-var ExtractTextPlugin = require('extract-text-webpack-plugin');
4
-var helpers = require('./helpers');
5
-
6
-module.exports = {
7
-    entry: {
8
-        'polyfills': './src/polyfills.ts',
9
-        'vendor': './src/vendor.ts',
10
-        'app': './src/main.ts'
11
-    },
12
-
13
-    resolve: {
14
-        extensions: ['.ts', '.js']
15
-    },
16
-
17
-    module: {
18
-        rules: [
19
-            {
20
-                test: /\.ts$/,
21
-                loaders: [
22
-                    {
23
-                        loader: 'awesome-typescript-loader',
24
-                        options: {
25
-                            configFileName: helpers.root('src', 'tsconfig.json')
26
-                        }
27
-                    },
28
-                    'angular2-template-loader'
29
-                ]
30
-            },
31
-            {
32
-                test: /\.html$/,
33
-                use: 'html-loader'
34
-            },
35
-            {
36
-                test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
37
-                use: 'file-loader?name=assets/[name].[hash].[ext]'
38
-            },
39
-            {
40
-                test: /\.css$/,
41
-                exclude: helpers.root('src', 'app'),
42
-                use: ExtractTextPlugin.extract({
43
-                    fallback: 'style-loader',
44
-                    use: 'css-loader?sourceMap'
45
-                })
46
-            },
47
-            {
48
-                test: /\.css$/,
49
-                include: helpers.root('src', 'app'),
50
-                use: 'raw-loader'
51
-            }
52
-        ]
53
-    },
54
-
55
-    plugins: [
56
-        // Workaround for angular/angular#11580
57
-        new webpack.ContextReplacementPlugin(
58
-            // The (\\|\/) piece accounts for path separators in *nix and Windows
59
-            /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
60
-            helpers.root('./src'), // location of your src
61
-            {} // a map of your routes
62
-        ),
63
-
64
-        new webpack.optimize.CommonsChunkPlugin({
65
-            name: ['app', 'vendor', 'polyfills']
66
-        }),
67
-
68
-        new HtmlWebpackPlugin({
69
-            template: 'src/index.html'
70
-        }),
71
-
72
-        new webpack.optimize.UglifyJsPlugin({
73
-            comments: false
74
-        })
75
-    ]
76
-};

+ 0
- 24
config/webpack.dev.js View File

@@ -1,24 +0,0 @@
1
-var webpackMerge = require('webpack-merge');
2
-var ExtractTextPlugin = require('extract-text-webpack-plugin');
3
-var commonConfig = require('./webpack.common.js');
4
-var helpers = require('./helpers');
5
-
6
-module.exports = webpackMerge(commonConfig, {
7
-    devtool: 'cheap-module-eval-source-map',
8
-
9
-    output: {
10
-        path: helpers.root('dist'),
11
-        publicPath: 'http://localhost:8080/',
12
-        filename: '[name].js',
13
-        chunkFilename: '[id].chunk.js'
14
-    },
15
-
16
-    plugins: [
17
-        new ExtractTextPlugin('[name].css')
18
-    ],
19
-
20
-    devServer: {
21
-        historyApiFallback: true,
22
-        stats: 'minimal'
23
-    }
24
-});

+ 0
- 39
config/webpack.prod.js View File

@@ -1,39 +0,0 @@
1
-var webpack = require('webpack');
2
-var webpackMerge = require('webpack-merge');
3
-var ExtractTextPlugin = require('extract-text-webpack-plugin');
4
-var commonConfig = require('./webpack.common.js');
5
-var helpers = require('./helpers');
6
-
7
-module.exports = function (env) {
8
-    console.log("env:", env);
9
-    return webpackMerge(commonConfig, {
10
-        devtool: 'source-map',
11
-
12
-        output: {
13
-            path: helpers.root('dist'),
14
-            publicPath: '',
15
-            filename: '[name].[hash].js',
16
-            chunkFilename: '[id].[hash].chunk.js'
17
-        },
18
-
19
-        plugins: [
20
-            new webpack.NoEmitOnErrorsPlugin(),
21
-            new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
22
-                mangle: {
23
-                    keep_fnames: true
24
-                }
25
-            }),
26
-            new ExtractTextPlugin('[name].[hash].css'),
27
-            new webpack.DefinePlugin({
28
-                'process.env': {
29
-                    'NODE_ENV': JSON.stringify(env.NODE_ENV)
30
-                }
31
-            }),
32
-            new webpack.LoaderOptionsPlugin({
33
-                htmlLoader: {
34
-                    minimize: false // workaround for ng2
35
-                }
36
-            })
37
-        ]
38
-    });
39
-};

+ 0
- 52
config/webpack.test.js View File

@@ -1,52 +0,0 @@
1
-var webpack = require('webpack');
2
-var helpers = require('./helpers');
3
-
4
-module.exports = {
5
-    devtool: 'inline-source-map',
6
-
7
-    resolve: {
8
-        extensions: ['.ts', '.js']
9
-    },
10
-
11
-    module: {
12
-        rules: [
13
-            {
14
-                test: /\.ts$/,
15
-                loaders: [
16
-                    {
17
-                        loader: 'awesome-typescript-loader',
18
-                        options: {configFileName: helpers.root('src', 'tsconfig.json')}
19
-                    }, 'angular2-template-loader'
20
-                ]
21
-            },
22
-            {
23
-                test: /\.html$/,
24
-                loader: 'html-loader'
25
-
26
-            },
27
-            {
28
-                test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
29
-                loader: 'null-loader'
30
-            },
31
-            {
32
-                test: /\.css$/,
33
-                exclude: helpers.root('src', 'app'),
34
-                loader: 'null-loader'
35
-            },
36
-            {
37
-                test: /\.css$/,
38
-                include: helpers.root('src', 'app'),
39
-                loader: 'raw-loader'
40
-            }
41
-        ]
42
-    },
43
-
44
-    plugins: [
45
-        new webpack.ContextReplacementPlugin(
46
-            // The (\\|\/) piece accounts for path separators in *nix and Windows
47
-            /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
48
-            helpers.root('./src'), // location of your src
49
-            {} // a map of your routes
50
-        )
51
-    ]
52
-};

+ 14
- 0
e2e/app.e2e-spec.ts View File

@@ -0,0 +1,14 @@
1
+import { ConvFriedliInfoPage } from './app.po';
2
+
3
+describe('conv.friedli.info App', () => {
4
+  let page: ConvFriedliInfoPage;
5
+
6
+  beforeEach(() => {
7
+    page = new ConvFriedliInfoPage();
8
+  });
9
+
10
+  it('should display message saying app works', () => {
11
+    page.navigateTo();
12
+    expect(page.getParagraphText()).toEqual('app works!');
13
+  });
14
+});

+ 11
- 0
e2e/app.po.ts View File

@@ -0,0 +1,11 @@
1
+import { browser, element, by } from 'protractor';
2
+
3
+export class ConvFriedliInfoPage {
4
+  navigateTo() {
5
+    return browser.get('/');
6
+  }
7
+
8
+  getParagraphText() {
9
+    return element(by.css('app-root h1')).getText();
10
+  }
11
+}

+ 12
- 0
e2e/tsconfig.e2e.json View File

@@ -0,0 +1,12 @@
1
+{
2
+  "extends": "../tsconfig.json",
3
+  "compilerOptions": {
4
+    "outDir": "../out-tsc/e2e",
5
+    "module": "commonjs",
6
+    "target": "es5",
7
+    "types":[
8
+      "jasmine",
9
+      "node"
10
+    ]
11
+  }
12
+}

+ 44
- 1
karma.conf.js View File

@@ -1 +1,44 @@
1
-module.exports = require('./config/karma.conf.js');
1
+// Karma configuration file, see link for more information
2
+// https://karma-runner.github.io/0.13/config/configuration-file.html
3
+
4
+module.exports = function (config) {
5
+  config.set({
6
+    basePath: '',
7
+    frameworks: ['jasmine', '@angular/cli'],
8
+    plugins: [
9
+      require('karma-jasmine'),
10
+      require('karma-chrome-launcher'),
11
+      require('karma-jasmine-html-reporter'),
12
+      require('karma-coverage-istanbul-reporter'),
13
+      require('@angular/cli/plugins/karma')
14
+    ],
15
+    client:{
16
+      clearContext: false // leave Jasmine Spec Runner output visible in browser
17
+    },
18
+    files: [
19
+      { pattern: './src/test.ts', watched: false }
20
+    ],
21
+    preprocessors: {
22
+      './src/test.ts': ['@angular/cli']
23
+    },
24
+    mime: {
25
+      'text/x-typescript': ['ts','tsx']
26
+    },
27
+    coverageIstanbulReporter: {
28
+      reports: [ 'html', 'lcovonly' ],
29
+      fixWebpackSourcePaths: true
30
+    },
31
+    angularCli: {
32
+      environment: 'dev'
33
+    },
34
+    reporters: config.angularCli && config.angularCli.codeCoverage
35
+              ? ['progress', 'coverage-istanbul']
36
+              : ['progress', 'kjhtml'],
37
+    port: 9876,
38
+    colors: true,
39
+    logLevel: config.LOG_INFO,
40
+    autoWatch: true,
41
+    browsers: ['Chrome'],
42
+    singleRun: false
43
+  });
44
+};

+ 36
- 41
package.json View File

@@ -19,54 +19,49 @@
19 19
     "type": "git",
20 20
     "url": "https://gittr.ch/manuel/dencode.org.git"
21 21
   },
22
+  "scripts": {
23
+    "ng": "ng",
24
+    "start": "ng serve",
25
+    "build": "ng build",
26
+    "build-prod": "ng build --env=prod",
27
+    "test": "ng test",
28
+    "lint": "ng lint",
29
+    "e2e": "ng e2e"
30
+  },
31
+  "private": true,
22 32
   "dependencies": {
23
-    "@angular/common": "^2.4.0",
24
-    "@angular/compiler": "^2.4.0",
25
-    "@angular/core": "^2.4.0",
26
-    "@angular/forms": "^2.4.0",
27
-    "@angular/platform-browser": "^2.4.0",
28
-    "@angular/platform-browser-dynamic": "^2.4.0",
33
+    "@angular/common": "^4.0.0",
34
+    "@angular/compiler": "^4.0.0",
35
+    "@angular/core": "^4.0.0",
36
+    "@angular/forms": "^4.0.0",
37
+    "@angular/http": "^4.0.0",
38
+    "@angular/platform-browser": "^4.0.0",
39
+    "@angular/platform-browser-dynamic": "^4.0.0",
40
+    "@angular/router": "^4.0.0",
29 41
     "core-js": "^2.4.1",
30
-    "rxjs": "^5.0.1",
31
-    "zone.js": "^0.7.4",
32
-    "bootstrap": "^3.3.0",
42
+    "punycode": "^2.1.0",
33 43
     "quoted-printable": "^1.0.0",
44
+    "rxjs": "^5.1.0",
34 45
     "utf8": "^2.1.0",
35
-    "punycode": "^1.4.0"
46
+    "zone.js": "^0.8.4"
36 47
   },
37 48
   "devDependencies": {
38
-    "@types/jasmine": "2.5.36",
39
-    "@types/node": "^6.0.45",
40
-    "angular2-template-loader": "^0.6.0",
41
-    "awesome-typescript-loader": "^3.0.4",
42
-    "css-loader": "^0.26.1",
43
-    "extract-text-webpack-plugin": "^2.0.0",
44
-    "file-loader": "^0.9.0",
45
-    "html-loader": "^0.4.3",
46
-    "html-webpack-plugin": "^2.16.1",
47
-    "jasmine-core": "^2.4.1",
48
-    "karma": "^1.2.0",
49
+    "@angular/cli": "^1.0.0",
50
+    "@angular/compiler-cli": "^4.0.0",
51
+    "@types/jasmine": "^2.5.38",
52
+    "@types/node": "^7.0.0",
53
+    "codelyzer": "^2.0.0",
54
+    "jasmine-core": "^2.5.2",
55
+    "jasmine-spec-reporter": "^3.2.0",
56
+    "karma": "^1.4.1",
49 57
     "karma-chrome-launcher": "^2.0.0",
50
-    "karma-firefox-launcher": "^1.0.1",
51
-    "karma-jasmine": "^1.0.2",
58
+    "karma-cli": "^1.0.1",
59
+    "karma-coverage-istanbul-reporter": "^1.0.0",
60
+    "karma-jasmine": "^1.1.0",
52 61
     "karma-jasmine-html-reporter": "^0.2.2",
53
-    "karma-phantomjs-launcher": "^1.0.4",
54
-    "karma-sourcemap-loader": "^0.3.7",
55
-    "karma-webpack": "^2.0.1",
56
-    "null-loader": "^0.1.1",
57
-    "phantomjs-prebuilt": "^2.1.14",
58
-    "raw-loader": "^0.5.1",
59
-    "rimraf": "^2.5.2",
60
-    "style-loader": "^0.13.1",
61
-    "typescript": "^2.0.10",
62
-    "webpack": "^2.2.1",
63
-    "webpack-dev-server": "^2.4.1",
64
-    "webpack-merge": "^3.0.0"
65
-  },
66
-  "scripts": {
67
-    "start": "webpack-dev-server --inline --progress --port 8080",
68
-    "test": "karma start",
69
-    "build-dev": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail --env.NODE_ENV=development",
70
-    "build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail --env.NODE_ENV=production"
62
+    "protractor": "^5.1.0",
63
+    "ts-node": "^3.0.0",
64
+    "tslint": "^5.0.0",
65
+    "typescript": "^2.2.0"
71 66
   }
72 67
 }

+ 30
- 0
protractor.conf.js View File

@@ -0,0 +1,30 @@
1
+// Protractor configuration file, see link for more information
2
+// https://github.com/angular/protractor/blob/master/lib/config.ts
3
+
4
+const { SpecReporter } = require('jasmine-spec-reporter');
5
+
6
+exports.config = {
7
+  allScriptsTimeout: 11000,
8
+  specs: [
9
+    './e2e/**/*.e2e-spec.ts'
10
+  ],
11
+  capabilities: {
12
+    'browserName': 'chrome'
13
+  },
14
+  directConnect: true,
15
+  baseUrl: 'http://localhost:4200/',
16
+  framework: 'jasmine',
17
+  jasmineNodeOpts: {
18
+    showColors: true,
19
+    defaultTimeoutInterval: 30000,
20
+    print: function() {}
21
+  },
22
+  beforeLaunch: function() {
23
+    require('ts-node').register({
24
+      project: 'e2e/tsconfig.e2e.json'
25
+    });
26
+  },
27
+  onPrepare() {
28
+    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
29
+  }
30
+};

+ 27
- 0
src/app/app-routing.module.js View File

@@ -0,0 +1,27 @@
1
+"use strict";
2
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+};
8
+var core_1 = require('@angular/core');
9
+var router_1 = require('@angular/router');
10
+var routes = [
11
+    {
12
+        path: '',
13
+        children: []
14
+    }
15
+];
16
+var AppRoutingModule = (function () {
17
+    function AppRoutingModule() {
18
+    }
19
+    AppRoutingModule = __decorate([
20
+        core_1.NgModule({
21
+            imports: [router_1.RouterModule.forRoot(routes)],
22
+            exports: [router_1.RouterModule]
23
+        })
24
+    ], AppRoutingModule);
25
+    return AppRoutingModule;
26
+}());
27
+exports.AppRoutingModule = AppRoutingModule;

+ 15
- 0
src/app/app-routing.module.ts View File

@@ -0,0 +1,15 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+
4
+const routes: Routes = [
5
+  {
6
+    path: '',
7
+    children: []
8
+  }
9
+];
10
+
11
+@NgModule({
12
+  imports: [RouterModule.forRoot(routes)],
13
+  exports: [RouterModule]
14
+})
15
+export class AppRoutingModule { }

+ 0
- 118
src/app/app.component.css View File

@@ -1,118 +0,0 @@
1
-.inputwrapper {
2
-    font-family: "ABeeZee", sans-serif;
3
-    margin: 0 1em 1em 1em;
4
-}
5
-
6
-.textwrapper {
7
-    margin: 0 0 1em 0;
8
-    padding: 0 1em 0 0;
9
-}
10
-
11
-.arrow_box {
12
-    position: relative;
13
-    background: #fff;
14
-    border: 1px solid #aaa;
15
-}
16
-
17
-.arrow_box:focus {
18
-    border-color: #888;
19
-}
20
-
21
-.arrow_box:hover {
22
-    border-color: #333;
23
-}
24
-
25
-.arrow_box:after, .arrow_box:before {
26
-    top: 100%;
27
-    left: 50%;
28
-    border: solid transparent;
29
-    content: " ";
30
-    height: 0;
31
-    width: 0;
32
-    position: absolute;
33
-    pointer-events: none;
34
-}
35
-
36
-.arrow_box:after {
37
-    border-color: rgba(255, 255, 255, 0);
38
-    border-top-color: #fff;
39
-    border-width: 1em;
40
-    margin-left: -1em;
41
-}
42
-
43
-.arrow_box:before {
44
-    border-color: rgba(170, 170, 170, 0);
45
-    border-top-color: #aaa;
46
-    border-width: calc(1em + 1px);
47
-    margin-left: calc(-1em - 1px);
48
-}
49
-
50
-.arrow_box:focus:before {
51
-    border-color: rgba(136, 136, 136, 0);
52
-    border-top-color: #888;
53
-}
54
-
55
-.arrow_box:hover:before {
56
-    border-color: rgba(51, 51, 51, 0);
57
-    border-top-color: #333;
58
-}
59
-
60
-.selectwrapper > .arrow_box {
61
-    display: inline-block;
62
-}
63
-
64
-.textinput {
65
-    background-color: #fff;
66
-    border: none;
67
-    color: #000;
68
-    font-family: "Free Monospaced", monospace;
69
-    height: 10em;
70
-    margin: 0;
71
-    padding: 0.5em;
72
-    resize: vertical;
73
-    width: 100%;
74
-}
75
-
76
-.textinput:focus {
77
-    border-color: #888;
78
-}
79
-
80
-.textinput:hover {
81
-    border-color: #333;
82
-}
83
-
84
-.selectwrapper {
85
-    margin: 0 0 1em 0;
86
-    padding: 0;
87
-    text-align: center;
88
-}
89
-
90
-.select {
91
-    background-color: #fff;
92
-    border: none;
93
-    color: #000;
94
-    font-family: "ABeeZee", sans-serif;
95
-    margin: 0;
96
-    padding: 0.5em;
97
-}
98
-
99
-.option {
100
-    /*    font-family: "ABeeZee", sans-serif;*/
101
-}
102
-
103
-.selectwrapper.error > .arrow_box {
104
-    border-color: red;
105
-}
106
-
107
-.selectwrapper.error > .arrow_box:before {
108
-    border-top-color: red;
109
-}
110
-
111
-.selectwrapper.error select {
112
-    color: red;
113
-}
114
-
115
-.errormessage {
116
-    color: red;
117
-    text-align: center;
118
-}

+ 12
- 11
src/app/app.component.html View File

@@ -1,16 +1,17 @@
1 1
 <div *ngFor="let step of steps" class="inputwrapper">
2
-    <div class="textwrapper arrow_box">
2
+  <div class="textwrapper arrow_box">
3 3
         <textarea class="textinput" (keyup)="update(step)" placeholder="Please enter your input ..."
4 4
                   [(ngModel)]="step.content">{{step.content}}</textarea>
5
+  </div>
6
+  <div [ngClass]="{selectwrapper: true, error: step.error}">
7
+    <div class="arrow_box">
8
+      <select class="select" (change)="convert(step, $event)">
9
+        <option id="undefined">Select conversion ...</option>
10
+        <option class="option" *ngFor="let c of converters" id="{{c.getId()}}">{{c.getDisplayname()}}
11
+        </option>
12
+      </select>
5 13
     </div>
6
-    <div [ngClass]="{selectwrapper: true, error: step.error}">
7
-        <div class="arrow_box">
8
-            <select class="select" (change)="convert(step, $event)">
9
-                <option id="undefined">Select conversion ...</option>
10
-                <option class="option" *ngFor="let c of converters" id="{{c.getId()}}">{{c.getDisplayname()}}
11
-                </option>
12
-            </select>
13
-        </div>
14
-    </div>
15
-    <div class="errormessage" *ngIf="step.error">{{step.message}}</div>
14
+  </div>
15
+  <div class="errormessage" *ngIf="step.error" [innerHTML]="step.message"></div>
16 16
 </div>
17
+<!--<router-outlet></router-outlet>-->

+ 65
- 0
src/app/app.component.js View File

@@ -0,0 +1,65 @@
1
+"use strict";
2
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+};
8
+var core_1 = require("@angular/core");
9
+var converterregistry_service_1 = require("./converterregistry.service");
10
+var inputcomponentmanager_service_1 = require("./inputcomponentmanager.service");
11
+var nativelibrarywrapper_service_1 = require("./nativelibrarywrapper.service");
12
+var AppComponent = (function () {
13
+    function AppComponent(converterRegistryService, inputComponentManagerService) {
14
+        this.converterRegistryService = converterRegistryService;
15
+        this.inputComponentManagerService = inputComponentManagerService;
16
+        this.steps = [];
17
+        this.converters = [];
18
+    }
19
+    AppComponent.prototype.convert = function (step, $event) {
20
+        step.selectedConverter = this.converterRegistryService.getConverter($event.target.selectedOptions[0].id);
21
+        this.update(step);
22
+    };
23
+    AppComponent.prototype.update = function (step) {
24
+        var converter = step.selectedConverter;
25
+        if (converter !== undefined) {
26
+            var content = step.content;
27
+            var result = void 0;
28
+            try {
29
+                result = converter.convert(content);
30
+            }
31
+            catch (error) {
32
+                if (typeof console === "object" && typeof console.log === "function") {
33
+                    console.log(error);
34
+                }
35
+                step.message = error.message;
36
+                step.error = true;
37
+                result = null;
38
+            }
39
+            if (result !== null) {
40
+                step.message = "";
41
+                step.error = false;
42
+                if (result !== "") {
43
+                    var nextComponent = this.inputComponentManagerService.getNext(step);
44
+                    nextComponent.content = result;
45
+                    this.update(nextComponent);
46
+                }
47
+            }
48
+        }
49
+    };
50
+    AppComponent.prototype.ngOnInit = function () {
51
+        this.converters = this.converterRegistryService.getAllConverters();
52
+        this.steps = this.inputComponentManagerService.getAllComponents();
53
+        this.inputComponentManagerService.getFirst();
54
+    };
55
+    AppComponent = __decorate([
56
+        core_1.Component({
57
+            selector: 'app-root',
58
+            templateUrl: './app.component.html',
59
+            styleUrls: ['./app.component.scss'],
60
+            providers: [converterregistry_service_1.ConverterRegistryService, inputcomponentmanager_service_1.InputComponentManagerService, nativelibrarywrapper_service_1.NativeLibraryWrapperService]
61
+        })
62
+    ], AppComponent);
63
+    return AppComponent;
64
+}());
65
+exports.AppComponent = AppComponent;

+ 107
- 0
src/app/app.component.scss View File

@@ -0,0 +1,107 @@
1
+.inputwrapper {
2
+  font-family: "ABeeZee", sans-serif;
3
+  margin: 0 1em 1em 1em;
4
+}
5
+
6
+.textwrapper {
7
+  margin: 0 0 1em 0;
8
+  padding: 0 1em 0 0;
9
+}
10
+
11
+.arrow_box {
12
+  position: relative;
13
+  background: #fff;
14
+  border: 1px solid #aaa;
15
+  &:focus {
16
+    border-color: #888;
17
+  }
18
+  &:hover {
19
+    border-color: #333;
20
+  }
21
+  &:after, &:before {
22
+    top: 100%;
23
+    left: 50%;
24
+    border: solid transparent;
25
+    content: " ";
26
+    height: 0;
27
+    width: 0;
28
+    position: absolute;
29
+    pointer-events: none;
30
+  }
31
+  &:after {
32
+    border-color: rgba(255, 255, 255, 0);
33
+    border-top-color: #fff;
34
+    border-width: 1em;
35
+    margin-left: -1em;
36
+  }
37
+  &:before {
38
+    border-color: rgba(170, 170, 170, 0);
39
+    border-top-color: #aaa;
40
+    border-width: calc(1em + 1px);
41
+    margin-left: calc(-1em - 1px);
42
+  }
43
+  &:focus:before {
44
+    border-color: rgba(136, 136, 136, 0);
45
+    border-top-color: #888;
46
+  }
47
+  &:hover:before {
48
+    border-color: rgba(51, 51, 51, 0);
49
+    border-top-color: #333;
50
+  }
51
+  .selectwrapper > & {
52
+    display: inline-block;
53
+  }
54
+}
55
+
56
+.textinput {
57
+  background-color: #fff;
58
+  border: none;
59
+  color: #000;
60
+  font-family: "Free Monospaced", monospace;
61
+  height: 10em;
62
+  margin: 0;
63
+  padding: 0.5em;
64
+  resize: vertical;
65
+  width: 100%;
66
+  &:focus {
67
+    border-color: #888;
68
+  }
69
+  &:hover {
70
+    border-color: #333;
71
+  }
72
+}
73
+
74
+.selectwrapper {
75
+  margin: 0 0 1em 0;
76
+  padding: 0;
77
+  text-align: center;
78
+  &.error {
79
+    > .arrow_box {
80
+      border-color: red;
81
+      &:before {
82
+        border-top-color: red;
83
+      }
84
+    }
85
+    select {
86
+      color: red;
87
+    }
88
+  }
89
+}
90
+
91
+.select {
92
+  background-color: #fff;
93
+  border: none;
94
+  color: #000;
95
+  font-family: "ABeeZee", sans-serif;
96
+  margin: 0;
97
+  padding: 0.5em;
98
+}
99
+
100
+.option {
101
+  /*    font-family: "ABeeZee", sans-serif;*/
102
+}
103
+
104
+.errormessage {
105
+  color: red;
106
+  text-align: center;
107
+}

+ 21
- 0
src/app/app.component.spec.js View File

@@ -0,0 +1,21 @@
1
+"use strict";
2
+var testing_1 = require('@angular/core/testing');
3
+var testing_2 = require('@angular/router/testing');
4
+var app_component_1 = require('./app.component');
5
+describe('AppComponent', function () {
6
+    beforeEach(testing_1.async(function () {
7
+        testing_1.TestBed.configureTestingModule({
8
+            imports: [
9
+                testing_2.RouterTestingModule
10
+            ],
11
+            declarations: [
12
+                app_component_1.AppComponent
13
+            ],
14
+        }).compileComponents();
15
+    }));
16
+    it('should create the app', testing_1.async(function () {
17
+        var fixture = testing_1.TestBed.createComponent(app_component_1.AppComponent);
18
+        var app = fixture.debugElement.componentInstance;
19
+        expect(app).toBeTruthy();
20
+    }));
21
+});

+ 22
- 15
src/app/app.component.spec.ts View File

@@ -1,16 +1,23 @@
1
-import {TestBed} from "@angular/core/testing";
2
-import {AppComponent} from "./app.component";
3
-import {FormsModule} from "@angular/forms";
1
+import { TestBed, async } from '@angular/core/testing';
2
+import { RouterTestingModule } from '@angular/router/testing';
4 3
 
5
-describe('App', () => {
6
-    beforeEach(() => {
7
-        TestBed.configureTestingModule({
8
-            declarations: [AppComponent],
9
-            imports: [FormsModule]
10
-        });
11
-    });
12
-    it('should work', () => {
13
-        let fixture = TestBed.createComponent(AppComponent);
14
-        expect(fixture.componentInstance instanceof AppComponent).toBe(true, 'should create AppComponent');
15
-    });
16
-});
4
+import { AppComponent } from './app.component';
5
+
6
+describe('AppComponent', () => {
7
+  beforeEach(async(() => {
8
+    TestBed.configureTestingModule({
9
+      imports: [
10
+        RouterTestingModule
11
+      ],
12
+      declarations: [
13
+        AppComponent
14
+      ],
15
+    }).compileComponents();
16
+  }));
17
+
18
+  it('should create the app', async(() => {
19
+    const fixture = TestBed.createComponent(AppComponent);
20
+    const app = fixture.debugElement.componentInstance;
21
+    expect(app).toBeTruthy();
22
+  }));
23
+});

+ 43
- 45
src/app/app.component.ts View File

@@ -1,61 +1,59 @@
1 1
 import {Component, OnInit} from "@angular/core";
2 2
 import {ConverterRegistryService} from "./converterregistry.service";
3 3
 import {InputComponentManagerService} from "./inputcomponentmanager.service";
4
-import {Converter} from "./converter/converter";
5 4
 import {NativeLibraryWrapperService} from "./nativelibrarywrapper.service";
6 5
 import {Step} from "./step";
7
-import "../assets/css/style.css";
6
+import {Converter} from "./converter/converter";
8 7
 
9 8
 @Component({
10
-    selector: "den-app",
11
-    templateUrl: "./app.component.html",
12
-    styleUrls: ["./app.component.css"],
13
-    providers: [ConverterRegistryService, InputComponentManagerService, NativeLibraryWrapperService]
9
+  selector: 'app-root',
10
+  templateUrl: './app.component.html',
11
+  styleUrls: ['./app.component.scss'],
12
+  providers: [ConverterRegistryService, InputComponentManagerService, NativeLibraryWrapperService]
14 13
 })
15
-export class AppComponent extends OnInit {
16
-    public steps:Step[] = [];
17
-    public converters:Converter[] = [];
14
+export class AppComponent implements OnInit {
15
+  public steps: Step[] = [];
16
+  public converters: Converter[] = [];
18 17
 
19
-    constructor(private converterRegistryService:ConverterRegistryService, private inputComponentManagerService:InputComponentManagerService) {
20
-        super();
21
-    }
18
+  constructor(private converterRegistryService: ConverterRegistryService, private inputComponentManagerService: InputComponentManagerService) {
19
+  }
22 20
 
23
-    convert(step:Step, $event:any):void {
24
-        step.selectedConverter = this.converterRegistryService.getConverter($event.target.selectedOptions[0].id);
25
-        this.update(step);
26
-    }
21
+  convert(step: Step, $event: any): void {
22
+    step.selectedConverter = this.converterRegistryService.getConverter($event.target.selectedOptions[0].id);
23
+    this.update(step);
24
+  }
27 25
 
28
-    update(step:Step):void {
29
-        let converter:Converter = step.selectedConverter;
26
+  update(step: Step): void {
27
+    let converter: Converter = step.selectedConverter;
30 28
 
31
-        if (converter !== undefined) {
32
-            let content:string = step.content;
33
-            let result:string;
34
-            try {
35
-                result = converter.convert(content);
36
-            } catch (error) {
37
-                if (typeof console === "object" && typeof console.log === "function") {
38
-                    console.log(error);
39
-                }
40
-                step.message = error.message;
41
-                step.error = true;
42
-                result = null;
43
-            }
44
-            if (result !== null) {
45
-                step.message = "";
46
-                step.error = false;
47
-                if (result !== "") {
48
-                    let nextComponent:Step = this.inputComponentManagerService.getNext(step);
49
-                    nextComponent.content = result;
50
-                    this.update(nextComponent);
51
-                }
52
-            }
29
+    if (converter !== undefined) {
30
+      let content: string = step.content;
31
+      let result: string;
32
+      try {
33
+        result = converter.convert(content);
34
+      } catch (error) {
35
+        if (typeof console === "object" && typeof console.log === "function") {
36
+          console.log(error);
37
+        }
38
+        step.message = error.message;
39
+        step.error = true;
40
+        result = null;
41
+      }
42
+      if (result !== null) {
43
+        step.message = "";
44
+        step.error = false;
45
+        if (result !== "") {
46
+          let nextComponent: Step = this.inputComponentManagerService.getNext(step);
47
+          nextComponent.content = result;
48
+          this.update(nextComponent);
53 49
         }
50
+      }
54 51
     }
52
+  }
55 53
 
56
-    ngOnInit():void {
57
-        this.converters = this.converterRegistryService.getAllConverters();
58
-        this.steps = this.inputComponentManagerService.getAllComponents();
59
-        this.inputComponentManagerService.getFirst();
60
-    }
54
+  ngOnInit(): void {
55
+    this.converters = this.converterRegistryService.getAllConverters();
56
+    this.steps = this.inputComponentManagerService.getAllComponents();
57
+    this.inputComponentManagerService.getFirst();
58
+  }
61 59
 }

+ 34
- 0
src/app/app.module.js View File

@@ -0,0 +1,34 @@
1
+"use strict";
2
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+};
8
+var platform_browser_1 = require('@angular/platform-browser');
9
+var core_1 = require('@angular/core');
10
+var forms_1 = require('@angular/forms');
11
+var http_1 = require('@angular/http');
12
+var app_routing_module_1 = require('./app-routing.module');
13
+var app_component_1 = require('./app.component');
14
+var AppModule = (function () {
15
+    function AppModule() {
16
+    }
17
+    AppModule = __decorate([
18
+        core_1.NgModule({
19
+            declarations: [
20
+                app_component_1.AppComponent
21
+            ],
22
+            imports: [
23
+                platform_browser_1.BrowserModule,
24
+                forms_1.FormsModule,
25
+                http_1.HttpModule,
26
+                app_routing_module_1.AppRoutingModule
27
+            ],
28
+            providers: [],
29
+            bootstrap: [app_component_1.AppComponent]
30
+        })
31
+    ], AppModule);
32
+    return AppModule;
33
+}());
34
+exports.AppModule = AppModule;

+ 19
- 14
src/app/app.module.ts View File

@@ -1,17 +1,22 @@
1
-import {NgModule} from "@angular/core";
2
-import {BrowserModule} from "@angular/platform-browser";
3
-import {FormsModule} from "@angular/forms";
4
-import {AppComponent} from "./app.component";
1
+import { BrowserModule } from '@angular/platform-browser';
2
+import { NgModule } from '@angular/core';
3
+import { FormsModule } from '@angular/forms';
4
+import { HttpModule } from '@angular/http';
5
+
6
+import { AppRoutingModule } from './app-routing.module';
7
+import { AppComponent } from './app.component';
5 8
 
6 9
 @NgModule({
7
-    imports: [
8
-        BrowserModule,
9
-        FormsModule
10
-    ],
11
-    declarations: [
12
-        AppComponent
13
-    ],
14
-    bootstrap: [AppComponent]
10
+  declarations: [
11
+    AppComponent
12
+  ],
13
+  imports: [
14
+    BrowserModule,
15
+    FormsModule,
16
+    HttpModule,
17
+    AppRoutingModule
18
+  ],
19
+  providers: [],
20
+  bootstrap: [AppComponent]
15 21
 })
16
-export class AppModule {
17
-}
22
+export class AppModule { }

+ 21
- 0
src/app/converter/base64decoder.js View File

@@ -0,0 +1,21 @@
1
+"use strict";
2
+var Base64Decoder = (function () {
3
+    function Base64Decoder() {
4
+    }
5
+    Base64Decoder.prototype.getDisplayname = function () {
6
+        return "Decode Base 64";
7
+    };
8
+    Base64Decoder.prototype.getId = function () {
9
+        return "base64decode";
10
+    };
11
+    Base64Decoder.prototype.convert = function (input) {
12
+        try {
13
+            return atob(input);
14
+        }
15
+        catch (exception) {
16
+            throw new Error("Could not decode base64 string. Maybe corrupt input?");
17
+        }
18
+    };
19
+    return Base64Decoder;
20
+}());
21
+exports.Base64Decoder = Base64Decoder;

+ 22
- 0
src/app/converter/base64encoder.js View File

@@ -0,0 +1,22 @@
1
+"use strict";
2
+var Base64Encoder = (function () {
3
+    function Base64Encoder() {
4
+    }
5
+    Base64Encoder.prototype.getDisplayname = function () {
6
+        return "Encode Base 64";
7
+    };
8
+    Base64Encoder.prototype.getId = function () {
9
+        return "base64encode";
10
+    };
11
+    Base64Encoder.prototype.convert = function (input) {
12
+        try {
13
+            return btoa(input);
14
+        }
15
+        catch (exception) {
16
+            console.error(exception);
17
+            throw new Error("Ouch! Looks like you've got a UTF-8 character there. Too bad, this is not supported yet. We're working on it and hope to be ready soon! Why don't you <a href=\"https://duckduckgo.com/?q=cute+kitties&iar=images\">enjoy some kittens</a> meanwhile?");
18
+        }
19
+    };
20
+    return Base64Encoder;
21
+}());
22
+exports.Base64Encoder = Base64Encoder;

+ 13
- 12
src/app/converter/base64encoder.ts View File

@@ -1,19 +1,20 @@
1 1
 import {Converter} from "./converter";
2 2
 
3 3
 export class Base64Encoder implements Converter {
4
-    getDisplayname():string {
5
-        return "Encode Base 64";
6
-    }
4
+  getDisplayname(): string {
5
+    return "Encode Base 64";
6
+  }
7 7
 
8
-    getId():string {
9
-        return "base64encode";
10
-    }
8
+  getId(): string {
9
+    return "base64encode";
10
+  }
11 11
 
12
-    convert(input:string):string {
13
-        try {
14
-            return btoa(input);
15
-        } catch (exception) {
16
-            throw new Error("Could not encode base64 string. This should not happen, so why don't you just try again?");
17
-        }
12
+  convert(input: string): string {
13
+    try {
14
+      return btoa(input);
15
+    } catch (exception) {
16
+      console.error(exception);
17
+      throw new Error("Ouch! Looks like you've got a UTF-8 character there. Too bad, this is not supported yet. We're working on it and hope to be ready soon! Why don't you <a href=\"https://duckduckgo.com/?q=cute+kitties&iar=images\">enjoy some kittens</a> meanwhile?");
18 18
     }
19
+  }
19 20
 }

+ 20
- 0
src/app/converter/bintodecconverter.js View File

@@ -0,0 +1,20 @@
1
+"use strict";
2
+var BinToDecConverter = (function () {
3
+    function BinToDecConverter() {
4
+    }
5
+    BinToDecConverter.prototype.getDisplayname = function () {
6
+        return "Convert binary to decimal";
7
+    };
8
+    BinToDecConverter.prototype.getId = function () {
9
+        return "bintodec";
10
+    };
11
+    BinToDecConverter.prototype.convert = function (input) {
12
+        var n = parseInt(input, 2);
13
+        if (isNaN(n)) {
14
+            throw new Error("The input seems not to be a valid binary number.");
15
+        }
16
+        return n.toString(10);
17
+    };
18
+    return BinToDecConverter;
19
+}());
20
+exports.BinToDecConverter = BinToDecConverter;

+ 1
- 0
src/app/converter/converter.js View File

@@ -0,0 +1 @@
1
+"use strict";

+ 20
- 0
src/app/converter/dectobinconverter.js View File

@@ -0,0 +1,20 @@
1
+"use strict";
2
+var DecToBinConverter = (function () {
3
+    function DecToBinConverter() {
4
+    }
5
+    DecToBinConverter.prototype.getDisplayname = function () {
6
+        return "Convert decimal to binary";
7
+    };
8
+    DecToBinConverter.prototype.getId = function () {
9
+        return "dectobin";
10
+    };
11
+    DecToBinConverter.prototype.convert = function (input) {
12
+        var n = parseInt(input, 10);
13
+        if (isNaN(n)) {
14
+            throw new Error("The input seems not to be a valid integer.");
15
+        }
16
+        return n.toString(2);
17
+    };
18
+    return DecToBinConverter;
19
+}());
20
+exports.DecToBinConverter = DecToBinConverter;

+ 20
- 0
src/app/converter/dectohexconverter.js View File

@@ -0,0 +1,20 @@
1
+"use strict";
2
+var DecToHexConverter = (function () {
3
+    function DecToHexConverter() {
4
+    }
5
+    DecToHexConverter.prototype.getDisplayname = function () {
6
+        return "Convert decimal to hexadecimal";
7
+    };
8
+    DecToHexConverter.prototype.getId = function () {
9
+        return "dectohex";
10
+    };
11
+    DecToHexConverter.prototype.convert = function (input) {
12
+        var n = parseInt(input, 10);
13
+        if (isNaN(n)) {
14
+            throw new Error("The input seems not to be a valid integer.");
15
+        }
16
+        return n.toString(16);
17
+    };
18
+    return DecToHexConverter;
19
+}());
20
+exports.DecToHexConverter = DecToHexConverter;

+ 20
- 0
src/app/converter/hextodecconverter.js View File

@@ -0,0 +1,20 @@
1
+"use strict";
2
+var HexToDecConverter = (function () {
3
+    function HexToDecConverter() {
4
+    }
5
+    HexToDecConverter.prototype.getDisplayname = function () {
6
+        return "Convert hexadecimal to decimal";
7
+    };
8
+    HexToDecConverter.prototype.getId = function () {
9
+        return "hextodec";
10
+    };
11
+    HexToDecConverter.prototype.convert = function (input) {
12
+        var n = parseInt(input, 16);
13
+        if (isNaN(n)) {
14
+            throw new Error("The input seems not to be a valid hexadecimal number.");
15
+        }
16
+        return n.toString(10);
17
+    };
18
+    return HexToDecConverter;
19
+}());
20
+exports.HexToDecConverter = HexToDecConverter;

+ 20
- 0
src/app/converter/htmlentitiesdecoder.js View File

@@ -0,0 +1,20 @@
1
+"use strict";
2
+var HTMLEntitiesDecoder = (function () {
3
+    function HTMLEntitiesDecoder() {
4
+    }
5
+    HTMLEntitiesDecoder.prototype.getDisplayname = function () {
6
+        return "Decode HTML entities";
7
+    };
8
+    HTMLEntitiesDecoder.prototype.getId = function () {
9
+        return "decodehtmlentities";
10
+    };
11
+    HTMLEntitiesDecoder.prototype.convert = function (input) {
12
+        return input
13
+            .replace(/\&quot\;/g, "\"")
14
+            .replace(/\&gt\;/g, ">")
15
+            .replace(/\&lt\;/g, "<")
16
+            .replace(/\&amp\;/g, "&");
17
+    };
18
+    return HTMLEntitiesDecoder;
19
+}());
20
+exports.HTMLEntitiesDecoder = HTMLEntitiesDecoder;

+ 20
- 0
src/app/converter/htmlentitiesencoder.js View File

@@ -0,0 +1,20 @@
1
+"use strict";
2
+var HTMLEntitiesEncoder = (function () {
3
+    function HTMLEntitiesEncoder() {
4
+    }
5
+    HTMLEntitiesEncoder.prototype.getDisplayname = function () {
6
+        return "Encode HTML entities";
7
+    };
8
+    HTMLEntitiesEncoder.prototype.getId = function () {
9
+        return "encodehtmlentities";
10
+    };
11
+    HTMLEntitiesEncoder.prototype.convert = function (input) {
12
+        return input
13
+            .replace(/\&/g, "&amp;")
14
+            .replace(/\</g, "&lt;")
15
+            .replace(/\>/g, "&gt;")
16
+            .replace(/\"/g, "&quot;");
17
+    };
18
+    return HTMLEntitiesEncoder;
19
+}());
20
+exports.HTMLEntitiesEncoder = HTMLEntitiesEncoder;

+ 17
- 0
src/app/converter/punycodedecoder.js View File

@@ -0,0 +1,17 @@
1
+"use strict";
2
+var PunycodeDecoder = (function () {
3
+    function PunycodeDecoder(nativeLibraryWrapperService) {
4
+        this.nativeLibraryWrapperService = nativeLibraryWrapperService;
5
+    }
6
+    PunycodeDecoder.prototype.getDisplayname = function () {
7
+        return "Decode from punycode";
8
+    };
9
+    PunycodeDecoder.prototype.getId = function () {
10
+        return "decodepunycode";
11
+    };
12
+    PunycodeDecoder.prototype.convert = function (input) {
13
+        return this.nativeLibraryWrapperService.punycode.decode(input);
14
+    };
15
+    return PunycodeDecoder;
16
+}());
17
+exports.PunycodeDecoder = PunycodeDecoder;

+ 17
- 0
src/app/converter/punycodeencoder.js View File

@@ -0,0 +1,17 @@
1
+"use strict";
2
+var PunycodeEncoder = (function () {
3
+    function PunycodeEncoder(nativeLibraryWrapperService) {
4
+        this.nativeLibraryWrapperService = nativeLibraryWrapperService;
5
+    }
6
+    PunycodeEncoder.prototype.getDisplayname = function () {
7
+        return "Encode as punycode";
8
+    };
9
+    PunycodeEncoder.prototype.getId = function () {
10
+        return "encodepunycode";
11
+    };
12
+    PunycodeEncoder.prototype.convert = function (input) {
13
+        return this.nativeLibraryWrapperService.punycode.encode(input);
14
+    };
15
+    return PunycodeEncoder;
16
+}());
17
+exports.PunycodeEncoder = PunycodeEncoder;

+ 22
- 0
src/app/converter/quotedprintabledecoder.js View File

@@ -0,0 +1,22 @@
1
+"use strict";
2
+var QuotedPrintableDecoder = (function () {
3
+    function QuotedPrintableDecoder(nativeLibraryWrapperService) {
4
+        this.nativeLibraryWrapperService = nativeLibraryWrapperService;
5
+    }
6
+    QuotedPrintableDecoder.prototype.getDisplayname = function () {
7
+        return "Decode quoted printable";
8
+    };
9
+    QuotedPrintableDecoder.prototype.getId = function () {
10
+        return "decodequotedprintable";
11
+    };
12
+    QuotedPrintableDecoder.prototype.convert = function (input) {
13
+        try {
14
+            return this.nativeLibraryWrapperService.quotedPrintable.decode(input);
15
+        }
16
+        catch (error) {
17
+            throw new Error("The input can not be interpreted as quoted-printable. May be corrupt?");
18
+        }
19
+    };
20
+    return QuotedPrintableDecoder;
21
+}());
22
+exports.QuotedPrintableDecoder = QuotedPrintableDecoder;

+ 17
- 0
src/app/converter/quotedprintableencoder.js View File

@@ -0,0 +1,17 @@
1
+"use strict";
2
+var QuotedPrintableEncoder = (function () {
3
+    function QuotedPrintableEncoder(nativeLibraryWrapperService) {
4
+        this.nativeLibraryWrapperService = nativeLibraryWrapperService;
5
+    }
6
+    QuotedPrintableEncoder.prototype.getDisplayname = function () {
7
+        return "Encode quoted printable";
8
+    };
9
+    QuotedPrintableEncoder.prototype.getId = function () {
10
+        return "encodequotedprintable";
11
+    };
12
+    QuotedPrintableEncoder.prototype.convert = function (input) {
13
+        return this.nativeLibraryWrapperService.quotedPrintable.encode(input);
14
+    };
15
+    return QuotedPrintableEncoder;
16
+}());
17
+exports.QuotedPrintableEncoder = QuotedPrintableEncoder;

+ 16
- 0
src/app/converter/uricomponentdecoder.js View File

@@ -0,0 +1,16 @@
1
+"use strict";
2
+var URIComponentDecoder = (function () {
3
+    function URIComponentDecoder() {
4
+    }
5
+    URIComponentDecoder.prototype.getDisplayname = function () {
6
+        return "Decode URI component";
7
+    };
8
+    URIComponentDecoder.prototype.getId = function () {
9
+        return "uricomponentdecode";
10
+    };
11
+    URIComponentDecoder.prototype.convert = function (input) {
12
+        return decodeURIComponent(input);
13
+    };
14
+    return URIComponentDecoder;
15
+}());
16
+exports.URIComponentDecoder = URIComponentDecoder;

+ 18
- 0
src/app/converter/uricomponentencoder.js View File

@@ -0,0 +1,18 @@
1
+"use strict";
2
+var URIComponentEncoder = (function () {
3
+    function URIComponentEncoder() {
4
+    }
5
+    URIComponentEncoder.prototype.getDisplayname = function () {
6
+        return "Encode URI component";
7
+    };
8
+    URIComponentEncoder.prototype.getId = function () {
9
+        return "uricomponentencode";
10
+    };
11
+    URIComponentEncoder.prototype.convert = function (input) {
12
+        return encodeURIComponent(input).replace(/[!'()*]/g, function (c) {
13
+            return '%' + c.charCodeAt(0).toString(16);
14
+        });
15
+    };
16
+    return URIComponentEncoder;
17
+}());
18
+exports.URIComponentEncoder = URIComponentEncoder;

+ 16
- 0
src/app/converter/uridecoder.js View File

@@ -0,0 +1,16 @@
1
+"use strict";
2
+var URIDecoder = (function () {
3
+    function URIDecoder() {
4
+    }
5
+    URIDecoder.prototype.getDisplayname = function () {
6
+        return "Decode URI";
7
+    };
8
+    URIDecoder.prototype.getId = function () {
9
+        return "uridecode";
10
+    };
11
+    URIDecoder.prototype.convert = function (input) {
12
+        return decodeURI(input);
13
+    };
14
+    return URIDecoder;
15
+}());
16
+exports.URIDecoder = URIDecoder;

+ 16
- 0
src/app/converter/uriencoder.js View File

@@ -0,0 +1,16 @@
1
+"use strict";
2
+var URIEncoder = (function () {
3
+    function URIEncoder() {
4
+    }
5
+    URIEncoder.prototype.getDisplayname = function () {
6
+        return "Encode URI";
7
+    };
8
+    URIEncoder.prototype.getId = function () {
9
+        return "uriencode";
10
+    };
11
+    URIEncoder.prototype.convert = function (input) {
12
+        return encodeURI(input).replace(/%5B/g, '[').replace(/%5D/g, ']');
13
+    };
14
+    return URIEncoder;
15
+}());
16
+exports.URIEncoder = URIEncoder;

+ 22
- 0
src/app/converter/utf8decoder.js View File

@@ -0,0 +1,22 @@
1
+"use strict";
2
+var UTF8Decoder = (function () {
3
+    function UTF8Decoder(nativeLibraryWrapperService) {
4
+        this.nativeLibraryWrapperService = nativeLibraryWrapperService;
5
+    }
6
+    UTF8Decoder.prototype.getDisplayname = function () {
7
+        return "Decode UTF-8";
8
+    };
9
+    UTF8Decoder.prototype.getId = function () {
10
+        return "decodeutf8";
11
+    };
12
+    UTF8Decoder.prototype.convert = function (input) {
13
+        try {
14
+            return this.nativeLibraryWrapperService.utf8.decode(input);
15
+        }
16
+        catch (error) {
17
+            throw new Error("The input can not be interpreted a valid UTF-8 encoded string. May be corrupt?");
18
+        }
19
+    };
20
+    return UTF8Decoder;
21
+}());
22
+exports.UTF8Decoder = UTF8Decoder;

+ 22
- 0
src/app/converter/utf8encoder.js View File

@@ -0,0 +1,22 @@
1
+"use strict";
2
+var UTF8Encoder = (function () {
3
+    function UTF8Encoder(nativeLibraryWrapperService) {
4
+        this.nativeLibraryWrapperService = nativeLibraryWrapperService;
5
+    }
6
+    UTF8Encoder.prototype.getDisplayname = function () {
7
+        return "Encode UTF-8";
8
+    };
9
+    UTF8Encoder.prototype.getId = function () {
10
+        return "encodeutf8";
11
+    };
12
+    UTF8Encoder.prototype.convert = function (input) {
13
+        try {
14
+            return this.nativeLibraryWrapperService.utf8.encode(input);
15
+        }
16
+        catch (error) {
17
+            throw new Error("The input can not be encoded as UTF-8. May be corrupt?");
18
+        }
19
+    };
20
+    return UTF8Encoder;
21
+}());
22
+exports.UTF8Encoder = UTF8Encoder;

+ 77
- 0
src/app/converterregistry.service.js View File

@@ -0,0 +1,77 @@
1
+"use strict";
2
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+};
8
+var core_1 = require("@angular/core");
9
+var base64encoder_1 = require("./converter/base64encoder");
10
+var base64decoder_1 = require("./converter/base64decoder");
11
+var uriencoder_1 = require("./converter/uriencoder");
12
+var uridecoder_1 = require("./converter/uridecoder");
13
+var uricomponentencoder_1 = require("./converter/uricomponentencoder");
14
+var uricomponentdecoder_1 = require("./converter/uricomponentdecoder");
15
+var htmlentitiesencoder_1 = require("./converter/htmlentitiesencoder");
16
+var htmlentitiesdecoder_1 = require("./converter/htmlentitiesdecoder");
17
+var dectohexconverter_1 = require("./converter/dectohexconverter");
18
+var hextodecconverter_1 = require("./converter/hextodecconverter");
19
+var dectobinconverter_1 = require("./converter/dectobinconverter");
20
+var bintodecconverter_1 = require("./converter/bintodecconverter");
21
+var quotedprintabledecoder_1 = require("./converter/quotedprintabledecoder");
22
+var quotedprintableencoder_1 = require("./converter/quotedprintableencoder");
23
+var punycodeencoder_1 = require("./converter/punycodeencoder");
24
+var punycodedecoder_1 = require("./converter/punycodedecoder");
25
+var utf8encoder_1 = require("./converter/utf8encoder");
26
+var utf8decoder_1 = require("./converter/utf8decoder");
27
+var ConverterRegistryService = (function () {
28
+    function ConverterRegistryService(wrapper) {
29
+        this.wrapper = wrapper;
30
+        this.converters = [];
31
+        this.init();
32
+    }
33
+    ConverterRegistryService.prototype.getAllConverters = function () {
34
+        return this.converters;
35
+    };
36
+    ConverterRegistryService.prototype.getConverter = function (id) {
37
+        for (var i = 0; i < this.converters.length; i++) {
38
+            if (this.converters[i].getId() == id) {
39
+                return this.converters[i];
40
+            }
41
+        }
42
+        return undefined;
43
+    };
44
+    ConverterRegistryService.prototype.init = function () {
45
+        this.registerConverter(new base64encoder_1.Base64Encoder());
46
+        this.registerConverter(new base64decoder_1.Base64Decoder());
47
+        this.registerConverter(new uriencoder_1.URIEncoder());
48
+        this.registerConverter(new uridecoder_1.URIDecoder());
49
+        this.registerConverter(new uricomponentencoder_1.URIComponentEncoder());
50
+        this.registerConverter(new uricomponentdecoder_1.URIComponentDecoder());
51
+        this.registerConverter(new htmlentitiesencoder_1.HTMLEntitiesEncoder());
52
+        this.registerConverter(new htmlentitiesdecoder_1.HTMLEntitiesDecoder());
53
+        this.registerConverter(new quotedprintableencoder_1.QuotedPrintableEncoder(this.wrapper));
54
+        this.registerConverter(new quotedprintabledecoder_1.QuotedPrintableDecoder(this.wrapper));
55
+        this.registerConverter(new dectohexconverter_1.DecToHexConverter());
56
+        this.registerConverter(new hextodecconverter_1.HexToDecConverter());
57
+        this.registerConverter(new dectobinconverter_1.DecToBinConverter());
58
+        this.registerConverter(new bintodecconverter_1.BinToDecConverter());
59
+        this.registerConverter(new punycodeencoder_1.PunycodeEncoder(this.wrapper));
60
+        this.registerConverter(new punycodedecoder_1.PunycodeDecoder(this.wrapper));
61
+        this.registerConverter(new utf8encoder_1.UTF8Encoder(this.wrapper));
62
+        this.registerConverter(new utf8decoder_1.UTF8Decoder(this.wrapper));
63
+    };
64
+    ConverterRegistryService.prototype.registerConverter = function (converter) {
65
+        this.converters.forEach(function (c) {
66
+            if (c.getId() == converter.getId()) {
67
+                throw new Error("Converter-ID " + converter.getId() + " is already registered!");
68
+            }
69
+        });
70
+        this.converters.push(converter);
71
+    };
72
+    ConverterRegistryService = __decorate([
73
+        core_1.Injectable()
74
+    ], ConverterRegistryService);
75
+    return ConverterRegistryService;
76
+}());
77
+exports.ConverterRegistryService = ConverterRegistryService;

+ 41
- 0
src/app/inputcomponentmanager.service.js View File

@@ -0,0 +1,41 @@
1
+"use strict";
2
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+};
8
+var core_1 = require("@angular/core");
9
+var step_1 = require("./step");
10
+var InputComponentManagerService = (function () {
11
+    function InputComponentManagerService() {
12
+        this.components = [];
13
+    }
14
+    InputComponentManagerService.prototype.register = function (component) {
15
+        this.components.push(component);
16
+    };
17
+    InputComponentManagerService.prototype.getAllComponents = function () {
18
+        return this.components;
19
+    };
20
+    InputComponentManagerService.prototype.getNext = function (component) {
21
+        var index = component.index;
22
+        if (index == this.components.length - 1) {
23
+            this.addComponent();
24
+        }
25
+        return this.components[index + 1];
26
+    };
27
+    InputComponentManagerService.prototype.getFirst = function () {
28
+        if (this.components.length == 0) {
29
+            this.addComponent();
30
+        }
31
+        return this.components[0];
32
+    };
33
+    InputComponentManagerService.prototype.addComponent = function () {
34
+        this.register(new step_1.Step(this.components.length));
35
+    };
36
+    InputComponentManagerService = __decorate([
37
+        core_1.Injectable()
38
+    ], InputComponentManagerService);
39
+    return InputComponentManagerService;
40
+}());
41
+exports.InputComponentManagerService = InputComponentManagerService;

+ 23
- 0
src/app/nativelibrarywrapper.service.js View File

@@ -0,0 +1,23 @@
1
+"use strict";
2
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+    return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+};
8
+var core_1 = require("@angular/core");
9
+var NativeUtf8 = require("utf8");
10
+var NativeQuotedPrintable = require("quoted-printable");
11
+var NativePunycode = require("punycode");
12
+var NativeLibraryWrapperService = (function () {
13
+    function NativeLibraryWrapperService() {
14
+        this.utf8 = NativeUtf8;
15
+        this.quotedPrintable = NativeQuotedPrintable;
16
+        this.punycode = NativePunycode;
17
+    }
18
+    NativeLibraryWrapperService = __decorate([
19
+        core_1.Injectable()
20
+    ], NativeLibraryWrapperService);
21
+    return NativeLibraryWrapperService;
22
+}());
23
+exports.NativeLibraryWrapperService = NativeLibraryWrapperService;

+ 11
- 8
src/app/nativelibrarywrapper.service.ts View File

@@ -2,16 +2,19 @@ import {Injectable} from "@angular/core";
2 2
 import {Punycode} from "./punycode";
3 3
 import {Utf8} from "./utf8";
4 4
 import {QuotedPrintable} from "./quotedprintable";
5
+import * as NativeUtf8 from "utf8";
6
+import * as NativeQuotedPrintable from "quoted-printable";
7
+import * as NativePunycode from "punycode";
5 8
 
6 9
 @Injectable()
7 10
 export class NativeLibraryWrapperService {
8
-    public utf8:Utf8;
9
-    public quotedPrintable:QuotedPrintable;
10
-    public punycode:Punycode;
11
+  public utf8: Utf8;
12
+  public quotedPrintable: QuotedPrintable;
13
+  public punycode: Punycode;
11 14
 
12
-    constructor() {
13
-        this.utf8 = require("utf8");
14
-        this.quotedPrintable = require("quoted-printable");
15
-        this.punycode = require("punycode");
16
-    }
15
+  constructor() {
16
+    this.utf8 = NativeUtf8;
17
+    this.quotedPrintable = NativeQuotedPrintable;
18
+    this.punycode = NativePunycode;
19
+  }
17 20
 }

+ 1
- 0
src/app/punycode.js View File

@@ -0,0 +1 @@
1
+"use strict";

+ 1
- 0
src/app/quotedprintable.js View File

@@ -0,0 +1 @@
1
+"use strict";

+ 12
- 0
src/app/step.js View File

@@ -0,0 +1,12 @@
1
+"use strict";
2
+var Step = (function () {
3
+    function Step(index) {
4
+        this.content = "";
5
+        this.selectedConverter = undefined;
6
+        this.error = false;
7
+        this.message = "";
8
+        this.index = index;
9
+    }
10
+    return Step;
11
+}());
12
+exports.Step = Step;

+ 1
- 0
src/app/utf8.js View File

@@ -0,0 +1 @@
1
+"use strict";

+ 0
- 0
src/assets/.gitkeep View File


+ 0
- 37
src/assets/css/style.css View File

@@ -1,37 +0,0 @@
1
-@font-face {
2
-    font-family: "ABeeZee";
3
-    font-stretch: normal;
4
-    font-style: normal;
5
-    font-variant: normal;
6
-    font-weight: normal;
7
-    src: local("ABeeZee Regular"),
8
-    local("ABeeZee-Regular"),
9
-    local("ABeeZee"),
10
-    url("../fonts/abeezee-regular.woff") format("woff");
11
-}
12
-
13
-@font-face {
14
-    font-family: "Free Monospaced";
15
-    src: url("../fonts/freemono.eot?") format("eot"),
16
-    url("../fonts/freemono.woff") format("woff"),
17
-    url("../fonts/freemono.ttf") format("truetype"),
18
-    url("../fonts/freemono.svg#FreeMono") format("svg");
19
-    font-weight: normal;
20
-    font-style: normal;
21
-}
22
-
23
-body {
24
-    background-color: white;
25
-    color: black;
26
-    font-family: "ABeeZee", sans-serif;
27
-    margin: 0;
28
-    padding: 1em 0 0 0;
29
-}
30
-
31
-h1 {
32
-    text-align: center;
33
-}
34
-
35
-.apploader {
36
-    text-align: center;
37
-}

+ 8
- 0
src/environments/environment.js View File

@@ -0,0 +1,8 @@
1
+// The file contents for the current environment will overwrite these during build.
2
+// The build system defaults to the dev environment which uses `environment.ts`, but if you do
3
+// `ng build --env=prod` then `environment.prod.ts` will be used instead.
4
+// The list of which env maps to which file can be found in `.angular-cli.json`.
5
+"use strict";
6
+exports.environment = {
7
+    production: false
8
+};

+ 4
- 0
src/environments/environment.prod.js View File

@@ -0,0 +1,4 @@
1
+"use strict";
2
+exports.environment = {
3
+    production: true
4
+};

+ 3
- 0
src/environments/environment.prod.ts View File

@@ -0,0 +1,3 @@
1
+export const environment = {
2
+  production: true
3
+};

+ 8
- 0
src/environments/environment.ts View File

@@ -0,0 +1,8 @@
1
+// The file contents for the current environment will overwrite these during build.
2
+// The build system defaults to the dev environment which uses `environment.ts`, but if you do
3
+// `ng build --env=prod` then `environment.prod.ts` will be used instead.
4
+// The list of which env maps to which file can be found in `.angular-cli.json`.
5
+
6
+export const environment = {
7
+  production: false
8
+};

BIN
src/favicon.ico View File


+ 12
- 9
src/index.html View File

@@ -1,18 +1,21 @@
1
-<!DOCTYPE html>
1
+<!doctype html>
2 2
 <html>
3 3
 <head>
4
-    <meta charset="UTF-8"/>
5
-    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
6
-    <title>conv.friedli.info - Convert whatever you want!</title>
4
+  <meta charset="utf-8">
5
+  <title>conv.friedli.info - Convert whatever you want!</title>
6
+  <base href="/">
7
+
8
+  <meta name="viewport" content="width=device-width, initial-scale=1">
9
+  <link rel="icon" type="image/x-icon" href="favicon.ico">
7 10
 </head>
8 11
 <body>
9 12
 <h1>Convert it all</h1>
10 13
 <noscript>This webpage lets you convert data and text to and from various formats. But
11
-    it requires you to <strong>enable Javascript</strong> to do so. So please turn it on in your
12
-    Browser. You won't regret it!
14
+  it requires you to <strong>enable Javascript</strong> to do so. So please turn it on in your
15
+  Browser. You won't regret it!
13 16
 </noscript>
14
-<den-app>
15
-    <div class="apploader">Please hold on, we're starting the turbines ...</div>
16
-</den-app>
17
+<app-root>
18
+  <div class="apploader">Please hold on, we're starting the turbines ...</div>
19
+</app-root>
17 20
 </body>
18 21
 </html>

+ 9
- 0
src/main.js View File

@@ -0,0 +1,9 @@
1
+"use strict";
2
+var core_1 = require('@angular/core');
3
+var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic');
4
+var app_module_1 = require('./app/app.module');
5
+var environment_1 = require('./environments/environment');
6
+if (environment_1.environment.production) {
7
+    core_1.enableProdMode();
8
+}
9
+platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule);

+ 7
- 5
src/main.ts View File

@@ -1,9 +1,11 @@
1
-import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
2
-import {AppModule} from "./app/app.module";
3
-import {enableProdMode} from "@angular/core";
1
+import { enableProdMode } from '@angular/core';
2
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
4 3
 
5
-if (process.env.NODE_ENV === "production") {
6
-    enableProdMode();
4
+import { AppModule } from './app/app.module';
5
+import { environment } from './environments/environment';
6
+
7
+if (environment.production) {
8
+  enableProdMode();
7 9
 }
8 10
 
9 11
 platformBrowserDynamic().bootstrapModule(AppModule);

+ 54
- 0
src/polyfills.js View File

@@ -0,0 +1,54 @@
1
+/**
2
+ * This file includes polyfills needed by Angular and is loaded before the app.
3
+ * You can add your own extra polyfills to this file.
4
+ *
5
+ * This file is divided into 2 sections:
6
+ *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7
+ *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
8
+ *      file.
9
+ *
10
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13
+ *
14
+ * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15
+ */
16
+"use strict";
17
+/***************************************************************************************************
18
+ * BROWSER POLYFILLS
19
+ */
20
+/** IE9, IE10 and IE11 requires all of the following polyfills. **/
21
+// import 'core-js/es6/symbol';
22
+// import 'core-js/es6/object';
23
+// import 'core-js/es6/function';
24
+// import 'core-js/es6/parse-int';
25
+// import 'core-js/es6/parse-float';
26
+// import 'core-js/es6/number';
27
+// import 'core-js/es6/math';
28
+// import 'core-js/es6/string';
29
+// import 'core-js/es6/date';
30
+// import 'core-js/es6/array';
31
+// import 'core-js/es6/regexp';
32
+// import 'core-js/es6/map';
33
+// import 'core-js/es6/set';
34
+/** IE10 and IE11 requires the following for NgClass support on SVG elements */
35
+// import 'classlist.js';  // Run `npm install --save classlist.js`.
36
+/** IE10 and IE11 requires the following to support `@angular/animation`. */
37
+// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
38
+/** Evergreen browsers require these. **/
39
+require('core-js/es6/reflect');
40
+require('core-js/es7/reflect');
41
+/** ALL Firefox browsers require the following to support `@angular/animation`. **/
42
+// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
43
+/***************************************************************************************************
44
+ * Zone JS is required by Angular itself.
45
+ */
46
+require('zone.js/dist/zone'); // Included with Angular CLI.
47
+/***************************************************************************************************
48
+ * APPLICATION IMPORTS
49
+ */
50
+/**
51
+ * Date, currency, decimal and percent pipes.
52
+ * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
53
+ */
54
+// import 'intl';  // Run `npm install --save intl`.

+ 68
- 11
src/polyfills.ts View File

@@ -1,11 +1,68 @@
1
-import "core-js/es6";
2
-import "core-js/es7/reflect";
3
-require("zone.js/dist/zone");
4
-
5
-if (process.env.ENV === 'production') {
6
-    // Production
7
-} else {
8
-    // Development and test
9
-    Error['stackTraceLimit'] = Infinity;
10
-    require('zone.js/dist/long-stack-trace-zone');
11
-}
1
+/**
2
+ * This file includes polyfills needed by Angular and is loaded before the app.
3
+ * You can add your own extra polyfills to this file.
4
+ *
5
+ * This file is divided into 2 sections:
6
+ *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7
+ *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
8
+ *      file.
9
+ *
10
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13
+ *
14
+ * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15
+ */
16
+
17
+/***************************************************************************************************
18
+ * BROWSER POLYFILLS
19
+ */
20
+
21
+/** IE9, IE10 and IE11 requires all of the following polyfills. **/
22
+// import 'core-js/es6/symbol';
23
+// import 'core-js/es6/object';
24
+// import 'core-js/es6/function';
25
+// import 'core-js/es6/parse-int';
26
+// import 'core-js/es6/parse-float';
27
+// import 'core-js/es6/number';
28
+// import 'core-js/es6/math';
29
+// import 'core-js/es6/string';
30
+// import 'core-js/es6/date';
31
+// import 'core-js/es6/array';
32
+// import 'core-js/es6/regexp';
33
+// import 'core-js/es6/map';
34
+// import 'core-js/es6/set';
35
+
36
+/** IE10 and IE11 requires the following for NgClass support on SVG elements */
37
+// import 'classlist.js';  // Run `npm install --save classlist.js`.
38
+
39
+/** IE10 and IE11 requires the following to support `@angular/animation`. */
40
+// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
41
+
42
+
43
+/** Evergreen browsers require these. **/
44
+import 'core-js/es6/reflect';
45
+import 'core-js/es7/reflect';
46
+
47
+
48
+/** ALL Firefox browsers require the following to support `@angular/animation`. **/
49
+// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
50
+
51
+
52
+
53
+/***************************************************************************************************
54
+ * Zone JS is required by Angular itself.
55
+ */
56
+import 'zone.js/dist/zone';  // Included with Angular CLI.
57
+
58
+
59
+
60
+/***************************************************************************************************
61
+ * APPLICATION IMPORTS
62
+ */
63
+
64
+/**
65
+ * Date, currency, decimal and percent pipes.
66
+ * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
67
+ */
68
+// import 'intl';  // Run `npm install --save intl`.

+ 38
- 0
src/styles.scss View File

@@ -0,0 +1,38 @@
1
+/* You can add global styles to this file, and also import other style files */
2
+@font-face {
3
+  font-family: "ABeeZee";
4
+  font-stretch: normal;
5
+  font-style: normal;
6
+  font-variant: normal;
7
+  font-weight: normal;
8
+  src: local("ABeeZee Regular"),
9
+  local("ABeeZee-Regular"),
10
+  local("ABeeZee"),
11
+  url("assets/fonts/abeezee-regular.woff") format("woff");
12
+}
13
+
14
+@font-face {
15
+  font-family: "Free Monospaced";
16
+  src: url("assets/fonts/freemono.eot?") format("eot"),
17
+  url("assets/fonts/freemono.woff") format("woff"),
18
+  url("assets/fonts/freemono.ttf") format("truetype"),
19
+  url("assets/fonts/freemono.svg#FreeMono") format("svg");
20
+  font-weight: normal;
21
+  font-style: normal;
22
+}
23
+
24
+body {
25
+  background-color: white;
26
+  color: black;
27
+  font-family: "ABeeZee", sans-serif;
28
+  margin: 0;
29
+  padding: 1em 0 0 0;
30
+}
31
+
32
+h1 {
33
+  text-align: center;
34
+}
35
+
36
+.apploader {
37
+  text-align: center;
38
+}

+ 20
- 0
src/test.js View File

@@ -0,0 +1,20 @@
1
+// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
+"use strict";
3
+require('zone.js/dist/long-stack-trace-zone');
4
+require('zone.js/dist/proxy.js');
5
+require('zone.js/dist/sync-test');
6
+require('zone.js/dist/jasmine-patch');
7
+require('zone.js/dist/async-test');
8
+require('zone.js/dist/fake-async-test');
9
+var testing_1 = require('@angular/core/testing');
10
+var testing_2 = require('@angular/platform-browser-dynamic/testing');
11
+// Prevent Karma from running prematurely.
12
+__karma__.loaded = function () { };
13
+// First, initialize the Angular testing environment.
14
+testing_1.getTestBed().initTestEnvironment(testing_2.BrowserDynamicTestingModule, testing_2.platformBrowserDynamicTesting());
15
+// Then we find all the tests.
16
+var context = require.context('./', true, /\.spec\.ts$/);
17
+// And load the modules.
18
+context.keys().map(context);
19
+// Finally, start Karma to run the tests.
20
+__karma__.start();

+ 32
- 0
src/test.ts View File

@@ -0,0 +1,32 @@
1
+// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
+
3
+import 'zone.js/dist/long-stack-trace-zone';
4
+import 'zone.js/dist/proxy.js';
5
+import 'zone.js/dist/sync-test';
6
+import 'zone.js/dist/jasmine-patch';
7
+import 'zone.js/dist/async-test';
8
+import 'zone.js/dist/fake-async-test';
9
+import { getTestBed } from '@angular/core/testing';
10
+import {
11
+  BrowserDynamicTestingModule,
12
+  platformBrowserDynamicTesting
13
+} from '@angular/platform-browser-dynamic/testing';
14
+
15
+// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
16
+declare var __karma__: any;
17
+declare var require: any;
18
+
19
+// Prevent Karma from running prematurely.
20
+__karma__.loaded = function () {};
21
+
22
+// First, initialize the Angular testing environment.
23
+getTestBed().initTestEnvironment(
24
+  BrowserDynamicTestingModule,
25
+  platformBrowserDynamicTesting()
26
+);
27
+// Then we find all the tests.
28
+const context = require.context('./', true, /\.spec\.ts$/);
29
+// And load the modules.
30
+context.keys().map(context);
31
+// Finally, start Karma to run the tests.
32
+__karma__.start();

+ 13
- 0
src/tsconfig.app.json View File

@@ -0,0 +1,13 @@
1
+{
2
+  "extends": "../tsconfig.json",
3
+  "compilerOptions": {
4
+    "outDir": "../out-tsc/app",
5
+    "module": "es2015",
6
+    "baseUrl": "",
7
+    "types": []
8
+  },
9
+  "exclude": [
10
+    "test.ts",
11
+    "**/*.spec.ts"
12
+  ]
13
+}

+ 20
- 0
src/tsconfig.spec.json View File

@@ -0,0 +1,20 @@
1
+{
2
+  "extends": "../tsconfig.json",
3
+  "compilerOptions": {
4
+    "outDir": "../out-tsc/spec",
5
+    "module": "commonjs",
6
+    "target": "es5",
7
+    "baseUrl": "",
8
+    "types": [
9
+      "jasmine",
10
+      "node"
11
+    ]
12
+  },
13
+  "files": [
14
+    "test.ts"
15
+  ],
16
+  "include": [
17
+    "**/*.spec.ts",
18
+    "**/*.d.ts"
19
+  ]
20
+}

+ 5
- 0
src/typings.d.ts View File

@@ -0,0 +1,5 @@
1
+/* SystemJS module definition */
2
+declare var module: NodeModule;
3
+interface NodeModule {
4
+  id: string;
5
+}

+ 0
- 5
src/vendor.ts View File

@@ -1,5 +0,0 @@
1
-import "@angular/core";
2
-import "@angular/platform-browser";
3
-import "@angular/platform-browser-dynamic";
4
-import "@angular/forms";
5
-import "rxjs";

src/tsconfig.json → tsconfig.json View File

@@ -1,20 +1,20 @@
1 1
 {
2
+  "compileOnSave": false,
2 3
   "compilerOptions": {
3
-    "alwaysStrict": true,
4
-    "target": "es5",
5
-    "module": "commonjs",
6
-    "moduleResolution": "node",
4
+    "outDir": "./dist/out-tsc",
5
+    "baseUrl": "src",
7 6
     "sourceMap": true,
7
+    "declaration": false,
8
+    "moduleResolution": "node",
8 9
     "emitDecoratorMetadata": true,
9 10
     "experimentalDecorators": true,
11
+    "target": "es5",
12
+    "typeRoots": [
13
+      "node_modules/@types"
14
+    ],
10 15
     "lib": [
11
-      "es2015",
16
+      "es2016",
12 17
       "dom"
13
-    ],
14
-    "noImplicitAny": true,
15
-    "suppressImplicitAnyIndexErrors": true,
16
-    "typeRoots": [
17
-      "../node_modules/@types/"
18 18
     ]
19 19
   }
20 20
 }

+ 116
- 0
tslint.json View File

@@ -0,0 +1,116 @@
1
+{
2
+  "rulesDirectory": [
3
+    "node_modules/codelyzer"
4
+  ],
5
+  "rules": {
6
+    "callable-types": true,
7
+    "class-name": true,
8
+    "comment-format": [
9
+      true,
10
+      "check-space"
11
+    ],
12
+    "curly": true,
13
+    "eofline": true,
14
+    "forin": true,
15
+    "import-blacklist": [true, "rxjs"],
16
+    "import-spacing": true,
17
+    "indent": [
18
+      true,
19
+      "spaces"
20
+    ],
21
+    "interface-over-type-literal": true,
22
+    "label-position": true,
23
+    "max-line-length": [
24
+      true,
25
+      140
26
+    ],
27
+    "member-access": false,
28
+    "member-ordering": [
29
+      true,
30
+      "static-before-instance",
31
+      "variables-before-functions"
32
+    ],
33
+    "no-arg": true,
34
+    "no-bitwise": true,
35
+    "no-console": [
36
+      true,
37
+      "debug",
38
+      "info",
39
+      "time",
40
+      "timeEnd",
41
+      "trace"
42
+    ],
43
+    "no-construct": true,
44
+    "no-debugger": true,
45
+    "no-duplicate-variable": true,
46
+    "no-empty": false,
47
+    "no-empty-interface": true,
48
+    "no-eval": true,
49
+    "no-inferrable-types": [true, "ignore-params"],
50
+    "no-shadowed-variable": true,
51
+    "no-string-literal": false,
52
+    "no-string-throw": true,
53
+    "no-switch-case-fall-through": true,
54
+    "no-trailing-whitespace": true,
55
+    "no-unused-expression": true,
56
+    "no-use-before-declare": true,
57
+    "no-var-keyword": true,
58
+    "object-literal-sort-keys": false,
59
+    "one-line": [
60
+      true,
61
+      "check-open-brace",
62
+      "check-catch",
63
+      "check-else",
64
+      "check-whitespace"
65
+    ],
66
+    "prefer-const": true,
67
+    "quotemark": [
68
+      true,
69
+      "single"
70
+    ],
71
+    "radix": true,
72
+    "semicolon": [
73
+      "always"
74
+    ],
75
+    "triple-equals": [
76
+      true,
77
+      "allow-null-check"
78
+    ],
79
+    "typedef-whitespace": [
80
+      true,
81
+      {
82
+        "call-signature": "nospace",
83
+        "index-signature": "nospace",
84
+        "parameter": "nospace",
85
+        "property-declaration": "nospace",
86