site-manual-notifier/content/display.md

33 lines
1.1 KiB
Markdown
Raw Normal View History

2020-07-03 06:20:15 +00:00
---
title: Display Page
2020-07-03 06:49:20 +00:00
description: This is a page that displays scrolling texts
---
<script>
function addJS(name) {
var fileref=document.createElement('script');
fileref.setAttribute('type','text/javascript');
fileref.setAttribute('src', name);
document.head.appendChild(fileref);
}
function addCSS(name) {
var fileref=document.createElement('link');
fileref.setAttribute('rel', 'stylesheet');
fileref.setAttribute('type', 'text/css');
fileref.setAttribute('href', filename);
document.head.appendChild(fileref);
}
var stylesheet = Array.from(document.getElementsByTagName('link')).filter(x=>x.getAttribute('rel')=='stylesheet')[0];
stylesheet.parentElement.removeChild(stylesheet);
function eraseCanvas() {
for (var headNode of Array.from(document.head.getElementsByTagName('script')))
document.head.removeChild(headNode);
for (var childNode of Array.from(document.body.childNodes))
document.body.removeChild(childNode);
document.body.removeAttribute('class')
}
setTimeout(()=>{
eraseCanvas();
addJS('/js/display.js');
}, 10);
</script>