aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/plugins
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-22 14:25:32 +0200
committerChocobozzz <me@florianbigard.com>2021-04-22 14:35:49 +0200
commit0f319334065fae8756fe7c7eec333000474d07ba (patch)
tree2ddc1fa8bdb9307b82cf52c91c86d3ba7a33cf62 /support/doc/plugins
parent87e0b71d36ae3d8f098c2be0ab45a29c9f2854b4 (diff)
downloadPeerTube-0f319334065fae8756fe7c7eec333000474d07ba.tar.gz
PeerTube-0f319334065fae8756fe7c7eec333000474d07ba.tar.zst
PeerTube-0f319334065fae8756fe7c7eec333000474d07ba.zip
Add ability to hide plugin form fields
Diffstat (limited to 'support/doc/plugins')
-rw-r--r--support/doc/plugins/guide.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md
index ca951c781..8d85092e7 100644
--- a/support/doc/plugins/guide.md
+++ b/support/doc/plugins/guide.md
@@ -623,7 +623,13 @@ async function register ({ registerVideoField, peertubeHelpers }) {
623 label: 'My added field', 623 label: 'My added field',
624 descriptionHTML: 'Optional description', 624 descriptionHTML: 'Optional description',
625 type: 'input-textarea', 625 type: 'input-textarea',
626 default: '' 626 default: '',
627 // Optional, to hide a field depending on the current form state
628 // liveVideo is in the options object when the user is creating/updating a live
629 // videoToUpdate is in the options object when the user is updating a video
630 hidden: ({ formValues, videoToUpdate, liveVideo }) => {
631 return formValues.pluginData['other-field'] === 'toto'
632 }
627 } 633 }
628 634
629 for (const type of [ 'upload', 'import-url', 'import-torrent', 'update', 'go-live' ]) { 635 for (const type of [ 'upload', 'import-url', 'import-torrent', 'update', 'go-live' ]) {