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

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

বইপিডিয়া থেকে
সম্পাদনা সারাংশ নেই
পাতাকে 'mw.notify("My userscript loaded!");' দিয়ে প্রতিস্থাপিত করা হল
ট্যাগ: প্রতিস্থাপিত
 
(একই ব্যবহারকারী দ্বারা সম্পাদিত ১৫টি মধ্যবর্তী সংশোধন দেখানো হচ্ছে না)
১ নং লাইন: ১ নং লাইন:
mw.loader.using(['mediawiki.util', 'mediawiki.api'], function () {
mw.notify("My userscript loaded!");
    $(function () {
        // Prevent script from running on Special pages (which cannot be purged)
        if (mw.config.get('wgNamespaceNumber') < 0) return;
 
        // Add the Portlet Link
        var purgeLink = mw.util.addPortletLink(
            'p-cactions',      // Target the "More" dropdown (Vector) or Actions tab (Monobook)
            '#',                // Link destination (handled by click event below)
            'Purge',            // The visible text
            'ca-purge',        // DOM ID for the link
            'Purge cache and update links', // Tooltip
            '*'                // Keyboard shortcut (Alt+Shift+*)
        );
 
        // Handle the click event
        $(purgeLink).on('click', function (e) {
            e.preventDefault(); // Stop the link from following '#'
 
            // Change text to indicate processing
            $(this).find('a').text('Purging...');
 
            // Call the API
            new mw.Api().post({
                action: 'purge',
                titles: mw.config.get('wgPageName'),
                forcelinkupdate: 1 // This performs the "Hard Purge" (updates tables)
            }).then(function () {
                // On success, reload the page
                location.reload();
            }).catch(function () {
                // If API fails, fallback to the standard confirmation screen
                window.location.href = mw.util.getUrl(null, { action: 'purge' });
            });
        });
    });
});

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

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