MediaWiki:Common.js: Perbedaan antara revisi
←Membuat halaman berisi '→JavaScript yang ada di sini akan diterapkan untuk semua kulit.: $(document).ready(function () { const $header = $('.vector-header-end .vector-user-links'); if ($header.length) { $header.prepend( '<li class="vector-menu-content-item"><a href="https://sekolahkan.com" target="_blank">Sekolahkan</a></li>' + '<li class="vector-menu-content-item"><a href="https://tespppk.com" target="_blank">TesPPPK</a></li>' ); } });' |
Tidak ada ringkasan suntingan |
||
Baris 2: | Baris 2: | ||
$(document).ready(function () { | $(document).ready(function () { | ||
const $header = $('.vector-header-end .vector-user-links'); | const $header = $('.vector-header-end .vector-user-links'); | ||
if ($header.length) { | if ($header.length) { | ||
// Dropdown utama | |||
const dropdownHTML = ` | |||
<li class="vector-menu-content-item vector-dropdown custom-sites-dropdown"> | |||
); | <a href="#" class="dropdown-toggle">🌐 Layanan Kami ▾</a> | ||
<ul class="dropdown-menu"> | |||
<li><a href="https://sekolahkan.com" target="_blank">E-Learning : Sekolahkan.com</a></li> | |||
<li><a href="https://walimah.web.id" target="_blank">Undangan Digital : Walimah.web.id</a></li> | |||
<li><a href="https://tespppk.com" target="_blank">Diklat Online : TesPPPK.com</a></li> | |||
<li><a href="https://rebrand.web.id" target="_blank">Rebrand Produk Digital : RebrandWebID</a></li> | |||
<li><a href="https://pustaka.inibudi.or.id" target="_blank">Perpustakaan Digital : Pustaka Berbudi</a></li> | |||
<li><a href="https://bookcraft.xyz" target="_blank">AI Pembuat Buku : BookCraft</a></li> | |||
</ul> | |||
</li> | |||
`; | |||
$header.prepend(dropdownHTML); | |||
// Toggle dropdown saat diklik | |||
$(document).on('click', '.custom-sites-dropdown .dropdown-toggle', function (e) { | |||
e.preventDefault(); | |||
$(this).parent().toggleClass('open'); | |||
}); | |||
// Tutup dropdown saat klik di luar | |||
$(document).on('click', function (e) { | |||
if (!$(e.target).closest('.custom-sites-dropdown').length) { | |||
$('.custom-sites-dropdown').removeClass('open'); | |||
} | |||
}); | |||
} | } | ||
}); | }); |