}\r
\r
if (legal)\r
+ {\r
+ canClick = false;\r
$.ajax({url : "/cgi-bin/qchess.cgi", data : {x : id[0], y : id[1]}}).done(function(data) {$(this).update(data)});\r
+ }\r
});\r
\r
$.fn.showMoves = function()\r
$(this).html(emptyHTML);\r
\r
// Collapse into quantum state if on a black square\r
- if ((dest.getX() + dest.getY()) % 2 != 0 && (dest.html()[0] == '?' || dest.html()[dest.html().length-1] == '?'))\r
+ if ((dest.getX() + dest.getY()) % 2 != 0 && (dest.html()[0] == '?' || dest.html()[dest.html().length-1] != dest.html()[0]))\r
{\r
oldHTML = dest.html();\r
dest.html(oldHTML.replace(/<bold>.*<\/bold>/i, "<bold>?</bold>"));\r
{\r
console.log("AJAX Response:\n"+data);\r
var lines = data.split("\n");\r
+ var timeout = false;\r
for (var i = 0; i < lines.length; ++i)\r
{\r
var tokens = lines[i].split(" ");\r
if (s1.html()[4] != '0')\r
{\r
s2 = $("#board").find("#"+tokens[3]+tokens[4]);\r
- canClick = false;\r
+ timeout = true;\r
setTimeout((function(x) \r
{\r
return function() \r
break;\r
}\r
}\r
+ if (timeout == false)\r
+ canClick = true;\r
}\r
\r
//Reset the colour of a square\r