Suradnica:Roberta F./extratoolbarbuttons.js

Izvor: Wječnik

Napomena: Nakon objave možda ćete trebati očistiti međuspremnik svog preglednika kako biste vidjeli promjene.

  • Firefox / Safari: držite Shift i pritisnite Reload, ili pritisnite bilo Ctrl-F5 ili Ctrl-R (⌘-R na Macu)
  • Google Chrome: pritisnite Ctrl-Shift-R (⌘-Shift-R na Macu)
  • Internet Explorer / Edge: držite Ctrl i kliknite Refresh, ili pritisnite Ctrl-F5
  • Opera: pritisnite Ctrl-F5.
if ( typeof $ != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
	$(document).ready( function() {
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'advanced',
			'group': 'format',
			'tools': {
				'strikethrough': {
					label: 'Strike',
					type: 'button',
					icon: 'http://upload.wikimedia.org/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: 'http://upload.wikimedia.org/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: 'http://upload.wikimedia.org/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: 'http://upload.wikimedia.org/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: 'http://upload.wikimedia.org/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: 'http://upload.wikimedia.org/wikipedia/commons/2/20/Toolbaricon_transclude.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "{{",
							post: "}}"
						}
					}
				}
			}
		} );
	} );
}