Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions resources/public/css/tryclojure.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ table.bottom {
padding: .3em 1em;
margin-right: .7em;
font-family: Helvetica, sans-serif;
font-size: 16px;
font-size: 14px;
font-weight: bold;
background: #90b4fe;
border-radius: 5px;
Expand Down Expand Up @@ -128,22 +128,22 @@ table.bottom {

#changer p {
background: transparent;
line-height: 1.3em;
line-height: 1.5em;
font-family: Arial, serif;
font-size: 16px;
font-size: 14px;
color: #555;
}

#changer code {
background-color: #979797;
background-color: #eee;
border: 1px solid #aaa;
color: #555;
font-family: courier, monospace;
padding: 0.1em 0.25em 0.1em 0.25em;
}

#changer code.expr{
background-color: #eee;
background-color: #D8ACDB;
}

div#tuttext {
Expand All @@ -160,11 +160,16 @@ div.footer {
}

pre.codeblock {
background: #f0f0f0;
background: #eee;
border: 1px solid #aaa;
font-size: 14px;
padding: 10px 0;
}

pre.codeblock.expr {
background: #D8ACDB;
}

#changer pre.codeblock code{
background-color: transparent;
border: none;
Expand Down
14 changes: 11 additions & 3 deletions resources/public/javascript/tryclojure.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var pages;

var currentPage = -1;
var currentPage = 0;

function pageExitCondition(pageNumber) {
if (pageNumber >= 0 && pageNumber < pages.length && pages[pageNumber].exitexpr) {
Expand Down Expand Up @@ -37,8 +37,8 @@ function goToTag(tag) {
return;
}

function setupLink(url) {
return function(e) { $("#changer").load(url, function(data) { $("#changer").html(data); }); }
function setupLink(url, opts) {
return function(e) { $("#changer").load(url, function(data) { $("#changer").html(data);changerUpdated() }); }
}

function setupExamples(controller) {
Expand Down Expand Up @@ -149,6 +149,13 @@ function changerUpdated() {

var controller;

function setCurrentPage(){
return function(){
$.post("/tutorial?page="+currentPage, function(data){
$("#changer").html(data);
})}
}

$(document).ready(function() {
$.getJSON("/metadata.json", function (data) { pages = data; } );

Expand All @@ -164,6 +171,7 @@ $(document).ready(function() {

$("#about").click(setupLink("about"));
$("#links").click(setupLink("links"));
$("#tutorial").click( setCurrentPage() );
$("#home").click(setupLink("home"));

changerUpdated();
Expand Down
Loading