Update hello world

This commit is contained in:
Chocobozzz 2021-05-04 08:46:59 +02:00
parent 6954e782ff
commit dd8f83b8c9
No known key found for this signature in database
GPG Key ID: 583A612D890159BE

View File

@ -2,15 +2,27 @@ function register ({ registerHook, registerVideoField }) {
console.log('loading video edit stuff') console.log('loading video edit stuff')
{ {
const commonOptions = { const commonOptions1 = {
name: 'hello-world-field', name: 'hello-world-field',
label: 'Super field', label: 'Super field',
type: 'input', type: 'input',
default: 'hello' 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' ]) { for (const type of [ 'upload', 'import-url', 'update' ]) {
registerVideoField(commonOptions, { type }) registerVideoField(commonOptions1, { type })
registerVideoField(commonOptions2, { type })
} }
} }