changeset 6:ffe01043ecea

* allow jquery location to become configurable
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 21 Dec 2010 18:07:15 -0800
parents 0c2b1fe8f53f
children c576f5877459
files wordstream/dispatcher.py wordstream/templates/index.html wordstream/templates/navigation.html
diffstat 3 files changed, 4 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/wordstream/dispatcher.py	Sun Feb 14 13:25:01 2010 -0500
+++ b/wordstream/dispatcher.py	Tue Dec 21 18:07:15 2010 -0800
@@ -17,6 +17,7 @@
 
     ### class level variables
     defaults = { 'auto_reload': 'False',
+                 'jquery': 'jquery.js',
                  'template_dirs': '',
                  'seed': '' }
 
@@ -57,12 +58,9 @@
         else:
             handler = exc.HTTPNotFound
 
-        # add navigation links to handler [example]
+        # add data to handler
         if hasattr(handler, 'data'):
-            handler.data.setdefault('links', [])
-            for h in self.handlers:
-                handler.data['links'].append((handler.link(h.handler_path), 
-                                              h.__name__))
+            handler.data['jquery'] = self.jquery
 
         # get response
         res = handler()
--- a/wordstream/templates/index.html	Sun Feb 14 13:25:01 2010 -0500
+++ b/wordstream/templates/index.html	Tue Dec 21 18:07:15 2010 -0800
@@ -6,7 +6,7 @@
       xmlns:xi="http://www.w3.org/2001/XInclude">
 <head>
 <title>wordstream</title>
-<script src="${link('jquery.js')}"></script>
+<script src="${jquery}"></script>
 <script type="text/javascript">
 $(document).ready(function(){
 
--- a/wordstream/templates/navigation.html	Sun Feb 14 13:25:01 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<!DOCTYPE html
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:py="http://genshi.edgewall.org/"
-      xmlns:xi="http://www.w3.org/2001/XInclude"
-      py:strip="True">
-
-  <!-- nav bar -->
-  <div class="site-nav">
-    <ul>
-      <li py:for="link, name in links">
-        <a href="${link}">${name}</a>
-      </li>
-    </ul>
-  </div>
-    
-</html>