Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
No edit summary
mNo edit summary
Line 12: Line 12:
     if ($redirect.length) {
     if ($redirect.length) {
         var from = $redirect.text().trim();
         var from = $redirect.text().trim();
         $('[role="tab"]').each(function() {
         $('[role="tabpanel"]').each(function() {
             var panelId = $(this).attr('aria-controls') || '';
             var panelText = $(this).text();
            var cleanName = from.replace(/ /g, '_');
             if (panelText.indexOf(from) !== -1) {
             if (panelId.indexOf(cleanName) !== -1) {
                 var panelId = $(this).attr('id');
                 $(this).click();
                $('[aria-controls="' + panelId + '"]').click();
                 return false;
                 return false;
             }
             }

Revision as of 20:57, 3 April 2026

/* Any JavaScript here will be loaded for all users on every page load. */
$(function() {
    $('[accesskey="t"]').removeAttr('accesskey');
    $('[accesskey="n"]').removeAttr('accesskey');
    $('#pt-mytalk').remove();
    $('#ca-talk').remove();
    $('#ca-addsection').remove();
});

$(function() {
    var $redirect = $('div.mw-redirectedfrom a');
    if ($redirect.length) {
        var from = $redirect.text().trim();
        $('[role="tabpanel"]').each(function() {
            var panelText = $(this).text();
            if (panelText.indexOf(from) !== -1) {
                var panelId = $(this).attr('id');
                $('[aria-controls="' + panelId + '"]').click();
                return false;
            }
        });
    }
});