Jump to content

MediaWiki:Common.js: Difference between revisions

From Global Wiki
No edit summary
No edit summary
Line 39: Line 39:
     }
     }
});
});




Line 45: Line 44:
     if (mw.config.get('wgPageName') === 'Prasad') {
     if (mw.config.get('wgPageName') === 'Prasad') {


         // Header (above page title)
         // Create the custom header box
         $('<div class="custom-header" style="background: #e0f7fa; padding: 10px; text-align: center; margin-bottom: 10px;">' +
         var customHeader = $('<div class="custom-header" style="background: #e0f7fa; padding: 10px; text-align: center; margin-bottom: 10px;">' +
             '<h2 style="margin: 5px 0;">🌟 Featured Profile</h2>' +
             '<h2 style="margin: 5px 0;">🌟 Featured Profile</h2>' +
             '<p style="margin: 0;">This is the official profile of Prasad Khanna.</p>' +
             '<p style="margin: 0;">This is the official profile of Prasad Khanna.</p>' +
          '</div>').insertBefore('#firstHeading');
        '</div>');
 
        // Insert the custom header ABOVE content and move the title BELOW it
        $('#firstHeading').before(customHeader);        // Add header box above the title
        $('#firstHeading').insertAfter(customHeader);   // Move title below the box


         // Footer (below content)
         // Add custom footer box after the content
         $('<div class="custom-footer" style="background: #f1f8e9; padding: 10px; text-align: center; margin-top: 20px;">' +
         $('<div class="custom-footer" style="background: #f1f8e9; padding: 10px; text-align: center; margin-top: 20px;">' +
             '<h3 style="margin: 5px 0;">📌 More About Prasad</h3>' +
             '<h3 style="margin: 5px 0;">📌 More About Prasad</h3>' +
             '<p style="margin: 0;">Scroll through his achievements, contributions, and recognitions below.</p>' +
             '<p style="margin: 0;">Scroll through his achievements, contributions, and recognitions below.</p>' +
          '</div>').insertAfter('#mw-content-text');
        '</div>').insertAfter('#mw-content-text');
     }
     }
});
});

Revision as of 11:33, 18 May 2025

/* Any JavaScript here will be loaded for all users on every page load. */
$(document).ready(function () {
    $('.mw-wiki-logo').parent('a').attr('href', '/wiki/Global_Wiki_Biographies');

    // ✅ Add viewport meta tag for mobile responsiveness (SEO)
    if ($('meta[name="viewport"]').length === 0) {
        $('head').append('<meta name="viewport" content="width=device-width, initial-scale=1">');
    }
});

$(document).ready(function() {
    if (mw.config.get('wgNamespaceNumber') === 120) {
        var warningHtml = '<div class="template-td" style="background-color: #ffcc00; color: black; padding: 10px; border-radius: 5px; font-weight: bold; text-align: center; margin-bottom:10px;">⚠ This is a draft article created for review. It is not yet published in the main space. Once approved, it will be moved to the main site and become publicly visible. ⚠</div>';
        
        // Insert after the subtitle, which is below the title and action tabs
        $('#mw-content-subtitle').after(warningHtml);
    }
});



$(document).ready(function() {
    var footerDisclaimer = $('<div style="text-align:center; font-size:12px; padding:10px; background:#f9f9f9; border-top:1px solid #ccc;">This website is not affiliated with Wikipedia or the Wikimedia Foundation. Content is independently published.</div>');
    $('#footer').append(footerDisclaimer);
});



$(document).ready(function () {
    if (mw.config.get("wgNamespaceNumber") === 0) { // Main/article pages only
        var title = $('#firstHeading');
        var badgeUrl = 'https://globalwiki.org/images/2/22/Verified.png';

        $('<img>', {
            src: badgeUrl,
            alt: 'Verified',
            style: 'margin-left: 10px; height: 20px; vertical-align: middle;'
        }).appendTo(title);
    }
});


$(document).ready(function () {
    if (mw.config.get('wgPageName') === 'Prasad') {

        // Create the custom header box
        var customHeader = $('<div class="custom-header" style="background: #e0f7fa; padding: 10px; text-align: center; margin-bottom: 10px;">' +
            '<h2 style="margin: 5px 0;">🌟 Featured Profile</h2>' +
            '<p style="margin: 0;">This is the official profile of Prasad Khanna.</p>' +
        '</div>');

        // Insert the custom header ABOVE content and move the title BELOW it
        $('#firstHeading').before(customHeader);         // Add header box above the title
        $('#firstHeading').insertAfter(customHeader);    // Move title below the box

        // Add custom footer box after the content
        $('<div class="custom-footer" style="background: #f1f8e9; padding: 10px; text-align: center; margin-top: 20px;">' +
            '<h3 style="margin: 5px 0;">📌 More About Prasad</h3>' +
            '<p style="margin: 0;">Scroll through his achievements, contributions, and recognitions below.</p>' +
        '</div>').insertAfter('#mw-content-text');
    }
});