// used by [[قالب:تبديل محتوى]] // written by [[user:khaled]] $(document).ready(function(){ var lastLoadedId; // في الحقيقة المحتوى ليس متوفر في كل صفحة، // فلا تقم بفعل أي شئ حيال ذلك. if (mw.util.$content === null) { return; } function showLoadingContect(target, id) { if(lastLoadedId==id) { return; } lastLoadedId=id; // الإشارة إلى أنه يجري تحميل المحتوى في الخلفية var text = '
يرجى الإنتظار'); link.attr('id',target + linkCounter); link.attr('targetName',target); link.attr('linkto',info[2]); link.css('textDecoration','none'); if (info[3] == "no‏"){ // not default link.attr('href', mw.util.getUrl(info[2])); link.click(function(){showLoadingContect(info[1],link.attr('id'));return false;}); } else { link.attr('disabled','true'); //link.removeAttribute("href"); } link.append(info[0]); this.innerHTML = ""; this.style.display = "none"; link.insertBefore($(this)); }); this.maxlinks = linksOfTarget.length; // load default text / random text var info2 = this.title.split("***"); // where [0] = default link, [1] = is random if (info2[1] == "yes") { // random var randomNum = Math.floor(Math.random()*linksOfTarget.length); var randomLink = document.getElementById(target + randomNum); showLoadingContect(target, randomLink.id); } else if (info2[0] != "") { updateContentTarget(target, info2[0]); } this.title = ""; }); });