Fixes for file editor (#170)
Various fixes for the file editor by Ebolam
This commit is contained in:
parent
68110c5930
commit
2b53598307
|
@ -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))
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -340,7 +340,7 @@
|
|||
<div id="sppopup">
|
||||
<div class="popuptitlebar">
|
||||
<div class="popuptitletext">Select A Soft Prompt To Use</div>
|
||||
<button class="btn btn-primary"><span class="oi" style="color: white;" data-glyph="folder" onclick="socket.emit('show_folder_soft_prompt', {});"></span></button>
|
||||
<button class="btn btn-primary" onclick="socket.emit('show_folder_soft_prompt', {});"><span class="oi" style="color: white;" data-glyph="folder"></span></button>
|
||||
</div>
|
||||
<div id="splistcontent">
|
||||
</div>
|
||||
|
@ -354,7 +354,7 @@
|
|||
<div id="uspopup">
|
||||
<div class="popuptitlebar">
|
||||
<div class="popuptitletext">Select userscripts to load; drag-and-drop to reorder</div>
|
||||
<button class="btn btn-primary"><span class="oi" style="color: white;" data-glyph="folder" onclick="socket.emit('show_folder_usersripts', {});"></span></button>
|
||||
<button class="btn btn-primary" onclick="socket.emit('show_folder_usersripts', {});"><span class="oi" style="color: white;" data-glyph="folder"></span></button>
|
||||
</div>
|
||||
<div class="usheadergrid">
|
||||
<div>[AVAILABLE]</div>
|
||||
|
|
Loading…
Reference in New Issue