chiark / gitweb /
TODO etc.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Jun 2020 18:48:33 +0000 (19:48 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 14 Jun 2020 18:48:33 +0000 (19:48 +0100)
TODO
templates/script.js

diff --git a/TODO b/TODO
index 0ce6a99b86b467ede747fbe8647d81829aefdb6d..bfab9fa76d8b8138bdf83ea28867316a4bad4c1c 100644 (file)
--- 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
index 50ce4be290e9a5bef6f5ae1317a0a71b89bc4729..72d45425013efa1817756c92ed1cc16702e750f0 100644 (file)
@@ -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) {