diff --git a/config/webpack.prod.js b/config/webpack.prod.js new file mode 100644 index 0000000..eef3bf1 --- /dev/null +++ b/config/webpack.prod.js @@ -0,0 +1,38 @@ +var webpack = require('webpack'); +var webpackMerge = require('webpack-merge'); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var commonConfig = require('./webpack.common.js'); +var helpers = require('./helpers'); + +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + +module.exports = webpackMerge(commonConfig, { + devtool: 'source-map', + + output: { + path: helpers.root('dist'), + publicPath: '/', + filename: '[name].[hash].js', + chunkFilename: '[id].[hash].chunk.js' + }, + + plugins: [ + new webpack.NoEmitOnErrorsPlugin(), + new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618 + mangle: { + keep_fnames: true + } + }), + new ExtractTextPlugin('[name].[hash].css'), + new webpack.DefinePlugin({ + 'process.env': { + 'ENV': JSON.stringify(ENV) + } + }), + new webpack.LoaderOptionsPlugin({ + htmlLoader: { + minimize: false // workaround for ng2 + } + }) + ] +}); diff --git a/package.json b/package.json index a5cb45e..d63eb57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dencode.org", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "description": "Convert to and fro!", "keywords": [ "dencode", @@ -13,8 +13,11 @@ "email": "manuel@fritteli.ch" }, "license": "MIT", - "homepage": "https://test.friedli.info/~manuel/dencode", - "repository": "https://gittr.ch/manuel/dencode.org.git", + "homepage": "https://manuel.pages.gittr.ch/dencode.org", + "repository": { + "type": "git", + "url": "https://gittr.ch/manuel/dencode.org.git" + }, "dependencies": { "@angular/common": "~2.4.0", "@angular/compiler": "~2.4.0", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 97a015e..6755491 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -5,11 +5,12 @@ import {Converter} from "./converter/converter"; import {NativeLibraryWrapperService} from "./nativelibrarywrapper.service"; import {Step} from "./step"; +import "../assets/css/style.css"; + @Component({ - moduleId: module.id, selector: "den-app", - templateUrl: "app.component.html", - styleUrls: ["app.component.css"], + templateUrl: "./app.component.html", + styleUrls: ["./app.component.css"], providers: [ConverterRegistryService, InputComponentManagerService, NativeLibraryWrapperService] }) export class AppComponent extends OnInit { diff --git a/src/app/converter/punycodedecoder.ts b/src/app/converter/punycodedecoder.ts index e61a8b4..15fc909 100644 --- a/src/app/converter/punycodedecoder.ts +++ b/src/app/converter/punycodedecoder.ts @@ -15,6 +15,7 @@ export class PunycodeDecoder implements Converter { } convert(input: string): string { - return this.nativeLibraryWrapperService.punycode.decode(input); + // return this.nativeLibraryWrapperService.punycode.decode(input); + return ""; } } diff --git a/src/app/converter/punycodeencoder.ts b/src/app/converter/punycodeencoder.ts index 66345d6..202d822 100644 --- a/src/app/converter/punycodeencoder.ts +++ b/src/app/converter/punycodeencoder.ts @@ -15,6 +15,7 @@ export class PunycodeEncoder implements Converter { } convert(input: string): string { - return this.nativeLibraryWrapperService.punycode.encode(input); + // return this.nativeLibraryWrapperService.punycode.encode(input); + return ""; } } diff --git a/src/app/converter/quotedprintabledecoder.ts b/src/app/converter/quotedprintabledecoder.ts index d998038..bc1e857 100644 --- a/src/app/converter/quotedprintabledecoder.ts +++ b/src/app/converter/quotedprintabledecoder.ts @@ -14,10 +14,10 @@ export class QuotedPrintableDecoder implements Converter { } convert(input:string):string { - try { - return this.nativeLibraryWrapperService.utf8.decode(this.nativeLibraryWrapperService.quotedPrintable.decode(input)); - } catch (error) { + // try { + // return this.nativeLibraryWrapperService.utf8.decode(this.nativeLibraryWrapperService.quotedPrintable.decode(input)); + // } catch (error) { throw new Error("The input can not be interpreted as quoted-printable. May be corrupt?"); - } + // } } } diff --git a/src/app/converter/quotedprintableencoder.ts b/src/app/converter/quotedprintableencoder.ts index 048dbc6..c97c9d7 100644 --- a/src/app/converter/quotedprintableencoder.ts +++ b/src/app/converter/quotedprintableencoder.ts @@ -14,6 +14,7 @@ export class QuotedPrintableEncoder implements Converter { } convert(input:string):string { - return this.nativeLibraryWrapperService.quotedPrintable.encode(this.nativeLibraryWrapperService.utf8.encode(input)); + // return this.nativeLibraryWrapperService.quotedPrintable.encode(this.nativeLibraryWrapperService.utf8.encode(input)); + return ""; } } diff --git a/src/app/converterregistry.service.ts b/src/app/converterregistry.service.ts index af6e30b..1fea66c 100644 --- a/src/app/converterregistry.service.ts +++ b/src/app/converterregistry.service.ts @@ -12,11 +12,11 @@ import {DecToHexConverter} from "./converter/dectohexconverter"; import {HexToDecConverter} from "./converter/hextodecconverter"; import {DecToBinConverter} from "./converter/dectobinconverter"; import {BinToDecConverter} from "./converter/bintodecconverter"; -import {QuotedPrintableDecoder} from "./converter/quotedprintabledecoder"; -import {QuotedPrintableEncoder} from "./converter/quotedprintableencoder"; +// import {QuotedPrintableDecoder} from "./converter/quotedprintabledecoder"; +// import {QuotedPrintableEncoder} from "./converter/quotedprintableencoder"; import {NativeLibraryWrapperService} from "./nativelibrarywrapper.service"; -import {PunycodeEncoder} from "./converter/punycodeencoder"; -import {PunycodeDecoder} from "./converter/punycodedecoder"; +// import {PunycodeEncoder} from "./converter/punycodeencoder"; +// import {PunycodeDecoder} from "./converter/punycodedecoder"; @Injectable() export class ConverterRegistryService { @@ -48,14 +48,14 @@ export class ConverterRegistryService { this.registerConverter(new URIComponentDecoder()); this.registerConverter(new HTMLEntitiesEncoder()); this.registerConverter(new HTMLEntitiesDecoder()); - this.registerConverter(new QuotedPrintableEncoder(this.wrapper)); - this.registerConverter(new QuotedPrintableDecoder(this.wrapper)); + // this.registerConverter(new QuotedPrintableEncoder(this.wrapper)); + // this.registerConverter(new QuotedPrintableDecoder(this.wrapper)); this.registerConverter(new DecToHexConverter()); this.registerConverter(new HexToDecConverter()); this.registerConverter(new DecToBinConverter()); this.registerConverter(new BinToDecConverter()); - this.registerConverter(new PunycodeEncoder(this.wrapper)); - this.registerConverter(new PunycodeDecoder(this.wrapper)); + // this.registerConverter(new PunycodeEncoder(this.wrapper)); + // this.registerConverter(new PunycodeDecoder(this.wrapper)); } private registerConverter(converter:Converter):void { diff --git a/src/app/nativelibrarywrapper.service.ts b/src/app/nativelibrarywrapper.service.ts index 2a905b9..1ee1437 100644 --- a/src/app/nativelibrarywrapper.service.ts +++ b/src/app/nativelibrarywrapper.service.ts @@ -6,13 +6,13 @@ declare var punycode:any; @Injectable() export class NativeLibraryWrapperService { - public utf8:any; - public quotedPrintable:any; - public punycode:any; + // public utf8:any; + // public quotedPrintable:any; + // public punycode:any; constructor() { - this.utf8 = utf8; - this.quotedPrintable = quotedPrintable; - this.punycode = punycode; + // this.utf8 = utf8; + // this.quotedPrintable = quotedPrintable; + // this.punycode = punycode; } } diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..f539881 --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,25 @@ +@font-face { + font-family: "ABeeZee"; + font-stretch: normal; + font-style: normal; + font-variant: normal; + font-weight: normal; + src: local("ABeeZee Regular"), + local("ABeeZee-Regular"), + local("ABeeZee"), + url("../fonts/abeezee-regular.woff") format("woff"); +} + +body { + font-family: "ABeeZee", sans-serif; + margin: 0; + padding: 1em 0 0 0; +} + +h1 { + text-align: center; +} + +.apploader { + text-align: center; +} diff --git a/src/abeezee-regular.woff b/src/assets/fonts/abeezee-regular.woff similarity index 100% rename from src/abeezee-regular.woff rename to src/assets/fonts/abeezee-regular.woff diff --git a/src/freemono.eot b/src/assets/fonts/freemono.eot similarity index 100% rename from src/freemono.eot rename to src/assets/fonts/freemono.eot diff --git a/src/freemono.svg b/src/assets/fonts/freemono.svg similarity index 100% rename from src/freemono.svg rename to src/assets/fonts/freemono.svg diff --git a/src/freemono.ttf b/src/assets/fonts/freemono.ttf similarity index 100% rename from src/freemono.ttf rename to src/assets/fonts/freemono.ttf diff --git a/src/freemono.woff b/src/assets/fonts/freemono.woff similarity index 100% rename from src/freemono.woff rename to src/assets/fonts/freemono.woff diff --git a/src/index.html b/src/index.html index 5473fad..962167d 100644 --- a/src/index.html +++ b/src/index.html @@ -1,50 +1,9 @@ - -