Permalink
Browse files

Updated JS to use .load where appropriate. Updated Clojure side to re…

…flect these changes (just changed query to form params.)
  • Loading branch information...
Raynes committed May 25, 2010
1 parent 35ec76f commit ce51c46ba4a002375a1b8a18b374564be4423a42
Showing with 10 additions and 6 deletions.
  1. +8 −4 resources/public/javascript/tryclojure.js
  2. +2 −2 src/tryclojure/core.clj
@@ -1,9 +1,13 @@
function setupLink(url) {
return function(e) { $.get(url, function(data) { $("#changer").html(data); }); }
return function(e) { $("#changer").load(url, function(data) { $("#changer").html(data); }); }
}
function getStep(n) {
$.get("tutorial", { step: n }, function(data) { $("#tuttext").html(data); });
$("#tuttext").load("tutorial", { step: n });
}
function setupExamples() {
$("span").click(function(e) { alert($("this").html()); });
}
$(document).ready(
@@ -33,13 +37,13 @@ $(document).ready(
$("#about").click(setupLink("about"));
$("#links").click(setupLink("links"));
$("#tutorial").click(function(e) {
$.get("tutorial", {step: 0}, function(data) {
$("#changer").html(data);
$("#changer").load("tutorial", {step: 0}, function(data) {
var step = 1;
$("#continue").click(function(e) {
if(step < 6 ) { step += 1; }
getStep(step);
$("#tuttext").scrollTop(0);
//setupExamples();
});
$("#back").click(function(e) {
if(step > 1) { step -= 1; }
View
@@ -134,11 +134,11 @@
:session session
:body links})
(defn tutorial-handler [{querys :query-params session :session}]
(defn tutorial-handler [{formps :form-params session :session :as req}]
{:status 200
:headers {"Content-Type" "text/html"}
:session session
:body (get-tutorial (querys "step"))})
:body (get-tutorial (formps "step"))})
(def clojureroutes
(app

0 comments on commit ce51c46

Please sign in to comment.