안무 자체도 예쁜데 모카가 진짜 잘 살림 ㅠㅠ
document.body.addEventListener('paste', function (e) { const clipboardData = e.clipboardData || window.clipboardData; const fullHtml = clipboardData.getData('text/html'); let html = fullHtml; const isAppleDevice = /iPhone|iPad|iPod|Macintosh/.test(navigator.userAgent) && !window.MSStream; if (fullHtml && isAppleDevice) { const temp = document.createElement('div'); temp.innerHTML = fullHtml; const body = temp.querySelector('body'); if (body) { html = body.innerHTML; } e.preventDefault(); const cleaned = cleanHtml(html); insertHtmlAtCursor(cleaned); }});function cleanHtml(html) { const temp = document.createElement('div'); temp.innerHTML = html; const removeTags = ['style', 'meta', 'title', 'head', 'html', 'body']; removeTags.forEach(tag => { const elements = temp.querySelectorAll(tag); elements.forEach(el => el.remove()); }); const allElements = temp.querySelectorAll('*'); allElements.forEach(el => { if (el.tagName = 'IMG') { // 기존 style 제거 후 max-width만 설정 el.removeAttribute('style'); el.style.maxWidth = '100%'; } else { // IMG가 아니면 style 제거만 el.removeAttribute('style'); } }); return temp.innerHTML;}function insertHtmlAtCursor(html) { const selection = window.getSelection(); if (!selection.rangeCount) return; const range = selection.getRangeAt(0); range.deleteContents(); const tempDiv = document.createElement('div'); tempDiv.innerHTML = html; const fragment = document.createDocumentFragment(); let node, lastNode; while ((node = tempDiv.firstChild)) { lastNode = fragment.appendChild(node); } range.insertNode(fragment); if (lastNode) { const newRange = document.createRange(); newRange.setStartAfter(lastNode); newRange.collapse(true); selection.removeAllRanges(); selection.addRange(newRange); } const el = document.getElementById('smartInput'); if (el) el.focus();}shortcuts.add("Alt+S",function(){if(parent.parent.#okbtn').css('display')'none')return false;parent.parent.document.getElementById('okbtn').style.display='none';parent.parent.document.getElementById('preview').value='';parent.parent._onSubmit();if(parent.parent.check_submit()) parent.parent.document.getElementById('write').submit();});const observer = new MutationObserver(function(mutationsList) { img').off('dblclick').on('dblclick', function(){ let a = prompt('설정할 가로 길이를 숫자로 입력하세요 (현재:'+$(this).attr('width')+')'); if(a > 0 && !isNaN(a)) { $(this).attr('width', a); $(this).removeAttr('height'); $(this).css({'height': ''}); } });});observer.observe(document.getElementById('smartInput'), { childList: true, subtree: true });