changeset 24:b094768c285b

wiki.html now communicates w/ the server instead of the static file.
author Atul Varma <varmaa@toolness.com>
date Thu, 12 Feb 2009 19:32:36 -0800
parents 6c84924cb63a
children 0aecc756ea18
files server.py static-files/wiki.js
diffstat 2 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/server.py	Thu Feb 12 19:25:23 2009 -0800
+++ b/server.py	Thu Feb 12 19:32:36 2009 -0800
@@ -5,8 +5,7 @@
 status = dict(max_changeset = 0)
 changesets = {
     0: dict(date='Thu Feb 12 2009 19:03:56 GMT-0800 (PST)',
-            content=('Edit me by holding shift while clicking '
-                     'on me.'))
+            content=open('static-files/wiki.txt', 'r').read())
     }
 
 CID_PATH = re.compile(r'/(\d+)')
--- a/static-files/wiki.js	Thu Feb 12 19:25:23 2009 -0800
+++ b/static-files/wiki.js	Thu Feb 12 19:32:36 2009 -0800
@@ -192,13 +192,18 @@
      linkFormat: ''
     });
 
-  jQuery.get("wiki.txt",
-             {},
-             function(text) {
-               $("#content").append(App.createParts(text));
-               App.saveChanges(false);
-             },
-             "text");
+  function onStatus(status) {
+    jQuery.get("/" + status.max_changeset,
+               {},
+               function(obj) {
+                 var text = obj.content;
+                 $("#content").append(App.createParts(text));
+                 App.saveChanges(false);
+               },
+               "json");
+  }
+
+  jQuery.get('/status', {}, onStatus, "json");
 };
 
 $(window).ready(App.eventHandlers.onLoad);