# HG changeset patch # User Atul Varma # Date 1234495956 28800 # Node ID b094768c285bcf259c60fc43132c8345c6cd81e2 # Parent 6c84924cb63a2b465e954b67316bacabdb09bb0e wiki.html now communicates w/ the server instead of the static file. diff -r 6c84924cb63a -r b094768c285b server.py --- 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+)') diff -r 6c84924cb63a -r b094768c285b static-files/wiki.js --- 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);