# HG changeset patch # User Atul Varma # Date 1238510665 25200 # Node ID c029286305e2ee76496f31b44410d33b212048a2 # Parent fa108b6e9fbd1dc00d025f6479d5a2f64a7ee645 Challenge IDs can now be specified in the querystring, and nonexistent ones show a 'does-not-exist' challenge. diff -r fa108b6e9fbd -r c029286305e2 index.html --- a/index.html Tue Mar 31 07:24:47 2009 -0700 +++ b/index.html Tue Mar 31 07:44:25 2009 -0700 @@ -69,7 +69,20 @@ } - +
+
+

Sorry, this challenge doesn't exist yet. Please check back later!

+
+
+

No, really, this isn't a challenge.

+

Well, if you really want more puzzles, check out Galatea.

+
+
+ function(query) { + return false; + } +
+
diff -r fa108b6e9fbd -r c029286305e2 open-web-challenges.js --- a/open-web-challenges.js Tue Mar 31 07:24:47 2009 -0700 +++ b/open-web-challenges.js Tue Mar 31 07:44:25 2009 -0700 @@ -17,6 +17,8 @@ load: function load(id) { var challenge = $('#challenge-' + id); + if (!challenge.length) + challenge = $('#challenge-does-not-exist'); var content = challenge.find('.content').clone(); var current = $('#current-challenge'); current.empty(); @@ -58,8 +60,15 @@ $(window).ready( function() { + var queryIndex = window.location.href.indexOf('?'); + var challengeId; + if (queryIndex == -1) + challengeId = 1; + else + challengeId = window.location.href.slice(queryIndex+1); + function showChallenge() { - OWC.load(1); + OWC.load(challengeId); } if ($('#_firebugConsole').length)