跳转到内容

MediaWiki:Gadget-Purgecache.js:修订间差异

来自萌娘共享
标签由机器人或全自动脚本执行的操作
标签由机器人或全自动脚本执行的操作
 
第4行: 第4行:
  * -------------------------------------------------------------------------
  * -------------------------------------------------------------------------
  */
  */
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/Purgecache/Gadget-Purgecache.js|user=[[U:机智的小鱼君]]|co-authors=|longId=f7ad925ef1d7a748c3c8f7624e72fc1e844b12fa|shortId=f7ad925e|summary=chore: no need to post twice}}';  
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/Purgecache/Gadget-Purgecache.js|user=[[U:SaoMikoto]]|co-authors=|longId=b2110e16d8c3a8618618c56ec4a411b8ef28114e|shortId=b2110e16|summary=fix(Gadget/Purgecache): 适配Vector-2022 (#683)}}';  


/* <pre> */
/* <pre> */


"use strict";$(()=>{if(!mw.config.get("wgIsArticle")||"Mainpage"===mw.config.get("wgPageName"))return;const $purgeButton=(e=wgULS("清除页面缓存","清除頁面快取"),t=wgULS("正在清除缓存","正在清除快取"),i=wgULS("清除缓存成功!","清除快取成功!"),a=wgULS("清除缓存失败,点击可重试","清除快取失敗,點選可重試",null,null,"清除快取失敗,點擊可重試"))=>{const n=$('<span class="n-button__content" />').text(e),o=$('<a class="n-button purgecache" />').append(n);let r=!1;return o.on("click",async()=>{if(r)return;n.text(t),n.prepend('<img src="https://img.moegirl.org.cn/common/d/d1/Windows_10_loading.gif" style="height: 1em; margin-top: -.25em;">'),r=!0;const o=new mw.Api,s={action:"purge",format:"json",forcelinkupdate:!0,titles:mw.config.get("wgPageName")};try{await o.post(s),n.text(i),setTimeout(()=>location.reload(location,!0),200)}catch{n.text(a),r=!1,setTimeout(()=>{r||n.text(e)},5e3)}}),o};"vector"===mw.config.get("skin")?$("#p-personal ul").append($('<li id="pt-purge" />').append($purgeButton())):($("#moe-article-header-top .right-block.flex").prepend($('<div class="flex" id="p-purge-cache"></div>').append($purgeButton().append('<div aria-hidden="true" class="n-base-wave"></div>','<div aria-hidden="true" class="n-button__border"></div>','<div aria-hidden="true" class="n-button__state-border"></div>'))),$("#mobile-page-actions .mobile-edit-button").append($purgeButton(wgULS("清除缓存","清除快取"),wgULS("正在清除","正在清除"),wgULS("清除成功!","清除成功!"),wgULS("清除失败,点击可重试","清除失敗,點選可重試",null,null,"清除失敗,點擊可重試")).append('<div aria-hidden="true" class="n-base-wave"></div>')))});  
"use strict";$(()=>{if(!mw.config.get("wgIsArticle")||"Mainpage"===mw.config.get("wgPageName"))return;const $purgeButton=(e=wgULS("清除页面缓存","清除頁面快取"),t=wgULS("正在清除缓存","正在清除快取"),i=wgULS("清除缓存成功!","清除快取成功!"),a=wgULS("清除缓存失败,点击可重试","清除快取失敗,點選可重試",null,null,"清除快取失敗,點擊可重試"))=>{const n=$('<span class="n-button__content" />').text(e),s=$('<a class="n-button purgecache" />').append(n);let c=!1;return s.on("click",async()=>{if(c)return;n.text(t),n.prepend('<img src="https://img.moegirl.org.cn/common/d/d1/Windows_10_loading.gif" style="height: 1em; margin-top: -.25em;">'),c=!0;const s=new mw.Api,l={action:"purge",format:"json",forcelinkupdate:!0,titles:mw.config.get("wgPageName")};try{await s.post(l),n.text(i),setTimeout(()=>location.reload(location,!0),200)}catch{n.text(a),c=!1,setTimeout(()=>{c||n.text(e)},5e3)}}),s};"vector-2022"===mw.config.get("skin")?$("#p-cactions ul").append($('<li class="mw-list-item mw-list-item-js" id="pt-purge" />').append($purgeButton())):($("#moe-article-header-top .right-block.flex").prepend($('<div class="flex" id="p-purge-cache"></div>').append($purgeButton().append('<div aria-hidden="true" class="n-base-wave"></div>','<div aria-hidden="true" class="n-button__border"></div>','<div aria-hidden="true" class="n-button__state-border"></div>'))),$("#mobile-page-actions .mobile-edit-button").append($purgeButton(wgULS("清除缓存","清除快取"),wgULS("正在清除","正在清除"),wgULS("清除成功!","清除成功!"),wgULS("清除失败,点击可重试","清除失敗,點選可重試",null,null,"清除失敗,點擊可重試")).append('<div aria-hidden="true" class="n-base-wave"></div>')))});  


/* </pre> */
/* </pre> */

2025年8月18日 (一) 19:18的最新版本

/**
 * -------------------------------------------------------------------------
 * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
 * -------------------------------------------------------------------------
 */
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/Purgecache/Gadget-Purgecache.js|user=[[U:SaoMikoto]]|co-authors=|longId=b2110e16d8c3a8618618c56ec4a411b8ef28114e|shortId=b2110e16|summary=fix(Gadget/Purgecache): 适配Vector-2022 (#683)}}'; 

/* <pre> */

"use strict";$(()=>{if(!mw.config.get("wgIsArticle")||"Mainpage"===mw.config.get("wgPageName"))return;const $purgeButton=(e=wgULS("清除页面缓存","清除頁面快取"),t=wgULS("正在清除缓存","正在清除快取"),i=wgULS("清除缓存成功!","清除快取成功!"),a=wgULS("清除缓存失败,点击可重试","清除快取失敗,點選可重試",null,null,"清除快取失敗,點擊可重試"))=>{const n=$('<span class="n-button__content" />').text(e),s=$('<a class="n-button purgecache" />').append(n);let c=!1;return s.on("click",async()=>{if(c)return;n.text(t),n.prepend('<img src="https://img.moegirl.org.cn/common/d/d1/Windows_10_loading.gif" style="height: 1em; margin-top: -.25em;">'),c=!0;const s=new mw.Api,l={action:"purge",format:"json",forcelinkupdate:!0,titles:mw.config.get("wgPageName")};try{await s.post(l),n.text(i),setTimeout(()=>location.reload(location,!0),200)}catch{n.text(a),c=!1,setTimeout(()=>{c||n.text(e)},5e3)}}),s};"vector-2022"===mw.config.get("skin")?$("#p-cactions ul").append($('<li class="mw-list-item mw-list-item-js" id="pt-purge" />').append($purgeButton())):($("#moe-article-header-top .right-block.flex").prepend($('<div class="flex" id="p-purge-cache"></div>').append($purgeButton().append('<div aria-hidden="true" class="n-base-wave"></div>','<div aria-hidden="true" class="n-button__border"></div>','<div aria-hidden="true" class="n-button__state-border"></div>'))),$("#mobile-page-actions .mobile-edit-button").append($purgeButton(wgULS("清除缓存","清除快取"),wgULS("正在清除","正在清除"),wgULS("清除成功!","清除成功!"),wgULS("清除失败,点击可重试","清除失敗,點選可重試",null,null,"清除失敗,點擊可重試")).append('<div aria-hidden="true" class="n-base-wave"></div>')))}); 

/* </pre> */