Skip to content

Commit

Permalink
Many css fixes to be compatible with default WP theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Toomas Romer committed Aug 28, 2015
1 parent dacc76e commit da19a29
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/main/board.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Copyright 2008-2015 Toomas Römer
*
*
* Licensed under the Apache License, Version 2.0 (the "License") you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
Expand Down Expand Up @@ -51,7 +51,7 @@ function Board(divId, options) {
this.opts['background'] = '#fff';

this.opts['commentFontSize'] = "8pt";
this.opts['commentFontColor'] = "#6060df";
this.opts['commentFontColor'] = "#006699";
this.opts['commentFont'] = 'Tahoma, Arial, sans-serif';

this.opts['boardSize'] = '257px';
Expand Down Expand Up @@ -143,8 +143,8 @@ function Board(divId, options) {

// toplevel table;
var topTable = resetStyles(document.createElement("table"));
topTable.style.width = (parseInt(this.opts['boardSize']) + 15) + "px";
topTable.style.height = (parseInt(this.opts['boardSize']) + 15) + "px";
topTable.style.width = parseInt(this.opts['boardSize']) + "px";
topTable.style.height = parseInt(this.opts['boardSize']) + "px";
topLeftTd.appendChild(topTable);
topTable.border = 0;
var topTableTb = document.createElement("tbody");
Expand Down Expand Up @@ -780,7 +780,7 @@ function Board(divId, options) {

for (var i = 0; i < tmp2.length; i++) {
if (tmp2[i].white != null) {
link = document.createElement("a");
link = resetStyles(document.createElement("a"));
tmp = document.createTextNode(tmp2[i].white);
tmp3 = document.createElement("b");

Expand Down Expand Up @@ -809,7 +809,7 @@ function Board(divId, options) {
tmp4.style.fontFamily = this.opts['commentFont'];
tmp4.style.fontSize = this.opts['commentFontSize'];
tmp4.style.color = this.opts['commentFontColor'];
tmp4.appendChild(document.createTextNode(comment[0]));
tmp4.appendChild(document.createTextNode(" "+comment[0]));
cont.appendChild(tmp4);
lastMoveIdx = comment[1];
}
Expand All @@ -820,7 +820,7 @@ function Board(divId, options) {
if (tmp2[i].black != null) {
cont.appendChild(document.createTextNode(" "));
tmp = document.createTextNode(tmp2[i].black);
link = document.createElement("a");
link = resetStyles(document.createElement("a"));
link.style.fontFamily = this.opts['moveFont'];
link.style.fontSize = this.opts['moveFontSize'];
link.style.color = this.opts['moveFontColor'];
Expand All @@ -838,7 +838,7 @@ function Board(divId, options) {
tmp4.style.fontFamily = this.opts['commentFont'];
tmp4.style.fontSize = this.opts['commentFontSize'];
tmp4.style.color = this.opts['commentFontColor'];
tmp4.appendChild(document.createTextNode(comment[0]));
tmp4.appendChild(document.createTextNode(" "+comment[0]));
cont.appendChild(tmp4);
lastMoveIdx = comment[1];
}
Expand Down Expand Up @@ -942,6 +942,7 @@ function Board(divId, options) {
var src = prefix + imageNames[color][piece];
var img = resetStyles(document.createElement("img"));
img.style.border = "0px solid #cccccc";
img.style.display = "inline";

if (/\.png$/.test(img.src.toLowerCase())
&& navigator.userAgent.toLowerCase().indexOf("msie") != -1) {
Expand Down Expand Up @@ -1078,5 +1079,6 @@ function resetStyles(obj) {
obj.style.verticalAlign = "middle";
obj.style.textAlign = "center";
obj.style.borderCollapse = "separate";
obj.style.lineHeight = "normal";
return obj;
}

0 comments on commit da19a29

Please sign in to comment.