Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign #498

Closed
wants to merge 274 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
ad6bbd5
Restore "Where am I?"
jfirebaugh Oct 2, 2013
ad7bc74
Remove unused
jfirebaugh Oct 2, 2013
d3bf414
Don't autofocus search, fade out "Where am I?" on focus
jfirebaugh Oct 2, 2013
2ba4bf3
Add current state to all nav elements
jfirebaugh Oct 2, 2013
5493723
Remove unused
jfirebaugh Oct 2, 2013
af227e5
Content style adjustments
jfirebaugh Oct 2, 2013
2b42fd1
Clean up
jfirebaugh Oct 2, 2013
3ba0360
Don't disable History button
jfirebaugh Oct 2, 2013
2f076d8
Fix "Edit" button when browsing features
jfirebaugh Oct 2, 2013
d414ffc
Simplify geolink-related code
jfirebaugh Oct 2, 2013
7481206
Fix missing translation
jfirebaugh Oct 2, 2013
4557654
Simplify layouting
jfirebaugh Oct 3, 2013
054f934
Eliminate separate browse.css asset
jfirebaugh Oct 3, 2013
85e6bbd
Eliminate edit.js
jfirebaugh Oct 3, 2013
3d0f953
Add layout-based class to body
jfirebaugh Oct 4, 2013
64cb9b0
Organize CSS better
jfirebaugh Oct 4, 2013
a56d103
pushState based navigation between map-based layouts
jfirebaugh Oct 2, 2013
3d4a137
Don't rely on body classes so much
jfirebaugh Oct 4, 2013
60170d7
Fix root link
jfirebaugh Oct 4, 2013
35458c0
Convert search to pushState
jfirebaugh Oct 4, 2013
de97f7b
Consolidate layer initialization
jfirebaugh Oct 4, 2013
a4e38ea
Precompile about.js
jfirebaugh Oct 4, 2013
6157280
Refactor browsed object loading
jfirebaugh Oct 4, 2013
ecbe27b
Render flash in sidebar
jfirebaugh Oct 5, 2013
32645dd
Implement closing sidebar
jfirebaugh Oct 5, 2013
aba79a5
Fix edit page
jfirebaugh Oct 7, 2013
c9dcccd
Don't route clicks on the dropdown menus
jfirebaugh Oct 7, 2013
aa20398
Consolidate search-related JavaScript
jfirebaugh Oct 8, 2013
db675e7
Fix click on search result
jfirebaugh Oct 8, 2013
bcc4897
Restore previous map state on popstate
jfirebaugh Oct 8, 2013
8530e3e
AJAXy changeset history
jfirebaugh Oct 7, 2013
e5ca823
Work towards integrating data overlay and browse pages
jfirebaugh Oct 5, 2013
3bbdb00
Trimming small style
jfirebaugh Jul 31, 2013
4cf32e0
Don't try to route external URLs
jfirebaugh Oct 8, 2013
637799f
Fix export location filter button
jfirebaugh Oct 9, 2013
1cded7d
Rejig changeset details in the style of danstowell
aaronlidman Nov 4, 2013
fc5998d
Simplified common details
aaronlidman Nov 5, 2013
51a21e6
Consistent headers and footers in sidebar
aaronlidman Nov 5, 2013
642e5fd
cleaned up header
Nov 4, 2013
ec61c46
narrower sidebar, transparent minimized state, cleaned up search results
Nov 5, 2013
d10888f
Fix common details
aaronlidman Nov 5, 2013
68967d3
Improve pagination
aaronlidman Nov 5, 2013
e5456e1
Link search results directly to browse pages
jfirebaugh Nov 5, 2013
689eeac
touch up secondary pages and leaflet sidebar content
Nov 5, 2013
0265c17
Undo commenting out code
jfirebaugh Nov 5, 2013
140d289
fix headers in export sidebar
Nov 5, 2013
95e13cf
Merge branch 'redesign' of https://github.com/osmlab/openstreetmap-we…
Nov 5, 2013
caff1b7
Go borderless here too
jfirebaugh Nov 5, 2013
6e85f44
Use appropriate precision for "Where am I?"
jfirebaugh Nov 5, 2013
c0c024d
Improve notes template
aaronlidman Nov 5, 2013
079ad12
Merge branch 'redesign' of github.com:osmlab/openstreetmap-website in…
aaronlidman Nov 5, 2013
c4396ed
Improve changeset list
aaronlidman Nov 5, 2013
5c5f822
base layers sidebar increased readability
Nov 5, 2013
cd0b185
Add close icons
aaronlidman Nov 5, 2013
c5b726c
Missed a couple close buttons
aaronlidman Nov 5, 2013
e98b58e
Fix map controls on user settings page
jfirebaugh Nov 5, 2013
18af846
Restore "Go to Home Location"
jfirebaugh Nov 6, 2013
3177294
Added hover state to close button
aaronlidman Nov 6, 2013
deb59e0
Link to full-world view for user changeset list
jfirebaugh Nov 6, 2013
dab02cb
Iterate on layer control item design
jfirebaugh Nov 6, 2013
d8c1541
Commented out background images from about page
aaronlidman Nov 6, 2013
a0e2eed
Improve changeset template
aaronlidman Nov 6, 2013
52e9871
Change about page background to match help page
aaronlidman Nov 6, 2013
3691da1
Remove all the headers
aaronlidman Nov 6, 2013
7ace2b8
groundwork for responsive menu
Nov 6, 2013
c028fca
Add 'Learn More' and 'Sign Up' buttons
aaronlidman Nov 6, 2013
6b73baa
responsive secondary pages and fixed map
Nov 6, 2013
519fb09
user menu fix
Nov 6, 2013
db0fa00
Hook up 'Learn More' and 'Sign Up' buttons
aaronlidman Nov 6, 2013
0d69751
Fix merge conflict
jfirebaugh Nov 6, 2013
5caaaf8
Remove unused about page code
jfirebaugh Nov 6, 2013
be69462
Float li's to eliminate whitespace between them
jfirebaugh Nov 6, 2013
0c983f1
Consistent changeset color
aaronlidman Nov 6, 2013
9d2c478
Fix feedback loop between L.hash and popstate
jfirebaugh Nov 6, 2013
2920ac8
L.hash expects parseHash to return false if there isn't a location
jfirebaugh Nov 6, 2013
55e0ae1
compact menu fix, changeset highlight styles
Nov 6, 2013
d89d146
Browse page style tweaks
Nov 6, 2013
4522532
Remove unused
jfirebaugh Nov 6, 2013
b20072a
Add donation attribution to mapnik layer
Nov 6, 2013
a7fa87a
Send appropriate Vary header
jfirebaugh Nov 6, 2013
3cfa21d
Fix layers initialization
jfirebaugh Nov 6, 2013
b946fd7
Fix donate link in attribution
Nov 6, 2013
924ef2b
Browse section pagination
Nov 6, 2013
cc79a1e
Split come changset display logic into a helper
aaronlidman Nov 6, 2013
507c0ef
Add conditions to index sidebar
aaronlidman Nov 6, 2013
512ef73
Fix helper indendation width
aaronlidman Nov 6, 2013
396d402
RTL fix for leaflet controls, Ad concept
Nov 6, 2013
d858730
Sidebar close reverts to 'view' state
aaronlidman Nov 7, 2013
562c149
Remove #view_tab
aaronlidman Nov 7, 2013
277adff
Remove references to #view_tab
aaronlidman Nov 7, 2013
817ba45
Improve pagination in changeset details
jfirebaugh Nov 7, 2013
075bf8f
Missed the sidebar on browse page
aaronlidman Nov 7, 2013
bae8f63
Minimize intro sidebar on mobile
Nov 7, 2013
1737f7f
Fix changeset byline style
Nov 7, 2013
789c17a
Hide export button when export area is too large, closes #30
aaronlidman Nov 7, 2013
4563b6d
Fix tag overflow, closes #32
aaronlidman Nov 7, 2013
787bb3a
Consistent changeset bbox color, closes #31
aaronlidman Nov 7, 2013
c32eb34
No border radius here
jfirebaugh Nov 7, 2013
3716694
Remove ad concept
jfirebaugh Nov 7, 2013
1801e80
Move sidebar footer elements elsewhere
jfirebaugh Nov 7, 2013
5bb147e
Left-align intro buttons and update donate icon
Nov 7, 2013
fa3d9cf
Tweak attribution
jfirebaugh Nov 7, 2013
e2ae540
Fix scale control margin
jfirebaugh Nov 7, 2013
422192b
Fixed changeset time inconsistencies
aaronlidman Nov 7, 2013
d3c427b
Return map-ui sidebars in mobile
Nov 7, 2013
b9c985c
Fix mobile menu and reduced sidebar height
Nov 7, 2013
f2c329b
Overlay-style minimized sidebar
jfirebaugh Nov 7, 2013
7f5251d
Simplify
jfirebaugh Nov 8, 2013
42c31aa
Redo mobile styles
jfirebaugh Nov 8, 2013
fef6e88
Fix browse overlay status messages
jfirebaugh Nov 8, 2013
6660682
Float the close icon, closes #40
aaronlidman Nov 8, 2013
a9d7135
Ignore hashchange-triggered popstate events here too
jfirebaugh Nov 8, 2013
61f1a96
Fix order of initialization
jfirebaugh Nov 8, 2013
d55d9ac
Include layers in all geolinks except edit
jfirebaugh Nov 8, 2013
cd88614
Hide welcome message on mobile
jfirebaugh Nov 8, 2013
619b07b
Consistent padding
jfirebaugh Nov 8, 2013
a7d0c3b
Remove text shadow
jfirebaugh Nov 8, 2013
1c006c5
Hide scrollbar
aaronlidman Nov 9, 2013
6ad7225
Update title on pushState, closes #33
aaronlidman Nov 9, 2013
6bc5977
Replace Vary header with explicit xhr=1 param
jfirebaugh Nov 9, 2013
1a667d9
Restructured notes page
aaronlidman Nov 10, 2013
16f5d50
Fix note formatting issues
aaronlidman Nov 11, 2013
c47bbc9
Move search form to header on small screens
jfirebaugh Nov 11, 2013
b29a29f
Fix search
jfirebaugh Nov 11, 2013
ec260db
Add notes sidebar interaction
aaronlidman Nov 11, 2013
9184f31
Merge map.js.erb and leaflet.extend.js.erb
jfirebaugh Nov 11, 2013
004fb95
Refactor to map.updateLayers
jfirebaugh Nov 11, 2013
3acbd41
Use our own hash implementation
jfirebaugh Nov 11, 2013
9ed8664
preserve visual center of map on sidebar transitions
jfirebaugh Nov 9, 2013
98eb424
Fix small screen header on interior pages
jfirebaugh Nov 11, 2013
e59db5a
Remove margin from overlay sidebar
jfirebaugh Nov 11, 2013
9a061a4
Tweak default link color
jfirebaugh Nov 11, 2013
79069da
Add note selection to the sidebar
aaronlidman Nov 12, 2013
d14e635
Add note creation to the sidebar
aaronlidman Nov 12, 2013
1995c48
Add marker halo animation styles
Nov 12, 2013
7112de9
Remove unused
jfirebaugh Nov 12, 2013
8ddf83b
Improve browse design
jfirebaugh Nov 12, 2013
06da933
Moved note description to the sidebar header
aaronlidman Nov 12, 2013
bfac512
Loading indicator for notes
aaronlidman Nov 12, 2013
54789fe
Style browse 404 page and simplify wording, closes #53
aaronlidman Nov 12, 2013
c861a77
Fix translations
jfirebaugh Nov 12, 2013
02c9fce
Style tweaks
jfirebaugh Nov 12, 2013
0a99265
Remove unused translations
jfirebaugh Nov 12, 2013
ff003ea
Rationalize browse translation keys
jfirebaugh Nov 12, 2013
30b02ee
Refactor browse templates
jfirebaugh Nov 12, 2013
4cb9b62
Fix lego translations
jfirebaugh Nov 12, 2013
f1deaa7
Add zoom to note
aaronlidman Nov 12, 2013
83d1ed9
Fix indentation and semicolon usage
jfirebaugh Nov 12, 2013
5d78f2d
Render correct template
jfirebaugh Nov 12, 2013
45ed6cb
Include changeset ID in list
jfirebaugh Nov 12, 2013
57eee1b
Add halo to currently selected note
aaronlidman Nov 13, 2013
ad02717
Fix editing notes outside of view, closes #57
aaronlidman Nov 13, 2013
b355db3
Patch Leaflet bug
jfirebaugh Nov 13, 2013
0840510
Add sidebar loading indicator
jfirebaugh Nov 13, 2013
d44eb1a
Fix inconsistent headers
aaronlidman Nov 13, 2013
0fe92de
Add close button to 404 page
aaronlidman Nov 13, 2013
709f7c5
Zoom in to note if zoom < 15
aaronlidman Nov 13, 2013
c0f2d3c
Prevent empty search
aaronlidman Nov 13, 2013
4c84e65
Revert to named font-weights, closes #58
aaronlidman Nov 13, 2013
21724b8
Add cascade font-weights
aaronlidman Nov 13, 2013
bcdecb8
Show XHR responseText on error
jfirebaugh Nov 13, 2013
38d3fc0
Moved note description out of the sidebar header
aaronlidman Nov 13, 2013
13dab21
Fix minimap labels on IE9
jfirebaugh Nov 13, 2013
d88eca9
Darken grey
jfirebaugh Nov 13, 2013
8a7729a
Don't add note when disabled
jfirebaugh Nov 13, 2013
d741d02
Don't show search in expando header on interior pages
jfirebaugh Nov 13, 2013
3af0200
Remove unused, fix global leak
jfirebaugh Nov 13, 2013
d95ed67
Different feature highlight color for browse pages
aaronlidman Nov 13, 2013
9ea6d08
Change halo color for notes
aaronlidman Nov 13, 2013
0121db7
Remove "Loading..." from browse for now
jfirebaugh Nov 13, 2013
3dde296
Layout tweaks to terms page
jfirebaugh Nov 13, 2013
820ba27
Fix note commenting
jfirebaugh Nov 13, 2013
922fb3f
Fix history sidebar
jfirebaugh Nov 13, 2013
0b348de
Border between history entries
jfirebaugh Nov 13, 2013
38c0a40
Don't set state if it doesn't exist
jfirebaugh Nov 14, 2013
6bb4f5c
Disable overlay layers at minZoom and add tooltips
aaronlidman Nov 14, 2013
f9d18fd
Fix disabled overlay layers translations
aaronlidman Nov 14, 2013
840432b
Fix #map-ui tooltip styling
aaronlidman Nov 14, 2013
928dcbd
Fixed note creation halo to update on dragging
aaronlidman Nov 14, 2013
07e5081
Simplify
jfirebaugh Nov 14, 2013
dead176
Expose more router functions
jfirebaugh Nov 14, 2013
ca643bf
Fixed border consistency
aaronlidman Nov 14, 2013
9fc8bc9
Eliminate HTML5 elements
jfirebaugh Nov 14, 2013
f337243
No hash on browse pages, closes #35
aaronlidman Nov 15, 2013
50e070d
Obey the hash
aaronlidman Nov 15, 2013
ce37383
Revert "Eliminate HTML5 elements"
jfirebaugh Nov 15, 2013
c65ec5c
Use html5shiv for IE8 compatibility
jfirebaugh Nov 15, 2013
05a6669
Use <h1> for the title of site#welcome to match other pages
tomhughes Nov 15, 2013
b78de4b
Make the link from site#help to site#welcome use a relative URL
tomhughes Nov 15, 2013
da67b49
Hide welcome section on help page if not logged in
aaronlidman Nov 15, 2013
4fe6da5
Hide control tooltips on #map-ui expansion, closes #55
aaronlidman Nov 15, 2013
fcf12eb
Adjustments to about page and welcome copy
jfirebaugh Nov 15, 2013
b1a548d
Improved noteLayer and dataLayer availability, closes #65
aaronlidman Nov 15, 2013
a61f327
Revert user page to full width for now
jfirebaugh Nov 15, 2013
f3973b3
Don't render the user menu for users without ids, closed #68
aaronlidman Nov 15, 2013
a95348e
Replace searching.gif with loader from iD
aaronlidman Nov 16, 2013
1539935
Merge branch 'master' into redesign
jfirebaugh Nov 16, 2013
1090e99
Fix welcome page redirect, closed #70
aaronlidman Nov 18, 2013
1ac9563
Adjust header sizing
aaronlidman Nov 18, 2013
0928fa2
Fix new note wrapping
aaronlidman Nov 18, 2013
1b9177d
Improve changeset detail display
aaronlidman Nov 18, 2013
6391be1
Better spaced changeset lists
aaronlidman Nov 19, 2013
5578973
Reorder changeset detail lists
aaronlidman Nov 19, 2013
acf7b12
Increase sidebar width, back to 350px
aaronlidman Nov 19, 2013
70b292e
Wrap bounds of changeset request, closes #72
aaronlidman Nov 19, 2013
370bcd2
Improvements to changeset bbox styling
aaronlidman Nov 19, 2013
12c4e35
Shorten intro text
jfirebaugh Nov 19, 2013
73125b2
Fixed export filter
aaronlidman Nov 19, 2013
a27f2e7
Improved export filter tool
aaronlidman Nov 19, 2013
e701d86
Merge branch 'master' into redesign
jfirebaugh Nov 19, 2013
de3f533
Fix test failures
jfirebaugh Nov 15, 2013
87f9f59
Eliminate loading flash for welcome overlay
jfirebaugh Nov 19, 2013
2718eac
Revert padding; fixes header baseline
jfirebaugh Nov 19, 2013
412967f
Improved export warning, removed heading
aaronlidman Nov 19, 2013
7728ef9
Refine changeset browse behavior
jfirebaugh Nov 19, 2013
c2fda0a
Logout -> Log Out
jfirebaugh Nov 19, 2013
acc4a7e
Sign Up -> Start Mapping
jfirebaugh Nov 19, 2013
59ad2e6
Fixed individual note marker implementation, closes #78
aaronlidman Nov 20, 2013
d424241
Nominatim results zoom to the result location
aaronlidman Nov 20, 2013
2f55b80
Add coordinate detail to node pages
aaronlidman Nov 20, 2013
b205186
Hide note overflow
aaronlidman Nov 20, 2013
122d4f4
Use machine-readable lat/lon format
jfirebaugh Nov 21, 2013
5fcb612
Restore prev/next changeset by user links
jfirebaugh Nov 22, 2013
5248025
Tweak welcome text
jfirebaugh Nov 22, 2013
bd4db07
Compromise on fonts to look better on Windows
jfirebaugh Nov 22, 2013
e9be484
Remove code to fixup authenticity tokens on page load
tomhughes Nov 24, 2013
c99b02d
Make sure all pages using the map layout call require_oauth
tomhughes Nov 24, 2013
2853008
Remove redundant code
tomhughes Nov 24, 2013
dc58139
Drop ejs as we aren't using it anymore
tomhughes Nov 24, 2013
e31d486
Don't wait for a timeout when the browser doesn't support geolocation
tomhughes Nov 24, 2013
37e1fee
Format browse page titles in a consistent way
tomhughes Nov 24, 2013
1f48920
Block max_id for changeset feeds instead of page which is no longer used
tomhughes Nov 24, 2013
c995665
Enable oauth for geocoder#search
tomhughes Nov 24, 2013
5c5b48a
Remove unused partials
tomhughes Nov 25, 2013
4894d29
Fix "in bounds" test in updateData
tomhughes Nov 25, 2013
b9507f7
Remove unneessary return added accidentally
tomhughes Nov 25, 2013
94f38af
Fix border-bottom for browse#note, closes #88
aaronlidman Nov 25, 2013
ffae1da
Sort changesets by id rather than created_at, closes #87
aaronlidman Nov 25, 2013
d5766e5
Revert "Remove redundant code"
tomhughes Nov 25, 2013
38dd5d3
Document/clarify OSM.Router use
jfirebaugh Nov 25, 2013
c5ec20f
Add explanatory comment
jfirebaugh Nov 25, 2013
9581e3c
Add test for redirect routes
tomhughes Nov 25, 2013
e4270a0
There are four methods, not three
tomhughes Nov 25, 2013
0d04cf1
Make main page flash messages visible
jfirebaugh Nov 25, 2013
5255a2d
Fix scroll bar issue on edit pages
jfirebaugh Nov 25, 2013
b9c6da1
Fix accumulation of parameters in edit link
jfirebaugh Nov 25, 2013
d0c84f4
Drop max_id from the changeset feed URL
tomhughes Nov 25, 2013
c645a45
Fix feed link for pushState loaded history page
jfirebaugh Nov 25, 2013
c7046d8
Simplify browse routes and make routes more consistent
tomhughes Nov 28, 2013
413f448
Add tests for new redirects and fix a few bugs in the redirects
tomhughes Nov 28, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ gem 'jsonify-rails'
# Use R2 for RTL conversion
gem 'r2'

# Use ejs for javascript templates
gem 'ejs'

# Load rails plugins
gem 'rails-i18n', "~> 4.0.0"
gem 'dynamic_form'
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ GEM
dalli (2.6.4)
deadlock_retry (1.2.0)
dynamic_form (1.1.4)
ejs (1.1.1)
erubis (2.7.0)
execjs (2.0.2)
faraday (0.8.8)
Expand Down Expand Up @@ -181,7 +180,6 @@ DEPENDENCIES
dalli
deadlock_retry (>= 1.2.0)
dynamic_form
ejs
htmlentities
http_accept_language (~> 2.0.0)
httpclient
Expand Down
8 changes: 4 additions & 4 deletions Vendorfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ folder 'vendor/assets' do
from 'git://github.com/jfirebaugh/leaflet-osm.git' do
file 'leaflet.osm.js', 'leaflet-osm.js'
end

from 'git://github.com/mlevans/leaflet-hash.git' do
file 'leaflet.hash.js', 'leaflet-hash.js'
end
end

folder 'ohauth' do
Expand All @@ -53,4 +49,8 @@ folder 'vendor/assets' do
file 'iD.js', 'dist/iD.js'
end
end

folder 'javascripts' do
file 'html5shiv.js', 'https://raw.github.com/aFarkas/html5shiv/master/src/html5shiv.js'
end
end
Binary file added app/assets/images/about/osm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/about/sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/about/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/menu-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/searching.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 17 additions & 9 deletions app/assets/images/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 31 additions & 46 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@
//= require osm
//= require leaflet
//= require leaflet.osm
//= require leaflet.hash
//= require leaflet.map
//= require leaflet.zoom
//= require leaflet.extend
//= require leaflet.locationfilter
//= require i18n/translations
//= require oauth
//= require piwik
//= require map
//= require sidebar
//= require richtext
//= require geocoder
//= require querystring

var querystring = require('querystring-component');
Expand All @@ -28,13 +24,6 @@ function zoomPrecision(zoom) {
return Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
}

function normalBounds(bounds) {
if (bounds instanceof L.LatLngBounds) return bounds;
return new L.LatLngBounds(
new L.LatLng(bounds[0][0], bounds[0][1]),
new L.LatLng(bounds[1][0], bounds[1][1]));
}

function remoteEditHandler(bbox, select) {
var loaded = false,
query = {
Expand Down Expand Up @@ -69,31 +58,27 @@ function remoteEditHandler(bbox, select) {
* Called as the user scrolls/zooms around to maniplate hrefs of the
* view tab and various other links
*/
function updatelinks(loc, zoom, layers, bounds, object) {
function updatelinks(loc, zoom, layers, object) {
$(".geolink").each(function(index, link) {
var href = link.href.split(/[?#]/)[0],
args = querystring.parse(link.search.substring(1));

if (bounds && $(link).hasClass("bbox")) args.bbox = normalBounds(bounds).toBBoxString();
if (object && $(link).hasClass("object")) args[object.type] = object.id;
editlink = $(link).hasClass("editlink");

var query = querystring.stringify(args);
if (query) href += '?' + query;

if ($(link).hasClass("llz")) {
args = {
lat: loc.lat,
lon: loc.lon || loc.lng,
zoom: zoom
};
if (object && editlink) {
href += '?' + object.type + '=' + object.id;
}

if (layers && $(link).hasClass("layers")) {
args.layers = layers;
}
var args = {
lat: loc.lat,
lon: loc.lon || loc.lng,
zoom: zoom
};

href += OSM.formatHash(args);
if (layers && !editlink) {
args.layers = layers;
}

href += OSM.formatHash(args);

link.href = href;
});

Expand All @@ -105,15 +90,6 @@ function updatelinks(loc, zoom, layers, bounds, object) {
.toggleClass('disabled', editDisabled)
.attr('data-original-title', editDisabled ?
I18n.t('javascripts.site.edit_disabled_tooltip') : '');

var historyDisabled = zoom < 11;
$('#history_tab')
.tooltip({placement: 'bottom'})
.off('click.minzoom')
.on('click.minzoom', function() { return !historyDisabled; })
.toggleClass('disabled', historyDisabled)
.attr('data-original-title', historyDisabled ?
I18n.t('javascripts.site.history_disabled_tooltip') : '');
}

// generate a cookie-safe string of map state
Expand All @@ -135,12 +111,21 @@ function escapeHTML(string) {
});
}

/*
* Forms which have been cached by rails may have the wrong
* authenticity token, so patch up any forms with the correct
* token taken from the page header.
*/
function maximiseMap() {
$("#content").addClass("maximised");
}

function minimiseMap() {
$("#content").removeClass("maximised");
}

$(document).ready(function () {
var auth_token = $("meta[name=csrf-token]").attr("content");
$("form input[name=authenticity_token]").val(auth_token);
$("#menu-icon").on("click", function(e) {
e.preventDefault();
$("header").toggleClass("closed");
});

$("nav.primary li a").on("click", function() {
$("header").toggleClass("closed");
});
});
84 changes: 0 additions & 84 deletions app/assets/javascripts/browse.js

This file was deleted.

73 changes: 0 additions & 73 deletions app/assets/javascripts/changeset.js

This file was deleted.

Loading