維基百科:維基百科工具/編輯工具/zhc.js

//

if(!mwCustomEditButtons.Signature){mwCustomEditButtons.Signature='—~~\~~';}
/**
 *  创建zhc菜单
 */
if(/^Wikipedia:繁简体转换请求\//i.test(wgPageName)){
	function getZhcAction(tagOpen, tagClose){
		var sectReg=/(^|\r?\n)==[^=].*?== *\r?\n|(^|\r?\n) *\{\{Wikipedia:(繁簡體轉換請求|繁简体转换请求)\/.*?\}\} */g;
		return function(){insertSect(sectReg, tagOpen, tagClose);}
	}
	addDropdownMenu("zhcInsertSel",wgULS('繁简转换','繁簡轉換'),[
		{
			id         : "zhcAdd",
			text       : '添加',
			summary    : "已添加請求",
			minor      : false,
			action     : getVfdAction("{\{ConverH|c}\}\n","----\n該請求添加至轉換表。"+mwCustomEditButtons.Signature+"\n{\{ConverF}\}")
		},
		{
			id         : "zhcCancel",
			text       : '未添加',
			summary    : "未添加請求",
			minor      : false,
			action     : getVfdAction("{\{ConverH|nc}\}\n","----\n該請求未能進入轉換表。"+mwCustomEditButtons.Signature+"\n{\{ConverF}\}")
		},
	]);
}
//