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 |
||
2. satır: | 2. satır: | ||
/* MediaWiki:Common.js */ | /* MediaWiki:Common.js */ | ||
$(function() { | $(function() { | ||
// | // Link verileri | ||
var socialLinks = [ | var socialLinks = [ | ||
{ | { | ||
icon: 'https://cdn.jsdelivr.net/ | icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/discord.svg', | ||
text: 'Discord', | text: 'Discord', | ||
url: 'https://discord.gg/link' | url: 'https://discord.gg/link' | ||
}, | }, | ||
{ | { | ||
icon: 'https://cdn.jsdelivr.net/ | icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/telegram.svg', | ||
text: 'Telegram', | text: 'Telegram', | ||
url: 'https://t.me/link' | url: 'https://t.me/link' | ||
}, | }, | ||
{ | { | ||
icon: 'https://cdn.jsdelivr.net/ | icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/deviantart.svg', | ||
text: 'DeviantArt', | text: 'DeviantArt', | ||
url: 'https://deviantart.com/link' | url: 'https://deviantart.com/link' | ||
}, | }, | ||
{ | { | ||
icon: 'https://cdn.jsdelivr.net/ | icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/steam.svg', | ||
text: 'Steam', | text: 'Steam', | ||
url: 'https://steamcommunity.com/link' | url: 'https://steamcommunity.com/link' | ||
26. satır: | 26. satır: | ||
]; | ]; | ||
// | // HTML oluşturma | ||
var $ | var $socialBar = $('<div id="monobook-top-social"></div>'); | ||
var $ | var $linksContainer = $('<div id="monobook-top-social-links"></div>'); | ||
// Linkleri ekle | // Linkleri ekle | ||
socialLinks.forEach(function(link) { | socialLinks.forEach(function(link) { | ||
$ | $linksContainer.append( | ||
$('<a>', { | $('<a>', { | ||
href: link.url, | href: link.url, | ||
38. satır: | 38. satır: | ||
target: '_blank' | target: '_blank' | ||
}) | }) | ||
.append($('<img>', { src: link.icon, alt: '' })) | .append($('<img>', { | ||
src: link.icon, | |||
alt: link.text + ' icon' | |||
})) | |||
.append(link.text) | .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' | |||
}); | |||
} | |||
}); | }); |
00.06, 3 Nisan 2025 tarihindeki hâli
/* 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' }); } });