Tanda: Suntingan perangkat seluler Suntingan peramban seluler |
Tanda: Suntingan perangkat seluler Suntingan peramban seluler |
| (202 revisi perantara oleh 2 pengguna tidak ditampilkan) |
| Baris 1: |
Baris 1: |
| | /* Otomatis alihkan Special:Upload ke Mippedia Commons */ |
| | if (mw.config.get('wgCanonicalSpecialPageName') === 'Upload') { |
| | window.location.href = 'https://commons.mippedia.org/wiki/Special:Upload'; |
| | } |
| | |
| /* Script Estimasi Waktu Baca - Spesialis Mobile (Minerva) & Desktop */ | | /* Script Estimasi Waktu Baca - Spesialis Mobile (Minerva) & Desktop */ |
| $(document).ready(function() { | | $(document).ready(function() { |
| // Hanya jalan di halaman artikel asli | | // Hanya jalan di halaman artikel asli dan BUKAN di Halaman Utama |
| if (mw.config.get('wgIsArticle') && mw.config.get('wgAction') === 'view' && mw.config.get('wgNamespaceNumber') === 0) { | | if (mw.config.get('wgIsArticle') && mw.config.get('wgAction') === 'view' && mw.config.get('wgNamespaceNumber') === 0 && !mw.config.get('wgIsMainPage')) { |
| | | |
| function hitungWaktuBaca() { | | function hitungWaktuBaca() { |
| Baris 15: |
Baris 20: |
| // Bikin elemen tampilannya | | // Bikin elemen tampilannya |
| var icon = '🕒'; // Emoji jam biar simpel dan ringan | | var icon = '🕒'; // Emoji jam biar simpel dan ringan |
| var label = (readingTime <= 1) ? 'Kurang dari 1 menit' : readingTime + ' menit'; | | var label = (readingTime <= 1) ? '- 1 menit' : readingTime + ' menit'; |
| | | |
| var html = '<div id="reading-time-auto" style="font-size: 0.9em; color: #54595d; margin-bottom: 15px; display: flex; align-items: center; font-family: sans-serif;">'; | | var html = '<div id="reading-time-auto" style="font-size: 0.9em; color: #54595d; margin-bottom: 15px; display: flex; align-items: center; font-family: sans-serif;">'; |
| html += '<span style="margin-right: 5px;">' + icon + '</span>'; | | html += '<span style="margin-right: 5px;">' + icon + '</span>'; |
| html += '<span>Estimasi waktu baca: <b>' + label + '</b></span>'; | | html += '<span>Estimasi waktu baca : <b>' + label + '</b></span>'; |
| html += '</div>'; | | html += '</div>'; |
|
| |
|
| Baris 36: |
Baris 41: |
| } | | } |
| }); | | }); |
|
| |
|
| |
|
| /* Script Tombol Back to Top (Spesial Mobile) */ | | /* Script Tombol Back to Top (Spesial Mobile) */ |
| Baris 60: |
Baris 64: |
| }); | | }); |
|
| |
|
| | | /* ========================================================== |
| /* Smart Glossary Pop-up (Pratinjau Link Ringan) */ | | 🚀 MIPPEDIA DATA BUTTON ONLY (Otomatis) |
| | Hanya memunculkan tombol jika data tersedia di pusat. |
| | ========================================================== */ |
| $(document).ready(function() { | | $(document).ready(function() { |
| if (mw.config.get('wgIsArticle') && mw.config.get('wgAction') === 'view') { | | var pageName = mw.config.get('wgPageName'); |
|
| | var namespace = mw.config.get('wgNamespaceNumber'); |
| var timer;
| | var dataDomain = 'https://data.mippedia.org'; |
| // Targetkan link di dalam konten artikel saja
| |
| $('#mw-content-text a').on('mouseenter touchstart', function(e) {
| |
| var $link = $(this);
| |
| var title = $link.attr('title');
| |
|
| |
| // Jangan jalan kalau link-nya bukan artikel (misal link luar atau redlink)
| |
| if (!title || $link.hasClass('new') || $link.hasClass('external')) return;
| |
| | |
| timer = setTimeout(function() {
| |
| $.getJSON(mw.util.wikiScript('api'), {
| |
| action: 'query',
| |
| prop: 'extracts',
| |
| exintro: true,
| |
| exsentences: 2, // Ambil 2 kalimat aja biar singkat
| |
| titles: title,
| |
| explaintext: true,
| |
| format: 'json'
| |
| }, function(data) {
| |
| var pages = data.query.pages;
| |
| var pageId = Object.keys(pages)[0];
| |
| var extract = pages[pageId].extract;
| |
| | |
| if (extract) {
| |
| // Hapus pop-up lama kalau ada
| |
| $('.wiki-preview').remove();
| |
|
| |
|
| var preview = $('<div class="wiki-preview" style="position:absolute; background:#fff; color:#202122; border:1px solid #a2a9b1; padding:12px; border-radius:8px; box-shadow:0 4px 12px rgba(0,0,0,0.2); z-index:10001; font-size:13px; max-width:250px; line-height:1.4; opacity:0; transition:opacity 0.3s ease;"></div>');
| | // Jalankan hanya di namespace artikel |
| preview.text(extract);
| | if (namespace === 0) { |
|
| | // Cek apakah halaman tersebut ada di Mippedia Data |
| $('body').append(preview);
| | $.ajax({ |
| | | url: dataDomain + '/api.php', |
| // Atur posisi pop-up di deket link
| | data: { |
| var offset = $link.offset();
| | action: 'query', |
| preview.css({
| | titles: pageName, |
| top: offset.top + 25,
| | format: 'json', |
| left: Math.min(offset.left, $(window).width() - 270),
| | origin: '*' |
| opacity: 1
| | }, |
| });
| | dataType: 'jsonp', |
| | | success: function(res) { |
| // Hilang kalau klik di mana aja atau setelah 5 detik
| | var pages = res.query.pages; |
| setTimeout(function() { $('.wiki-preview').fadeOut(function() { $(this).remove(); }); }, 5000);
| | var isExist = false; |
| | |
| | // Cek apakah ID halaman > 0 (artinya halaman ada) |
| | for (var id in pages) { |
| | if (parseInt(id) > 0) { |
| | isExist = true; |
| | break; |
| } | | } |
| }); | | } |
| }, 600); // Delay 0.6 detik biar gak ganggu kalau cuma scrolling lewat
| |
| }).on('mouseleave', function() {
| |
| clearTimeout(timer);
| |
| });
| |
|
| |
|
| $(document).on('mousedown touchstart', function() {
| | // Jika data ditemukan, munculkan tombol melayang |
| $('.wiki-preview').remove();
| | if (isExist) { |
| | injectFloatingDataBtn(pageName, dataDomain); |
| | } |
| | } |
| }); | | }); |
| } | | } |
| });
| |
|
| |
|
| /* 3. Notifikasi Link Luar */
| | function injectFloatingDataBtn(name, domain) { |
| $(document).ready(function() {
| | if ($('#mippedia-data-btn').length) return; |
| $('a.external').click(function(e) { | |
| var url = $(this).attr('href');
| |
| if (!confirm('Anda akan meninggalkan Mippedia menuju situs luar:\n' + url + '\n\nLanjutkan?')) { | |
| e.preventDefault();
| |
| }
| |
| });
| |
| });
| |
|
| |
|
| | var $btn = $('<a>', { |
| | id: 'mippedia-data-btn', |
| | href: domain + '/wiki/' + encodeURIComponent(name), |
| | target: '_blank', |
| | style: 'position: absolute; right: 10px; top: -32px; background: #36c; color: #fff; padding: 4px 10px; border-radius: 4px; font-weight: bold; font-size: 10px; text-decoration: none; z-index: 1000; box-shadow: 0 2px 4px rgba(0,0,0,0.1);', |
| | text: 'DATA' |
| | }); |
|
| |
|
| /* 3. Anti-Ghosting pada Link Kosong (Redlinks) */ | | // Target: Area menu aksi (dekat ikon pensil) |
| $(document).ready(function() { | | // Mendukung skin Mobile (Minerva) dan Desktop |
| $('a.new').click(function(e) {
| | var $target = $('.page-actions-menu, .mw-editsection-visualeditor, #ca-edit, .minerva__tab-container').first(); |
| var confirmCreate = confirm("Halaman ini belum tersedia di Mippedia.\n\nApakah Anda ingin berkontribusi membuatnya?");
| | |
| if (!confirmCreate) {
| | if ($target.length) { |
| e.preventDefault();
| | $target.css('position', 'relative').append($btn); |
| | } else { |
| | // Fallback jika header tidak standar |
| | $('#firstHeading').css('position', 'relative').append($btn); |
| } | | } |
| }); | | } |
| }); | | }); |
|
| |
|
| /* 1. Navigasi Bab Melayang (Vertical Stack Edition) */ | | /* ========================================================== |
| $(document).ready(function() {
| | 🚀 MIPPEDIA COMMAND CENTER: AUTO-SYNC ENGINE (V4) |
| if (mw.config.get('wgIsArticle') && $('#toc').length) { | | Status: Global Login User | Auto-Purge | High Reliability |
|
| | ========================================================== */ |
| // CSS untuk posisi menumpuk secara vertikal
| | (function($, mw) { |
| var $quickNav = $('<div id="quick-nav" style="position:fixed; bottom:20px; right:20px; width:45px; height:45px; background:#36c; color:#fff; border-radius:50%; display:flex; align-items:center; justify-content:center; z-index:9996; box-shadow:0 4px 12px rgba(0,0,0,0.2); cursor:pointer; font-size:20px; transition: all 0.3s ease;">≡</div>');
| | "use strict"; |
|
| | |
| // Tombol Back to Top lo biasanya di bottom: 80px atau 90px kan?
| | var conf = mw.config.get(['wgNamespaceNumber', 'wgAction', 'wgPageName', 'wgIsMainPage', 'wgUserName']); |
| // Kita paksa Back to Top naik sedikit, dan navigasi bab ada di bawahnya.
| | // Filter: Hanya artikel, hanya saat baca, hanya user yang sudah login |
| // Script ini bakal otomatis menyesuaikan posisi tombol panah atas lo.
| | if (conf.wgNamespaceNumber !== 0 || conf.wgAction !== 'view' || conf.wgIsMainPage || conf.wgUserName === null) return; |
|
| |
| $('body').append($quickNav);
| |
|
| |
|
| // Menyesuaikan posisi tombol Back to Top bawaan (jika ada) biar gak tabrakan
| | $(document).ready(function() { |
| // Kita set navigasi di bottom 20px, dan Back to Top di bottom 80px | | var currentTitle = conf.wgPageName; |
| $('.back-to-top, #mw-mf-back-to-top').css('bottom', '85px'); | | // Penentuan subdomain (id, en, concise) |
| | var hostParts = window.location.hostname.split('.'); |
| | var langKey = hostParts[0] === 'mippedia' || hostParts[0] === 'www' ? 'id' : hostParts[0]; |
|
| |
|
| $quickNav.click(function() { | | $.ajax({ |
| var $toc = $('#toc ul').first().clone(); | | url: 'https://data.mippedia.org/api.php', |
| var $modal = $('<div id="nav-modal" style="position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); z-index:20001; display:flex; align-items:flex-end; justify-content:center; backdrop-filter:blur(5px); opacity:0; transition:opacity 0.3s ease;">' + | | data: { |
| '<div id="nav-card" style="background:#fff; width:100%; max-height:75%; overflow-y:auto; border-top-left-radius:30px; border-top-right-radius:30px; padding:25px; transform:translateY(100%); transition:transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);">' + | | action: 'query', |
| '<div style="width:50px; height:5px; background:#eee; border-radius:10px; margin:0 auto 20px;"></div>' + | | prop: 'revisions', |
| '<h3 style="margin-top:0; color:#36c; font-size:1.3em; text-align:center;">Daftar Isi</h3>' + | | titles: 'MediaWiki:ShortDesc-Data.json', |
| '<div id="nav-list" style="margin-top:10px;"></div>' + | | rvprop: 'content', |
| '</div></div>');
| | format: 'json', |
| | | origin: '*' |
| $('body').append($modal); | | }, |
| $modal.find('#nav-list').append($toc); | | dataType: 'jsonp', |
|
| | success: function(res) { |
| setTimeout(function() {
| | try { |
| $modal.css('opacity', '1'); | | var pages = res.query.pages; |
| $modal.find('#nav-card').css('transform', 'translateY(0)');
| | var pageId = Object.keys(pages)[0]; |
| }, 10);
| | if (pageId === "-1") return; |
|
| |
|
| // Styling link agar terasa seperti menu aplikasi
| | var fullData = JSON.parse(pages[pageId].revisions[0]['*']); |
| $modal.find('a').css({
| | var targetDesc = (fullData[currentTitle] && fullData[currentTitle][langKey]) ? fullData[currentTitle][langKey].trim() : ""; |
| 'display':'block',
| |
| 'padding':'15px 10px',
| |
| 'color':'#333',
| |
| 'text-decoration':'none',
| |
| 'border-bottom':'1px solid #f9f9f9',
| |
| 'font-size':'1.1em'
| |
| });
| |
|
| |
|
| function closeModal() {
| | syncMetadata(currentTitle, targetDesc); |
| $modal.find('#nav-card').css('transform', 'translateY(100%)'); | | } catch (e) { |
| $modal.css('opacity', '0');
| | console.log("Mippedia System: Data sync not required or entry missing."); |
| setTimeout(function() { $modal.remove(); }, 400); | | } |
| } | | } |
|
| |
| $modal.on('click', function(e) { if(e.target === this) closeModal(); });
| |
| }); | | }); |
| }
| |
| });
| |
|
| |
|
| /* 2. Auto-Night Shift (Berdasarkan Jam Lokal) */
| | function syncMetadata(title, dataCenterDesc) { |
| $(document).ready(function() {
| | var api = new mw.Api(); |
| var hour = new Date().getHours();
| | api.get({ |
| if (hour >= 21 || hour < 6) { // Jam 9 malem sampe 6 pagi
| | action: 'query', |
| $("<style id='night-shift'>").prop("type", "text/css").html(`
| | prop: 'revisions', |
| body::after {
| | titles: title, |
| content: ""; | | rvprop: 'content', |
| position: fixed; | | formatversion: 2 |
| top: 0; left: 0; | | }).done(function(data) { |
| width: 100vw; height: 100vh; | | var content = data.query.pages[0].revisions[0].content; |
| background: rgba(255, 165, 0, 0.05); /* Filter orange tipis */ | | var shortDescPattern = /\{\{SHORTDESC:.*?\}\}\n?/gi; |
| pointer-events: none; | | var hasLocalDesc = shortDescPattern.test(content); |
| z-index: 99999; | | |
| }
| | var localMatch = content.match(/\{\{SHORTDESC:(.*?)\}\}/i); |
| `).appendTo("head");
| | var currentLocalDesc = localMatch ? localMatch[1].trim() : ""; |
| }
| |
| });
| |
|
| |
|
| /* 3. Smooth Fade-In saat Ganti Halaman */ | | // AKSI 1: HAPUS (Jika di pusat kosong/dihapus, tapi di artikel lokal masih ada) |
| $(document).ready(function() {
| | if (dataCenterDesc === "" && hasLocalDesc) { |
| $('body').css({'opacity': '0', 'transition': 'opacity 0.5s ease'});
| | console.log("Mippedia: Purging metadata..."); |
| setTimeout(function() { $('body').css('opacity', '1'); }, 100);
| | saveEdit(title, content.replace(shortDescPattern, ""), "Purge out-of-sync metadata"); |
| }); | | } |
| | // AKSI 2: UPDATE/TAMBAH (Jika data di pusat ada dan beda dengan lokal) |
| | else if (dataCenterDesc !== "" && dataCenterDesc !== currentLocalDesc) { |
| | console.log("Mippedia: Syncing with Data Center..."); |
| | var cleanedContent = content.replace(shortDescPattern, ""); |
| | // Menaruh di paling atas agar terbaca Extension ShortDescription |
| | var newContent = '{{SHORTDESC:' + dataCenterDesc + '}}\n' + cleanedContent; |
| | saveEdit(title, newContent, "Sync metadata: " + dataCenterDesc); |
| | } |
| | }); |
| | } |
|
| |
|
| /* 2. Auto-Source on Copy (Kredit Otomatis) */
| | function saveEdit(title, text, summary) { |
| document.addEventListener('copy', function(e) {
| | // Menggunakan token user yang sedang login saat ini |
| var selection = window.getSelection();
| | new mw.Api().postWithEditToken({ |
| if (selection.toString().length > 1) { // Hanya aktif kalau copy lebih dari 50 karakter
| | action: 'edit', |
| var body_element = document.getElementsByTagName('body')[0];
| | title: title, |
| var newdiv = document.createElement('div');
| | text: text, |
| newdiv.style.position = 'absolute';
| | summary: '🤖 ' + summary, |
| newdiv.style.left = '-99999px';
| | minor: true // Menandai sebagai suntingan kecil |
| body_element.appendChild(newdiv);
| | // Parameter 'bot: true' DIHAPUS agar bisa dijalankan semua pengguna login |
| newdiv.innerHTML = selection + '<br /><br />Sumber: ' + document.title + '<br />Link: ' + window.location.href;
| | }).done(function() { |
| selection.selectAllChildren(newdiv);
| | console.log("Mippedia: " + title + " synced successfully."); |
| window.setTimeout(function() {
| | }); |
| body_element.removeChild(newdiv);
| |
| }, 0);
| |
| }
| |
| });
| |
| | |
| /* Pindahkan Mippedia Data ke Sebelah Tab Pembicaraan - FIX VERSION */ | |
| $(document).ready(function() {
| |
| function moveMippediaData() {
| |
| // 1. Cari elemen template aslinya
| |
| var $dataTemplate = $('.mw-parser-output div:contains("Mippedia Data")').first();
| |
|
| |
| // Cari URL-nya dari tombol "Lihat"
| |
| var dataUrl = $dataTemplate.find('a').attr('href');
| |
| | |
| if ($dataTemplate.length && dataUrl) {
| |
| // 2. Buat elemen List Item (li) biar sama kayak tab Halaman & Pembicaraan
| |
| var $dataTab = $('<li id="ca-mippediadata" style="display: inline-block; margin-left: 10px; vertical-align: middle;">' +
| |
| '<a href="' + dataUrl + '" target="_blank" style="text-decoration: none !important; display: flex; align-items: center;">' +
| |
| '<span style="background: #36c; color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: bold; box-shadow: 0 2px 4px rgba(54,102,204,0.3);">LIHAT DI MIPPEDIA DATA</span>' +
| |
| '</a>' +
| |
| '</li>');
| |
| | |
| // 3. Masukkan tepat setelah li terakhir di area tab (Pembicaraan) | |
| var $lastTab = $('.page-tabs li:last-child, .minerva__tab-container li:last-child');
| |
| | |
| if ($lastTab.length) {
| |
| $lastTab.after($dataTab);
| |
| // Hapus template lama biar gak berantakan di bawah
| |
| $dataTemplate.remove();
| |
| }
| |
| } | | } |
| } | | }); |
| | })(jQuery, mediaWiki); |
|
| |
|
| // Jalankan langsung dan kasih delay dikit buat mastiin Minerva udah render tab-nya
| | /* ========================================================== |
| moveMippediaData();
| | 🚀 MIPPEDIA METADATA GUARD - RADAR SYSTEM (V5) |
| setTimeout(moveMippediaData, 500);
| | Status: Professional Messaging | Hybrid Mobile/Desktop |
| });
| | ========================================================== */ |
| | (function($, mw) { |
| | "use strict"; |
|
| |
|
| /* Smart Random Toaster Mippedia (Fixed: Article & Main Page Only) */
| |
| $(document).ready(function() {
| |
| var ns = mw.config.get('wgNamespaceNumber'); | | var ns = mw.config.get('wgNamespaceNumber'); |
| var action = mw.config.get('wgAction'); | | if (ns !== 0 || mw.config.get('wgIsMainPage')) return; |
| var isMainPage = mw.config.get('wgIsMainPage');
| |
| var isDiff = mw.config.get('wgDiffOldId') !== null;
| |
|
| |
|
| // VALIDASI: Cuma di Artikel (NS 0), Halaman Utama, dan saat 'View' saja | | var shortDescRegex = /\{\{SHORTDESC:.*?\}\}/gi; |
| if ((ns === 0 || isMainPage) && action === 'view' && !isDiff) {
| | var originalShortDesc = null; |
|
| | |
| var mippediaDatabase = [
| | function validateAndBlock(e) { |
| // KATEGORI: FAKTA UNIK (💡)
| | var $textbox = $('#wpTextbox1, textarea.previewable-render, .editor-container textarea, textarea[name="wpTextbox1"]'); |
| { type: "💡 FAKTA UNIK", text: "Mippedia adalah proyek ensiklopedia mandiri yang berfokus pada sejarah, musik, dan teknologi." },
| | if (!$textbox.length) return true; |
| { type: "💡 FAKTA UNIK", text: "Rumi Haitami, pendiri Mippedia, adalah musisi dan pengusaha muda asal Indonesia." },
| |
| { type: "💡 FAKTA UNIK", text: "Nama 'Mippedia' merepresentasikan identitas kolektif dari Mippedia Community." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia tidak berafiliasi dengan Wikimedia Foundation dan mengelola server secara mandiri." },
| |
| { type: "💡 FAKTA UNIK", text: "Sugar Store Id merupakan bagian dari ekosistem bisnis yang dikembangkan pendiri Mippedia." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia memiliki ribuan item data yang terhubung melalui sistem Mippedia Data." },
| |
| { type: "💡 FAKTA UNIK", text: "Proyek ini dimulai dengan visi untuk mendokumentasikan pengetahuan secara profesional dan bebas." },
| |
| { type: "💡 FAKTA UNIK", text: "Logo Mippedia melambangkan integrasi ilmu pengetahuan global dan lokal." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia Community terdiri dari kontributor yang ahli di bidang teknologi dan dokumentasi digital." },
| |
| { type: "💡 FAKTA UNIK", text: "Selain ensiklopedia, ekosistem Mippedia juga mencakup label rekaman musik." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia mendukung standarisasi Wikidata untuk sinkronisasi informasi tokoh." },
| |
| { type: "💡 FAKTA UNIK", text: "Setiap artikel di sini melewati proses kurasi oleh tim administrator Mippedia." },
| |
| { type: "💡 FAKTA UNIK", text: "Sistem pencarian Mippedia dirancang untuk menemukan artikel dalam hitungan milidetik." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia menggunakan platform MediaWiki yang telah dimodifikasi secara ekstrim untuk kenyamanan pengguna." },
| |
| { type: "💡 FAKTA UNIK", text: "Warna biru pada tema Mippedia melambangkan kepercayaan, profesionalisme, dan teknologi." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia adalah salah satu proyek wiki independen terbesar yang dikelola oleh komunitas lokal." },
| |
| { type: "💡 FAKTA UNIK", text: "Konten musik di Mippedia mencakup diskografi lengkap dari artis-artis di bawah label Mippedia." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia menyediakan portal khusus bagi administrator untuk mengelola sistem secara real-time." },
| |
| { type: "💡 FAKTA UNIK", text: "Data kelahiran dan riwayat tokoh di Mippedia diambil dari sumber primer yang tervalidasi." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia sering melakukan pembaruan sistem pesan sistem untuk menjaga keamanan komunitas." },
| |
| { type: "💡 FAKTA UNIK", text: "User interface Mippedia dioptimasi agar ramah bagi pengguna perangkat mobile." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia memiliki kebijakan privasi yang ketat untuk melindungi data setiap pembacanya." },
| |
| { type: "💡 FAKTA UNIK", text: "Sistem 'Dengarkan Artikel' di Mippedia menggunakan teknologi sintesis suara yang jernih." },
| |
| { type: "💡 FAKTA UNIK", text: "Mippedia secara aktif mengarsipkan dokumen sejarah yang jarang ditemukan di tempat lain." },
| |
| { type: "💡 FAKTA UNIK", text: "Setiap gambar yang diunggah ke Mippedia disimpan dalam repositori lokal yang aman." },
| |
|
| |
|
| // KATEGORI: INFORMASI (ℹ️)
| | var currentContent = $textbox.val() || ""; |
| { type: "ℹ️ INFORMASI", text: "Anda dapat mendengarkan isi artikel ini dengan mengklik ikon 🔊 di bagian atas halaman." },
| | var currentMatch = currentContent.match(shortDescRegex); |
| { type: "ℹ️ INFORMASI", text: "Klik ikon ≡ di pojok kanan bawah untuk melihat daftar isi dan melompat antar bagian." },
| | var currentShortDesc = currentMatch ? currentMatch[0] : ""; |
| { type: "ℹ️ INFORMASI", text: "Gunakan fitur 'Back to Top' (ikon panah) untuk kembali ke atas halaman dengan cepat." },
| |
| { type: "ℹ️ INFORMASI", text: "Artikel ini terakhir diperbarui sesuai dengan log aktivitas Mippedia Community." },
| |
| { type: "ℹ️ INFORMASI", text: "Anda bisa membagikan artikel ini melalui tombol share yang tersedia di akhir tulisan." },
| |
| { type: "ℹ️ INFORMASI", text: "Mippedia Data menyediakan basis data teknis yang terhubung dengan artikel ini." },
| |
| { type: "ℹ️ INFORMASI", text: "Aktifkan Mode Malam pada browser Anda untuk pengalaman membaca yang lebih nyaman di Mippedia." },
| |
| { type: "ℹ️ INFORMASI", text: "Seluruh konten di sini dilindungi oleh lisensi Creative Commons BY-SA 4.0." },
| |
| { type: "ℹ️ INFORMASI", text: "Untuk bantuan teknis atau laporan bug, silakan hubungi tim administrator Mippedia." },
| |
| { type: "ℹ️ INFORMASI", text: "Anda bisa melihat estimasi waktu baca artikel tepat di bawah judul halaman." },
| |
| { type: "ℹ️ INFORMASI", text: "Mippedia menyediakan fitur pencarian pintar di header untuk menemukan topik terkait." },
| |
| { type: "ℹ️ INFORMASI", text: "Pastikan Anda melihat bagian 'Referensi' untuk memverifikasi keaslian data artikel." },
| |
| { type: "ℹ️ INFORMASI", text: "Pendaftaran kontributor Mippedia Community dibuka secara berkala melalui pengumuman resmi." },
| |
| { type: "ℹ️ INFORMASI", text: "Sistem Mippedia secara otomatis mendeteksi perangkat Anda untuk memberikan tampilan terbaik." },
| |
| { type: "ℹ️ INFORMASI", text: "Ikon DATA di sebelah tab Pembicaraan akan mengarahkan Anda ke metadata lengkap tokoh tersebut." },
| |
| { type: "ℹ️ INFORMASI", text: "Mippedia menjaga integritas data dengan sistem proteksi halaman dari suntingan anonim berbahaya." },
| |
| { type: "ℹ️ INFORMASI", text: "Anda bisa mengunduh artikel Mippedia dalam format PDF melalui menu aksi di pojok kanan." },
| |
| { type: "ℹ️ INFORMASI", text: "Jaringan Mippedia mencakup berbagai subdomain untuk proyek bahasa yang berbeda." },
| |
| { type: "ℹ️ INFORMASI", text: "Gunakan fitur seleksi teks untuk mencari istilah yang tidak Anda mengerti di dalam Mippedia." },
| |
| { type: "ℹ️ INFORMASI", text: "Pesan toast ini hanya muncul sekali per sesi halaman untuk kenyamanan membaca Anda." },
| |
| { type: "ℹ️ INFORMASI", text: "Mippedia Community berkomitmen menjaga netralitas informasi di setiap artikel sejarah." },
| |
| { type: "ℹ️ INFORMASI", text: "Pembaruan basis data Mippedia dilakukan setiap hari untuk memastikan akurasi informasi." },
| |
| { type: "ℹ️ INFORMASI", text: "Anda dapat melihat riwayat penyuntingan artikel melalui tab 'History' di menu navigasi." },
| |
| { type: "ℹ️ INFORMASI", text: "Mippedia mendukung integrasi media kaya seperti audio dan video berkualitas tinggi." },
| |
| { type: "ℹ️ INFORMASI", text: "Terima kasih telah menjadi bagian dari pembaca setia Mippedia Community!" }
| |
| ];
| |
|
| |
|
| var randomItem = mippediaDatabase[Math.floor(Math.random() * mippediaDatabase.length)]; | | if (originalShortDesc === null) { |
|
| | originalShortDesc = currentShortDesc; |
| setTimeout(function() {
| | return true; |
| if ($('input:focus, textarea:focus').length > 0) return; | | } |
|
| |
|
| var $toaster = $('<div id="smart-toaster" style="position:fixed; top:25px; left:20px; right:20px; background:rgba(255,255,255,0.98); border-left:5px solid #36c; color:#333; padding:15px; border-radius:12px; z-index:11000; box-shadow:0 10px 30px rgba(0,0,0,0.15); backdrop-filter:blur(10px); display:none; font-family:sans-serif;">' +
| | if (originalShortDesc !== currentShortDesc) { |
| '<div style="color:#36c; font-weight:bold; font-size:11px; margin-bottom:5px; text-transform:uppercase; letter-spacing:1px;">' + randomItem.type + '</div>' + | | // --- PESAN PROFESIONAL BARU --- |
| '<div style="font-size:13px; line-height:1.4; color:#444;">' + randomItem.text + '</div>' + | | window.alert( |
| '</div>');
| | "MIPPEDIA SYSTEM NOTIFICATION\n" + |
| | "────────────────────────────\n\n" + |
| | "Suntingan anda tidak bisa di lanjutkan untuk di terbitkan, Karena sinkronisasi otomatis terdeteksi tidak valid.\n\n" + |
| | "Untuk menjaga integritas metadata, deskripsi singkat (ShortDescription) wajib dikelola melalui repositori Mippedia Data.\n\n" + |
| | "Harap urungkan perubahan manual pada kode {{SHORTDESC}} untuk melanjutkan proses penyimpanan." |
| | ); |
| | | |
| $('body').append($toaster); | | e.preventDefault(); |
| $toaster.slideDown(500).delay(7000).slideUp(500, function() { $(this).remove(); }); | | e.stopPropagation(); |
| }, 5000); | | e.stopImmediatePropagation(); |
| | return false; |
| | } |
| | return true; |
| } | | } |
| });
| |
|
| |
|
| /* ========================================================== | | // Radar untuk menangkap elemen editor saat muncul (terutama di Mobile) |
| 🛡️ MIPPEDIA SHIELD: PROTEKSI HALAMAN SENSITIF (FULL CODE)
| | var observer = new MutationObserver(function() { |
| Hanya untuk Pengurus, Birokrat, dan Pengawas.
| | var $textbox = $('#wpTextbox1, .editor-container textarea, textarea[name="wpTextbox1"]'); |
| ========================================================== */
| | if ($textbox.length && originalShortDesc === null) { |
| $(document).ready(function() { | | var content = $textbox.val() || ""; |
|
| | var match = content.match(shortDescRegex); |
| // 1. DAFTAR HALAMAN YANG MAU DIKUNCI
| | originalShortDesc = match ? match[0] : ""; |
| // Tambah atau hapus di dalam kurung siku ini. Gunakan koma sebagai pemisah.
| | } |
| var protectedPages = [
| | }); |
| "MediaWiki:",
| |
| "Mippedia:Privasi",
| |
| "Mippedia:Kebijakan", | |
| "Spesial:Versi",
| |
| "Mippedia:Ketentuan_penggunaan"
| |
| ]; | |
|
| |
|
| // 2. CEK STATUS USER & HALAMAN | | observer.observe(document.body, { childList: true, subtree: true }); |
| var userGroups = mw.config.get('wgUserGroups') || [];
| |
| // Daftar grup yang KEBAL proteksi (bisa akses halaman)
| |
| var isStaff = userGroups.some(r => ["sysop", "bureaucrat", "steward", "interface-admin"].includes(r));
| |
|
| |
| var currentPage = mw.config.get('wgPageName');
| |
| // Cek apakah halaman saat ini masuk dalam daftar proteksi
| |
| var shouldProtect = protectedPages.some(prefix => currentPage.startsWith(prefix.replace(/ /g, '_')));
| |
|
| |
|
| // 3. EKSEKUSI PROTEKSI (Hanya jika user BUKAN staff) | | // Event listener untuk tombol simpan di berbagai platform |
| if (shouldProtect && !isStaff) { | | $(document).on('click mousedown touchstart', |
| | | '#wpSave, .mw-ui-button.primary, button.submit, .editor-save, .save-button, button[type="submit"]', |
| // Hapus total konten asli agar tidak bisa diintip/disunting | | function(e) { |
| $('body').addClass('mippedia-locked').html('');
| | return validateAndBlock(e); |
| | } |
| | ); |
|
| |
|
| // Inject CSS khusus untuk tampilan Mobile-Friendly & Auto-Center
| | window.addEventListener('submit', function(e) { |
| $('<style>').prop('type', 'text/css').html(`
| | if (!validateAndBlock(e)) e.preventDefault(); |
| html, body {
| | }, true); |
| margin: 0 !important;
| |
| padding: 0 !important;
| |
| height: 100% !important;
| |
| width: 100% !important;
| |
| overflow: hidden !important;
| |
| background: #f8f9fa !important;
| |
| }
| |
| #protection-wrapper {
| |
| display: flex;
| |
| align-items: center;
| |
| justify-content: center;
| |
| min-height: 100vh;
| |
| width: 100vw;
| |
| padding: 20px;
| |
| box-sizing: border-box;
| |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
| |
| }
| |
| .protection-card {
| |
| width: 100%;
| |
| max-width: 400px;
| |
| background: #ffffff;
| |
| padding: 40px 25px;
| |
| border-radius: 30px;
| |
| box-shadow: 0 15px 50px rgba(54, 102, 204, 0.15);
| |
| border: 1px solid #eef0f2;
| |
| text-align: center;
| |
| }
| |
| .shield-icon { font-size: 70px; display: block; margin-bottom: 20px; }
| |
| .lock-title { color: #1a1a1a; font-size: 24px; font-weight: 800; margin: 0 0 15px 0; }
| |
| .lock-desc { color: #5f6368; font-size: 15px; line-height: 1.6; margin-bottom: 25px; }
| |
| .admin-notice {
| |
| background: #fff5f5;
| |
| color: #d93025;
| |
| padding: 12px;
| |
| border-radius: 12px;
| |
| font-size: 13px;
| |
| font-weight: 700;
| |
| margin-bottom: 30px;
| |
| border: 1px solid #fadbd8;
| |
| }
| |
| .btn-back {
| |
| background: #36c;
| |
| color: #fff;
| |
| border: none;
| |
| padding: 16px;
| |
| border-radius: 18px;
| |
| font-weight: 700;
| |
| font-size: 16px;
| |
| width: 100%;
| |
| cursor: pointer;
| |
| box-shadow: 0 4px 12px rgba(51, 102, 204, 0.3);
| |
| }
| |
| .link-home { display: block; margin-top: 20px; color: #70757a; font-size: 14px; text-decoration: none; }
| |
| .footer-ver { margin-top: 40px; font-size: 10px; color: #bdc1c6; font-weight: bold; letter-spacing: 2px; }
| |
| `).appendTo('head');
| |
|
| |
|
| // Tampilkan layar kunci
| | })(jQuery, mediaWiki); |
| var shieldHTML = `
| |
| <div id="protection-wrapper">
| |
| <div class="protection-card">
| |
| <span class="shield-icon">🛡️</span>
| |
| <h2 class="lock-title">Akses Dibatasi</h2>
| |
| <p class="lock-desc">
| |
| Halaman ini merupakan bagian sensitif yang dilindungi oleh <b>Mippedia Community</b> untuk menjaga stabilitas sistem.
| |
| </p>
| |
| <div class="admin-notice">
| |
| Hanya Administrator & Birokrat yang dapat mengakses halaman ini.
| |
| </div>
| |
| <button class="btn-back" onclick="window.history.back()">
| |
| Kembali ke Halaman Sebelumnya
| |
| </button>
| |
| <a href="/" class="link-home">Kembali ke Beranda</a>
| |
| <div class="footer-ver">MIPPEDIA SECURE v2.0</div>
| |
| </div>
| |
| </div>
| |
| `;
| |
|
| |
|
| $('body').append(shieldHTML);
| | $(function() { |
| | $('.ambox-learn-more').on('click', function(e) { |
| | e.preventDefault(); |
| | var $parentBox = $(this).closest('.ambox'); |
| | | |
| // Ubah judul tab browser | | $parentBox.toggleClass('ambox-active'); |
| document.title = "Akses Dilindungi - Mippedia"; | | $parentBox.find('.ambox-text-long').slideToggle('fast'); |
| } | | |
| | // Ubah teks tombol pas dibuka |
| | if ($parentBox.hasClass('ambox-active')) { |
| | $(this).text('Sembunyikan'); |
| | } else { |
| | $(this).text('Pelajari selengkapnya'); |
| | } |
| | }); |
| }); | | }); |