MediaWiki:Common.js: Revizyonlar arasındaki fark
MediaWiki arayüz sayfası
More actions
C. Karakuş (mesaj | katkılar) Değişiklik özeti yok |
C. Karakuş (mesaj | katkılar) Değişiklik özeti yok |
||
| 1. satır: | 1. satır: | ||
// ========================================== | // ========================================== | ||
// KIZILBASHICA BİRLEŞİK JS KODU | // KIZILBASHICA BİRLEŞİK JS KODU | ||
// ========================================== | // ========================================== | ||
// Sayfa ilk yüklendiğinde Tartışma sekmesini Kaynak ad alanına yönlendir | |||
$(document).ready(function() { | |||
var ns = mw.config.get('wgNamespaceNumber'); | |||
var pageName = mw.config.get('wgTitle'); | |||
// Eğer ana ad alanındaysak (Madde sayfasındaysak) | |||
if (ns === 0) { | |||
// Citizen temasındaki tartışma linklerini bul ve "Kaynak:Sayfa_Adı" olarak değiştir | |||
// Hem üst bar, hem yan menü hem de mobil görünümdeki butonları hedefler | |||
$('a[href*="Tart%C4%B1%C5%9Fma:"], a[href*="Talk:"]').each(function() { | |||
var baseUrl = mw.config.get('wgArticlePath') || '/wiki/$1'; | |||
$(this).attr('href', baseUrl.replace('$1', 'Kaynak:' + encodeURIComponent(pageName))); | |||
}); | |||
} | |||
}); | |||
const observer = new MutationObserver((mutations) => { | const observer = new MutationObserver((mutations) => { | ||
mutations.forEach((mutation) => { | mutations.forEach((mutation) => { | ||
// -------------------------------------- | // -------------------------------------- | ||
// GENEL MENÜ TÜRKÇELEŞTİRME | // GENEL MENÜ TÜRKÇELEŞTİRME | ||
// -------------------------------------- | // -------------------------------------- | ||
const menuHeadings = document.querySelectorAll('.citizen-menu__heading'); | const menuHeadings = document.querySelectorAll('.citizen-menu__heading'); | ||
menuHeadings.forEach(heading => { | menuHeadings.forEach(heading => { | ||
if (heading.textContent.trim() === 'Last modified') { | if (heading.textContent.trim() === 'Last modified') { | ||
heading.textContent = 'Son | heading.textContent = 'Son değişiklikler'; | ||
} | } | ||
}); | }); | ||
| 30. satır: | 44. satır: | ||
randomBtn.id = 'citizen-custom-random-btn'; | randomBtn.id = 'citizen-custom-random-btn'; | ||
randomBtn.title = 'Rastgele Sayfa Getir'; | randomBtn.title = 'Rastgele Sayfa Getir'; | ||
randomBtn.innerHTML = '<span class="citizen-ui-icon mw-ui-icon-wikimedia-die"></span>'; | randomBtn.innerHTML = '<span class="citizen-ui-icon mw-ui-icon-wikimedia-die"></span>'; | ||
| 45. satır: | 57. satır: | ||
// KOMUT PALETİ TÜRKÇELEŞTİRME KISMI | // KOMUT PALETİ TÜRKÇELEŞTİRME KISMI | ||
// -------------------------------------- | // -------------------------------------- | ||
const allElements = palette.querySelectorAll('*'); | const allElements = palette.querySelectorAll('*'); | ||
allElements.forEach(el => { | allElements.forEach(el => { | ||
| 54. satır: | 64. satır: | ||
}); | }); | ||
const badges = palette.querySelectorAll('[class*="badge"], [class*="item-badge"], .citizen-command-palette__item-badge'); | const badges = palette.querySelectorAll('[class*="badge"], [class*="item-badge"], .citizen-command-palette__item-badge'); | ||
badges.forEach(badge => { | badges.forEach(badge => { | ||
const text = badge.textContent.trim(); | const text = badge.textContent.trim(); | ||
if (text === 'Page') | if (text === 'Page') badge.innerHTML = 'Sayfa'; | ||
else if (text === 'Action') badge.innerHTML = 'Eylem'; | |||
}); | }); | ||
const descriptions = palette.querySelectorAll('[class*="description"], [class*="item-description"]'); | const descriptions = palette.querySelectorAll('[class*="description"], [class*="item-description"]'); | ||
descriptions.forEach(desc => { | descriptions.forEach(desc => { | ||
| 73. satır: | 78. satır: | ||
}); | }); | ||
const note = palette.querySelector('[class*="footer-note"]'); | const note = palette.querySelector('[class*="footer-note"]'); | ||
if (note) { | if (note) { | ||
| 88. satır: | 92. satır: | ||
} | } | ||
const hints = palette.querySelectorAll('[class*="keyboard-hint"]'); | const hints = palette.querySelectorAll('[class*="keyboard-hint"]'); | ||
hints.forEach(hint => { | hints.forEach(hint => { | ||
| 104. satır: | 107. satır: | ||
}); | }); | ||
observer.observe(document.body, { childList: true, subtree: true }); | observer.observe(document.body, { childList: true, subtree: true }); | ||
11.03, 7 Temmuz 2026 tarihindeki hâli
// ==========================================
// KIZILBASHICA BİRLEŞİK JS KODU
// ==========================================
// Sayfa ilk yüklendiğinde Tartışma sekmesini Kaynak ad alanına yönlendir
$(document).ready(function() {
var ns = mw.config.get('wgNamespaceNumber');
var pageName = mw.config.get('wgTitle');
// Eğer ana ad alanındaysak (Madde sayfasındaysak)
if (ns === 0) {
// Citizen temasındaki tartışma linklerini bul ve "Kaynak:Sayfa_Adı" olarak değiştir
// Hem üst bar, hem yan menü hem de mobil görünümdeki butonları hedefler
$('a[href*="Tart%C4%B1%C5%9Fma:"], a[href*="Talk:"]').each(function() {
var baseUrl = mw.config.get('wgArticlePath') || '/wiki/$1';
$(this).attr('href', baseUrl.replace('$1', 'Kaynak:' + encodeURIComponent(pageName)));
});
}
});
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
// --------------------------------------
// GENEL MENÜ TÜRKÇELEŞTİRME
// --------------------------------------
const menuHeadings = document.querySelectorAll('.citizen-menu__heading');
menuHeadings.forEach(heading => {
if (heading.textContent.trim() === 'Last modified') {
heading.textContent = 'Son değişiklikler';
}
});
// --------------------------------------
// RASTGELE SAYFA (ZAR) BUTONU ENTEGRASYONU
// --------------------------------------
const palette = document.querySelector('.citizen-command-palette');
if (palette) {
const inputArea = palette.querySelector('.citizen-command-palette-header__input-area');
const customBtnCheck = palette.querySelector('#citizen-custom-random-btn');
if (inputArea && !customBtnCheck) {
const randomBtn = document.createElement('div');
randomBtn.id = 'citizen-custom-random-btn';
randomBtn.title = 'Rastgele Sayfa Getir';
randomBtn.innerHTML = '<span class="citizen-ui-icon mw-ui-icon-wikimedia-die"></span>';
randomBtn.addEventListener('click', function() {
const baseUrl = mw.config.get('wgArticlePath') || '/wiki/$1';
window.location.href = baseUrl.replace('$1', 'Özel:Rastgele');
});
inputArea.appendChild(randomBtn);
}
// --------------------------------------
// KOMUT PALETİ TÜRKÇELEŞTİRME KISMI
// --------------------------------------
const allElements = palette.querySelectorAll('*');
allElements.forEach(el => {
if (el.childNodes.length === 1 && el.textContent.trim() === 'Recent') {
el.textContent = 'Son Aramalar';
}
});
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';
});
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';
}
});
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';
}
}
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';
}
});
}
});
});
observer.observe(document.body, { childList: true, subtree: true });