Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Quick hack to fix javascript issue impeding new problem submission

  • Loading branch information...
commit 040aca3d34ef86a9b54e1bc6ad7f9b44b586a640 1 parent 3846a84
@dbyrne dbyrne authored
View
7 resources/public/script/foreclojure.js
@@ -81,7 +81,7 @@ function configureCodeBox(){
var hiddenCodeInput = "<input type=\"hidden\" value=\"blank\" name=\"code\" id=\"code\">";
oldBox.replaceWith("<div id=\"code-div\"> <pre id=\"editor\">" + oldBox.val() + "</pre></div>"+hiddenCodeInput);
- if ($("#run-button").length){
+ if ($("#run-button").length || $("#submission-button").length){
var editor = ace.edit("editor");
editor.setTheme("ace/theme/textmate");
@@ -172,6 +172,11 @@ function configureCodeBox(){
var text = editor.getSession().getValue();
$('#code').val(text);
});
+
+ $("#submission-button").click(function(){
+ var text = editor.getSession().getValue();
+ $('#code').val(text);
+ });
}
}
View
2  src/foreclojure/problems.clj
@@ -359,7 +359,7 @@ Return a map, {:message, :url, :num-tests-passed}."
(text-area {:id "code-box" :spellcheck "false"}
:code (session/flash-get :tests))
[:p
- [:button.large {:id "run-button" :type "submit"} "Submit"]]))
+ [:button.large {:id "submission-button" :type "submit"} "Submit"]]))
(defn create-problem
"create a user submitted problem"
Please sign in to comment.
Something went wrong with that request. Please try again.