User:Camphora/customEdittools.js
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google Chrome、Firefox、Microsoft Edge及Safari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
//define buttons 定義按鈕與下拉菜單
addEditButton('btnInterLink',{
src : 'c/c0/Button_link.png',
tagOpen : '[[',
sampleText : '链接标题',
tagClose : ']]',
speedTip : "内部链接"
});
addEditButton('btnInterHashLink',{
src : "9/93/Button_sub_link.png",
tagOpen : "[[条目#",
sampleText : "章节|文本",
tagClose : "]]",
speedTip : "内部段落链接"
});
addEditButton('btnExtraLink',{
src : '7/73/External_link_icon.png',
tagOpen : '[',
sampleText : 'http://www.example.com 链接标题',
tagClose : ']',
speedTip : '外部链接(加前缀 http://)'
});
addEditButton('btnTemplateLink',{
src : "9/97/Template_button.png",
tagOpen : "{{",
sampleText : "模板名",
tagClose : "}}",
speedTip : "应用模板"
});
addEditButton('btnCategory',{
src : "b/b4/Button_category03.png",
tagOpen : "[[分类:",
sampleText : "分类名",
tagClose : "]]",
speedTip : "分类"
});
addEditButton('btnRedirect',{
src : "4/47/Button_redir.png",
tagOpen : "#REDIRECT [[",
sampleText : "目标条目名",
tagClose : "]]",
speedTip : "重定向"
});
addEditButton('btnImage',{
src : 'f/f0/Image_icon.png',
tagOpen : '[[File:',
sampleText : 'Example.jpg',
tagClose : '|thumb|图像描述]]',
speedTip : '嵌入图像'
});
var __temp="\nFile:PictureFileName.jpg|图片题注";
addEditButton('btnGallery',{
src : "9/9e/Btn_toolbar_gallery.png",
tagOpen : "<gallery>",
sampleText : __temp+__temp,
tagClose : "\n</gallery>",
speedTip : "画廊"
});
addEditButton('btnNowiki',{
src : '8/82/Nowiki_icon.png',
tagOpen : '<nowiki>',
sampleText : '插入非格式文本',
tagClose : '</nowiki>',
speedTip : '插入非格式文本'
});
addEditButton('btnSigOnly',{
src : 'd/d8/Button_sig_zh.png',
tagOpen : '~~\~',
sampleText : '',
tagClose : '',
speedTip : '签名(无日期)',
width : 12
});
addEditButton('btnSignature',{
src : '6/6d/Button_sig.png',
tagOpen : '—~~\~~',
sampleText : '',
tagClose : '',
speedTip : '签名'
});
addEditButton('btnHeadline2',{
src : 'e/e9/Button_headline2.png',
tagOpen : '\n== ',
sampleText : '标题文字',
tagClose : ' ==\n',
speedTip : '二级标题',
});
addEditButton('btnHeadline3',{
src : "3/3a/Button_headline3.png",
tagOpen : "\n=== ",
sampleText : "标题文本",
tagClose : " ===\n",
speedTip : "三级子标题",
});
addEditButton('btnBr',{
src : "1/13/Button_enter.png",
tagOpen : "<br />",
sampleText : "",
tagClose : "",
speedTip : "换行"
});
addEditButton('btnBold',{
src : '6/6f/Bold_icon.png',
tagOpen : '\'\'\'',
sampleText : '粗体',
tagClose : '\'\'\'',
speedTip : '粗体'
});
addEditButton('btnItalic',{
src : 'd/d7/Italic_icon.png',
tagOpen : '\'\'',
sampleText : '斜体',
tagClose : '\'\'',
speedTip : '斜体'
});
addEditButton('btnUnderline',{
src : 'f/fd/Button_underline.png',
tagOpen : '<span style="text-decoration: underline;">',
sampleText : "下划线",
tagClose : '</span>',
speedTip : "下划线"
});
addEditButton('btnStrike',{
src : "c/c9/Button_strike.png",
tagOpen : "<del>",
sampleText : "删除线",
tagClose : "</del>",
speedTip : "删除线"
});
addEditButton('btnAlignLeft',{
src : "e/ea/Button_align_left.png",
tagOpen : '<div style="text-align: left;">',
sampleText : "左对齐",
tagClose : "</div>",
speedTip : "左对齐",
});
addEditButton('btnAlignCenter',{
src : "5/5f/Button_center.png",
tagOpen : '<div style="text-align: center;">',
sampleText : "居中",
tagClose : "</div>",
speedTip : "居中",
});
addEditButton('btnAlignRight',{
src : "a/a5/Button_align_right.png",
tagOpen : '<div style="text-align: right;">',
sampleText : "右对齐",
tagClose : "</div>",
speedTip : "右对齐",
});
addEditButton('btnSup',{
src : "6/6a/Button_sup_letter.png",
tagOpen : "<sup>",
sampleText : "上标",
tagClose : "</sup>",
speedTip : "上标"
});
addEditButton('btnBig',{
src : "5/56/Button_big.png",
tagOpen : '<span style="font-size:larger;">',
sampleText : "放大",
tagClose : "</span>",
speedTip : "放大"
});
addEditButton('btnSmall',{
src : "5/58/Button_small.png",
tagOpen : '<span style="font-size:smaller;">',
sampleText : "缩小",
tagClose : "</span>",
speedTip : "缩小"
});
addEditButton('btnColor',{
src : "1/1e/Button_font_color.png",
tagOpen : '<span style="color: ColorName;">',
sampleText : "彩色文本",
tagClose : "</span>",
speedTip : "彩色文字"
});
addEditButton('btnQuote',{
src : "f/fd/Button_blockquote.png",
tagOpen : '{\{quote|\n',
sampleText : "引文",
tagClose : "\n}\}",
speedTip : "块引用"
});
addEditButton('btnSource',{
src : "d/d2/Button_source.png",
tagOpen : '<source lang="text">',
sampleText : "源代码",
tagClose : "</source>",
speedTip : "高亮代码"
});
addEditButton('btnComment',{
src : "3/34/Button_hide_comment.png",
tagOpen : "<!-- ",
sampleText : "隐藏文字",
tagClose : " -->",
speedTip : "注释或隐藏文字"
});
addEditButton('btnTable',{
src : "0/04/Button_array.png",
tagOpen : '\n{| class="wikitable" \n|- \n| 第一部分 || 第二部分 \n|- \n| 第三部分 || 第四部分',
sampleText : "",
tagClose : "\n|}\n",
speedTip : "插入表格"
});
addEditButton('btnRef',{
src : "c/c4/Button_ref.png",
tagOpen : "<ref>",
sampleText : "参考",
tagClose : "</ref>",
speedTip : "简单参考"
});
addEditButton('btnRef1',{
src : "c/cf/Button_ref_adv.png",
tagOpen : '<ref name="">',
sampleText : "参考",
tagClose : '</ref>',
speedTip : "首次同项参考",
width : 12
});
addEditButton('btnRef2',{
src : "c/cf/Button_ref_adv.png",
tagOpen : '<ref name="',
sampleText : "项名",
tagClose : '" />',
speedTip : "再次同项参考",
width : 12
});
addEditButton('btnReferences',{
src : "f/fe/Button_refs.png",
tagOpen : '\n==' + '参考资料' + '==\n<div class=\"references-small\">\n<references />\n</div>\n',
sampleText : '',
tagClose : '',
speedTip : "参考资料区"
});
delete __temp;
addDropdownMenu("articleEdit",'条目编辑',[
{
id : "elink",
text : "外部链接章节",
tagOpen : "\n==外部链接==\n* [" ,
sampleText : "网页地址 网页说明" ,
tagClose : "]\n"
},
{
id : "seealso",
text : "参见章节",
tagOpen : "\n==参见==\n* [[" ,
sampleText : "参见地址" ,
tagClose : "]]\n"
},
{
id : "Disambig",
text : "消歧义",
tagOpen : "\n'''{{PAGENAME}}'''可以指:\n" ,
sampleText : "* [[歧义1]],描述1\n* [[歧义2]],描述2" ,
tagClose : "\n{\{消歧义}\}"
},
{
id : "otheruses",
text : "条目消歧义",
tagOpen : "{\{Otheruses|",
sampleText : "条目名称|subject=本页主題描述|other=同名或類似名的其它條目描述",
tagClose : "}\}"
},
{
id : "Current",
text : "正在发生",
tagOpen : "{\{Current}\}",
sampleText : "",
tagClose : ""
},
{
id : "noconv",
text : "取消繁简转换",
tagOpen : "-\{" ,
sampleText : "不转换内容",
tagClose : "}\-"
},
{
id : "title",
text : "标题错误",
tagOpen : "-\{T|",
sampleText : "正确标题名称",
tagClose : "}\-"
},
{
id : "noteTA",
text : "标题全文转换",
tagOpen : '{\{noteTA\n',
sampleText : '|G1=公共组名\n|1=zh-cn:大陆;zh-tw:台灣;zh-hk:香港;zh-sg:新马;\n|2=zh-cn:大陆;zh-tw:台灣;zh-hk:香港;zh-sg:新马;\n',
tagClose : "}\}"
},
]);
addDropdownMenu("articleMaintenance",'页面维护',[
{
id : "stub",
text : "小作品",
tagOpen : "\n{\{" ,
sampleText : "" ,
tagClose : "小作品}\}"
},
{
id : "inuse",
text : "正在编辑",
tagOpen : "{\{Inuse}\}",
sampleText : "",
tagClose : ""
},
{
id : "Unreferenced",
text : "缺少参考文献",
tagOpen : "{\{subst:Unreferenced/auto}\}",
sampleText : "",
tagClose : ""
},
{
id : "Substub",
text : "小小条目",
tagOpen : "{\{subst:Substub/auto}\}",
sampleText : "",
tagClose : ''
},
{
id : "vfd",
text : "标示删除",
tagOpen : "{\{subst:vfd/auto|",
sampleText : "理由",
tagClose : "}\}"
},
{
id : "sd",
text : "标示快速删除",
tagOpen : "{\{Delete|",
sampleText : "理由",
tagClose : "}\}"
},
{
id : "Copyvio",
text : "标示侵权",
tagOpen : "{\{subst:Copyvio/auto|url=",
sampleText : "*http://url1\n*http://url2\n*http://url3",
tagClose : "}\}\n"
},
{
id : "Copyntf",
text : "侵权通知",
tagOpen : "{{subst:Uw-copyright|",
sampleText : "条目名称",
tagClose : "\}\}—~~\~~\n"
},
{
id : "mergeto",
text : "合并本条目到",
tagOpen : "{\{mergeto|",
sampleText : "合并本条目到的条目名称",
tagClose : "}\}"
},
{
id : "mergefrom",
text : "合并到本条目",
tagOpen : "{\{mergefrom|",
sampleText : "需要合并到本条目的条目名称",
tagClose : "}\}"
},
{
id : "split",
text : "分拆条目",
tagOpen : "{\{Split}\}",
sampleText : "",
tagClose : ""
},
{
id : "translation",
text : "正在翻译",
tagOpen : "{\{translation|tfrom=",
sampleText : "在此填入来源",
tagClose : "|tpercent=翻譯進度百分數}\}"
}
]);
addDropdownMenu("langTags",'非中文标明',[
{
id : "en",
text : "英语",
tagOpen : "{\{lang|en|",
sampleText : "英语",
tagClose : "}\}"
},
{
id : "de",
text : "德语",
tagOpen : "{\{lang|de|",
sampleText : "德语",
tagClose : "}\}"
},
{
id : "fr",
text : "法语",
tagOpen : "{\{lang|fr|",
sampleText : "法语",
tagClose : "}\}"
},
{
id : "ja",
text : "日语",
tagOpen : "{\{lang|ja|",
sampleText : "日语",
tagClose : "}\}"
},
{
id : "langcode",
text : "其他语言",
tagOpen : "{\{lang|"+"在此填上语言代码|",
sampleText : "其他语言",
tagClose : "}\}"
},
{
id : 'nochineseRedirect',
text : '非中文重定向',
tagOpen : '{\{非中文重定向}\}',
sampleText : '',
tagClose : ''
}
]);