|
|
| ১ নং লাইন: |
১ নং লাইন: |
| mw.loader.using(['mediawiki.util', 'mediawiki.api'], function () { | | mw.notify('User JS loaded: rollback scripts will work'); |
| $(function () {
| |
| if (mw.config.get('wgNamespaceNumber') < 0) return;
| |
| | |
| | |
| var purgeLink = mw.util.addPortletLink(
| |
| 'p-tb', // This puts it in the "Tools" list
| |
| '#', // Link destination
| |
| 'Purge', // Text to show (You can change this to 'শোধন')
| |
| 't-purge', // HTML ID
| |
| 'Purge cache and update links' // Tooltip
| |
| );
| |
| | |
| | |
| $(purgeLink).on('click', function (e) {
| |
| e.preventDefault();
| |
|
| |
| | |
| $(this).find('a').text('Purging...');
| |
| | |
| new mw.Api().post({
| |
| action: 'purge',
| |
| titles: mw.config.get('wgPageName'),
| |
| forcelinkupdate: 1
| |
| }).then(function () {
| |
| // 3. Reload on success
| |
| location.reload();
| |
| }).catch(function () {
| |
| // Fallback if API fails
| |
| location.reload();
| |
| });
| |
| });
| |
| });
| |
| });
| |
২৩:১৭, ৬ জানুয়ারি ২০২৬ তারিখে সংশোধিত সংস্করণ
mw.notify('User JS loaded: rollback scripts will work');