MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
 
(31 intermediate revisions by the same user not shown)
Line 1,298: Line 1,298:
                             '?action=query&format=json&formatversion=2' +
                             '?action=query&format=json&formatversion=2' +
                             '&generator=prefixsearch' +
                             '&generator=prefixsearch' +
                             '&gpsnamespace=0&gpslimit=10';
                             '&gpsnamespace=0&gpslimit=50';


                     }
                     }
Line 1,371: Line 1,371:
$(function () {
$(function () {


    // Only for mobile Minerva skin
     if (mw.config.get('skin') !== 'minerva') {
     if (mw.config.get('skin') !== 'minerva') {
         return;
         return;
     }
     }


     var $content = $('.mw-parser-output');
     var title = $('p').filter(function () {
        return $(this).text().trim() === 'કાવ્ય, ભજન';
    }).first();
 
    var booksHeading = $('.wst-center.tiInherit').first();


     if (!$content.length) {
     if (title.length && booksHeading.length) {
         return;
         title.insertAfter(booksHeading);
     }
     }


    // Find author block
});
     var $author = $content.children('p').filter(function () {
 
        return $(this).find('span[style*="float:right"]').length > 0;
/*---------------------------22-06-2026---------------------------------------*/
    }).first();
$(function () {
 
     $('.ekatra-right-author').each(function () {
 
        // Remove blank <p> inside Poem2 after author
        $(this).nextAll('p').each(function () {
            var html = $.trim($(this).html());
 
            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');


    // Find article content block
        if (p.length && p.find('br').length) {
    var $poem = $content.children('.Poem2-Ekatra').first();
            p.remove();
        }


     if ($author.length && $poem.length) {
     });
        $author.insertAfter($poem);
    }


});
});