X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/4453728a7204f1cbf95355d0280d236a7ae6d94e..dad6bca7530f0f7d240dc21d3369cf71edcf41bb:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 706647ef5..5c7b2d26e 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -12,9 +12,9 @@ //= require leaflet.contextmenu //= require index/contextmenu //= require index/search -//= require index/browse +//= require index/layers/data //= require index/export -//= require index/notes +//= require index/layers/notes //= require index/history //= require index/note //= require index/new_note @@ -160,12 +160,12 @@ $(document).ready(function () { OSM.initializeContextMenu(map); if (OSM.STATUS !== "api_offline" && OSM.STATUS !== "database_offline") { - OSM.initializeNotes(map); + OSM.initializeNotesLayer(map); if (params.layers.indexOf(map.noteLayer.options.code) >= 0) { map.addLayer(map.noteLayer); } - OSM.initializeBrowse(map); + OSM.initializeDataLayer(map); if (params.layers.indexOf(map.dataLayer.options.code) >= 0) { map.addLayer(map.dataLayer); } @@ -355,6 +355,16 @@ $(document).ready(function () { return page; }; + OSM.OldBrowse = function () { + var page = {}; + + page.pushstate = page.popstate = function (path) { + OSM.loadSidebarContent(path); + }; + + return page; + }; + var history = OSM.History(map); OSM.router = OSM.Router(map, { @@ -369,8 +379,11 @@ $(document).ready(function () { "/user/:display_name/history": history, "/note/:id": OSM.Note(map), "/node/:id(/history)": OSM.Browse(map, "node"), + "/node/:id/history/:version": OSM.OldBrowse(), "/way/:id(/history)": OSM.Browse(map, "way"), + "/way/:id/history/:version": OSM.OldBrowse(), "/relation/:id(/history)": OSM.Browse(map, "relation"), + "/relation/:id/history/:version": OSM.OldBrowse(), "/changeset/:id": OSM.Changeset(map), "/query": OSM.Query(map) });