Difference between revisions of "MediaWiki:Common.js"

From PolyCraft World
Jump to: navigation, search
(Created page with "Any JavaScript here will be loaded for all users on every page load.: $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'main', groups: { list: { tools: {...")
 
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'main',
+
'sections': {
groups: {
+
'emoticons': {
list: {
+
'type': 'toolbar', // Can also be 'booklet'
tools: {
+
'label': 'Emoticons'
templates: {
+
// or 'labelMsg': 'section-emoticons-label' for a localized label
label: 'Templates',
+
type: 'select',
+
list: {
+
'Ping-button': {
+
label: '{{Ping}}',
+
action: {
+
type: 'encapsulate',
+
options: {
+
pre: '{{Ping|',
+
post: '}}'
+
}
+
}
+
},
+
'Clear-button': {
+
label: 'Clear',
+
action: {
+
type: 'encapsulate',
+
options: {
+
pre: '{{Clear}}'
+
}
+
}
+
},
+
'Done-button': {
+
label: 'Done',
+
action: {
+
type: 'encapsulate',
+
options: {
+
pre: '{{Done}}'
+
}
+
}
+
}
+
}
+
}
+
}
+
 
}
 
}
 
}
 
}
 
} );
 
} );

Revision as of 01:33, 11 December 2018

/* Any JavaScript here will be loaded for all users on every page load. */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'sections': {
		'emoticons': {
			'type': 'toolbar', // Can also be 'booklet'
			'label': 'Emoticons'
			// or 'labelMsg': 'section-emoticons-label' for a localized label
		}
	}
} );