Commit 55418bed authored by Konstantin Schulz's avatar Konstantin Schulz
Browse files

major update to support more browsers, esp. MS Edge and IE11

parent b018ebba
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
\ No newline at end of file
......@@ -17,6 +17,7 @@ npm-debug.log*
.sass-cache/
.tmp/
.versions/
.gitlab/
coverage/
# dist/
node_modules/
......
<!--- Beschreibe deinen Vorschlag mit wenigen Stichworten im Titel -->
## Beschreibung
<!--- Beschreibe deinen Vorschlag detailliert -->
## Motivation und Kontext
<!--- Warum ist diese Veränderung wichtig? Welches Problem wird dadurch gelöst? -->
<!--- Falls dadurch ein bereits diskutiertes Problem gelöst wird, hinterlasse hier bitte einen Link dazu. -->
## Wie kann man das neue Verhalten testen?
<!--- Beschreibe bitte detailliert, wie das neue Verhalten getesten werden kann. -->
<!--- Füge Details zum Test-Framework hinzu und wie die Auswirkungen auf andere Code-Bereiche getestet werden können. -->
## Screenshots (falls angemessen):
## Art der Veränderung
<!--- Wie verändert sich die Software durch das neue Feature? Schreibe ein 'x' in alle zutreffenden Boxen: -->
- [ ] Fehler / Störendes Verhalten beheben (oberflächliche Änderung, die ein Problem löst)
- [ ] Neues Feature (oberflächliche Änderung, die neue Funktionalität hinzufügt)
- [ ] Tiefgreifende Änderung (ein Feature, durch das Teile der bisherigen Software anders funktionieren oder angepasst werden müssen)
## Checkliste:
<!--- Gehe alle folgenden Punkte durch und schreibe ein 'x' in die zutreffenden Boxen. -->
<!--- Bei Unsicherheiten gerne nachfragen. Wir sind da, um dir zu helfen! -->
- [ ] Mein Feature passt gut in die bisherige Struktur des Projekts.
- [ ] Mein Feature erfordert eine Anpassung der Dokumentation.
- [ ] Ich habe die Dokumentation entsprechend angepasst.
- [ ] Ich habe die Anleitung zur **MITWIRKUNG** gelesen.
- [ ] Ich habe Tests vorgeschlagen, die meine vorgeschlagenen Änderungen abdecken.
......@@ -24,6 +24,4 @@ RUN npm install
# workaround to fix the missing binding issue for node-sass
RUN npm rebuild node-sass
# TODO: for some reason, this does not persist?!?!??!
RUN ionic cordova build browser --prod --release --max-old-space-size=4096
# TODO: cordova uses a fixed path starting at root (i.e. korpling.org/ instead of korpling.org/mc/). How do we deal with this to give it access to the config.xml file? Change the production server's NGINX config?
#COPY platforms/browser/config.xml www/config.xml
# RUN ionic cordova build browser --prod --release --max-old-space-size=4096
......@@ -124,8 +124,13 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"ionic-cordova-build": {
......@@ -174,7 +179,9 @@
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": ["**/node_modules/**"]
"exclude": [
"**/node_modules/**"
]
}
}
}
......
......@@ -2,7 +2,7 @@
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>mc_frontend</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
......@@ -18,15 +18,11 @@
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreenDelay" value="3000" />
<platform name="browser">
<preference name="SplashScreen" value="assets/imgs/logo.png" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="SplashScreenBackgroundColor" value="white" />
<preference name="ShowSplashScreen" value="true" />
<preference name="SplashScreenWidth" value="600" />
<preference name="SplashScreenHeight" value="300" />
</platform>
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="@xml/network_security_config" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
<allow-intent href="market:*" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
......@@ -47,6 +43,16 @@
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
</platform>
<platform name="browser">
<preference name="FadeSplashScreen" value="false" />
<preference name="FadeSplashScreenDuration" value="0" />
<preference name="SplashScreen" value="assets/imgs/logo.png" />
<preference name="SplashScreenBackgroundColor" value="0xABCDEFFF" />
<preference name="SplashScreenDelay" value="4000" />
<preference name="ShowSplashScreen" value="true" />
<preference name="SplashScreenWidth" value="512" />
<preference name="SplashScreenHeight" value="512" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
......@@ -84,11 +90,10 @@
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
</platform>
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
<plugin name="cordova-plugin-device" spec="2.0.2" />
<plugin name="cordova-plugin-ionic-keyboard" spec="2.0.5" />
<plugin name="cordova-plugin-ionic-webview" spec="^2.2.5" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
<plugin name="cordova-plugin-ionic-webview" spec="^4.0.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<engine name="android" spec="7.1.4" />
<engine name="browser" spec="^5.0.4" />
<engine name="browser" spec="5.0.4" />
</widget>
......@@ -21,7 +21,7 @@ exports.config = {
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
......
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5"
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
......@@ -32,7 +32,7 @@ http {
#access_log logs/host.access.log main;
location / {
root /home/mc/mc_frontend/www;
root /home/mc/mc_frontend/platforms/browser/www;
index index.html index.htm;
# enable CORS so the cordova files (config.xml) can be accessed from other domains
add_header Access-Control-Allow-Origin *;
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve --port 8100",
"build": "ionic cordova build browser",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
......@@ -20,64 +20,63 @@
"@angular/platform-browser": "^7.2.10",
"@angular/platform-browser-dynamic": "^7.2.10",
"@angular/router": "^7.2.10",
"@ionic-native/core": "^5.0.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^4.0.0",
"@ionic-native/core": "^5.6.0",
"@ionic-native/splash-screen": "^5.6.0",
"@ionic-native/status-bar": "^5.6.0",
"@ionic/angular": "^4.3.1",
"@ionic/core": "^4.4.0",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"ajv": "^6.9.1",
"cordova-android": "7.1.4",
"cordova-browser": "^5.0.4",
"cordova-browser": "5.0.4",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.0.5",
"cordova-plugin-ionic-webview": "^2.3.3",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^4.0.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"core-js": "^2.5.4",
"rxjs": "~6.3.3",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.8.29"
},
"devDependencies": {
"@angular-devkit/architect": "~0.12.3",
"@angular-devkit/build-angular": "^0.13.8",
"@angular-devkit/core": "~7.2.3",
"@angular-devkit/schematics": "~7.2.3",
"@angular/cli": "~7.2.3",
"@angular-devkit/architect": "~0.13.8",
"@angular-devkit/build-angular": "^0.13.9",
"@angular-devkit/core": "~7.3.8",
"@angular-devkit/schematics": "~7.3.8",
"@angular/cli": "~7.3.8",
"@angular/compiler": "^7.2.10",
"@angular/compiler-cli": "^7.2.10",
"@angular/language-service": "~7.2.2",
"@ionic/angular-toolkit": "^1.3.0",
"@ionic/angular-toolkit": "~1.5.1",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~10.12.0",
"@types/node": "~12.0.0",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.4",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~8.0.0",
"tslint": "~5.12.0",
"ts-node": "~8.1.0",
"tslint": "~5.16.0",
"typescript": "~3.1.6"
},
"description": "An Ionic project",
"cordova": {
"platforms": [
"android",
"browser"
],
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-splashscreen": {}
}
},
"platforms": [
"browser"
]
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain>localhost</domain>
</domain-config>
</network-security-config>
......@@ -3,22 +3,23 @@ import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'vocabulary-check', loadChildren: './vocabulary-check/vocabulary-check.module#VocabularyCheckPageModule' },
{ path: 'change-language', loadChildren: './change-language/change-language.module#ChangeLanguagePageModule' },
{ path: 'confirm-cancel', loadChildren: './confirm-cancel/confirm-cancel.module#ConfirmCancelPageModule' },
{ path: 'author', loadChildren: './author/author.module#AuthorPageModule' },
{ path: 'author-detail', loadChildren: './author-detail/author-detail.module#AuthorDetailPageModule' },
{ path: 'text-range', loadChildren: './text-range/text-range.module#TextRangePageModule' },
{ path: 'show-text', loadChildren: './show-text/show-text.module#ShowTextPageModule' },
{ path: 'exercise-parameters', loadChildren: './exercise-parameters/exercise-parameters.module#ExerciseParametersPageModule' },
{ path: 'preview', loadChildren: './preview/preview.module#PreviewPageModule' },
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'imprint', loadChildren: './imprint/imprint.module#ImprintPageModule' },
{ path: 'info', loadChildren: './info/info.module#InfoPageModule' },
{ path: 'kwic', loadChildren: './kwic/kwic.module#KwicPageModule' },
{ path: 'preview', loadChildren: './preview/preview.module#PreviewPageModule' },
{ path: 'ranking', loadChildren: './ranking/ranking.module#RankingPageModule' },
{ path: 'change-language', loadChildren: './change-language/change-language.module#ChangeLanguagePageModule' },
{ path: 'info', loadChildren: './info/info.module#InfoPageModule' },
{ path: 'show-text', loadChildren: './show-text/show-text.module#ShowTextPageModule' },
{ path: 'sources', loadChildren: './sources/sources.module#SourcesPageModule' },
{ path: 'imprint', loadChildren: './imprint/imprint.module#ImprintPageModule' },
{ path: 'test', loadChildren: './test/test.module#TestPageModule' },
{ path: 'confirm-cancel', loadChildren: './confirm-cancel/confirm-cancel.module#ConfirmCancelPageModule' },
{ path: 'text-range', loadChildren: './text-range/text-range.module#TextRangePageModule' },
{ path: 'vocabulary-check', loadChildren: './vocabulary-check/vocabulary-check.module#VocabularyCheckPageModule' },
];
......
......@@ -10,10 +10,10 @@ import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from 'src/app/app.component';
import {HttpClient, HttpClientModule} from '@angular/common/http';
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {ChangeLanguagePage} from "src/app/change-language/change-language.page";
import {ChangeLanguagePageModule} from "src/app/change-language/change-language.module";
import {HelperService} from "src/app/helper.service";
import {ConfirmCancelPageModule} from "src/app/confirm-cancel/confirm-cancel.module";
import {ChangeLanguagePage} from 'src/app/change-language/change-language.page';
import {ChangeLanguagePageModule} from 'src/app/change-language/change-language.module';
import {HelperService} from 'src/app/helper.service';
import {ConfirmCancelPageModule} from 'src/app/confirm-cancel/confirm-cancel.module';
@NgModule({
declarations: [AppComponent],
......
/* tslint:disable:no-string-literal object-literal-shorthand */
import {Injectable} from '@angular/core';
import {CorpusMC} from 'src/app/models/corpusMC';
import {Author} from 'src/app/models/author';
import {TextRange} from 'src/app/models/textRange';
import {Citation} from 'src/app/models/citation';
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
import {TranslateService} from '@ngx-translate/core';
import {ToastController} from '@ionic/angular';
import {HelperService} from 'src/app/helper.service';
import {AnnisResponse} from "src/app/models/annisResponse";
import {AnnisResponse} from 'src/app/models/annisResponse';
import {
CaseTranslations,
CaseValue,
......@@ -16,12 +16,12 @@ import {
PartOfSpeechTranslation,
PartOfSpeechValue,
Phenomenon
} from "src/app/models/enum";
import {NodeMC} from "src/app/models/nodeMC";
import {LinkMC} from "src/app/models/linkMC";
import {QueryMC} from "src/app/models/queryMC";
import {Exercise} from "src/app/models/exercise";
import {Feedback} from "src/app/models/feedback";
} from 'src/app/models/enum';
import {NodeMC} from 'src/app/models/nodeMC';
import {LinkMC} from 'src/app/models/linkMC';
import {QueryMC} from 'src/app/models/queryMC';
import {Exercise} from 'src/app/models/exercise';
import {Feedback} from 'src/app/models/feedback';
@Injectable({
providedIn: 'root'
......@@ -32,9 +32,8 @@ export class CorpusService {
public availableAuthors: Author[];
public corporaUnavailableString: string;
public currentAuthor: Author;
public currentCitations: Citation[] = [];
public currentCorpus: CorpusMC;
public currentText: string = '';
public currentText = '';
public currentTextRange: TextRange = new TextRange({start: ['', '', ''], end: ['', '', '']});
public currentUrn: string;
public exercise: Exercise = new Exercise({
......@@ -90,7 +89,7 @@ export class CorpusService {
}
// check local storage for necessary updates
const updateInfoJSON: object = JSON.parse(window.localStorage.getItem(HelperService.config['localStorageKeyUpdateInfo']));
this.getCorpora(updateInfoJSON ? new Date(updateInfoJSON['corpora']['lastAccessTime']).getTime() : 0).then();
this.getCorpora(updateInfoJSON ? new Date(updateInfoJSON['corpora'].lastAccessTime).getTime() : 0).then();
}
getCorpora(lastUpdateTimeMS: number = 0) {
......@@ -99,7 +98,7 @@ export class CorpusService {
this.availableAuthors = [];
// get corpora from REST API
const url = HelperService.config['backendBaseUrl'] + HelperService.config['backendApiCorporaPath'];
this.http.get(url, {params: {'last_update_time': lastUpdateTimeMS.toString()}}).subscribe((data: object) => {
this.http.get(url, {params: {last_update_time: lastUpdateTimeMS.toString()}}).subscribe((data: object) => {
if (data) {
const corpusList: CorpusMC[] = data['corpora'] as CorpusMC[];
window.localStorage.setItem(HelperService.config['localStorageKeyCorpora'], JSON.stringify(corpusList));
......@@ -126,13 +125,13 @@ export class CorpusService {
getCTStextPassage(urn: string) {
const url = HelperService.config['backendBaseUrl'] + HelperService.config['backendApiRawtextPath'];
return this.http.get(url, {params: {'urn': urn}});
return this.http.get(url, {params: {urn: urn}});
}
getCTSvalidReff(urn: string) {
const config: object = HelperService.config;
const fullUrl: string = config['backendBaseUrl'] + config['backendApiValidReffPath'];
return this.http.get(fullUrl, {params: {'urn': urn}});
return this.http.get(fullUrl, {params: {urn: urn}});
}
getText() {
......@@ -235,6 +234,8 @@ export class CorpusService {
this.phenomenonMap[Phenomenon.dependency][2][DependencyValue.root] = rootNodeIds.length;
this.adjustQueryValue(this.exercise.queryItems[0]);
this.annisResponse = ar;
HelperService.mostRecentSetup.annisResponse = ar;
HelperService.saveMostRecentSetup();
this.currentText = ar.graph.nodes.map(x => x.annis_tok).join(' ');
}
......@@ -277,8 +278,10 @@ export class CorpusService {
restoreLastCorpus() {
return new Promise((resolve, reject) => {
this.annisResponse = HelperService.mostRecentSetup.annisResponse;
// check if the data is already present
if (this.currentUrn == HelperService.mostRecentSetup.currentUrn && this.currentCorpus == HelperService.mostRecentSetup.currentCorpus && this.currentText) {
if (this.currentUrn === HelperService.mostRecentSetup.currentUrn &&
this.currentCorpus === HelperService.mostRecentSetup.currentCorpus && this.currentText) {
return resolve();
}
this.currentCorpus = HelperService.mostRecentSetup.currentCorpus;
......
/* tslint:disable:no-string-literal */
import {
ExerciseType,
ExerciseTypeTranslation,
......@@ -46,7 +47,7 @@ export class ExerciseParametersPage {
adjustTranslations() {
this.translateService.get(ExerciseTypeTranslation[this.corpusService.exercise.type]).subscribe(
value => this.corpusService.exercise.typeTranslation = value);
if ([ExerciseType.cloze, ExerciseType.matching].includes(this.corpusService.exercise.type)) {
if ([ExerciseType.cloze, ExerciseType.matching].indexOf(this.corpusService.exercise.type) > -1) {
this.translateService.get(InstructionsTranslation[this.corpusService.exercise.type]).subscribe(
value => this.corpusService.exercise.instructionsTranslation = value);
}
......@@ -86,29 +87,15 @@ export class ExerciseParametersPage {
}
private getExerciseData() {
const search_values: string[] = this.corpusService.exercise.queryItems.map(
const searchValues: string[] = this.corpusService.exercise.queryItems.map(
query => query.phenomenon + '=' + query.values.join('|'));
const formData = new FormData();
formData.append('urn', this.corpusService.currentUrn);
formData.append('search_values', JSON.stringify(search_values));
formData.append('search_values', JSON.stringify(searchValues));
HelperService.currentError = null;
HelperService.isLoading = true;
if (this.corpusService.exercise.type === ExerciseType.kwic) {
const kwic_url: string = HelperService.config['backendBaseUrl'] + HelperService.config['backendApiKwicPath'];
this.http.post(kwic_url, formData).subscribe((svgString: string) => {
HelperService.isLoading = false;
this.exerciseService.kwicGraphs = svgString;
this.navCtrl.navigateForward('kwic').then();
}, async (error: HttpErrorResponse) => {
HelperService.isLoading = false;
HelperService.currentError = error;
const toast = await this.toastCtrl.create({
message: HelperService.generalErrorAlertMessage,
duration: 3000,
position: 'top'
});
toast.present().then();
});
this.getKwicExercise(formData);
return;
}
// TODO: change the corpus title to something meaningful, e.g. concatenate user ID and wanted exercise title
......@@ -123,9 +110,15 @@ export class ExerciseParametersPage {
formData.append('incorrect_feedback', this.corpusService.exercise.feedback.incorrect);
formData.append('general_feedback', this.corpusService.exercise.feedback.general);
formData.append('work_author', this.corpusService.currentCorpus.author);
this.getH5Pexercise(formData);
}
getH5Pexercise(formData: FormData) {
const url = HelperService.config['backendBaseUrl'] + HelperService.config['backendApiExercisePath'];
this.http.post(url, formData).subscribe((ar: AnnisResponse) => {
HelperService.isLoading = false;
HelperService.mostRecentSetup.annisResponse = ar;
HelperService.saveMostRecentSetup();
this.corpusService.annisResponse.exercise_id = ar.exercise_id;
this.corpusService.annisResponse.uri = ar.uri;
this.corpusService.annisResponse.solutions = ar.solutions;
......@@ -142,6 +135,24 @@ export class ExerciseParametersPage {
});
}
getKwicExercise(formData: FormData) {
const kwicUrl: string = HelperService.config['backendBaseUrl'] + HelperService.config['backendApiKwicPath'];
this.http.post(kwicUrl, formData).subscribe((svgString: string) => {
HelperService.isLoading = false;
this.exerciseService.kwicGraphs = svgString;
this.navCtrl.navigateForward('kwic').then();
}, async (error: HttpErrorResponse) => {
HelperService.isLoading = false;
HelperService.currentError = error;
const toast = await this.toastCtrl.create({
message: HelperService.generalErrorAlertMessage,
duration: 3000,
position: 'top'
});
toast.present().then();
});
}
getSortedQueryValues(query: QueryMC) {
const targetObject: object = this.corpusService.phenomenonMap[query.phenomenon][0];
return Object.keys(this.corpusService.phenomenonMap[query.phenomenon][2]).sort((a, b) => {
......
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {ToastController} from '@ionic/angular';
import {TranslateService} from '@ngx-translate/core';
@Injectable({
providedIn: 'root'
......@@ -10,9 +7,7 @@ export class ExerciseService {
public excludeOOV = false;
public kwicGraphs: string;
constructor(public http: HttpClient,
public translateService: TranslateService,
public toastCtrl: ToastController) {
constructor() {
}
createGuid() {
......
/* tslint:disable:no-string-literal */
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {NavController} from '@ionic/angular';
import {ApplicationState} from 'src/app/models/applicationState';
import {TranslateHttpLoader} from "@ngx-translate/http-loader";
import {CaseValue, DependencyValue, PartOfSpeechValue} from "src/app/models/enum";
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {CaseValue, DependencyValue, PartOfSpeechValue} from 'src/app/models/enum';
import {TranslateService} from '@ngx-translate/core';
@Injectable({
providedIn: 'root'
})
export class HelperService {
public static baseUrl: string = location.protocol.concat('//').concat(window.location.host) + window.location.pathname.split("/").slice(0, -1).join("/");
public static baseUrl: string = location.protocol.concat('//').concat(window.location.host) +
window.location.pathname.split('/').slice(0, -1).join('/');
public static caseMap: { [rawValue: string]: CaseValue } = {
'Nom': CaseValue.nominative,
'Gen': CaseValue.genitive,
'Dat': CaseValue.dative,