MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1,391: Line 1,391:


     $('.ekatra-right-author').each(function () {
     $('.ekatra-right-author').each(function () {
        $(this).nextAll('p').filter(function () {
            return $.trim($(this).text()) === '';
        }).first().remove();
    });


    $('div.header-mainblock').each(function () {
        // Remove blank <p> inside Poem2 after author
        var $prev = $(this).prev();
        $(this).nextAll('p').each(function () {
        if ($prev.is('p') && !$prev.text().trim() && $prev.find('br').length) {
            var html = $.trim($(this).html());
             $prev.remove();
 
            if (html === '' || html === '<br>' || html === '<br/>' || html === '<br />') {
                $(this).remove();
            } else {
                return false;
            }
        });
 
        // Remove blank <p><br></p> after Poem2 block
        var p = $(this).closest('.Poem2-Ekatra').next('p');
 
        if (p.length && p.find('br').length) {
             p.remove();
         }
         }
     });
     });


});
});