Etdiyiniz dəyişikliklərin yayımlanandan sonra effekt verməsi üçün brauzerinizin keşini təmizləməyə ehtiyacınız ola bilər. Bunun üçün Chrome, Firefox, Edge, yaxud Safari istifadəçisisinizsə, klaviaturanızın Shift düyməsini sıxaraq brauzerin ⟳ səhifə yeniləmək düyməsini klik edə bilərsiniz.
(function(){constmodalId='moveHistoryModal';// Modal yaratmaq və göstərməkfunctionshowModal(){if(!document.getElementById(modalId)){constmodal=document.createElement('div');modal.id=modalId;modal.style.cssText=` display: block; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.7); color: #222; overflow-y: auto; z-index: 99999; padding: 20px; box-sizing: border-box; font-family: sans-serif; `;modal.innerHTML=` <button id="${modalId}_close" style=" position: fixed; top: 20px; right: 20px; font-size: 30px; background: transparent; border: none; color: white; cursor: pointer; z-index: 100000; " title="Bağla">×</button> <div id="${modalId}_content" style=" background: white; border-radius: 8px; padding: 20px; max-width: 900px; margin: 60px auto 40px auto; color: black; font-size: 14px; min-height: 200px; "></div> `;document.body.appendChild(modal);document.getElementById(modalId+'_close').onclick=()=>{modal.style.display='none';};}else{document.getElementById(modalId).style.display='block';}}// MediaWiki API ilə move loglarını almaqasyncfunctiongetMoveLogs(title){constapi=newmw.Api();constlogs=[];letlecontinue=null;do{constparams={action:'query',list:'logevents',letype:'move',letitle:title,lelimit:'500',format:'json',origin:'*',};if(lecontinue)params.lecontinue=lecontinue;constdata=awaitapi.get(params);if(data.query&&data.query.logevents){logs.push(...data.query.logevents);}lecontinue=data.continue?.lecontinue;}while(lecontinue);returnlogs;}// Verilmiş ad üçün bütün ad dəyişmələrini zəncirvari tapmaqasyncfunctiontraceTitleHistory(title){letcurrentTitle=title;constallLogs=[];while(true){constlogs=awaitgetMoveLogs(currentTitle);if(!logs.length)break;allLogs.push(...logs);// Köhnə adı tap, yoxdursa dayandırconstoldTitle=logs[0].params?.old_title||logs[0].old_title||null;if(!oldTitle||oldTitle===currentTitle)break;currentTitle=oldTitle;}returnallLogs;}// Nəticələri göstərməkfunctionrenderResults(title,logs){showModal();constcontent=document.getElementById(modalId+'_content');if(!logs.length){content.innerHTML=`<h2>${title} üçün ad dəyişmə jurnalı tapılmadı</h2>`;return;}content.innerHTML=`<h2>${title} üçün bütün ad dəyişmə jurnalları (${logs.length} dəfə)</h2>`;constul=document.createElement('ul');ul.style.listStyle='none';ul.style.padding='0';logs.forEach(log=>{constuserLink=`https://az.wikipedia.org/wiki/İstifadəçi:${encodeURIComponent(log.user)}`;consttime=newDate(log.timestamp).toLocaleString('az-AZ',{timeZone:'UTC'});constli=document.createElement('li');li.style.padding='8px 0';li.style.borderBottom='1px solid #ddd';li.innerHTML=` <div><strong>${time} (UTC)</strong></div> <div>İstifadəçi: <a href="${userLink}" target="_blank">${log.user}</a></div> <div>Əvvəlki ad: <em>${log.params?.old_title||log.old_title||''}</em></div> <div>Yeni ad: <em>${log.params?.new_title||log.new_title||''}</em></div> `;ul.appendChild(li);});content.appendChild(ul);}// İstifadəçidən səhifə adı soruşmaq və işlətməkfunctionshowInputPrompt(){consttitle=prompt('Səhifə adını daxil edin (boş buraxmaq üçün ləğv et):');if(!title)return;constformattedTitle=title.charAt(0).toUpperCase()+title.slice(1).replace(/_/g,' ');renderResults(formattedTitle,[]);traceTitleHistory(formattedTitle).then(logs=>renderResults(formattedTitle,logs));}// Səhifəyə düymə əlavə etfunctionaddSidebarButton(){constsidebar=document.getElementById('p-cactions');if(!sidebar||document.getElementById('showMoveHistoryBtn'))return;constli=document.createElement('li');consta=document.createElement('a');a.href='#';a.id='showMoveHistoryBtn';a.textContent='Addəyişmə jurnallarını göstər';a.style.cursor='pointer';a.addEventListener('click',e=>{e.preventDefault();showInputPrompt();});li.appendChild(a);constul=sidebar.querySelector('ul');if(ul)ul.appendChild(li);}// Başla$(document).ready(()=>{addSidebarButton();});})();