Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Font bigger and Non-Javascript fallback

  • Loading branch information...
commit 31c1eab4998faa44f4ed36c2a218b33eb6f60080 1 parent f6f0d1f
@gigasquid gigasquid authored
View
9 resources/public/script/foreclojure.js
@@ -31,13 +31,20 @@ function configureDataTables(){
}
function configureCodeBox(){
+ //For no javascript version we have the code-box text area
+ //If we have javascript on then we remove it and replace it with
+ //the proper div
+ $('#code-box').replaceWith("<div id=\"code-div\"> <pre id=\"editor\"></pre></div>");
+ var hiddenCodeInput = "<input type=\"hidden\" value=\"blank\" name=\"code\" id=\"code\">";
+ $(hiddenCodeInput).insertBefore('#id');
+
if ($("#run-button").length){
var editor = ace.edit("editor");
editor.setTheme("ace/theme/textmate");
var ClojureMode = require("ace/mode/clojure").Mode;
editor.getSession().setMode(new ClojureMode());
- document.getElementById('editor').style.fontSize='14px';
+ document.getElementById('editor').style.fontSize='13px';
$("#run-button").click(function(){
var text = editor.getSession().getValue();
$('#code').val(text);
View
6 src/foreclojure/problems.clj
@@ -111,9 +111,9 @@
[:b "Code which fills in the blank:" [:br]
[:span {:class "error"} (session/flash-get :error)]]]
(form-to [:post "/run-code"]
- [:div#code-div
- [:pre#editor ]]
- (hidden-field :code "blank")
+ (text-area {:id "code-box"
+ :spellcheck "false"}
+ :code (session/flash-get :code))
(hidden-field :id id)
[:br]
[:button.large {:id "run-button" :type "submit"} "Run"])]))
Please sign in to comment.
Something went wrong with that request. Please try again.