帮助:沙盒:修订间差异
来自 LNN的:not(博客)?
更多操作
小无编辑摘要 |
|||
| 第139行: | 第139行: | ||
== customized edit toolbar == | == customized edit toolbar == | ||
<html><script> | <html><style> | ||
#lnnblog-edittoolbar { | |||
font-size: 0.75rem; | |||
} | |||
#lnnblog-edittoolbar div { | |||
display: inline-block; | |||
margin-right: 0.25rem; | |||
} | |||
#lnnblog-edittoolbar button { | |||
margin-right: 1px; | |||
font-size: inherit; | |||
line-height: 1.25; | |||
} | |||
</style><script> | |||
$( function () { | $( function () { | ||
var newToolbar = $( '<div id="lnnblog-edittoolbar">' ) | |||
$ | /* 重新定义编辑工具栏 */ | ||
function addButton(label, before, after, sample) { | if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) { | ||
var $newToolbar = $( '<div id="lnnblog-edittoolbar" lang="zh-cmn-Hans">' ) | |||
} | var $group = null | ||
addButton(" | |||
function addButton( label, title, before, after, sample ) { | |||
$group.append( $( "<button>" ) | |||
/ | .attr( "type", "button" ) | ||
// | .attr( "class", "lnnblog-button-small" ) | ||
.attr( "title", title ) | |||
.append( $( "<tt>" ).text( label ) ) | |||
mw. | .on( "mousedown", false ) // 防止焦点离开文本框 | ||
.click( mw.toolbar.insertTags.bind(mw.toolbar, before, after || "", sample || "") ) ) | |||
} | } | ||
function newGroup() { | |||
$group = $( '<div>' ).appendTo( $newToolbar ) | |||
} | |||
newGroup() | |||
addButton( "le", "英文文本", "{{le|", "}}" ) | |||
addButton( "lj", "逻辑语文本", "{{lj|", "}}" ) | |||
addButton( "lang", "文本语言", "{{lang|und|", "}}" ) | |||
newGroup() | |||
addButton( "[[]]", "内链", "[[", "]]" ) | |||
addButton( "lelink", "英文内链", "{{lelink|", "}}" ) | |||
addButton( "ljlink", "逻辑语内链", "{{lelink|", "}}" ) | |||
addButton( "{{|}}", "模板调用", "{{|", "}}" ) | |||
newGroup() | |||
addButton( "h2", "二级标题", "== ", " ==" ) | |||
addButton( "h3", "三级标题", "=== ", " ===" ) | |||
newGroup() | |||
addButton( "table", "wikitable 表格", "{|class=wikitable\n! ", "\n|-\n|\n|}" ) | |||
addButton( "box", "box 模板", "{{box|标题|2=\n", "\n}}" ) | |||
addButton( "hidebox", "hidebox 模板", "{{hidebox|标题|2=\n", "\n}}" ) | |||
newGroup() | |||
addButton( "nw", "nowiki 标签", "<nowiki>", "</nowiki>" ) | |||
addButton( "nw/", "空 nowiki 标签", "<nowiki/>" ) | |||
addButton( "code", "行内代码", "{{code|", "}}" ) | |||
addButton( "codenw", "nowiki 代码", "{{code|<nowiki>", "</nowiki>}}" ) | |||
addButton( "pre", "pre 块", "<pre>\n", "\n</pre>" ) | |||
addButton( "syntax", "代码高亮块", "<syntaxhighlight lang=javascript>\n", "\n</syntaxhighlight>" ) | |||
newGroup() | |||
addButton( "html", "原始 HTML 标签", "<html>", "<\/html>" ) | |||
addButton( "/html", "反向原始 HTML 标签", "<\/html>", "<html>" ) | |||
addButton( "phack", "原始 HTML 块", "{{MywikiParaHack|<html>", "<\/html>}}" ) | |||
newGroup() | |||
addButton( "subst", "模板替代", "{{subst:", "}}" ) | |||
addButton( "pn", "当前页面名称", mw.config.get( 'wgTitle' ) ) | |||
addButton( "bpn", "粗体的当前页面名称", "'''" + mw.config.get( 'wgTitle' ) + "'''" ) | |||
addButton( "fpn", "带名字空间的当前页面名称", mw.config.get( 'wgPageName' ) ) | |||
newGroup() | |||
addButton( "Cat", "分类", "[[分类:", "]]" ) | |||
addButton( "SORT", "默认排序字", "{{DEFAULTSORT:", "}}", mw.config.get( "wgTitle" ) ) | |||
newGroup() | |||
addButton( "<!--", "HTML 注释", "<!--", "-->" ) | |||
addButton( "ni", "noinclude 标签", "<noinclude>", "</noinclude>" ) | |||
addButton( "ni/", "空 noinclude 标签", "<noinclude/>", "" ) | |||
addButton( "io", "includeonly 标签", "<includeonly>", "</includeonly>" ) | |||
addButton( "oi", "onlyinclude 标签", "<onlyinclude>", "</onlyinclude>" ) | |||
$( "#ydnedittoolbar" ).parent().replaceWith( $newToolbar ) | |||
} | |||
} ) | } ) | ||
</script></html> | </script></html> | ||
2022年11月24日 (四) 14:14的版本
lnncrypt
. . , ,“”!!(
Animated {{Hidebox}}?
hidebox
一二三四五,上山打老虎。
customized edit toolbar