לדלג לתוכן

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

מתוך צפונות ויקי
פיינשמקרים לא גומרים.
hook
שורה 6: שורה 6:
  *
  *
  */  
  */  
$(document).ready(function() {
mw.hook( 'wikipage.content' ).add( function() {
var hist = mw.util.getParamValue('action') == 'history';  
var hist = mw.util.getParamValue( 'action' ) == 'history';  
$('span.mw-rollback-link')
$( 'span.mw-rollback-link' )
.append(hist ? ' | ' : '[')
.append(hist ? ' | ' : '[')
.append(
.append(
$('<a>', {href: '#', title: 'שחזור מהיר עם תקציר', text: 'תקציר'})
$( '<a>', { href: '#', title: 'שחזור מהיר עם תקציר', text: 'תקצי ר '})
.click(function() {
.click( function() {
var summary = $.trim(prompt('אנא הזינו תקציר לשחזור') || '');
var summary = $.trim( prompt( 'אנא הזינו תקציר לשחז ור') || '' );
if (summary)  
if ( summary )  
$(this).attr('href', $(this).siblings('a:first').attr('href') + '&summary=' + encodeURIComponent(summary));
$( this ).attr( 'href', $(this).siblings( 'a:first' ).attr( 'href' ) + '&summary=' + encodeURIComponent( summary ) );
}))
}))
.append(hist ? '' : ']');
.append( hist ? '' : ']' );
});
});

גרסה מ־20:14, 10 במאי 2017

/*
 * 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() {
	var hist = mw.util.getParamValue( 'action' ) == 'history'; 
	$( 'span.mw-rollback-link' )
		.append(hist ? ' | ' : '[')
		.append(
			$( '<a>', { href: '#', title: 'שחזור מהיר עם תקציר', text: 'תקצי ר '})
			.click( function() {
				var summary = $.trim( prompt( 'אנא הזינו תקציר לשחז ור') || '' );
				if ( summary ) 
					$( this ).attr( 'href', $(this).siblings( 'a:first' ).attr( 'href' ) + '&summary=' + encodeURIComponent( summary ) );
			}))
		.append( hist ? '' : ']' );
});