Jump to content

User:Ansumang/toolbaroptns.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
if ( typeof $ != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
	$(document).ready( function() {
               $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'strikethrough': {
					label: 'Strike',
					type: 'button',
					icon: '//up.wiki.x.io/wikipedia/commons/9/95/Toolbaricon_strike_s.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<s>",
							post: "</s>"
						}
					}
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'hline': {
					label: 'Horizontal line',
					type: 'button',
					icon: '//up.wiki.x.io/wikipedia/commons/b/b4/Toolbaricon_rule.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "----",
							ownline: true
						}
					}
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'comment': {
					label: 'HTML comment',
					type: 'button',
					icon: '//up.wiki.x.io/wikipedia/commons/e/e7/Toolbaricon_hidden.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<!-- ",
							post: " -->"
						}
					}
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'math': {
					label: 'Math',
					type: 'button',
					icon: '//up.wiki.x.io/wikipedia/commons/1/1c/Toolbaricon_math.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<math>",
							post: "</math>"
						}
					}
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'blockquote': {
					label: 'Blockquote',
					type: 'button',
					icon: '//up.wiki.x.io/wikipedia/commons/4/4e/Toolbaricon_quote.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<blockquote>",
							post: "</blockquote>"
						}
					}
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'transclude': {
					label: 'Transclude',
					type: 'button',
					icon: '//up.wiki.x.io/wikipedia/commons/2/20/Toolbaricon_transclude.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "{{",
							post: "}}"
						}
					}
				}
			}
		} );

		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'insert',
			'tools': {
				'welcome': {
					label: 'Hi BASEPAGENAME',
					type: 'button',
					icon: '//up.wiki.x.io/wikipedia/commons/f/f8/Waving.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "Hi {{subst:BASEPAGENAME",
                                                        post: "}}"
					                  }
					       }
				}
			}
		} );

	} );
}