v1.0.165: app_utils.js + detailed comments (Opus analysis) in classify/grouping/connection
This commit is contained in:
+4
-45
@@ -12,19 +12,8 @@ var fileTable = document.getElementById('fileTable');
|
||||
var fileQueue = [];
|
||||
var contractId = null;
|
||||
var batchId = crypto.randomUUID(); // классификация: привязка всех файлов сессии
|
||||
|
||||
function formatSize(bytes) {
|
||||
if (!bytes || bytes === 0) return '—';
|
||||
if (bytes < 1024) return bytes + ' B';
|
||||
if (bytes < 1048576) return (bytes / 1024).toFixed(1) + ' KB';
|
||||
return (bytes / 1048576).toFixed(1) + ' MB';
|
||||
}
|
||||
|
||||
function formatDate(ts) {
|
||||
if (!ts) return '—';
|
||||
var d = new Date(ts);
|
||||
return d.toLocaleDateString('ru-RU') + ' ' + d.toLocaleTimeString('ru-RU', {hour:'2-digit',minute:'2-digit'});
|
||||
}
|
||||
// Утилиты (formatSize, formatDate, moveUp, moveDown, escHtml, fmtDate) —
|
||||
// вынесены в app_utils.js для облегчения анализа и отладки.
|
||||
|
||||
function renderTable() {
|
||||
if (fileQueue.length === 0) {
|
||||
@@ -44,36 +33,7 @@ function renderTable() {
|
||||
lucide.createIcons();
|
||||
}
|
||||
|
||||
function removeFile(i) {
|
||||
fileQueue.splice(i, 1);
|
||||
if (fileQueue.length === 0) contractId = null;
|
||||
renderTable();
|
||||
}
|
||||
window.removeFile = removeFile;
|
||||
|
||||
function moveUp(i) {
|
||||
if (i <= 0) return;
|
||||
var tmp = fileQueue[i]; fileQueue[i] = fileQueue[i-1]; fileQueue[i-1] = tmp;
|
||||
renderTable();
|
||||
}
|
||||
function moveDown(i) {
|
||||
if (i >= fileQueue.length - 1) return;
|
||||
var tmp = fileQueue[i]; fileQueue[i] = fileQueue[i+1]; fileQueue[i+1] = tmp;
|
||||
renderTable();
|
||||
}
|
||||
window.moveUp = moveUp;
|
||||
window.moveDown = moveDown;
|
||||
|
||||
// ── О сервисе ────────────────────────────────────────────────
|
||||
function openAbout() {
|
||||
document.getElementById('aboutModalOverlay').classList.add('open');
|
||||
}
|
||||
function closeAbout(e) {
|
||||
if (e && e.target !== document.getElementById('aboutModalOverlay')) return;
|
||||
document.getElementById('aboutModalOverlay').classList.remove('open');
|
||||
}
|
||||
window.openAbout = openAbout;
|
||||
window.closeAbout = closeAbout;
|
||||
// moveUp/moveDown/removeFile/openAbout/closeAbout — вынесены в app_utils.js
|
||||
|
||||
// ── Автозагрузка при выборе файлов ──────────────────────────
|
||||
fileInput.addEventListener('change', async function() {
|
||||
@@ -649,8 +609,7 @@ function loadHistory(role) {
|
||||
.catch(function(e) { console.error('loadHistory:', e); });
|
||||
}
|
||||
|
||||
function escHtml(s) { var d = document.createElement('div'); d.textContent = s; return d.innerHTML; }
|
||||
function fmtDate(d) { if (!d) return ''; return d.replace('T', ' ').substring(0, 16); }
|
||||
// escHtml/fmtDate — вынесены в app_utils.js
|
||||
|
||||
function activatePrompt(id) {
|
||||
fetch('/prompt.cfm?action=activate', {
|
||||
|
||||
Reference in New Issue
Block a user