MediaWiki:Common.js: Revizyonlar arasındaki fark

korna ansiklopedisi sitesinden
Gezinti kısmına atlaArama kısmına atla
Değişiklik özeti yok
Değişiklik özeti yok
1. satır: 1. satır:
/* Buraya konulacak JavaScript kodu sitedeki her kullanıcı için her sayfa yüklendiğinde çalışacaktır */
/* Buraya konulacak JavaScript kodu sitedeki her kullanıcı için her sayfa yüklendiğinde çalışacaktır */
/* MediaWiki:Common.js */
$(function() {
$(function() {
    // Link verileri
     var socialLinks = [
     var socialLinks = [
         {  
         {
             icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/discord.svg',
             icon: 'https://www.svgrepo.com/show/353655/discord-icon.svg',
             text: 'Discord',
             text: 'Discord',
             url: 'https://discord.gg/link'
             url: 'https://discord.gg/link'
         },
         },
         {
         {
             icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/telegram.svg',
             icon: 'https://www.svgrepo.com/show/349540/telegram.svg',
             text: 'Telegram',
             text: 'Telegram',
             url: 'https://t.me/link'
             url: 'https://t.me/link'
         },
         },
         {
         {
             icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/deviantart.svg',
             icon: 'https://www.svgrepo.com/show/331488/deviantart.svg',
             text: 'DeviantArt',
             text: 'DeviantArt',
             url: 'https://deviantart.com/link'
             url: 'https://deviantart.com/link'
         },
         },
         {
         {
             icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/steam.svg',
             icon: 'https://www.svgrepo.com/show/349418/steam.svg',
             text: 'Steam',
             text: 'Steam',
             url: 'https://steamcommunity.com/link'
             url: 'https://steamcommunity.com/link'
26. satır: 24. satır:
     ];
     ];


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


     // Sayfaya ekle (EN ÜSTE)
     // EN ÜSTE EKLEME (body'nin ilk elemanı olarak)
     $socialBar.append($linksContainer);
     $socialBar.append($links);
     $('#column-one').before($socialBar); // MonoBook'da mutlak üst konum
     $('body').prepend($socialBar);
      
      
     // Mobil uyumluluk
     // Sol menüyü aşağı itme ayarı
     if (window.matchMedia("(max-width: 768px)").matches) {
     $('#column-one').css('margin-top', '50px');
        $('#monobook-top-social a').css('font-size', '11px');
        $('#monobook-top-social img').css({
            'width': '14px',
            'height': '14px'
        });
    }
});
});

00.09, 3 Nisan 2025 tarihindeki hâli

/* Buraya konulacak JavaScript kodu sitedeki her kullanıcı için her sayfa yüklendiğinde çalışacaktır */
$(function() {
    var socialLinks = [
        {
            icon: 'https://www.svgrepo.com/show/353655/discord-icon.svg',
            text: 'Discord',
            url: 'https://discord.gg/link'
        },
        {
            icon: 'https://www.svgrepo.com/show/349540/telegram.svg',
            text: 'Telegram',
            url: 'https://t.me/link'
        },
        {
            icon: 'https://www.svgrepo.com/show/331488/deviantart.svg',
            text: 'DeviantArt',
            url: 'https://deviantart.com/link'
        },
        {
            icon: 'https://www.svgrepo.com/show/349418/steam.svg',
            text: 'Steam',
            url: 'https://steamcommunity.com/link'
        }
    ];

    var $socialBar = $('<div id="monobook-top-social"></div>');
    var $links = $('<div id="monobook-top-social-links"></div>');

    socialLinks.forEach(function(link) {
        $links.append(
            $('<a>', {
                href: link.url,
                title: link.text,
                target: '_blank'
            })
            .append($('<img>', { src: link.icon, alt: link.text }))
            .append(link.text)
        );
    });

    // EN ÜSTE EKLEME (body'nin ilk elemanı olarak)
    $socialBar.append($links);
    $('body').prepend($socialBar);
    
    // Sol menüyü aşağı itme ayarı
    $('#column-one').css('margin-top', '50px');
});