Jump to content

User:Mono/vote.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
if ( typeof $ != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
	$( document ).ready( function() {
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'sections': {
				'voting': {
					'type': 'toolbar',
					'label': 'Voting'
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'voting',
			'groups': {
				'voting': {
					'label': 'Voting'
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'voting',
			'group': 'voting',
			'tools': {
				'smile': {
					label: 'Like',
					type: 'button',
					icon: 'http://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/Pictogram_voting_support.svg/25px-Pictogram_voting_support.svg.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "[[File:Pictogram voting support.svg|20px]]"
						}
					}
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'voting',
			'group': 'voting',
			'tools': {
				'smile': {
					label: 'Dislike',
					type: 'button',
					icon: 'http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Pictogram_voting_delete.svg/25px-Pictogram_voting_delete.svg.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "[[File:Pictogram voting delete.svg|20px]]"
						}
					}
				}
			}
		} );
	} );
}