changeset 45:8cb5e556960b

Added an optional querystring param, '?issue=<number>', allowing browser to pass in the issue # to view
author Atul Varma <varmaa@toolness.com>
date Sun, 28 Mar 2010 22:37:49 +0000
parents 6a771622dbd1
children 966fef436653
files daily-edition.js
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/daily-edition.js	Sun Mar 28 22:31:48 2010 +0000
+++ b/daily-edition.js	Sun Mar 28 22:37:49 2010 +0000
@@ -1,7 +1,13 @@
 $(window).ready(
   function() {
     var req = new XMLHttpRequest();
-    req.open('GET', 'daily-edition.json');
+    var jsonFile = 'daily-edition.json';
+
+    var matches = location.search.match(/\?issue=([0-9]+)/);
+    if (matches)
+      jsonFile = 'issue-' + parseInt(matches[1]) + '.json';
+
+    req.open('GET', jsonFile);
     req.overrideMimeType('text/plain');
     req.addEventListener(
       "load",