مدیاویکی:Gadget-decodesummary.js: تفاوت میان نسخهها
ظاهر
imported>Ebrahim ادغام از https://fa.wikipedia.org/w/index.php?title=%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:%D8%AF%D8%A7%D9%84%D8%A8%D8%A7/%DA%A9%D8%AF%D9%87%D8%A7%DB%8C_%D9%85%D9%81%DB%8C%D8%AF&diff=14769197&oldid=13715593 |
imported>Dalba next|prev|cur در diff |
||
| خط ۴: | خط ۴: | ||
setTimeout(function () { | setTimeout(function () { | ||
var val = that.val(); | var val = that.val(); | ||
val = val.replace(/(?:(^| )|https?:\/\/fa\.wikipedia\.org\/[^ \\^`#<>\[\]\"\t\n{|}]*)&?diff=(\d+)&oldid=(\d+)/g, '$1[[special:diff/$3/$2]]'); | val = val.replace(/(?:(^| )|https?:\/\/fa\.wikipedia\.org\/[^ \\^`#<>\[\]\"\t\n{|}]*)&?diff=(\d+|next|prev|cur)&oldid=(\d+)/g, '$1[[special:diff/$3/$2]]'); | ||
val = decodeURI(val.replace(/%20/g, '')).replace(//g, '%20'); // three zwnj | val = decodeURI(val.replace(/%20/g, '')).replace(//g, '%20'); // three zwnj | ||
if (val !== that.val()) { | if (val !== that.val()) { | ||
نسخهٔ ۱۱ فوریهٔ ۲۰۱۵، ساعت ۰۱:۵۴
$(function () {
$('input#wpSummary, input#wpReason, input#mwProtect-reason').bind('paste', function (e) {
var that = $(this);
setTimeout(function () {
var val = that.val();
val = val.replace(/(?:(^| )|https?:\/\/fa\.wikipedia\.org\/[^ \\^`#<>\[\]\"\t\n{|}]*)&?diff=(\d+|next|prev|cur)&oldid=(\d+)/g, '$1[[special:diff/$3/$2]]');
val = decodeURI(val.replace(/%20/g, '')).replace(//g, '%20'); // three zwnj
if (val !== that.val()) {
that.val(val);
}
}, 100);
});
});