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

??
DK
שורה 54: שורה 54:
function indexOfMoveNotation(notation) {
function indexOfMoveNotation(notation) {
var match = notation.match( /(\d+)([ld])/ );
var match = notation.match( /(\d+)([ld])/ );
if (match) return parseInt( match[1] ) + ( match[2] === 'l' ? 1 : 2 );
if (match) return parseInt( match[1] ) * 2 + ( match[2] === 'l' ? 1 : 2 );
return 0;
return 0;
}
}