跳转到内容

User:Shizhao/Edittools-vector.js

维基百科,自由的百科全书

这是本页的一个历史版本,由Shizhao留言 | 贡献2010年7月1日 (四) 14:21编辑。这可能和当前版本存在着巨大的差异。

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
// To add a group to an existing toolbar section:

if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'strikethrough': {
					label: '删除线',
					type: 'button',
					icon: '/media/wikipedia/commons/thumb/4/45/Gnome-format-text-strikethrough.svg/22px-Gnome-format-text-strikethrough.svg.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<s>",
							post: "</s>"
						}
					}
				}
			}
		} );
	} );
}

if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'underline': {
					label: '下划线',
					type: 'button',
					icon: '/media/wikipedia/commons/thumb/9/99/Gnome-format-text-underline.svg/22px-Gnome-format-text-underline.svg.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<u>",
							post: "</u>"
						}
					}
				}
			}
		} );
	} );
}

if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'quote': {
					label: '块引用',
					type: 'button',
					icon: '/media/wikipedia/commons/4/4e/Toolbaricon_quote.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<blockquote>",
							post: "</blockquote>"
						}
					}
				}
			}
		} );
	} );
}

if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'insert',
			'tools': {
				'math': {
					label: '数学公式',
					type: 'button',
					icon: '/media/wikipedia/commons/1/1c/Toolbaricon_math.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<math>",
							post: "</math>"
						}
					}
				}
			}
		} );
	} );
}
if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'insert',
			'tools': {
				'template': {
					label: '模板',
					type: 'button',
					icon: '/media/wikipedia/commons/thumb/f/fb/Template_icon.svg/22px-Template_icon.svg.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "{{",
							post: "}}"
						}
					}
				}
			}
		} );
	} );
}

if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'insert',
			'tools': {
				'hidden': {
					label: '注释或隐藏文字',
					type: 'button',
					icon: '/media/wikipedia/commons/e/e7/Toolbaricon_hidden.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<!-- ",
							post: " -->"
						}
					}
				}
			}
		} );
	} );
}

if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'insert',
			'tools': {
				'hline': {
					label: '水平线',
					type: 'button',
					icon: '/media/wikipedia/commons/b/b4/Toolbaricon_rule.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "----",
							ownline: true
						}
					}
				}
			}
		} );
	} );
}

if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'insert',
			'tools': {
				'hans-hant': {
					label: '繁简转换',
					type: 'button',
					icon: '/media/wikipedia/commons/9/9d/Toolbaricon_sr.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "-{",
							post: "}-"
						}
					}
				}
			}
		} );
	} );
}

if ( typeof $j != 'undefined' && typeof $j.fn.wikiEditor != 'undefined' ) {
	$j(document).ready( function() {
		$j( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'insert',
			'tools': {
				'mediafile': {
					label: '媒体文件链接',
					type: 'button',
					icon: '/media/wikipedia/commons/6/65/Toolbaricon_media.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "[[Media:",
                                                        periMsg: 'Example.ogg', 
							post: "]]"
						}
					}
				}
			}
		} );
	} );
}