text-range.page.html 7.74 KB
Newer Older
1 2 3 4
<ion-header>
    <ion-toolbar>
        <div class="toolbar-left">
            <ion-back-button icon="arrow-round-back" defaultHref="home"></ion-back-button>
5
            <ion-title>{{corpusService.currentCorpus?.title}}</ion-title>
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
        </div>
        <div class="toolbar-right">
            <ion-spinner *ngIf="HelperService.isLoading"></ion-spinner>
            <button (click)="HelperService.goToHomePage(navCtrl)">
                <ion-icon name="home"></ion-icon>
            </button>
        </div>
    </ion-toolbar>
</ion-header>


<ion-content padding>
    <ion-grid>
        <ion-row>
            <ion-col>
21 22 23 24 25 26
                <ion-button (click)="confirmSelection()">{{ "SHOW_TEXT" | translate }}</ion-button>
            </ion-col>
        </ion-row>
        <ion-row>
            <ion-col>
                <ion-button (click)="confirmSelection(true)">{{ "EXERCISE_SET_PARAMETERS" | translate }}</ion-button>
27 28 29 30 31 32 33 34 35
            </ion-col>
        </ion-row>
        <ion-row>
            <ion-col>{{ 'START' | translate }}</ion-col>
        </ion-row>
        <ion-row>
            <ion-col>
                <input [(ngModel)]="corpusService.currentTextRange.start[0]" id="input1"
                       (ngModelChange)="showFurtherReferences(true).then()"
36
                       placeholder="{{ corpusService.currentCorpus?.citation_level_1 }}"
37 38 39
                       (focus)="currentInputId = 1" (blur)="resetCurrentInputId()"/>
            </ion-col>
            <ion-col>
40
                <input *ngIf="corpusService.currentCorpus?.citation_level_2 !== CitationLevel[CitationLevel.default]"
41 42
                       [(ngModel)]="corpusService.currentTextRange.start[1]" id="input2"
                       (ngModelChange)="showFurtherReferences(true).then()"
43
                       placeholder="{{ corpusService.currentCorpus?.citation_level_2 }}"
44
                       (focus)="currentInputId = 2" (blur)="resetCurrentInputId()"
45
                       disabled="{{!corpusService.currentCorpus?.citations.hasOwnProperty(corpusService.currentTextRange.start[0])}}"/>
46 47
            </ion-col>
            <ion-col>
48
                <input *ngIf="corpusService.currentCorpus?.citation_level_3 !== CitationLevel[CitationLevel.default]"
49 50
                       [(ngModel)]="corpusService.currentTextRange.start[2]" id="input3"
                       (ngModelChange)="showFurtherReferences(true).then()"
51
                       placeholder="{{ corpusService.currentCorpus?.citation_level_3 }}"
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
                       (focus)="currentInputId = 3" (blur)="resetCurrentInputId()"
                       disabled="{{isInputDisabled(true)}}"/>
            </ion-col>
        </ion-row>
        <ion-row>
            <ion-col>
                <ion-list *ngIf="currentInputId === 1">
                    <ion-item *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations)">
                        <button class="autocomplete"
                                (click)="corpusService.currentTextRange.start[0] = key; applyAutoComplete(true)">
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
            <ion-col>
                <ion-list *ngIf="currentInputId === 2">
                    <ion-item
                            *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations[corpusService.currentTextRange.start[0]].subcitations)">
                        <button class="autocomplete"
                                (click)="corpusService.currentTextRange.start[1] = key; applyAutoComplete(true)">
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
            <ion-col>
                <ion-list *ngIf="currentInputId === 3">
                    <ion-item
                            *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations[corpusService.currentTextRange.start[0]].subcitations[corpusService.currentTextRange.start[1]].subcitations)">
                        <button class="autocomplete"
                                (click)="corpusService.currentTextRange.start[2] = key; applyAutoComplete(true)">
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
        </ion-row>
        <ion-row>
            <ion-col>{{ 'END' | translate }}</ion-col>
        </ion-row>
        <ion-row>
            <ion-col>
                <input [(ngModel)]="corpusService.currentTextRange.end[0]" id="input4"
                       (ngModelChange)="showFurtherReferences(false).then()"
97
                       placeholder="{{ corpusService.currentCorpus?.citation_level_1 }}"
98 99 100
                       (focus)="currentInputId = 4" (blur)="resetCurrentInputId()"/>
            </ion-col>
            <ion-col>
101
                <input *ngIf="corpusService.currentCorpus?.citation_level_2 !== CitationLevel[CitationLevel.default]"
102 103
                       [(ngModel)]="corpusService.currentTextRange.end[1]" id="input5"
                       (ngModelChange)="showFurtherReferences(false).then()"
104
                       placeholder="{{ corpusService.currentCorpus?.citation_level_2 }}"
105
                       (focus)="currentInputId = 5" (blur)="resetCurrentInputId()"
106
                       disabled="{{!corpusService.currentCorpus?.citations.hasOwnProperty(corpusService.currentTextRange.start[0])}}"/>
107 108
            </ion-col>
            <ion-col>
109
                <input *ngIf="corpusService.currentCorpus?.citation_level_3 !== CitationLevel[CitationLevel.default]"
110 111
                       [(ngModel)]="corpusService.currentTextRange.end[2]" id="input6"
                       (ngModelChange)="showFurtherReferences(false).then()"
112
                       placeholder="{{ corpusService.currentCorpus?.citation_level_3 }}"
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
                       (focus)="currentInputId = 6" (blur)="resetCurrentInputId()"
                       disabled="{{isInputDisabled(false)}}"/>
            </ion-col>
        </ion-row>
        <ion-row>
            <ion-col>
                <ion-list *ngIf="currentInputId === 4">
                    <ion-item *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations)">
                        <button class="autocomplete"
                                (click)="corpusService.currentTextRange.end[0] = key; applyAutoComplete(false)">
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
            <ion-col>
                <ion-list *ngIf="currentInputId === 5">
                    <ion-item
                            *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations[corpusService.currentTextRange.end[0]].subcitations)">
                        <button class="autocomplete"
                                (click)="corpusService.currentTextRange.end[1] = key; applyAutoComplete(false)">
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
            <ion-col>
                <ion-list *ngIf="currentInputId === 6">
                    <ion-item
                            *ngFor="let key of ObjectKeys(corpusService.currentCorpus.citations[corpusService.currentTextRange.end[0]].subcitations[corpusService.currentTextRange.end[1]].subcitations)">
                        <button class="autocomplete"
                                (click)="corpusService.currentTextRange.end[2] = key; applyAutoComplete(false)">
                            {{ key }}
                        </button>
                    </ion-item>
                </ion-list>
            </ion-col>
        </ion-row>
    </ion-grid>
</ion-content>