MediaWiki:Edittool-plus.js
外观
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google Chrome、Firefox、Microsoft Edge及Safari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
//define buttons 定義按鈕與下拉菜單
addEditButton('btnInterLink',{
src : 'f/f3/Internal_link_icon.png',
pre : '[[',
sampleText : '链接标题',
post : ']]',
desc : '内部链接'
});
addEditButton('btnInterHashLink',{
src : "9/93/Button_sub_link.png",
pre : wgULS("[[条目#","[[條目#"),
sampleText : wgULS("章节|文本","章節|文本"),
post : "]]",
desc : wgULS("内部段落链接","內部段落連結")
});
addEditButton('btnCategoryLink',{
src : "b/b0/Button_category02.png",
pre : "[[:Category:",
sampleText : wgULS("分类名","分類名"),
post : "]]",
desc : wgULS("分类链接","分類連接")
});
addEditButton('btnMediaLink',{
src : '9/9d/Media_icon.png',
pre : '[[Media:',
sampleText : 'Example.ogg',
post : ']]',
desc : '媒体文件链接'
});
addEditButton('btnExtraLink',{
src : '7/73/External_link_icon.png',
pre : '[',
sampleText : 'http://www.example.com 链接标题',
post : ']',
desc : '外部链接(加前缀 http://)'
});
addEditButton('btnTemplateLink',{
src : "9/97/Template_button.png",
pre : "{{",
sampleText : "模板名",
post : "}}",
desc : wgULS("应用模板","應用模板")
});
addEditButton('btnCategory',{
src : "b/b4/Button_category03.png",
pre : "[[Category:",
sampleText : wgULS("分类名","分類名"),
post : "]]",
desc : wgULS("分类","分類")
});
addEditButton('btnRedirect',{
src : "4/47/Button_redir.png",
pre : "#REDIRECT [[",
sampleText : wgULS("目标条目名","目標條目名"),
post : "]]",
desc : "重定向"
});
addEditButton('btnImage',{
src : 'f/f0/Image_icon.png',
pre : '[[Image:',
sampleText : 'Example.jpg',
post : ']]',
desc : '嵌入图像'
});
addEditButton('btnAdvImage',{
src : "1/1c/Button_advanced_image.png",
pre : "<imagemap>\n",
sampleText : "Image:圖像名 | 100px | 描述\nrect 0 0 50 50 [[鏈接]]\ncircle 50 50 20 [[鏈接B]]\ndesc bottom-left\n",
post : "</imagemap>",
desc : wgULS("高级画像", "高级画像")
});
var __temp="\nImage:PictureFileName.jpg|"+wgULS("图片题注","圖片題注");
addEditButton('btnGallery',{
src : "9/9e/Btn_toolbar_gallery.png",
pre : "<gallery>",
sampleText : __temp+__temp,
post : "\n</gallery>",
desc : wgULS("画廊", "畫廊")
});
addEditButton('btnMath',{
src : '5/5b/Math_icon.png',
pre : '<math>',
sampleText : '插入数学公式',
post : '</math>',
desc : '插入数学公式(LaTeX)'
});
addEditButton('btnNowiki',{
src : '8/82/Nowiki_icon.png',
pre : '<nowiki>',
sampleText : '插入非格式文本',
post : '</nowiki>',
desc : '插入非格式文本'
});
addEditButton('btnSigOnly',{
src : '6/6d/Button_sig.png',
pre : '~~\~',
sampleText : '',
post : '',
desc : '签名(无日期)',
width : 12
});
addEditButton('btnSignature',{
src : 'c/c7/Signature_icon.png',
pre : '—~~\~~',
sampleText : '',
post : '',
desc : '签名'
});
addEditButton('btnHeadline2',{
src : 'e/e9/Button_headline2.png',
pre : '== ',
sampleText : '标题文字',
post : ' ==',
desc : '2级标题文字',
action : mwCustomEditButtons.lineAction
});
addEditButton('btnHeadline3',{
src : "3/3a/Button_headline3.png",
pre : "=== ",
sampleText : wgULS("标题文本","標題文本"),
post : " ===",
desc : wgULS("三级子标题","三級子標題"),
action : mwCustomEditButtons.lineAction
});
addEditButton('btnHr',{
src : 'a/a4/H-line_icon.png',
pre : '\n----\n',
sampleText : '',
post : '',
desc : wgULS('水平线','水平線')
});
addEditButton('btnBr',{
src : "1/13/Button_enter.png",
pre : "<br />",
sampleText : "",
post : "",
desc : wgULS("换行","換行")
});
addEditButton('btnBold',{
src : '6/6f/Bold_icon.png',
pre : '\'\'\'',
sampleText : '粗体',
post : '\'\'\'',
desc : '粗体'
});
addEditButton('btnItalic',{
src : 'd/d7/Italic_icon.png',
pre : '\'\'',
sampleText : '斜体',
post : '\'\'',
desc : '斜体'
});
__temp=wgULS("下划线","下劃線");
addEditButton('btnUnderline',{
src : 'f/fd/Button_underline.png',
pre : '<span style="text-decoration: underline;">',
sampleText : __temp,
post : '</span>',
desc : __temp
});
__temp=wgULS("删除线","刪除線");
addEditButton('btnStrike',{
src : "c/c9/Button_strike.png",
pre : "<del>",
sampleText : __temp,
post : "</del>",
desc : __temp
});
__temp=wgULS("左对齐","左對齊");
addEditButton('btnAlignLeft',{
src : "e/ea/Button_align_left.png",
pre : '<div style="text-align: left;">\n',
sampleText : __temp,
post : "\n</div>",
desc : __temp,
action : mwCustomEditButtons.lineAction
});
addEditButton('btnAlignCenter',{
src : "5/5f/Button_center.png",
pre : '<div style="text-align: center;">\n',
sampleText : "居中",
post : "\n</div>",
desc : "居中",
action : mwCustomEditButtons.lineAction
});
__temp=wgULS("右对齐","右對齊");
addEditButton('btnAlignRight',{
src : "a/a5/Button_align_right.png",
pre : '<div style="text-align: right;">\n',
sampleText : __temp,
post : "\n</div>",
desc : __temp,
action : mwCustomEditButtons.lineAction
});
__temp=wgULS("上标","上標");
addEditButton('btnSup',{
src : "6/6a/Button_sup_letter.png",
pre : "<sup>",
sampleText : __temp,
post : "</sup>",
desc : __temp
});
__temp=wgULS("下标","下標");
addEditButton('btnSub',{
src : "a/aa/Button_sub_letter.png",
pre : "<sub>",
sampleText : __temp,
post : "</sub>",
desc : __temp
});
addEditButton('btnBig',{
src : "5/56/Button_big.png",
pre : '<span style="font-size:larger;">',
sampleText : "放大",
post : "</span>",
desc : "放大"
});
__temp=wgULS("缩小","縮小");
addEditButton('btnSmall',{
src : "5/58/Button_small.png",
pre : '<span style="font-size:smaller;">',
sampleText : __temp,
post : "</span>",
desc : __temp
});
addEditButton('btnShift',{
src : "8/8e/Button_shifting.png",
pre : ":",
sampleText : "",
post : "",
desc : wgULS("缩进","縮進"),
action : mwCustomEditButtons.lineAction
});
addEditButton('btnEnum',{
src : "8/88/Btn_toolbar_enum.png",
pre : "#",
sampleText : "",
post : "",
desc : wgULS("数字列表","數字列表"),
action : mwCustomEditButtons.lineAction
});
addEditButton('btnList',{
src : "1/11/Btn_toolbar_liste.png",
pre : "*",
sampleText : "",
post : "",
desc : wgULS("符号列表","符號列表"),
action : mwCustomEditButtons.lineAction
});
addEditButton('btnDefine',{
src : "d/d3/Button_definition_list.png",
pre : "; ",
sampleText : wgULS("释义","釋義") ,
post : " : ",
desc : wgULS("定义文本","定義文本"),
action : mwCustomEditButtons.lineAction
});
addEditButton('btnColor',{
src : "1/1e/Button_font_color.png",
pre : '<span style="color: ColorName;">',
sampleText : "彩色文本",
post : "</span>",
desc : "彩色文本"
});
addEditButton('btnQuote',{
src : "f/fd/Button_blockquote.png",
pre : '{\{quote|\n',
sampleText : "引文",
post : "\n}\}",
desc : wgULS("块引用","塊引用")
});
addEditButton('btnCode',{
src : "2/23/Button_code.png",
pre : "<code>",
sampleText : wgULS("代码","代碼"),
post : "</code>",
desc : wgULS("代码文本","代碼文本")
});
addEditButton('btnSource',{
src : "d/d2/Button_source.png",
pre : '<source lang="text">',
sampleText : wgULS("源代码","源代碼"),
post : "</source>",
desc : wgULS("高亮代码","高亮代碼")
});
addEditButton('btnComment',{
src : "3/34/Button_hide_comment.png",
pre : "<!-- ",
sampleText : wgULS("隐藏文字","隱藏文字"),
post : " -->",
desc : wgULS("注释或隐藏文字","注釋或隱藏文字")
});
addEditButton('btnTable',{
src : "0/04/Button_array.png",
pre : '\n{| border="1" \n|- \n| 第一部分 || 第二部分 \n|- \n| 第三部分 || 第四部分',
sampleText : "",
post : "\n|}\n",
desc : "插入表格"
});
__temp=wgULS("参考","參考");
addEditButton('btnRef',{
src : "c/c4/Button_ref.png",
pre : "<ref>",
sampleText : __temp,
post : "</ref>",
desc : __temp
});
__temp=wgULS("同项参考","同項參考");
addEditButton('btnRef2',{
src : "c/cf/Button_ref_adv.png",
pre : '<ref name="">',
sampleText : __temp,
post : '</ref>',
desc : __temp,
width : 12
});
addEditButton('btnReferences',{
src : "f/fe/Button_refs.png",
pre : '\n==参考文献==\n<div class="references-small">\n<references />\n</div>',
sampleText : '',
post : '',
desc : wgULS("参考文献区","參考文獻區")
});
delete __temp;
addDropdownMenu("articleEdit",wgULS('条目编辑','條目編輯'),[
{
id : "elink",
text : wgULS("外部链接章节","外部連結章節"),
pre : "\n==外部链接==\n* [" ,
sampleText : "网页地址 网页说明" ,
post : "]\n"
},
{
id : "seealso",
text : wgULS("参见章节","參見章節"),
pre : "\n==参见==\n* [[" ,
sampleText : "参见地址" ,
post : "]]\n"
},
{
id : "stub",
text : "小作品",
pre : "\n{\{" ,
sampleText : "" ,
post : "小作品}\}"
},
{
id : "Disambig",
text : wgULS("消歧义","消歧義"),
pre : "\n'''{{PAGENAME}}'''可以指:\n" ,
sampleText : "* [[歧义1]],描述1\n* [[歧义2]],描述2" ,
post : "\n{\{disambig}\}"
},
{
id : "otheruses",
text : wgULS("条目消歧义","條目消歧義"),
pre : "{\{Otheruses|",
sampleText : "条目名称|subject=本页主題描述|other=同名或類似名的其它條目描述",
post : "}\}"
},
{
id : "inuse",
text : wgULS("正在编辑","正在編輯"),
pre : "{\{Inuse}\}",
sampleText : "",
post : ""
},
{
id : "Current",
text : wgULS("正在发生","正在發生"),
pre : "{\{Current}\}",
sampleText : "",
post : ""
},
{
id : "noconv",
text : wgULS("取消繁简转换","取消繁簡轉換"),
pre : "-\{" ,
sampleText : "不转换内容",
post : "}\-"
},
{
id : "title",
text : wgULS("标题错误","標題錯誤"),
pre : "-\{T|",
sampleText : "正确标题名称",
post : "}\-"
},
{
id : "noteTA",
text : wgULS("标题全文转换","標題全文轉換"),
pre : '{\{noteTA|',
sampleText : 'T=zh:中;zh-cn:大陆;zh-hk:香港;zh-sg:新马;zh-tw:台灣;|zh:中;zh-cn:大陆;zh-hk:香港;zh-sg:新马;zh-tw:台灣;',
post : '}\}'
},
{
id : "mergeto",
text : wgULS("合并本条目到","合併本條目到"),
pre : "{\{mergeto|",
sampleText : "合并本条目到的条目名称",
post : "}\}"
},
{
id : "mergefrom",
text : wgULS("合并到本条目","合併到本條目"),
pre : "{\{mergefrom|",
sampleText : "需要合并到本条目的条目名称",
post : "}\}"
},
{
id : "split",
text : wgULS("分拆条目","分拆條目"),
pre : "{\{Split}\}",
sampleText : "",
post : ""
},
{
id : "translation",
text : wgULS("正在翻译","正在翻譯"),
pre : "{\{translation|tfrom=",
sampleText : "在此填入来源",
post : "|tpercent=翻譯進度百分數}\}"
},
{
id : "Unreferenced",
text : wgULS("缺少参考文献","缺少參考文獻"),
pre : "{\{Unreferenced}\}",
sampleText : "",
post : ""
},
{
id : "lrm",
text : "LRM符",
pre : "\u200E",
sampleText : "",
post : ""
}
]);
createDropdownMenu("langTags",wgULS('非中文标明', '非中文標明'),[
{
id : "en",
text : wgULS("英语","英語"),
pre : "{\{lang|en|",
sampleText : wgULS("英语","英語"),
post : "}\}"
},
{
id : "de",
text : wgULS("德语","德語"),
pre : "{\{lang|de|",
sampleText : wgULS("德语","德語"),
post : "}\}"
},
{
id : "fr",
text : wgULS("法语","法語"),
pre : "{\{lang|fr|",
sampleText : wgULS("法语","法語"),
post : "}\}"
},
{
id : "ja",
text : wgULS("日语","日語"),
pre : "{\{lang|ja|",
sampleText : wgULS("日语","日語"),
post : "}\}"
},
{
id : "es",
text : wgULS("西班牙语","西班牙語"),
pre : "{\{lang|es|",
sampleText : wgULS("西班牙语","西班牙語"),
post : "}\}"
},
{
id : "ar",
text : wgULS("阿拉伯语","阿拉伯語"),
pre : "{\{lang|ar|",
sampleText : wgULS("阿拉伯语","阿拉伯語"),
post : "|\u200E}\}"
},
{
id : "ru",
text : wgULS("俄语","俄語"),
pre : "{\{lang|ru|",
sampleText : wgULS("俄语","俄語"),
post : "}\}"
},
{
id : "he",
text : wgULS("希伯来语", "希伯來語"),
pre : "{\{lang|he|",
sampleText : wgULS("希伯来语", "希伯來語"),
post : "|\u200E}\}"
},
{
id : "el",
text : wgULS("希腊语", "希臘語"),
pre : "{\{lang|el|",
sampleText : wgULS("希腊语", "希臘語"),
post : "}\}"
},
{
id : "langcode",
text : wgULS("其他语","其他語")+"言",
pre : "{\{lang|"+wgULS("在此填上语言代码|", "在此填上語言代碼|"),
sampleText : wgULS("其他语","其他語")+"言",
post : "}\}"
}
]);