پرش به محتوا

مدیاویکی:Gadget-decodesummary.js: تفاوت میان نسخه‌ها

از دانشنامه علوم انسانی
imported>Ebrahim
بدون خلاصۀ ویرایش
imported>Ebrahim
بدون خلاصۀ ویرایش
خط ۳: خط ۳:
var that = $(this);
var that = $(this);
setTimeout(function () {
setTimeout(function () {
that.val(decodeURI(
var decoded = decodeURI(that.val().replace(/%20/g, '‍‍‍')).replace(/‍‍‍/g, '%20'); // three zwnj
that.val().replace(/%20/g, '‍‍‍') // three zwj
if (decoded !== that.val()) {
).replace(/‍‍‍/g, '%20'));
that.val(decoded);
}
}, 100);
}, 100);
});
});
}());
}());

نسخهٔ ۲۷ سپتامبر ۲۰۱۴، ساعت ۰۹:۱۸

$(function () {
	$('input#wpSummary, input#wpReason, input#mwProtect-reason').bind('paste', function (e) {
		var that = $(this);
		setTimeout(function () {
			var decoded = decodeURI(that.val().replace(/%20/g, '‍‍‍')).replace(/‍‍‍/g, '%20'); // three zwnj
			if (decoded !== that.val()) {
				that.val(decoded);
			}
		}, 100);
	});
}());