MediaWiki:Gadget-Purge.js

来自Vocawiki
人间百态留言 | 贡献2025年9月13日 (六) 16:02的版本 (创建页面,内容为“* * 刷新缓存按钮 * 搬運自 https://zh.wikipedia.org/w/index.php?title=User:%E6%A1%90%E7%94%9F%E3%81%93%E3%81%93/js/Gadget-purge.js&oldid=69943550 * @author [[zhwp:User:桐生ここ]]:​ (function($, mw) { if ( mw.config.get( 'wgIsArticle' ) == true ) { if ( ( mw.config.get( 'wgMFAmc' ) == true ) && ( $( '#p-tb' ).length != 0 ) ) { $( '#p-tb' ).append( '<li class="toggle-list-item"><a class="toggle-list-item__anchor" href="' + $(loca…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到导航 跳转到搜索

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
/**
 * 刷新缓存按钮
 * 搬運自 https://zh.wikipedia.org/w/index.php?title=User:%E6%A1%90%E7%94%9F%E3%81%93%E3%81%93/js/Gadget-purge.js&oldid=69943550
 * @author [[zhwp:User:桐生ここ]]
 */
(function($, mw) {
    if ( mw.config.get( 'wgIsArticle' ) == true ) {
    	if ( ( mw.config.get( 'wgMFAmc' ) == true ) && ( $( '#p-tb' ).length != 0 ) ) {
    		$( '#p-tb' ).append( '<li class="toggle-list-item"><a class="toggle-list-item__anchor" href="' + $(location).attr( 'origin' ) + '/wiki/Special:Purge/' + mw.config.get( 'wgPageName' ) + '" data-mw="interface"><span class="mw-ui-icon mw-ui-icon-reload"></span>&nbsp;<span class="toggle-list-item__label">' + wgULS( '刷新缓存' , '清除快取' ) + '</span></a></li>' );
    	}
    	else {
    		mw.util.addPortletLink( 'p-cactions' , $(location).attr( 'origin' ) + '/wiki/Special:Purge/' + mw.config.get( 'wgPageName' ), wgULS( '刷新缓存' , '清除快取' ) );
    	}
    }
})(jQuery, mw);