const orientation = args.orientation || "w";
const markArray = getMarkArray(args.marks);
const shadowArray = getShadowArray(args.shadow);
+ const vr = new V(); //just for pieces images paths
let boardDiv = "";
const [startX, startY, inc] =
orientation == "w" ? [0, 0, 1] : [V.size.x - 1, V.size.y - 1, -1];
boardDiv +=
"<img " +
"src='/images/pieces/" +
- V.getPpath(board[i][j]) +
- ".svg' " +
+ vr.getPpath(board[i][j], null, null, orientation) +
+ V.IMAGE_EXTENSION + "' " +
"class='piece'/>";
}
if (markArray.length > 0 && markArray[i][j])
- boardDiv += "<img src='/images/mark.svg' class='mark-square'/>";
+ boardDiv += "<img src='/images/diag_mark.svg' class='mark-square'/>";
boardDiv += "</div>";
}
boardDiv += "</div>";
}
return boardDiv;
}
+
+// Method to replace diagrams in loaded HTML
+export function replaceByDiag(match, p1, p2) {
+ const diagParts = p2.split(" ");
+ return getDiagram({
+ position: diagParts[0],
+ marks: diagParts[1],
+ orientation: diagParts[2],
+ shadow: diagParts[3]
+ });
+}