diff --git a/aiserver.py b/aiserver.py index 3d50400b..9d34fe9c 100644 --- a/aiserver.py +++ b/aiserver.py @@ -6200,9 +6200,9 @@ def popup_edit(data): return if session['popup_jailed_dir'] is None: - emit("popup_edit_file", {"file": data, "text": open(data, 'r').read()}); + emit("popup_edit_file", {"file": data, "text": open(data, 'r', encoding='utf-8').read()}); elif session['popup_jailed_dir'] in data: - emit("popup_edit_file", {"file": data, "text": open(data, 'r').read()}); + emit("popup_edit_file", {"file": data, "text": open(data, 'r', encoding='utf-8').read()}); else: print("User is trying to delete files in your server outside the jail. Blocked. Jailed Dir: {} Requested Dir: {}".format(session['popup_jailed_dir'], data)) diff --git a/static/application.js b/static/application.js index 8defc342..2388aa23 100644 --- a/static/application.js +++ b/static/application.js @@ -3434,6 +3434,10 @@ function popup_breadcrumbs(data) { function popup_edit_file(data) { var popup_list = document.getElementById('popup_list'); + var accept = document.getElementById("popup_accept"); + accept.classList.add("btn-secondary"); + accept.classList.remove("btn-primary"); + accept.textContent = "Save"; //first, let's clear out our existing data while (popup_list.firstChild) { popup_list.removeChild(popup_list.firstChild); @@ -3444,6 +3448,7 @@ function popup_edit_file(data) { var textarea = document.getElementById("filecontents"); socket.emit("popup_change_file", {"file": textarea.getAttribute("filename"), "data": textarea.value}); document.getElementById("popup").classList.add("hidden"); + this.classList.add("hidden"); }; var textarea = document.createElement("textarea"); @@ -3454,7 +3459,9 @@ function popup_edit_file(data) { textarea.value = data.text; textarea.onblur = function () { var accept = document.getElementById("popup_accept"); - accept.classList.remove("disabled"); + accept.classList.remove("hidden"); + accept.classList.remove("btn-secondary"); + accept.classList.add("btn-primary"); }; popup_list.append(textarea); diff --git a/templates/index.html b/templates/index.html index 3e099118..2132021c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -340,7 +340,7 @@
Select A Soft Prompt To Use
- +
@@ -354,7 +354,7 @@
Select userscripts to load; drag-and-drop to reorder
- +
[AVAILABLE]