]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/user.js
Use lazy lookups for site translations
[rails.git] / app / assets / javascripts / user.js
index e8ad3324d0ccc2b01e5a4e3b388b39f0d47f6603..bdf0443056329df566e07fbc880dd8ea3153b79c 100644 (file)
@@ -12,14 +12,26 @@ $(document).ready(function () {
     L.OSM.zoom({position: position})
       .addTo(map);
 
-    L.control.locate({
+    var locate = L.control.locate({
       position: position,
+      icon: 'icon geolocate',
+      iconLoading: 'icon geolocate',
       strings: {
         title: I18n.t('javascripts.map.locate.title'),
         popup: I18n.t('javascripts.map.locate.popup')
       }
     }).addTo(map);
 
+    var locateContainer = locate.getContainer();
+
+    $(locateContainer)
+      .removeClass('leaflet-control-locate leaflet-bar')
+      .addClass('control-locate')
+      .children("a")
+      .attr('href', '#')
+      .removeClass('leaflet-bar-part leaflet-bar-part-single')
+      .addClass('control-button');
+
     if (OSM.home) {
       map.setView([OSM.home.lat, OSM.home.lon], 12);
     } else {
@@ -73,6 +85,10 @@ $(document).ready(function () {
 
   $("select#user_auth_provider").on("change", updateAuthUID);
 
+  $("input#user_image").on("change", function () {
+    $("#image_action_new").prop("checked", true);
+  });
+
   function enableAuth() {
     $("#auth_prompt").hide();
     $("#auth_field").show();
@@ -92,4 +108,20 @@ $(document).ready(function () {
   } else {
     enableAuth();
   }
+
+  $("#user_all").change(function () {
+    $("#user_list input[type=checkbox]").prop("checked", $("#user_all").prop("checked"));
+  });
+
+  $("#content.user_confirm").each(function () {
+    $(this).hide();
+    $(this).find("#confirm").submit();
+  });
+
+  $("input[name=legale]").change(function () {
+    var url = $(this).data("url");
+
+    $("#contributorTerms").html("<img src='" + OSM.SEARCHING + "' />");
+    $("#contributorTerms").load(url);
+  });
 });