User:ProjectYA/common.js

// סקריפט להוספת תבניות בעד, נגד ובוצע, נכתב על ידי User:Krinkle וUser:Matanya if ($.fn.wikiEditor && typeof kCustomMainInsertButton === 'undefined' && (mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit')) { window.kCustomMainInsertButton = function (imageId, imageFile, speedTip, tagOpen, tagClose, sampleText, callback) { // Reason for the a[b]-method instead of the much shorter a.b-method // is to dynamically set the object name imageId var wikiOptions = {'section': 'main', 'group': 'insert', 'tools': {}}; wikiOptions.tools[imageId] = { label: speedTip, type: 'button', icon: imageFile, action: { type: 'callback', execute: function { $('#wpTextbox1').textSelection('encapsulateSelection',{						pre: tagOpen,						peri: sampleText,						post: tagClose					}); if (callback) { callback; } }			}		};		$('#wpTextbox1').wikiEditor('addToToolbar', wikiOptions); };

jQuery(function {		if (typeof kCustomMainInsertButton_config !== undefined) {			kCustomMainInsertButton_config;		}	});

} else { window.kCustomMainInsertButton = function { }; }

function kCustomMainInsertButton_config{ // בעד : kCustomMainInsertButton(	'בעד', //imageId	'//commons.wikimedia.org/wiki/Special:Redirect?wptype=file&wpvalue=Symbol_support_vote.svg&width=20', //imageFile	'בעד', //speedTip	'* {\{בעד}\} \~\~\~\~', //tagOpen	, //tagClose	 //sampleText ); // נגד : kCustomMainInsertButton(	'נגד', //imageId	'//commons.wikimedia.org/wiki/Special:Redirect?wptype=file&wpvalue=Symbol_oppose_vote.svg&width=20', //imageFile	'נגד', //speedTip	'* {\{נגד}\} \~\~\~\~', //tagOpen	, //tagClose	 //sampleText ); // בוצע : kCustomMainInsertButton(	'בוצע', //imageId	'//commons.wikimedia.org/wiki/Special:Redirect?wptype=file&wpvalue=Yes_check.svg&width=20', //imageFile	'בוצע', //speedTip	':{\{בוצע}\} \~\~\~\~', //tagOpen	, //tagClose	 //sampleText );

// הצבעה : kCustomMainInsertButton(	'הצבעה', //imageId	'//commons.wikimedia.org/wiki/Special:Redirect?wptype=file&wpvalue=Number_sign.svg&width=20', //imageFile	'הצבעה', //speedTip	'# \~\~\~\~', //tagOpen	, //tagClose	 //sampleText ); }