-

 

ברסלבער!


האתר ברסלביקי מחפש אנשים בעלי כשרון כתיבה.


מרגיש שאתה מתאים?

הקש כאן כדי להצטרף

לוגו3.png

מדיה ויקי:סקריפטים/40.js

מתוך ברסלביקי
גרסה מ־18:39, 30 באוקטובר 2019 מאת יענק'ל (שיחה | תרומות) (יצירת דף עם התוכן "// סקריפט להוספת תבניות בעד, נגד ובוצע, נכתב על ידי User:Krinkle וUser:Matanya if ( typeof $.fn.wikiEditor != 'und...")
(הבדל) → הגרסה הקודמת | הגרסה האחרונה (הבדל) | הגרסה הבאה ← (הבדל)
קפיצה לניווט קפיצה לחיפוש

הערה: לאחר השמירה, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload), או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר: להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh), או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: לפתוח תפריט ← הגדרות (במחשב מק: Opera ← העדפות) ואז ללחוץ על פרטיות ואבטחה ← מחק היסטוריית גלישה ← Cached images and files.
// סקריפט להוספת תבניות בעד, נגד ובוצע, נכתב על ידי [[User:Krinkle]] ו[[User:Matanya]]
if ( typeof $.fn.wikiEditor != 'undefined' && typeof kCustomMainInsertButton == 'undefined' && ( mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit' )) {
	window.kCustomMainInsertButton = function(imageId,imageFile,speedTip,tagOpen,tagClose,sampleText,callbackFunc){
		// Reason for the a[b]-method instead of the much shorter a.b-method
		// is to dynamicly 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(typeof callbackFunc == 'function'){ callbackFunc(); }
				}
			}
		};
		$('#wpTextbox1').wikiEditor('addToToolbar', wikiOptions);
	};

	jQuery(document).ready(function($){
	if ( $.isFunction(kCustomMainInsertButton_config) ) {
		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
);
}