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
mNo edit summary
No edit summary
Line 9: Line 9:


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

Revision as of 21:10, 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() {
    setTimeout(function() {
        var $redirect = $('span.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');
                    var tab = document.querySelector('[aria-controls="' + panelId + '"]');
                    if (tab) {
                        tab.click();
                    }
                    return false;
                }
            });
        }
    }, 500);
});