From dd8f83b8c99291f6c2eb7f585bdf7934240925a7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 May 2021 08:46:59 +0200 Subject: [PATCH] Update hello world --- .../client/video-edit-client-plugin.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/peertube-plugin-hello-world/client/video-edit-client-plugin.js b/peertube-plugin-hello-world/client/video-edit-client-plugin.js index 7243bee..2cc1e10 100644 --- a/peertube-plugin-hello-world/client/video-edit-client-plugin.js +++ b/peertube-plugin-hello-world/client/video-edit-client-plugin.js @@ -2,15 +2,27 @@ function register ({ registerHook, registerVideoField }) { console.log('loading video edit stuff') { - const commonOptions = { + const commonOptions1 = { name: 'hello-world-field', label: 'Super field', type: 'input', default: 'hello' } + const commonOptions2 = { + name: 'hello-world-field-2', + label: 'Super field 2', + type: 'input', + hidden: ({ liveVideo, videoToUpdate, formValues }) => { + console.log('check hidden field', { videoToUpdate, liveVideo, formValues }) + + return formValues.pluginData['hello-world-field'] === 'toto' + } + } + for (const type of [ 'upload', 'import-url', 'update' ]) { - registerVideoField(commonOptions, { type }) + registerVideoField(commonOptions1, { type }) + registerVideoField(commonOptions2, { type }) } }