User:AngeCI/common.js
外观
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google Chrome、Firefox、Microsoft Edge及Safari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
// [[User:Lupin/popups.js]] - please include this line
popupDelay = 0.1; // 接近立刻显示
//[[Wikipedia:維基百科工具/強迫更新/purge.js]]
addOnloadHook(function () {
var hist; var url;
if (!(hist = document.getElementById('ca-history') )) return;
if (!(url = hist.getElementsByTagName('a')[0] )) return;
if (!(url = url.href )) return;
addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),
wgULS('清除缓存','清除快取'), 'ca-purge', wgULS('清理服务器缓存','清理伺服器快取'), 'p');
});
mw.loader.using(['ext.gadget.Edittools-vector'], function () {
$(document).ready(function(){
customizeToolbar( function() {
this.wikiEditor('addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'bolditalic': {
label: '粗斜体',
type: 'button',
icon: '/media/wikipedia/commons/b/be/Toolbaricon_bolditalic_A.png',
action: {
type: 'encapsulate',
options: {
pre: "'''''",
periMsg: wgULS("粗斜体文字","粗斜體文字"),
post: "'''''"
}
}
},
'strikethrough': {
label: '删除线',
type: 'button',
icon: '/media/wikipedia/commons/1/1a/Toolbaricon_strike.png',
action: {
type: 'encapsulate',
options: {
pre: "<s>",
post: "</s>"
}
}
},
'underline': {
label: '下划线',
type: 'button',
icon: '/media/wikipedia/commons/thumb/9/99/Gnome-format-text-underline.svg/22px-Gnome-format-text-underline.svg.png',
action: {
options: {
pre: "<u>",
post: "</u>"
}
}
}
}
});
this.wikiEditor('addToToolbar', {
'section': 'advanced',
'group': 'insert',
'tools': {
'source': {
label: '源代码',
type: 'button',
icon: '/media/wikipedia/commons/thumb/1/1b/Toolbaricon_source.svg/22px-Toolbaricon_source.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<source lang=\"text\">",
post: '</source>'
}
}
},
'math': {
label: '数学公式',
type: 'button',
icon: '/media/wikipedia/commons/thumb/c/c2/Nuvola_apps_edu_mathematics-p.svg/22px-Nuvola_apps_edu_mathematics-p.svg.png',
action: {
type: 'encapsulate',
options: {
pre: "<math>",
periMsg: '插入数学公式',
post: "</math>"
}
}
}
}
});
});
});
});