מדיה ויקי:Gadget-pgnviewer.js: הבדלים בין גרסאות בדף

יכול להופיע כמה פעמים בנוטציה
אחידות
שורה 335: שורה 335:
notation = move.s,
notation = move.s,
turn = move.turn,
turn = move.turn,
pieces = config && config.translate && config.translate.pieces,
piece = config && config.translate && config.translate.piece,
file = config && config.translate && config.translate.file,
file = config && config.translate && config.translate.file,
row = config && config.translate && config.translate.row;
row = config && config.translate && config.translate.row;
if (pieces) {
if (piece) {
pieces =  pieces.white && turn == 'l'
piece =  piece.white && turn == 'l'
|| pieces.black && turn == 'd'
|| piece.black && turn == 'd'
|| pieces;
|| piece;
try {
try {
notation = notation.replace(/[RNBQK]/, function(c) { return pieces[c]; } );
notation = notation.replace(/[RNBQK]/, function(c) { return piece[c]; } );
} catch (e) {
} catch (e) {
mw.log('bad config.translate.pieces');
mw.log('bad config.translate.pieces');
שורה 436: שורה 436:
   
   
Game.prototype.clearPieceAt = function(file, row) {
Game.prototype.clearPieceAt = function(file, row) {
var
var piece = this.pieceAt(file, row);
piece = this.pieceAt(file, row);
if (piece)
if (piece)
piece.remove();
piece.remove();