MediaWiki:Common.js

korna ansiklopedisi sitesinden
00.06, 3 Nisan 2025 tarihinde Iamthegodofkorna (mesaj | katkılar) tarafından oluşturulmuş 305 numaralı sürüm
Gezinti kısmına atlaArama kısmına atla

Not: Yayımladıktan sonra değişiklikleri görmek için tarayıcınızın önbelleğini temizlemeniz gerekebilir.

  • Firefox / Safari: Shift tuşuna basılıyken Yeniden Yükle'ye tıklayın ya da Ctrl-F5 ya da Ctrl-R tıklayın (Mac için ⌘-R).
  • Google Chrome: Ctrl-Shift-R'ye basın. (Mac için ⌘-Shift-R)
  • Internet Explorer / Edge: Ctrl basılıyken Yenile'ye tıklayın ya da Ctrl-F5 yapın.
  • Opera: Ctrl-F5 tıklayın.
/* Buraya konulacak JavaScript kodu sitedeki her kullanıcı için her sayfa yüklendiğinde çalışacaktır */
/* MediaWiki:Common.js */
$(function() {
    // Link verileri
    var socialLinks = [
        { 
            icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/discord.svg',
            text: 'Discord',
            url: 'https://discord.gg/link'
        },
        {
            icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/telegram.svg',
            text: 'Telegram',
            url: 'https://t.me/link'
        },
        {
            icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/deviantart.svg',
            text: 'DeviantArt',
            url: 'https://deviantart.com/link'
        },
        {
            icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/steam.svg',
            text: 'Steam',
            url: 'https://steamcommunity.com/link'
        }
    ];

    // HTML oluşturma
    var $socialBar = $('<div id="monobook-top-social"></div>');
    var $linksContainer = $('<div id="monobook-top-social-links"></div>');
    
    // Linkleri ekle
    socialLinks.forEach(function(link) {
        $linksContainer.append(
            $('<a>', {
                href: link.url,
                title: link.text,
                target: '_blank'
            })
            .append($('<img>', { 
                src: link.icon,
                alt: link.text + ' icon'
            }))
            .append(link.text)
        );
    });

    // Sayfaya ekle (EN ÜSTE)
    $socialBar.append($linksContainer);
    $('#column-one').before($socialBar); // MonoBook'da mutlak üst konum
    
    // Mobil uyumluluk
    if (window.matchMedia("(max-width: 768px)").matches) {
        $('#monobook-top-social a').css('font-size', '11px');
        $('#monobook-top-social img').css({
            'width': '14px',
            'height': '14px'
        });
    }
});