跳转到内容

User:小躍/GoToSubmit.js

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

这是本页的一个历史版本,由小躍留言 | 贡献2018年11月1日 (四) 14:23 (修改js程式碼設置,Drive by Templatescript of Eager)编辑。这可能和当前版本存在着巨大的差异。

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
var GoToSubmit='';
var GoToSubmitLG=mw.config.get('wgUserLanguage');
switch(GoToSubmitLG){
	case 'de':GoToSubmit='Gehe zu Senden';break;
	case 'es':GoToSubmit='Ir a Enviar';break;
	case 'fr':GoToSubmit='Aller à soumettre';break;
	case 'it':GoToSubmit='Vai a Invia';break;
	case 'pt':GoToSubmit='Vá para Enviar';break;
	case 'zh':case 'zh-cn':
	case 'zh-hans':case 'zh-my':GoToSubmit='前往发布';break;
	case 'zh-hant':case 'zh-hk':case 'zh-mo':
	case 'zh-sg':case'zh-tw':GoToSubmit='前往發布';break;
	case 'ja':GoToSubmit='送信する';break;
	default:GoToSubmit=wgULS('Go to Submit');
}

if( $.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1) {
	var GoToSubmitBtn='<button id="wpGoToSubmit">' + GoToSubmit +'</button>';
	$('#mw-content-text').before(GoToSubmitBtn);
	$('#wpGoToSubmit').addClass('mw-ui-button mw-ui-progressive');
	$('#wpGoToSubmit').css('position','fixed').css('top','150px').css('right','25px');
}
$('#wpGoToSubmit').click(function(){
	
        $("html, body").animate({scrollTop:($("#content").height()-$(".mw-editTools").height()-$(".editOptions").height())}, 1000);
});