Merge branch '12-clean-up-old-files' into 'develop'

deleted obsolete/old files

Closes #12

See merge request !6
This commit is contained in:
Manuel Friedli 2016-09-21 23:24:07 +02:00
commit 2deb03f754
8 changed files with 1 additions and 130 deletions

View file

@ -2,7 +2,6 @@ import {NgModule} from "@angular/core";
import {BrowserModule} from "@angular/platform-browser";
import {FormsModule} from "@angular/forms";
import {AppComponent} from "./app.component";
import {InputareaComponent} from "./inputarea.component";
@NgModule({
imports: [
@ -10,8 +9,7 @@ import {InputareaComponent} from "./inputarea.component";
FormsModule
],
declarations: [
AppComponent,
InputareaComponent
AppComponent
],
bootstrap: [AppComponent]
})

View file

@ -1,6 +0,0 @@
import {ConversionType} from "./conversiontype";
export class ConversionInput {
public content:string;
public type:ConversionType;
}

View file

@ -1,28 +0,0 @@
export enum ConversionType {
ENCODE_BASE64,
DECODE_BASE64
}
export namespace ConversionType {
export function getName(type:ConversionType):string {
switch (type) {
case ConversionType.DECODE_BASE64:
return "Decode BASE64";
case ConversionType.ENCODE_BASE64:
return "Encode BASE64";
default:
return "Unknown";
}
}
export function of(id:number):ConversionType {
switch (id) {
case 0:
return ConversionType.ENCODE_BASE64;
case 1:
return ConversionType.DECODE_BASE64;
default:
return undefined;
}
}
}

View file

@ -1,15 +0,0 @@
<!--<div id="wrapper-{{index}}" class="wrapper">-->
<!--<textarea id="input-{{index}}" class="input" (change)="update()" placeholder="Please enter your input ..."-->
<!--[(ngModel)]="conversion.content">{{conversion.content}}</textarea>-->
<!--<select id="type-{{index}}" class="conversion" (change)="convert($event)">-->
<!--<option id="-1">Select conversion ...</option>-->
<!--<option *ngFor="let c of conversions" id="{{c}}">Type {{ConversionType[c]}}</option>-->
<!--</select>-->
<!--</div>-->
<textarea class="input" (change)="update()" placeholder="Please enter your input ..."
[(ngModel)]="content">{{content}}</textarea>
<select class="conversion" (change)="convert($event)">
<option id="-1">Select conversion ...</option>
<option *ngFor="let c of converters" id="{{c.getId()}}">{{c.getDisplayname()}}</option>
</select>

View file

@ -1,47 +0,0 @@
import {Component, OnInit} from "@angular/core";
import {ConverterRegistryService} from "./converterregistry.service";
import {Converter} from "./converter/converter";
import {InputComponentManagerService} from "./inputcomponentmanager.service";
@Component({
moduleId: module.id,
selector: "den-inputarea",
templateUrl: "inputarea.component.html",
styleUrls: ["inputarea.component.css"]
})
export class InputareaComponent extends OnInit {
public converters:Converter[] = [];
public content:string = '';
private selectedConverter:Converter;
constructor(private converterRegistryService:ConverterRegistryService, private inputComponentManagerService:InputComponentManagerService) {
super();
}
public convert(e):void {
this.selectedConverter = this.converterRegistryService.getConverter(e.target.selectedOptions[0].id);
this.update();
}
public update():void {
if (this.selectedConverter !== undefined) {
let result:string = this.selectedConverter.convert(this.content);
let nextComponent:InputareaComponent = this.inputComponentManagerService.getNext(this);
if (nextComponent !== undefined) {
nextComponent.setContent(result);
}
}
}
public setContent(content:string):void {
this.content = content;
this.update();
}
ngOnInit():void {
this.converters = this.converterRegistryService.getAllConverters();
this.selectedConverter = undefined;
this.inputComponentManagerService.register(this);
}
}

View file

@ -1,12 +0,0 @@
//import {Component} from "@angular/core";
//
//@Component({
// selector: "den-option",
// template: `
// <option id="{{id}}">{{displayName}}</option>
// `
//})
//export class OptionComponent {
// public id:string;
// public displayName:string;
//}

View file

@ -1,19 +0,0 @@
//import {Component} from "@angular/core";
//
//import {OptionComponent} from "./option.component";
//
//@Component({
// selector: "den-selector",
// template: `
// <select>
// <span *ngFor="#option of options">
// <option id="{{option.id}}">{{option.displayName}}</option>
// </span>
// </select>
// `,
// directives: [OptionComponent]
//})
//export class SelectorComponent {
// private options:OptionComponent[];
//
//}