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

22 lines
542 B
JavaScript
Raw Normal View History

2019-07-16 09:53:38 +00:00
function register ({ registerHook, peertubeHelpers }) {
registerHook({
target: 'action:application.loaded',
2019-07-16 14:00:11 +00:00
handler: () => onApplicationLoaded(peertubeHelpers)
2019-07-16 09:53:38 +00:00
})
}
export {
register
}
2019-07-16 14:00:11 +00:00
function onApplicationLoaded (peertubeHelpers) {
console.log('Hello application world')
const baseStaticUrl = peertubeHelpers.getBaseStaticRoute()
const imageUrl = baseStaticUrl + '/images/chocobo.png'
const topLeftBlock = document.querySelector('.top-left-block')
topLeftBlock.style.backgroundImage = 'url(' + imageUrl + ')'
}