MediaWiki:Common.js: Perbedaan antara revisi
Tidak ada ringkasan suntingan Tanda: Suntingan perangkat seluler Suntingan peramban seluler |
Tidak ada ringkasan suntingan |
||
| (8 revisi perantara oleh pengguna yang sama tidak ditampilkan) | |||
| Baris 1: | Baris 1: | ||
/** | /** | ||
* ==================================================================== | * ==================================================================== | ||
* MIPPEDIA DATA - ADVANCED STRUCTURED DATA SYSTEM (V8. | * MIPPEDIA DATA - ADVANCED STRUCTURED DATA SYSTEM (V8.7 SECURE ULTIMATE) | ||
* Fitur: ALL ORIGINAL | * Fitur: ALL ORIGINAL V8 FEATURES KEPT + Global Social Media Box, | ||
* Smart | * Smart Autocomplete/Preview Wikilink, Ultra-Strict Security, Mobile Ready. | ||
* ==================================================================== | * ==================================================================== | ||
*/ | */ | ||
| Baris 19: | Baris 19: | ||
var isLocked = false; | var isLocked = false; | ||
var api = new mw.Api(); | var api = new mw.Api(); | ||
var DRAFT_KEY = 'mippedia_data_draft_' + pageName; | var DRAFT_KEY = 'mippedia_data_draft_' + pageName; | ||
// 1. DATA MASTER PLATFORM MEDIA SOSIAL & MUSIK (FULL ASLI) | // 1. DATA MASTER PLATFORM MEDIA SOSIAL & MUSIK (FULL ASLI) | ||
| Baris 80: | Baris 80: | ||
function sanitizeHTML(str) { | function sanitizeHTML(str) { | ||
if (typeof str !== 'string') return str; | if (typeof str !== 'string') return str; | ||
return str.replace(/[&<>"']/g, function( | return str.replace(/[&<>"'`=\/]/g, function(s) { | ||
return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[ | return { | ||
'&': '&', '<': '<', '>': '>', '"': '"', | |||
"'": ''', '/': '/', '`': '`', '=': '=' | |||
}[s]; | |||
}); | }); | ||
} | } | ||
| Baris 109: | Baris 112: | ||
if (!urlStr) return ''; | if (!urlStr) return ''; | ||
urlStr = urlStr.trim(); | urlStr = urlStr.trim(); | ||
// | var protoMatch = urlStr.match(/^([a-z0-9]+):/i); | ||
if ( | if (protoMatch) { | ||
var badProtos = ['javascript', 'data', 'vbscript', 'file', 'ws', 'wss', 'ftp']; | |||
if (badProtos.indexOf(protoMatch[1].toLowerCase()) !== -1) return ''; | |||
} | |||
return (urlStr && !urlStr.match(/^https?:\/\//i)) ? 'https://' + urlStr : urlStr; | return (urlStr && !urlStr.match(/^https?:\/\//i)) ? 'https://' + urlStr : urlStr; | ||
} | } | ||
| Baris 121: | Baris 127: | ||
} | } | ||
// 5. STYLESHEET | // 5. STYLESHEET (TERMASUK LAYOUT MEDIA SOSIAL GLOBAL & AUTOCOMPLETE) | ||
var css = ` | var css = ` | ||
#mippedia-data-app { | #mippedia-data-app { | ||
| Baris 145: | Baris 151: | ||
.md-search-input:focus { background: #fff; border-color: #4f46e5; outline: none; } | .md-search-input:focus { background: #fff; border-color: #4f46e5; outline: none; } | ||
.md-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #94a3b8; } | .md-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #94a3b8; } | ||
/* Kotak Global Sosial Media Terpisah di Atas */ | |||
.md-global-social-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); } | |||
.md-social-box-title { font-size: 0.85rem; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; border-bottom: 1px dashed #cbd5e1; padding-bottom: 8px; } | |||
.md-social-group { display: flex; flex-wrap: wrap; gap: 8px; } | |||
.md-social-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; color: white !important; text-decoration: none !important; transition: transform 0.2s, opacity 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.05); } | |||
.md-social-badge:hover { transform: translateY(-2px); opacity: 0.92; } | |||
.md-row-display { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 12px; border-bottom: 1px solid #f1f5f9; transition: all 0.2s; border-radius: 12px; gap: 12px; margin-bottom: 8px; background: #fff; } | .md-row-display { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 12px; border-bottom: 1px solid #f1f5f9; transition: all 0.2s; border-radius: 12px; gap: 12px; margin-bottom: 8px; background: #fff; } | ||
| Baris 156: | Baris 169: | ||
.md-btn-copy { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 2px 4px; border-radius: 4px; transition: 0.2s; display: inline-flex; align-items: center; } | .md-btn-copy { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 2px 4px; border-radius: 4px; transition: 0.2s; display: inline-flex; align-items: center; } | ||
.md-btn-copy:hover { color: #4f46e5; background: #e0e7ff; } | .md-btn-copy:hover { color: #4f46e5; background: #e0e7ff; } | ||
.md-ref-container { margin-top: 10px; width: 100%; box-sizing: border-box; } | .md-ref-container { margin-top: 10px; width: 100%; box-sizing: border-box; } | ||
.md-ref-details { background: #f8fafc; border-left: 3px solid #4f46e5; border-radius: 10px; overflow: hidden; border-top:1px solid #f1f5f9; border-right:1px solid #f1f5f9; border-bottom:1px solid #f1f5f9; transition: 0.3s; } | .md-ref-details { background: #f8fafc; border-left: 3px solid #4f46e5; border-radius: 10px; overflow: hidden; border-top:1px solid #f1f5f9; border-right:1px solid #f1f5f9; border-bottom:1px solid #f1f5f9; transition: 0.3s; } | ||
.md-ref-details summary { display: flex; padding: 10px 14px; font-size: 0.85rem; font-weight: 700; color: #374151; cursor: pointer; user-select: none; list-style: none; flex-wrap: nowrap; } | .md-ref-details summary { display: flex; padding: 10px 14px; font-size: 0.85rem; font-weight: 700; color: #374151; cursor: pointer; user-select: none; list-style: none; flex-wrap: nowrap; align-items: center; gap: 8px; } | ||
.md-ref-details summary::-webkit-details-marker { display: none; } | .md-ref-details summary::-webkit-details-marker { display: none; } | ||
.md-ref-details[open] summary { border-bottom: 1px dashed #cbd5e1; background: #e0e7ff; color: #3730a3; } | .md-ref-details[open] summary { border-bottom: 1px dashed #cbd5e1; background: #e0e7ff; color: #3730a3; } | ||
.md-ref-body { padding: 12px 14px; font-size: 0.85rem; display: flex; flex-direction: column; gap: 6px; } | .md-ref-body { padding: 12px 14px; font-size: 0.85rem; display: flex; flex-direction: column; gap: 6px; } | ||
.md-verified-badge { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin-left: | .md-verified-badge { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; vertical-align: middle; transition: transform 0.2s; flex-shrink: 0; } | ||
.md-verified-badge:hover { transform: scale(1.1); } | .md-verified-badge:hover { transform: scale(1.1); } | ||
.md-btn-visit { background: #f1f5f9; color: #0f172a; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 0.8rem; display: inline-block; width: fit-content; margin-top: 6px; font-weight:700; border:1px solid #cbd5e1; } | .md-btn-visit { background: #f1f5f9; color: #0f172a; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 0.8rem; display: inline-block; width: fit-content; margin-top: 6px; font-weight:700; border:1px solid #cbd5e1; } | ||
| Baris 181: | Baris 190: | ||
.md-form-group { margin-bottom: 14px; } | .md-form-group { margin-bottom: 14px; } | ||
.md-form-group label { display: flex; align-items:center; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; color: #334155; } | .md-form-group label { display: flex; align-items:center; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; color: #334155; } | ||
.md-input, .md-select, .md-textarea { width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; font-family: inherit; font-size: 0.9rem; transition: 0.2s; background: #fff; } | .md-input, .md-select, .md-textarea { width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; font-family: inherit; font-size: 0.9rem; transition: 0.2s; background: #fff; } | ||
.md-input:focus, .md-select:focus, .md-textarea:focus { border-color: #4f46e5; outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); } | .md-input:focus, .md-select:focus, .md-textarea:focus { border-color: #4f46e5; outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); } | ||
/* Autocomplete Styles */ | |||
.md-autocomplete-wrapper { position: relative; width: 100%; } | |||
.md-autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #cbd5e1; border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 1000; display: none; max-height: 200px; overflow-y: auto; margin-top: -2px; } | |||
.md-autocomplete-item { padding: 10px 12px; font-size: 0.88rem; color: #0f172a; cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: 0.2s; display: flex; align-items: center; gap: 8px; } | |||
.md-autocomplete-item:last-child { border-bottom: none; } | |||
.md-autocomplete-item:hover { background: #f8fafc; color: #4f46e5; padding-left: 16px; } | |||
.md-ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #f8fafc; padding: 12px; border-radius: 8px; border: 1px dashed #cbd5e1; } | .md-ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #f8fafc; padding: 12px; border-radius: 8px; border: 1px dashed #cbd5e1; } | ||
.md-social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #f1f5f9; padding: 12px; border-radius: 8px; border: 1px solid #cbd5e1; max-height: 280px; overflow-y: auto; } | .md-social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #f1f5f9; padding: 12px; border-radius: 8px; border: 1px solid #cbd5e1; max-height: 280px; overflow-y: auto; } | ||
| Baris 194: | Baris 211: | ||
.md-help-icon:hover { color: #4f46e5; } | .md-help-icon:hover { color: #4f46e5; } | ||
.md-tooltip-popup { position: absolute; background: #1e293b; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 0.8rem; width: 260px; max-width: calc(100vw - 30px); z-index: 1000; box-shadow: 0 4px 15px rgba(0,0,0,0.15); display: none; line-height: 1.4; text-align: left; font-weight:normal; } | .md-tooltip-popup { position: absolute; background: #1e293b; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 0.8rem; width: 260px; max-width: calc(100vw - 30px); z-index: 1000; box-shadow: 0 4px 15px rgba(0,0,0,0.15); display: none; line-height: 1.4; text-align: left; font-weight:normal; } | ||
.md-tooltip-popup::after { content: ''; position: absolute; border-width: 6px; border-style: solid; border-color: #1e293b transparent transparent transparent; top: 100%; left: 15px; } | .md-tooltip-popup::after { content: ''; position: absolute; border-width: 6px; border-style: solid; border-color: #1e293b transparent transparent transparent; top: 100%; left: 15px; } | ||
| Baris 213: | Baris 229: | ||
@keyframes md-spin { to { transform: rotate(360deg); } } | @keyframes md-spin { to { transform: rotate(360deg); } } | ||
/* Mobile Optimized Layout (Seluler) */ | |||
@media (max-width: 600px) { | @media (max-width: 600px) { | ||
#mippedia-data-app { padding: 14px; margin: 14px 0; border-radius: 12px; } | #mippedia-data-app { padding: 14px; margin: 14px 0; border-radius: 12px; } | ||
| Baris 222: | Baris 239: | ||
.md-form-actions { flex-direction: column; width: 100%; } | .md-form-actions { flex-direction: column; width: 100%; } | ||
.md-btn { width: 100%; margin: 0 !important; } | .md-btn { width: 100%; margin: 0 !important; } | ||
.md-row-display { padding: 12px | .md-row-display { padding: 12px 10px; flex-direction:column; align-items:stretch;} | ||
.edit-btn { align-self:flex-end; } | .edit-btn { align-self:flex-end; margin-top:8px; } | ||
.md-ref-details summary { align-items: flex-start; } | |||
} | } | ||
.md-native-render { display: none; } | .md-native-render { display: none; } | ||
| Baris 229: | Baris 247: | ||
$('<style>').text(css).appendTo('head'); | $('<style>').text(css).appendTo('head'); | ||
// 6. POPUP, MODAL & TOOLTIPS | // 6. POPUP, MODAL & TOOLTIPS | ||
function showModal(title, text) { | function showModal(title, text) { | ||
$('.md-modal-overlay').remove(); | $('.md-modal-overlay').remove(); | ||
| Baris 244: | Baris 262: | ||
e.stopPropagation(); | e.stopPropagation(); | ||
var $icon = $(this); | var $icon = $(this); | ||
var text = sanitizeHTML($icon.data('help')); | var text = sanitizeHTML($icon.data('help')); | ||
var $tt = $('<div class="md-tooltip-popup">' + text + '</div>'); | var $tt = $('<div class="md-tooltip-popup">' + text + '</div>'); | ||
| Baris 254: | Baris 271: | ||
var leftPos = offset.left - 15; | var leftPos = offset.left - 15; | ||
if (leftPos + ttWidth > winWidth - 15) leftPos = winWidth - ttWidth - 15; | |||
if (leftPos + ttWidth > winWidth - 15) | if (leftPos < 10) leftPos = 10; | ||
if (leftPos < 10) | |||
$tt.css({ top: offset.top - $tt.outerHeight() - 10, left: leftPos }).fadeIn(200); | $tt.css({ top: offset.top - $tt.outerHeight() - 10, left: leftPos }).fadeIn(200); | ||
| Baris 324: | Baris 335: | ||
if ($btnEl) $btnEl.addClass('is-loading').prop('disabled', true); | if ($btnEl) $btnEl.addClass('is-loading').prop('disabled', true); | ||
var summaryTxt = customSummary ? ('Mippedia Data: ' + customSummary) : ('Mippedia Data V8. | var summaryTxt = customSummary ? ('Mippedia Data: ' + customSummary) : ('Mippedia Data V8.7: ' + actionType); | ||
var jsonStr = JSON.stringify({ locked: isLocked, items: dataItems }); | var jsonStr = JSON.stringify({ locked: isLocked, items: dataItems }); | ||
var wt = "<!-- MIPPEDIA_DATA_START | " + jsonStr + " -->\n"; | var wt = "<!-- MIPPEDIA_DATA_START | " + jsonStr + " -->\n"; | ||
| Baris 386: | Baris 397: | ||
$app.append($header); | $app.append($header); | ||
// Tampilkan kotak pencarian jika data banyak | |||
if (dataItems.length > 2) { | if (dataItems.length > 2) { | ||
var $searchBox = $('<div class="md-search-box"><span class="md-search-icon">' + svgSearch + '</span><input type="text" class="md-search-input" placeholder="Cari data terstruktur..."></div>'); | var $searchBox = $('<div class="md-search-box"><span class="md-search-icon">' + svgSearch + '</span><input type="text" class="md-search-input" placeholder="Cari data terstruktur..."></div>'); | ||
| Baris 396: | Baris 408: | ||
}); | }); | ||
$app.append($searchBox); | $app.append($searchBox); | ||
} | |||
// MENGUMPULKAN MEDIA SOSIAL GLOBAL (Memisahkan media sosial ke atas) | |||
var globalSocials = {}; | |||
dataItems.forEach(function(item) { | |||
if (item.isPersonOrg && item.socials) { | |||
Object.assign(globalSocials, item.socials); | |||
} | |||
}); | |||
if (Object.keys(globalSocials).length > 0) { | |||
var $topSocials = $('<div class="md-global-social-box"></div>'); | |||
$topSocials.append('<div class="md-social-box-title">Media Sosial & Platform Resmi</div>'); | |||
var $socialGroupGlobal = $('<div class="md-social-group"></div>'); | |||
Object.keys(SOCIAL_PLATFORMS).forEach(function(key) { | |||
var uname = globalSocials[key]; | |||
if (uname) { | |||
var platform = SOCIAL_PLATFORMS[key]; | |||
var fullUrl = platform.base + uname.replace(/^@/, ''); | |||
var $badge = $('<a class="md-social-badge" href="' + sanitizeHTML(fullUrl) + '" target="_blank" rel="noopener noreferrer" style="background:' + platform.color + ';">' + platform.icon + ' ' + sanitizeHTML(platform.name) + '</a>'); | |||
$socialGroupGlobal.append($badge); | |||
} | |||
}); | |||
$topSocials.append($socialGroupGlobal); | |||
$app.append($topSocials); | |||
} | } | ||
| Baris 440: | Baris 478: | ||
$valWrap.append($copyBtn); | $valWrap.append($copyBtn); | ||
$info.append($valWrap); | $info.append($valWrap); | ||
if (item.ref && (item.ref.url || item.ref.title)) { | if (item.ref && (item.ref.url || item.ref.title)) { | ||
| Baris 468: | Baris 490: | ||
var $refDetails = $(` | var $refDetails = $(` | ||
<details class="md-ref-details"> | <details class="md-ref-details"> | ||
<summary | <summary> | ||
< | <div style="color:#4f46e5; display:inline-flex; align-items:center; gap:5px; white-space:nowrap; flex-shrink:0;">${svgRef} REFERENSI:</div> | ||
< | <div style="color:#374151; display:flex; align-items:center; flex-wrap:wrap; flex:1;"> | ||
<span style="word-break:break-word;">${sanitizeHTML(refTitle)}</span>${verBadgeHtml} | <span style="word-break:break-word; line-height:1.3;">${sanitizeHTML(refTitle)}</span>${verBadgeHtml} | ||
</ | </div> | ||
</summary> | </summary> | ||
<div class="md-ref-body"> | <div class="md-ref-body"> | ||
| Baris 480: | Baris 502: | ||
${ref.date ? '<div><span style="color:#64748b; font-weight:700;">Tanggal Akses:</span> ' + formatIndonesianDate(ref.date) + '</div>' : ''} | ${ref.date ? '<div><span style="color:#64748b; font-weight:700;">Tanggal Akses:</span> ' + formatIndonesianDate(ref.date) + '</div>' : ''} | ||
${ref.type ? '<div style="margin-top:4px;"><span style="background:#e2e8f0; padding:2px 8px; border-radius:6px; font-weight:700; font-size:0.75rem;">' + sanitizeHTML(ref.type) + (ref.subType ? ' • ' + sanitizeHTML(ref.subType) : '') + '</span></div>' : ''} | ${ref.type ? '<div style="margin-top:4px;"><span style="background:#e2e8f0; padding:2px 8px; border-radius:6px; font-weight:700; font-size:0.75rem;">' + sanitizeHTML(ref.type) + (ref.subType ? ' • ' + sanitizeHTML(ref.subType) : '') + '</span></div>' : ''} | ||
${safeUrl ? '<a href="' + sanitizeHTML(safeUrl) + '" target="_blank" rel="noopener noreferrer" class="md-btn-visit"> | ${safeUrl ? '<a href="' + sanitizeHTML(safeUrl) + '" target="_blank" rel="noopener noreferrer" class="md-btn-visit">Kunjungi Situs</a>' : ''} | ||
</div> | </div> | ||
</details> | </details> | ||
| Baris 487: | Baris 509: | ||
$refDetails.find('.md-verified-badge').on('click', function(e) { | $refDetails.find('.md-verified-badge').on('click', function(e) { | ||
e.preventDefault(); e.stopPropagation(); | e.preventDefault(); e.stopPropagation(); | ||
showModal('Situs Terverifikasi', 'Centang biru menandakan bahwa URL referensi berasal dari | showModal('Situs Terverifikasi', 'Centang biru menandakan bahwa URL referensi ini valid dan berasal dari entitas, media publikasi besar, portal populer, atau pangkalan data resmi (seperti Kompas, YouTube, Apple Music, Spotify, dll) yang bereputasi kredibel.'); | ||
}); | }); | ||
| Baris 554: | Baris 576: | ||
var $valBox = $('<div class="md-form-group"></div>'); | var $valBox = $('<div class="md-form-group"></div>'); | ||
$valBox.append('<label>Nilai Data <span class="md-help-icon" data-help=" | $valBox.append('<label>Nilai Data <span class="md-help-icon" data-help="Ketik nilai. Jika halaman sudah ada di Wiki, saran akan muncul (pratinjau) dan otomatis mencentang opsi Wikilink.">' + svgHelp + '</span></label>'); | ||
$ | |||
// FITUR AUTOCOMPLETE PRATINJAU DIMULAI DI SINI | |||
var $autoWrap = $('<div class="md-autocomplete-wrapper"></div>'); | |||
var $valInput = $('<input type="text" id="md-inp-val" class="md-input" autocomplete="off" value="' + sanitizeHTML(currentData.val || '') + '">'); | |||
var $autoList = $('<div class="md-autocomplete-list"></div>'); | |||
$autoWrap.append($valInput).append($autoList); | |||
$valBox.append($autoWrap); | |||
var $wikilinkOpts = $('<div style="margin-top:8px; display:flex; flex-direction:column; gap:8px; background:#f8fafc; padding:10px; border-radius:8px; border:1px solid #e2e8f0;"></div>'); | var $wikilinkOpts = $('<div style="margin-top:8px; display:flex; flex-direction:column; gap:8px; background:#f8fafc; padding:10px; border-radius:8px; border:1px solid #e2e8f0;"></div>'); | ||
| Baris 561: | Baris 589: | ||
var chkSplit = currentData.linkSplit ? 'checked' : ''; | var chkSplit = currentData.linkSplit ? 'checked' : ''; | ||
$ | var $linkCheck = $('<input type="checkbox" id="md-inp-link" ' + chkLink + '>'); | ||
var $lblLinkCheck = $('<label style="display:flex; align-items:center; gap:8px; font-size:0.82rem; font-weight:700; cursor:pointer;"></label>'); | |||
$lblLinkCheck.append($linkCheck).append(' Jadikan Wikilink Standar'); | |||
// Logika pratinjau ketika diketik | |||
var isAutoChecked = false; | |||
$valInput.on('input', function() { | |||
var q = $(this).val(); | |||
// Jika input dikosongkan/berubah, kembalikan centang link ke false jika tadinya otomatis centang | |||
if (isAutoChecked) { | |||
$linkCheck.prop('checked', false); | |||
isAutoChecked = false; | |||
} | |||
if(q.length < 1) { | |||
$autoList.empty().hide(); | |||
return; | |||
} | |||
// Panggil API MediaWiki Prefix Search | |||
api.get({ | |||
action: 'query', | |||
list: 'prefixsearch', | |||
pssearch: q, | |||
pslimit: 6, | |||
format: 'json' | |||
}).done(function(data) { | |||
$autoList.empty(); | |||
if(data.query && data.query.prefixsearch && data.query.prefixsearch.length > 0) { | |||
data.query.prefixsearch.forEach(function(res) { | |||
var $item = $('<div class="md-autocomplete-item">' + svgSearch + ' ' + sanitizeHTML(res.title) + '</div>'); | |||
$item.on('click', function() { | |||
$valInput.val(res.title); | |||
$autoList.empty().hide(); | |||
$linkCheck.prop('checked', true); // OTOMATIS TERCENTANG | |||
isAutoChecked = true; | |||
}); | |||
$autoList.append($item); | |||
}); | |||
$autoList.show(); | |||
} else { | |||
$autoList.hide(); | |||
} | |||
}); | |||
}); | |||
// Sembunyikan pratinjau saat klik di luar | |||
$(document).on('click.mdauto', function(e) { | |||
if(!$(e.target).closest('.md-autocomplete-wrapper').length) { | |||
$autoList.hide(); | |||
} | |||
}); | |||
$wikilinkOpts.append($lblLinkCheck); | |||
$wikilinkOpts.append('<label style="display:flex; align-items:center; gap:8px; font-size:0.82rem; font-weight:700; cursor:pointer;"><input type="checkbox" id="md-inp-split" ' + chkSplit + '> Smart Split Wikilink</label>'); | $wikilinkOpts.append('<label style="display:flex; align-items:center; gap:8px; font-size:0.82rem; font-weight:700; cursor:pointer;"><input type="checkbox" id="md-inp-split" ' + chkSplit + '> Smart Split Wikilink</label>'); | ||
var $pipedGroup = $('<div style="margin-top:4px;"><label style="font-size:0.78rem; color:#475569; margin-bottom:4px;">Target Halaman Khusus (Opsional):</label><input type="text" id="md-inp-target" class="md-input" style="padding:6px 10px; font-size:0.85rem;" placeholder="Contoh: Diskografi Rumi Haitami" value="' + sanitizeHTML(currentData.linkTarget || '') + '"></div>'); | var $pipedGroup = $('<div style="margin-top:4px;"><label style="font-size:0.78rem; color:#475569; margin-bottom:4px;">Target Halaman Khusus (Opsional):</label><input type="text" id="md-inp-target" class="md-input" style="padding:6px 10px; font-size:0.85rem;" placeholder="Contoh: Diskografi Rumi Haitami" value="' + sanitizeHTML(currentData.linkTarget || '') + '"></div>'); | ||
| Baris 570: | Baris 652: | ||
var $socialSec = $('<div class="md-form-group" style="margin-top:16px;"></div>'); | var $socialSec = $('<div class="md-form-group" style="margin-top:16px;"></div>'); | ||
var chkPerson = currentData.isPersonOrg ? 'checked' : ''; | var chkPerson = currentData.isPersonOrg ? 'checked' : ''; | ||
$socialSec.append('<label style="display:flex; align-items:center; gap:8px; cursor:pointer; background:#e0e7ff; padding:10px; border-radius:8px; font-weight:700; color:#3730a3; font-size:0.85rem;"><input type="checkbox" id="md-chk-person" ' + chkPerson + '> | $socialSec.append('<label style="display:flex; align-items:center; gap:8px; cursor:pointer; background:#e0e7ff; padding:10px; border-radius:8px; font-weight:700; color:#3730a3; font-size:0.85rem;"><input type="checkbox" id="md-chk-person" ' + chkPerson + '> Simpan Profil Media Sosial (Akan muncul di paling atas) <span class="md-help-icon" data-help="Centang ini untuk mengisi data sosial media. Datanya akan dihimpun dan dimunculkan di kotak teratas data struktur.">' + svgHelp + '</span></label>'); | ||
var $socialGrid = $('<div class="md-social-grid" id="md-social-box" style="display:' + (currentData.isPersonOrg ? 'grid' : 'none') + '; margin-top:8px;"></div>'); | var $socialGrid = $('<div class="md-social-grid" id="md-social-box" style="display:' + (currentData.isPersonOrg ? 'grid' : 'none') + '; margin-top:8px;"></div>'); | ||
| Baris 582: | Baris 664: | ||
var $refArea = $('<div class="md-form-group" style="margin-top:20px;"></div>'); | var $refArea = $('<div class="md-form-group" style="margin-top:20px;"></div>'); | ||
$refArea.append('<label style="font-size:0.95rem; font-weight:800; color:#0f172a; margin-bottom:10px;">Sumber Referensi <span class="md-help-icon" data-help="Mohon berikan sumber referensi yang valid, kredibel, dan dapat dipertanggungjawabkan (seperti portal berita resmi, jurnal akademik ilmiah, buku cetak ber-ISBN, atau pangkalan data terverifikasi). Referensi yang kuat sangat membantu memastikan keakuratan informasi. Jika URL rujukan Anda mengarah ke situs web besar yang terverifikasi, sistem keamanan akan secara otomatis menampilkan lencana centang biru premium sebagai tanda sumber tepercaya.">' + svgHelp + '</span></label>'); | |||
$refArea.append('<label style="font-size:0.95rem; font-weight:800; color:#0f172a; margin-bottom:10px;">Sumber Referensi <span class="md-help-icon" data-help="Mohon berikan sumber referensi yang valid, kredibel, dan dapat dipertanggungjawabkan (seperti portal berita resmi, jurnal akademik ilmiah, buku cetak ber-ISBN, atau pangkalan data terverifikasi). Referensi yang kuat | |||
var $refGrid = $('<div class="md-ref-grid"></div>'); | var $refGrid = $('<div class="md-ref-grid"></div>'); | ||
| Baris 608: | Baris 689: | ||
$refGrid.append('<div><label style="font-size:0.78rem; margin-bottom:4px;">Sub-Tipe</label></div>').find('div').last().append($subTypeSel); | $refGrid.append('<div><label style="font-size:0.78rem; margin-bottom:4px;">Sub-Tipe</label></div>').find('div').last().append($subTypeSel); | ||
var $urlInput = $('<input type=" | var $urlInput = $('<input type="text" id="md-ref-url" class="md-input" placeholder="https://...." value="' + sanitizeHTML(currentRef.url || '') + '">'); | ||
$urlInput.on('blur', function() { | $urlInput.on('blur', function() { | ||
var u = ensureHttps($(this).val()); | var u = ensureHttps($(this).val()); | ||
| Baris 675: | Baris 756: | ||
$form.append($actions); | $form.append($actions); | ||
$container.append($form); | $container.append($form); | ||
initTooltips(); | initTooltips(); | ||
$('#md-chk-person').on('change', function() { | $('#md-chk-person').on('change', function() { | ||
| Baris 1.276: | Baris 1.357: | ||
'<div style="font-size:11px; color:#718096; font-weight:800; text-transform:uppercase; letter-spacing:1px; margin-bottom:10px;">Lisensi, Atribusi & Penggunaan Data</div>' + | '<div style="font-size:11px; color:#718096; font-weight:800; text-transform:uppercase; letter-spacing:1px; margin-bottom:10px;">Lisensi, Atribusi & Penggunaan Data</div>' + | ||
'<p style="margin:0 0 10px; font-size:13px; color:#4a5568; line-height:1.6;">' + | '<p style="margin:0 0 10px; font-size:13px; color:#4a5568; line-height:1.6;">' + | ||
'Seluruh data terstruktur yang tersaji dalam repositori ini merupakan milik publik dan tersedia di bawah | 'Seluruh data terstruktur yang tersaji dalam repositori ini merupakan milik publik dan tersedia di bawah ' + | ||
'<a href="https://creativecommons.org/ | '<a href="https://creativecommons.org/publicdomain/zero/1.0/"target="_blank" style="color:#6a5acd; text-decoration:none; font-weight:700;">Lisensi Creative Commons CC0</a>.' + | ||
'</p>' + | '</p>' + | ||
'<p style="margin:0; font-size:12px; color:#a0aec0;">Akses API dan penggunaan data secara massal wajib mencantumkan atribusi kepada <strong>Mippedia Community</strong> selaku pengelola proyek.</p></div>'; | '<p style="margin:0; font-size:12px; color:#a0aec0;">Akses API dan penggunaan data secara massal wajib mencantumkan atribusi kepada <strong>Mippedia Community</strong> selaku pengelola proyek.</p></div>'; | ||