User:BZPN/MassRollback2.js: Difference between revisions
From Test Wiki
Content deleted Content added
Created page with "(function($, mw) { 'use strict'; const MassRollback = { init: function() { if (mw.config.get('wgCanonicalSpecialPageName') !== 'Contributions') { return; } this.createUI(); this.bindEvents(); this.fetchUserStats(); }, createUI: function() { // Główna zawartość, początkowo ukryta (display: none) const $container = $(`..." |
No edit summary |
||
| Line 14: | Line 14: | ||
createUI: function() { |
createUI: function() { |
||
// Główna zawartość, początkowo ukryta (display: none) |
|||
const $container = $(` |
const $container = $(` |
||
<div id="mass-rollback-container" style="border: 1px solid #ccc; padding: 15px; margin-bottom: 20px; border-radius: 4px; background: #f9f9f9; display: none;"> |
<div id="mass-rollback-container" style="border: 1px solid #ccc; padding: 15px; margin-bottom: 20px; border-radius: 4px; background: #f9f9f9; display: none;"> |
||
| Line 130: | Line 130: | ||
`); |
`); |
||
// Przycisk przełączający widoczność narzędzia |
|||
const $toggleButton = $(` |
const $toggleButton = $(` |
||
<button id="mass-rollback-toggle" style="padding: 5px 10px; margin-bottom: 10px; background-color: #007bff; color: #fff; border: none; border-radius: 3px; cursor: pointer;"> |
<button id="mass-rollback-toggle" style="padding: 5px 10px; margin-bottom: 10px; background-color: #007bff; color: #fff; border: none; border-radius: 3px; cursor: pointer;"> |
||
Show |
Show MassRollback |
||
</button> |
</button> |
||
`); |
`); |
||
| Line 139: | Line 139: | ||
$toggleButton.on('click', function() { |
$toggleButton.on('click', function() { |
||
$('#mass-rollback-container').slideToggle(); |
$('#mass-rollback-container').slideToggle(); |
||
const btn = $(this); |
const btn = $(this); |
||
btn.text(btn.text() === 'Show |
btn.text(btn.text() === 'Show MassRollback' ? 'Hide MassRollback' : 'Show MassRollback'); |
||
}); |
}); |
||
// Dodaj przycisk i kontener do elementu #mw-content-text |
|||
$('#mw-content-text').prepend($toggleButton).prepend($container); |
$('#mw-content-text').prepend($toggleButton).prepend($container); |
||
}, |
}, |
||
| Line 304: | Line 304: | ||
}); |
}); |
||
} |
} |
||
$('#filtered-edits-container'). |
$('#filtered-edits-container').css("display", "block"); |
||
$('#filtered-edits-container').slideDown(); |
$('#filtered-edits-container').slideDown(); |
||
}); |
}); |
||