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) | ||
- | - 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'); | ||
// | // 1. FILTER KETAT (Penyebab Masalah di Screenshot lo) | ||
// | // 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; | |||
} | |||
// | // 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); | ||
// | // 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); | ||
var i = 0; | var i = 0; | ||
var speed = 25; | var speed = 25; | ||
| Baris 1.408: | Baris 1.416: | ||
setTimeout(typeWriter, 500); | setTimeout(typeWriter, 500); | ||
$('#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; | ||