مستخدم:Mr. Ibrahem/IMO magic.js
المظهر
![]() | يمكن توفير توثيق لسكربت المستخدم هذا في الصفحة : مستخدم:Mr. Ibrahem/IMO magic. |
ملاحظة: بعد الحفظ، قد يلزمك إفراغ الكاش لرؤية التغييرات.
/* [[Commons:IMO sources]]
* Quick and dirty for generic sources pages
* by [[User:Dispenser]]
*/
$(function() {
// Retrieve and escape the replacement for MAGICNUMBER
var mn_replacement = mw.util.getParamValue("imon");
if(!mn_replacement) {
// Null or blank value
return;
}
if(!mn_replacement.match(/^\d+$/)) {
// Invalid value
return;
}
// Replace HTML with magic number text
$('#mw-content-text')[0].innerHTML = $('#mw-content-text')[0].innerHTML.replace(/MAGICNUMBER/g, mw.html.escape(mn_replacement));
// Remove the no JavaScript notice
$("#nojs-notice").remove();
});