MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
 
(43 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,351: Line 1,351:


/*----------------------------5-6-2026---------------------------------------*/
/*----------------------------5-6-2026---------------------------------------*/
$(document).ready(function () {
$(function () {


     if (mw.config.get('skin') !== 'minerva') {
     if (mw.config.get('skin') !== 'minerva') {
Line 1,357: Line 1,357:
     }
     }


     $('.pre-content .page-heading').each(function () {
     var title = mw.config.get('wgTitle') || '';
 
    if (title.indexOf('/') !== -1) {
 
        $('head').append(
            '<style>@media only screen and (max-width:767px){#firstHeading{display:none!important;}}</style>'
        );
 
    }
 
});
/*----------------------------8-6-2026---------------------------------------*/
$(function () {
 
    if (mw.config.get('skin') !== 'minerva') {
        return;
    }
 
    var title = $('p').filter(function () {
        return $(this).text().trim() === 'કાવ્ય, ભજન';
    }).first();
 
    var booksHeading = $('.wst-center.tiInherit').first();
 
    if (title.length && booksHeading.length) {
        title.insertAfter(booksHeading);
    }
 
});
 
/*---------------------------22-06-2026---------------------------------------*/
$(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;
            }
        });


         var $heading = $(this);
        // Remove blank <p><br></p> after Poem2 block
        var $breadcrumb = $heading.next('p');
         var p = $(this).closest('.Poem2-Ekatra').next('p');


        // Check if next element is breadcrumb containing a link
         if (p.length && p.find('br').length) {
         if ($breadcrumb.length && $breadcrumb.find('a').length) {
             p.remove();
             $heading.hide();
         }
         }