[openstreetmap-website] Convert {browse, export}/start.js.erb to static assets (#73)

John Firebaugh notifications at github.com
Sun Aug 26 04:01:19 BST 2012


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).

You can merge this Pull Request by running:

  git pull https://github.com/jfirebaugh/openstreetmap-website static_js

Or you can view, comment on it, or merge it online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/73

-- Commit Summary --

  * Reduce interpolation in export/start.js.erb
  * Extract export.js static asset
  * Reduce interpolation in browse/start.js.erb
  * Extract browse.js static asset
  * Remove unused gem and add a comment where it was replaced
  * Remove unused helper
  * Use a standard application.js bundle

-- File Changes --

M Gemfile (3)
M Gemfile.lock (2)
R app/assets/javascripts/application.js (6)
R app/assets/javascripts/browse.js (98)
R app/assets/javascripts/export.js (34)
A app/assets/javascripts/globals.js.erb (5)
M app/controllers/browse_controller.rb (6)
M app/controllers/export_controller.rb (1)
M app/helpers/application_helper.rb (10)
M app/views/browse/_map.html.erb (3)
M app/views/changeset/_map.html.erb (3)
M app/views/diary_entry/edit.html.erb (3)
M app/views/layouts/_head.html.erb (3)
M app/views/layouts/site.html.erb (2)
M app/views/site/index.html.erb (18)
M app/views/user/_map.html.erb (3)
M config/environments/production.rb (3)
M config/locales/af.yml (2)
M config/locales/aln.yml (2)
M config/locales/ar.yml (2)
M config/locales/arz.yml (2)
M config/locales/ast.yml (2)
M config/locales/be-Tarask.yml (2)
M config/locales/be.yml (2)
M config/locales/br.yml (2)
M config/locales/ca.yml (2)
M config/locales/cs.yml (2)
M config/locales/da.yml (2)
M config/locales/de.yml (2)
M config/locales/dsb.yml (2)
M config/locales/el.yml (2)
M config/locales/en.yml (2)
M config/locales/eo.yml (2)
M config/locales/es.yml (2)
M config/locales/et.yml (2)
M config/locales/fa.yml (2)
M config/locales/fi.yml (2)
M config/locales/fr.yml (2)
M config/locales/gcf.yml (2)
M config/locales/gl.yml (2)
M config/locales/gsw.yml (2)
M config/locales/he.yml (2)
M config/locales/hr.yml (2)
M config/locales/hsb.yml (2)
M config/locales/hu.yml (2)
M config/locales/ia.yml (2)
M config/locales/is.yml (2)
M config/locales/it.yml (2)
M config/locales/ja.yml (2)
M config/locales/ko.yml (2)
M config/locales/lt.yml (2)
M config/locales/lv.yml (2)
M config/locales/mk.yml (2)
M config/locales/ms.yml (2)
M config/locales/nb.yml (2)
M config/locales/nl.yml (2)
M config/locales/nn.yml (2)
M config/locales/pl.yml (2)
M config/locales/pt-BR.yml (2)
M config/locales/pt.yml (2)
M config/locales/ro.yml (2)
M config/locales/ru.yml (2)
M config/locales/sk.yml (2)
M config/locales/sl.yml (2)
M config/locales/sq.yml (2)
M config/locales/sr-Latn.yml (2)
M config/locales/sr.yml (2)
M config/locales/sv.yml (2)
M config/locales/tl.yml (2)
M config/locales/tr.yml (2)
M config/locales/uk.yml (2)
M config/locales/vi.yml (2)
M config/locales/zh-CN.yml (2)
M config/locales/zh-TW.yml (2)
M test/functional/export_controller_test.rb (2)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/73.patch
https://github.com/openstreetmap/openstreetmap-website/pull/73.diff


---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/73
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20120825/7715fb29/attachment.html>


More information about the rails-dev mailing list