Commit f76d2f67 authored by Konstantin Schulz's avatar Konstantin Schulz
Browse files

minor fixes/additions to 0.1.9

parent 91e2d6ed
{
"name": "mcClient",
"version": "0.1.9",
"version": "0.2.0",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
......
......@@ -9,7 +9,6 @@ export class CorpusMC {
public citation_level_1: string;
public citation_level_2: string;
public citation_level_3: string;
// public citations: { [value: number]: Citation; };
public citations: { [label: string]: Citation; };
constructor(init?: Partial<CorpusMC>) {
Object.assign(this, init);
......
......@@ -20,7 +20,6 @@
<ion-content padding>
<ion-grid>
<!--*ngIf="currentlyAvailableCitations.length > 0; else loading"-->
<ion-row>
<ion-col>
<ion-label>
......@@ -63,7 +62,4 @@
</ion-row>
</ion-grid>
<button ion-button block (click)="showText()">{{ "SHOW" | translate }}</button>
<!--<ng-template #loading>-->
<!--<ion-spinner></ion-spinner>-->
<!--</ng-template>-->
</ion-content>
......@@ -138,7 +138,7 @@ export class CorpusDetailPage {
// }
}
async checkTextRange(citationLabelsStart: string[], citationLabelsEnd: string[]) {
checkTextRange(citationLabelsStart: string[], citationLabelsEnd: string[]) {
return new Promise(resolve => {
let wholeTextRangeLabels: string[] = citationLabelsStart.concat(citationLabelsEnd);
if (this.corpusProvider.currentCorpus.citation_level_2 === CitationLevel[CitationLevel.default]) {
......@@ -175,7 +175,7 @@ export class CorpusDetailPage {
this.corpusProvider.currentTextRange.start = this.corpusProvider.currentTextRange.end = randomLabel;
}
public async mapCitationLabelsToValues(label: string, index: number, citationLabels: string[], valueList: number[]) {
public mapCitationLabelsToValues(label: string, index: number, citationLabels: string[], valueList: number[]) {
return new Promise(resolve => {
if (index === 0) {
valueList.push(this.corpusProvider.currentCorpus.citations[label].value);
......@@ -246,22 +246,23 @@ export class CorpusDetailPage {
}
}
async showText() {
showText() {
let citationLabelsStart: string[] = this.corpusProvider.currentTextRange.start.split(".").filter(x => x);
let citationLabelsEnd: string[] = this.corpusProvider.currentTextRange.end.split(".").filter(x => x);
let isTextRangeCorrect = await this.checkTextRange(citationLabelsStart, citationLabelsEnd);
if (!isTextRangeCorrect) {
let toast = this.toastCtrl.create({
message: this.invalidTextRangeString,
duration: 3000,
position: 'top'
});
toast.present().then();
return;
}
let newUrnBase: string = this.corpusProvider.currentCorpus.source_urn + ":";
this.corpusProvider.currentUrn = newUrnBase + this.citationValuesStart.join(".") + "-" + this.citationValuesEnd.join(".");
this.corpusProvider.currentText = "";
this.navCtrl.push(ShowTextPage).then();
this.checkTextRange(citationLabelsStart, citationLabelsEnd).then((isTextRangeCorrect: boolean) => {
if (!isTextRangeCorrect) {
let toast = this.toastCtrl.create({
message: this.invalidTextRangeString,
duration: 3000,
position: 'top'
});
toast.present().then();
return;
}
let newUrnBase: string = this.corpusProvider.currentCorpus.source_urn + ":";
this.corpusProvider.currentUrn = newUrnBase + this.citationValuesStart.join(".") + "-" + this.citationValuesEnd.join(".");
this.corpusProvider.currentText = "";
this.navCtrl.push(ShowTextPage).then();
});
}
}
......@@ -50,14 +50,4 @@ export class HomePage {
toast.present().then();
let a = new Date().getTime()
}
showFurtherReferences(value: string){
if (!value){
return;
}
if (value.endsWith(".")){
this.listValues = ['1.1', '1.2', '1.3'];
}
console.log(value);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment