User:Perhelion/Wikieditor-config.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
/********************************
**   Extra buttons in toolbar  **
*********************************/
//<nowiki>
var cUrl = '//upload.wikimedia.org/wikipedia/commons/';

mw.libs.wikieditor = {
config: function (we) {
'use strict';
we.remove('link', true);
we.remove('signature', true);
we.addMyButton('', cUrl + 'thumb/f/ff/Interlink_alt.svg/24px-Interlink_alt.svg.png',
		'Wiki-Link', '[[', '', ']]');
we.addMyButton('', cUrl + 'thumb/5/5f/Image-x-generic.svg/24px-Image-x-generic.svg.png',
		'File:', '[[File:', '', ']]');
we.addButton('', 'T');
we.addMyButton('advanced', cUrl + '1/1d/Кнопка.png', 'mark', '<mark>', '', '<\/mark>', false, ''); // mark

if (ext) { // On file
	we.addMyButton(// Own work
		'', //position
		cUrl + 'thumb/0/03/Persons.svg/22px-Persons.svg.png', //imageFile
		'Own work', //speedTip
		'{{Own work}} ', //tagOpen
		'', //sampleText
		'\n', //tagClose
		true //ownline
	);
	if (!ext.indexOf("GIF"))
		we.addMyButton(// BadGIF
			'', //position
			cUrl + 'thumb/0/0e/No_GIF.svg/22px-No_GIF.svg.png',
			'Insert {BadGIF}', //speedTip
			'{{BadGIF}}', //tagOpen
			'', //sampleText
			'\n', //tagClose
			true, //ownline
			//callbackFunc:
			we.addComment("BadGIF+ "));
	else if (!ext.indexOf("PDF"))
		we.addMyButton(// BadPDF
			'', //position
			cUrl + 'thumb/4/47/No_PDF.svg/22px-No_PDF.svg.png',
			'Insert {BadPDF}', //speedTip
			'{{BadPDF}}', //tagOpen
			'', //sampleText
			'\n', //tagClose
			true, //ownline
			//callbackFunc:
			we.addComment("BadPDF+ "));
	else if (!ext.indexOf("JPG"))
		we.addMyButton(// BadJPEG
			'', //position
			cUrl + 'thumb/a/ad/No_JPG.svg/22px-No_JPG.svg.png',
			'Insert {BadJPEG}', //speedTip
			'{{BadJPEG}}', //tagOpen
			'', //sampleText
			'\n', //tagClose
			true, //ownline
			//callbackFunc:
			we.addComment("BadJPEG+ "));
	else if (bSVG) {
		we.addMyButton(// BadSVG
			'', //position
			cUrl + 'thumb/d/d4/No_SVG.svg/24px-No_SVG.svg.png',
			'Insert {BadSVG}', //speedTip
			'{{BadSVG}}', //tagOpen
			'', //sampleText
			'\n', //tagClose
			true, //ownline
			//callbackFunc:
			we.addComment("BadSVG+ "));

		we.addMyButton(// TracedSVG
			'', //position
			cUrl + 'thumb/1/1e/Gnome-x-office-drawing-warning.svg/24px-Gnome-x-office-drawing-warning.svg.png',
			'Insert {TracedSVG}', //speedTip
			'{{TracedSVG', //tagOpen
			'|', //sampleText
			'}}\n', //tagClose
			true, //ownline
			//callbackFunc:
			we.addComment("TracedSVG+ "));

		we.addMyButton(// Valid SVG
			'', //position
			cUrl + 'thumb/0/08/W3C_Svalid.svg/24px-W3C_Svalid.svg.png',
			'Insert Valid SVG', //speedTip
			'{{Valid SVG}}', //tagOpen
			'', //sampleText
			'\n', //tagClose
			true, //ownline
			//callbackFunc:
			we.addComment("Valid SVG+ "));
		we.addMyButton(// Invalid SVG
			'', //position
			cUrl + 'thumb/6/6c/W3C_invalid.svg/24px-W3C_invalid.svg.png',
			'Insert Invalid SVG', //speedTip
			'{{Invalid SVG}}', //tagOpen
			'', //sampleText
			'\n', //tagClose
			true, //ownline
			//callbackFunc:
			we.addComment("Invalid SVG+ "));
		// AttribSVG:
		we.addMyButton(
			'', //position
			cUrl + 'thumb/2/27/SVG_in_SVG.svg/20px-SVG_in_SVG.svg.png',
			'take {AttribSVG}', //speedTip
			'{{AttribSVG', //tagOpen
			'||', //sampleText
			'}}', //tagClose
			true, //ownline
			//callbackFunc:
			we.addComment("AttribSVG+ "));
	}
	we.addMyButton(// {Artifacts}:
		'', //position
		cUrl + 'thumb/3/35/Information_icon.svg/22px-Information_icon.svg.png',
		'Insert {Artifacts}', //speedTip
		'{{Artifacts}}', //tagOpen
		'', //sampleText
		'\n', //tagClose
		true, //ownline
		//callbackFunc:
		we.addComment("Artifacts+ "));
	// {Low quality}
	we.addMyButton(
		'', //position
		cUrl + 'thumb/7/7f/Dialog-error.svg/22px-Dialog-error.svg.png',
		'Insert {Low quality}', //speedTip
		'{{Low quality}}', //tagOpen
		'', //sampleText
		'\n', //tagClose
		true, //ownline
		//callbackFunc:
		we.addComment("Low quality+ "));
	// Unreferenced
	we.addMyButton(
		'', //position
		cUrl + '3/3c/Oppose_blurry.png',
		'Unreferenced', //speedTip
		'{{Unreferenced', //tagOpen
		'|detail', //sampleText
		'}}\n', //tagClose
		true, //ownline
		//callbackFunc:
		we.addComment("Unreferenced+ "));
	// {Grafikwerkstatt}
	we.addMyButton(
		'', //position
		cUrl + 'thumb/9/93/Crystal_Clear_app_gimp.png/22px-Crystal_Clear_app_gimp.png',
		'Insert {Grafikwerkstatt}', //speedTip
		'{{Grafikwerkstatt}}', //tagOpen
		'', //sampleText
		'\n', //tagClose
		true, //ownline
		//callbackFunc:
		we.addComment("Grafikwerkstatt+ "));
	// {Retouched picture} {{Retouched picture origoff= }}
	we.addMyButton(
		'', //position
		cUrl + 'thumb/7/76/Applications-graphics.svg/22px-Applications-graphics.svg.png',
		'Insert Retouched picture', //speedTip
		'{{Retouched picture|1=', //tagOpen
		'Modifications', //sampleText
		'|editor=' + mw.config.get("wgUserName") + '|orig= file}}', //tagClose
		true, //ownline
		//callbackFunc:
		we.addComment("Retouched picture+ "));

	if (ext.indexOf('PNG')) // Convert to PNG:
		we.addMyButton(
			'', //position
			cUrl + 'thumb/6/6a/Xee_png.png/22px-Xee_png.png',
			'Convert to PNG', //speedTip
			'{{Convert to PNG}}', //tagOpen
			'', //sampleText
			'', //tagClose
			true, //ownline
			//callbackFunc:
			we.addComment("Convert to PNG+ "));

	// Superseded PNG:
	we.addMyButton(
		'', //position
		cUrl + 'thumb/d/d2/File_equals_PNG_icon.svg/23px-File_equals_PNG_icon.svg.png',
		'Superseded PNG', //speedTip
		'{{SupersededPNG|', //tagOpen
		mw.config.get('wgTitle').replace(/\.\D{3}\D?$/, '.png'), //sampleText
		'}}', //tagClose
		true, //ownline
		//callbackFunc:
		we.addComment("Superseded PNG+ "));


	// Insignia without source:
	we.addMyButton(
		'', //position
		cUrl + 'thumb/1/19/Unknown_Blazon_red.svg/24px-Unknown_Blazon_red.svg.png',
		'Lacking insignia source', //speedTip
		'{{Lacking insignia source', //tagOpen
		'', //sampleText
		'}}', //tagClose
		0, //ownline
		//callbackFunc:
		we.addComment(" +Lacking insignia source"));

	// Uncategorized:
	we.addMyButton('', //position
		cUrl + '1/10/Button_category04.png',
		'Uncategorized', //speedTip
		'{{subst:unc}}', //tagOpen
		'', //sampleText
		'', //tagClose
		true, //ownline
		we.addComment("Uncategorized+ ") //callbackFunc:
	);

	// Image extracted:
	we.addMyButton(
		'', //position
		cUrl + 'thumb/e/e3/Image_Crop_Icon.svg/22px-Image_Crop_Icon.svg.png',
		'take {Image extracted}', //speedTip
		'|other fields = {{Image extracted|', //tagOpen
		'{{subst:#invoke:file|woExtension}} (cropped).{{subst:#invoke:file|extension}}', //sampleText
		'}}', //tagClose
		true, //ownline
		//callbackFunc:
		we.addComment(" +Image extracted}"));

	// Description-title:
	we.addMyButton(
		'', //position
		cUrl + 'b/be/Button_Filedesc.png',
		'Description', //speedTip
		'=={{int:filedesc}}==', //tagOpen
		'', //sampleText
		'', //tagClose
		true //ownline
	);

	// License-title:
	we.addMyButton(
		'', //position
		cUrl + '1/15/Button_License.png',
		'License-title', //speedTip
		'=={{int:license-header}}==', //tagOpen
		'', //sampleText
		'', //tagClose
		true //ownline
	);

} // File end

/* Edit request:
we.addMyButton(
	'', //position
	cUrl + 'thumb/5/59/Padlock.svg/22px-Padlock.svg.png',
	'take {Edit request}', //speedTip
	'{{Edit request', //tagOpen
	'|category=|technical=', //sampleText
	'}}', //tagClose
	true, //ownline
	//callbackFunc:
	we.addComment("Edit request+ "));*/

we.addMySelect('', // talk notes
	'Bewertungen',
	[['Pro', '{{Pro}} ', '', '', false, we.addComment('Pro')],
	['Contra', '{{Contra}} ', '', '', false, we.addComment('Contra')],
	['Neutral', '{{Neutral}} ', '', '', false, we.addComment('Neutral')],
	['Comment', '{{Cmt)}} ', '', '', false, we.addComment('Comment')],
	['done', '{{Done}} ', '', '', false, we.addComment('Done')],
	['info', '{{Info}} ', '', '', false, we.addComment('Info')],
	['Weak support', '{{Weak support}} ', '', '', false, we.addComment('Weak support')],
	['vd', '{{Vd}} ', '', '', false, we.addComment('Vote delete')],
	['vk', '{{Vk}} ', '', '', false, we.addComment('Vote keep')],
	['Disagree', '{{Disagree}} ', '', '', false, we.addComment('Disagree')],
	['Agree', '{{Agree}} ', '', '', false, we.addComment('Agree')]
]);

// Seealso-title:
we.addMyButton(
	'', //position
	cUrl + '0/01/Button_Seealso.png',
	'Seealso-title', //speedTip
	'=={{int:Seealso}}==', //tagOpen
	'', //sampleText
	'', //tagClose
	true //ownline
);

// de:
we.addMyButton(
	'', //position
	cUrl + 'thumb/6/61/Lilyu_Custom_Button_de.svg/23px-Lilyu_Custom_Button_de.svg.png',
	'de|', //speedTip
	'{{de|', //tagOpen
	'1=', //sampleText
	'}}', //tagClose
	true //ownline
);

// en:
we.addMyButton(
	'', //position
	cUrl + 'thumb/2/22/Lilyu_Custom_Button_en.svg/23px-Lilyu_Custom_Button_en.svg.png',
	'en|', //speedTip
	'{{en|', //tagOpen
	'1=', //sampleText
	'}}', //tagClose
	true //ownline
);

we.addMySelect('advanced', 'Code', [
		['code', '<code>', 'code', '</code>'],
		['pre', '<pre>\n', 'vorvormatierter Text', '\n</pre>', {
				ownline: false,
				splitlines: false
			}
		],
		['source', '<syntaxhighlight lang="javascript" inline>\n', 'Quelltext', '\n</syntaxhighlight>', {
				ownline: false,
				splitlines: false
			}
		],
		['div', '<div style="">', 'div', '<\/div>'],
		['span', '<span style="">', 'span', '<\/span>'],
		['kbd', '<kbd>', 'kbd', '<\/kbd>']
		//['var', '<var>', 'var', '<\/var>']
	]);
}
};
//</nowiki>