|
|
| (একই ব্যবহারকারী দ্বারা সম্পাদিত ১০টি মধ্যবর্তী সংশোধন দেখানো হচ্ছে না) |
| ১ নং লাইন: |
১ নং লাইন: |
| mw.loader.using(['mediawiki.api'], function () { | | mw.notify("My userscript loaded!"); |
| | |
| console.log('MR DEBUG: script loaded');
| |
| | |
| if (mw.config.get('wgCanonicalSpecialPageName') !== 'Contributions') {
| |
| console.log('MR DEBUG: not contributions page');
| |
| return;
| |
| }
| |
| | |
| const username = mw.config.get('wgRelevantUserName');
| |
| console.log('MR DEBUG: username =', username);
| |
| | |
| if (!username) {
| |
| console.log('MR DEBUG: username missing');
| |
| return;
| |
| }
| |
| | |
| const btn = $('<button>')
| |
| .text('Rollback visible edits')
| |
| .css({
| |
| marginLeft: '12px',
| |
| padding: '4px 8px',
| |
| fontSize: '90%'
| |
| })
| |
| .on('click', function () {
| |
| alert('Rollback button works for user: ' + username);
| |
| });
| |
| | |
| $('#firstHeading').append(btn);
| |
| console.log('MR DEBUG: button added');
| |
| });
| |
১১:৪২, ১৮ জুন ২০২৬ তারিখে সম্পাদিত সর্বশেষ সংস্করণ
mw.notify("My userscript loaded!");