views/geolocate.erb in travlrmap-1.4.0 vs views/geolocate.erb in travlrmap-1.5.0

- old
+ new

@@ -46,10 +46,13 @@ </div> <div class="form-group"> <input type="text" class="form-control" id="point_country" placeholder="Country"> </div> <div class="form-group"> + <input type="text" class="form-control" id="point_gallery" placeholder="Gallery Specification"> + </div> + <div class="form-group"> <button type="submit" class="btn btn-primary">Preview</button> </div> </form> </div> </div> @@ -64,10 +67,12 @@ function getLocationName(results) { var addrComponents = results[0].address_components; for (var i = 0; i < addrComponents.length; i++) { if ($.inArray(addrComponents[i].types[0], ["establishment", "point_of_interest", "postal_town", "locality"])) { + if (!isNaN(addrComponents[i].long_name)) continue; + return addrComponents[i].long_name; } } return results[0].formatted_address; @@ -132,13 +137,21 @@ point.type = document.getElementById('point_type').value point.title = document.getElementById('point_title').value point.comment = document.getElementById('point_comment').value point.country = document.getElementById('point_country').value point.date = document.getElementById('point_date').value - point.href = document.getElementById('point_href').value point.linktext = document.getElementById('point_linktext').value point.linkimg = document.getElementById('point_linkimg').value + + if (point.type != "gallery" && point.type != "track") { + point.href = document.getElementById('point_href').value + } + + if (point.type == "gallery") { + point.gallery = document.getElementById('point_gallery').value + } + point.lon = marker.position.lng(); point.lat = marker.position.lat(); return point; } @@ -171,9 +184,10 @@ $('#point_date').datepicker({ format: 'yyyy-mm-dd', todayHighlight: false, autoclose: true, clearBtn: true, + todayBtn: true }); map = new GMaps({ div: '#main_map', zoom: 3,