לדלג לתוכן

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

מתוך צפונות ויקי
מ עדכון של משתמש:קיפודנחש
מ תיקון של קיפודנחש - תיקון איטיות מסוימת.
שורה 6: שורה 6:
  *
  *
  */  
  */  
$(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').append(
                $('<a>', {href: '#', title: 'שחזור מהיר עם תקציר'})
$('<a>', {href: '#', title: 'שחזור מהיר עם תקציר'})
                .text(hist ? ' | תקציר' : '[תקציר]')
.text(hist ? ' | תקציר' : '[תקציר]')
                .click(function() {
.click(function() {
                        var summary = $.trim(prompt('אנא הזינו תקציר לשחזור') || '');
var summary = $.trim(prompt('אנא הזינו תקציר לשחזור') || '');
                        if (summary)  
if (summary)  
                                window.location = $(this).parent().find('a:eq(0)').attr('href') + '&summary=' + encodeURIComponent(summary);
$(this).attr('href', $(this).parent().find('a:eq(0)').attr('href') + '&summary=' + encodeURIComponent(summary));
                }));
}));
});
});

גרסה מ־18:15, 2 בדצמבר 2011

/*
 * 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(
		$('<a>', {href: '#', title: 'שחזור מהיר עם תקציר'})
		.text(hist ? ' | תקציר' : '[תקציר]')
		.click(function() {
			var summary = $.trim(prompt('אנא הזינו תקציר לשחזור') || '');
			if (summary) 
				$(this).attr('href', $(this).parent().find('a:eq(0)').attr('href') + '&summary=' + encodeURIComponent(summary));
		}));
});