MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
Line 1,369: Line 1,369:
});
});
/*----------------------------8-6-2026---------------------------------------*/
/*----------------------------8-6-2026---------------------------------------*/
$(function () {
$(window).on('load', 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');
     setTimeout(function () {


    if (!$content.length) {
        var author = document.querySelector(
         return;
            '.mw-parser-output > p span[style*="float:right"]'
    }
         );


    // Find author block
        var poem = document.querySelector(
    var $author = $content.children('p').filter(function () {
            '.mw-parser-output > .Poem2-Ekatra'
        return $(this).find('span[style*="float:right"]').length > 0;
        );
    }).first();


    // Find article content block
        if (author && poem) {
    var $poem = $content.children('.Poem2-Ekatra').first();
            var p = author.closest('p');
            poem.parentNode.insertBefore(p, poem.nextSibling);
            console.log('Author block moved');
        } else {
            console.log('Not found', author, poem);
        }


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


});
});