Update hello world

This commit is contained in:
Chocobozzz 2021-06-30 16:44:42 +02:00
parent ea025763fb
commit 7e43cb5f18
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
5 changed files with 62 additions and 19 deletions

View File

@ -80,6 +80,26 @@ function register ({ registerHook, registerSettingsScript, peertubeHelpers }) {
} }
}) })
registerHook({
target: 'filter:left-menu.links.create.result',
handler: (result) => {
return [
{
key: 'in-my-stuff',
title: 'In my stuff',
links: [
{
path: '/about',
icon: 'alert',
shortLabel: 'About',
label: 'About'
}
]
}
].concat(result)
}
})
// Router hooks // Router hooks
registerHook({ registerHook({

View File

@ -4,6 +4,14 @@ function register ({ registerHook, peertubeHelpers }) {
handler: () => alert('video loaded') handler: () => alert('video loaded')
}) })
registerHook({
target: 'filter:internal.player.videojs.options.result',
handler: (options) => {
options.poster = 'https://joinpeertube.org/img/brand-with-v3.png'
return options
}
})
console.log(peertubeHelpers.translate('toto')) console.log(peertubeHelpers.translate('toto'))
} }

View File

@ -20,9 +20,16 @@ function register ({ registerHook, registerVideoField }) {
} }
} }
const commonOptions3 = {
name: 'hello-world-field-3',
label: 'Super field 3',
type: 'input-checkbox'
}
for (const type of [ 'upload', 'import-url', 'update' ]) { for (const type of [ 'upload', 'import-url', 'update' ]) {
registerVideoField(commonOptions1, { type }) registerVideoField(commonOptions1, { type })
registerVideoField(commonOptions2, { type }) registerVideoField(commonOptions2, { type })
registerVideoField(commonOptions3, { type })
} }
} }

View File

@ -63,6 +63,14 @@ function register ({ registerHook, peertubeHelpers }) {
} }
}) })
registerHook({
target: 'filter:internal.player.videojs.options.result',
handler: (options) => {
options.poster = ''
return options
}
})
peertubeHelpers.notifier.info('you are on the watch page', 'useless', 1000) peertubeHelpers.notifier.info('you are on the watch page', 'useless', 1000)
} }

View File

@ -46,8 +46,7 @@ async function register ({
}) })
{ {
const fieldName = 'hello-world-field' for (const fieldName of [ 'hello-world-field', 'hello-world-field-2', 'hello-world-field-3' ]) {
registerHook({ registerHook({
target: 'action:api.video.updated', target: 'action:api.video.updated',
handler: ({ video, body }) => { handler: ({ video, body }) => {
@ -71,6 +70,7 @@ async function register ({
} }
}) })
} }
}
registerSetting({ registerSetting({
name: 'admin-name', name: 'admin-name',