跳转到内容

User:十六夜砕月/commons.js

维基百科,自由的百科全书

这是User:十六夜砕月/commons.js当前版本,由Ladsgroup留言 | 贡献编辑于2021年11月29日 (一) 10:19 (Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink))。这个网址是本页该版本的固定链接。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
$(function () {
    var hist; var url;
    if (!(hist = document.getElementById('ca-history') )) return;
    if (!(url = hist.getElementsByTagName('a')[0] )) return;
    if (!(url = url.href )) return;
    mw.util.addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),
                   wgULS('清理缓存'), 'ca-purge', wgULS('清理服务器缓存'), 'p');
 
});