MediaWiki:Common.js

From YOU SEEM PRETTY SAD FOR A GIRL SO IN LOVE
Revision as of 08:32, 12 June 2026 by Sleepy (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
$(function () {
    // Only show on article/content pages, not special pages
    if (mw.config.get('wgNamespaceNumber') !== 0) return;

    var buttons = $('<div>', { style: 'margin-bottom: 1em;' }).append(
        $('<span>').addClass('ao3-button').text('Kudos ♥'),
        $('<span>').addClass('ao3-button').text('Bookmark').css('margin-left', '6px'),
    );

    // Insert before the first heading or at the top of the content area
    $('#mw-content-text').prepend(buttons);
});


$('<span>').addClass('ao3-button').text('Kudos ♥').on('click', function () {
    $(this).text('Kudos given! ♥');
    $(this).css('background-color', '#c8e6c9'); // light green feedback
})