משתמש:Mikey641/תיעוד.js

מתוך ויקיפדיה, האנציקלופדיה החופשית

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

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: ללחוץ על Ctrl-F5.
if ( mw.config.get( 'wgNamespaceNumber' ) === 10 )
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_plain_green.svg&width=20', //imageFile
	'התחלה', //speedTip
	'\{\{תיעוד\/תבנית מידע\|התחלה\}\}', //tagOpen
	'', //tagClose
	'' //sampleText
);
// סוף :
kCustomMainInsertButton(
	'סוף', //imageId
	'//commons.wikimedia.org/wiki/Special:Redirect?wptype=file&wpvalue=Symbol_plain_red.svg&width=20', //imageFile
	'סוף', //speedTip
	'\{\{תיעוד\/תבנית מידע\|סוף\}\}', //tagOpen
	'', //tagClose
	'' //sampleText
);
// תיעוד :
kCustomMainInsertButton(
	'תיעוד', //imageId
	'//commons.wikimedia.org/wiki/Special:Redirect?wptype=file&wpvalue=Symbol_plain_blue.svg&width=20', //imageFile
	'תיעוד', //speedTip
	'\{\{תיעוד תבנית\}\}', //tagOpen
	'', //tagClose
	'' //sampleText
);
}