From 329fc1c691b97f57cd8a7016c2204a8f122f5e48 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 14 Jun 2020 19:48:33 +0100 Subject: [PATCH] TODO etc. --- TODO | 5 ++++- templates/script.js | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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) { -- 2.30.2