diff options
author | gebele <gebele@in-silico.ch> | 2015-09-10 15:27:39 +0200 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2015-09-10 15:27:39 +0200 |
commit | 1f3029412ad0a5d94c369b916b23593191b9534f (patch) | |
tree | 446e53c30858e89abbdf68b687a96ee250a24a45 /views/predict.haml | |
parent | bbb7b767ff595227fa69f6e4cda5b0d92f5e439c (diff) |
changed submit button to wait animation instead progress bar
Diffstat (limited to 'views/predict.haml')
-rw-r--r-- | views/predict.haml | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/views/predict.haml b/views/predict.haml index 118c4d4..77f16bc 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -1,11 +1,22 @@ %link{ :href=>"/jsme/jsa.css", :rel=>"stylesheet"} %script{:src=>"/jsme/jsme.nocache.js"} :javascript + function showcircle() { + if (checksmiles() && checkboxes()){ + button = document.getElementById("submit"); + image = document.getElementById("circle"); + button.parentNode.replaceChild(image, button); + $("img.circle").show(); + return true; + }; + return false; + }; function checksmiles () { if (document.form.identifier.value == "") { alert("Please draw or insert a chemical structure."); document.form.identifier.focus(); - $('.progress-bar').hide(); + //$('.progress-bar').hide(); + $("img.circle").hide(); return false; }; return true; @@ -19,6 +30,7 @@ }); if (checked == false){ alert("Please select an endpoint."); + $("img.circle").hide(); return false; }; return true; @@ -39,7 +51,7 @@ // init task for progress // whole site content needs to be in one form. Input and checkboxes are proofed by js functions. -%form{:name => "form", :action => to('/predict'), :method => "post", :enctype => "multipart/form-data", :onsubmit => "return !!(checksmiles() & checkboxes())" } +%form{:name => "form", :action => to('/predict'), :method => "post", :enctype => "multipart/form-data", :onsubmit => "return !!(showcircle())" } %fieldset#top.well %h2 1. Draw a chemical structure :javascript @@ -88,3 +100,4 @@ 3. Predict %div.col-md-10 %input.btn.btn-warning.h2{ :type => "submit", :id => "submit", :value=>">>", :onclick => "getsmiles()"} + %img.h2{:src=>"/images/wait30trans.gif", :id=>"circle", :class=>"circle", :style=>"display:none;"} |