বিষয়বস্তুতে চলুন
🎉 বইপিডিয়ার ১ বছর পূর্তি! · আমাদের ফেসবুক পেজ অনুসরণ করুন.

ব্যবহারকারী:ARI/common.js: সংশোধিত সংস্করণের মধ্যে পার্থক্য

বইপিডিয়া থেকে
সম্পাদনা সারাংশ নেই
পাতাকে 'mw.notify("My userscript loaded!");' দিয়ে প্রতিস্থাপিত করা হল
ট্যাগ: প্রতিস্থাপিত
 
(একই ব্যবহারকারী দ্বারা সম্পাদিত ৫টি মধ্যবর্তী সংশোধন দেখানো হচ্ছে না)
১ নং লাইন: ১ নং লাইন:
// Mass Rollback Tool - Language Independent
mw.notify("My userscript loaded!");
$(function() {
    // Check if we're on any Special:Contributions page
    var isContribPage = mw.config.get('wgCanonicalSpecialPageName') === 'Contributions' ||
                        window.location.href.indexOf('Special:Contributions') > -1 ||
                        window.location.href.indexOf('বিশেষ:অবদান') > -1;
   
    console.log('Is contrib page?', isContribPage);
    console.log('Page name:', mw.config.get('wgCanonicalSpecialPageName'));
   
    if (!isContribPage) {
        console.log('Not on contributions page, exiting');
        return;
    }
   
    console.log('Creating button...');
   
    // Add mass rollback button
    var $button = $('<button>')
        .attr('id', 'mass-rollback-btn')
        .text('Mass Rollback All')
        .css({
            'margin': '10px',
            'padding': '10px 20px',
            'background': '#d33',
            'color': 'white',
            'border': 'none',
            'cursor': 'pointer',
            'font-weight': 'bold'
        })
        .click(function() {
            if (!confirm('Are you sure you want to rollback ALL visible edits?')) return;
           
            var $rollbackLinks = $('.mw-rollback-link a');
            var total = $rollbackLinks.length;
           
            console.log('Found rollback links:', total);
           
            if (total === 0) {
                alert('No rollback links found on this page!');
                return;
            }
           
            var done = 0;
            mw.notify('Starting mass rollback of ' + total + ' edits...');
           
            $rollbackLinks.each(function(i) {
                var link = this;
                setTimeout(function() {
                    $.get(link.href).done(function() {
                        done++;
                        mw.notify('Rolled back ' + done + '/' + total);
                        if (done === total) {
                            mw.notify('Mass rollback complete! Refreshing...', {type: 'success'});
                            setTimeout(function() { location.reload(); }, 2000);
                        }
                    }).fail(function() {
                        mw.notify('Error rolling back edit ' + (i+1), {type: 'error'});
                    });
                }, i * 1000);
            });
        });
   
    // Try multiple places to add the button
    if ($('#mw-content-text').length) {
        $('#mw-content-text').prepend($button);
        console.log('Button added to #mw-content-text');
    } else if ($('.mw-body-content').length) {
        $('.mw-body-content').prepend($button);
        console.log('Button added to .mw-body-content');
    } else {
        $('body').prepend($button);
        console.log('Button added to body');
    }
   
    console.log('Button element:', $('#mass-rollback-btn').length);
});

১১:৪২, ১৮ জুন ২০২৬ তারিখে সম্পাদিত সর্বশেষ সংস্করণ

mw.notify("My userscript loaded!");