peertube-theme-nctv-dark/peertube-plugin-hello-world/client/search-client-plugin.js

54 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-07-22 14:40:52 +00:00
function register ({ registerHook, peertubeHelpers }) {
registerHook({
target: 'action:search.init',
handler: () => console.log('Search init')
})
registerHook({
target: 'filter:api.search.videos.list.result',
handler: result => {
result.data.forEach(v => v.name += ' SEARCH')
return {
total: result.total,
data: result.data
}
}
})
registerHook({
target: 'filter:api.search.video-channels.list.result',
handler: result => {
result.data.forEach(v => v.displayName += ' :p')
return {
total: result.total,
data: result.data
}
}
})
2020-04-15 14:13:04 +00:00
peertubeHelpers.showModal({
title: 'my super modal',
content: 'hello, do you like my modal?',
close: true,
cancel: {
value: 'Cancel',
action: () => console.log('Canceled')
},
confirm: {
value: 'Confirm',
action: () => console.log('Confirmed')
}
})
2020-04-24 12:25:43 +00:00
peertubeHelpers.markdownRenderer.textMarkdownToHTML('**My Bold Text**')
.then(v => console.log(v))
2019-07-22 14:40:52 +00:00
}
export {
register
}