MediaWiki:Gadget-toplinksDropdown.js: Difference between revisions

From [N8]
Jump to navigation Jump to search
Created page with "/** * De-clutters the personal links at the top by collecting them in a dropdown, * opened by hovering over your username - inspired by the Timeless skin * * @author Banri..."
 
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 20: Line 20:
                     $('#pt-watchlist'),
                     $('#pt-watchlist'),
                     $('#pt-preferences'),
                     $('#pt-preferences'),
                    $('#pt-sandbox'),
                     $('#pt-logout')
                     $('#pt-logout')
                 )
                 )

Latest revision as of 21:27, 10 March 2020

/**
 * De-clutters the personal links at the top by collecting them in a dropdown,
 * opened by hovering over your username - inspired by the Timeless skin
 *
 * @author Banri
 */

$(function() {
    // change new message text
    $('#pt-mytalk .mw-echo-alert').text('Talk!');
    
    // create dropdown
    $('<div>')
        .addClass('pt-userpage-dropdown')
        .append(
            $('<ul>')
                .append(
                    $('#pt-mytalk'),
                    $('#pt-mycontris'),
                    $('#pt-watchlist'),
                    $('#pt-preferences'),
                    $('#pt-sandbox'),
                    $('#pt-logout')
                )
        )
        .appendTo('#pt-userpage');
});