Add user hooks in hello world
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
function register ({ registerVideoField }) {
|
||||
function register ({ registerHook, registerVideoField }) {
|
||||
console.log('loading video edit stuff')
|
||||
|
||||
{
|
||||
@ -13,6 +13,35 @@ function register ({ registerVideoField }) {
|
||||
registerVideoField(commonOptions, { type })
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
const hooks = [
|
||||
'action:video-upload.init',
|
||||
'action:video-url-import.init',
|
||||
'action:video-torrent-import.init',
|
||||
'action:go-live.init'
|
||||
]
|
||||
|
||||
for (const h of hooks) {
|
||||
registerHook({
|
||||
target: h,
|
||||
handler: () => {
|
||||
const event = new Event('change', {
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
});
|
||||
const selects = document.querySelectorAll('label[for=first-step-privacy] + my-select-options')
|
||||
|
||||
console.log(selects)
|
||||
|
||||
selects.forEach(s => {
|
||||
s.value = 2 // Unlisted
|
||||
s.dispatchEvent(event)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
|
Reference in New Issue
Block a user