MediaWiki:Gadget-CleanDeleteReasons.js
外观
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/**
* -------------------------------------------------------------------------
* !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
* -------------------------------------------------------------------------
*/
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/CleanDeleteReasons/Gadget-CleanDeleteReasons.js|user=[[U:屠麟傲血]]|co-authors=|longId=6943529111ca996bf65b72925d9ce1c09b98992c|shortId=69435291|summary=fix: :bug: 依赖与小工具加载条件|body=<nowiki>1.移除失效依赖:mw.notify↩2.将部分小工具名字空间、操作判断条件移动到配置文件中</nowiki>}}';
/* <pre> */
"use strict";(async()=>{await $.ready;const t=document.getElementById("wpReason");if(!t)return;const e=new mw.Api;/(?:^内容|內容|被清空前|页面为空|頁面為空|page was empty|content was|content before blanking was)/i.test(t.value)&&(t.value="");const n=(await e.post({action:"parse",pageid:mw.config.get("wgArticleId"),prop:"text",format:"json",formatversion:2}))?.parse?.text||null;if(!n)return;const a=(new DOMParser).parseFromString(n,"text/html"),o=a.querySelector(".mw-parser-output > .infoBox.will2Be2Deleted #reason"),r=a.querySelector(".mw-parser-output > .infoBox.will2Be2Deleted #actor a");o&&r&&(t.value=`删除被挂删的页面,[[User_talk:${r.innerText}|${r.innerText}]]的挂删理由:''${o.innerText}''`)})();
/* </pre> */