Spaces:
Sleeping
Sleeping
Update index.html
Browse files- index.html +0 -90
index.html
CHANGED
|
@@ -393,7 +393,6 @@ textarea::placeholder{color:var(--text-muted);font-size:13px;}
|
|
| 393 |
<div class="nav-item" data-tab="highlight" onclick="switchTab('highlight')"><span class="nav-icon">π¨</span><span>νμ΄λΌμ΄νΈ</span></div>
|
| 394 |
<div class="nav-item" data-tab="humanize" onclick="switchTab('humanize')"><span class="nav-icon">βοΈ</span><span>AIβμΈκ°</span></div>
|
| 395 |
<div class="nav-item" data-tab="plagiarism" onclick="switchTab('plagiarism')"><span class="nav-icon">π</span><span>νμ </span></div>
|
| 396 |
-
<div class="nav-item" data-tab="document" onclick="switchTab('document')"><span class="nav-icon">π</span><span>λ¬Έμ</span></div>
|
| 397 |
</nav>
|
| 398 |
|
| 399 |
<!-- Panel 1 -->
|
|
@@ -487,34 +486,6 @@ textarea::placeholder{color:var(--text-muted);font-size:13px;}
|
|
| 487 |
</div>
|
| 488 |
</div>
|
| 489 |
|
| 490 |
-
<!-- Panel 5: Document Analysis -->
|
| 491 |
-
<div class="panel" id="panel-document">
|
| 492 |
-
<div class="card">
|
| 493 |
-
<div class="card-header"><div class="card-icon" style="background:rgba(84,181,255,0.12);border:1px solid rgba(84,181,255,0.2);">π</div><div class="card-title">λ¬Έμ AI λΆμ</div></div>
|
| 494 |
-
<div class="card-desc">PDF Β· DOCX Β· HWP Β· HWPX Β· TXT λ¬Έμλ₯Ό μ
λ‘λνλ©΄ μΉμ
λ³ AI νμ§ ννΈλ§΅ λ³΄κ³ μλ₯Ό μμ±ν©λλ€.</div>
|
| 495 |
-
<div class="file-drop" id="file-drop" onclick="document.getElementById('file-input').click()">
|
| 496 |
-
<input type="file" id="file-input" accept=".pdf,.docx,.hwp,.hwpx,.txt,.md,.csv" onchange="handleFile(this)">
|
| 497 |
-
<div class="file-drop-icon">π</div>
|
| 498 |
-
<div class="file-drop-text">ν΄λ¦νκ±°λ νμΌμ λλκ·ΈνμΈμ</div>
|
| 499 |
-
<div class="file-drop-hint">PDF Β· DOCX Β· HWP Β· HWPX Β· TXT Β· MD Β· CSV</div>
|
| 500 |
-
</div>
|
| 501 |
-
<div class="file-info" id="file-info">
|
| 502 |
-
<span>π</span>
|
| 503 |
-
<span class="file-info-name" id="file-name"></span>
|
| 504 |
-
<span class="file-info-size" id="file-size"></span>
|
| 505 |
-
<span class="file-remove" onclick="clearFile()">β</span>
|
| 506 |
-
</div>
|
| 507 |
-
<div style="margin-top:14px;">
|
| 508 |
-
<button class="btn btn-primary" id="btn-document" onclick="runDocument()">π λ¬Έμ AI λΆμ</button>
|
| 509 |
-
</div>
|
| 510 |
-
</div>
|
| 511 |
-
<div class="loader" id="loader-document"><div class="loader-ring"></div><div class="loader-text">λ¬Έμ μΆμΆ + μΉμ
λ³ λΆμ μ€</div><div class="loader-dots"><span></span><span></span><span></span></div></div>
|
| 512 |
-
<div id="result-document-area" style="display:none;">
|
| 513 |
-
<div class="result-html" id="result-document"></div>
|
| 514 |
-
<div class="log-box" id="result-document-log"></div>
|
| 515 |
-
</div>
|
| 516 |
-
</div>
|
| 517 |
-
|
| 518 |
<footer class="footer">
|
| 519 |
<div class="footer-brand">TeXray</div>
|
| 520 |
<div class="footer-line"></div>
|
|
@@ -729,67 +700,6 @@ function clearInline(textareaId, statusId){
|
|
| 729 |
document.getElementById(statusId).classList.remove('active');
|
| 730 |
document.getElementById(statusId).querySelector('.fname').style.color='';
|
| 731 |
}
|
| 732 |
-
|
| 733 |
-
/* βββ ν5: λ¬Έμ λΆμ μ μ© βββ */
|
| 734 |
-
let selectedFile=null;
|
| 735 |
-
function handleFile(input){
|
| 736 |
-
if(!input.files||!input.files[0])return;
|
| 737 |
-
selectedFile=input.files[0];
|
| 738 |
-
const fi=document.getElementById('file-info');
|
| 739 |
-
document.getElementById('file-name').textContent=selectedFile.name;
|
| 740 |
-
document.getElementById('file-size').textContent=Math.round(selectedFile.size/1024)+'KB';
|
| 741 |
-
fi.classList.add('active');
|
| 742 |
-
document.getElementById('file-drop').style.display='none';
|
| 743 |
-
}
|
| 744 |
-
function clearFile(){
|
| 745 |
-
selectedFile=null;
|
| 746 |
-
document.getElementById('file-info').classList.remove('active');
|
| 747 |
-
document.getElementById('file-drop').style.display='';
|
| 748 |
-
document.getElementById('file-input').value='';
|
| 749 |
-
}
|
| 750 |
-
|
| 751 |
-
/* Drag & drop for tab 5 */
|
| 752 |
-
const fdrop=document.getElementById('file-drop');
|
| 753 |
-
if(fdrop){
|
| 754 |
-
fdrop.addEventListener('dragover',e=>{e.preventDefault();fdrop.classList.add('dragover');});
|
| 755 |
-
fdrop.addEventListener('dragleave',()=>fdrop.classList.remove('dragover'));
|
| 756 |
-
fdrop.addEventListener('drop',e=>{
|
| 757 |
-
e.preventDefault();fdrop.classList.remove('dragover');
|
| 758 |
-
if(e.dataTransfer.files[0]){
|
| 759 |
-
const dt=new DataTransfer();dt.items.add(e.dataTransfer.files[0]);
|
| 760 |
-
document.getElementById('file-input').files=dt.files;
|
| 761 |
-
handleFile(document.getElementById('file-input'));
|
| 762 |
-
}
|
| 763 |
-
});
|
| 764 |
-
}
|
| 765 |
-
|
| 766 |
-
async function runDocument(){
|
| 767 |
-
if(!selectedFile){alert('νμΌμ λ¨Όμ μ
λ‘λνμΈμ.');return;}
|
| 768 |
-
const btn=document.getElementById('btn-document');btn.disabled=true;
|
| 769 |
-
document.getElementById('result-document-area').style.display='none';
|
| 770 |
-
sw('loader-document');
|
| 771 |
-
try{
|
| 772 |
-
/* 1. Upload */
|
| 773 |
-
const uploadedPath=await uploadFileToGradio(selectedFile);
|
| 774 |
-
/* 2. Call run_document API (Gradio 6.x FileData νμ) */
|
| 775 |
-
const fileData=makeFileData(uploadedPath, selectedFile.name);
|
| 776 |
-
const d=await gc('/run_document',[fileData]);
|
| 777 |
-
hw('loader-document');
|
| 778 |
-
document.getElementById('result-document-area').style.display='block';
|
| 779 |
-
document.getElementById('result-document').innerHTML=d[0]||'';
|
| 780 |
-
document.getElementById('result-document-log').textContent=d[1]||'';
|
| 781 |
-
/* 3. Report download (d[2] = file path) */
|
| 782 |
-
if(d[2]){
|
| 783 |
-
const dlArea=document.getElementById('result-document-log');
|
| 784 |
-
dlArea.textContent+= '\n\nπ₯ λ³΄κ³ μ: λ³΄κ³ μλ Gradio UI(/gradio)μμ λ€μ΄λ‘λ κ°λ₯ν©λλ€.';
|
| 785 |
-
}
|
| 786 |
-
}catch(e){
|
| 787 |
-
hw('loader-document');
|
| 788 |
-
document.getElementById('result-document-area').style.display='block';
|
| 789 |
-
showError(document.getElementById('result-document'),e.message);
|
| 790 |
-
}
|
| 791 |
-
btn.disabled=false;
|
| 792 |
-
}
|
| 793 |
/* βββ textarea λλκ·Έμ€λλ‘ νμΌ (ν1~4) βββ */
|
| 794 |
const dropMappings=[
|
| 795 |
{ta:'input-detect',fs:'fs-detect'},
|
|
|
|
| 393 |
<div class="nav-item" data-tab="highlight" onclick="switchTab('highlight')"><span class="nav-icon">π¨</span><span>νμ΄λΌμ΄νΈ</span></div>
|
| 394 |
<div class="nav-item" data-tab="humanize" onclick="switchTab('humanize')"><span class="nav-icon">βοΈ</span><span>AIβμΈκ°</span></div>
|
| 395 |
<div class="nav-item" data-tab="plagiarism" onclick="switchTab('plagiarism')"><span class="nav-icon">π</span><span>νμ </span></div>
|
|
|
|
| 396 |
</nav>
|
| 397 |
|
| 398 |
<!-- Panel 1 -->
|
|
|
|
| 486 |
</div>
|
| 487 |
</div>
|
| 488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 489 |
<footer class="footer">
|
| 490 |
<div class="footer-brand">TeXray</div>
|
| 491 |
<div class="footer-line"></div>
|
|
|
|
| 700 |
document.getElementById(statusId).classList.remove('active');
|
| 701 |
document.getElementById(statusId).querySelector('.fname').style.color='';
|
| 702 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 703 |
/* βββ textarea λλκ·Έμ€λλ‘ νμΌ (ν1~4) βββ */
|
| 704 |
const dropMappings=[
|
| 705 |
{ta:'input-detect',fs:'fs-detect'},
|