diff --git a/webxdc.js b/webxdc.js index e46d0d7..acea8e6 100644 --- a/webxdc.js +++ b/webxdc.js @@ -61,8 +61,9 @@ window.clearXdcStorage = () => { } window.alterXdcApp = () => { - var styleControlPanel = 'position: fixed; bottom:1em; left:1em; background-color: #000; opacity:0.8; padding:.5em; font-family: sans-serif; width: 50%;color:#fff;'; - var styleMenuLink = 'color:#fff; text-decoration: none;'; + var styleControlPanel = 'position: fixed; bottom:1em; left:1em; background-color: #000; opacity:0.8; padding:.5em; font-family: sans-serif; color:#fff;'; + var styleMenuLink = 'color:#fff; text-decoration: none; vertical-align: middle'; + var styleAppIcon = 'height: 1.5em; width: 1.5em; margin-right: 0.5em; border-radius:10%; vertical-align: middle'; var title = document.getElementsByTagName('title')[0]; if (typeof title == 'undefined') { title = document.createElement('title'); @@ -74,10 +75,24 @@ window.alterXdcApp = () => { var div = document.createElement('div'); div.innerHTML = '
' + - 'Add Peer | ' + + 'Add Peer' + + ' | ' + 'Clear Storage' + '
'; - document.getElementsByTagName('body')[0].append(div.firstChild); + var controlPanel = div.firstChild; + + function loadIcon(name) { + var tester = new Image(); + tester.onload = () => { + div.innerHTML = ''; + controlPanel.insertBefore(div.firstChild, controlPanel.firstChild); + }; + tester.src = name; + } + loadIcon("icon.png"); + loadIcon("icon.jpg"); + + document.getElementsByTagName('body')[0].append(controlPanel); } }