language combobox fix 4 (script-editor)
This commit is contained in:
parent
ae424b4341
commit
ea600dfc7a
@ -30,4 +30,28 @@ $( document ).ready(function() {
|
||||
if ($.urlParam("script_id") != "-1") {
|
||||
getActionScript();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function grab_form() {
|
||||
let arr = [];
|
||||
arr["action_body_text"] = editor.getValue();
|
||||
arr["action_desc_text"] = $("#action_desc_text").val();
|
||||
arr["action_name_text"] = $("#action_name_text").val();
|
||||
return arr;
|
||||
}
|
||||
|
||||
function add_entry() {
|
||||
$.ajax({
|
||||
url: "/api/add_entry",
|
||||
type: "POST",
|
||||
data: grab_form()
|
||||
}).done(function() {
|
||||
window.location.href = "/panel?section=actions";
|
||||
});
|
||||
}
|
||||
|
||||
function edit_submit_entry() {
|
||||
$.post("/api/remove_entry", "section=actions&entry_id="+($.urlParam("script_id")), function(data, status) {
|
||||
add_entry();
|
||||
});
|
||||
}
|
@ -57,7 +57,7 @@
|
||||
<label for="action_desc_text" class="col-form-label" th:text="#{inladesc}"></label>
|
||||
<input type="text" class="form-control" id="action_desc_text" name="action_desc_text">
|
||||
</div>
|
||||
<button type="button" id="submit_add" onclick="" class="btn btn-primary mb-3" th:text="#{adddbtn}"></button>
|
||||
<button type="button" id="submit_add" onclick="edit_submit_entry()" class="btn btn-primary mb-3" th:text="#{edditbtn}"></button>
|
||||
<div id="script_editor" style="height: 50vh"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user