From 00b5556c182fa70dfca17c517488b8afae6257c9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 22 Feb 2018 10:22:53 +0100 Subject: Add ability to add custom css/javascript --- .../edit-custom-config.component.html | 24 ++++++++++++++++++++++ .../edit-custom-config.component.scss | 6 ++++++ .../edit-custom-config.component.ts | 18 ++++++++++++---- 3 files changed, 44 insertions(+), 4 deletions(-) (limited to 'client/src/app/+admin/config/edit-custom-config') diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 0fe2aa203..8dca9bc04 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html @@ -128,5 +128,29 @@ +
Customizations
+ +
+ + +
+ {{ formErrors.customizationJavascript }} +
+
+ +
+ + +
+ {{ formErrors.customizationCSS }} +
+
+ diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss index 0195f44eb..e72f30c69 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss @@ -29,3 +29,9 @@ input[type=submit] { margin-top: 30px; margin-bottom: 10px; } + +textarea { + @include peertube-textarea(500px, 150px); + + display: block; +} diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index cd8c926f7..027268536 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts @@ -49,7 +49,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { signupLimit: '', adminEmail: '', userVideoQuota: '', - transcodingThreads: '' + transcodingThreads: '', + customizationJavascript: '', + customizationCSS: '' } validationMessages = { instanceName: INSTANCE_NAME.MESSAGES, @@ -84,7 +86,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { adminEmail: [ '', ADMIN_EMAIL.VALIDATORS ], userVideoQuota: [ '', USER_VIDEO_QUOTA.VALIDATORS ], transcodingThreads: [ '', TRANSCODING_THREADS.VALIDATORS ], - transcodingEnabled: [ ] + transcodingEnabled: [ ], + customizationJavascript: [ '' ], + customizationCSS: [ '' ] } for (const resolution of this.resolutions) { @@ -125,7 +129,11 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { instance: { name: this.form.value['instanceName'], description: this.form.value['instanceDescription'], - terms: this.form.value['instanceTerms'] + terms: this.form.value['instanceTerms'], + customizations: { + javascript: this.form.value['customizationJavascript'], + css: this.form.value['customizationCSS'] + } }, cache: { previews: { @@ -183,7 +191,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { adminEmail: this.customConfig.admin.email, userVideoQuota: this.customConfig.user.videoQuota, transcodingThreads: this.customConfig.transcoding.threads, - transcodingEnabled: this.customConfig.transcoding.enabled + transcodingEnabled: this.customConfig.transcoding.enabled, + customizationJavascript: this.customConfig.instance.customizations.javascript, + customizationCSS: this.customConfig.instance.customizations.css } for (const resolution of this.resolutions) { -- cgit v1.2.3