diff options
Diffstat (limited to 'support/doc/plugins')
-rw-r--r-- | support/doc/plugins/guide.md | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index 568c0662f..072c7c6ca 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md | |||
@@ -180,6 +180,15 @@ function register (...) { | |||
180 | type: 'input', | 180 | type: 'input', |
181 | // type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 'select' | 'html' | 181 | // type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 'select' | 'html' |
182 | 182 | ||
183 | // If type: 'select', give the select available options | ||
184 | options: [ | ||
185 | { label: 'Label 1', value: 'value1' }, | ||
186 | { label: 'Label 2', value: 'value2' } | ||
187 | ], | ||
188 | |||
189 | // If type: 'html', set the HTML that will be injected in the page | ||
190 | html: '<strong class="...">Hello</strong><br /><br />' | ||
191 | |||
183 | // Optional | 192 | // Optional |
184 | descriptionHTML: 'The purpose of this field is...', | 193 | descriptionHTML: 'The purpose of this field is...', |
185 | 194 | ||
@@ -196,7 +205,7 @@ function register (...) { | |||
196 | result['admin-name] | 205 | result['admin-name] |
197 | 206 | ||
198 | settingsManager.onSettingsChange(settings => { | 207 | settingsManager.onSettingsChange(settings => { |
199 | settings['admin-name]) | 208 | settings['admin-name'] |
200 | }) | 209 | }) |
201 | } | 210 | } |
202 | ``` | 211 | ``` |
@@ -234,21 +243,29 @@ function register ({ | |||
234 | 243 | ||
235 | #### Update video constants | 244 | #### Update video constants |
236 | 245 | ||
237 | You can add/delete video categories, licences or languages using the appropriate managers: | 246 | You can add/delete video categories, licences or languages using the appropriate constant managers: |
238 | 247 | ||
239 | ```js | 248 | ```js |
240 | function register (...) { | 249 | function register ({ |
241 | videoLanguageManager.addLanguage('al_bhed', 'Al Bhed') | 250 | videoLanguageManager, |
242 | videoLanguageManager.deleteLanguage('fr') | 251 | videoCategoryManager, |
252 | videoLicenceManager, | ||
253 | videoPrivacyManager, | ||
254 | playlistPrivacyManager | ||
255 | }) { | ||
256 | videoLanguageManager.addConstant('al_bhed', 'Al Bhed') | ||
257 | videoLanguageManager.deleteConstant('fr') | ||
243 | 258 | ||
244 | videoCategoryManager.addCategory(42, 'Best category') | 259 | videoCategoryManager.addConstant(42, 'Best category') |
245 | videoCategoryManager.deleteCategory(1) // Music | 260 | videoCategoryManager.deleteConstant(1) // Music |
261 | videoCategoryManager.resetConstants() // Reset to initial categories | ||
262 | videoCategoryManager.getConstants() // Retrieve all category constants | ||
246 | 263 | ||
247 | videoLicenceManager.addLicence(42, 'Best licence') | 264 | videoLicenceManager.addConstant(42, 'Best licence') |
248 | videoLicenceManager.deleteLicence(7) // Public domain | 265 | videoLicenceManager.deleteConstant(7) // Public domain |
249 | 266 | ||
250 | videoPrivacyManager.deletePrivacy(2) // Remove Unlisted video privacy | 267 | videoPrivacyManager.deleteConstant(2) // Remove Unlisted video privacy |
251 | playlistPrivacyManager.deletePlaylistPrivacy(3) // Remove Private video playlist privacy | 268 | playlistPrivacyManager.deleteConstant(3) // Remove Private video playlist privacy |
252 | } | 269 | } |
253 | ``` | 270 | ``` |
254 | 271 | ||