From 6794c7c4fb881cebcde3404d35febe12580a1f90 Mon Sep 17 00:00:00 2001 From: alterdekim Date: Sun, 7 Jul 2024 03:47:07 +0300 Subject: [PATCH] script editor js added fix x2 --- src/main/resources/static/javascript/script-editor.js | 10 ++++++---- src/main/resources/templates/script-editor.html | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/resources/static/javascript/script-editor.js b/src/main/resources/static/javascript/script-editor.js index e24583e..152ed85 100644 --- a/src/main/resources/static/javascript/script-editor.js +++ b/src/main/resources/static/javascript/script-editor.js @@ -7,7 +7,7 @@ editor.session.setMode("ace/mode/lua"); const snippets = ["player", "players[index]", "genders[index]", "hobbies[index]", "healths[index]", "luggages[index]", "works[index]"]; -urlParam = function(name){ +$.urlParam = function(name){ var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); if (results==null) { return null; @@ -26,6 +26,8 @@ function getActionScript() { }); } -if ($.urlParam("script_id") != "-1") { - getActionScript(); -} \ No newline at end of file +$( document ).ready(function() { + if ($.urlParam("script_id") != "-1") { + getActionScript(); + } +}); \ No newline at end of file diff --git a/src/main/resources/templates/script-editor.html b/src/main/resources/templates/script-editor.html index 7ce3daf..60775f8 100644 --- a/src/main/resources/templates/script-editor.html +++ b/src/main/resources/templates/script-editor.html @@ -29,10 +29,10 @@ - - -
+ + + \ No newline at end of file