From 3c9572a94f6654f9b9a2ad65433039de51fd5c2a Mon Sep 17 00:00:00 2001 From: ZoruaFox Date: Sun, 2 Jun 2024 16:53:49 +0800 Subject: [PATCH] chore(PurgePageCache): remove unused code and event listener --- src/PurgePageCache/PurgePageCache.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/PurgePageCache/PurgePageCache.ts b/src/PurgePageCache/PurgePageCache.ts index 1ac9afa..ceddbc7 100644 --- a/src/PurgePageCache/PurgePageCache.ts +++ b/src/PurgePageCache/PurgePageCache.ts @@ -1,5 +1,4 @@ import {getBody} from 'ext.gadget.Util'; -import {getMessage} from './modules/i18n'; import {purge} from './modules/purge'; void getBody().then(function purgePageCache($body: JQuery): void { @@ -9,21 +8,6 @@ void getBody().then(function purgePageCache($body: JQuery): voi return; } - const portletId: 'p-cactions' | 'p-tb' = $body.find('#p-cactions').length ? 'p-cactions' : 'p-tb'; - const portletElement: HTMLLIElement | null = mw.util.addPortletLink( - portletId, - getMessage('Purge'), - getMessage('PurgeFromServer') - ); - if (!portletElement) { - return; - } - - (portletElement.querySelector('a') as HTMLAnchorElement).addEventListener('click', (event: MouseEvent): void => { - event.preventDefault(); - void purge(wgPageName); - }); - for (const element of $body.find('a[href*="action=purge"]')) { const title: string = mw.util.getParamValue('title', element.href) || wgPageName; element.addEventListener('click', (event: MouseEvent): void => {