跳转到内容

User:Zanhsieh/vector.js

维基百科,自由的百科全书
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
/*<pre>
 *
 * 增加“強制刷新”按鈕
 */
$(function(){
	var ca_history = document.getElementById( "ca-history" );
	if ( ca_history && document.location.href.indexOf(mw.config.get('wgServer')+mw.config.get('wgArticlePath').replace("$1","")) == 0 ){
		var newA = document.createElement( "a" );
		newA.setAttribute( "href" , ca_history.firstChild.href.replace( "=history" , "=purge" ) );
		newA.appendChild( document.createTextNode( wgULS('刷新缓存','清除快取') ) );
		var newLi = document.createElement( "li" );
		newLi.appendChild( newA );
		var ul = document.getElementById("ca-move").parentNode;
		ul.appendChild( newLi );
	}
}); 
//</pre>