From: Ian Jackson Date: Sun, 14 Jun 2020 18:48:33 +0000 (+0100) Subject: TODO etc. X-Git-Tag: otter-0.2.0~1583 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=329fc1c691b97f57cd8a7016c2204a8f122f5e48;p=otter.git TODO etc. --- diff --git a/TODO b/TODO index 0ce6a99b..bfab9fa7 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,9 @@ +communicate with server about moves + sync problem wrt xhr api grab call and ui updates + per-piece seq no? + client ? struct ? instance struct token in main url token in api queries dashedline around only things gotten -communicate with server about moves diff --git a/templates/script.js b/templates/script.js index 50ce4be2..72d45425 100644 --- a/templates/script.js +++ b/templates/script.js @@ -12,6 +12,17 @@ var our_dnd_type = "text/puvnex-game-server-dummy"; dragthresh = 5; space = document.getElementById('space'); +function new_xhr_then(good,bad) { + // xxx not yet finished?? + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function(){ + if (xhr.readyState != XMLHttpRequest.DONE) { return; } + if (xhr.status != 200) { bad(xhr); } + good(xhr); + }; + return xhr; +} + console.log('foo1'); function drag_mousedown(e) { @@ -27,6 +38,7 @@ function drag_mousedown(e) { dragging = false; window.addEventListener('mousemove', drag_mousemove, true); window.addEventListener('mouseup', drag_mouseup, true); + } function drag_mousemove(e) {