Adding 404 image and styles

This commit is contained in:
ICabaleiro 2020-02-21 16:49:22 +00:00
parent ddbb365d46
commit 84496a8a93
3 changed files with 25 additions and 1 deletions

View file

@ -4,8 +4,10 @@ function register ({ registerHook, peertubeHelpers }) {
const filterUrl = baseStaticUrl + '/images/filter_black.png';
const keyboardUrl = baseStaticUrl + '/images/keyboard_black.png';
const languagesUrl = baseStaticUrl + '/images/languages_black.png';
const image404 = baseStaticUrl + '/images/404.svg'
const style = document.createElement('style')
document.head.appendChild(style)
// STYLES START
const sheet = style.sheet
// Change filter icon
let rule = "#custom-css .icon.icon-filter { "
@ -22,7 +24,22 @@ function register ({ registerHook, peertubeHelpers }) {
rule+= " background-image: url('"+ keyboardUrl +"'); -webkit-filter: none; filter: none"
rule+= " } "
sheet.insertRule(rule, 0)
// END
// STYLES END
/* ANGULAR NAVIGATION-END */
registerHook({
target: 'action:router.navigation-end',
handler: params => {
console.warn("======= INJECTING 404 ====== path is:", params.path)
if(document.querySelector('my-page-not-found')){
const img = document.querySelector('my-page-not-found').querySelector('img')
if(img){
console.log("REACHING THE POINT!!!!!!")
img.src = image404
}
}
}
})
}
export {