MediaWiki:Common.js: Perbedaan antara revisi

Tidak ada ringkasan suntingan
Tanda: Suntingan perangkat seluler Suntingan peramban seluler
Tidak ada ringkasan suntingan
Tanda: Suntingan perangkat seluler Suntingan peramban seluler
Baris 1.327: Baris 1.327:


/* ==========================================================
/* ==========================================================
   🧠 MIPPEDIA SMART-SUMMARY V5 - TYPEWRITER EDITION (FIXED)
   🧠 MIPPEDIA SMART-SUMMARY V5 - TYPEWRITER EDITION (ULTRA FIXED)
   - Fixed: Tombol otomatis hilang saat Edit/Action/File
   - Anti-Leak: Tombol HARAM muncul di Editor / Media Viewer / History
   ========================================================== */
   ========================================================== */
(function() {
(function() {
Baris 1.348: Baris 1.348:
         var action = mw.config.get('wgAction');
         var action = mw.config.get('wgAction');


         // PERBAIKAN: Tombol hanya muncul di Namespace 0 (Artikel) DAN Action 'view'
         // 1. FILTER KETAT (Penyebab Masalah di Screenshot lo)
         // Jika sedang edit, history, atau di halaman File/Media, skrip berhenti di sini.
         // Tombol mati kalau: Bukan artikel, lagi Edit, lagi History, atau ada editor aktif
         if (ns !== 0 || action !== 'view') return;
         if (ns !== 0 || action !== 'view' || $('#wpTextbox1').length || $('.ve-ui-surface').length) {
            return;
        }


         // 1. Tombol Melayang Presisi
         // 2. Tombol Melayang Presisi
         var $btn = $('<div id="mip-summary-btn">✨ Rangkum</div>').css({
         var $btn = $('<div id="mip-summary-btn">✨ Rangkum</div>').css({
             'position': 'absolute', 'right': '15px', 'top': '-35px',
             'position': 'absolute', 'right': '15px', 'top': '-35px',
Baris 1.361: Baris 1.363:
         $('.page-actions-menu').css('position', 'relative').prepend($btn);
         $('.page-actions-menu').css('position', 'relative').prepend($btn);


         // 2. Logic Cinematic Typing
         // 3. CSS TAMBAHAN: Sembunyiin paksa kalau ada MediaViewer (Layar hitam gambar)
        $('<style>').text(`
            .mw-mmv-viewer-active #mip-summary-btn,
            .ve-active #mip-summary-btn {
                display: none !important;
            }
        `).appendTo('head');
 
        // 4. Logic Cinematic Typing
         $btn.on('click', function() {
         $btn.on('click', function() {
             var fullText = getSummary();
             var fullText = getSummary();
           
             var $overlay = $('<div id="mip-sum-ov"></div>').css({
             var $overlay = $('<div id="mip-sum-ov"></div>').css({
                 'position': 'fixed', 'top': 0, 'left': 0, 'width': '100%', 'height': '100%',
                 'position': 'fixed', 'top': 0, 'left': 0, 'width': '100%', 'height': '100%',
Baris 1.392: Baris 1.401:
             }, 50);
             }, 50);


            // FUNGSI TYPING
             var i = 0;
             var i = 0;
             var speed = 25;  
             var speed = 25;  
Baris 1.408: Baris 1.416:
             setTimeout(typeWriter, 500);
             setTimeout(typeWriter, 500);


            // Close
             $('#mip-close, #mip-sum-ov').on('click', function(e) {
             $('#mip-close, #mip-sum-ov').on('click', function(e) {
                 if (e.target !== this) return;
                 if (e.target !== this) return;