MediaWiki:Common.js: Difference between revisions
From YOU SEEM PRETTY SAD FOR A GIRL SO IN LOVE
Created page with "$(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(butt..." |
No edit summary |
||
| Line 11: | Line 11: | ||
$('#mw-content-text').prepend(buttons); | $('#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 | |||
}) | |||
Revision as of 08:32, 12 June 2026
$(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
})