MediaWiki:Common.js: Difference between revisions

From Leo's Notes
This page was last edited on 6 April 2020, at 23:22.
No edit summary
toolbar buttons
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
$( function() {
if ( typeof $.fn.wikiEditor != 'undefined' ) {
$('#wpTextbox1').wikiEditor('addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'code': {
label: 'code',
type: 'button',
oouiIcon: 'code',
action: {
type: 'encapsulate',
options: {
pre: "{{code|",
post: "}}"
}
}
}
}
});
$('#wpTextbox1').wikiEditor('addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'terminal': {
label: 'highlight',
type: 'button',
oouiIcon: 'tag',
action: {
type: 'encapsulate',
options: {
pre: "{{highlight|lang=terminal|code=",
post: "}}"
}
}
}
}
});
}
});

Revision as of 23:22, 6 April 2020

$( function() {
	 if ( typeof $.fn.wikiEditor != 'undefined' ) {
		$('#wpTextbox1').wikiEditor('addToToolbar', {
				'section': 'main',
				'group': 'format',
				'tools': {
						'code': {
								label: 'code',
								type: 'button',
								oouiIcon: 'code',
								action: {
										type: 'encapsulate',
										options: {
												pre: "{{code|",
												post: "}}"
										}
								}
						}
				}
		});
		$('#wpTextbox1').wikiEditor('addToToolbar', {
				'section': 'main',
				'group': 'format',
				'tools': {
						'terminal': {
								label: 'highlight',
								type: 'button',
								oouiIcon: 'tag',
								action: {
										type: 'encapsulate',
										options: {
												pre: "{{highlight|lang=terminal|code=",
												post: "}}"
										}
								}
						}
				}
		});
	 
	 }
});