diff --git a/displayFileList.js b/displayFileList.js index 603efa1..0974b68 100644 --- a/displayFileList.js +++ b/displayFileList.js @@ -166,47 +166,41 @@ document.addEventListener("DOMContentLoaded", function () { }); window.editFile = function(fileName) { - console.log("Edit button clicked for:", fileName); - let existingEditor = document.getElementById("editorContainer"); - if (existingEditor) { - existingEditor.remove(); - } - fetch(`uploads/${fileName}?t=${new Date().getTime()}`) - .then(response => { - if (!response.ok) { - throw new Error(`HTTP error! Status: ${response.status}`); - } - return response.text(); - }) - .then(content => { - const editorContainer = document.createElement("div"); - editorContainer.id = "editorContainer"; - editorContainer.style.position = "fixed"; - editorContainer.style.top = "50%"; - editorContainer.style.left = "50%"; - editorContainer.style.transform = "translate(-50%, -50%)"; - editorContainer.style.background = "white"; - editorContainer.style.padding = "15px"; - editorContainer.style.border = "1px solid black"; - editorContainer.style.boxShadow = "0px 4px 6px rgba(0,0,0,0.1)"; - editorContainer.style.zIndex = "1000"; - editorContainer.style.width = "80vw"; - editorContainer.style.maxWidth = "90vw"; - editorContainer.style.minWidth = "400px"; - editorContainer.style.height = "400px"; - editorContainer.style.maxHeight = "80vh"; - editorContainer.style.overflow = "auto"; - editorContainer.style.resize = "both"; - editorContainer.innerHTML = ` -