From 414c0588f7ca36bb73fc55d91b1c5085ab241918 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 15 Apr 2017 14:47:43 +0200 Subject: [PATCH] Various updates --- .angular-cli.json | 2 +- .gitignore | 1 + README.md | 8 +-- e2e/app.e2e-spec.ts | 8 +-- e2e/app.po.ts | 2 +- src/app/app-routing.module.js | 27 -------- src/app/app.component.js | 65 ----------------- src/app/app.component.spec.js | 21 ------ src/app/app.module.js | 34 --------- src/app/converter/base64decoder.js | 21 ------ src/app/converter/base64encoder.js | 22 ------ src/app/converter/bintodecconverter.js | 20 ------ src/app/converter/converter.js | 1 - src/app/converter/dectobinconverter.js | 20 ------ src/app/converter/dectohexconverter.js | 20 ------ src/app/converter/hextodecconverter.js | 20 ------ src/app/converter/htmlentitiesdecoder.js | 20 ------ src/app/converter/htmlentitiesencoder.js | 20 ------ src/app/converter/punycodedecoder.js | 17 ----- src/app/converter/punycodeencoder.js | 17 ----- src/app/converter/quotedprintabledecoder.js | 22 ------ src/app/converter/quotedprintableencoder.js | 17 ----- src/app/converter/uricomponentdecoder.js | 16 ----- src/app/converter/uricomponentencoder.js | 18 ----- src/app/converter/uridecoder.js | 16 ----- src/app/converter/uriencoder.js | 16 ----- src/app/converter/utf8decoder.js | 22 ------ src/app/converter/utf8encoder.js | 22 ------ src/app/converterregistry.service.js | 77 --------------------- src/app/inputcomponentmanager.service.js | 41 ----------- src/app/nativelibrarywrapper.service.js | 23 ------ src/app/punycode.js | 1 - src/app/quotedprintable.js | 1 - src/app/step.js | 12 ---- src/app/utf8.js | 1 - src/environments/environment.js | 8 --- src/environments/environment.prod.js | 4 -- src/main.js | 9 --- src/polyfills.js | 54 --------------- src/test.js | 20 ------ 40 files changed, 11 insertions(+), 755 deletions(-) delete mode 100644 src/app/app-routing.module.js delete mode 100644 src/app/app.component.js delete mode 100644 src/app/app.component.spec.js delete mode 100644 src/app/app.module.js delete mode 100644 src/app/converter/base64decoder.js delete mode 100644 src/app/converter/base64encoder.js delete mode 100644 src/app/converter/bintodecconverter.js delete mode 100644 src/app/converter/converter.js delete mode 100644 src/app/converter/dectobinconverter.js delete mode 100644 src/app/converter/dectohexconverter.js delete mode 100644 src/app/converter/hextodecconverter.js delete mode 100644 src/app/converter/htmlentitiesdecoder.js delete mode 100644 src/app/converter/htmlentitiesencoder.js delete mode 100644 src/app/converter/punycodedecoder.js delete mode 100644 src/app/converter/punycodeencoder.js delete mode 100644 src/app/converter/quotedprintabledecoder.js delete mode 100644 src/app/converter/quotedprintableencoder.js delete mode 100644 src/app/converter/uricomponentdecoder.js delete mode 100644 src/app/converter/uricomponentencoder.js delete mode 100644 src/app/converter/uridecoder.js delete mode 100644 src/app/converter/uriencoder.js delete mode 100644 src/app/converter/utf8decoder.js delete mode 100644 src/app/converter/utf8encoder.js delete mode 100644 src/app/converterregistry.service.js delete mode 100644 src/app/inputcomponentmanager.service.js delete mode 100644 src/app/nativelibrarywrapper.service.js delete mode 100644 src/app/punycode.js delete mode 100644 src/app/quotedprintable.js delete mode 100644 src/app/step.js delete mode 100644 src/app/utf8.js delete mode 100644 src/environments/environment.js delete mode 100644 src/environments/environment.prod.js delete mode 100644 src/main.js delete mode 100644 src/polyfills.js delete mode 100644 src/test.js diff --git a/.angular-cli.json b/.angular-cli.json index f87b85b..4ba15b0 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -1,7 +1,7 @@ { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { - "name": "conv.friedli.info" + "name": "convertorizr" }, "apps": [ { diff --git a/.gitignore b/.gitignore index aa578ea..dd95ca2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /dist /tmp /out-tsc +/src/**/*.js # dependencies /node_modules diff --git a/README.md b/README.md index 2068ce9..2c01592 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -# conv.friedli.info - Convert whatever you want! +# convertorizr - Convert whatever you want! -This is a short introduction to the awesome converter hosted at [https://conv.friedli.info/]. +This is a short introduction to the awesome Convertorizr hosted at [https://conv.friedli.info/]. Deployment is automated with Gitlab CI. Usage is self-explanatory. What else do you need to know? -Contact the author at manuel-conv.friedli.info|at|fritteli.ch. +Contact the author at manuel-convertorizr|at|fritteli.ch. Cheers! -# AngularCliTestproject +# Technical stuff This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0. diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 51fa703..924c313 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -1,10 +1,10 @@ -import {ConvFriedliInfoPage} from "./app.po"; +import {ConvertorizrPage} from "./app.po"; -describe('conv.friedli.info App', () => { - let page: ConvFriedliInfoPage; +describe('convertorizr App', () => { + let page: ConvertorizrPage; beforeEach(() => { - page = new ConvFriedliInfoPage(); + page = new ConvertorizrPage(); }); it('should display message saying app works', () => { diff --git a/e2e/app.po.ts b/e2e/app.po.ts index e9f6929..f1eea5b 100644 --- a/e2e/app.po.ts +++ b/e2e/app.po.ts @@ -1,6 +1,6 @@ import {browser, by, element} from "protractor"; -export class ConvFriedliInfoPage { +export class ConvertorizrPage { navigateTo() { return browser.get('/'); } diff --git a/src/app/app-routing.module.js b/src/app/app-routing.module.js deleted file mode 100644 index 9262e57..0000000 --- a/src/app/app-routing.module.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - 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; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require('@angular/core'); -var router_1 = require('@angular/router'); -var routes = [ - { - path: '', - children: [] - } -]; -var AppRoutingModule = (function () { - function AppRoutingModule() { - } - AppRoutingModule = __decorate([ - core_1.NgModule({ - imports: [router_1.RouterModule.forRoot(routes)], - exports: [router_1.RouterModule] - }) - ], AppRoutingModule); - return AppRoutingModule; -}()); -exports.AppRoutingModule = AppRoutingModule; diff --git a/src/app/app.component.js b/src/app/app.component.js deleted file mode 100644 index 022ff57..0000000 --- a/src/app/app.component.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - 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; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require("@angular/core"); -var converterregistry_service_1 = require("./converterregistry.service"); -var inputcomponentmanager_service_1 = require("./inputcomponentmanager.service"); -var nativelibrarywrapper_service_1 = require("./nativelibrarywrapper.service"); -var AppComponent = (function () { - function AppComponent(converterRegistryService, inputComponentManagerService) { - this.converterRegistryService = converterRegistryService; - this.inputComponentManagerService = inputComponentManagerService; - this.steps = []; - this.converters = []; - } - AppComponent.prototype.convert = function (step, $event) { - step.selectedConverter = this.converterRegistryService.getConverter($event.target.selectedOptions[0].id); - this.update(step); - }; - AppComponent.prototype.update = function (step) { - var converter = step.selectedConverter; - if (converter !== undefined) { - var content = step.content; - var result = void 0; - try { - result = converter.convert(content); - } - catch (error) { - if (typeof console === "object" && typeof console.log === "function") { - console.log(error); - } - step.message = error.message; - step.error = true; - result = null; - } - if (result !== null) { - step.message = ""; - step.error = false; - if (result !== "") { - var nextComponent = this.inputComponentManagerService.getNext(step); - nextComponent.content = result; - this.update(nextComponent); - } - } - } - }; - AppComponent.prototype.ngOnInit = function () { - this.converters = this.converterRegistryService.getAllConverters(); - this.steps = this.inputComponentManagerService.getAllComponents(); - this.inputComponentManagerService.getFirst(); - }; - AppComponent = __decorate([ - core_1.Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'], - providers: [converterregistry_service_1.ConverterRegistryService, inputcomponentmanager_service_1.InputComponentManagerService, nativelibrarywrapper_service_1.NativeLibraryWrapperService] - }) - ], AppComponent); - return AppComponent; -}()); -exports.AppComponent = AppComponent; diff --git a/src/app/app.component.spec.js b/src/app/app.component.spec.js deleted file mode 100644 index 7c43d0a..0000000 --- a/src/app/app.component.spec.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -var testing_1 = require('@angular/core/testing'); -var testing_2 = require('@angular/router/testing'); -var app_component_1 = require('./app.component'); -describe('AppComponent', function () { - beforeEach(testing_1.async(function () { - testing_1.TestBed.configureTestingModule({ - imports: [ - testing_2.RouterTestingModule - ], - declarations: [ - app_component_1.AppComponent - ], - }).compileComponents(); - })); - it('should create the app', testing_1.async(function () { - var fixture = testing_1.TestBed.createComponent(app_component_1.AppComponent); - var app = fixture.debugElement.componentInstance; - expect(app).toBeTruthy(); - })); -}); diff --git a/src/app/app.module.js b/src/app/app.module.js deleted file mode 100644 index f4e916c..0000000 --- a/src/app/app.module.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - 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; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var platform_browser_1 = require('@angular/platform-browser'); -var core_1 = require('@angular/core'); -var forms_1 = require('@angular/forms'); -var http_1 = require('@angular/http'); -var app_routing_module_1 = require('./app-routing.module'); -var app_component_1 = require('./app.component'); -var AppModule = (function () { - function AppModule() { - } - AppModule = __decorate([ - core_1.NgModule({ - declarations: [ - app_component_1.AppComponent - ], - imports: [ - platform_browser_1.BrowserModule, - forms_1.FormsModule, - http_1.HttpModule, - app_routing_module_1.AppRoutingModule - ], - providers: [], - bootstrap: [app_component_1.AppComponent] - }) - ], AppModule); - return AppModule; -}()); -exports.AppModule = AppModule; diff --git a/src/app/converter/base64decoder.js b/src/app/converter/base64decoder.js deleted file mode 100644 index c3d4858..0000000 --- a/src/app/converter/base64decoder.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -var Base64Decoder = (function () { - function Base64Decoder() { - } - Base64Decoder.prototype.getDisplayname = function () { - return "Decode Base 64"; - }; - Base64Decoder.prototype.getId = function () { - return "base64decode"; - }; - Base64Decoder.prototype.convert = function (input) { - try { - return atob(input); - } - catch (exception) { - throw new Error("Could not decode base64 string. Maybe corrupt input?"); - } - }; - return Base64Decoder; -}()); -exports.Base64Decoder = Base64Decoder; diff --git a/src/app/converter/base64encoder.js b/src/app/converter/base64encoder.js deleted file mode 100644 index 6471395..0000000 --- a/src/app/converter/base64encoder.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -var Base64Encoder = (function () { - function Base64Encoder() { - } - Base64Encoder.prototype.getDisplayname = function () { - return "Encode Base 64"; - }; - Base64Encoder.prototype.getId = function () { - return "base64encode"; - }; - Base64Encoder.prototype.convert = function (input) { - try { - return btoa(input); - } - catch (exception) { - console.error(exception); - 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 enjoy some kittens meanwhile?"); - } - }; - return Base64Encoder; -}()); -exports.Base64Encoder = Base64Encoder; diff --git a/src/app/converter/bintodecconverter.js b/src/app/converter/bintodecconverter.js deleted file mode 100644 index f6273b0..0000000 --- a/src/app/converter/bintodecconverter.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -var BinToDecConverter = (function () { - function BinToDecConverter() { - } - BinToDecConverter.prototype.getDisplayname = function () { - return "Convert binary to decimal"; - }; - BinToDecConverter.prototype.getId = function () { - return "bintodec"; - }; - BinToDecConverter.prototype.convert = function (input) { - var n = parseInt(input, 2); - if (isNaN(n)) { - throw new Error("The input seems not to be a valid binary number."); - } - return n.toString(10); - }; - return BinToDecConverter; -}()); -exports.BinToDecConverter = BinToDecConverter; diff --git a/src/app/converter/converter.js b/src/app/converter/converter.js deleted file mode 100644 index 3918c74..0000000 --- a/src/app/converter/converter.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; diff --git a/src/app/converter/dectobinconverter.js b/src/app/converter/dectobinconverter.js deleted file mode 100644 index f34d9fe..0000000 --- a/src/app/converter/dectobinconverter.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -var DecToBinConverter = (function () { - function DecToBinConverter() { - } - DecToBinConverter.prototype.getDisplayname = function () { - return "Convert decimal to binary"; - }; - DecToBinConverter.prototype.getId = function () { - return "dectobin"; - }; - DecToBinConverter.prototype.convert = function (input) { - var n = parseInt(input, 10); - if (isNaN(n)) { - throw new Error("The input seems not to be a valid integer."); - } - return n.toString(2); - }; - return DecToBinConverter; -}()); -exports.DecToBinConverter = DecToBinConverter; diff --git a/src/app/converter/dectohexconverter.js b/src/app/converter/dectohexconverter.js deleted file mode 100644 index 7087894..0000000 --- a/src/app/converter/dectohexconverter.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -var DecToHexConverter = (function () { - function DecToHexConverter() { - } - DecToHexConverter.prototype.getDisplayname = function () { - return "Convert decimal to hexadecimal"; - }; - DecToHexConverter.prototype.getId = function () { - return "dectohex"; - }; - DecToHexConverter.prototype.convert = function (input) { - var n = parseInt(input, 10); - if (isNaN(n)) { - throw new Error("The input seems not to be a valid integer."); - } - return n.toString(16); - }; - return DecToHexConverter; -}()); -exports.DecToHexConverter = DecToHexConverter; diff --git a/src/app/converter/hextodecconverter.js b/src/app/converter/hextodecconverter.js deleted file mode 100644 index daa9c29..0000000 --- a/src/app/converter/hextodecconverter.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -var HexToDecConverter = (function () { - function HexToDecConverter() { - } - HexToDecConverter.prototype.getDisplayname = function () { - return "Convert hexadecimal to decimal"; - }; - HexToDecConverter.prototype.getId = function () { - return "hextodec"; - }; - HexToDecConverter.prototype.convert = function (input) { - var n = parseInt(input, 16); - if (isNaN(n)) { - throw new Error("The input seems not to be a valid hexadecimal number."); - } - return n.toString(10); - }; - return HexToDecConverter; -}()); -exports.HexToDecConverter = HexToDecConverter; diff --git a/src/app/converter/htmlentitiesdecoder.js b/src/app/converter/htmlentitiesdecoder.js deleted file mode 100644 index ee282af..0000000 --- a/src/app/converter/htmlentitiesdecoder.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -var HTMLEntitiesDecoder = (function () { - function HTMLEntitiesDecoder() { - } - HTMLEntitiesDecoder.prototype.getDisplayname = function () { - return "Decode HTML entities"; - }; - HTMLEntitiesDecoder.prototype.getId = function () { - return "decodehtmlentities"; - }; - HTMLEntitiesDecoder.prototype.convert = function (input) { - return input - .replace(/\"\;/g, "\"") - .replace(/\>\;/g, ">") - .replace(/\<\;/g, "<") - .replace(/\&\;/g, "&"); - }; - return HTMLEntitiesDecoder; -}()); -exports.HTMLEntitiesDecoder = HTMLEntitiesDecoder; diff --git a/src/app/converter/htmlentitiesencoder.js b/src/app/converter/htmlentitiesencoder.js deleted file mode 100644 index 8455fcd..0000000 --- a/src/app/converter/htmlentitiesencoder.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -var HTMLEntitiesEncoder = (function () { - function HTMLEntitiesEncoder() { - } - HTMLEntitiesEncoder.prototype.getDisplayname = function () { - return "Encode HTML entities"; - }; - HTMLEntitiesEncoder.prototype.getId = function () { - return "encodehtmlentities"; - }; - HTMLEntitiesEncoder.prototype.convert = function (input) { - return input - .replace(/\&/g, "&") - .replace(/\/g, ">") - .replace(/\"/g, """); - }; - return HTMLEntitiesEncoder; -}()); -exports.HTMLEntitiesEncoder = HTMLEntitiesEncoder; diff --git a/src/app/converter/punycodedecoder.js b/src/app/converter/punycodedecoder.js deleted file mode 100644 index 54c60c3..0000000 --- a/src/app/converter/punycodedecoder.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var PunycodeDecoder = (function () { - function PunycodeDecoder(nativeLibraryWrapperService) { - this.nativeLibraryWrapperService = nativeLibraryWrapperService; - } - PunycodeDecoder.prototype.getDisplayname = function () { - return "Decode from punycode"; - }; - PunycodeDecoder.prototype.getId = function () { - return "decodepunycode"; - }; - PunycodeDecoder.prototype.convert = function (input) { - return this.nativeLibraryWrapperService.punycode.decode(input); - }; - return PunycodeDecoder; -}()); -exports.PunycodeDecoder = PunycodeDecoder; diff --git a/src/app/converter/punycodeencoder.js b/src/app/converter/punycodeencoder.js deleted file mode 100644 index 65e8366..0000000 --- a/src/app/converter/punycodeencoder.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var PunycodeEncoder = (function () { - function PunycodeEncoder(nativeLibraryWrapperService) { - this.nativeLibraryWrapperService = nativeLibraryWrapperService; - } - PunycodeEncoder.prototype.getDisplayname = function () { - return "Encode as punycode"; - }; - PunycodeEncoder.prototype.getId = function () { - return "encodepunycode"; - }; - PunycodeEncoder.prototype.convert = function (input) { - return this.nativeLibraryWrapperService.punycode.encode(input); - }; - return PunycodeEncoder; -}()); -exports.PunycodeEncoder = PunycodeEncoder; diff --git a/src/app/converter/quotedprintabledecoder.js b/src/app/converter/quotedprintabledecoder.js deleted file mode 100644 index fc11bac..0000000 --- a/src/app/converter/quotedprintabledecoder.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -var QuotedPrintableDecoder = (function () { - function QuotedPrintableDecoder(nativeLibraryWrapperService) { - this.nativeLibraryWrapperService = nativeLibraryWrapperService; - } - QuotedPrintableDecoder.prototype.getDisplayname = function () { - return "Decode quoted printable"; - }; - QuotedPrintableDecoder.prototype.getId = function () { - return "decodequotedprintable"; - }; - QuotedPrintableDecoder.prototype.convert = function (input) { - try { - return this.nativeLibraryWrapperService.quotedPrintable.decode(input); - } - catch (error) { - throw new Error("The input can not be interpreted as quoted-printable. May be corrupt?"); - } - }; - return QuotedPrintableDecoder; -}()); -exports.QuotedPrintableDecoder = QuotedPrintableDecoder; diff --git a/src/app/converter/quotedprintableencoder.js b/src/app/converter/quotedprintableencoder.js deleted file mode 100644 index afa5dda..0000000 --- a/src/app/converter/quotedprintableencoder.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -var QuotedPrintableEncoder = (function () { - function QuotedPrintableEncoder(nativeLibraryWrapperService) { - this.nativeLibraryWrapperService = nativeLibraryWrapperService; - } - QuotedPrintableEncoder.prototype.getDisplayname = function () { - return "Encode quoted printable"; - }; - QuotedPrintableEncoder.prototype.getId = function () { - return "encodequotedprintable"; - }; - QuotedPrintableEncoder.prototype.convert = function (input) { - return this.nativeLibraryWrapperService.quotedPrintable.encode(input); - }; - return QuotedPrintableEncoder; -}()); -exports.QuotedPrintableEncoder = QuotedPrintableEncoder; diff --git a/src/app/converter/uricomponentdecoder.js b/src/app/converter/uricomponentdecoder.js deleted file mode 100644 index c90a2ae..0000000 --- a/src/app/converter/uricomponentdecoder.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var URIComponentDecoder = (function () { - function URIComponentDecoder() { - } - URIComponentDecoder.prototype.getDisplayname = function () { - return "Decode URI component"; - }; - URIComponentDecoder.prototype.getId = function () { - return "uricomponentdecode"; - }; - URIComponentDecoder.prototype.convert = function (input) { - return decodeURIComponent(input); - }; - return URIComponentDecoder; -}()); -exports.URIComponentDecoder = URIComponentDecoder; diff --git a/src/app/converter/uricomponentencoder.js b/src/app/converter/uricomponentencoder.js deleted file mode 100644 index c59b145..0000000 --- a/src/app/converter/uricomponentencoder.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -var URIComponentEncoder = (function () { - function URIComponentEncoder() { - } - URIComponentEncoder.prototype.getDisplayname = function () { - return "Encode URI component"; - }; - URIComponentEncoder.prototype.getId = function () { - return "uricomponentencode"; - }; - URIComponentEncoder.prototype.convert = function (input) { - return encodeURIComponent(input).replace(/[!'()*]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16); - }); - }; - return URIComponentEncoder; -}()); -exports.URIComponentEncoder = URIComponentEncoder; diff --git a/src/app/converter/uridecoder.js b/src/app/converter/uridecoder.js deleted file mode 100644 index 3272fbd..0000000 --- a/src/app/converter/uridecoder.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var URIDecoder = (function () { - function URIDecoder() { - } - URIDecoder.prototype.getDisplayname = function () { - return "Decode URI"; - }; - URIDecoder.prototype.getId = function () { - return "uridecode"; - }; - URIDecoder.prototype.convert = function (input) { - return decodeURI(input); - }; - return URIDecoder; -}()); -exports.URIDecoder = URIDecoder; diff --git a/src/app/converter/uriencoder.js b/src/app/converter/uriencoder.js deleted file mode 100644 index 34967e3..0000000 --- a/src/app/converter/uriencoder.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var URIEncoder = (function () { - function URIEncoder() { - } - URIEncoder.prototype.getDisplayname = function () { - return "Encode URI"; - }; - URIEncoder.prototype.getId = function () { - return "uriencode"; - }; - URIEncoder.prototype.convert = function (input) { - return encodeURI(input).replace(/%5B/g, '[').replace(/%5D/g, ']'); - }; - return URIEncoder; -}()); -exports.URIEncoder = URIEncoder; diff --git a/src/app/converter/utf8decoder.js b/src/app/converter/utf8decoder.js deleted file mode 100644 index e57b03c..0000000 --- a/src/app/converter/utf8decoder.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -var UTF8Decoder = (function () { - function UTF8Decoder(nativeLibraryWrapperService) { - this.nativeLibraryWrapperService = nativeLibraryWrapperService; - } - UTF8Decoder.prototype.getDisplayname = function () { - return "Decode UTF-8"; - }; - UTF8Decoder.prototype.getId = function () { - return "decodeutf8"; - }; - UTF8Decoder.prototype.convert = function (input) { - try { - return this.nativeLibraryWrapperService.utf8.decode(input); - } - catch (error) { - throw new Error("The input can not be interpreted a valid UTF-8 encoded string. May be corrupt?"); - } - }; - return UTF8Decoder; -}()); -exports.UTF8Decoder = UTF8Decoder; diff --git a/src/app/converter/utf8encoder.js b/src/app/converter/utf8encoder.js deleted file mode 100644 index 54e9965..0000000 --- a/src/app/converter/utf8encoder.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -var UTF8Encoder = (function () { - function UTF8Encoder(nativeLibraryWrapperService) { - this.nativeLibraryWrapperService = nativeLibraryWrapperService; - } - UTF8Encoder.prototype.getDisplayname = function () { - return "Encode UTF-8"; - }; - UTF8Encoder.prototype.getId = function () { - return "encodeutf8"; - }; - UTF8Encoder.prototype.convert = function (input) { - try { - return this.nativeLibraryWrapperService.utf8.encode(input); - } - catch (error) { - throw new Error("The input can not be encoded as UTF-8. May be corrupt?"); - } - }; - return UTF8Encoder; -}()); -exports.UTF8Encoder = UTF8Encoder; diff --git a/src/app/converterregistry.service.js b/src/app/converterregistry.service.js deleted file mode 100644 index aca6053..0000000 --- a/src/app/converterregistry.service.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - 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; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require("@angular/core"); -var base64encoder_1 = require("./converter/base64encoder"); -var base64decoder_1 = require("./converter/base64decoder"); -var uriencoder_1 = require("./converter/uriencoder"); -var uridecoder_1 = require("./converter/uridecoder"); -var uricomponentencoder_1 = require("./converter/uricomponentencoder"); -var uricomponentdecoder_1 = require("./converter/uricomponentdecoder"); -var htmlentitiesencoder_1 = require("./converter/htmlentitiesencoder"); -var htmlentitiesdecoder_1 = require("./converter/htmlentitiesdecoder"); -var dectohexconverter_1 = require("./converter/dectohexconverter"); -var hextodecconverter_1 = require("./converter/hextodecconverter"); -var dectobinconverter_1 = require("./converter/dectobinconverter"); -var bintodecconverter_1 = require("./converter/bintodecconverter"); -var quotedprintabledecoder_1 = require("./converter/quotedprintabledecoder"); -var quotedprintableencoder_1 = require("./converter/quotedprintableencoder"); -var punycodeencoder_1 = require("./converter/punycodeencoder"); -var punycodedecoder_1 = require("./converter/punycodedecoder"); -var utf8encoder_1 = require("./converter/utf8encoder"); -var utf8decoder_1 = require("./converter/utf8decoder"); -var ConverterRegistryService = (function () { - function ConverterRegistryService(wrapper) { - this.wrapper = wrapper; - this.converters = []; - this.init(); - } - ConverterRegistryService.prototype.getAllConverters = function () { - return this.converters; - }; - ConverterRegistryService.prototype.getConverter = function (id) { - for (var i = 0; i < this.converters.length; i++) { - if (this.converters[i].getId() == id) { - return this.converters[i]; - } - } - return undefined; - }; - ConverterRegistryService.prototype.init = function () { - this.registerConverter(new base64encoder_1.Base64Encoder()); - this.registerConverter(new base64decoder_1.Base64Decoder()); - this.registerConverter(new uriencoder_1.URIEncoder()); - this.registerConverter(new uridecoder_1.URIDecoder()); - this.registerConverter(new uricomponentencoder_1.URIComponentEncoder()); - this.registerConverter(new uricomponentdecoder_1.URIComponentDecoder()); - this.registerConverter(new htmlentitiesencoder_1.HTMLEntitiesEncoder()); - this.registerConverter(new htmlentitiesdecoder_1.HTMLEntitiesDecoder()); - this.registerConverter(new quotedprintableencoder_1.QuotedPrintableEncoder(this.wrapper)); - this.registerConverter(new quotedprintabledecoder_1.QuotedPrintableDecoder(this.wrapper)); - this.registerConverter(new dectohexconverter_1.DecToHexConverter()); - this.registerConverter(new hextodecconverter_1.HexToDecConverter()); - this.registerConverter(new dectobinconverter_1.DecToBinConverter()); - this.registerConverter(new bintodecconverter_1.BinToDecConverter()); - this.registerConverter(new punycodeencoder_1.PunycodeEncoder(this.wrapper)); - this.registerConverter(new punycodedecoder_1.PunycodeDecoder(this.wrapper)); - this.registerConverter(new utf8encoder_1.UTF8Encoder(this.wrapper)); - this.registerConverter(new utf8decoder_1.UTF8Decoder(this.wrapper)); - }; - ConverterRegistryService.prototype.registerConverter = function (converter) { - this.converters.forEach(function (c) { - if (c.getId() == converter.getId()) { - throw new Error("Converter-ID " + converter.getId() + " is already registered!"); - } - }); - this.converters.push(converter); - }; - ConverterRegistryService = __decorate([ - core_1.Injectable() - ], ConverterRegistryService); - return ConverterRegistryService; -}()); -exports.ConverterRegistryService = ConverterRegistryService; diff --git a/src/app/inputcomponentmanager.service.js b/src/app/inputcomponentmanager.service.js deleted file mode 100644 index 0b1443f..0000000 --- a/src/app/inputcomponentmanager.service.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - 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; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require("@angular/core"); -var step_1 = require("./step"); -var InputComponentManagerService = (function () { - function InputComponentManagerService() { - this.components = []; - } - InputComponentManagerService.prototype.register = function (component) { - this.components.push(component); - }; - InputComponentManagerService.prototype.getAllComponents = function () { - return this.components; - }; - InputComponentManagerService.prototype.getNext = function (component) { - var index = component.index; - if (index == this.components.length - 1) { - this.addComponent(); - } - return this.components[index + 1]; - }; - InputComponentManagerService.prototype.getFirst = function () { - if (this.components.length == 0) { - this.addComponent(); - } - return this.components[0]; - }; - InputComponentManagerService.prototype.addComponent = function () { - this.register(new step_1.Step(this.components.length)); - }; - InputComponentManagerService = __decorate([ - core_1.Injectable() - ], InputComponentManagerService); - return InputComponentManagerService; -}()); -exports.InputComponentManagerService = InputComponentManagerService; diff --git a/src/app/nativelibrarywrapper.service.js b/src/app/nativelibrarywrapper.service.js deleted file mode 100644 index a0647b6..0000000 --- a/src/app/nativelibrarywrapper.service.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - 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; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var core_1 = require("@angular/core"); -var NativeUtf8 = require("utf8"); -var NativeQuotedPrintable = require("quoted-printable"); -var NativePunycode = require("punycode"); -var NativeLibraryWrapperService = (function () { - function NativeLibraryWrapperService() { - this.utf8 = NativeUtf8; - this.quotedPrintable = NativeQuotedPrintable; - this.punycode = NativePunycode; - } - NativeLibraryWrapperService = __decorate([ - core_1.Injectable() - ], NativeLibraryWrapperService); - return NativeLibraryWrapperService; -}()); -exports.NativeLibraryWrapperService = NativeLibraryWrapperService; diff --git a/src/app/punycode.js b/src/app/punycode.js deleted file mode 100644 index 3918c74..0000000 --- a/src/app/punycode.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; diff --git a/src/app/quotedprintable.js b/src/app/quotedprintable.js deleted file mode 100644 index 3918c74..0000000 --- a/src/app/quotedprintable.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; diff --git a/src/app/step.js b/src/app/step.js deleted file mode 100644 index 400b403..0000000 --- a/src/app/step.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -var Step = (function () { - function Step(index) { - this.content = ""; - this.selectedConverter = undefined; - this.error = false; - this.message = ""; - this.index = index; - } - return Step; -}()); -exports.Step = Step; diff --git a/src/app/utf8.js b/src/app/utf8.js deleted file mode 100644 index 3918c74..0000000 --- a/src/app/utf8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; diff --git a/src/environments/environment.js b/src/environments/environment.js deleted file mode 100644 index c2c6f8a..0000000 --- a/src/environments/environment.js +++ /dev/null @@ -1,8 +0,0 @@ -// The file contents for the current environment will overwrite these during build. -// The build system defaults to the dev environment which uses `environment.ts`, but if you do -// `ng build --env=prod` then `environment.prod.ts` will be used instead. -// The list of which env maps to which file can be found in `.angular-cli.json`. -"use strict"; -exports.environment = { - production: false -}; diff --git a/src/environments/environment.prod.js b/src/environments/environment.prod.js deleted file mode 100644 index 228c1a1..0000000 --- a/src/environments/environment.prod.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -exports.environment = { - production: true -}; diff --git a/src/main.js b/src/main.js deleted file mode 100644 index 4bda7be..0000000 --- a/src/main.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -var core_1 = require('@angular/core'); -var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic'); -var app_module_1 = require('./app/app.module'); -var environment_1 = require('./environments/environment'); -if (environment_1.environment.production) { - core_1.enableProdMode(); -} -platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule); diff --git a/src/polyfills.js b/src/polyfills.js deleted file mode 100644 index 0b25668..0000000 --- a/src/polyfills.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ -"use strict"; -/*************************************************************************************************** - * BROWSER POLYFILLS - */ -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/set'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. -/** IE10 and IE11 requires the following to support `@angular/animation`. */ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. -/** Evergreen browsers require these. **/ -require('core-js/es6/reflect'); -require('core-js/es7/reflect'); -/** ALL Firefox browsers require the following to support `@angular/animation`. **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -require('zone.js/dist/zone'); // Included with Angular CLI. -/*************************************************************************************************** - * APPLICATION IMPORTS - */ -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. diff --git a/src/test.js b/src/test.js deleted file mode 100644 index 6ece824..0000000 --- a/src/test.js +++ /dev/null @@ -1,20 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files -"use strict"; -require('zone.js/dist/long-stack-trace-zone'); -require('zone.js/dist/proxy.js'); -require('zone.js/dist/sync-test'); -require('zone.js/dist/jasmine-patch'); -require('zone.js/dist/async-test'); -require('zone.js/dist/fake-async-test'); -var testing_1 = require('@angular/core/testing'); -var testing_2 = require('@angular/platform-browser-dynamic/testing'); -// Prevent Karma from running prematurely. -__karma__.loaded = function () { }; -// First, initialize the Angular testing environment. -testing_1.getTestBed().initTestEnvironment(testing_2.BrowserDynamicTestingModule, testing_2.platformBrowserDynamicTesting()); -// Then we find all the tests. -var context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); -// Finally, start Karma to run the tests. -__karma__.start();