ವಿಷಯಕ್ಕೆ ಹೋಗು

ಮೀಡಿಯವಿಕಿ:Gadget-extra-toolbar-buttons-core.js

ವಿಕಿಸೋರ್ಸ್ದಿಂದ

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.
// <nowiki>
/*global mw */
/*jshint strict: false, browser: true, jquery: true */
/**
 * Extra toolbar options
 *  
 *  Description: Adds extra buttons to the old (non-enhanced) editing toolbar.
 *  
 *  Maintainers: [[User:MarkS]], [[User:Voice of All]], [[User:R. Koot]]
 */

function addExtraButtons () {
	mw.toolbar.addButtons(
	{
		imageId: 'button-redirect',
		imageFile: '//upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png',
		speedTip: 'Redirect',
		tagOpen: '#REDIRECT[[',
		tagClose: ']]',
		sampleText: 'Target page name'
	},
	{
		imageId: 'button-strike',
		imageFile: '//upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png',
		speedTip: 'Strike',
		tagOpen: '<s>',
		tagClose: '</s>',
		sampleText: 'Strike-through text'
	},
	{
		imageId: 'button-enter',
		imageFile: '//upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png',
		speedTip: 'Line break',
		tagOpen: '<br/>',
		tagClose: '',
		sampleText: ''
	},
	{
		imageId: 'button-subscript',
		imageFile: '//upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png',
		speedTip: 'Subscript',
		tagOpen: '{{sub|',
		tagClose: '}}',
		sampleText: 'Subscript text'
	},
	{
		imageId: 'button-superscript',
		imageFile: '//upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png',
		speedTip: 'Superscript',
		tagOpen: '{{sup|',
		tagClose: '}}',
		sampleText: 'Superscript text'
	},
	{
		imageId: 'button-small',
		imageFile: '//upload.wikimedia.org/wikipedia/en/5/58/Button_small.png',
		speedTip: 'Smaller',
		tagOpen: '{{smaller|',
		tagClose: '}}',
		sampleText: 'Smaller text'
	},
	{
		imageId: 'mw-customeditbutton-templatelarger',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/5/56/Button_big.png',
		speedTip: 'Larger',
		tagOpen: '{{larger|',
		tagClose: '}}',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-templatesmallcaps',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/4/4e/Button_romain.png',
		speedTip: 'sc ',
		tagOpen: '{{sc|',
		tagClose: '}}',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-templatecenter',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/5/5f/Button_center.png',
		speedTip: 'Centre text',
		tagOpen: '{{center|',
		tagClose: '}}',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-linkauthor',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/8/83/Button_biocitas.png',
		speedTip: 'Author link',
		tagOpen: '[[Author:',
		tagClose: '|]]',
		sampleText: ''
	},
	{
		imageId: 'button-insert-reflink',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png',
		speedTip: 'Insert a reference',
		tagOpen: '<ref>',
		tagClose: '</ref>',
		sampleText: 'Insert footnote text here'
	},
	{
		imageId: 'mw-customeditbutton-templatehwe',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/0/07/Hyphenated_word_end.svg',
		speedTip: 'hwe ',
		tagOpen: '{{hyphenated word end|',
		tagClose: '|}}',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-substitution',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/2/20/Button_subst.png',
		speedTip: 's: ',
		tagOpen: '{{subst:',
		tagClose: '}}',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-linkwikipedia',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/7/7f/Button_link_to_Wikipedia.png',
		speedTip: 'Wikipedia link',
		tagOpen: '[[w:',
		tagClose: '|]]',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-textforcesentencecase',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/1/12/Button_case.png',
		speedTip: 'force sentence case',
		tagOpen: '{{'+'subst:ucfirst:{{'+'subst:lc:',
		tagClose: '}}}}',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-pagesdjvu',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/7/74/Documents_icon.svg',
		speedTip: 'pg ',
		tagOpen: '<pages index=".djvu" from= to= fromsection="" tosection=""',
		tagClose: '/>',
		sampleText: ''
	},
		{
		imageId: 'mw-customeditbutton-linkitalics',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/4/4d/Farm-Fresh_book_link.png',
		speedTip: 'bk ',
		tagOpen: '\'\'[[',
		tagClose: ']]\'\'',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-taginsertreference',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png',
		speedTip: 'ref',
		tagOpen: '{{'+'subst:#tag:ref|',
		tagClose: '}}',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-sectionbegin',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/0/06/Tag_green.png',
		speedTip: 'section begin',
		tagOpen: '<section begin="',
		tagClose: '" />',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-sectionend',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/d/dd/Tag_red.png',
		speedTip: 'section end',
		tagOpen: '<section end="',
		tagClose: '" />',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-tagtemplateblockcenterpoem',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/4/4f/Button_verse.png',
		speedTip: 'spm',
		tagOpen: '{{block center|<poem>',
		tagClose: '</poem>}}',
		sampleText: ''
	},
	{
		imageId: 'mw-customeditbutton-EB9',
		imageFile: '//upload.wikimedia.org/wikipedia/commons/d/db/Button_with_wikinumber_character.png',
		speedTip: 'EB9 ',
		tagOpen: '{{sc|[[Author:',
		tagClose: '|]]}}',
		sampleText: ''
	}

	);
}

mw.loader.using( 'user.options', function () {
	// This can be the string "0" if the user disabled the preference ([[bugzilla:52542#c3]])
	if ( mw.user.options.get( 'usebetatoolbar' ) != 1 && mw.user.options.get( 'gadget-legacyToolbar' ) == 1 ) {
		mw.hook("mw.toolbar").add( addExtraButtons );
	}
} );
// </nowiki>