openstreetmap/openstreetmap-website — pull request #73 by jfirebaugh (2012-08-26 03:01:18+00:00)
Title: Convert {browse,export}/start.js.erb to static assets

This improves caching opportunities, makes it easier to
debug the JavaScript in the browser, and paves the way
for getting it under test coverage using a JS testing
harness.

I used several techniques to eliminate the need to interpolate
into the script via erb:

* Converted localization to the pre-existing client-side i18n
mechanism.
* Introduced a globals.js file that reflects some server-side
global constants to the client.
* Special case #1: ported the html_escape_unicode helper to JS
for generating the HTML embedding code (manually tested).
* Special case #2: ported server-side browser sniffing to JS
for limiting the number of features browsed (not tested -- I
don't have access to a Windows machine).