1// ###################################################################### 2// # Locations widget 3// ###################################################################### 4 function locationsWidget() { 5 6 __locationsWidget = this; 7 8 this.container = $('.locations-widget .content'); 9 10 } 11 12 // ###################################################################### 13 // # Reset 14 // ###################################################################### 15 locationsWidget.prototype.reset = function() { 16 17 this.container.empty(); 18 19 } 20 21 // ###################################################################### 22 // # Load locations listing page 23 // ###################################################################### 24 locationsWidget.prototype.loadListingPage = function() { 25 26 // this.container.html( 27 // '<div style="margin: 20px; text-align:center;"><img src="/PTMSCMS/js/locationsWidget/images/loader-bar.gif" width="220" height="19" /></div>' 28 // ); 29 // 30 // $.ajax({ 31 // url:/PTMSCMS/js/locationsWidget/responder/loadListingPage.php', 32 // success: function(response) { 33 // 34 // __locationsWidget.container.html(response); 35 // 36 // // Uncomment when call tracking properly implemented 37 // // __locationsWidget.adjustForCallTracking(); 38 // 39 // __locationsWidget.initGoogleMaps(); 40 // 41 // __locationsWidget.initDirectionsButtons(); 42 // 43 // } 44 // }); 45 46 } 47 48 // ###################################################################### 49 // # Adjust for Call Tracking 50 // ###################################################################### 51 locationsWidget.prototype.adjustForCallTracking = function() { 52 53 var i = 0; 54 55 this.container.find('.info-container li').each( function() { 56 57 if( $(this).html().substring(0, 6) == 'Phone:' ){ 58 59 $(this).html( 'Phone: ' + $(".phone").eq(i).html() ); 60 i++; 61 62 } 63 64 }) 65 } 66 67 68 // ###################################################################### 69 // # Initialize google maps 70 // ###################################################################### 71 locationsWidget.prototype.initGoogleMaps = function() { 72 73 this.container.find('.location').each( 74 75 function() { 76 77 var lat = $(this).find('.latitude').text(); 78 79 var lng = $(this).find('.longitude').text(); 80 81 var options = { 82 zoom: 12, 83 center: new google.maps.LatLng(lat, lng), 84 mapTypeId: google.maps.MapTypeId.ROADMAP, 85 streetViewControl: false, 86 mapTypeControl: false 87 }; 88 89 90/* 91 var map = new google.maps.Map( $(this).find('.map').get(0), options ); 92 93 new google.maps.Marker({ 94 position: options.center, 95 map: map 96 }); 97*/ 98 99 } 100 101 ); 102 103 } 104 105 // ###################################################################### 106 // # Initialize directions buttons 107 // ###################################################################### 108 // locationsWidget.prototype.initDirectionsButtons = function() { 109 // 110 // var directions = $('#directions-container'); 111 // 112 // this.container.find('.location').each( 113 // 114 // function() { 115 // 116 // var location = $(this); 117 // 118 // var lat = $(this).find('.latitude').text(); 119 // 120 // var lng = $(this).find('.longitude').text(); 121 // var dest = $(this).find('.destination-address').text(); 122 // 123 // // Directions button... 124 // $(this).find('.directions').click( 125 // 126 // function() { 127 // 128 // $('#directions-container button:first').click( 129 // 130 // function() { 131 // 132 // __locationsWidget.loadDirectionsTo(dest); 133 // 134 // } 135 // 136 // ); 137 // 138 // // Transform button to "close directions" behavior... 139 // $(this).text('Close Directions').click( 140 // 141 // function() { 142 // 143 // directions.hide('fast', function(){ 144 // 145 // location.hide('fast', function(){ 146 // 147 // // __locationsWidget.reset(); 148 // 149 // __locationsWidget.loadListingPage(); 150 // 151 // }); 152 // 153 // }); 154 // } 155 // 156 // ); 157 // 158 // // If multiple locations, hide the others and show the directions input... 159 // if( location.siblings('.location').length > 0 ) { 160 // 161 // location.siblings('.location').hide('fast', function(){ 162 // 163 // directions.show('medium'); 164 // 165 // }); 166 // 167 // } else { 168 // 169 // directions.show('medium'); 170 // 171 // } 172 // 173 // } 174 // 175 // ); 176 // 177 // } 178 // 179 // ); 180 // 181 // } 182 183 // ###################################################################### 184 // # Load directions to specified lat/lon 185 // ###################################################################### 186 // locationsWidget.prototype.loadDirectionsTo = function(dest) { 187 // 188 // var origin = $('#directions-origin-address').val(); 189 // 190 // var container = $('#directions-results'); 191 // 192 // var service = new google.maps.DirectionsService(); 193 // 194 // var renderer = new google.maps.DirectionsRenderer(); 195 // 196 // var request = { 197 // origin: origin, 198 // destination: dest, 199 // travelMode: google.maps.DirectionsTravelMode.DRIVING 200 // } 201 // 202 // container.empty(); 203 // 204 // $('.print-directions').remove(); 205 // 206 // renderer.setPanel( container.get(0) ); 207 // 208 // service.route(request, function(response, status){ 209 // 210 // if( status == google.maps.DirectionsStatus.OK ) { 211 // 212 // renderer.setDirections(response); 213 // 214 // $('<a class="print-directions orangeButton" href="#">Print These Directions</a>').click( 215 // 216 // function() { 217 // 218 // window.open('http://maps.google.com/maps?q=' + origin + '+to+' + dest); 219 // 220 // } 221 // 222 // ).insertAfter(container); 223 // 224 // } else { 225 // 226 // container.html('<p><em>Directions not available for the specified address.</em></p>'); 227 // 228 // } 229 // 230 // }); 231 // 232 // }
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.