MediaWiki:BibleGet.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 147: Line 147:
//TODO: shouldn't we do this any time it's the first node within a verseText node, since it follows a verseNum?
//TODO: shouldn't we do this any time it's the first node within a verseText node, since it follows a verseNum?


jQuery(this).contents().first().filter(function(){
return (
this.nodeType === 1 && (
jQuery(this).hasClass('pof') && jQuery(this).parent('.verseText').prevAll('.verseText').length > 0
)
)
}).parent('.verseText').prev('.verseNum').before('<br>');
//HERE IS THE LOGIC:
//IF the (first node) following a .verseText node is not a text node,
//AND it IS an element node with class pof  
//AND this is not the first .verseText node of a chapter
//THEN add a newline before the preceding .verseNum node containing the verse number
jQuery(this).contents().first().filter(function(){
jQuery(this).contents().first().filter(function(){
return (
return (