]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Merge branch 'redesign'
[rails.git] / app / assets / javascripts / index.js
index 6f4603923a4d4783168c434c8fc6e80f3deaa447..3ce1a02da3d0a2ada5f01f9d9f79df19e18fea2e 100644 (file)
       dataType: "html",
       complete: function(xhr) {
         clearTimeout(loaderTimeout);
+        $('#flash').empty();
         $('#sidebar_loader').hide();
-        $('#sidebar_content').html(xhr.responseText);
+
+        var content = $(xhr.responseText);
+
         if (xhr.getResponseHeader('X-Page-Title')) {
           document.title = xhr.getResponseHeader('X-Page-Title');
         }
+
+        $('head')
+          .find('link[type="application/atom+xml"]')
+          .remove();
+
+        $('head')
+          .append(content.filter('link[type="application/atom+xml"]'));
+
+        $('#sidebar_content').html(content.not('link[type="application/atom+xml"]'));
+
         if (callback) {
           callback();
         }
@@ -248,13 +261,13 @@ $(document).ready(function () {
     "/":                           OSM.Index(map),
     "/search":                     OSM.Search(map),
     "/export":                     OSM.Export(map),
-    "/new_note":                   OSM.NewNote(map),
+    "/note/new":                   OSM.NewNote(map),
+    "/history/friends":            history,
+    "/history/nearby":             history,
     "/history":                    history,
-    "/user/:display_name/edits":   history,
-    "/browse/friends":             history,
-    "/browse/nearby":              history,
-    "/browse/note/:id":            OSM.Note(map),
-    "/browse/:type/:id(/history)": OSM.Browse(map)
+    "/user/:display_name/history": history,
+    "/note/:id":                  OSM.Note(map),
+    "/:type/:id(/history)":       OSM.Browse(map)
   });
 
   OSM.router.load();