@ -58,9 +58,9 @@ xhr.send(null);
var h1TN = statusm [ 1 ] ;
var h1TN = statusm [ 1 ] ;
var h2TN = statusm [ 2 ] ;
var h2TN = statusm [ 2 ] ;
h2 . innerHTML = h2TN ;
h2 . innerHTML = h2TN ;
document . body . insertBefore ( h2 , I ( 'board' ) ) ;
I ( 'main' ) . insertBefore ( h2 , I ( 'board' ) ) ;
h1 . innerHTML = h1TN ;
h1 . innerHTML = h1TN ;
document . body . insertBefore ( h1 , h2 ) ;
I ( 'main' ) . insertBefore ( h1 , h2 ) ;
xhr . onload = function ( ) {
xhr . onload = function ( ) {
if ( xhr . status === 200 ) {
if ( xhr . status === 200 ) {
@ -86,9 +86,9 @@ var h1TN = statusm[0];
var h2TN = statusm [ 2 ] ;
var h2TN = statusm [ 2 ] ;
}
}
h2 . innerHTML = h2TN ;
h2 . innerHTML = h2TN ;
document . body . insertBefore ( h2 , I ( 'board' ) ) ;
I ( 'main' ) . insertBefore ( h2 , I ( 'board' ) ) ;
h1 . innerHTML = h1TN ;
h1 . innerHTML = h1TN ;
document . body . insertBefore ( h1 , h2 ) ;
I ( 'main' ) . insertBefore ( h1 , h2 ) ;
if ( responseObject . Black . status . length === 6 ) {
if ( responseObject . Black . status . length === 6 ) {
if ( responseObject . Black . status [ 5 ] === 4 ) {
if ( responseObject . Black . status [ 5 ] === 4 ) {
@ -105,9 +105,9 @@ var h1TN = statusm[5];
var h2TN = 'Black took your king.' ;
var h2TN = 'Black took your king.' ;
}
}
h2 . innerHTML = h2TN ;
h2 . innerHTML = h2TN ;
document . body . insertBefore ( h2 , I ( 'board' ) ) ;
I ( 'main' ) . insertBefore ( h2 , I ( 'board' ) ) ;
h1 . innerHTML = h1TN ;
h1 . innerHTML = h1TN ;
document . body . insertBefore ( h1 , h2 ) ;
I ( 'main' ) . insertBefore ( h1 , h2 ) ;
}
}
// else {
// else {
//var h1TN = statusm[1];
//var h1TN = statusm[1];
@ -169,7 +169,7 @@ if (responseObject.White.status[0] === 1) { // TODO: Replace for a (temporary) s
//ol.setAttribute('id', 'moves');
//ol.setAttribute('id', 'moves');
var section = document . createElement ( 'section' ) ;
var section = document . createElement ( 'section' ) ;
section . setAttribute ( 'id' , 'log' ) ;
section . setAttribute ( 'id' , 'log' ) ;
document . body . insertBefore ( section , I ( 'board' ) ) ;
I ( 'main' ) . appendChild ( section ) ;
//d = document.createElement('ol');
//d = document.createElement('ol');
section . appendChild ( d ) ;
section . appendChild ( d ) ;
//d.appendChild(ol);
//d.appendChild(ol);
@ -249,7 +249,7 @@ d.appendChild(li);
} else {
} else {
var h1TN = statusm [ 0 ] ;
var h1TN = statusm [ 0 ] ;
h1 . innerHTML = h1TN ;
h1 . innerHTML = h1TN ;
document . body . insertBefore ( h1 , h2 ) ;
I ( 'main' ) . insertBefore ( h1 , h2 ) ;
var h2TN = statusm [ 3 ] ;
var h2TN = statusm [ 3 ] ;
if ( count > 1 ) {
if ( count > 1 ) {
if ( count > 3 ) {
if ( count > 3 ) {
@ -261,7 +261,7 @@ h2.innerHTML = h2TN + ' for the ' + count + '<sup>' + suffix + '</sup>' + ' time
} else {
} else {
h2 . innerHTML = h2TN ;
h2 . innerHTML = h2TN ;
}
}
document . body . insertBefore ( h2 , I ( 'board' ) ) ;
I ( 'main' ) . insertBefore ( h2 , I ( 'board' ) ) ;
count ++ ;
count ++ ;
}
}
// TODO: Display status and/or sleep.
// TODO: Display status and/or sleep.
@ -274,9 +274,9 @@ count++;
var h1TN = statusm [ 8 ] ;
var h1TN = statusm [ 8 ] ;
var h2TN = statusm [ 9 ] ;
var h2TN = statusm [ 9 ] ;
h2 . innerHTML = h2TN ;
h2 . innerHTML = h2TN ;
document . body . insertBefore ( h2 , I ( 'board' ) ) ;
I ( 'main' ) . insertBefore ( h2 , I ( 'board' ) ) ;
h1 . innerHTML = h1TN ;
h1 . innerHTML = h1TN ;
document . body . insertBefore ( h1 , h2 ) ;
I ( 'main' ) . insertBefore ( h1 , h2 ) ;
}
}
}
}
}
}