לדלג לתוכן

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

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

גרסה מ־16:06, 9 במרץ 2012

/*
 * 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:קיפודנחש]]
 *
 */ 
$(document).ready(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 ? '' : ']');
});