הבדלים בין גרסאות בדף "מדיה ויקי:Gadget-rollBackSummary.js"

מתוך ויקיסוגיה
קפיצה לניווט קפיצה לחיפוש
(יצירת דף עם התוכן "/* * Adds option to add summary to rollback revets. * Written by he:User:Yonidebest based on en:User:Ilmari Karonen's script. * Translated to Hebrew...")
 
(אין הבדלים)

גרסה אחרונה מ־19:57, 1 בנובמבר 2020

/*
 * Adds option to add summary to rollback revets.
 * Written by [[:he:User:Yonidebest]] based on [[:en:User:Ilmari Karonen]]'s script.
 * Translated to Hebrew by [[User:ברק שושני]]
 * Rewritten by [[User:קיפודנחש]]
 *
 */ 
mw.hook( 'wikipage.content' ).add( function( content ) {
	var hist = mw.util.getParamValue( 'action' ) == 'history',
		rollbackSummaryClass = 'rollback-summary-link';
	if ($( '.' + rollbackSummaryClass ).length ) return;
	$( 'span.mw-rollback-link', content )
		.append(' | ')
		.append(
			$( '<a>', { href: '#', 'class': rollbackSummaryClass, title: 'שחזור מהיר עם תקציר', text: 'תקציר' })
			.click( function() {
				var summary = $.trim( prompt( 'אנא הזינו תקציר לשחזור') || '' );
				if ( summary ) 
					$( this ).attr( 'href', $(this).siblings( 'a:first' ).attr( 'href' ) + '&summary=' + encodeURIComponent( summary ) );
			}));
});