From 293b20963f2bbf0cfca1a146506d65d615b01c2c Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 6 Oct 2012 00:19:12 -0700 Subject: starting to bootstrap the layout: navbar and tricks - changing the tricks-selector to a paginator and fixing the js for highlighting - adding a navbar using bootstrap, probably should use .wrap more instead of adding divs to the code --- js/game.js | 23 ++++++++++++++++++++++- js/layout.js | 3 +++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 js/layout.js (limited to 'js') diff --git a/js/game.js b/js/game.js index 3a1a080..d1d8405 100644 --- a/js/game.js +++ b/js/game.js @@ -5,9 +5,30 @@ var current=0; /* do the higlighting */ function hl(num) { var i; - for(i=0;i<14;i++){ $("#trick"+i).hide(); } + for(i=0;i<14;i++){ $("#trick"+i).hide(); $("#tricks"+i).removeClass('active'); } $("#trick"+num).css('display', 'block'); + $("#tricks"+num).addClass('active'); current=num; + + if(document.getElementById("tricks0")) + min=0; + else + min=1; + + if(document.getElementById("tricks13")) + max=13; + else + min=12; + + if(current==min) + $("#prevtr").addClass('disabled'); + else + $("#prevtr").removeClass('disabled'); + if(current==max) + $("#nexttr").addClass('disabled'); + else + $("#nexttr").removeClass('disabled'); + } /* highlight the last trick, useful when a page is called the first time*/ diff --git a/js/layout.js b/js/layout.js new file mode 100644 index 0000000..b98db8e --- /dev/null +++ b/js/layout.js @@ -0,0 +1,3 @@ +$(".navbar .nav").addClass("pull-right"); +$("table").addClass("table table-striped"); +$("ul.tricks").wrap('