diff options
author | Prashant S | 2017-07-25 10:42:30 +0530 |
---|---|---|
committer | GitHub | 2017-07-25 10:42:30 +0530 |
commit | 4fa03dd3ed456a8629b75a4b70c4b8b94f9ba2cc (patch) | |
tree | de1c6fde28d29a784a21dc6e59540361447a4147 /static/website | |
parent | e9e998e8061b8a8a2356a090c486af8c5aa4de6a (diff) | |
parent | 6ce5c567e8a4b4e93c8687f8e0447a28e8f32157 (diff) | |
download | scilab-on-cloud-4fa03dd3ed456a8629b75a4b70c4b8b94f9ba2cc.tar.gz scilab-on-cloud-4fa03dd3ed456a8629b75a4b70c4b8b94f9ba2cc.tar.bz2 scilab-on-cloud-4fa03dd3ed456a8629b75a4b70c4b8b94f9ba2cc.zip |
Merge pull request #4 from divakar1800/master
Optimisation of Scilab code execution merged after discussion with mentor
Diffstat (limited to 'static/website')
-rw-r--r-- | static/website/js/cloud.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/static/website/js/cloud.js b/static/website/js/cloud.js index 33dd209..e0ee41d 100644 --- a/static/website/js/cloud.js +++ b/static/website/js/cloud.js @@ -110,15 +110,24 @@ $(document).ready(function() { }, {example_id: $(this).val()}); }); + /* Execute the code */ $plotbox_wrapper = $("#plotbox-wrapper"); $plotbox = $("#plotbox"); $(document).on("click", "#execute", function() { $("#execute-inner").html("Executing..."); - Dajaxice.website.execute(function(data) { + var send_data = { + token: $("[name='csrfmiddlewaretoken']").val(), + code: editor.getValue(), + book_id: $("#books").val() || 0, + chapter_id: $("#chapters").val() || 0, + example_id: $("#examples").val() || 0 + }; + $.post("/execute-code", send_data, + function(data){ $("#execute-inner").html("Execute"); result.setValue(data.output); - if(data.plot_path) { + if(data.plot_path){ $plot = $("<img>"); $plot.attr({ src: data.plot_path, @@ -127,12 +136,6 @@ $(document).ready(function() { $plotbox.html($plot); $plotbox_wrapper.lightbox_me({centered: true}); } - }, { - token: $("[name='csrfmiddlewaretoken']").val(), - code: editor.getValue(), - book_id: $("#books").val() || 0, - chapter_id: $("#chapters").val() || 0, - example_id: $("#examples").val() || 0 }); }); |