Etdiyiniz dəyişikliklərin yayımlanandan sonra effekt verməsi üçün brauzerinizin keşini təmizləməyə ehtiyacınız ola bilər. Bunun üçün Chrome, Firefox, Edge, yaxud Safari istifadəçisisinizsə, klaviaturanızın Shift düyməsini sıxaraq brauzerin ⟳ səhifə yeniləmək düyməsini klik edə bilərsiniz.
// === ReiKaze: test1 ===
// 1. hello
const welcomeBox = document.createElement("div");
welcomeBox.innerText = " 👋 Salam, ReiKaze! etmək üçün mükəmməl bir gündür!";
Object.assign(welcomeBox.style, {
position: "fixed",
top: "30px",
left: "30px",
background: "linear-gradient(135deg, #1f4037, #99f2c8)",
color: "#fff",
padding: "16px 28px",
borderRadius: "15px",
fontSize: "16px",
fontWeight: "bold",
zIndex: "10000",
boxShadow: "0 4px 15px rgba(0,0,0,0.4)",
transition: "opacity 1s ease",
opacity: "1",
fontFamily: "Segoe UI, sans-serif"
});
document.body.appendChild(welcomeBox);
// 5 min
setTimeout(() => {
welcomeBox.style.opacity = "0";
setTimeout(() => welcomeBox.remove(), 1000);
}, 1000);
const style = document.createElement('style');
style.innerHTML = `
@keyframes fadeSlide {
0% {opacity: 0; transform: translateY(-20px);}
100% {opacity: 1; transform: translateY(0);}
}`;
document.head.appendChild(style);
// 2. saat
const clock = document.createElement("div");
clock.style.position = "fixed";
clock.style.top = "10px";
clock.style.right = "10px";
clock.style.padding = "10px 15px";
clock.style.backgroundColor = "#111";
clock.style.color = "#0f0";
clock.style.fontFamily = "monospace";
clock.style.borderRadius = "8px";
clock.style.zIndex = "9999";
clock.style.fontSize = "14px";
document.body.appendChild(clock);
setInterval(() => {
const now = new Date();
clock.innerText = now.toLocaleTimeString();
}, 1000);
// 3. Təsadüfi məqalə
const randomBtn = document.createElement("button");
randomBtn.innerText = "Təsadüfi Məqalə";
Object.assign(randomBtn.style, {
position: "fixed",
bottom: "20px",
left: "20px",
padding: "10px 15px",
background: "#333",
color: "#fff",
border: "none",
borderRadius: "8px",
cursor: "pointer",
zIndex: "9999"
});
randomBtn.onclick = () => {
window.location.href = "https://az.wikipedia.org/wiki/X%C3%BCsusi:T%C9%99sad%C3%BCfi";
};
document.body.appendChild(randomBtn);
// 4. fon
for (let i = 0; i < 30; i++) {
const star = document.createElement("div");
star.style.position = "fixed";
star.style.top = Math.random() * 100 + "%";
star.style.left = Math.random() * 100 + "%";
star.style.width = "4px";
star.style.height = "4px";
star.style.background = "#fff";
star.style.borderRadius = "50%";
star.style.opacity = Math.random();
star.style.boxShadow = "0 0 5px #fff";
star.style.zIndex = "1";
document.body.appendChild(star);
}
// 5. Musiqi düyməsi
const musicBtn = document.createElement("button");
musicBtn.innerText = "🎵 Musiqini oynat";
Object.assign(musicBtn.style, {
position: "fixed",
bottom: "20px",
right: "20px",
padding: "10px 15px",
background: "#006",
color: "#fff",
border: "none",
borderRadius: "8px",
cursor: "pointer",
zIndex: "9999"
});
document.body.appendChild(musicBtn);
const audio = new Audio("https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3");
audio.loop = true;
let playing = false;
musicBtn.onclick = () => {
if (!playing) {
audio.play();
musicBtn.innerText = "⏸️ Musiqini dayandır";
} else {
audio.pause();
musicBtn.innerText = "🎵 Musiqini oynat";
}
playing = !playing;
};
// Kateqoriya tövsiyəçisi
$(function () {
if (mw.config.get('wgNamespaceNumber') !== 0 || mw.config.get('wgAction') !== 'edit') return;
const bazasi = {
'Bakı': 'Kateqoriya:Bakı',
'Azərbaycan': 'Kateqoriya:Azərbaycan',
'şair': 'Kateqoriya:Azərbaycan şairləri',
'aktyor': 'Kateqoriya:Azərbaycan aktyorları',
'musiqiçi': 'Kateqoriya:Azərbaycan musiqiçiləri'
};
const content = document.getElementById('wpTextbox1')?.value || '';
const ilk = content.split('\n').slice(0, 2).join(' ');
const təkliflər = [];
for (const açar in bazasi) {
if (ilk.toLowerCase().includes(açar.toLowerCase())) {
təkliflər.push(bazasi[açar]);
}
}
if (təkliflər.length === 0) return;
const qutu = document.createElement('div');
qutu.style.background = '#e0f0ff';
qutu.style.border = '1px solid #aaa';
qutu.style.padding = '10px';
qutu.style.marginTop = '1em';
qutu.innerHTML = '<strong>💡 Tövsiyə olunan kateqoriyalar:</strong><br>';
təkliflər.forEach(k => {
const btn = document.createElement('button');
btn.textContent = k;
btn.style.margin = '5px';
btn.onclick = () => {
const t = document.getElementById('wpTextbox1');
if (!t.value.includes(`[[${k}]]`)) {
t.value += `\n[[${k}]]`;
}
};
qutu.appendChild(btn);
});
const box = document.getElementById('wpTextbox1');
if (box) box.parentNode.insertBefore(qutu, box.nextSibling);
});
// Yoxlayıcı// Məqalə
mw.loader.using(['mediawiki.api', 'mediawiki.util'], function () { if (mw.config.get('wgAction') !== 'edit' && mw.config.get('wgAction') !== 'submit') return;
var api = new mw.Api();
function checkArticle() {
var content = $('#wpTextbox1').val() || '';
var warnings = [];
// 1. Mənbə bölməsi
if (!content.includes('== Mənbə ==') && !content.includes('== İstinadlar ==')) {
warnings.push('⚠️ Məqalədə "== Mənbə ==" və ya "== İstinadlar ==" bölməsi yoxdur.');
}
// 2. Vikilink yoxlaması
if (!content.match(/\[.*?\]/)) {
warnings.push('⚠️ Məqalədə heç bir daxili vikilink yoxdur.');
}
// 3. Kateqoriya yoxlaması
if (!content.includes('[[Kateqoriya:')) {
warnings.push('⚠️ Məqalədə kateqoriya yoxdur.');
}
// 4. Məqalə uzunluğu
var plainText = content.replace(/\{\{.*?\}\}/g, '')
.replace(/\[.*?\]/g, '')
.replace(/<[^>]*>/g, '')
.replace(/={2,}/g, '')
.trim();
if (plainText.length < 300) {
warnings.push('⚠️ Məqalə çox qısadır (300 simvoldan az). Qaralama şablonu əlavə edin.');
}
// 5. Başlıq formatları
var headerMatches = content.match(/^=+[^=]+=+$/gm) || [];
headerMatches.forEach(function (header) {
if (!header.startsWith('==') || !header.endsWith('==')) {
warnings.push('⚠️ Başlıq düzgün formatda deyil: ' + header);
}
});
// 6. Tarixlərin yoxlanması (ay adlarının böyük hərflə yazılması)
if (content.match(/\b(Yanvar|Fevral|Mart|Aprel|May|İyun|İyul|Avqust|Sentyabr|Oktyabr|Noyabr|Dekabr)\b/)) {
warnings.push('⚠️ Tarix formatında ay adları böyük hərflə yazılıb. Düzgün format: "5 yanvar 2020".');
}
// 7. İstinadların olmaması
if (!content.includes('<ref') && !content.includes('{{cite')) {
warnings.push('⚠️ Məqalədə heç bir istinad yoxdur.');
}
// Nəticəni göstər
if (warnings.length) {
mw.notify('📝 Aşkar olunan problemlər:\n' + warnings.join('\n'), { autoHide: false, type: 'warn' });
} else {
mw.notify('✅ Məqalədə əsas boşluqlar aşkar edilmədi.', { type: 'success' });
}
}
mw.util.addPortletLink('p-cactions', '#', '🛠 Məqaləni Yoxla', 'ca-check-article', 'Məqaləni avtomatik yoxla');
$(document).on('click', '#ca-check-article', function (e) {
e.preventDefault();
checkArticle();
});
});