Menüyü değiştir
Toggle preferences menu
Kişisel menüyü aç / kapat
Oturum açık değil
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Revizyonlar arasındaki fark

MediaWiki arayüz sayfası
Değişiklik özeti yok
Değişiklik özeti yok
1. satır: 1. satır:
// ==========================================
// ==========================================
// 1. RASTGELE SAYFA (ZAR) BUTONU KODU
// KIZILBASHICA BİRLEŞİK JS KODU
// (Komut Paleti Türkçeleştirme + Zar Butonu)
// ==========================================
// ==========================================
// Buraya eski zar butonunuzun kodunu ekledik
$(document).ready(function() {
    // MediaWiki'nin standart rastgele sayfa URL'si
    var rastgeleUrl = mw.config.get('wgArticlePath').replace('$1', 'Özel:Rastgele');
   
    // Eğer vikinize özel bir buton ekleme kodu kullanıyorsanız burası onu tetikler
    // Not: Eğer zar butonu görünmezse bana butonun HTML sınıfını veya tasarımını söyleyin, güncelleyelim.
    console.log("Zar butonu aktif edildi.");
});


// ==========================================
// 2. CİTİZEN KOMUT PALETİ TÜRKÇELEŞTİRME
// ==========================================
const observer = new MutationObserver((mutations) => {
const observer = new MutationObserver((mutations) => {
     mutations.forEach((mutation) => {
     mutations.forEach((mutation) => {
21. satır: 9. satır:
          
          
         if (palette) {
         if (palette) {
             // 1. "Recent" Başlığı
            // --------------------------------------
            // RASTGELE SAYFA (ZAR) BUTONU ENTEGRASYONU
            // --------------------------------------
            const inputArea = palette.querySelector('.citizen-command-palette-header__input-area');
            const customBtnCheck = palette.querySelector('#citizen-custom-random-btn');
           
            // Eğer giriş alanı varsa ve buton henüz eklenmediyse oluştur
            if (inputArea && !customBtnCheck) {
                const randomBtn = document.createElement('div');
                randomBtn.id = 'citizen-custom-random-btn';
                randomBtn.title = 'Rastgele Sayfa Getir';
               
                // CSS'inizdeki dönme animasyonunu tetikleyen ikon yapısı
                randomBtn.innerHTML = '<span class="citizen-ui-icon ui-icon-die">🎲</span>';
               
                // Tıklanınca rastgele sayfaya yönlendir
                randomBtn.addEventListener('click', function() {
                    const baseUrl = mw.config.get('wgArticlePath') || '/wiki/$1';
                    window.location.href = baseUrl.replace('$1', 'Özel:Rastgele');
                });
               
                // Butonu girdi alanının en sağına yerleştir
                inputArea.appendChild(randomBtn);
            }
 
            // --------------------------------------
            // KOMUT PALETİ TÜRKÇELEŞTİRME KISMI
            // --------------------------------------
           
             // 1. "Recent" Başlığı İçin Derin Arama
             const allElements = palette.querySelectorAll('*');
             const allElements = palette.querySelectorAll('*');
             allElements.forEach(el => {
             allElements.forEach(el => {
79. satır: 96. satır:
});
});


// Sayfayı izlemeye al
// Tüm sayfadaki dinamik hareketleri izle
observer.observe(document.body, { childList: true, subtree: true });
observer.observe(document.body, { childList: true, subtree: true });

10.51, 7 Temmuz 2026 tarihindeki hâli

// ==========================================
// KIZILBASHICA BİRLEŞİK JS KODU
// (Komut Paleti Türkçeleştirme + Zar Butonu)
// ==========================================

const observer = new MutationObserver((mutations) => {
    mutations.forEach((mutation) => {
        const palette = document.querySelector('.citizen-command-palette');
        
        if (palette) {
            // --------------------------------------
            // RASTGELE SAYFA (ZAR) BUTONU ENTEGRASYONU
            // --------------------------------------
            const inputArea = palette.querySelector('.citizen-command-palette-header__input-area');
            const customBtnCheck = palette.querySelector('#citizen-custom-random-btn');
            
            // Eğer giriş alanı varsa ve buton henüz eklenmediyse oluştur
            if (inputArea && !customBtnCheck) {
                const randomBtn = document.createElement('div');
                randomBtn.id = 'citizen-custom-random-btn';
                randomBtn.title = 'Rastgele Sayfa Getir';
                
                // CSS'inizdeki dönme animasyonunu tetikleyen ikon yapısı
                randomBtn.innerHTML = '<span class="citizen-ui-icon ui-icon-die">🎲</span>';
                
                // Tıklanınca rastgele sayfaya yönlendir
                randomBtn.addEventListener('click', function() {
                    const baseUrl = mw.config.get('wgArticlePath') || '/wiki/$1';
                    window.location.href = baseUrl.replace('$1', 'Özel:Rastgele');
                });
                
                // Butonu girdi alanının en sağına yerleştir
                inputArea.appendChild(randomBtn);
            }

            // --------------------------------------
            // KOMUT PALETİ TÜRKÇELEŞTİRME KISMI
            // --------------------------------------
            
            // 1. "Recent" Başlığı İçin Derin Arama
            const allElements = palette.querySelectorAll('*');
            allElements.forEach(el => {
                if (el.childNodes.length === 1 && el.textContent.trim() === 'Recent') {
                    el.textContent = 'Son Aramalar';
                }
            });

            // 2. Sağ taraftaki "Page" ve "Action" Rozetleri
            const badges = palette.querySelectorAll('[class*="badge"], [class*="item-badge"], .citizen-command-palette__item-badge');
            badges.forEach(badge => {
                const text = badge.textContent.trim();
                if (text === 'Page') {
                    badge.innerHTML = 'Sayfa';
                } else if (text === 'Action') {
                    badge.innerHTML = 'Eylem';
                }
            });

            // 3. "Create or edit page" Açıklamaları
            const descriptions = palette.querySelectorAll('[class*="description"], [class*="item-description"]');
            descriptions.forEach(desc => {
                if (desc.textContent.trim() === 'Create or edit page') {
                    desc.textContent = 'Sayfa oluştur veya düzenle';
                }
            });

            // 4. Sol alttaki Değişken Alt Not Alanları
            const note = palette.querySelector('[class*="footer-note"]');
            if (note) {
                const noteHTML = note.innerHTML;
                if (noteHTML.includes('for all commands') || noteHTML.includes('all commands')) {
                    note.innerHTML = 'Tüm komutlar için <code>/</code> yazın';
                } else if (noteHTML.includes('for namespace') || noteHTML.includes('namespace')) {
                    note.innerHTML = 'Ad alanlarında aramak için <code>:</code> yazın';
                } else if (noteHTML.includes('to search for users') || noteHTML.includes('for users')) {
                    note.innerHTML = 'Kullanıcıları aramak için <code>@</code> yazın';
                } else if (noteHTML.includes('to search for templates') || noteHTML.includes('for templates')) {
                    note.innerHTML = 'Şablonları aramak için <code>{{</code> yazın';
                }
            }

            // 5. Alt taraftaki Tuş İpuçları
            const hints = palette.querySelectorAll('[class*="keyboard-hint"]');
            hints.forEach(hint => {
                const label = hint.querySelector('[class*="label"]');
                if (label) {
                    const text = label.textContent.trim();
                    if (text === 'Select') label.textContent = 'Seç';
                    else if (text === 'Navigate') label.textContent = 'Gezin';
                    else if (text === 'Actions') label.textContent = 'Eylemler';
                    else if (text === 'Close') label.textContent = 'Kapat';
                }
            });
        }
    });
});

// Tüm sayfadaki dinamik hareketleri izle
observer.observe(document.body, { childList: true, subtree: true });