1/** 2 * Callback for map initialization, called by the Google Maps API script after 3 * it has been loaded. 4 */ 5function calp_load_map() 6{ 7 var options = { 8 zoom: 14, 9 mapTypeId: google.maps.MapTypeId.ROADMAP 10 }; 11 var map = new google.maps.Map( document.getElementById( 'calp-gmap-canvas' ), options ); 12 var marker = new google.maps.Marker({ map: map }); 13 var geocoder = new google.maps.Geocoder(); 14 15 geocoder.geocode( 16 { 17 'address': document.getElementById( 'calp-gmap-address' ).value, 18 }, 19 function( results, status ) { 20 if( status == google.maps.GeocoderStatus.OK ) { 21 map.setCenter( results[0].geometry.location ); 22 marker.setPosition( results[0].geometry.location ); 23 } 24 } 25 ); 26} 27 28// jQuery-less onready 29var orig_onload = window.onload; 30window.onload = function() 31{ 32 if( typeof( orig_onload ) == 'function' ) 33 orig_onload(); 34 35 // Check if map container exists, and if so, load map into it 36 if( document.getElementById( 'calp-gmap-canvas' ) ) { 37 // Include Google Maps API to display embedded map, triggering callback 38 // when script has loaded. 39 var script = document.createElement( 'script' ); 40 script.type = 'text/javascript'; 41 script.src = 'http://maps.google.com/maps/api/js?sensor=false&callback=calp_load_map&language=' + calp_event.language; 42 document.body.appendChild( script ); 43 } 44} 45 46jQuery( function( $ ) { 47 $( '.calp-gmap-placeholder:first' ).click( function() { 48 var map_el = $( '.calp-gmap-container-hidden:first'); 49 // delete placeholder 50 $( this ).remove(); 51 // hide map 52 map_el.hide(); 53 map_el.removeClass( 'calp-gmap-container-hidden' ); 54 map_el.fadeIn(); 55 }); 56 57 // Calendar widget navigation. 58 $( '#calp-widget-calendar .calp-widget-nav ' ).live( 'click', function(e) { 59 e.preventDefault(); 60 e.stopPropagation(); 61 var offset = $(this).attr('offset'); 62 var instance = $(this).attr('instance'); 63 var query = { 64 'action': 'calp_widget_navigation', 65 'calp_offset': offset, 66 'calp_instance': instance 67 }; 68 69 var $container = $('#'+$(this).closest('.calp-agenda-widget-view').attr('id')); 70 var $loading = $('#'+$(this).closest('.calp-agenda-widget-view').attr('id')+' .calp-widget-loading'); 71 72 $loading.height( $container.height() ); 73 $loading.width( $container.width() ); 74 $loading.fadeIn('slow', function() { 75 $.post( calp_event.ajaxurl, query, function( data ) { 76 $container.html( data.html ); 77 },'json'); 78 }); 79 }); 80});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.