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: | ||
$(function() { | $(function() { | ||
// | // 1. SOSYAL MEDYA LİNKLERİ | ||
var links = [ | var links = [ | ||
{ | { | ||
24. satır: | 24. satır: | ||
]; | ]; | ||
// | // Sosyal medya barını oluştur | ||
var $socialBar = $('<div id="korna-social-header"></div>'); | var $socialBar = $('<div id="korna-social-header"></div>'); | ||
var $linksContainer = $('<div id="korna-social-links"></div>'); | var $linksContainer = $('<div id="korna-social-links"></div>'); | ||
40. satır: | 40. satır: | ||
}); | }); | ||
// | // 2. MEDIAVIEWER AYARLARI | ||
function initMediaViewer() { | |||
$('a.image').off('click').on('click', function(e) { | |||
e.preventDefault(); | |||
var $this = $(this); | |||
var imgSrc = $this.find('img').attr('src') || $this.attr('href'); | |||
// MediaViewer kontrolü | |||
if (mw.mmv) { | |||
mw.mmv.openImage(imgSrc); | |||
} else { | |||
mw.loader.using('mmv').then(function() { | |||
mw.mmv.openImage(imgSrc); | |||
}).catch(function() { | |||
window.location.href = $this.attr('href'); | |||
}); | |||
} | |||
}); | |||
} | |||
// 3. SAYFA YÜKLENDİĞİNDE ÇALIŞTIR | |||
$socialBar.append($linksContainer); | $socialBar.append($linksContainer); | ||
$('#firstHeading').before($socialBar); | $('#firstHeading').before($socialBar); | ||
// MediaViewer'ı başlat (500ms gecikmeyle garantile) | |||
setTimeout(initMediaViewer, 500); | |||
}); | }); |
19.59, 3 Nisan 2025 tarihindeki hâli
$(function() { // 1. SOSYAL MEDYA LİNKLERİ var links = [ { icon: '//videoliq.com.tr/images/d/dd/Discord.png?20250402213537', text: 'Discord', url: 'https://discord.gg/a4jGxPkHTc' }, { icon: '//upload.wikimedia.org/wikipedia/commons/8/82/Telegram_logo.svg', text: 'Telegram', url: 'https://videoliq.com.tr/acmadik.php' }, { icon: '//videoliq.com.tr/images/7/76/Sitwatch.png?20250402214911', text: 'SitWatch', url: 'https://sitwatch.net/profile/EncyclopediaKorna' }, { icon: '//upload.wikimedia.org/wikipedia/commons/8/83/Steam_icon_logo.svg', text: 'Steam', url: 'https://videoliq.com.tr/acmadik.php' } ]; // Sosyal medya barını oluştur var $socialBar = $('<div id="korna-social-header"></div>'); var $linksContainer = $('<div id="korna-social-links"></div>'); links.forEach(function(link) { $linksContainer.append( $('<a>', { href: link.url, title: link.text, target: '_blank' }) .append($('<img>', { src: link.icon, alt: link.text })) .append(link.text) ); }); // 2. MEDIAVIEWER AYARLARI function initMediaViewer() { $('a.image').off('click').on('click', function(e) { e.preventDefault(); var $this = $(this); var imgSrc = $this.find('img').attr('src') || $this.attr('href'); // MediaViewer kontrolü if (mw.mmv) { mw.mmv.openImage(imgSrc); } else { mw.loader.using('mmv').then(function() { mw.mmv.openImage(imgSrc); }).catch(function() { window.location.href = $this.attr('href'); }); } }); } // 3. SAYFA YÜKLENDİĞİNDE ÇALIŞTIR $socialBar.append($linksContainer); $('#firstHeading').before($socialBar); // MediaViewer'ı başlat (500ms gecikmeyle garantile) setTimeout(initMediaViewer, 500); });