MediaWiki:Gadget-CleanDeleteReasons.js:修订间差异
外观
AnnAngela-dbot(留言 | 贡献) 标签:由机器人或全自动脚本执行的操作 |
AnnAngela-dbot(留言 | 贡献) 代码变动:36744944 - fix by U:星海子 标签:由机器人或全自动脚本执行的操作 |
||
| 第4行: | 第4行: | ||
* ------------------------------------------------------------------------- | * ------------------------------------------------------------------------- | ||
*/ | */ | ||
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/CleanDeleteReasons/Gadget-CleanDeleteReasons.js|user=[[U: | var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/CleanDeleteReasons/Gadget-CleanDeleteReasons.js|user=[[U:星海子]]|co-authors=|longId=3674494486329bc858bd70afc9369f8b78b02f88|shortId=36744944|summary=fix}}'; | ||
/* <pre> */ | /* <pre> */ | ||
"use strict";(async()=>{await $.ready;const t=document. | "use strict";(async()=>{await $.ready;const t=document.getElementsByName("wpReason")?.[0];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> */ | /* </pre> */ | ||
2025年7月30日 (三) 07:12的最新版本
/**
* -------------------------------------------------------------------------
* !!! 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=3674494486329bc858bd70afc9369f8b78b02f88|shortId=36744944|summary=fix}}';
/* <pre> */
"use strict";(async()=>{await $.ready;const t=document.getElementsByName("wpReason")?.[0];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> */