File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 11var pages ;
22
3- var currentPage = - 1 ;
3+ var currentPage = 0 ;
44
55function pageExitCondition ( pageNumber ) {
66 if ( pageNumber >= 0 && pageNumber < pages . length && pages [ pageNumber ] . exitexpr ) {
@@ -37,8 +37,8 @@ function goToTag(tag) {
3737 return ;
3838}
3939
40- function setupLink ( url ) {
41- return function ( e ) { $ ( "#changer" ) . load ( url , function ( data ) { $ ( "#changer" ) . html ( data ) ; } ) ; }
40+ function setupLink ( url , opts ) {
41+ return function ( e ) { $ ( "#changer" ) . load ( url , function ( data ) { $ ( "#changer" ) . html ( data ) ; changerUpdated ( ) } ) ; }
4242}
4343
4444function setupExamples ( controller ) {
@@ -149,6 +149,13 @@ function changerUpdated() {
149149
150150var controller ;
151151
152+ function setCurrentPage ( ) {
153+ return function ( ) {
154+ $ . post ( "/tutorial?page=" + currentPage , function ( data ) {
155+ $ ( "#changer" ) . html ( data ) ;
156+ } ) }
157+ }
158+
152159$ ( document ) . ready ( function ( ) {
153160 $ . getJSON ( "/metadata.json" , function ( data ) { pages = data ; } ) ;
154161
@@ -164,6 +171,7 @@ $(document).ready(function() {
164171
165172 $ ( "#about" ) . click ( setupLink ( "about" ) ) ;
166173 $ ( "#links" ) . click ( setupLink ( "links" ) ) ;
174+ $ ( "#tutorial" ) . click ( setCurrentPage ( ) ) ;
167175 $ ( "#home" ) . click ( setupLink ( "home" ) ) ;
168176
169177 changerUpdated ( ) ;
Original file line number Diff line number Diff line change 11< div id ="tutorial ">
2+ < div class ="page ">
3+ < p > Welcome to Clojure!</ p >
4+ < p > You can see a Clojure interpreter above - we call it a < em > REPL</ em > .</ p >
5+ < p > Type < code > next</ code > in the REPL to begin.</ p >
6+ </ div >
27 < div class ="page " data-tag ="start ">
38 < p >
49 I'll take you on a 5-minutes tour of Clojure, but feel free to experiment on your own along the road!
Original file line number Diff line number Diff line change 6161 [:div#console.console ]
6262 [:div#changer (home-html )]
6363 [:div#buttons
64+ [:a#tutorial.buttons " tutorial" ]
6465 [:a#links.buttons " links" ]
6566 [:a#about.buttons.last " about" ]]]
6667 [:div.footer
You can’t perform that action at this time.
0 commit comments