מדיה ויקי:Gadget-pgnviewer.js: הבדלים בין גרסאות בדף
יכול להופיע כמה פעמים בנוטציה |
אחידות |
||
| שורה 335: | שורה 335: | ||
notation = move.s, | notation = move.s, | ||
turn = move.turn, | turn = move.turn, | ||
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 ( | if (piece) { | ||
piece = piece.white && turn == 'l' | |||
|| | || piece.black && turn == 'd' | ||
|| | || piece; | ||
try { | try { | ||
notation = notation.replace(/[RNBQK]/, function(c) { return | 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); | ||
if (piece) | if (piece) | ||
piece.remove(); | piece.remove(); | ||