========================================================== Example Dynamic Web Site ========================================================== The CitySpeed distribution includes a sample JavaScript-powered web site to display collected data using Google Maps and in tabular form. You can see an example here: |examplesite| The (X)HTML, JavaScript, and CSS files can be found in the :file:`www/` directory of the source distribution. They expect to find the `.json` data files in a subdirectory :file:`data/` on your web site. If you don't want to generate your own, you can steal some `sample data`_. The web pages don't require any special server-side support; all the action happens client-side in JavaScript. :file:`index.html` The main page shows a color-coded Google Map and tabulates the stats for each city. It gets its data from :file:`data/citystats.json` via AJAX. :file:`city.html` The city detail page; shows a Google Map with the starting and ending points for that city. The city file name is passed as a URL parameter and the corresponding `.json` files are retrieved and displayed via AJAX. Shows a table with the addresses of all starting and ending points. :file:`cityspeed.css` The Cascading Style Sheet that makes the whole thing look pretty. :file:`cityspeed.js` The JavaScript code for :file:`index.html` and :file:`city.html`. Handles retrieving and parsing the JSON data, as well as populating the maps and tables. This code is LAGPLv3 licensed like the Python source. :file:`json2.js` Douglas Crockford's JSON parser from http://json.org/js.html. Incidentally, all the CitySpeed JavaScript code (:file:`cityspeed.js`) is JSLint_ `Good Parts`_-clean; JSLint rocks. This code is in the public domain. :file:`ajaxCaller.js`, :file:`util.js` AjaxCaller_ is an XMLHttpRequest wrapper from `Ajax Design Patterns`_, copyright by `Michael Mahemoff`_. It's been slightly patched to fix a bug and you'll need to use this patched version. This code is `Creative Commons Attribution Noncommercial Share Alike 2.5`_ licensed. :file:`sorttable.js` sorttable_ is Stuart Langridge's lovely dynamic table sorting script. It's X11 licensed. Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` .. |examplesite| replace:: http://infinitemonkeycorps.net/projects/cityspeed/ .. _sample data: http://infinitemonkeycorps.net/projects/cityspeed/data/ .. _JSLint: http://www.jslint.com/ .. _Good Parts: http://www.youtube.com/watch?v=hQVTIJBZook .. _Ajax Design Patterns: http://ajaxpatterns.org/Book .. _Creative Commons Attribution Noncommercial Share Alike 2.5: http://creativecommons.org/licenses/by-nc-sa/2.5/ .. _AjaxCaller: http://ajaxify.com/run/testAjaxCaller/ .. _Michael Mahemoff: http://softwareas.com/ .. _sorttable: http://www.kryogenix.org/code/browser/sorttable/