41 lines
1.5 KiB
Markdown
41 lines
1.5 KiB
Markdown
---
|
|
title: Display Page
|
|
description: This is a page that displays the manual notification
|
|
---
|
|
|
|
<script>
|
|
function addJS(name) {
|
|
var node=document.createElement('script');
|
|
node.setAttribute('type','text/javascript');
|
|
node.setAttribute('src', name);
|
|
document.head.appendChild(node);
|
|
}
|
|
function addCSS(name) {
|
|
var node=document.createElement('link');
|
|
node.setAttribute('rel', 'stylesheet');
|
|
node.setAttribute('type', 'text/css');
|
|
node.setAttribute('href', name);
|
|
document.head.appendChild(node);
|
|
}
|
|
var searchArgsGetter = () => Object.fromEntries(window.location.search.substr(1).split('&').map(x=>[...x.split('='), ''].slice(0, 2).map(y=>decodeURIComponent(y))));
|
|
var searchArgs = searchArgsGetter();
|
|
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')
|
|
}
|
|
var nextStyle = document.createElement('style');
|
|
nextStyle.setAttribute('id', 'nextStyle');
|
|
document.head.appendChild(nextStyle);
|
|
test_display = !!searchArgs.test;
|
|
setTimeout(()=>{
|
|
eraseCanvas();
|
|
addCSS('/css/display.css');
|
|
addJS('/js/sharedWebSocket.js');
|
|
addJS('/js/display.js');
|
|
}, 10);
|
|
</script> |