Skip to content

Commit f24ea7b

Browse files
committed
update webxdc.js
1 parent 6ed5164 commit f24ea7b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

webxdc.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ window.webxdc = (() => {
2525
return {
2626
selfAddr: params.get("addr") || "device0@local.host",
2727
selfName: params.get("name") || "device0",
28-
setUpdateListener: (cb, serial) => {
28+
setUpdateListener: (cb, serial = 0) => {
2929
var updates = getUpdates();
3030
var maxSerial = updates.length;
3131
updates.forEach((update) => {
@@ -35,6 +35,7 @@ window.webxdc = (() => {
3535
}
3636
});
3737
updateListener = cb;
38+
return Promise.resolve()
3839
},
3940
getAllUpdates: () => {
4041
console.log('[Webxdc] WARNING: getAllUpdates() is deprecated.');
@@ -75,7 +76,7 @@ window.clearXdcStorage = () => {
7576
}
7677

7778
window.alterXdcApp = () => {
78-
var styleControlPanel = 'position: fixed; bottom:1em; left:1em; background-color: #000; opacity:0.8; padding:.5em; font-family: sans-serif; color:#fff; z-index: 9999';
79+
var styleControlPanel = 'position: fixed; bottom:1em; left:1em; background-color: #000; opacity:0.8; padding:.5em; font-size:16px; font-family: sans-serif; color:#fff; z-index: 9999';
7980
var styleMenuLink = 'color:#fff; text-decoration: none; vertical-align: middle';
8081
var styleAppIcon = 'height: 1.5em; width: 1.5em; margin-right: 0.5em; border-radius:10%; vertical-align: middle';
8182
var title = document.getElementsByTagName('title')[0];
@@ -88,10 +89,10 @@ window.alterXdcApp = () => {
8889
if (window.webxdc.selfName === "device0") {
8990
var div = document.createElement('div');
9091
div.innerHTML =
91-
'<div style="' + styleControlPanel + '">' +
92+
'<div id="webxdc-panel" style="' + styleControlPanel + '">' +
9293
'<a href="javascript:window.addXdcPeer();" style="' + styleMenuLink + '">Add Peer</a>' +
9394
'<span style="' + styleMenuLink + '"> | </span>' +
94-
'<a href="javascript:window.clearXdcStorage();" style="' + styleMenuLink + '">Clear Storage</a>' +
95+
'<a id="webxdc-panel-clear" href="javascript:window.clearXdcStorage();" style="' + styleMenuLink + '">Clear Storage</a>' +
9596
'<div>';
9697
var controlPanel = div.firstChild;
9798

0 commit comments

Comments
 (0)