GoogleMapsTemplate.html

 1   <input type="hidden" id="${entry.idEntry}_map_provider" name="${entry.idEntry}_map_provider" value="${entry.mapProvider.key}"/>
 2   <div class="form-element" id="${entry.idEntry}_waiting" style="display:none;">
 3    	#i18n{module.genericattributes.googlemaps.loading}
 4   </div>
 5   <div id="${entry.idEntry}_gmap" class="google-maps"></div>
 6   <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true"></script>
 7   <script type="text/javascript" src="js/plugins/genericattributes/modules/googlemaps/genericattributes_gmap.js"></script>
 8   <script type="text/javascript">
 9   		$(document).ready( function (  ) 
 10   		{
 11   			var idEntry = <#if entry.idEntry?has_content>${entry.idEntry}<#else>0</#if>;
 12   		
 13   			<#-- add onChange to set coordinates to ZERO -->
 14   			$("#${entry.idEntry}_address").change( function()
 15   				{
 16   					// set x and y to 0
 17   					document.getElementById(idEntry + "_x").value = 0;
 18   					document.getElementById(idEntry + "_y").value = 0;
 19   				}
 20   			);
 21   		
 22   			$( '#${entry.idEntry}_address' ).keypress( function(event) {
 23   				if (event.keyCode == '13') { // Enter button
 24   				     event.preventDefault(  );
 25   				     $('#${entry.idEntry}_gmap_button').click();
 26   				}
 27   			});
 28   			
 29   			var x = 0;
 30   			var y = 0;
 31   			gmap_genericattributes( x, y, idEntry, "#i18n{module.genericattributes.googlemaps.button_address}" );
 32   		});
 33   </script>
 34   <noscript>#i18n{module.genericattributes.googlemaps.javascript.disabled}</noscript>