MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 99: Line 99:
if( countPoem2.length > 0 ){
if( countPoem2.length > 0 ){
for (let j = 0; j < countPoem2.length; j++) {
var Poem2lenghtArray = [];
for (var k = 0; k <= countPoem2.length; k++) {
  Poem2lenghtArray.push(k);
}
Poem2lenghtArray.forEach(function(j) {
var poemElement = $(".Poem2-Ekatra").eq(j);
var poemElement = $(".Poem2-Ekatra").eq(j);
Line 111: Line 117:
// First measure
// First measure
poemArray.forEach(appendIndent);
poemArray.forEach( function(i) {
poemElement.append( '<p style="text-indent: 2em;">' + i + '</p>' );
});
// Second measure
// Second measure
poemElement.children('p').each(appendCssIndent);
poemElement.children('p').each(function () {
$(this).css('text-indent', '2em');
});
}
}
}
});
}
function appendIndent(i){
return poemElement.append( '<p style="text-indent: 2em;">' + i + '</p>' );
}
function appendCssIndent(){
return $(this).css('text-indent', '2em');
}
}
});
});