Version Description
Download this release
Release Info
Developer | tijmensmit |
Plugin | WP Store Locator |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.1.2
- frontend/class-frontend.php +38 -14
- frontend/underscore-functions.php +18 -3
- js/wpsl-gmap.js +2 -2
- js/wpsl-gmap.min.js +1 -1
- readme.txt +7 -1
- wp-store-locator.php +2 -2
frontend/class-frontend.php
CHANGED
@@ -280,7 +280,7 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
|
|
280 |
|
281 |
$all_stores = array();
|
282 |
$include_post_content = apply_filters( 'wpsl_include_post_content', false );
|
283 |
-
|
284 |
// Get the list of store fields that we need to filter out of the post meta data.
|
285 |
$meta_field_map = $this->frontend_meta_fields();
|
286 |
|
@@ -301,8 +301,8 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
|
|
301 |
foreach ( $meta_field_map as $meta_key => $meta_value ) {
|
302 |
|
303 |
if ( isset( $custom_fields[$meta_key][0] ) ) {
|
304 |
-
if ( ( isset( $meta_value['type'] ) ) && ( !empty( $meta_value['type'] ) ) ) {
|
305 |
-
$meta_type = $meta_value['type'];
|
306 |
} else {
|
307 |
$meta_type = '';
|
308 |
}
|
@@ -873,9 +873,9 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
|
|
873 |
* @return string $output The html for the map
|
874 |
*/
|
875 |
public function show_store_map( $atts ) {
|
876 |
-
|
877 |
global $wpsl_settings, $post;
|
878 |
-
|
879 |
$atts = shortcode_atts( apply_filters( 'wpsl_map_shortcode_defaults', array(
|
880 |
'id' => '',
|
881 |
'category' => '',
|
@@ -888,7 +888,7 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
|
|
888 |
'street_view' => $wpsl_settings['streetview'],
|
889 |
'scrollwheel' => $wpsl_settings['scrollwheel'],
|
890 |
'control_position' => $wpsl_settings['control_position']
|
891 |
-
) ), $atts );
|
892 |
|
893 |
array_push( $this->load_scripts, 'wpsl_base' );
|
894 |
|
@@ -922,9 +922,16 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
|
|
922 |
$store_ids = array_map( 'absint', explode( ',', $atts['id'] ) );
|
923 |
$id_count = count( $store_ids );
|
924 |
}
|
925 |
-
|
926 |
-
|
927 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
928 |
$incl_url = true;
|
929 |
} else {
|
930 |
$incl_url = false;
|
@@ -1265,9 +1272,9 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
|
|
1265 |
$category .= '<label for="wpsl-category-list">' . esc_html( $wpsl->i18n->get_translation( 'category_label', __( 'Category', 'wpsl' ) ) ) . '</label>' . "\r\n";
|
1266 |
$category .= '<select autocomplete="off" name="wpsl-category" id="wpsl-category-list" class="wpsl-dropdown">';
|
1267 |
$category .= '<option value="0">'. __( 'Any' , 'wpsl' ) .'</option>';
|
1268 |
-
|
1269 |
foreach ( $terms as $term ) {
|
1270 |
-
$category .= '<option value="' . $term->term_id . '" '.
|
1271 |
}
|
1272 |
|
1273 |
$category .= '</select>';
|
@@ -1277,6 +1284,23 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
|
|
1277 |
}
|
1278 |
}
|
1279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1280 |
/**
|
1281 |
* Create a filename with @2x in it for the selected marker color.
|
1282 |
*
|
@@ -1474,7 +1498,8 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
|
|
1474 |
'url' => WPSL_URL,
|
1475 |
'markerIconProps' => $this->get_marker_props(),
|
1476 |
'draggable' => $this->maybe_draggable(),
|
1477 |
-
'storeUrl' => $wpsl_settings['store_url']
|
|
|
1478 |
);
|
1479 |
|
1480 |
$locator_map_settings = array(
|
@@ -1498,8 +1523,7 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
|
|
1498 |
'distanceUnit' => $wpsl_settings['distance_unit'],
|
1499 |
'geoLocationTimout' => apply_filters( 'wpsl_geolocation_timeout', 5000 ),
|
1500 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
1501 |
-
'mapControls' => $this->get_map_controls()
|
1502 |
-
'mapTabAnchor' => apply_filters( 'wpsl_map_tab_anchor', 'wpsl-map-tab' )
|
1503 |
);
|
1504 |
|
1505 |
/*
|
280 |
|
281 |
$all_stores = array();
|
282 |
$include_post_content = apply_filters( 'wpsl_include_post_content', false );
|
283 |
+
|
284 |
// Get the list of store fields that we need to filter out of the post meta data.
|
285 |
$meta_field_map = $this->frontend_meta_fields();
|
286 |
|
301 |
foreach ( $meta_field_map as $meta_key => $meta_value ) {
|
302 |
|
303 |
if ( isset( $custom_fields[$meta_key][0] ) ) {
|
304 |
+
if ( ( isset( $meta_value['type'] ) ) && ( !empty( $meta_value['type'] ) ) ) {
|
305 |
+
$meta_type = $meta_value['type'];
|
306 |
} else {
|
307 |
$meta_type = '';
|
308 |
}
|
873 |
* @return string $output The html for the map
|
874 |
*/
|
875 |
public function show_store_map( $atts ) {
|
876 |
+
|
877 |
global $wpsl_settings, $post;
|
878 |
+
|
879 |
$atts = shortcode_atts( apply_filters( 'wpsl_map_shortcode_defaults', array(
|
880 |
'id' => '',
|
881 |
'category' => '',
|
888 |
'street_view' => $wpsl_settings['streetview'],
|
889 |
'scrollwheel' => $wpsl_settings['scrollwheel'],
|
890 |
'control_position' => $wpsl_settings['control_position']
|
891 |
+
) ), $atts );
|
892 |
|
893 |
array_push( $this->load_scripts, 'wpsl_base' );
|
894 |
|
922 |
$store_ids = array_map( 'absint', explode( ',', $atts['id'] ) );
|
923 |
$id_count = count( $store_ids );
|
924 |
}
|
925 |
+
|
926 |
+
/*
|
927 |
+
* The location url is included if:
|
928 |
+
*
|
929 |
+
* - Multiple ids are set.
|
930 |
+
* - The category attr is set.
|
931 |
+
* - The shortcode is used on a post type other then 'wpsl_stores'. No point in showing a location
|
932 |
+
* url to the user that links back to the page they are already on.
|
933 |
+
*/
|
934 |
+
if ( $atts['category'] || isset( $id_count ) && $id_count > 1 || get_post_type() != 'wpsl_stores' && !empty( $atts['id'] ) ) {
|
935 |
$incl_url = true;
|
936 |
} else {
|
937 |
$incl_url = false;
|
1272 |
$category .= '<label for="wpsl-category-list">' . esc_html( $wpsl->i18n->get_translation( 'category_label', __( 'Category', 'wpsl' ) ) ) . '</label>' . "\r\n";
|
1273 |
$category .= '<select autocomplete="off" name="wpsl-category" id="wpsl-category-list" class="wpsl-dropdown">';
|
1274 |
$category .= '<option value="0">'. __( 'Any' , 'wpsl' ) .'</option>';
|
1275 |
+
|
1276 |
foreach ( $terms as $term ) {
|
1277 |
+
$category .= '<option value="' . $term->term_id . '" '. $this->set_selected_category( $term->term_id ) .'>' . $term->name . '</option>';
|
1278 |
}
|
1279 |
|
1280 |
$category .= '</select>';
|
1284 |
}
|
1285 |
}
|
1286 |
|
1287 |
+
/**
|
1288 |
+
* Set the selected category item.
|
1289 |
+
*
|
1290 |
+
* @since 2.1.2
|
1291 |
+
* @todo add support to make it check a query string for set cat
|
1292 |
+
* @param integer The term id.
|
1293 |
+
* @return string|void $category The 'selected' attribute or nothing.
|
1294 |
+
*/
|
1295 |
+
public function set_selected_category( $term_id ) {
|
1296 |
+
|
1297 |
+
$selected = apply_filters( 'wpsl_selected_category', $term_id );
|
1298 |
+
|
1299 |
+
if ( $selected ) {
|
1300 |
+
return $selected;
|
1301 |
+
}
|
1302 |
+
}
|
1303 |
+
|
1304 |
/**
|
1305 |
* Create a filename with @2x in it for the selected marker color.
|
1306 |
*
|
1498 |
'url' => WPSL_URL,
|
1499 |
'markerIconProps' => $this->get_marker_props(),
|
1500 |
'draggable' => $this->maybe_draggable(),
|
1501 |
+
'storeUrl' => $wpsl_settings['store_url'],
|
1502 |
+
'mapTabAnchor' => apply_filters( 'wpsl_map_tab_anchor', 'wpsl-map-tab' )
|
1503 |
);
|
1504 |
|
1505 |
$locator_map_settings = array(
|
1523 |
'distanceUnit' => $wpsl_settings['distance_unit'],
|
1524 |
'geoLocationTimout' => apply_filters( 'wpsl_geolocation_timeout', 5000 ),
|
1525 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
1526 |
+
'mapControls' => $this->get_map_controls()
|
|
|
1527 |
);
|
1528 |
|
1529 |
/*
|
frontend/underscore-functions.php
CHANGED
@@ -75,7 +75,7 @@ function wpsl_create_underscore_templates( $template ) {
|
|
75 |
<?php
|
76 |
$cpt_info_window_template = '<div class="wpsl-info-window">' . "\r\n";
|
77 |
$cpt_info_window_template .= "\t\t" . '<p class="wpsl-no-margin">' . "\r\n";
|
78 |
-
$cpt_info_window_template .= "\t\t\t" . wpsl_store_header_template() . "\r\n";
|
79 |
$cpt_info_window_template .= "\t\t\t" . '<span><%= address %></span>' . "\r\n";
|
80 |
$cpt_info_window_template .= "\t\t\t" . '<% if ( address2 ) { %>' . "\r\n";
|
81 |
$cpt_info_window_template .= "\t\t\t" . '<span><%= address2 %></span>' . "\r\n";
|
@@ -149,7 +149,7 @@ function wpsl_more_info_template() {
|
|
149 |
* Create the store header template.
|
150 |
*
|
151 |
* @since 2.0.0
|
152 |
-
* @param string $location The location where the header is shown ( info_window
|
153 |
* @return string $header_template The template for the store header
|
154 |
*/
|
155 |
function wpsl_store_header_template( $location = 'info_window' ) {
|
@@ -173,7 +173,22 @@ function wpsl_store_header_template( $location = 'info_window' ) {
|
|
173 |
}
|
174 |
|
175 |
if ( $wpsl_settings['permalinks'] ) {
|
176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
} else {
|
178 |
$header_template = '<% if ( wpslSettings.storeUrl == 1 && url ) { %>' . "\r\n";
|
179 |
$header_template .= $tab . '<strong><a' . $new_window . ' href="<%= url %>"><%= store %></a></strong>' . "\r\n";
|
75 |
<?php
|
76 |
$cpt_info_window_template = '<div class="wpsl-info-window">' . "\r\n";
|
77 |
$cpt_info_window_template .= "\t\t" . '<p class="wpsl-no-margin">' . "\r\n";
|
78 |
+
$cpt_info_window_template .= "\t\t\t" . wpsl_store_header_template( 'wpsl_map' ) . "\r\n";
|
79 |
$cpt_info_window_template .= "\t\t\t" . '<span><%= address %></span>' . "\r\n";
|
80 |
$cpt_info_window_template .= "\t\t\t" . '<% if ( address2 ) { %>' . "\r\n";
|
81 |
$cpt_info_window_template .= "\t\t\t" . '<span><%= address2 %></span>' . "\r\n";
|
149 |
* Create the store header template.
|
150 |
*
|
151 |
* @since 2.0.0
|
152 |
+
* @param string $location The location where the header is shown ( info_window / listing / wpsl_map shortcode )
|
153 |
* @return string $header_template The template for the store header
|
154 |
*/
|
155 |
function wpsl_store_header_template( $location = 'info_window' ) {
|
173 |
}
|
174 |
|
175 |
if ( $wpsl_settings['permalinks'] ) {
|
176 |
+
|
177 |
+
/**
|
178 |
+
* It's possible the permalinks are enabled, but not included in
|
179 |
+
* the location data on pages where the [wpsl_map] shortcode is used.
|
180 |
+
*
|
181 |
+
* So we need to check for undefined, which isn't necesary in all other cases.
|
182 |
+
*/
|
183 |
+
if ( $location == 'wpsl_map') {
|
184 |
+
$header_template = '<% if ( typeof permalink !== "undefined" ) { %>' . "\r\n";
|
185 |
+
$header_template .= $tab . '<strong><a' . $new_window . ' href="<%= permalink %>"><%= store %></a></strong>' . "\r\n";
|
186 |
+
$header_template .= $tab . '<% } else { %>' . "\r\n";
|
187 |
+
$header_template .= $tab . '<strong><%= store %></strong>' . "\r\n";
|
188 |
+
$header_template .= $tab . '<% } %>';
|
189 |
+
} else {
|
190 |
+
$header_template = '<strong><a' . $new_window . ' href="<%= permalink %>"><%= store %></a></strong>';
|
191 |
+
}
|
192 |
} else {
|
193 |
$header_template = '<% if ( wpslSettings.storeUrl == 1 && url ) { %>' . "\r\n";
|
194 |
$header_template .= $tab . '<strong><a' . $new_window . ' href="<%= url %>"><%= store %></a></strong>' . "\r\n";
|
js/wpsl-gmap.js
CHANGED
@@ -1222,7 +1222,7 @@ function makeAjaxRequest( startLatLng, resetMap, autoLoad, infoWindow ) {
|
|
1222 |
addMarker( latLng, response[index].id, response[index], draggable, infoWindow );
|
1223 |
|
1224 |
// Create the html output with help from underscore js.
|
1225 |
-
storeData = storeData + _.template( template
|
1226 |
});
|
1227 |
|
1228 |
$( "#wpsl-result-list" ).off( "click", ".wpsl-directions" );
|
@@ -1767,7 +1767,7 @@ function createInfoWindowHtml( infoWindowData ) {
|
|
1767 |
template = $( "#wpsl-info-window-template" ).html();
|
1768 |
}
|
1769 |
|
1770 |
-
windowContent = _.template( template
|
1771 |
|
1772 |
return windowContent;
|
1773 |
}
|
1222 |
addMarker( latLng, response[index].id, response[index], draggable, infoWindow );
|
1223 |
|
1224 |
// Create the html output with help from underscore js.
|
1225 |
+
storeData = storeData + _.template( template )( response[index] );
|
1226 |
});
|
1227 |
|
1228 |
$( "#wpsl-result-list" ).off( "click", ".wpsl-directions" );
|
1767 |
template = $( "#wpsl-info-window-template" ).html();
|
1768 |
}
|
1769 |
|
1770 |
+
windowContent = _.template( template )( infoWindowData ); //see http://underscorejs.org/#template
|
1771 |
|
1772 |
return windowContent;
|
1773 |
}
|
js/wpsl-gmap.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(e){function t(t,n){var p,g,u,m,v,S,b,y=Number(wpslSettings.autoZoomLevel);g=o(n),u=i(),H=new google.maps.Geocoder,q=new google.maps.DirectionsRenderer,Y=new google.maps.DirectionsService,p={zoom:Number(g.zoomLevel),center:g.startLatLng,mapTypeId:google.maps.MapTypeId[g.mapType.toUpperCase()],mapTypeControl:Number(g.mapTypeControl)?!0:!1,scrollwheel:Number(g.scrollWheel)?!0:!1,streetViewControl:Number(g.streetView)?!0:!1,zoomControlOptions:{position:google.maps.ControlPosition[g.controlPosition.toUpperCase()+"_TOP"]}},le=a(),Q=new google.maps.Map(document.getElementById(t),p),l(Q),r(g.mapStyle),"undefined"!=typeof window["wpslMap_"+n]&&"undefined"!=typeof window["wpslMap_"+n].locations&&(v=new google.maps.LatLngBounds,S=window["wpslMap_"+n].locations,b=S.length,e.each(S,function(e){m=new google.maps.LatLng(S[e].lat,S[e].lng),O(m,S[e].id,S[e],!1,u),v.extend(m)}),Q.fitBounds(v),google.maps.event.addListenerOnce(Q,"bounds_changed",function(e){return function(){e.getZoom()>y&&e.setZoom(y)}}(Q))),e("#wpsl-gmap").length&&(!c()&&e(".wpsl-dropdown").length?j():(e("#wpsl-search-wrap select").show(),e("#wpsl-wrap").addClass("wpsl-mobile")),e(".wpsl-search").hasClass("wpsl-widget")||(1==wpslSettings.autoLocate?w(g.startLatLng,u):1==wpslSettings.autoLoad&&d(g.startLatLng,u)),1!=wpslSettings.mouseFocus||c()||e("#wpsl-search-input").focus(),f(u),h(g,Q,u),F()),s()}function s(){"undefined"!=typeof wpslSettings.markerZoomTo&&1==wpslSettings.markerZoomTo&&google.maps.event.addListener(Q,"zoom_changed",function(){Z()})}function o(e){var t,s,o,i=["zoomLevel","mapType","mapTypeControl","mapStyle","streetView","scrollWheel","controlPosition"],l={zoomLevel:wpslSettings.zoomLevel,mapType:wpslSettings.mapType,mapTypeControl:wpslSettings.mapTypeControl,mapStyle:wpslSettings.mapStyle,streetView:wpslSettings.streetView,scrollWheel:wpslSettings.scrollWheel,controlPosition:wpslSettings.controlPosition};if("undefined"!=typeof window["wpslMap_"+e]&&"undefined"!=typeof window["wpslMap_"+e].shortCode)for(t=0,s=i.length;s>t;t++)o=window["wpslMap_"+e].shortCode[i[t]],"undefined"!=typeof o&&(l[i[t]]=o);return l.startLatLng=n(e),l}function n(e){var t,s,o="";return"undefined"!=typeof window["wpslMap_"+e]&&"undefined"!=typeof window["wpslMap_"+e].locations&&(o=window["wpslMap_"+e].locations[0]),"undefined"!=typeof o&&"undefined"!=typeof o.lat&&"undefined"!=typeof o.lng?t=new google.maps.LatLng(o.lat,o.lng):""!==wpslSettings.zoomLatlng?(s=wpslSettings.zoomLatlng.split(","),t=new google.maps.LatLng(s[0],s[1])):t=new google.maps.LatLng(0,0),t}function i(){var e,t,s={};return"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle?(e=wpslSettings.infoBoxClearance.split(","),t=wpslSettings.infoBoxPixelOffset.split(","),s={alignBottom:!0,boxClass:wpslSettings.infoBoxClass,closeBoxMargin:wpslSettings.infoBoxCloseMargin,closeBoxURL:wpslSettings.infoBoxCloseUrl,content:"",disableAutoPan:Number(wpslSettings.infoBoxDisableAutoPan)?!0:!1,enableEventPropagation:Number(wpslSettings.infoBoxEnableEventPropagation)?!0:!1,infoBoxClearance:new google.maps.Size(Number(e[0]),Number(e[1])),pixelOffset:new google.maps.Size(Number(t[0]),Number(t[1])),zIndex:Number(wpslSettings.infoBoxZindex)},ee=new InfoBox(s)):ee=new google.maps.InfoWindow,ee}function l(t){var s=parseInt(wpslSettings.draggable.disableRes),o={draggable:Boolean(wpslSettings.draggable.enabled)};"NaN"!==s&&o.draggable&&(o.draggable=e(document).width()>s?!0:!1),t.setOptions(o)}function a(){var e,t=wpslSettings.markerIconProps,s={};"undefined"!=typeof t.url?s.url=t.url:s.url=wpslSettings.url+"img/markers/";for(var o in t)t.hasOwnProperty(o)&&(e=t[o].split(","),2==e.length&&(s[o]=e));return s}function r(e){e=p(e),e&&Q.setOptions({styles:e})}function p(e){try{var t=JSON.parse(e);if(t&&"object"==typeof t&&null!==t)return t}catch(s){}return!1}function d(e,t){O(e,0,"",!0,t),N(e,pe,ce,t)}function c(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function w(t,s){if(navigator.geolocation){var o,n,i=!1,l=Number(wpslSettings.geoLocationTimout);o=setInterval(function(){e(".wpsl-icon-direction").toggleClass("wpsl-active-icon")},600),n=setTimeout(function(){g(o),d(t,s)},l),navigator.geolocation.getCurrentPosition(function(e){g(o),clearTimeout(n),A(i),u(t,e,pe,s)},function(o){if(e(".wpsl-icon-direction").hasClass("wpsl-user-activated")){switch(o.code){case o.PERMISSION_DENIED:alert(wpslGeolocationErrors.denied);break;case o.POSITION_UNAVAILABLE:alert(wpslGeolocationErrors.unavailable);break;case o.TIMEOUT:alert(wpslGeolocationErrors.timeout);break;default:alert(wpslGeolocationErrors.generalError)}e(".wpsl-icon-direction").removeClass("wpsl-active-icon")}else clearTimeout(n),d(t,s)},{maximumAge:6e4,timeout:l,enableHighAccuracy:!0})}else alert(wpslGeolocationErrors.unavailable),d(t,s)}function g(t){clearInterval(t),e(".wpsl-icon-direction").removeClass("wpsl-active-icon")}function u(e,t,s,o){if("undefined"==typeof t)d(e,o);else{var n=new google.maps.LatLng(t.coords.latitude,t.coords.longitude);J=t,k(n),Q.setCenter(n),O(n,0,"",!0,o),N(n,s,ce,o)}}function f(t){e("#wpsl-search-btn").on("click",function(){var s=!1;e("#wpsl-search-input").removeClass(),e("#wpsl-search-input").val()?(e("#wpsl-result-list ul").empty(),e("#wpsl-stores").show(),e(".wpsl-direction-before, .wpsl-direction-after").remove(),e("#wpsl-direction-details").hide(),pe=!1,m(),A(s),S(),I(t)):e("#wpsl-search-input").addClass("wpsl-error").focus()})}function m(){"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&"undefined"!=typeof ne[0]&&ne[0].close()}function h(t,s,o){google.maps.event.addListenerOnce(s,"tilesloaded",function(){e(".gm-style").append(wpslSettings.mapControls),e(".wpsl-icon-reset, #wpsl-reset-map").length>0&&(v(t.startLatLng,o),e(".wpsl-icon-reset").hide()),e(".wpsl-icon-direction").on("click",function(){e(this).addClass("wpsl-user-activated"),w(t.startLatLng,o)})})}function v(t,s){e(".wpsl-icon-reset, #wpsl-reset-map").on("click",function(){var o=!1,n=!0;e(this).hasClass("wpsl-in-progress")||(1==wpslSettings.autoLoad&&(ce=1),(Q.getCenter().lat()!==re.centerLatlng.lat()||Q.getCenter().lng()!==re.centerLatlng.lng()||Q.getZoom()!==re.zoomLevel)&&(A(o),e("#wpsl-search-input").val("").removeClass(),e(".wpsl-icon-reset").addClass("wpsl-in-progress"),te&&te.clearMarkers(),S(),b(),1==wpslSettings.autoLocate?u(t,J,n,s):d(t,s)),e("#wpsl-stores").show(),e("#wpsl-direction-details").hide())})}function S(){"undefined"!=typeof se&&""!==se&&(se.setMap(null),se="")}function b(){var t,s,o,n,i=[wpslSettings.searchRadius+" "+wpslSettings.distanceUnit,wpslSettings.maxResults],l=["wpsl-radius","wpsl-results"];for(t=0,s=l.length;s>t;t++)e("#"+l[t]+" select").val(parseInt(i[t])),e("#"+l[t]+" li").removeClass(),"wpsl-radius"==l[t]?o=wpslSettings.searchRadius:"wpsl-results"==l[t]&&(o=wpslSettings.maxResults),e("#"+l[t]+" li").each(function(){e(this).text()===i[t]&&(e(this).addClass("wpsl-selected-dropdown"),e("#"+l[t]+" .wpsl-selected-item").html(i[t]).attr("data-value",o))});e("#wpsl-category").length&&(e("#wpsl-category select").val(0),e("#wpsl-category li").removeClass(),e("#wpsl-category li:first-child").addClass("wpsl-selected-dropdown"),n=e("#wpsl-category li:first-child").text(),e("#wpsl-category .wpsl-selected-item").html(n).attr("data-value",0))}function y(t){var s,o,n,i,l;for(m(),l=t.parents("li").length>0?t.parents("li").data("store-id"):t.parents(".wpsl-info-window").data("store-id"),"undefined"!=typeof se&&""!==se&&(o=se.getPosition()),ae={centerLatlng:Q.getCenter(),zoomLevel:Q.getZoom()},s=0,i=ie.length;i>s;s++)0!=ie[s].storeId||"undefined"!=typeof o&&""!==o?ie[s].storeId==l&&(n=ie[s].getPosition()):o=ie[s].getPosition();o&&n?(e("#wpsl-direction-details ul").empty(),e(".wpsl-direction-before, .wpsl-direction-after").remove(),C(o,n)):alert(wpslLabels.generalError)}function L(e,t){var s,o,n;for(s=0,o=ie.length;o>s;s++)ie[s].storeId==e&&(n=ie[s],"start"==t?n.setAnimation(google.maps.Animation.BOUNCE):n.setAnimation(null))}function C(t,s){var o,n,i,l,a,r,p,d,c,w="",g={};d="km"==wpslSettings.distanceUnit?"METRIC":"IMPERIAL",g={origin:t,destination:s,travelMode:google.maps.DirectionsTravelMode.DRIVING,unitSystem:google.maps.UnitSystem[d]},Y.route(g,function(t,s){if(s==google.maps.DirectionsStatus.OK){if(q.setMap(Q),q.setDirections(t),t.routes.length>0){for(a=t.routes[0],r=0;r<a.legs.length;r++)for(o=a.legs[r],p=0,n=o.steps.length;n>p;p++)i=o.steps[p],l=p+1,w=w+"<li><div class='wpsl-direction-index'>"+l+"</div><div class='wpsl-direction-txt'>"+i.instructions+"</div><div class='wpsl-direction-distance'>"+i.distance.text+"</div></li>";for(e("#wpsl-direction-details ul").append(w).before("<div class='wpsl-direction-before'><a class='wpsl-back' id='wpsl-direction-start' href='#'>"+wpslLabels.back+"</a><div><span class='wpsl-total-distance'>"+a.legs[0].distance.text+"</span> - <span class='wpsl-total-durations'>"+a.legs[0].duration.text+"</span></div></div>").after("<p class='wpsl-direction-after'>"+t.routes[0].copyrights+"</p>"),e("#wpsl-direction-details").show(),r=0,n=ie.length;n>r;r++)ie[r].setMap(null);te&&te.clearMarkers(),"undefined"!=typeof se&&""!==se&&se.setMap(null),e("#wpsl-stores").hide(),1==wpslSettings.templateId&&(c=e("#wpsl-gmap").offset(),e(window).scrollTop(c.top))}}else G(s)})}function I(t){var s,o=!1,n=!1,i={address:e("#wpsl-search-input").val()};"undefined"==typeof wpslSettings.geocodeComponents||e.isEmptyObject(wpslSettings.geocodeComponents)||(i.componentRestrictions=wpslSettings.geocodeComponents),H.geocode(i,function(e,i){i==google.maps.GeocoderStatus.OK?(s=e[0].geometry.location,A(n),O(s,0,"",!0,t),N(s,pe,o,t)):D(i)})}function k(t){var s;H.geocode({latLng:t},function(t,o){o==google.maps.GeocoderStatus.OK?(s=x(t),""!==s&&e("#wpsl-search-input").val(s)):D(o)})}function x(e){var t,s,o,n=e[0].address_components.length;for(o=0;n>o;o++)s=e[0].address_components[o].types,(/^postal_code$/.test(s)||/^postal_code_prefix,postal_code$/.test(s))&&(t=e[0].address_components[o].long_name);return t}function N(e,t,s,o){1==wpslSettings.directionRedirect?E(e,function(){M(e,t,s,o)}):M(e,t,s,o)}function E(e,t){H.geocode({latLng:e},function(e,s){s==google.maps.GeocoderStatus.OK?(oe=e[0].formatted_address,t()):D(s)})}function M(t,s,o,n){var i,l,a,r="",p="",d=!1,w=e("#wpsl-wrap").hasClass("wpsl-mobile"),g=e("#wpsl-listing-template").html(),u=e("#wpsl-stores ul"),f=wpslSettings.url+"img/ajax-loader.gif",m={action:"store_search",lat:t.lat(),lng:t.lng()};s?(m.max_results=wpslSettings.maxResults,m.radius=wpslSettings.searchRadius):(w?(l=parseInt(e("#wpsl-results .wpsl-dropdown").val()),a=parseInt(e("#wpsl-radius .wpsl-dropdown").val())):(l=parseInt(e("#wpsl-results .wpsl-selected-item").attr("data-value")),a=parseInt(e("#wpsl-radius .wpsl-selected-item").attr("data-value"))),isNaN(l)?m.max_results=wpslSettings.maxResults:m.max_results=l,isNaN(a)?m.radius=wpslSettings.searchRadius:m.radius=a,"undefined"!=typeof wpslSettings.categoryIds?m.filter=wpslSettings.categoryIds:e("#wpsl-category").length>0&&(p=w?parseInt(e("#wpsl-category .wpsl-dropdown").val()):parseInt(e("#wpsl-category .wpsl-selected-item").attr("data-value")),isNaN(p)||0===p||(m.filter=p))),1==o&&("undefined"!=typeof J?m.skip_cache=1:(m.autoload=1,"undefined"!=typeof wpslSettings.categoryIds&&(m.filter=wpslSettings.categoryIds))),u.empty().append("<li class='wpsl-preloader'><img src='"+f+"'/>"+wpslLabels.preloader+"</li>"),e.get(wpslSettings.ajaxurl,m,function(t){e(".wpsl-preloader, .no-results").remove(),t.length>0?(e.each(t,function(e){_.extend(t[e],he),i=new google.maps.LatLng(t[e].lat,t[e].lng),O(i,t[e].id,t[e],d,n),r+=_.template(g,t[e])}),e("#wpsl-result-list").off("click",".wpsl-directions"),u.append(r),e("#wpsl-result-list").on("click",".wpsl-directions",function(){return 1!=wpslSettings.directionRedirect?(y(e(this)),!1):void 0}),P(),W(),e("#wpsl-result-list p:empty").remove()):u.html("<li class='no-results'>"+wpslLabels.noResults+"</li>"),1==wpslSettings.resetMap&&(e.isEmptyObject(re)&&google.maps.event.addListenerOnce(Q,"tilesloaded",function(){re={centerLatlng:Q.getCenter(),zoomLevel:Q.getZoom()},e("#wpsl-map-controls").addClass("wpsl-reset-exists"),e(".wpsl-icon-reset, #wpsl-reset-map").show()}),e(".wpsl-icon-reset").removeClass("wpsl-in-progress"))}),1!=wpslSettings.mouseFocus||c()||e("#wpsl-search-input").focus()}function P(){if(1==wpslSettings.markerClusters){var e=Number(wpslSettings.clusterZoom),t=Number(wpslSettings.clusterSize);isNaN(e)&&(e=""),isNaN(t)&&(t=""),te=new MarkerClusterer(Q,ie,{gridSize:t,maxZoom:e})}}function O(e,t,s,o,n){var i,l,a,r=!0;0===t?(s={store:wpslLabels.startPoint},i=le.url+wpslSettings.startMarker):i=le.url+wpslSettings.storeMarker,l={url:i,scaledSize:new google.maps.Size(Number(le.scaledSize[0]),Number(le.scaledSize[1])),origin:new google.maps.Point(Number(le.origin[0]),Number(le.origin[1])),anchor:new google.maps.Point(Number(le.anchor[0]),Number(le.anchor[1]))},a=new google.maps.Marker({position:e,map:Q,optimized:!1,title:R(s.store),draggable:o,storeId:t,icon:l}),ie.push(a),google.maps.event.addListener(a,"click",function(o){return function(){0!=t?"undefined"!=typeof wpslSettings.markerStreetView&&1==wpslSettings.markerStreetView?$(e,function(){T(a,U(s),n,o)}):T(a,U(s),n,o):T(a,wpslLabels.startPoint,n,o),google.maps.event.clearListeners(n,"domready"),google.maps.event.addListener(n,"domready",function(){z(a,o),Z()})}}(Q)),o&&google.maps.event.addListener(a,"dragend",function(e){A(r),Q.setCenter(e.latLng),k(e.latLng),N(e.latLng,pe,ce=!1,n)})}function R(e){return e?e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)}):void 0}function T(e,t,s,o){ne.length=0,s.setContent(t),s.open(o,e),ne.push(s),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters&&(X=e.storeId,s.setVisible(!0))}function z(t,s){e(".wpsl-info-actions a").on("click",function(o){var n=Number(wpslSettings.autoZoomLevel);if(o.stopImmediatePropagation(),e(this).hasClass("wpsl-directions")){if(1==wpslSettings.directionRedirect)return!0;y(e(this))}else e(this).hasClass("wpsl-streetview")?B(t,s):e(this).hasClass("wpsl-zoom-here")&&(s.setCenter(t.getPosition()),s.setZoom(n));return!1})}function Z(){var t=Q.getZoom();t>=wpslSettings.autoZoomLevel?e(".wpsl-zoom-here").hide():e(".wpsl-zoom-here").show()}function B(t,s){var o=s.getStreetView();o.setPosition(t.getPosition()),o.setVisible(!0),e("#wpsl-map-controls").hide(),V(o,s)}function V(t,s){google.maps.event.addListener(t,"visible_changed",function(){if(!t.getVisible()){var o=s.getZoom();e("#wpsl-map-controls").show(),s.setZoom(o-1),s.setZoom(o)}})}function $(e,t){var s=new google.maps.StreetViewService;s.getPanoramaByLocation(e,50,function(e,s){de=s==google.maps.StreetViewStatus.OK?!0:!1,t()})}function U(t){var s,o;return o=e("#wpsl-base-gmap_0").length?e("#wpsl-cpt-info-window-template").html():e("#wpsl-info-window-template").html(),s=_.template(o,t)}function W(){var e,t,s=Number(wpslSettings.autoZoomLevel),o=new google.maps.LatLngBounds;for(google.maps.event.addListenerOnce(Q,"bounds_changed",function(e){this.getZoom()>s&&this.setZoom(s)}),e=0,t=ie.length;t>e;e++)o.extend(ie[e].position);Q.fitBounds(o)}function A(e){var t,s;if(q.setMap(null),ie){for(s=0,t=ie.length;t>s;s++)e?1!=ie[s].draggable?ie[s].setMap(null):se=ie[s]:ie[s].setMap(null);ie.length=0}te&&te.clearMarkers()}function D(e){var t;switch(e){case"ZERO_RESULTS":t=wpslLabels.noResults;break;case"OVER_QUERY_LIMIT":t=wpslLabels.queryLimit;break;default:t=wpslLabels.generalError}alert(t)}function G(e){var t;switch(e){case"NOT_FOUND":case"ZERO_RESULTS":t=wpslLabels.noDirectionsFound;break;case"OVER_QUERY_LIMIT":t=wpslLabels.queryLimit;break;default:t=wpslLabels.generalError}alert(t)}function j(){e(".wpsl-dropdown").each(function(t){var s,o,n=e(this);n.$dropdownWrap=n.wrap("<div class='wpsl-dropdown'></div>").parent(),n.$selectedVal=n.val(),n.$dropdownElem=e("<div><ul/></div>").appendTo(n.$dropdownWrap),n.$dropdown=n.$dropdownElem.find("ul"),n.$options=n.$dropdownWrap.find("option"),n.hide().removeClass("wpsl-dropdown"),e.each(n.$options,function(){s=e(this).val()==n.$selectedVal?'class="wpsl-selected-dropdown"':"",n.$dropdown.append("<li data-value="+e(this).val()+" "+s+">"+e(this).text()+"</li>")}),n.$dropdownElem.before("<span data-value="+n.find(":selected").val()+" class='wpsl-selected-item'>"+n.find(":selected").text()+"</span>"),n.$dropdownItem=n.$dropdownElem.find("li"),n.$dropdownWrap.on("click",function(t){K(),e(this).toggleClass("wpsl-active"),o=0,e(this).hasClass("wpsl-active")?(n.$dropdownItem.each(function(t){o+=e(this).outerHeight()}),n.$dropdownElem.css("height",o+2+"px")):n.$dropdownElem.css("height",0),t.stopPropagation()}),n.$dropdownItem.on("click",function(t){n.$dropdownWrap.find(e(".wpsl-selected-item")).html(e(this).text()).attr("data-value",e(this).attr("data-value")),n.$dropdownItem.removeClass("wpsl-selected-dropdown"),e(this).addClass("wpsl-selected-dropdown"),K(),t.stopPropagation()})}),e(document).click(function(){K()})}function K(){e(".wpsl-dropdown").removeClass("wpsl-active"),e(".wpsl-dropdown div").css("height",0)}function F(){e(".wpsl-search").hasClass("wpsl-widget")&&(e("#wpsl-search-btn").trigger("click"),e(".wpsl-search").removeClass("wpsl-widget"))}var H,Q,q,Y,J,X,ee,te,se,oe,ne=[],ie=[],le={},ae={},re={},pe=!1,de=!1,ce="undefined"!=typeof wpslSettings?wpslSettings.autoLoad:"";if(_.templateSettings={evaluate:/\<\%(.+?)\%\>/g,interpolate:/\<\%=(.+?)\%\>/g,escape:/\<\%-(.+?)\%\>/g},e(".wpsl-gmap-canvas").length&&(e("<img />").attr("src",wpslSettings.url+"img/ajax-loader.gif"),e(".wpsl-gmap-canvas").each(function(s){var o=e(this).attr("id");t(o,s)})),e("#wpsl-result-list").on("click",".wpsl-back",function(){var t,s;for(q.setMap(null),t=0,s=ie.length;s>t;t++)ie[t].setMap(Q);return"undefined"!=typeof se&&""!==se&&se.setMap(Q),te&&P(),Q.setCenter(ae.centerLatlng),Q.setZoom(ae.zoomLevel),e(".wpsl-direction-before, .wpsl-direction-after").remove(),e("#wpsl-stores").show(),e("#wpsl-direction-details").hide(),!1}),e("#wpsl-gmap").length&&("bounce"==wpslSettings.markerEffect?(e("#wpsl-stores").on("mouseenter","li",function(){L(e(this).data("store-id"),"start")}),e("#wpsl-stores").on("mouseleave","li",function(){L(e(this).data("store-id"),"stop")})):"info_window"==wpslSettings.markerEffect&&e("#wpsl-stores").on("mouseenter","li",function(){var t,s;for(t=0,s=ie.length;s>t;t++)ie[t].storeId==e(this).data("store-id")&&(google.maps.event.trigger(ie[t],"click"),Q.setCenter(ie[t].position))})),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters){var we,ge,ue,fe,me;google.maps.event.addListener(Q,"zoom_changed",function(){google.maps.event.addListenerOnce(Q,"idle",function(){if("undefined"!=typeof te&&(we=te.clusters_,we.length))for(fe=0,ge=we.length;ge>fe;fe++)for(me=0,ue=we[fe].markers_.length;ue>me;me++)if(we[fe].markers_[me].storeId==X){ee.getVisible()&&null===we[fe].markers_[me].map?ee.setVisible(!1):ee.getVisible()||null===we[fe].markers_[me].map||ee.setVisible(!0);break}})})}var he={formatPhoneNumber:function(e){return 1==wpslSettings.phoneUrl&&c()&&(e="<a href='tel:"+he.formatClickablePhoneNumber(e)+"'>"+e+"</a>"),e},formatClickablePhoneNumber:function(e){return-1!=e.indexOf("+")&&-1!=e.indexOf("(0)")&&(e=e.replace("(0)","")),e.replace(/(-| |\(|\)|\.|)/g,"")},createInfoWindowActions:function(t){var s,o="",n="";return e("#wpsl-gmap").length&&(de&&(o="<a class='wpsl-streetview' href='#'>"+wpslLabels.streetView+"</a>"),1==wpslSettings.markerZoomTo&&(n="<a class='wpsl-zoom-here' href='#'>"+wpslLabels.zoomHere+"</a>"),s="<div class='wpsl-info-actions'>"+he.createDirectionUrl(t)+o+n+"</div>"),s},createDirectionUrl:function(t){var s,o,n,i={};return 1==wpslSettings.directionRedirect?("undefined"==typeof oe&&(oe=""),i.target="target='_blank'","undefined"!=typeof t?i.src=e("[data-store-id="+t+"] .wpsl-directions").attr("href"):(n=this.zip?this.zip+", ":"",o=this.address+", "+this.city+", "+n+this.country,i.src="https://maps.google.com/maps?saddr="+he.rfc3986EncodeURIComponent(oe)+"&daddr="+he.rfc3986EncodeURIComponent(o))):i={src:"#",target:""},s="<a class='wpsl-directions' "+i.target+" href='"+i.src+"'>"+wpslLabels.directions+"</a>"},rfc3986EncodeURIComponent:function(e){return encodeURIComponent(e).replace(/[!'()*]/g,escape)}};if(e("#wpsl-search-input").keydown(function(t){var s=t.keyCode||t.which;13==s&&e("#wpsl-search-btn").trigger("click")}),e("#wpsl-stores").on("click",".wpsl-store-details",function(){var t,s,o=e(this).parents("li"),n=o.data("store-id");if("info window"==wpslSettings.moreInfoLocation)for(t=0,s=ie.length;s>t;t++)ie[t].storeId==n&&google.maps.event.trigger(ie[t],"click");else o.find(".wpsl-more-info-listings").is(":visible")?e(this).removeClass("wpsl-active-details"):e(this).addClass("wpsl-active-details"),o.siblings().find(".wpsl-store-details").removeClass("wpsl-active-details"),o.siblings().find(".wpsl-more-info-listings").hide(),o.find(".wpsl-more-info-listings").toggle();return"default"!=wpslSettings.templateId||"store listings"==wpslSettings.moreInfoLocation?!1:void 0}),e("a[href='#"+wpslSettings.mapTabAnchor+"']").length){var ve,Se,be=e("a[href='#"+wpslSettings.mapTabAnchor+"']");be.on("click",function(){return setTimeout(function(){ve=Q.getZoom(),Se=Q.getCenter(),google.maps.event.trigger(Q,"resize"),Q.setZoom(ve),Q.setCenter(Se),W()},50),!1})}});
|
1 |
+
jQuery(document).ready(function(e){function t(t,n){var p,g,u,m,v,S,b,y=Number(wpslSettings.autoZoomLevel);g=o(n),u=i(),H=new google.maps.Geocoder,q=new google.maps.DirectionsRenderer,Y=new google.maps.DirectionsService,p={zoom:Number(g.zoomLevel),center:g.startLatLng,mapTypeId:google.maps.MapTypeId[g.mapType.toUpperCase()],mapTypeControl:Number(g.mapTypeControl)?!0:!1,scrollwheel:Number(g.scrollWheel)?!0:!1,streetViewControl:Number(g.streetView)?!0:!1,zoomControlOptions:{position:google.maps.ControlPosition[g.controlPosition.toUpperCase()+"_TOP"]}},le=a(),Q=new google.maps.Map(document.getElementById(t),p),l(Q),r(g.mapStyle),"undefined"!=typeof window["wpslMap_"+n]&&"undefined"!=typeof window["wpslMap_"+n].locations&&(v=new google.maps.LatLngBounds,S=window["wpslMap_"+n].locations,b=S.length,e.each(S,function(e){m=new google.maps.LatLng(S[e].lat,S[e].lng),O(m,S[e].id,S[e],!1,u),v.extend(m)}),Q.fitBounds(v),google.maps.event.addListenerOnce(Q,"bounds_changed",function(e){return function(){e.getZoom()>y&&e.setZoom(y)}}(Q))),e("#wpsl-gmap").length&&(!c()&&e(".wpsl-dropdown").length?j():(e("#wpsl-search-wrap select").show(),e("#wpsl-wrap").addClass("wpsl-mobile")),e(".wpsl-search").hasClass("wpsl-widget")||(1==wpslSettings.autoLocate?w(g.startLatLng,u):1==wpslSettings.autoLoad&&d(g.startLatLng,u)),1!=wpslSettings.mouseFocus||c()||e("#wpsl-search-input").focus(),f(u),h(g,Q,u),F()),s()}function s(){"undefined"!=typeof wpslSettings.markerZoomTo&&1==wpslSettings.markerZoomTo&&google.maps.event.addListener(Q,"zoom_changed",function(){Z()})}function o(e){var t,s,o,i=["zoomLevel","mapType","mapTypeControl","mapStyle","streetView","scrollWheel","controlPosition"],l={zoomLevel:wpslSettings.zoomLevel,mapType:wpslSettings.mapType,mapTypeControl:wpslSettings.mapTypeControl,mapStyle:wpslSettings.mapStyle,streetView:wpslSettings.streetView,scrollWheel:wpslSettings.scrollWheel,controlPosition:wpslSettings.controlPosition};if("undefined"!=typeof window["wpslMap_"+e]&&"undefined"!=typeof window["wpslMap_"+e].shortCode)for(t=0,s=i.length;s>t;t++)o=window["wpslMap_"+e].shortCode[i[t]],"undefined"!=typeof o&&(l[i[t]]=o);return l.startLatLng=n(e),l}function n(e){var t,s,o="";return"undefined"!=typeof window["wpslMap_"+e]&&"undefined"!=typeof window["wpslMap_"+e].locations&&(o=window["wpslMap_"+e].locations[0]),"undefined"!=typeof o&&"undefined"!=typeof o.lat&&"undefined"!=typeof o.lng?t=new google.maps.LatLng(o.lat,o.lng):""!==wpslSettings.zoomLatlng?(s=wpslSettings.zoomLatlng.split(","),t=new google.maps.LatLng(s[0],s[1])):t=new google.maps.LatLng(0,0),t}function i(){var e,t,s={};return"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle?(e=wpslSettings.infoBoxClearance.split(","),t=wpslSettings.infoBoxPixelOffset.split(","),s={alignBottom:!0,boxClass:wpslSettings.infoBoxClass,closeBoxMargin:wpslSettings.infoBoxCloseMargin,closeBoxURL:wpslSettings.infoBoxCloseUrl,content:"",disableAutoPan:Number(wpslSettings.infoBoxDisableAutoPan)?!0:!1,enableEventPropagation:Number(wpslSettings.infoBoxEnableEventPropagation)?!0:!1,infoBoxClearance:new google.maps.Size(Number(e[0]),Number(e[1])),pixelOffset:new google.maps.Size(Number(t[0]),Number(t[1])),zIndex:Number(wpslSettings.infoBoxZindex)},ee=new InfoBox(s)):ee=new google.maps.InfoWindow,ee}function l(t){var s=parseInt(wpslSettings.draggable.disableRes),o={draggable:Boolean(wpslSettings.draggable.enabled)};"NaN"!==s&&o.draggable&&(o.draggable=e(document).width()>s?!0:!1),t.setOptions(o)}function a(){var e,t=wpslSettings.markerIconProps,s={};"undefined"!=typeof t.url?s.url=t.url:s.url=wpslSettings.url+"img/markers/";for(var o in t)t.hasOwnProperty(o)&&(e=t[o].split(","),2==e.length&&(s[o]=e));return s}function r(e){e=p(e),e&&Q.setOptions({styles:e})}function p(e){try{var t=JSON.parse(e);if(t&&"object"==typeof t&&null!==t)return t}catch(s){}return!1}function d(e,t){O(e,0,"",!0,t),N(e,pe,ce,t)}function c(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function w(t,s){if(navigator.geolocation){var o,n,i=!1,l=Number(wpslSettings.geoLocationTimout);o=setInterval(function(){e(".wpsl-icon-direction").toggleClass("wpsl-active-icon")},600),n=setTimeout(function(){g(o),d(t,s)},l),navigator.geolocation.getCurrentPosition(function(e){g(o),clearTimeout(n),A(i),u(t,e,pe,s)},function(o){if(e(".wpsl-icon-direction").hasClass("wpsl-user-activated")){switch(o.code){case o.PERMISSION_DENIED:alert(wpslGeolocationErrors.denied);break;case o.POSITION_UNAVAILABLE:alert(wpslGeolocationErrors.unavailable);break;case o.TIMEOUT:alert(wpslGeolocationErrors.timeout);break;default:alert(wpslGeolocationErrors.generalError)}e(".wpsl-icon-direction").removeClass("wpsl-active-icon")}else clearTimeout(n),d(t,s)},{maximumAge:6e4,timeout:l,enableHighAccuracy:!0})}else alert(wpslGeolocationErrors.unavailable),d(t,s)}function g(t){clearInterval(t),e(".wpsl-icon-direction").removeClass("wpsl-active-icon")}function u(e,t,s,o){if("undefined"==typeof t)d(e,o);else{var n=new google.maps.LatLng(t.coords.latitude,t.coords.longitude);J=t,k(n),Q.setCenter(n),O(n,0,"",!0,o),N(n,s,ce,o)}}function f(t){e("#wpsl-search-btn").on("click",function(){var s=!1;e("#wpsl-search-input").removeClass(),e("#wpsl-search-input").val()?(e("#wpsl-result-list ul").empty(),e("#wpsl-stores").show(),e(".wpsl-direction-before, .wpsl-direction-after").remove(),e("#wpsl-direction-details").hide(),pe=!1,m(),A(s),S(),I(t)):e("#wpsl-search-input").addClass("wpsl-error").focus()})}function m(){"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&"undefined"!=typeof ne[0]&&ne[0].close()}function h(t,s,o){google.maps.event.addListenerOnce(s,"tilesloaded",function(){e(".gm-style").append(wpslSettings.mapControls),e(".wpsl-icon-reset, #wpsl-reset-map").length>0&&(v(t.startLatLng,o),e(".wpsl-icon-reset").hide()),e(".wpsl-icon-direction").on("click",function(){e(this).addClass("wpsl-user-activated"),w(t.startLatLng,o)})})}function v(t,s){e(".wpsl-icon-reset, #wpsl-reset-map").on("click",function(){var o=!1,n=!0;e(this).hasClass("wpsl-in-progress")||(1==wpslSettings.autoLoad&&(ce=1),(Q.getCenter().lat()!==re.centerLatlng.lat()||Q.getCenter().lng()!==re.centerLatlng.lng()||Q.getZoom()!==re.zoomLevel)&&(A(o),e("#wpsl-search-input").val("").removeClass(),e(".wpsl-icon-reset").addClass("wpsl-in-progress"),te&&te.clearMarkers(),S(),b(),1==wpslSettings.autoLocate?u(t,J,n,s):d(t,s)),e("#wpsl-stores").show(),e("#wpsl-direction-details").hide())})}function S(){"undefined"!=typeof se&&""!==se&&(se.setMap(null),se="")}function b(){var t,s,o,n,i=[wpslSettings.searchRadius+" "+wpslSettings.distanceUnit,wpslSettings.maxResults],l=["wpsl-radius","wpsl-results"];for(t=0,s=l.length;s>t;t++)e("#"+l[t]+" select").val(parseInt(i[t])),e("#"+l[t]+" li").removeClass(),"wpsl-radius"==l[t]?o=wpslSettings.searchRadius:"wpsl-results"==l[t]&&(o=wpslSettings.maxResults),e("#"+l[t]+" li").each(function(){e(this).text()===i[t]&&(e(this).addClass("wpsl-selected-dropdown"),e("#"+l[t]+" .wpsl-selected-item").html(i[t]).attr("data-value",o))});e("#wpsl-category").length&&(e("#wpsl-category select").val(0),e("#wpsl-category li").removeClass(),e("#wpsl-category li:first-child").addClass("wpsl-selected-dropdown"),n=e("#wpsl-category li:first-child").text(),e("#wpsl-category .wpsl-selected-item").html(n).attr("data-value",0))}function y(t){var s,o,n,i,l;for(m(),l=t.parents("li").length>0?t.parents("li").data("store-id"):t.parents(".wpsl-info-window").data("store-id"),"undefined"!=typeof se&&""!==se&&(o=se.getPosition()),ae={centerLatlng:Q.getCenter(),zoomLevel:Q.getZoom()},s=0,i=ie.length;i>s;s++)0!=ie[s].storeId||"undefined"!=typeof o&&""!==o?ie[s].storeId==l&&(n=ie[s].getPosition()):o=ie[s].getPosition();o&&n?(e("#wpsl-direction-details ul").empty(),e(".wpsl-direction-before, .wpsl-direction-after").remove(),C(o,n)):alert(wpslLabels.generalError)}function L(e,t){var s,o,n;for(s=0,o=ie.length;o>s;s++)ie[s].storeId==e&&(n=ie[s],"start"==t?n.setAnimation(google.maps.Animation.BOUNCE):n.setAnimation(null))}function C(t,s){var o,n,i,l,a,r,p,d,c,w="",g={};d="km"==wpslSettings.distanceUnit?"METRIC":"IMPERIAL",g={origin:t,destination:s,travelMode:google.maps.DirectionsTravelMode.DRIVING,unitSystem:google.maps.UnitSystem[d]},Y.route(g,function(t,s){if(s==google.maps.DirectionsStatus.OK){if(q.setMap(Q),q.setDirections(t),t.routes.length>0){for(a=t.routes[0],r=0;r<a.legs.length;r++)for(o=a.legs[r],p=0,n=o.steps.length;n>p;p++)i=o.steps[p],l=p+1,w=w+"<li><div class='wpsl-direction-index'>"+l+"</div><div class='wpsl-direction-txt'>"+i.instructions+"</div><div class='wpsl-direction-distance'>"+i.distance.text+"</div></li>";for(e("#wpsl-direction-details ul").append(w).before("<div class='wpsl-direction-before'><a class='wpsl-back' id='wpsl-direction-start' href='#'>"+wpslLabels.back+"</a><div><span class='wpsl-total-distance'>"+a.legs[0].distance.text+"</span> - <span class='wpsl-total-durations'>"+a.legs[0].duration.text+"</span></div></div>").after("<p class='wpsl-direction-after'>"+t.routes[0].copyrights+"</p>"),e("#wpsl-direction-details").show(),r=0,n=ie.length;n>r;r++)ie[r].setMap(null);te&&te.clearMarkers(),"undefined"!=typeof se&&""!==se&&se.setMap(null),e("#wpsl-stores").hide(),1==wpslSettings.templateId&&(c=e("#wpsl-gmap").offset(),e(window).scrollTop(c.top))}}else G(s)})}function I(t){var s,o=!1,n=!1,i={address:e("#wpsl-search-input").val()};"undefined"==typeof wpslSettings.geocodeComponents||e.isEmptyObject(wpslSettings.geocodeComponents)||(i.componentRestrictions=wpslSettings.geocodeComponents),H.geocode(i,function(e,i){i==google.maps.GeocoderStatus.OK?(s=e[0].geometry.location,A(n),O(s,0,"",!0,t),N(s,pe,o,t)):D(i)})}function k(t){var s;H.geocode({latLng:t},function(t,o){o==google.maps.GeocoderStatus.OK?(s=x(t),""!==s&&e("#wpsl-search-input").val(s)):D(o)})}function x(e){var t,s,o,n=e[0].address_components.length;for(o=0;n>o;o++)s=e[0].address_components[o].types,(/^postal_code$/.test(s)||/^postal_code_prefix,postal_code$/.test(s))&&(t=e[0].address_components[o].long_name);return t}function N(e,t,s,o){1==wpslSettings.directionRedirect?E(e,function(){M(e,t,s,o)}):M(e,t,s,o)}function E(e,t){H.geocode({latLng:e},function(e,s){s==google.maps.GeocoderStatus.OK?(oe=e[0].formatted_address,t()):D(s)})}function M(t,s,o,n){var i,l,a,r="",p="",d=!1,w=e("#wpsl-wrap").hasClass("wpsl-mobile"),g=e("#wpsl-listing-template").html(),u=e("#wpsl-stores ul"),f=wpslSettings.url+"img/ajax-loader.gif",m={action:"store_search",lat:t.lat(),lng:t.lng()};s?(m.max_results=wpslSettings.maxResults,m.radius=wpslSettings.searchRadius):(w?(l=parseInt(e("#wpsl-results .wpsl-dropdown").val()),a=parseInt(e("#wpsl-radius .wpsl-dropdown").val())):(l=parseInt(e("#wpsl-results .wpsl-selected-item").attr("data-value")),a=parseInt(e("#wpsl-radius .wpsl-selected-item").attr("data-value"))),isNaN(l)?m.max_results=wpslSettings.maxResults:m.max_results=l,isNaN(a)?m.radius=wpslSettings.searchRadius:m.radius=a,"undefined"!=typeof wpslSettings.categoryIds?m.filter=wpslSettings.categoryIds:e("#wpsl-category").length>0&&(p=w?parseInt(e("#wpsl-category .wpsl-dropdown").val()):parseInt(e("#wpsl-category .wpsl-selected-item").attr("data-value")),isNaN(p)||0===p||(m.filter=p))),1==o&&("undefined"!=typeof J?m.skip_cache=1:(m.autoload=1,"undefined"!=typeof wpslSettings.categoryIds&&(m.filter=wpslSettings.categoryIds))),u.empty().append("<li class='wpsl-preloader'><img src='"+f+"'/>"+wpslLabels.preloader+"</li>"),e.get(wpslSettings.ajaxurl,m,function(t){e(".wpsl-preloader, .no-results").remove(),t.length>0?(e.each(t,function(e){_.extend(t[e],he),i=new google.maps.LatLng(t[e].lat,t[e].lng),O(i,t[e].id,t[e],d,n),r+=_.template(g)(t[e])}),e("#wpsl-result-list").off("click",".wpsl-directions"),u.append(r),e("#wpsl-result-list").on("click",".wpsl-directions",function(){return 1!=wpslSettings.directionRedirect?(y(e(this)),!1):void 0}),P(),W(),e("#wpsl-result-list p:empty").remove()):u.html("<li class='no-results'>"+wpslLabels.noResults+"</li>"),1==wpslSettings.resetMap&&(e.isEmptyObject(re)&&google.maps.event.addListenerOnce(Q,"tilesloaded",function(){re={centerLatlng:Q.getCenter(),zoomLevel:Q.getZoom()},e("#wpsl-map-controls").addClass("wpsl-reset-exists"),e(".wpsl-icon-reset, #wpsl-reset-map").show()}),e(".wpsl-icon-reset").removeClass("wpsl-in-progress"))}),1!=wpslSettings.mouseFocus||c()||e("#wpsl-search-input").focus()}function P(){if(1==wpslSettings.markerClusters){var e=Number(wpslSettings.clusterZoom),t=Number(wpslSettings.clusterSize);isNaN(e)&&(e=""),isNaN(t)&&(t=""),te=new MarkerClusterer(Q,ie,{gridSize:t,maxZoom:e})}}function O(e,t,s,o,n){var i,l,a,r=!0;0===t?(s={store:wpslLabels.startPoint},i=le.url+wpslSettings.startMarker):i=le.url+wpslSettings.storeMarker,l={url:i,scaledSize:new google.maps.Size(Number(le.scaledSize[0]),Number(le.scaledSize[1])),origin:new google.maps.Point(Number(le.origin[0]),Number(le.origin[1])),anchor:new google.maps.Point(Number(le.anchor[0]),Number(le.anchor[1]))},a=new google.maps.Marker({position:e,map:Q,optimized:!1,title:R(s.store),draggable:o,storeId:t,icon:l}),ie.push(a),google.maps.event.addListener(a,"click",function(o){return function(){0!=t?"undefined"!=typeof wpslSettings.markerStreetView&&1==wpslSettings.markerStreetView?$(e,function(){T(a,U(s),n,o)}):T(a,U(s),n,o):T(a,wpslLabels.startPoint,n,o),google.maps.event.clearListeners(n,"domready"),google.maps.event.addListener(n,"domready",function(){z(a,o),Z()})}}(Q)),o&&google.maps.event.addListener(a,"dragend",function(e){A(r),Q.setCenter(e.latLng),k(e.latLng),N(e.latLng,pe,ce=!1,n)})}function R(e){return e?e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)}):void 0}function T(e,t,s,o){ne.length=0,s.setContent(t),s.open(o,e),ne.push(s),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters&&(X=e.storeId,s.setVisible(!0))}function z(t,s){e(".wpsl-info-actions a").on("click",function(o){var n=Number(wpslSettings.autoZoomLevel);if(o.stopImmediatePropagation(),e(this).hasClass("wpsl-directions")){if(1==wpslSettings.directionRedirect)return!0;y(e(this))}else e(this).hasClass("wpsl-streetview")?B(t,s):e(this).hasClass("wpsl-zoom-here")&&(s.setCenter(t.getPosition()),s.setZoom(n));return!1})}function Z(){var t=Q.getZoom();t>=wpslSettings.autoZoomLevel?e(".wpsl-zoom-here").hide():e(".wpsl-zoom-here").show()}function B(t,s){var o=s.getStreetView();o.setPosition(t.getPosition()),o.setVisible(!0),e("#wpsl-map-controls").hide(),V(o,s)}function V(t,s){google.maps.event.addListener(t,"visible_changed",function(){if(!t.getVisible()){var o=s.getZoom();e("#wpsl-map-controls").show(),s.setZoom(o-1),s.setZoom(o)}})}function $(e,t){var s=new google.maps.StreetViewService;s.getPanoramaByLocation(e,50,function(e,s){de=s==google.maps.StreetViewStatus.OK?!0:!1,t()})}function U(t){var s,o;return o=e("#wpsl-base-gmap_0").length?e("#wpsl-cpt-info-window-template").html():e("#wpsl-info-window-template").html(),s=_.template(o)(t)}function W(){var e,t,s=Number(wpslSettings.autoZoomLevel),o=new google.maps.LatLngBounds;for(google.maps.event.addListenerOnce(Q,"bounds_changed",function(e){this.getZoom()>s&&this.setZoom(s)}),e=0,t=ie.length;t>e;e++)o.extend(ie[e].position);Q.fitBounds(o)}function A(e){var t,s;if(q.setMap(null),ie){for(s=0,t=ie.length;t>s;s++)e?1!=ie[s].draggable?ie[s].setMap(null):se=ie[s]:ie[s].setMap(null);ie.length=0}te&&te.clearMarkers()}function D(e){var t;switch(e){case"ZERO_RESULTS":t=wpslLabels.noResults;break;case"OVER_QUERY_LIMIT":t=wpslLabels.queryLimit;break;default:t=wpslLabels.generalError}alert(t)}function G(e){var t;switch(e){case"NOT_FOUND":case"ZERO_RESULTS":t=wpslLabels.noDirectionsFound;break;case"OVER_QUERY_LIMIT":t=wpslLabels.queryLimit;break;default:t=wpslLabels.generalError}alert(t)}function j(){e(".wpsl-dropdown").each(function(t){var s,o,n=e(this);n.$dropdownWrap=n.wrap("<div class='wpsl-dropdown'></div>").parent(),n.$selectedVal=n.val(),n.$dropdownElem=e("<div><ul/></div>").appendTo(n.$dropdownWrap),n.$dropdown=n.$dropdownElem.find("ul"),n.$options=n.$dropdownWrap.find("option"),n.hide().removeClass("wpsl-dropdown"),e.each(n.$options,function(){s=e(this).val()==n.$selectedVal?'class="wpsl-selected-dropdown"':"",n.$dropdown.append("<li data-value="+e(this).val()+" "+s+">"+e(this).text()+"</li>")}),n.$dropdownElem.before("<span data-value="+n.find(":selected").val()+" class='wpsl-selected-item'>"+n.find(":selected").text()+"</span>"),n.$dropdownItem=n.$dropdownElem.find("li"),n.$dropdownWrap.on("click",function(t){K(),e(this).toggleClass("wpsl-active"),o=0,e(this).hasClass("wpsl-active")?(n.$dropdownItem.each(function(t){o+=e(this).outerHeight()}),n.$dropdownElem.css("height",o+2+"px")):n.$dropdownElem.css("height",0),t.stopPropagation()}),n.$dropdownItem.on("click",function(t){n.$dropdownWrap.find(e(".wpsl-selected-item")).html(e(this).text()).attr("data-value",e(this).attr("data-value")),n.$dropdownItem.removeClass("wpsl-selected-dropdown"),e(this).addClass("wpsl-selected-dropdown"),K(),t.stopPropagation()})}),e(document).click(function(){K()})}function K(){e(".wpsl-dropdown").removeClass("wpsl-active"),e(".wpsl-dropdown div").css("height",0)}function F(){e(".wpsl-search").hasClass("wpsl-widget")&&(e("#wpsl-search-btn").trigger("click"),e(".wpsl-search").removeClass("wpsl-widget"))}var H,Q,q,Y,J,X,ee,te,se,oe,ne=[],ie=[],le={},ae={},re={},pe=!1,de=!1,ce="undefined"!=typeof wpslSettings?wpslSettings.autoLoad:"";if(_.templateSettings={evaluate:/\<\%(.+?)\%\>/g,interpolate:/\<\%=(.+?)\%\>/g,escape:/\<\%-(.+?)\%\>/g},e(".wpsl-gmap-canvas").length&&(e("<img />").attr("src",wpslSettings.url+"img/ajax-loader.gif"),e(".wpsl-gmap-canvas").each(function(s){var o=e(this).attr("id");t(o,s)})),e("#wpsl-result-list").on("click",".wpsl-back",function(){var t,s;for(q.setMap(null),t=0,s=ie.length;s>t;t++)ie[t].setMap(Q);return"undefined"!=typeof se&&""!==se&&se.setMap(Q),te&&P(),Q.setCenter(ae.centerLatlng),Q.setZoom(ae.zoomLevel),e(".wpsl-direction-before, .wpsl-direction-after").remove(),e("#wpsl-stores").show(),e("#wpsl-direction-details").hide(),!1}),e("#wpsl-gmap").length&&("bounce"==wpslSettings.markerEffect?(e("#wpsl-stores").on("mouseenter","li",function(){L(e(this).data("store-id"),"start")}),e("#wpsl-stores").on("mouseleave","li",function(){L(e(this).data("store-id"),"stop")})):"info_window"==wpslSettings.markerEffect&&e("#wpsl-stores").on("mouseenter","li",function(){var t,s;for(t=0,s=ie.length;s>t;t++)ie[t].storeId==e(this).data("store-id")&&(google.maps.event.trigger(ie[t],"click"),Q.setCenter(ie[t].position))})),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters){var we,ge,ue,fe,me;google.maps.event.addListener(Q,"zoom_changed",function(){google.maps.event.addListenerOnce(Q,"idle",function(){if("undefined"!=typeof te&&(we=te.clusters_,we.length))for(fe=0,ge=we.length;ge>fe;fe++)for(me=0,ue=we[fe].markers_.length;ue>me;me++)if(we[fe].markers_[me].storeId==X){ee.getVisible()&&null===we[fe].markers_[me].map?ee.setVisible(!1):ee.getVisible()||null===we[fe].markers_[me].map||ee.setVisible(!0);break}})})}var he={formatPhoneNumber:function(e){return 1==wpslSettings.phoneUrl&&c()&&(e="<a href='tel:"+he.formatClickablePhoneNumber(e)+"'>"+e+"</a>"),e},formatClickablePhoneNumber:function(e){return-1!=e.indexOf("+")&&-1!=e.indexOf("(0)")&&(e=e.replace("(0)","")),e.replace(/(-| |\(|\)|\.|)/g,"")},createInfoWindowActions:function(t){var s,o="",n="";return e("#wpsl-gmap").length&&(de&&(o="<a class='wpsl-streetview' href='#'>"+wpslLabels.streetView+"</a>"),1==wpslSettings.markerZoomTo&&(n="<a class='wpsl-zoom-here' href='#'>"+wpslLabels.zoomHere+"</a>"),s="<div class='wpsl-info-actions'>"+he.createDirectionUrl(t)+o+n+"</div>"),s},createDirectionUrl:function(t){var s,o,n,i={};return 1==wpslSettings.directionRedirect?("undefined"==typeof oe&&(oe=""),i.target="target='_blank'","undefined"!=typeof t?i.src=e("[data-store-id="+t+"] .wpsl-directions").attr("href"):(n=this.zip?this.zip+", ":"",o=this.address+", "+this.city+", "+n+this.country,i.src="https://maps.google.com/maps?saddr="+he.rfc3986EncodeURIComponent(oe)+"&daddr="+he.rfc3986EncodeURIComponent(o))):i={src:"#",target:""},s="<a class='wpsl-directions' "+i.target+" href='"+i.src+"'>"+wpslLabels.directions+"</a>"},rfc3986EncodeURIComponent:function(e){return encodeURIComponent(e).replace(/[!'()*]/g,escape)}};if(e("#wpsl-search-input").keydown(function(t){var s=t.keyCode||t.which;13==s&&e("#wpsl-search-btn").trigger("click")}),e("#wpsl-stores").on("click",".wpsl-store-details",function(){var t,s,o=e(this).parents("li"),n=o.data("store-id");if("info window"==wpslSettings.moreInfoLocation)for(t=0,s=ie.length;s>t;t++)ie[t].storeId==n&&google.maps.event.trigger(ie[t],"click");else o.find(".wpsl-more-info-listings").is(":visible")?e(this).removeClass("wpsl-active-details"):e(this).addClass("wpsl-active-details"),o.siblings().find(".wpsl-store-details").removeClass("wpsl-active-details"),o.siblings().find(".wpsl-more-info-listings").hide(),o.find(".wpsl-more-info-listings").toggle();return"default"!=wpslSettings.templateId||"store listings"==wpslSettings.moreInfoLocation?!1:void 0}),e("a[href='#"+wpslSettings.mapTabAnchor+"']").length){var ve,Se,be=e("a[href='#"+wpslSettings.mapTabAnchor+"']");be.on("click",function(){return setTimeout(function(){ve=Q.getZoom(),Se=Q.getCenter(),google.maps.event.trigger(Q,"resize"),Q.setZoom(ve),Q.setCenter(Se),W()},50),!1})}});
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.paypal.me/tijmensmit
|
|
5 |
Tags: google maps, store locator, business locations, geocoding, stores, geo, zipcode locator, dealer locater, geocode, gmaps, google map, google map plugin, location finder, map tools, shop locator, wp google map
|
6 |
Requires at least: 3.7
|
7 |
Tested up to: 4.4.1
|
8 |
-
Stable tag: 2.1.
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl.html
|
11 |
|
@@ -113,6 +113,12 @@ If you find a plugin or theme that causes a conflict, please report it on the [s
|
|
113 |
|
114 |
== Changelog ==
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
= 2.1.1, January 13, 2016 =
|
117 |
* Added: Restrict the search results to one or more categories by using the "category" attribute on the [wpsl] [shortcode](https://wpstorelocator.co/document/shortcodes/#store-locator).
|
118 |
* Added: A "start_location" attribute for the [wpsl] [shortcode](https://wpstorelocator.co/document/shortcodes/#store-locator).
|
5 |
Tags: google maps, store locator, business locations, geocoding, stores, geo, zipcode locator, dealer locater, geocode, gmaps, google map, google map plugin, location finder, map tools, shop locator, wp google map
|
6 |
Requires at least: 3.7
|
7 |
Tested up to: 4.4.1
|
8 |
+
Stable tag: 2.1.2
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl.html
|
11 |
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
+
= 2.1.2, March 4, 2016 =
|
117 |
+
* Fixed: Invalid HTML in the category dropdown.
|
118 |
+
* Fixed: Clicking on the marker on a single store / [wpsl_map] page triggered a JS error if the location permalinks are enabled.
|
119 |
+
* Fixed: The wpsl_map_tab_anchor filter not working with the [wpsl_map] shortcode.
|
120 |
+
* Fixed: Compatibility [issue](https://make.wordpress.org/core/2016/02/17/backbone-and-underscore-updated-to-latest-versions/) with Underscore 1.8.3.
|
121 |
+
|
122 |
= 2.1.1, January 13, 2016 =
|
123 |
* Added: Restrict the search results to one or more categories by using the "category" attribute on the [wpsl] [shortcode](https://wpstorelocator.co/document/shortcodes/#store-locator).
|
124 |
* Added: A "start_location" attribute for the [wpsl] [shortcode](https://wpstorelocator.co/document/shortcodes/#store-locator).
|
wp-store-locator.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Store Locator
|
|
4 |
Description: An easy to use location management system that enables users to search for nearby physical stores
|
5 |
Author: Tijmen Smit
|
6 |
Author URI: https://wpstorelocator.co/
|
7 |
-
Version: 2.1.
|
8 |
Text Domain: wpsl
|
9 |
Domain Path: /languages/
|
10 |
License: GPL v3
|
@@ -58,7 +58,7 @@ if ( !class_exists( 'WP_Store_locator' ) ) {
|
|
58 |
public function define_constants() {
|
59 |
|
60 |
if ( !defined( 'WPSL_VERSION_NUM' ) )
|
61 |
-
define( 'WPSL_VERSION_NUM', '2.1.
|
62 |
|
63 |
if ( !defined( 'WPSL_URL' ) )
|
64 |
define( 'WPSL_URL', plugin_dir_url( __FILE__ ) );
|
4 |
Description: An easy to use location management system that enables users to search for nearby physical stores
|
5 |
Author: Tijmen Smit
|
6 |
Author URI: https://wpstorelocator.co/
|
7 |
+
Version: 2.1.2
|
8 |
Text Domain: wpsl
|
9 |
Domain Path: /languages/
|
10 |
License: GPL v3
|
58 |
public function define_constants() {
|
59 |
|
60 |
if ( !defined( 'WPSL_VERSION_NUM' ) )
|
61 |
+
define( 'WPSL_VERSION_NUM', '2.1.2' );
|
62 |
|
63 |
if ( !defined( 'WPSL_URL' ) )
|
64 |
define( 'WPSL_URL', plugin_dir_url( __FILE__ ) );
|