diff --git a/src/frontend/app/administration/customization/customization.component.ts b/src/frontend/app/administration/customization/customization.component.ts index 480f2850f0230bf0a8e26eb9827c529c4551301f..0907f0956c2fb87c5450281ffb174154705766f8 100644 --- a/src/frontend/app/administration/customization/customization.component.ts +++ b/src/frontend/app/administration/customization/customization.component.ts @@ -6,6 +6,7 @@ import { TranslateService } from '@ngx-translate/core'; import { AuthService } from '../../service/auth.service'; import { of } from 'rxjs'; import { NgForm } from '@angular/forms'; +import { FunctionsService } from '../../service/functions.service'; declare let tinymce: any; @@ -26,6 +27,7 @@ export class CustomizationComponent implements OnInit { private translate: TranslateService, public notificationService: NotificationService, public authService: AuthService, + private functions: FunctionsService ) { } ngOnInit(){ @@ -51,11 +53,11 @@ export class CustomizationComponent implements OnInit { initMce() { const param = { selector: '#login_message', - base_url: '../../tinymce/', + base_url: this.functions.getBaseUrl() + '/tinymce/', height: '200', suffix: '.min', extended_valid_elements : 'tag,class', - content_css: '../../assets/custom_tinymce.css', + content_css: this.functions.getBaseUrl() + '/assets/custom_tinymce.css', language: this.translate.instant('lang.langISO').replace('-', '_'), language_url: `../node_modules/tinymce-i18n/langs/${this.translate.instant('lang.langISO').replace('-', '_')}.js`, menubar: false, diff --git a/src/frontend/app/administration/otp/otp.component.ts b/src/frontend/app/administration/otp/otp.component.ts index 07b533076bc7bf72a56ebfc43b4e2cf87153d637..d695fd4eb41d2e0544aca30d057a7b1d16a66381 100644 --- a/src/frontend/app/administration/otp/otp.component.ts +++ b/src/frontend/app/administration/otp/otp.component.ts @@ -10,6 +10,7 @@ import { AuthService } from '../../service/auth.service'; import { AlertController, ModalController, PopoverController } from '@ionic/angular'; import { of } from 'rxjs'; import { OtpService } from '../../document/visa-workflow/otps/otp.service'; +import { FunctionsService } from '../../service/functions.service'; declare let tinymce: any; @@ -64,6 +65,7 @@ export class OtpComponent implements OnInit, OnDestroy { public modalController: ModalController, public alertController: AlertController, public otpService: OtpService, + private functions: FunctionsService ) { this.getConnectorTypes(); this.connector = { @@ -108,11 +110,11 @@ export class OtpComponent implements OnInit, OnDestroy { initMce() { const param = { selector: '#email_message', - base_url: '../../tinymce/', + base_url: this.functions.getBaseUrl() + '/tinymce/', height: '200', suffix: '.min', extended_valid_elements : 'tag,class', - content_css: '../../assets/custom_tinymce.css', + content_css: this.functions.getBaseUrl() + '/assets/custom_tinymce.css', language: this.translate.instant('lang.langISO').replace('-', '_'), language_url: `../node_modules/tinymce-i18n/langs/${this.translate.instant('lang.langISO').replace('-', '_')}.js`, menubar: false, diff --git a/src/frontend/app/service/functions.service.ts b/src/frontend/app/service/functions.service.ts index 3e40a697e17b0500272b99bfe13b8c3d0bf8a7c0..df9b345bd0152583e59036541cd4b7cc3a594fd0 100644 --- a/src/frontend/app/service/functions.service.ts +++ b/src/frontend/app/service/functions.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@angular/core'; +import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { LatinisePipe } from 'ngx-pipes'; @@ -10,6 +11,7 @@ export class FunctionsService { constructor( public translate: TranslateService, private latinisePipe: LatinisePipe, + private router: Router ) { } empty(value: any) { @@ -138,4 +140,9 @@ export class FunctionsService { return bytes; } } + + getBaseUrl() { + const baseUrl = window.location.href.replace(this.router.url, ''); + return baseUrl; + } }