27 lines
635 B
Plaintext
27 lines
635 B
Plaintext
|
doctype html
|
||
|
html
|
||
|
head
|
||
|
body
|
||
|
input#url(placeholder = 'URL to grab')
|
||
|
button#send Pull
|
||
|
#downloaded
|
||
|
#todownload
|
||
|
script.
|
||
|
var ws=null;
|
||
|
function ensurews() {
|
||
|
if(ws) return ws;
|
||
|
ws = new WebSocket('ws://localhost:8080');
|
||
|
return ws;
|
||
|
}
|
||
|
var urlElem = document.querySelector('#url')
|
||
|
var sendElem = document.querySelector('#send')
|
||
|
var downloadedElem = document.querySelector('#downloaded')
|
||
|
var todownloadElem = document.querySelector('#todownload')
|
||
|
sendElem.addEventListener('click',()=>{
|
||
|
|
||
|
});
|
||
|
function timeout(ms) {
|
||
|
return new Promise(r=>setTimeout(r,ms));
|
||
|
}
|
||
|
ws.on('message',event=>{
|