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 @@ - - -
+ + +