diff --git a/static/js/workflows-core.js b/static/js/workflows-core.js index 410b427..bb0af11 100644 --- a/static/js/workflows-core.js +++ b/static/js/workflows-core.js @@ -349,6 +349,74 @@ class WorkflowsCore { this.hideProcessing(); } + /** + * Copy agent results to clipboard (common agent function) + */ + static copyResults() { + const content = document.getElementById('resultsContent') || document.querySelector('.results-content'); + if (content) { + const text = content.textContent || content.innerText || ''; + this.copyToClipboard(text, 'Results copied to clipboard!'); + } else { + this.showToast('â No results to copy', 'error'); + } + } + + /** + * Download agent results as file (common agent function) + */ + static downloadResults(filename = 'analysis-results.txt') { + const content = document.getElementById('resultsContent') || document.querySelector('.results-content'); + if (content) { + const text = content.textContent || content.innerText || ''; + this.downloadAsFile(text, filename, 'Results downloaded!'); + } else { + this.showToast('â No results to download', 'error'); + } + } + + /** + * Reset agent form and hide results (common agent function) + */ + static resetForm() { + const form = document.getElementById('agentForm'); + if (form) { + form.reset(); + } + + const resultsContainer = document.getElementById('resultsContainer'); + const processingStatus = document.getElementById('processingStatus'); + + if (resultsContainer) resultsContainer.style.display = 'none'; + if (processingStatus) processingStatus.style.display = 'none'; + + // Reset file upload areas + const uploadAreas = document.querySelectorAll('.file-upload-area'); + uploadAreas.forEach(area => { + area.classList.remove('file-selected'); + const uploadText = area.querySelector('.upload-text'); + if (uploadText) { + uploadText.innerHTML = ` +
+