跳转到内容

User:Willy1018/cleanup.js

维基百科,自由的百科全书
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
importScript('User:Vozhuo/Tool/MOSNUM dates.js');
$.ajax('https://tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
	if( $.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1) {
		$.ajax('https://en.wikipedia.org/w/index.php?title=User:Ohconfucius/script/MOSNUM_utils.js&action=raw&ctype=text/javascript', { dataType:'script', cache:true }).then(function() {
			$(function() {
				var add = mw.util.addPortletLink;
				$( add('p-tb', '#', '移除長期無來源字句')).click(Remove_fact_driver);
			});
		});
	}
});

function MOSNUM_edit_summary() {
	setoptions(minor='false');
	setreason('移除長期無來源字句', 'append');
	doaction('diff');
}

function Remove_fact() {
	ohc_regex(/[ \f\n\r\t\v]{0,5}[{]{2}[ \f\n\r\t\v]{0,5}([fF]act|[Oo]r|Citation needed|来源请求|來源請求|請求來源|请求来源|[Cc][Nn]|[Oo]riginal research inline)[ \f\n\r\t\v]{0,5}[|].+[}]{2}/, "");
	ohc_regex(/[|][ \f\n\r\t\v]{0,5}url-access[ \f\n\r\t\v]{0,5}=[ \f\n\r\t\v]{0,5}[a-z]+/, "");
}
function Remove_fact_driver(e) {
	e.preventDefault();
	Remove_fact();
	MOSNUM_edit_summary();
}