WP Store Locator - Version 2.0.3

Version Description

Download this release

Release Info

Developer tijmensmit
Plugin Icon 128x128 WP Store Locator
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.3

admin/class-settings.php CHANGED
@@ -158,11 +158,9 @@ if ( !class_exists( 'WPSL_Settings' ) ) {
158
  }
159
 
160
  $output['streetview'] = isset( $_POST['wpsl_map']['streetview'] ) ? 1 : 0;
161
- $output['pan_controls'] = isset( $_POST['wpsl_map']['pan_controls'] ) ? 1 : 0;
162
  $output['type_control'] = isset( $_POST['wpsl_map']['type_control'] ) ? 1 : 0;
163
  $output['scrollwheel'] = isset( $_POST['wpsl_map']['scrollwheel'] ) ? 1 : 0;
164
  $output['control_position'] = ( $_POST['wpsl_map']['control_position'] == 'left' ) ? 'left' : 'right';
165
- $output['control_style'] = ( $_POST['wpsl_map']['control_style'] == 'small' ) ? 'small' : 'large';
166
 
167
  $output['map_style'] = json_encode( strip_tags( trim( $_POST['wpsl_map']['map_style'] ) ) );
168
 
158
  }
159
 
160
  $output['streetview'] = isset( $_POST['wpsl_map']['streetview'] ) ? 1 : 0;
 
161
  $output['type_control'] = isset( $_POST['wpsl_map']['type_control'] ) ? 1 : 0;
162
  $output['scrollwheel'] = isset( $_POST['wpsl_map']['scrollwheel'] ) ? 1 : 0;
163
  $output['control_position'] = ( $_POST['wpsl_map']['control_position'] == 'left' ) ? 'left' : 'right';
 
164
 
165
  $output['map_style'] = json_encode( strip_tags( trim( $_POST['wpsl_map']['map_style'] ) ) );
166
 
admin/templates/map-settings.php CHANGED
@@ -111,10 +111,6 @@
111
  <label for="wpsl-streetview"><?php _e( 'Show the street view controls?', 'wpsl' ); ?></label>
112
  <input type="checkbox" value="" <?php checked( $wpsl_settings['streetview'], true ); ?> name="wpsl_map[streetview]" id="wpsl-streetview">
113
  </p>
114
- <p>
115
- <label for="wpsl-pan-controls"><?php _e( 'Show the pan controls?', 'wpsl' ); ?></label>
116
- <input type="checkbox" value="" <?php checked( $wpsl_settings['pan_controls'], true ); ?> name="wpsl_map[pan_controls]" id="wpsl-pan-controls">
117
- </p>
118
  <p>
119
  <label for="wpsl-type-control"><?php _e( 'Show the map type control?', 'wpsl' ); ?></label>
120
  <input type="checkbox" value="" <?php checked( $wpsl_settings['type_control'], true ); ?> name="wpsl_map[type_control]" id="wpsl-type-control">
@@ -132,15 +128,6 @@
132
  <label for="wpsl-control-right"><?php _e( 'Right', 'wpsl' ); ?></label>
133
  </span>
134
  </p>
135
- <p>
136
- <label><?php _e( 'Zoom control style', 'wpsl' ); ?>:</label>
137
- <span class="wpsl-radioboxes">
138
- <input type="radio" autocomplete="off" value="small" <?php checked( 'small', $wpsl_settings['control_style'], true ); ?> name="wpsl_map[control_style]" id="wpsl-small-style">
139
- <label for="wpsl-small-style"><?php _e( 'Small', 'wpsl' ); ?></label>
140
- <input type="radio" autocomplete="off" value="large" <?php checked( 'large', $wpsl_settings['control_style'], true ); ?> name="wpsl_map[control_style]" id="wpsl-large-style">
141
- <label for="wpsl-large-style"><?php _e( 'Large', 'wpsl' ); ?></label>
142
- </span>
143
- </p>
144
  <p>
145
  <label for="wpsl-map-type"><?php _e( 'Map type', 'wpsl' ); ?>:</label>
146
  <?php echo $wpsl_admin->settings_page->create_dropdown( 'map_types' ); ?>
111
  <label for="wpsl-streetview"><?php _e( 'Show the street view controls?', 'wpsl' ); ?></label>
112
  <input type="checkbox" value="" <?php checked( $wpsl_settings['streetview'], true ); ?> name="wpsl_map[streetview]" id="wpsl-streetview">
113
  </p>
 
 
 
 
114
  <p>
115
  <label for="wpsl-type-control"><?php _e( 'Show the map type control?', 'wpsl' ); ?></label>
116
  <input type="checkbox" value="" <?php checked( $wpsl_settings['type_control'], true ); ?> name="wpsl_map[type_control]" id="wpsl-type-control">
128
  <label for="wpsl-control-right"><?php _e( 'Right', 'wpsl' ); ?></label>
129
  </span>
130
  </p>
 
 
 
 
 
 
 
 
 
131
  <p>
132
  <label for="wpsl-map-type"><?php _e( 'Map type', 'wpsl' ); ?>:</label>
133
  <?php echo $wpsl_admin->settings_page->create_dropdown( 'map_types' ); ?>
admin/upgrade.php CHANGED
@@ -310,7 +310,7 @@ function wpsl_check_upgrade() {
310
  /* Change the template ids from number based to name based */
311
  if ( is_numeric( $wpsl_settings['template_id'] ) ) {
312
  $wpsl_settings['template_id'] = ( !$wpsl_settings['template_id'] ) ? 'default' : 'below_map';
313
- }
314
 
315
  $replace_data = array(
316
  'max_results' => $wpsl_settings['max_results'],
@@ -346,11 +346,22 @@ function wpsl_check_upgrade() {
346
  if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpsl_table'" ) && version_compare( $current_version, '1.9', '<' ) ) {
347
  if ( wpsl_remaining_cpt_count() ) {
348
  update_option( 'wpsl_convert_cpt', 'in_progress' );
349
- }
350
  }
351
  }
352
  }
353
 
 
 
 
 
 
 
 
 
 
 
 
354
  update_option( 'wpsl_version', WPSL_VERSION_NUM );
355
  }
356
 
310
  /* Change the template ids from number based to name based */
311
  if ( is_numeric( $wpsl_settings['template_id'] ) ) {
312
  $wpsl_settings['template_id'] = ( !$wpsl_settings['template_id'] ) ? 'default' : 'below_map';
313
+ }
314
 
315
  $replace_data = array(
316
  'max_results' => $wpsl_settings['max_results'],
346
  if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpsl_table'" ) && version_compare( $current_version, '1.9', '<' ) ) {
347
  if ( wpsl_remaining_cpt_count() ) {
348
  update_option( 'wpsl_convert_cpt', 'in_progress' );
349
+ }
350
  }
351
  }
352
  }
353
 
354
+ /*
355
+ * Both map options are no longer supported in 3.22 of the Google Maps API.
356
+ * See: https://developers.google.com/maps/articles/v322-controls-diff
357
+ */
358
+ if ( version_compare( $current_version, '2.0.3', '<' ) ) {
359
+ unset( $wpsl_settings['control_style'] );
360
+ unset( $wpsl_settings['pan_controls'] );
361
+
362
+ update_option( 'wpsl_settings', $wpsl_settings );
363
+ }
364
+
365
  update_option( 'wpsl_version', WPSL_VERSION_NUM );
366
  }
367
 
css/styles.css CHANGED
@@ -71,13 +71,19 @@ div elements, we disable it to prevent it from messing up the map
71
 
72
  /* Map Controls */
73
  #wpsl-gmap #wpsl-map-controls {
74
- position: absolute;
75
- right: 5px;
76
- bottom: 20px;
77
- border-radius: 3px;
 
78
  z-index: 3;
79
  font-size: 11px;
80
  white-space: nowrap;
 
 
 
 
 
81
  }
82
 
83
  #wpsl-map-controls .wpsl-direction-preloader {
@@ -86,8 +92,8 @@ div elements, we disable it to prevent it from messing up the map
86
 
87
  #wpsl-map-controls div {
88
  float: left;
89
- background: #fff;
90
- border-radius: 3px;
91
  }
92
 
93
  #wpsl-map-controls div:hover {
@@ -98,14 +104,14 @@ div elements, we disable it to prevent it from messing up the map
98
  #wpsl-wrap [class*=" wpsl-icon-"] {
99
  position: relative;
100
  float: left;
101
- padding: 5px 7px;
102
  display: inline-block;
103
  font-family: "wpsl-fontello";
104
  font-style: normal;
105
  font-weight: normal;
106
  font-size: 1.3em;
107
- color: #7c7c7c;
108
- speak: none;
109
  text-decoration: inherit;
110
  text-align: center;
111
  font-variant: normal;
@@ -115,10 +121,19 @@ div elements, we disable it to prevent it from messing up the map
115
  -moz-osx-font-smoothing: grayscale;
116
  }
117
 
 
 
 
 
 
 
 
 
 
118
  /* Fix the padding for the icon fonts in IE 8-11 :( */
119
  #wpsl-wrap .wpsl-ie [class^="wpsl-icon-"],
120
  #wpsl-wrap .wpsl-ie [class*=" wpsl-icon-"] {
121
- padding: 8px 8px 4px 8px;
122
  }
123
 
124
  /* Make the clickable area bigger for the buttons on mobile devices */
@@ -128,20 +143,18 @@ div elements, we disable it to prevent it from messing up the map
128
  }
129
 
130
  #wpsl-wrap .wpsl-icon-reset {
131
- /* display: none;*/
132
- border: 1px solid #ccc;
133
- border-radius: 3px 0 0 3px;
134
  z-index: 2;
 
 
135
  }
136
 
137
  #wpsl-wrap .wpsl-icon-direction {
138
- border: 1px solid #ccc;
139
  z-index: 1;
140
  }
141
 
142
- #wpsl-wrap .wpsl-reset-exists {
143
- border-radius: 0 3px 3px 0;
144
- border-left: 0;
145
  }
146
 
147
  #wpsl-wrap .wpsl-active-icon,
@@ -170,7 +183,7 @@ div elements, we disable it to prevent it from messing up the map
170
  background: #fff !important;
171
  background-clip: padding-box;
172
  border: 1px solid rgba(0, 0, 0, 0.15);
173
- border-radius: 3px;
174
  z-index: 3;
175
  }
176
 
71
 
72
  /* Map Controls */
73
  #wpsl-gmap #wpsl-map-controls {
74
+ position: absolute;
75
+ height: 28px;
76
+ right: 10px;
77
+ bottom: 24px;
78
+ border-radius: 2px;
79
  z-index: 3;
80
  font-size: 11px;
81
  white-space: nowrap;
82
+ overflow: hidden;
83
+ }
84
+
85
+ #wpsl-gmap #wpsl-map-controls.wpsl-street-view-exists {
86
+ right: 48px;
87
  }
88
 
89
  #wpsl-map-controls .wpsl-direction-preloader {
92
 
93
  #wpsl-map-controls div {
94
  float: left;
95
+ background: #fff;
96
+ border-radius: 2px;
97
  }
98
 
99
  #wpsl-map-controls div:hover {
104
  #wpsl-wrap [class*=" wpsl-icon-"] {
105
  position: relative;
106
  float: left;
107
+ padding: 7px 9px 7px 8px;
108
  display: inline-block;
109
  font-family: "wpsl-fontello";
110
  font-style: normal;
111
  font-weight: normal;
112
  font-size: 1.3em;
113
+ color: #737373;
114
+ speak: none;
115
  text-decoration: inherit;
116
  text-align: center;
117
  font-variant: normal;
121
  -moz-osx-font-smoothing: grayscale;
122
  }
123
 
124
+ /*
125
+ * Make sure the CSS from a theme doesn't set a different font family, or font size
126
+ * for the font icons. Otherwise the icons either don't show, or are to large.
127
+ */
128
+ #wpsl-map-controls span {
129
+ font-family: inherit;
130
+ font-size: inherit;
131
+ }
132
+
133
  /* Fix the padding for the icon fonts in IE 8-11 :( */
134
  #wpsl-wrap .wpsl-ie [class^="wpsl-icon-"],
135
  #wpsl-wrap .wpsl-ie [class*=" wpsl-icon-"] {
136
+ padding: 9px 8px 4px 8px;
137
  }
138
 
139
  /* Make the clickable area bigger for the buttons on mobile devices */
143
  }
144
 
145
  #wpsl-wrap .wpsl-icon-reset {
146
+ border-radius: 2px 0 0 2px;
 
 
147
  z-index: 2;
148
+ padding-left: 9px;
149
+ padding-right: 4px;
150
  }
151
 
152
  #wpsl-wrap .wpsl-icon-direction {
 
153
  z-index: 1;
154
  }
155
 
156
+ #wpsl-map-controls.wpsl-reset-exists .wpsl-icon-direction {
157
+ border-radius: 0 2px 2px 0;
 
158
  }
159
 
160
  #wpsl-wrap .wpsl-active-icon,
183
  background: #fff !important;
184
  background-clip: padding-box;
185
  border: 1px solid rgba(0, 0, 0, 0.15);
186
+ border-radius: 2px;
187
  z-index: 3;
188
  }
189
 
css/styles.min.css CHANGED
@@ -1 +1 @@
1
- #wpsl-result-list a,#wpsl-wrap [class*=" wpsl-icon-"]:focus,#wpsl-wrap [class^=wpsl-icon-]:active{outline:0}#wpsl-map-controls div:hover,#wpsl-reset-map:hover,#wpsl-search-btn:hover,.wpsl-dropdown{cursor:pointer}#wpsl-wrap,.wpsl-clearfix:after,.wpsl-contact-details{clear:both}@font-face{font-family:wpsl-fontello;src:url(../font/fontello.eot?28897909);src:url(../font/fontello.eot?28897909#iefix) format('embedded-opentype'),url(../font/fontello.woff?28897909) format('woff'),url(../font/fontello.ttf?28897909) format('truetype'),url(../font/fontello.svg?28897909#fontello) format('svg');font-weight:400;font-style:normal}#wpsl-gmap{float:right;width:66.5%;height:350px;margin-bottom:0}.wpsl-store-below #wpsl-gmap{float:none;width:100%}.wpsl-gmap-canvas{width:100%;height:300px;margin-bottom:20px}.gm-style-mtc,.gmnoprint{z-index:9999!important}#wpsl-gmap div,#wpsl-gmap img,.wpsl-gmap-canvas div,.wpsl-gmap-canvas img{box-shadow:none!important;max-width:none!important;background:0 0}#wpsl-gmap img,.wpsl-gmap-canvas img{display:inline!important;opacity:1!important;max-height:none!important}#wpsl-wrap{width:100%;overflow:hidden;margin-bottom:20px}#wpsl-search-wrap{float:left;width:100%}#wpsl-gmap #wpsl-map-controls{position:absolute;right:5px;bottom:20px;border-radius:3px;z-index:3;font-size:11px;white-space:nowrap}#wpsl-map-controls .wpsl-direction-preloader{margin:5px 5px 0}#wpsl-map-controls div{float:left;background:#fff;border-radius:3px}#wpsl-wrap [class*=" wpsl-icon-"],#wpsl-wrap [class^=wpsl-icon-]{position:relative;float:left;padding:5px 7px;display:inline-block;font-family:wpsl-fontello;font-style:normal;font-weight:400;font-size:1.3em;color:#7c7c7c;speak:none;text-decoration:inherit;text-align:center;font-variant:normal;text-transform:none;line-height:1em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#wpsl-wrap .wpsl-ie [class*=" wpsl-icon-"],#wpsl-wrap .wpsl-ie [class^=wpsl-icon-]{padding:8px 8px 4px}#wpsl-wrap.wpsl-mobile [class*=" wpsl-icon-"],#wpsl-wrap.wpsl-mobile [class^=wpsl-icon-]{padding:8px 10px}#wpsl-wrap .wpsl-icon-reset{border:1px solid #ccc;border-radius:3px 0 0 3px;z-index:2}#wpsl-wrap .wpsl-icon-direction{border:1px solid #ccc;z-index:1}#wpsl-wrap .wpsl-reset-exists{border-radius:0 3px 3px 0;border-left:0}#wpsl-wrap .wpsl-active-icon,#wpsl-wrap [class*=" wpsl-icon-"]:hover,#wpsl-wrap [class^=wpsl-icon-]:hover{color:#000}#wpsl-wrap .wpsl-in-progress,#wpsl-wrap .wpsl-in-progress:hover{color:#c6c6c6}#wpsl-gmap #wpsl-reset-map{position:absolute;display:none;right:37px;top:37px;padding:6px 14px;background:#fff!important;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:3px;z-index:3}.gm-style-cc{word-wrap:normal}#wpsl-search-wrap .wpsl-input,#wpsl-search-wrap .wpsl-select-wrap{display:table}#wpsl-search-btn,#wpsl-search-wrap #wpsl-radius,#wpsl-search-wrap #wpsl-results,#wpsl-search-wrap .wpsl-input input,#wpsl-search-wrap .wpsl-input label{display:table-cell}#wpsl-search-wrap label{margin-bottom:0}#wpsl-search-input{width:179px;height:auto;padding:7px 12px;font-size:100%;margin:0}#wpsl-search-btn,#wpsl-search-wrap input{border:1px solid #d2d2d2;border-radius:3px}#wpsl-search-btn{padding:7px 10px;line-height:1.428571429;font-weight:400;color:#7c7c7c;background-color:#e6e6e6;background-repeat:repeat-x;background-image:-moz-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-ms-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-webkit-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-o-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:linear-gradient(top,#f4f4f4,#e6e6e6);box-shadow:0 1px 2px rgba(64,64,64,.1);text-transform:none!important}#wpsl-search-input.wpsl-error{border:1px solid #bd0028!important}.wpsl-search{margin-bottom:12px;padding:12px 12px 0;background:#f4f3f3}.wpsl-back{display:inline-block}#wpsl-result-list{width:33%;margin-right:.5%}.wpsl-store-below #wpsl-result-list{width:100%;margin:12px 0 0}#wpsl-direction-details,#wpsl-stores{height:350px;overflow-y:auto}#wpsl-direction-details,.wpsl-hide{display:none}#wpsl-result-list p{padding-left:10px}.wpsl-store-below #wpsl-result-list p{padding-left:0}.wpsl-direction-before{margin:14px 0 21px;padding-left:10px}.wpsl-store-below .wpsl-direction-before{padding-left:0}.wpsl-direction-before div{margin-top:10px}#wpsl-wrap #wpsl-result-list li{padding:10px;border-bottom:1px dotted #ccc;margin-left:0;overflow:hidden;list-style:none!important;text-indent:0}#wpsl-wrap.wpsl-store-below #wpsl-result-list li{padding:10px 10px 10px 0}#wpsl-result-list li p{padding-left:0;margin:0 0 20px}.wpsl-store-details.wpsl-store-listing{position:relative;padding-right:20px}.wpsl-store-details.wpsl-store-listing.wpsl-active-details:before,.wpsl-store-details.wpsl-store-listing:before{position:absolute;content:'';bottom:6px;right:0;border-top:5px solid #000;border-left:6px solid transparent;border-right:6px solid transparent}.wpsl-store-details.wpsl-store-listing.wpsl-active-details:before{border-bottom:5px solid #000;border-top:none;border-left:6px solid transparent;border-right:6px solid transparent}#wpsl-stores .wpsl-store-thumb{float:right;border-radius:3px;margin:7px 0 0 10px;padding:0;border:none}.wpsl-direction-index{float:left;width:8%;margin:0 5% 0 0}.wpsl-direction-txt{float:left;width:62%}.wpsl-direction-distance{float:left;width:20%;margin:0 0 0 5%}.wpsl-direction-txt span{display:block;margin-top:10px}.wpsl-country,.wpsl-directions,.wpsl-street{display:block;border-bottom:none!important}#wpsl-wrap #wpsl-result-list li.wpsl-preloader{position:relative;border-bottom:none;padding:10px 10px 10px 35px}.wpsl-preloader img{position:absolute;left:10px;top:50%;margin-top:-8px;box-shadow:none!important;border:none!important}.wpsl-preloader span{float:left;margin:-5px 0 0 11px}#wpsl-search-btn,#wpsl-search-wrap div{margin-right:10px;float:left}#wpsl-search-wrap .wpsl-select-wrap{position:relative;z-index:2;margin-right:0}#wpsl-search-wrap .wpsl-input-field{position:relative}#wpsl-radius,#wpsl-results{float:left;margin-right:15px;display:inline}#wpsl-category{z-index:1;clear:both}#wpsl-search-wrap .wpsl-dropdown div{position:absolute;float:none;margin:-1px 0 0;top:100%;left:-1px;right:-1px;border:1px solid #ccc;background:#fff;border-top:1px solid #eee;border-radius:0 0 3px 3px;opacity:0;overflow:hidden;-webkit-transition:all 150ms ease-in-out;-moz-transition:all 150ms ease-in-out;-ms-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out}#wpsl-search-wrap .wpsl-dropdown.wpsl-active div{opacity:1}#wpsl-search-wrap .wpsl-input label{margin-right:0}#wpsl-radius{margin-right:10px}#wpsl-search select,#wpsl-search-wrap select,.wpsl-direction-details{display:none}#wpsl-search-wrap div label{float:left;margin-right:10px;line-height:32px}#wpsl-results label{width:auto}#wpsl-result-list ul{list-style:none;margin:0;padding:0}#wpsl-gmap .wpsl-info-window,.wpsl-gmap-canvas .wpsl-info-window{max-width:225px}.wpsl-info-window span,.wpsl-more-info-listings span{display:block}.wpsl-info-window .wpsl-no-margin{margin:0}.wpsl-more-info-listings{display:none}.wpsl-info-window span span{display:inline!important}#wpsl-wrap .wpsl-info-window p{margin:0 0 10px}.wpsl-store-hours{margin-top:10px}.wpsl-store-hours strong{display:block}#wpsl-gmap .wpsl-info-actions{display:block;margin:10px 0!important}.wpsl-info-actions a{float:left;margin-right:7px}.wpsl-info-actions .wpsl-zoom-here{margin-right:0}.wpsl-dropdown{position:relative;width:90px;border:1px solid #ccc;background:#fff;border-radius:3px;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-right:0!important;z-index:2}#wpsl-results .wpsl-dropdown{width:70px}.wpsl-dropdown ul{position:absolute;left:0;width:100%;height:100%;padding:0!important;margin:0!important;list-style:none;overflow:hidden}.wpsl-dropdown:hover{box-shadow:0 0 5px rgba(0,0,0,.15)}.wpsl-dropdown .wpsl-selected-item,.wpsl-dropdown li{position:relative;display:block;line-height:1;color:#000;overflow:hidden;white-space:nowrap}.wpsl-selected-item:after{position:absolute;content:"";right:12px;top:50%;margin-top:-4px;border:6px solid transparent;border-top:8px solid #000}.wpsl-active .wpsl-selected-item:after{margin-top:-10px;border:6px solid transparent;border-bottom:8px solid #000}.wpsl-dropdown li:hover{background:#f8f9f8;position:relative;z-index:3;color:#000}.wpsl-dropdown .wpsl-selected-item,.wpsl-dropdown li,.wpsl-selected-item{list-style:none;padding:9px 12px!important;margin:0!important}.wpsl-selected-dropdown{font-weight:700}.wpsl-clearfix:after,.wpsl-clearfix:before{content:" ";display:table}#wpsl-wrap .wpsl-selected-item{position:static;padding-right:35px!important}#wpsl-category,.wpsl-input,.wpsl-select-wrap{position:relative;margin-bottom:10px}.wpsl-provided-by{float:right;padding:5px 0;text-align:right;font-size:12px;width:100%}#wpsl-wrap .wpsl-results-only label{width:auto}.wpsl-contact-details,.wpsl-location-address,.wpsl-locations-details{margin-bottom:15px}table.wpsl-opening-hours td{vertical-align:top;padding:0 15px 0 0;text-align:left}#wpsl-stores .wpsl-contact-details span,.wpsl_stores .wpsl-contact-details span,table.wpsl-opening-hours time{display:block}table.wpsl-opening-hours{width:auto!important;font-size:100%!important}table.wpsl-opening-hours,table.wpsl-opening-hours td{border:none!important}.wpsl-gmap-canvas .wpsl-infobox{min-width:155px;max-width:350px!important;padding:10px;border-radius:4px;font-size:13px;font-weight:300;border:1px solid #ccc;background:#fff!important}.wpsl-gmap-canvas .wpsl-infobox:after,.wpsl-gmap-canvas .wpsl-infobox:before{position:absolute;content:"";left:40px;bottom:-11px}.wpsl-gmap-canvas .wpsl-infobox:after{border-left:11px solid transparent;border-right:11px solid transparent;border-top:11px solid #fff}.wpsl-gmap-canvas .wpsl-infobox:before{border-left:13px solid transparent;border-right:13px solid transparent;border-top:13px solid #ccc;bottom:-13px;left:38px}@media (max-width:825px){#wpsl-search-input{width:348px}.wpsl-results-only #wpsl-search-wrap .wpsl-dropdown{width:70px}#wpsl-search-wrap .wpsl-input{width:100%;margin-bottom:10px}#wpsl-category label,#wpsl-radius label,.wpsl-cat-results-filter #wpsl-search-wrap .wpsl-input,.wpsl-input label,.wpsl-no-filters #wpsl-search-wrap .wpsl-input,.wpsl-results-only #wpsl-search-wrap .wpsl-input{width:auto}}@media (max-width:720px){#wpsl-search-wrap .wpsl-dropdown{width:114px}}@media (max-width:675px){#wpsl-search-wrap #wpsl-search-btn{float:left;margin:0 5px 0 0}.wpsl-dropdown,.wpsl-results-only #wpsl-search-wrap .wpsl-input{width:100%}.wpsl-search{padding:2%}#wpsl-result-list p,#wpsl-wrap #wpsl-result-list li,.wpsl-direction-before{padding-left:0}.wpsl-input{margin-right:0}#wpsl-gmap,#wpsl-result-list{float:none;width:100%}#wpsl-gmap{margin-bottom:15px;margin-top:10px}#wpsl-result-list,.wpsl-cat-results-filter .wpsl-select-wrap,.wpsl-filter .wpsl-select-wrap{margin-bottom:10px}#wpsl-wrap #wpsl-result-list li.wpsl-preloader{padding-left:25px}.wpsl-preloader img{left:0}#wpsl-stores.wpsl-not-loaded{height:25px}#wpsl-reset-map{top:25px}#wpsl-category,#wpsl-search-btn,.wpsl-input,.wpsl-no-filters #wpsl-search-wrap .wpsl-input,.wpsl-select-wrap{margin-bottom:0}#wpsl-stores.wpsl-no-autoload{height:auto!important}}@media (max-width:570px){#wpsl-search-wrap #wpsl-search-btn{margin-bottom:5px}.wpsl-search{padding:4%}#wpsl-search-input{width:98%!important}.wpsl-cat-results-filter #wpsl-search-input,.wpsl-cat-results-filter #wpsl-search-wrap .wpsl-input,.wpsl-no-results #wpsl-search-input,.wpsl-results-only #wpsl-search-input{width:100%!important}.wpsl-search-btn-wrap{margin-top:15px;clear:both}#wpsl-search-btn,#wpsl-search-wrap div{margin-right:0}#wpsl-search-wrap div label{display:block;width:100%}.wpsl-select-wrap{width:100%}#wpsl-radius,#wpsl-results{width:50%}#wpsl-radius{margin-right:4%}#wpsl-search-wrap .wpsl-dropdown{width:96%!important}.wpsl-no-filters #wpsl-search-input,.wpsl-no-filters #wpsl-search-wrap .wpsl-input{width:100%!important}}
1
+ #wpsl-wrap,.wpsl-gmap-canvas{margin-bottom:20px;width:100%}#wpsl-result-list a,#wpsl-wrap [class*=" wpsl-icon-"]:focus,#wpsl-wrap [class^=wpsl-icon-]:active{outline:0}#wpsl-map-controls div:hover,#wpsl-reset-map:hover,#wpsl-search-btn:hover,.wpsl-dropdown{cursor:pointer}#wpsl-wrap,.wpsl-clearfix:after,.wpsl-contact-details{clear:both}@font-face{font-family:wpsl-fontello;src:url(../font/fontello.eot?28897909);src:url(../font/fontello.eot?28897909#iefix) format('embedded-opentype'),url(../font/fontello.woff?28897909) format('woff'),url(../font/fontello.ttf?28897909) format('truetype'),url(../font/fontello.svg?28897909#fontello) format('svg');font-weight:400;font-style:normal}#wpsl-gmap{float:right;width:66.5%;height:350px;margin-bottom:0}.wpsl-store-below #wpsl-gmap{float:none;width:100%}.wpsl-gmap-canvas{height:300px}.gm-style-mtc,.gmnoprint{z-index:9999!important}#wpsl-gmap div,#wpsl-gmap img,.wpsl-gmap-canvas div,.wpsl-gmap-canvas img{box-shadow:none!important;max-width:none!important;background:0 0}#wpsl-gmap img,.wpsl-gmap-canvas img{display:inline!important;opacity:1!important;max-height:none!important}#wpsl-wrap{overflow:hidden}#wpsl-search-wrap{float:left;width:100%}#wpsl-gmap #wpsl-map-controls{position:absolute;height:28px;right:10px;bottom:24px;border-radius:2px;z-index:3;font-size:11px;white-space:nowrap;overflow:hidden}#wpsl-gmap #wpsl-map-controls.wpsl-street-view-exists{right:48px}#wpsl-map-controls .wpsl-direction-preloader{margin:5px 5px 0}#wpsl-map-controls div{float:left;background:#fff;border-radius:2px}#wpsl-wrap [class*=" wpsl-icon-"],#wpsl-wrap [class^=wpsl-icon-]{position:relative;float:left;padding:7px 9px 7px 8px;display:inline-block;font-family:wpsl-fontello;font-style:normal;font-weight:400;font-size:1.3em;color:#737373;speak:none;text-decoration:inherit;text-align:center;font-variant:normal;text-transform:none;line-height:1em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#wpsl-map-controls span{font-family:inherit;font-size:inherit}#wpsl-wrap .wpsl-ie [class*=" wpsl-icon-"],#wpsl-wrap .wpsl-ie [class^=wpsl-icon-]{padding:9px 8px 4px}#wpsl-wrap.wpsl-mobile [class*=" wpsl-icon-"],#wpsl-wrap.wpsl-mobile [class^=wpsl-icon-]{padding:8px 10px}#wpsl-wrap .wpsl-icon-reset{border-radius:2px 0 0 2px;z-index:2;padding-left:9px;padding-right:4px}#wpsl-wrap .wpsl-icon-direction{z-index:1}#wpsl-map-controls.wpsl-reset-exists .wpsl-icon-direction{border-radius:0 2px 2px 0}#wpsl-wrap .wpsl-active-icon,#wpsl-wrap [class*=" wpsl-icon-"]:hover,#wpsl-wrap [class^=wpsl-icon-]:hover{color:#000}#wpsl-wrap .wpsl-in-progress,#wpsl-wrap .wpsl-in-progress:hover{color:#c6c6c6}#wpsl-gmap #wpsl-reset-map{position:absolute;display:none;right:37px;top:37px;padding:6px 14px;background:#fff!important;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:2px;z-index:3}.gm-style-cc{word-wrap:normal}#wpsl-search-wrap .wpsl-input,#wpsl-search-wrap .wpsl-select-wrap{display:table}#wpsl-search-btn,#wpsl-search-wrap #wpsl-radius,#wpsl-search-wrap #wpsl-results,#wpsl-search-wrap .wpsl-input input,#wpsl-search-wrap .wpsl-input label{display:table-cell}#wpsl-search-wrap label{margin-bottom:0}#wpsl-search-input{width:179px;height:auto;padding:7px 12px;font-size:100%;margin:0}#wpsl-search-btn,#wpsl-search-wrap input{border:1px solid #d2d2d2;border-radius:3px}#wpsl-search-btn{padding:7px 10px;line-height:1.428571429;font-weight:400;color:#7c7c7c;background-color:#e6e6e6;background-repeat:repeat-x;background-image:-moz-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-ms-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-webkit-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-o-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:linear-gradient(top,#f4f4f4,#e6e6e6);box-shadow:0 1px 2px rgba(64,64,64,.1);text-transform:none!important}#wpsl-search-input.wpsl-error{border:1px solid #bd0028!important}.wpsl-search{margin-bottom:12px;padding:12px 12px 0;background:#f4f3f3}.wpsl-back{display:inline-block}#wpsl-result-list{width:33%;margin-right:.5%}.wpsl-store-below #wpsl-result-list{width:100%;margin:12px 0 0}#wpsl-direction-details,#wpsl-stores{height:350px;overflow-y:auto}#wpsl-direction-details,.wpsl-hide{display:none}#wpsl-result-list p{padding-left:10px}.wpsl-store-below #wpsl-result-list p{padding-left:0}.wpsl-direction-before{margin:14px 0 21px;padding-left:10px}.wpsl-store-below .wpsl-direction-before{padding-left:0}.wpsl-direction-before div{margin-top:10px}#wpsl-wrap #wpsl-result-list li{padding:10px;border-bottom:1px dotted #ccc;margin-left:0;overflow:hidden;list-style:none!important;text-indent:0}#wpsl-wrap.wpsl-store-below #wpsl-result-list li{padding:10px 10px 10px 0}#wpsl-result-list li p{padding-left:0;margin:0 0 20px}.wpsl-store-details.wpsl-store-listing{position:relative;padding-right:20px}.wpsl-store-details.wpsl-store-listing.wpsl-active-details:before,.wpsl-store-details.wpsl-store-listing:before{position:absolute;content:'';bottom:6px;right:0;border-top:5px solid #000;border-left:6px solid transparent;border-right:6px solid transparent}.wpsl-store-details.wpsl-store-listing.wpsl-active-details:before{border-bottom:5px solid #000;border-top:none;border-left:6px solid transparent;border-right:6px solid transparent}#wpsl-stores .wpsl-store-thumb{float:right;border-radius:3px;margin:7px 0 0 10px;padding:0;border:none}.wpsl-direction-index{float:left;width:8%;margin:0 5% 0 0}.wpsl-direction-txt{float:left;width:62%}.wpsl-direction-distance{float:left;width:20%;margin:0 0 0 5%}.wpsl-direction-txt span{display:block;margin-top:10px}.wpsl-country,.wpsl-directions,.wpsl-street{display:block;border-bottom:none!important}#wpsl-wrap #wpsl-result-list li.wpsl-preloader{position:relative;border-bottom:none;padding:10px 10px 10px 35px}.wpsl-preloader img{position:absolute;left:10px;top:50%;margin-top:-8px;box-shadow:none!important;border:none!important}.wpsl-preloader span{float:left;margin:-5px 0 0 11px}#wpsl-search-btn,#wpsl-search-wrap div{margin-right:10px;float:left}#wpsl-search-wrap .wpsl-select-wrap{position:relative;z-index:2;margin-right:0}#wpsl-search-wrap .wpsl-input-field{position:relative}#wpsl-radius,#wpsl-results{float:left;margin-right:15px;display:inline}#wpsl-category{z-index:1;clear:both}#wpsl-search-wrap .wpsl-dropdown div{position:absolute;float:none;margin:-1px 0 0;top:100%;left:-1px;right:-1px;border:1px solid #ccc;background:#fff;border-top:1px solid #eee;border-radius:0 0 3px 3px;opacity:0;overflow:hidden;-webkit-transition:all 150ms ease-in-out;-moz-transition:all 150ms ease-in-out;-ms-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out}#wpsl-search-wrap .wpsl-dropdown.wpsl-active div{opacity:1}#wpsl-search-wrap .wpsl-input label{margin-right:0}#wpsl-radius{margin-right:10px}#wpsl-search select,#wpsl-search-wrap select,.wpsl-direction-details{display:none}#wpsl-search-wrap div label{float:left;margin-right:10px;line-height:32px}#wpsl-results label{width:auto}#wpsl-result-list ul{list-style:none;margin:0;padding:0}#wpsl-gmap .wpsl-info-window,.wpsl-gmap-canvas .wpsl-info-window{max-width:225px}.wpsl-info-window span,.wpsl-more-info-listings span{display:block}.wpsl-info-window .wpsl-no-margin{margin:0}.wpsl-more-info-listings{display:none}.wpsl-info-window span span{display:inline!important}#wpsl-wrap .wpsl-info-window p{margin:0 0 10px}.wpsl-store-hours{margin-top:10px}.wpsl-store-hours strong{display:block}#wpsl-gmap .wpsl-info-actions{display:block;margin:10px 0!important}.wpsl-info-actions a{float:left;margin-right:7px}.wpsl-info-actions .wpsl-zoom-here{margin-right:0}.wpsl-dropdown{position:relative;width:90px;border:1px solid #ccc;background:#fff;border-radius:3px;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-right:0!important;z-index:2}#wpsl-results .wpsl-dropdown{width:70px}.wpsl-dropdown ul{position:absolute;left:0;width:100%;height:100%;padding:0!important;margin:0!important;list-style:none;overflow:hidden}.wpsl-dropdown:hover{box-shadow:0 0 5px rgba(0,0,0,.15)}.wpsl-dropdown .wpsl-selected-item,.wpsl-dropdown li{position:relative;display:block;line-height:1;color:#000;overflow:hidden;white-space:nowrap}.wpsl-selected-item:after{position:absolute;content:"";right:12px;top:50%;margin-top:-4px;border:6px solid transparent;border-top:8px solid #000}.wpsl-active .wpsl-selected-item:after{margin-top:-10px;border:6px solid transparent;border-bottom:8px solid #000}.wpsl-dropdown li:hover{background:#f8f9f8;position:relative;z-index:3;color:#000}.wpsl-dropdown .wpsl-selected-item,.wpsl-dropdown li,.wpsl-selected-item{list-style:none;padding:9px 12px!important;margin:0!important}.wpsl-selected-dropdown{font-weight:700}.wpsl-clearfix:after,.wpsl-clearfix:before{content:" ";display:table}#wpsl-wrap .wpsl-selected-item{position:static;padding-right:35px!important}#wpsl-category,.wpsl-input,.wpsl-select-wrap{position:relative;margin-bottom:10px}.wpsl-provided-by{float:right;padding:5px 0;text-align:right;font-size:12px;width:100%}#wpsl-wrap .wpsl-results-only label{width:auto}.wpsl-contact-details,.wpsl-location-address,.wpsl-locations-details{margin-bottom:15px}table.wpsl-opening-hours td{vertical-align:top;padding:0 15px 0 0;text-align:left}#wpsl-stores .wpsl-contact-details span,.wpsl_stores .wpsl-contact-details span,table.wpsl-opening-hours time{display:block}table.wpsl-opening-hours{width:auto!important;font-size:100%!important}table.wpsl-opening-hours,table.wpsl-opening-hours td{border:none!important}.wpsl-gmap-canvas .wpsl-infobox{min-width:155px;max-width:350px!important;padding:10px;border-radius:4px;font-size:13px;font-weight:300;border:1px solid #ccc;background:#fff!important}.wpsl-gmap-canvas .wpsl-infobox:after,.wpsl-gmap-canvas .wpsl-infobox:before{position:absolute;content:"";left:40px;bottom:-11px}.wpsl-gmap-canvas .wpsl-infobox:after{border-left:11px solid transparent;border-right:11px solid transparent;border-top:11px solid #fff}.wpsl-gmap-canvas .wpsl-infobox:before{border-left:13px solid transparent;border-right:13px solid transparent;border-top:13px solid #ccc;bottom:-13px;left:38px}@media (max-width:825px){#wpsl-search-input{width:348px}.wpsl-results-only #wpsl-search-wrap .wpsl-dropdown{width:70px}#wpsl-search-wrap .wpsl-input{width:100%;margin-bottom:10px}#wpsl-category label,#wpsl-radius label,.wpsl-cat-results-filter #wpsl-search-wrap .wpsl-input,.wpsl-input label,.wpsl-no-filters #wpsl-search-wrap .wpsl-input,.wpsl-results-only #wpsl-search-wrap .wpsl-input{width:auto}}@media (max-width:720px){#wpsl-search-wrap .wpsl-dropdown{width:114px}}@media (max-width:675px){#wpsl-search-wrap #wpsl-search-btn{float:left;margin:0 5px 0 0}.wpsl-dropdown,.wpsl-results-only #wpsl-search-wrap .wpsl-input{width:100%}.wpsl-search{padding:2%}#wpsl-result-list p,#wpsl-wrap #wpsl-result-list li,.wpsl-direction-before{padding-left:0}.wpsl-input{margin-right:0}#wpsl-gmap,#wpsl-result-list{float:none;width:100%}#wpsl-gmap{margin-bottom:15px;margin-top:10px}#wpsl-result-list,.wpsl-cat-results-filter .wpsl-select-wrap,.wpsl-filter .wpsl-select-wrap{margin-bottom:10px}#wpsl-wrap #wpsl-result-list li.wpsl-preloader{padding-left:25px}.wpsl-preloader img{left:0}#wpsl-stores.wpsl-not-loaded{height:25px}#wpsl-reset-map{top:25px}#wpsl-category,#wpsl-search-btn,.wpsl-input,.wpsl-no-filters #wpsl-search-wrap .wpsl-input,.wpsl-select-wrap{margin-bottom:0}#wpsl-stores.wpsl-no-autoload{height:auto!important}}@media (max-width:570px){#wpsl-search-wrap #wpsl-search-btn{margin-bottom:5px}.wpsl-search{padding:4%}#wpsl-search-input{width:98%!important}.wpsl-cat-results-filter #wpsl-search-input,.wpsl-cat-results-filter #wpsl-search-wrap .wpsl-input,.wpsl-no-results #wpsl-search-input,.wpsl-results-only #wpsl-search-input{width:100%!important}.wpsl-search-btn-wrap{margin-top:15px;clear:both}#wpsl-search-btn,#wpsl-search-wrap div{margin-right:0}#wpsl-search-wrap div label{display:block;width:100%}.wpsl-select-wrap{width:100%}#wpsl-radius,#wpsl-results{width:50%}#wpsl-radius{margin-right:4%}#wpsl-search-wrap .wpsl-dropdown{width:96%!important}.wpsl-no-filters #wpsl-search-input,.wpsl-no-filters #wpsl-search-wrap .wpsl-input{width:100%!important}}
frontend/class-frontend.php CHANGED
@@ -291,7 +291,7 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
291
  * or if $include_post_content is set to true through the 'wpsl_include_post_content' filter.
292
  */
293
  if ( ( $wpsl_settings['more_info'] && $wpsl_settings['more_info_location'] == 'store listings' ) || $include_post_content ) {
294
- $page_object = get_page( $store->ID );
295
  $store_meta['description'] = apply_filters( 'the_content', strip_shortcodes( $page_object->post_content ) );
296
  }
297
 
@@ -741,10 +741,8 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
741
  'map_type_control' => $wpsl_settings['type_control'],
742
  'map_style' => '',
743
  'street_view' => $wpsl_settings['streetview'],
744
- 'pan_controls' => $wpsl_settings['pan_controls'],
745
  'scrollwheel' => $wpsl_settings['scrollwheel'],
746
- 'control_position' => $wpsl_settings['control_position'],
747
- 'control_style' => $wpsl_settings['control_style']
748
  ) ), $atts );
749
 
750
  array_push( $this->load_scripts, 'wpsl_base' );
@@ -863,10 +861,6 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
863
  $map_atts['streetView'] = $this->shortcode_atts_boolean( $atts['street_view'] );
864
  }
865
 
866
- if ( isset( $atts['pan_controls'] ) ) {
867
- $map_atts['panControls'] = $this->shortcode_atts_boolean( $atts['pan_controls'] );
868
- }
869
-
870
  if ( isset( $atts['scrollwheel'] ) ) {
871
  $map_atts['scrollWheel'] = $this->shortcode_atts_boolean( $atts['scrollwheel'] );
872
  }
@@ -874,10 +868,6 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
874
  if ( isset( $atts['control_position'] ) && !empty( $atts['control_position'] ) && ( $atts['control_position'] == 'left' || $atts['control_position'] == 'right' ) ) {
875
  $map_atts['controlPosition'] = $atts['control_position'];
876
  }
877
-
878
- if ( isset( $atts['control_style'] ) && !empty( $atts['control_style'] ) && ( $atts['control_style'] == 'small' || $atts['control_style'] == 'large' ) ) {
879
- $map_atts['controlStyle'] = $atts['control_style'];
880
- }
881
 
882
  return $map_atts;
883
  }
@@ -1162,6 +1152,8 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
1162
  public function get_map_controls() {
1163
 
1164
  global $wpsl_settings, $is_IE;
 
 
1165
 
1166
  if ( $wpsl_settings['reset_map'] ) {
1167
  $reset_button = '<div class="wpsl-icon-reset"><span>&#xe801;</span></div>';
@@ -1169,13 +1161,23 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
1169
  $reset_button = '';
1170
  }
1171
 
1172
- /* IE messes up the top padding for the icon fonts from fontello >_<.
 
1173
  *
1174
  * Luckily it's the same in all IE version ( 8-11 ),
1175
  * so adjusting the padding just for IE fixes it.
1176
  */
1177
  if ( $is_IE ) {
1178
- $class = 'class="wpsl-ie"';
 
 
 
 
 
 
 
 
 
1179
  } else {
1180
  $class = '';
1181
  }
@@ -1233,10 +1235,8 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
1233
  'zoomLevel' => $wpsl_settings['zoom_level'],
1234
  'zoomLatlng' => $wpsl_settings['zoom_latlng'],
1235
  'autoZoomLevel' => $wpsl_settings['auto_zoom_level'],
1236
- 'panControls' => $wpsl_settings['pan_controls'],
1237
  'scrollWheel' => $wpsl_settings['scrollwheel'],
1238
  'controlPosition' => $wpsl_settings['control_position'],
1239
- 'controlStyle' => $wpsl_settings['control_style'],
1240
  'path' => WPSL_URL
1241
  );
1242
 
291
  * or if $include_post_content is set to true through the 'wpsl_include_post_content' filter.
292
  */
293
  if ( ( $wpsl_settings['more_info'] && $wpsl_settings['more_info_location'] == 'store listings' ) || $include_post_content ) {
294
+ $page_object = get_post( $store->ID );
295
  $store_meta['description'] = apply_filters( 'the_content', strip_shortcodes( $page_object->post_content ) );
296
  }
297
 
741
  'map_type_control' => $wpsl_settings['type_control'],
742
  'map_style' => '',
743
  'street_view' => $wpsl_settings['streetview'],
 
744
  'scrollwheel' => $wpsl_settings['scrollwheel'],
745
+ 'control_position' => $wpsl_settings['control_position']
 
746
  ) ), $atts );
747
 
748
  array_push( $this->load_scripts, 'wpsl_base' );
861
  $map_atts['streetView'] = $this->shortcode_atts_boolean( $atts['street_view'] );
862
  }
863
 
 
 
 
 
864
  if ( isset( $atts['scrollwheel'] ) ) {
865
  $map_atts['scrollWheel'] = $this->shortcode_atts_boolean( $atts['scrollwheel'] );
866
  }
868
  if ( isset( $atts['control_position'] ) && !empty( $atts['control_position'] ) && ( $atts['control_position'] == 'left' || $atts['control_position'] == 'right' ) ) {
869
  $map_atts['controlPosition'] = $atts['control_position'];
870
  }
 
 
 
 
871
 
872
  return $map_atts;
873
  }
1152
  public function get_map_controls() {
1153
 
1154
  global $wpsl_settings, $is_IE;
1155
+
1156
+ $classes = array();
1157
 
1158
  if ( $wpsl_settings['reset_map'] ) {
1159
  $reset_button = '<div class="wpsl-icon-reset"><span>&#xe801;</span></div>';
1161
  $reset_button = '';
1162
  }
1163
 
1164
+ /*
1165
+ * IE messes up the top padding for the icon fonts from fontello >_<.
1166
  *
1167
  * Luckily it's the same in all IE version ( 8-11 ),
1168
  * so adjusting the padding just for IE fixes it.
1169
  */
1170
  if ( $is_IE ) {
1171
+ $classes[] = 'wpsl-ie';
1172
+ }
1173
+
1174
+ // If the street view option is enabled, then we need to adjust the right margin for the map control div.
1175
+ if ( $wpsl_settings['streetview'] ) {
1176
+ $classes[] = 'wpsl-street-view-exists';
1177
+ }
1178
+
1179
+ if ( !empty( $classes ) ) {
1180
+ $class = 'class="' . join( ' ', $classes ) . '"';
1181
  } else {
1182
  $class = '';
1183
  }
1235
  'zoomLevel' => $wpsl_settings['zoom_level'],
1236
  'zoomLatlng' => $wpsl_settings['zoom_latlng'],
1237
  'autoZoomLevel' => $wpsl_settings['auto_zoom_level'],
 
1238
  'scrollWheel' => $wpsl_settings['scrollwheel'],
1239
  'controlPosition' => $wpsl_settings['control_position'],
 
1240
  'path' => WPSL_URL
1241
  );
1242
 
inc/wpsl-functions.php CHANGED
@@ -51,7 +51,6 @@ function wpsl_get_default_settings() {
51
  'height' => 350,
52
  'map_type' => 'roadmap',
53
  'map_style' => '',
54
- 'pan_controls' => 0,
55
  'type_control' => 0,
56
  'streetview' => 0,
57
  'results_dropdown' => 1,
@@ -61,7 +60,6 @@ function wpsl_get_default_settings() {
61
  'search_width' => 179,
62
  'label_width' => 95,
63
  'control_position' => 'left',
64
- 'control_style' => 'small',
65
  'scrollwheel' => 1,
66
  'marker_clusters' => 0,
67
  'cluster_zoom' => 0,
51
  'height' => 350,
52
  'map_type' => 'roadmap',
53
  'map_style' => '',
 
54
  'type_control' => 0,
55
  'streetview' => 0,
56
  'results_dropdown' => 1,
60
  'search_width' => 179,
61
  'label_width' => 95,
62
  'control_position' => 'left',
 
63
  'scrollwheel' => 1,
64
  'marker_clusters' => 0,
65
  'cluster_zoom' => 0,
js/wpsl-gmap.js CHANGED
@@ -69,11 +69,9 @@ function initializeGmap( mapId, mapIndex ) {
69
  center: settings.startLatLng,
70
  mapTypeId: google.maps.MapTypeId[ settings.mapType.toUpperCase() ],
71
  mapTypeControl: Number( settings.mapTypeControl ) ? true : false,
72
- panControl: Number( settings.panControls ) ? true : false,
73
  scrollwheel: Number( settings.scrollWheel ) ? true : false,
74
  streetViewControl: Number( settings.streetView ) ? true : false,
75
  zoomControlOptions: {
76
- style: google.maps.ZoomControlStyle[ settings.controlStyle.toUpperCase() ],
77
  position: google.maps.ControlPosition[ settings.controlPosition.toUpperCase() + '_TOP' ]
78
  }
79
  };
@@ -174,17 +172,15 @@ function zoomChangedListener() {
174
  */
175
  function getMapSettings( mapIndex ) {
176
  var j, len, shortCodeVal,
177
- settingOptions = [ "zoomLevel", "mapType", "mapTypeControl", "mapStyle", "streetView", "panControls", "scrollWheel", "controlPosition", "controlStyle" ],
178
  mapSettings = {
179
  zoomLevel: wpslSettings.zoomLevel,
180
  mapType: wpslSettings.mapType,
181
  mapTypeControl: wpslSettings.mapTypeControl,
182
  mapStyle: wpslSettings.mapStyle,
183
  streetView: wpslSettings.streetView,
184
- panControls: wpslSettings.panControls,
185
  scrollWheel: wpslSettings.scrollWheel,
186
- controlPosition: wpslSettings.controlPosition,
187
- controlStyle: wpslSettings.controlStyle
188
  };
189
 
190
  /* If there are settings that are set through the shortcode, then we use them instead of the default ones */
@@ -1080,24 +1076,25 @@ function makeAjaxRequest( startLatLng, resetMap, autoLoad, infoWindow ) {
1080
  */
1081
  }
1082
 
1083
- /* Check if autoload all stores is enabled */
1084
- if ( autoLoad == 1 ) {
1085
- ajaxData.autoload = 1;
1086
-
1087
- /**
1088
- * Check if the included latlng is based on a geolocation attempt.
1089
- *
1090
- * If this is the case, then we should not use the transient cache
1091
- * to return nearby store locations.
1092
- *
1093
- * Otherwise the user will see results based on the start location
1094
- * from the settings page, instead of the users actual location.
1095
- */
1096
- if ( typeof geolocationLatlng !== "undefined" ) {
1097
- ajaxData.skip_cache = 1;
1098
- }
1099
- }
1100
-
 
1101
  /* Add the preloader */
1102
  $storeList.empty().append( "<li class='wpsl-preloader'><img src='" + preloader + "'/>" + wpslLabels.preloader + "</li>" );
1103
 
@@ -1164,7 +1161,7 @@ function makeAjaxRequest( startLatLng, resetMap, autoLoad, infoWindow ) {
1164
  /* Because the reset icon exists, we need to adjust
1165
  * the styling of the direction icon.
1166
  */
1167
- $( ".wpsl-icon-direction" ).addClass( "wpsl-reset-exists" );
1168
 
1169
  /* The reset initialy is set to hidden to prevent
1170
  * users from clicking it before the map is loaded.
69
  center: settings.startLatLng,
70
  mapTypeId: google.maps.MapTypeId[ settings.mapType.toUpperCase() ],
71
  mapTypeControl: Number( settings.mapTypeControl ) ? true : false,
 
72
  scrollwheel: Number( settings.scrollWheel ) ? true : false,
73
  streetViewControl: Number( settings.streetView ) ? true : false,
74
  zoomControlOptions: {
 
75
  position: google.maps.ControlPosition[ settings.controlPosition.toUpperCase() + '_TOP' ]
76
  }
77
  };
172
  */
173
  function getMapSettings( mapIndex ) {
174
  var j, len, shortCodeVal,
175
+ settingOptions = [ "zoomLevel", "mapType", "mapTypeControl", "mapStyle", "streetView", "scrollWheel", "controlPosition" ],
176
  mapSettings = {
177
  zoomLevel: wpslSettings.zoomLevel,
178
  mapType: wpslSettings.mapType,
179
  mapTypeControl: wpslSettings.mapTypeControl,
180
  mapStyle: wpslSettings.mapStyle,
181
  streetView: wpslSettings.streetView,
 
182
  scrollWheel: wpslSettings.scrollWheel,
183
+ controlPosition: wpslSettings.controlPosition
 
184
  };
185
 
186
  /* If there are settings that are set through the shortcode, then we use them instead of the default ones */
1076
  */
1077
  }
1078
 
1079
+ /*
1080
+ * If the autoload option is enabled, then we need to check if the included latlng
1081
+ * is based on a geolocation attempt before including the autoload param.
1082
+ *
1083
+ * Because if both the geolocation and autoload options are enabled,
1084
+ * and the geolocation attempt was successfull, then we need to to include
1085
+ * the skip_cache param.
1086
+ *
1087
+ * This makes sure the results don't come from an older transient based on the
1088
+ * start location from the settings page, instead of the users actual location.
1089
+ */
1090
+ if ( autoLoad == 1 ) {
1091
+ if ( typeof geolocationLatlng !== "undefined" ) {
1092
+ ajaxData.skip_cache = 1;
1093
+ } else {
1094
+ ajaxData.autoload = 1;
1095
+ }
1096
+ }
1097
+
1098
  /* Add the preloader */
1099
  $storeList.empty().append( "<li class='wpsl-preloader'><img src='" + preloader + "'/>" + wpslLabels.preloader + "</li>" );
1100
 
1161
  /* Because the reset icon exists, we need to adjust
1162
  * the styling of the direction icon.
1163
  */
1164
+ $( "#wpsl-map-controls" ).addClass( "wpsl-reset-exists" );
1165
 
1166
  /* The reset initialy is set to hidden to prevent
1167
  * users from clicking it before the map is loaded.
js/wpsl-gmap.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){function t(t,n){var a,c,w,u,m,h,v,S=Number(wpslSettings.autoZoomLevel);c=o(n),w=l(),G=new google.maps.Geocoder,K=new google.maps.DirectionsRenderer,F=new google.maps.DirectionsService,a={zoom:Number(c.zoomLevel),center:c.startLatLng,mapTypeId:google.maps.MapTypeId[c.mapType.toUpperCase()],mapTypeControl:Number(c.mapTypeControl)?!0:!1,panControl:Number(c.panControls)?!0:!1,scrollwheel:Number(c.scrollWheel)?!0:!1,streetViewControl:Number(c.streetView)?!0:!1,zoomControlOptions:{style:google.maps.ZoomControlStyle[c.controlStyle.toUpperCase()],position:google.maps.ControlPosition[c.controlPosition.toUpperCase()+"_TOP"]}},j=new google.maps.Map(document.getElementById(t),a),i(c.mapStyle),"undefined"!=typeof window["wpslMap_"+n]&&"undefined"!=typeof window["wpslMap_"+n].locations&&(m=new google.maps.LatLngBounds,h=window["wpslMap_"+n].locations,v=h.length,e.each(h,function(e){u=new google.maps.LatLng(h[e].lat,h[e].lng),N(u,h[e].id,h[e],!1,w),m.extend(u)}),j.fitBounds(m),google.maps.event.addListenerOnce(j,"bounds_changed",function(e){return function(){e.getZoom()>S&&e.setZoom(S)}}(j))),e("#wpsl-gmap").length&&(!p()&&e(".wpsl-dropdown").length?A():(e("#wpsl-search-wrap select").show(),e("#wpsl-wrap").addClass("wpsl-mobile")),1==wpslSettings.autoLocate?d(c.startLatLng,w):1==wpslSettings.autoLoad&&r(c.startLatLng,w),1!=wpslSettings.mouseFocus||p()||e("#wpsl-search-input").focus(),g(w),f(c,j,w)),s()}function s(){"undefined"!=typeof wpslSettings.markerZoomTo&&1==wpslSettings.markerZoomTo&&google.maps.event.addListener(j,"zoom_changed",function(){O()})}function o(e){var t,s,o,l=["zoomLevel","mapType","mapTypeControl","mapStyle","streetView","panControls","scrollWheel","controlPosition","controlStyle"],i={zoomLevel:wpslSettings.zoomLevel,mapType:wpslSettings.mapType,mapTypeControl:wpslSettings.mapTypeControl,mapStyle:wpslSettings.mapStyle,streetView:wpslSettings.streetView,panControls:wpslSettings.panControls,scrollWheel:wpslSettings.scrollWheel,controlPosition:wpslSettings.controlPosition,controlStyle:wpslSettings.controlStyle};if("undefined"!=typeof window["wpslMap_"+e]&&"undefined"!=typeof window["wpslMap_"+e].shortCode)for(t=0,s=l.length;s>t;t++)o=window["wpslMap_"+e].shortCode[l[t]],"undefined"!=typeof o&&(i[l[t]]=o);return i.startLatLng=n(e),i}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 l(){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)},q=new InfoBox(s)):q=new google.maps.InfoWindow,q}function i(e){e=a(e),e&&j.setOptions({styles:e})}function a(e){try{var t=JSON.parse(e);if(t&&"object"==typeof t&&null!==t)return t}catch(s){}return!1}function r(e,t){var s={store:wpslLabels.startPoint};N(e,0,s,!0,t),I(e,nt,it,t)}function p(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function d(t,s){if(navigator.geolocation){var o,n,l=!1,i=Number(wpslSettings.geoLocationTimout);o=setInterval(function(){e(".wpsl-icon-direction").toggleClass("wpsl-active-icon")},600),n=setTimeout(function(){c(o),r(t,s)},i),navigator.geolocation.getCurrentPosition(function(e){c(o),clearTimeout(n),U(l),w(t,e,nt,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),r(t,s)},{maximumAge:6e4,timeout:i,enableHighAccuracy:!0})}else alert(wpslGeolocationErrors.unavailable),r(t,s)}function c(t){clearInterval(t),e(".wpsl-icon-direction").removeClass("wpsl-active-icon")}function w(e,t,s,o){if("undefined"==typeof t)r(e,o);else{var n=new google.maps.LatLng(t.coords.latitude,t.coords.longitude);H=t,C(n),j.setCenter(n),N(n,0,"",!0),I(n,s,it,o)}}function g(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(),nt=!1,u(),U(s),h(),y(t)):e("#wpsl-search-input").addClass("wpsl-error").focus()})}function u(){"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&"undefined"!=typeof et[0]&&et[0].close()}function f(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&&(m(t.startLatLng,o),e(".wpsl-icon-reset").hide()),e(".wpsl-icon-direction").on("click",function(){e(this).addClass("wpsl-user-activated"),d(t.startLatLng,o)})})}function m(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&&(it=1),(j.getCenter().lat()!==ot.centerLatlng.lat()||j.getCenter().lng()!==ot.centerLatlng.lng()||j.getZoom()!==ot.zoomLevel)&&(U(o),e("#wpsl-search-input").val("").removeClass(),e(".wpsl-icon-reset").addClass("wpsl-in-progress"),Y&&Y.clearMarkers(),h(),v(),1==wpslSettings.autoLocate?w(t,H,n,s):r(t,s)),e("#wpsl-stores").show(),e("#wpsl-direction-details").hide())})}function h(){"undefined"!=typeof J&&""!==J&&(J.setMap(null),J="")}function v(){var t,s,o,n,l=[wpslSettings.searchRadius+" "+wpslSettings.distanceUnit,wpslSettings.maxResults],i=["wpsl-radius","wpsl-results"];for(t=0,s=i.length;s>t;t++)e("#"+i[t]+" select").val(parseInt(l[t])),e("#"+i[t]+" li").removeClass(),"wpsl-radius"==i[t]?o=wpslSettings.searchRadius:"wpsl-results"==i[t]&&(o=wpslSettings.maxResults),e("#"+i[t]+" li").each(function(){e(this).text()===l[t]&&(e(this).addClass("wpsl-selected-dropdown"),e("#"+i[t]+" .wpsl-selected-item").html(l[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 S(t){var s,o,n,l,i;for(u(),i=t.parents("li").length>0?t.parents("li").data("store-id"):t.parents(".wpsl-info-window").data("store-id"),"undefined"!=typeof J&&""!==J&&(o=J.getPosition()),st={centerLatlng:j.getCenter(),zoomLevel:j.getZoom()},s=0,l=tt.length;l>s;s++)0!=tt[s].storeId||"undefined"!=typeof o&&""!==o?tt[s].storeId==i&&(n=tt[s].getPosition()):o=tt[s].getPosition();o&&n?(e("#wpsl-direction-details ul").empty(),e(".wpsl-direction-before, .wpsl-direction-after").remove(),b(o,n)):alert(wpslLabels.generalError)}function L(e,t){var s,o,n;for(s=0,o=tt.length;o>s;s++)tt[s].storeId==e&&(n=tt[s],n.setAnimation("start"==t?google.maps.Animation.BOUNCE:null))}function b(t,s){var o,n,l,i,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]},F.route(g,function(t,s){if(s==google.maps.DirectionsStatus.OK){if(K.setMap(j),K.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++)l=o.steps[p],i=p+1,w=w+"<li><div class='wpsl-direction-index'>"+i+"</div><div class='wpsl-direction-txt'>"+l.instructions+"</div><div class='wpsl-direction-distance'>"+l.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=tt.length;n>r;r++)tt[r].setMap(null);Y&&Y.clearMarkers(),"undefined"!=typeof J&&""!==J&&J.setMap(null),e("#wpsl-stores").hide(),1==wpslSettings.templateId&&(c=e("#wpsl-gmap").offset(),e(window).scrollTop(c.top))}}else W(s)})}function y(t){var s,o=!1,n=!1,l=e("#wpsl-search-input").val();G.geocode({address:l},function(e,l){l==google.maps.GeocoderStatus.OK?(s=e[0].geometry.location,U(n),N(s,0,"",!0,t),I(s,nt,o,t)):$(l)})}function C(t){var s;G.geocode({latLng:t},function(t,o){o==google.maps.GeocoderStatus.OK?(s=k(t),""!==s&&e("#wpsl-search-input").val(s)):$(o)})}function k(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 I(e,t,s,o){1==wpslSettings.directionRedirect?x(e,function(){E(e,t,s,o)}):E(e,t,s,o)}function x(e,t){G.geocode({latLng:e},function(e,s){s==google.maps.GeocoderStatus.OK?(X=e[0].formatted_address,t()):$(s)})}function E(t,s,o,n){var l,i,a,r="",d="",c=!1,w=e("#wpsl-wrap").hasClass("wpsl-mobile"),g=e("#wpsl-listing-template").html(),u=e("#wpsl-stores ul"),f=wpslSettings.path+"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?(i=parseInt(e("#wpsl-results .wpsl-dropdown").val()),a=parseInt(e("#wpsl-radius .wpsl-dropdown").val())):(i=parseInt(e("#wpsl-results .wpsl-selected-item").attr("data-value")),a=parseInt(e("#wpsl-radius .wpsl-selected-item").attr("data-value"))),m.max_results=isNaN(i)?wpslSettings.maxResults:i,m.radius=isNaN(a)?wpslSettings.searchRadius:a,e("#wpsl-category").length>0&&(d=parseInt(w?e("#wpsl-category .wpsl-dropdown").val():e("#wpsl-category .wpsl-selected-item").attr("data-value")),isNaN(d)||0===d||(m.filter=d))),1==o&&(m.autoload=1,"undefined"!=typeof H&&(m.skip_cache=1)),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],wt),l=new google.maps.LatLng(t[e].lat,t[e].lng),N(l,t[e].id,t[e],c,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?(S(e(this)),!1):void 0}),M(),B(),e("#wpsl-result-list p:empty").remove()):u.html("<li class='no-results'>"+wpslLabels.noResults+"</li>"),1==wpslSettings.resetMap&&(e.isEmptyObject(ot)&&google.maps.event.addListenerOnce(j,"tilesloaded",function(){ot={centerLatlng:j.getCenter(),zoomLevel:j.getZoom()},e(".wpsl-icon-direction").addClass("wpsl-reset-exists"),e(".wpsl-icon-reset, #wpsl-reset-map").show()}),e(".wpsl-icon-reset").removeClass("wpsl-in-progress"))}),1!=wpslSettings.mouseFocus||p()||e("#wpsl-search-input").focus()}function M(){if(1==wpslSettings.markerClusters){var e=Number(wpslSettings.clusterZoom),t=Number(wpslSettings.clusterSize);isNaN(e)&&(e=""),isNaN(t)&&(t=""),Y=new MarkerClusterer(j,tt,{gridSize:t,maxZoom:e})}}function N(e,t,s,o,n){var l,i,a,r=!0;l=0===t?wpslSettings.path+"img/markers/"+wpslSettings.startMarker:wpslSettings.path+"img/markers/"+wpslSettings.storeMarker,i={url:l,scaledSize:new google.maps.Size(24,35),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(12,35)},a=new google.maps.Marker({position:e,map:j,optimized:!1,title:s.store,draggable:o,storeId:t,icon:i}),tt.push(a),google.maps.event.addListener(a,"click",function(o){return function(){0!=t?"undefined"!=typeof wpslSettings.markerStreetView&&1==wpslSettings.markerStreetView?Z(e,function(){P(a,V(s),n,o)}):P(a,V(s),n,o):P(a,wpslLabels.startPoint,n,o),google.maps.event.clearListeners(n,"domready"),google.maps.event.addListener(n,"domready",function(){T(a,o),O()})}}(j)),o&&google.maps.event.addListener(a,"dragend",function(e){U(r),j.setCenter(e.latLng),C(e.latLng),I(e.latLng,nt,it=!1,n)})}function P(e,t,s,o){et.length=0,s.setContent(t),s.open(o,e),et.push(s),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters&&(Q=e.storeId,s.setVisible(!0))}function T(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;S(e(this))}else e(this).hasClass("wpsl-streetview")?R(t,s):e(this).hasClass("wpsl-zoom-here")&&(s.setCenter(t.getPosition()),s.setZoom(n));return!1})}function O(){var t=j.getZoom();t>=wpslSettings.autoZoomLevel?e(".wpsl-zoom-here").hide():e(".wpsl-zoom-here").show()}function R(t,s){var o=s.getStreetView();o.setPosition(t.getPosition()),o.setVisible(!0),e("#wpsl-map-controls").hide(),z(o,s)}function z(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 Z(e,t){var s=new google.maps.StreetViewService;s.getPanoramaByLocation(e,50,function(e,s){lt=s==google.maps.StreetViewStatus.OK?!0:!1,t()})}function V(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 B(){var e,t,s=Number(wpslSettings.autoZoomLevel),o=new google.maps.LatLngBounds;for(google.maps.event.addListenerOnce(j,"bounds_changed",function(){this.getZoom()>s&&this.setZoom(s)}),e=0,t=tt.length;t>e;e++)o.extend(tt[e].position);j.fitBounds(o)}function U(e){var t,s;if(K.setMap(null),tt){for(s=0,t=tt.length;t>s;s++)e?1!=tt[s].draggable?tt[s].setMap(null):J=tt[s]:tt[s].setMap(null);tt.length=0}Y&&Y.clearMarkers()}function $(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 W(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 A(){e(".wpsl-dropdown").each(function(){var t,s,o=e(this);o.$dropdownWrap=o.wrap("<div class='wpsl-dropdown'></div>").parent(),o.$selectedVal=o.val(),o.$dropdownElem=e("<div><ul/></div>").appendTo(o.$dropdownWrap),o.$dropdown=o.$dropdownElem.find("ul"),o.$options=o.$dropdownWrap.find("option"),o.hide().removeClass("wpsl-dropdown"),e.each(o.$options,function(){t=e(this).val()==o.$selectedVal?'class="wpsl-selected-dropdown"':"",o.$dropdown.append("<li data-value="+e(this).val()+" "+t+">"+e(this).text()+"</li>")}),o.$dropdownElem.before("<span data-value="+o.find(":selected").val()+" class='wpsl-selected-item'>"+o.find(":selected").text()+"</span>"),o.$dropdownItem=o.$dropdownElem.find("li"),o.$dropdownWrap.on("click",function(t){D(),e(this).toggleClass("wpsl-active"),s=0,e(this).hasClass("wpsl-active")?(o.$dropdownItem.each(function(){s+=e(this).outerHeight()}),o.$dropdownElem.css("height",s+2+"px")):o.$dropdownElem.css("height",0),t.stopPropagation()}),o.$dropdownItem.on("click",function(t){o.$dropdownWrap.find(e(".wpsl-selected-item")).html(e(this).text()).attr("data-value",e(this).attr("data-value")),o.$dropdownItem.removeClass("wpsl-selected-dropdown"),e(this).addClass("wpsl-selected-dropdown"),D(),t.stopPropagation()})}),e(document).click(function(){D()})}function D(){e(".wpsl-dropdown").removeClass("wpsl-active"),e(".wpsl-dropdown div").css("height",0)}var G,j,K,F,H,Q,q,Y,J,X,et=[],tt=[],st={},ot={},nt=!1,lt=!1,it="undefined"!=typeof wpslSettings?wpslSettings.autoLoad:"";if(_.templateSettings={evaluate:/\<\%(.+?)\%\>/g,interpolate:/\<\%=(.+?)\%\>/g,escape:/\<\%-(.+?)\%\>/g},e(".wpsl-gmap-canvas").length&&(e("<img />").attr("src",wpslSettings.path+"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(K.setMap(null),t=0,s=tt.length;s>t;t++)tt[t].setMap(j);return"undefined"!=typeof J&&""!==J&&J.setMap(j),Y&&M(),j.setCenter(st.centerLatlng),j.setZoom(st.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=tt.length;s>t;t++)tt[t].storeId==e(this).data("store-id")&&(google.maps.event.trigger(tt[t],"click"),j.setCenter(tt[t].position))})),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters){var at,rt,pt,dt,ct;google.maps.event.addListener(j,"zoom_changed",function(){google.maps.event.addListenerOnce(j,"idle",function(){if("undefined"!=typeof Y&&(at=Y.clusters_,at.length))for(dt=0,rt=at.length;rt>dt;dt++)for(ct=0,pt=at[dt].markers_.length;pt>ct;ct++)if(at[dt].markers_[ct].storeId==Q){q.getVisible()&&null===at[dt].markers_[ct].map?q.setVisible(!1):q.getVisible()||null===at[dt].markers_[ct].map||q.setVisible(!0);break}})})}var wt={formatPhoneNumber:function(e){return 1==wpslSettings.phoneUrl&&p()&&(e="<a href='tel:"+wt.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&&(lt&&(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'>"+wt.createDirectionUrl(t)+o+n+"</div>"),s},createDirectionUrl:function(t){var s,o,n,l={};return 1==wpslSettings.directionRedirect?("undefined"==typeof X&&(X=""),l.target="target='_blank'","undefined"!=typeof t?l.src=e("[data-store-id="+t+"] .wpsl-directions").attr("href"):(n=this.zip?this.zip+", ":"",o=this.address+", "+this.city+", "+n+this.country,l.src="https://maps.google.com/maps?saddr="+wt.rfc3986EncodeURIComponent(X)+"&daddr="+wt.rfc3986EncodeURIComponent(o))):l={src:"#",target:""},s="<a class='wpsl-directions' "+l.target+" href='"+l.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=tt.length;s>t;t++)tt[t].storeId==n&&google.maps.event.trigger(tt[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 gt,ut,ft=e("a[href='#"+wpslSettings.mapTabAnchor+"']");ft.on("click",function(){return setTimeout(function(){gt=j.getZoom(),ut=j.getCenter(),google.maps.event.trigger(j,"resize"),j.setZoom(gt),j.setCenter(ut),B()},50),!1})}});
1
+ jQuery(document).ready(function(e){function t(t,n){var a,c,w,u,m,h,v,S=Number(wpslSettings.autoZoomLevel);c=o(n),w=i(),G=new google.maps.Geocoder,K=new google.maps.DirectionsRenderer,F=new google.maps.DirectionsService,a={zoom:Number(c.zoomLevel),center:c.startLatLng,mapTypeId:google.maps.MapTypeId[c.mapType.toUpperCase()],mapTypeControl:Number(c.mapTypeControl)?!0:!1,scrollwheel:Number(c.scrollWheel)?!0:!1,streetViewControl:Number(c.streetView)?!0:!1,zoomControlOptions:{position:google.maps.ControlPosition[c.controlPosition.toUpperCase()+"_TOP"]}},j=new google.maps.Map(document.getElementById(t),a),l(c.mapStyle),"undefined"!=typeof window["wpslMap_"+n]&&"undefined"!=typeof window["wpslMap_"+n].locations&&(m=new google.maps.LatLngBounds,h=window["wpslMap_"+n].locations,v=h.length,e.each(h,function(e){u=new google.maps.LatLng(h[e].lat,h[e].lng),N(u,h[e].id,h[e],!1,w),m.extend(u)}),j.fitBounds(m),google.maps.event.addListenerOnce(j,"bounds_changed",function(e){return function(){e.getZoom()>S&&e.setZoom(S)}}(j))),e("#wpsl-gmap").length&&(!p()&&e(".wpsl-dropdown").length?A():(e("#wpsl-search-wrap select").show(),e("#wpsl-wrap").addClass("wpsl-mobile")),1==wpslSettings.autoLocate?d(c.startLatLng,w):1==wpslSettings.autoLoad&&r(c.startLatLng,w),1!=wpslSettings.mouseFocus||p()||e("#wpsl-search-input").focus(),g(w),f(c,j,w)),s()}function s(){"undefined"!=typeof wpslSettings.markerZoomTo&&1==wpslSettings.markerZoomTo&&google.maps.event.addListener(j,"zoom_changed",function(){O()})}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)},q=new InfoBox(s)):q=new google.maps.InfoWindow,q}function l(e){e=a(e),e&&j.setOptions({styles:e})}function a(e){try{var t=JSON.parse(e);if(t&&"object"==typeof t&&null!==t)return t}catch(s){}return!1}function r(e,t){var s={store:wpslLabels.startPoint};N(e,0,s,!0,t),I(e,ne,le,t)}function p(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function d(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(){c(o),r(t,s)},l),navigator.geolocation.getCurrentPosition(function(e){c(o),clearTimeout(n),$(i),w(t,e,ne,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),r(t,s)},{maximumAge:6e4,timeout:l,enableHighAccuracy:!0})}else alert(wpslGeolocationErrors.unavailable),r(t,s)}function c(t){clearInterval(t),e(".wpsl-icon-direction").removeClass("wpsl-active-icon")}function w(e,t,s,o){if("undefined"==typeof t)r(e,o);else{var n=new google.maps.LatLng(t.coords.latitude,t.coords.longitude);H=t,C(n),j.setCenter(n),N(n,0,"",!0),I(n,s,le,o)}}function g(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(),ne=!1,u(),$(s),h(),y(t)):e("#wpsl-search-input").addClass("wpsl-error").focus()})}function u(){"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&"undefined"!=typeof ee[0]&&ee[0].close()}function f(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&&(m(t.startLatLng,o),e(".wpsl-icon-reset").hide()),e(".wpsl-icon-direction").on("click",function(){e(this).addClass("wpsl-user-activated"),d(t.startLatLng,o)})})}function m(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&&(le=1),(j.getCenter().lat()!==oe.centerLatlng.lat()||j.getCenter().lng()!==oe.centerLatlng.lng()||j.getZoom()!==oe.zoomLevel)&&($(o),e("#wpsl-search-input").val("").removeClass(),e(".wpsl-icon-reset").addClass("wpsl-in-progress"),Y&&Y.clearMarkers(),h(),v(),1==wpslSettings.autoLocate?w(t,H,n,s):r(t,s)),e("#wpsl-stores").show(),e("#wpsl-direction-details").hide())})}function h(){"undefined"!=typeof J&&""!==J&&(J.setMap(null),J="")}function v(){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 S(t){var s,o,n,i,l;for(u(),l=t.parents("li").length>0?t.parents("li").data("store-id"):t.parents(".wpsl-info-window").data("store-id"),"undefined"!=typeof J&&""!==J&&(o=J.getPosition()),se={centerLatlng:j.getCenter(),zoomLevel:j.getZoom()},s=0,i=te.length;i>s;s++)0!=te[s].storeId||"undefined"!=typeof o&&""!==o?te[s].storeId==l&&(n=te[s].getPosition()):o=te[s].getPosition();o&&n?(e("#wpsl-direction-details ul").empty(),e(".wpsl-direction-before, .wpsl-direction-after").remove(),b(o,n)):alert(wpslLabels.generalError)}function L(e,t){var s,o,n;for(s=0,o=te.length;o>s;s++)te[s].storeId==e&&(n=te[s],"start"==t?n.setAnimation(google.maps.Animation.BOUNCE):n.setAnimation(null))}function b(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]},F.route(g,function(t,s){if(s==google.maps.DirectionsStatus.OK){if(K.setMap(j),K.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=te.length;n>r;r++)te[r].setMap(null);Y&&Y.clearMarkers(),"undefined"!=typeof J&&""!==J&&J.setMap(null),e("#wpsl-stores").hide(),1==wpslSettings.templateId&&(c=e("#wpsl-gmap").offset(),e(window).scrollTop(c.top))}}else W(s)})}function y(t){var s,o=!1,n=!1,i=e("#wpsl-search-input").val();G.geocode({address:i},function(e,i){i==google.maps.GeocoderStatus.OK?(s=e[0].geometry.location,$(n),N(s,0,"",!0,t),I(s,ne,o,t)):U(i)})}function C(t){var s;G.geocode({latLng:t},function(t,o){o==google.maps.GeocoderStatus.OK?(s=k(t),""!==s&&e("#wpsl-search-input").val(s)):U(o)})}function k(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 I(e,t,s,o){1==wpslSettings.directionRedirect?x(e,function(){E(e,t,s,o)}):E(e,t,s,o)}function x(e,t){G.geocode({latLng:e},function(e,s){s==google.maps.GeocoderStatus.OK?(X=e[0].formatted_address,t()):U(s)})}function E(t,s,o,n){var i,l,a,r="",d="",c=!1,w=e("#wpsl-wrap").hasClass("wpsl-mobile"),g=e("#wpsl-listing-template").html(),u=e("#wpsl-stores ul"),f=wpslSettings.path+"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,e("#wpsl-category").length>0&&(d=w?parseInt(e("#wpsl-category .wpsl-dropdown").val()):parseInt(e("#wpsl-category .wpsl-selected-item").attr("data-value")),isNaN(d)||0===d||(m.filter=d))),1==o&&("undefined"!=typeof H?m.skip_cache=1:m.autoload=1),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],we),i=new google.maps.LatLng(t[e].lat,t[e].lng),N(i,t[e].id,t[e],c,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?(S(e(this)),!1):void 0}),M(),B(),e("#wpsl-result-list p:empty").remove()):u.html("<li class='no-results'>"+wpslLabels.noResults+"</li>"),1==wpslSettings.resetMap&&(e.isEmptyObject(oe)&&google.maps.event.addListenerOnce(j,"tilesloaded",function(){oe={centerLatlng:j.getCenter(),zoomLevel:j.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||p()||e("#wpsl-search-input").focus()}function M(){if(1==wpslSettings.markerClusters){var e=Number(wpslSettings.clusterZoom),t=Number(wpslSettings.clusterSize);isNaN(e)&&(e=""),isNaN(t)&&(t=""),Y=new MarkerClusterer(j,te,{gridSize:t,maxZoom:e})}}function N(e,t,s,o,n){var i,l,a,r=!0;i=0===t?wpslSettings.path+"img/markers/"+wpslSettings.startMarker:wpslSettings.path+"img/markers/"+wpslSettings.storeMarker,l={url:i,scaledSize:new google.maps.Size(24,35),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(12,35)},a=new google.maps.Marker({position:e,map:j,optimized:!1,title:s.store,draggable:o,storeId:t,icon:l}),te.push(a),google.maps.event.addListener(a,"click",function(o){return function(){0!=t?"undefined"!=typeof wpslSettings.markerStreetView&&1==wpslSettings.markerStreetView?Z(e,function(){P(a,V(s),n,o)}):P(a,V(s),n,o):P(a,wpslLabels.startPoint,n,o),google.maps.event.clearListeners(n,"domready"),google.maps.event.addListener(n,"domready",function(){T(a,o),O()})}}(j)),o&&google.maps.event.addListener(a,"dragend",function(e){$(r),j.setCenter(e.latLng),C(e.latLng),I(e.latLng,ne,le=!1,n)})}function P(e,t,s,o){ee.length=0,s.setContent(t),s.open(o,e),ee.push(s),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters&&(Q=e.storeId,s.setVisible(!0))}function T(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;S(e(this))}else e(this).hasClass("wpsl-streetview")?R(t,s):e(this).hasClass("wpsl-zoom-here")&&(s.setCenter(t.getPosition()),s.setZoom(n));return!1})}function O(){var t=j.getZoom();t>=wpslSettings.autoZoomLevel?e(".wpsl-zoom-here").hide():e(".wpsl-zoom-here").show()}function R(t,s){var o=s.getStreetView();o.setPosition(t.getPosition()),o.setVisible(!0),e("#wpsl-map-controls").hide(),z(o,s)}function z(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 Z(e,t){var s=new google.maps.StreetViewService;s.getPanoramaByLocation(e,50,function(e,s){ie=s==google.maps.StreetViewStatus.OK?!0:!1,t()})}function V(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 B(){var e,t,s=Number(wpslSettings.autoZoomLevel),o=new google.maps.LatLngBounds;for(google.maps.event.addListenerOnce(j,"bounds_changed",function(e){this.getZoom()>s&&this.setZoom(s)}),e=0,t=te.length;t>e;e++)o.extend(te[e].position);j.fitBounds(o)}function $(e){var t,s;if(K.setMap(null),te){for(s=0,t=te.length;t>s;s++)e?1!=te[s].draggable?te[s].setMap(null):J=te[s]:te[s].setMap(null);te.length=0}Y&&Y.clearMarkers()}function U(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 W(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 A(){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){D(),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"),D(),t.stopPropagation()})}),e(document).click(function(){D()})}function D(){e(".wpsl-dropdown").removeClass("wpsl-active"),e(".wpsl-dropdown div").css("height",0)}var G,j,K,F,H,Q,q,Y,J,X,ee=[],te=[],se={},oe={},ne=!1,ie=!1,le="undefined"!=typeof wpslSettings?wpslSettings.autoLoad:"";if(_.templateSettings={evaluate:/\<\%(.+?)\%\>/g,interpolate:/\<\%=(.+?)\%\>/g,escape:/\<\%-(.+?)\%\>/g},e(".wpsl-gmap-canvas").length&&(e("<img />").attr("src",wpslSettings.path+"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(K.setMap(null),t=0,s=te.length;s>t;t++)te[t].setMap(j);return"undefined"!=typeof J&&""!==J&&J.setMap(j),Y&&M(),j.setCenter(se.centerLatlng),j.setZoom(se.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=te.length;s>t;t++)te[t].storeId==e(this).data("store-id")&&(google.maps.event.trigger(te[t],"click"),j.setCenter(te[t].position))})),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters){var ae,re,pe,de,ce;google.maps.event.addListener(j,"zoom_changed",function(){google.maps.event.addListenerOnce(j,"idle",function(){if("undefined"!=typeof Y&&(ae=Y.clusters_,ae.length))for(de=0,re=ae.length;re>de;de++)for(ce=0,pe=ae[de].markers_.length;pe>ce;ce++)if(ae[de].markers_[ce].storeId==Q){q.getVisible()&&null===ae[de].markers_[ce].map?q.setVisible(!1):q.getVisible()||null===ae[de].markers_[ce].map||q.setVisible(!0);break}})})}var we={formatPhoneNumber:function(e){return 1==wpslSettings.phoneUrl&&p()&&(e="<a href='tel:"+we.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&&(ie&&(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'>"+we.createDirectionUrl(t)+o+n+"</div>"),s},createDirectionUrl:function(t){var s,o,n,i={};return 1==wpslSettings.directionRedirect?("undefined"==typeof X&&(X=""),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="+we.rfc3986EncodeURIComponent(X)+"&daddr="+we.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=te.length;s>t;t++)te[t].storeId==n&&google.maps.event.trigger(te[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 ge,ue,fe=e("a[href='#"+wpslSettings.mapTabAnchor+"']");fe.on("click",function(){return setTimeout(function(){ge=j.getZoom(),ue=j.getCenter(),google.maps.event.trigger(j,"resize"),j.setZoom(ge),j.setCenter(ue),B()},50),!1})}});
readme.txt CHANGED
@@ -1,10 +1,11 @@
1
  === WP Store Locator ===
2
  Plugin URI: http://wpstorelocator.co
3
  Contributors: tijmensmit
 
4
  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
5
  Requires at least: 3.7
6
  Tested up to: 4.3
7
- Stable tag: 2.0.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
@@ -106,18 +107,25 @@ If you find a plugin or theme that causes a conflict, please report it on the [s
106
 
107
  == Changelog ==
108
 
109
- = 2.0.2 =
 
 
 
 
 
 
 
110
  * Fixed: Not all users always seeing the notice to convert the 1.x locations to custom post types.
111
  * Fixed: Prevented empty search results from ending up in the autoload transient.
112
  * Fixed: The autoload transient not being cleared after changing the start location on the settings page.
113
  * Changed: Added extra CSS to make it harder for themes to turn the map completely grey, and set the default opening hours alignment to left.
114
  * Changed: If you use the store locator in a tab, then it no longer requires the tab anchor to be 'wpsl-map-tab'. You can use whatever you want with the 'wpsl_map_tab_anchor' filter.
115
 
116
- = 2.0.1 =
117
  * Fixed: Prevented other plugins that use [underscore](http://underscorejs.org/) or [backbone](http://backbonejs.org/) from breaking the JavaScript templates, via [fatman49](https://profiles.wordpress.org/fatman49/) and [zurf](https://profiles.wordpress.org/zurf/).
118
  * Fixed: Street view not showing the correct location after using it more then once, via [marijke_25](https://profiles.wordpress.org/marijke_25/).
119
 
120
- = 2.0 =
121
  * New: Moved away from a custom db table, the store locations are now registered as custom post types.
122
  * Note: The upgrade procedure will ask you to convert the current store locations to custom post types. This takes around 1 minute for every 1000 store locations.
123
  * New: The option to enable/disable permalinks for the stores, and set a custom slug from the settings page.
1
  === WP Store Locator ===
2
  Plugin URI: http://wpstorelocator.co
3
  Contributors: tijmensmit
4
+ 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.3
8
+ Stable tag: 2.0.3
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl.html
11
 
107
 
108
  == Changelog ==
109
 
110
+ = 2.0.3, October 27, 2015 =
111
+ * Fixed: The default search radius is no longer ignored if the Geolocation API is used. Via [xeyefex](https://wordpress.org/support/profile/xeyefex).
112
+ * Changed: Replaced get_page ( deprecated ) with get_post.
113
+ * Changed: Adjusted the position, and size of the reset map / current location icon to make them match with the new [control styles](http://googlegeodevelopers.blogspot.com/2015/09/new-controls-style-for-google-maps.html) introduced in v3.22 of the Google Maps API.
114
+ * Changed: Made it harder for themes to overwrite the icon font that is used to show the reset map / current location icon.
115
+ * Changed: Removed support for the map's pan control and zoom control style from the settings page and [wpsl_map] shortcode attributes. They are both [deprecated](https://developers.google.com/maps/articles/v322-controls-diff) in v3.22 of the Google Maps API.
116
+
117
+ = 2.0.2, September 19, 2015 =
118
  * Fixed: Not all users always seeing the notice to convert the 1.x locations to custom post types.
119
  * Fixed: Prevented empty search results from ending up in the autoload transient.
120
  * Fixed: The autoload transient not being cleared after changing the start location on the settings page.
121
  * Changed: Added extra CSS to make it harder for themes to turn the map completely grey, and set the default opening hours alignment to left.
122
  * Changed: If you use the store locator in a tab, then it no longer requires the tab anchor to be 'wpsl-map-tab'. You can use whatever you want with the 'wpsl_map_tab_anchor' filter.
123
 
124
+ = 2.0.1, September 10, 2015 =
125
  * Fixed: Prevented other plugins that use [underscore](http://underscorejs.org/) or [backbone](http://backbonejs.org/) from breaking the JavaScript templates, via [fatman49](https://profiles.wordpress.org/fatman49/) and [zurf](https://profiles.wordpress.org/zurf/).
126
  * Fixed: Street view not showing the correct location after using it more then once, via [marijke_25](https://profiles.wordpress.org/marijke_25/).
127
 
128
+ = 2.0, September 7, 2015 =
129
  * New: Moved away from a custom db table, the store locations are now registered as custom post types.
130
  * Note: The upgrade procedure will ask you to convert the current store locations to custom post types. This takes around 1 minute for every 1000 store locations.
131
  * New: The option to enable/disable permalinks for the stores, and set a custom slug from the settings page.
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: http://wpstorelocator.co/
7
- Version: 2.0.2
8
  Text Domain: wpsl
9
  Domain Path: /languages/
10
  License: GPL v3
@@ -59,7 +59,7 @@ if ( !class_exists( 'WP_Store_locator' ) ) {
59
  public function define_constants() {
60
 
61
  if ( !defined( 'WPSL_VERSION_NUM' ) )
62
- define( 'WPSL_VERSION_NUM', '2.0.2' );
63
 
64
  if ( !defined( 'WPSL_URL' ) )
65
  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: http://wpstorelocator.co/
7
+ Version: 2.0.3
8
  Text Domain: wpsl
9
  Domain Path: /languages/
10
  License: GPL v3
59
  public function define_constants() {
60
 
61
  if ( !defined( 'WPSL_VERSION_NUM' ) )
62
+ define( 'WPSL_VERSION_NUM', '2.0.3' );
63
 
64
  if ( !defined( 'WPSL_URL' ) )
65
  define( 'WPSL_URL', plugin_dir_url( __FILE__ ) );