changeset 22:f44ab359f4af

Added an 'on to the next challenge!' button.
author Atul Varma <varmaa@toolness.com>
date Tue, 31 Mar 2009 09:55:56 -0700
parents aaf8f3a74070
children cca5e1d8c555
files index.html open-web-challenges.js
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/index.html	Tue Mar 31 09:44:24 2009 -0700
+++ b/index.html	Tue Mar 31 09:55:56 2009 -0700
@@ -17,6 +17,7 @@
     <div id="msg-no-more-hints">All hints are displayed below.</div>
     <div id="msg-success">You got it!</div>
     <div id="msg-header">Atul’s Open Web Challenge #{id}</div>
+    <div id="msg-next-challenge">On to the next challenge!</div>
   </div>
   <div id="challenge-1" class="challenge">
     <div class="content">
--- a/open-web-challenges.js	Tue Mar 31 09:44:24 2009 -0700
+++ b/open-web-challenges.js	Tue Mar 31 09:55:56 2009 -0700
@@ -46,6 +46,10 @@
         success.hide();
         current.children().addClass('completed');
         current.append(success);
+        var next = $('<a target="_self"></a>');
+        next.attr("href", "?" + (id+1));
+        next.text($('#msg-next-challenge').text());
+        current.append(next);
         success.fadeIn('slow');
         window.clearInterval(intervalId);
       }
@@ -65,7 +69,7 @@
     if (queryIndex == -1)
       challengeId = 1;
     else
-      challengeId = window.location.href.slice(queryIndex+1);
+      challengeId = Number(window.location.href.slice(queryIndex+1));
 
     function showChallenge() {
       OWC.load(challengeId);