",r[o].infowindow+=wpsl_locator_searchhistory.searchTerm+": "+r[o].search_term,r[o].infowindow+=" "+wpsl_locator_searchhistory.searchTermFormatted+": "+r[o].search_term_formatted,r[o].infowindow+=" "+wpsl_locator_searchhistory.userIp+": "+r[o].user_ip,r[o].infowindow+=" "+wpsl_locator_searchhistory.distance+": "+r[o].distance,r[o].infowindow+="
",google.maps.event.addListener(c,"click",function(o,e){return function(){i.setContent(r[e].infowindow),i.open(l,o)}}(c,o)),l.fitBounds(a);var d=google.maps.event.addListener(l,"idle",function(){r.length<2&&l.setZoom(13),google.maps.event.removeListener(d)})}var m=google.maps.event.addListener(l,"bounds_changed",function(o){google.maps.event.removeListener(m)})},n.bindEvents()};
--------------------------------------------------------------------------------
/assets/js/simple-locator-non-ajax-results.js:
--------------------------------------------------------------------------------
1 | var NonAjaxResults=function(){var t=this,e=jQuery;return t.results=e("*[data-wpsl-result]"),t.resultData=[],t.init=function(){t.setResultData()},t.setResultData=function(){e.each(t.results,function(a,o){t.resultData[a]={latitude:e(this).attr("data-lat"),longitude:e(this).attr("data-lng"),permalink:e(this).attr("data-permalink"),title:e(this).attr("data-title")}}),t.loadMap()},t.loadMap=function(){markers=[];var a,o=t.resultData,n=wpsl_locator.mapstyles,l=wpsl_locator.mappin?wpsl_locator.mappin:"",s=new google.maps.LatLngBounds,r={mapTypeId:"roadmap",mapTypeControl:!1,zoom:8,styles:n,panControl:!1},i=new google.maps.InfoWindow,p=e(wpsl_locator_options.mapcont)[0];e(p).show();var g=new google.maps.Map(p,r);for(a=0;a"+o[e].title+''+wpsl_locator.viewlocation+"
"),i.open(g,t)}}(m,a)),markers.push(m),g.fitBounds(s);var d=google.maps.event.addListener(g,"idle",function(){o.length<2&&g.setZoom(13),google.maps.event.removeListener(d)})}var c=google.maps.event.addListener(g,"bounds_changed",function(t){google.maps.event.removeListener(c)});googlemap=g},t.init()};
--------------------------------------------------------------------------------
/assets/js/source/admin/simple-locator-admin.factory.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Admin Functionality for Simple Locator
3 | * @package Simple Locator
4 | * @author Kyle Phillips - https://github.com/kylephillips
5 | *
6 | */
7 |
8 | jQuery(document).ready(function(){
9 | new SimpleLocatorAdmin.Factory;
10 | });
11 |
12 | var SimpleLocatorAdmin = SimpleLocatorAdmin || {};
13 |
14 | // API Endpoints
15 | SimpleLocatorAdmin.endpoints = {
16 |
17 | }
18 |
19 | /**
20 | * Primary Simple Locator Class
21 | */
22 | SimpleLocatorAdmin.Factory = function()
23 | {
24 | var self = this;
25 | var $ = jQuery;
26 |
27 | self.init = function()
28 | {
29 | new SimpleLocatorAdmin.Modals;
30 | new SimpleLocatorAdmin.PostEdit;
31 | new SimpleLocatorAdmin.GeneralSettings;
32 | new SimpleLocatorAdmin.PostType;
33 | new SimpleLocatorAdmin.MapDisplay;
34 | new SimpleLocatorAdmin.ResultsDisplay;
35 | new SimpleLocatorAdmin.DefaultMap;
36 | new SimpleLocatorAdmin.SearchHistory;
37 | new SimpleLocatorAdmin.ImportTest;
38 | new SimpleLocatorAdmin.ImportUpload;
39 | new SimpleLocatorAdmin.ImportColumnMap;
40 | new SimpleLocatorAdmin.Import;
41 | new SimpleLocatorAdmin.ListingMap;
42 | new SimpleLocatorAdmin.ExportTemplates;
43 | new SimpleLocatorAdmin.QuickEdit;
44 | }
45 |
46 | return self.init();
47 | }
48 |
49 | /**
50 | * Global function catches Google API Errors
51 | * @link https://developers.google.com/maps/documentation/javascript/events#auth-errors
52 | */
53 | var editScreenGoogleApiError = false;
54 | function gm_authFailure(e){
55 | editScreenGoogleApiError = true;
56 | }
57 |
--------------------------------------------------------------------------------
/assets/js/source/admin/simple-locator-admin.import-test.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Test that the Google API key has the geocode service enabled
3 | * @package simple-locator
4 | */
5 | var SimpleLocatorAdmin = SimpleLocatorAdmin || {};
6 | SimpleLocatorAdmin.ImportTest = function()
7 | {
8 | var self = this;
9 | var $ = jQuery;
10 |
11 | self.selectors = {
12 | button : 'data-simple-locator-import-test-button',
13 | message : 'data-simple-locator-import-test-message'
14 | }
15 |
16 | self.bindEvents = function()
17 | {
18 | $(document).on('click', '[' + self.selectors.button+ ']', function(e){
19 | e.preventDefault();
20 | self.test();
21 | })
22 | }
23 |
24 | /**
25 | * Test
26 | */
27 | self.test = function()
28 | {
29 | $.ajax({
30 | url: ajaxurl,
31 | type: 'post',
32 | datatype: 'json',
33 | data: {
34 | action: 'wpslimporttest',
35 | nonce: wpsl_locator.locatorNonce
36 | },
37 | success: function(data){
38 | if ( data.status === 'testing' ){
39 | console.log(data);
40 | return;
41 | }
42 | if ( data.status === 'success' ){
43 | $('[' + self.selectors.message + ']').text(data.message).addClass('wpsl-alert');
44 | return;
45 | }
46 | if (data.status === 'error') {
47 | $('[' + self.selectors.message + ']').text(data.message).addClass('wpsl-error');
48 | return;
49 | }
50 | }
51 | });
52 | }
53 |
54 |
55 | return self.bindEvents();
56 | }
--------------------------------------------------------------------------------
/assets/js/source/admin/simple-locator-admin.modals.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Modal Windows
3 | *
4 | * @package Simple Locator
5 | * @author Kyle Phillips - https://github.com/kylephillips
6 | *
7 | * To use, include a modal backdrop and modal content window with the appropriate data-attributes
8 | * The data attributes should match the value of the toggle buttons data-modal-toggle attribute
9 | */
10 | var SimpleLocatorAdmin = SimpleLocatorAdmin || {};
11 | SimpleLocatorAdmin.Modals = function()
12 | {
13 | var plugin = this;
14 | var $ = jQuery;
15 |
16 | plugin.activeBtn = '';
17 | plugin.activeModal = '';
18 | plugin.modalOpen = false;
19 |
20 | plugin.selectors = {
21 | toggleBtn : '[data-wpsl-modal-toggle]',
22 | backdrop : '[data-wpsl-modal-backdrop]',
23 | closeBtn : '[data-wpsl-modal-close]'
24 | }
25 |
26 | plugin.bindEvents = function()
27 | {
28 | $(document).on('click', plugin.selectors.toggleBtn, function(e){
29 | e.preventDefault();
30 | plugin.activeBtn = $(this);
31 | plugin.openModal();
32 | });
33 | $(document).on('click', plugin.selectors.closeBtn, function(e){
34 | e.preventDefault();
35 | plugin.closeModals();
36 | });
37 | $(document).on('open-wpsl-modal-manual', function(e, modal){
38 | plugin.activeModal = $('*[data-wpsl-modal="' + modal + '"]');
39 | console.log(plugin.activeModal);
40 | plugin.openModal();
41 | });
42 | $(document).on('close-wpsl-modal-manual', function(e){
43 | plugin.closeModals();
44 | });
45 | $(document).on('click', plugin.selectors.backdrop, function(e){
46 | plugin.closeModals();
47 | });
48 | }
49 |
50 | /**
51 | * Open the Modal Window
52 | */
53 | plugin.openModal = function()
54 | {
55 | if ( plugin.modalOpen ){
56 | plugin.closeModals();
57 | return;
58 | }
59 | if ( $(plugin.activeBtn).length > 0 ){
60 | var modal = $(plugin.activeBtn).attr('data-wpsl-modal-toggle');
61 | plugin.activeModal = $('*[data-wpsl-modal="' + modal + '"]');
62 | }
63 | $(plugin.activeModal).addClass('active');
64 | plugin.modalOpen = true;
65 | $(document).trigger('open-wpsl-modal', [plugin.activeBtn, plugin.activeModal]);
66 | }
67 |
68 | /**
69 | * Close the Modal Window
70 | */
71 | plugin.closeModals = function()
72 | {
73 | plugin.modalOpen = false;
74 | $('[data-wpsl-modal]').removeClass('active');
75 | $(document).trigger('close-wpsl-modal', [plugin.activeBtn, plugin.activeModal]);
76 | }
77 |
78 | return plugin.bindEvents();
79 | }
--------------------------------------------------------------------------------
/assets/js/source/admin/simple-locator-admin.results-display.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Results Display Settings Page
3 | * @package simple-locator
4 | */
5 | var SimpleLocatorAdmin = SimpleLocatorAdmin || {};
6 | SimpleLocatorAdmin.ResultsDisplay = function()
7 | {
8 | var self = this;
9 | var $ = jQuery;
10 |
11 | self.bindEvents = function()
12 | {
13 | $(document).ready(function(){
14 | self.enableDatePicker();
15 | });
16 | $(document).on('click', '.wpsl-field-add', function(e){
17 | e.preventDefault();
18 | self.addResultField();
19 | });
20 | $(document).on('click', '.wpsl-post-field-add', function(e){
21 | e.preventDefault();
22 | self.addPostField();
23 | });
24 | }
25 |
26 | self.addResultField = function()
27 | {
28 | var field = '[' + $('#wpsl-fields').val() + ']';
29 | tinymce.activeEditor.execCommand('mceInsertContent', false, field);
30 | }
31 |
32 | self.addPostField = function()
33 | {
34 | var field = '[' + $('#wpsl-post-fields').val() + ']';
35 | tinymce.activeEditor.execCommand('mceInsertContent', false, field);
36 | }
37 |
38 | self.enableDatePicker = function()
39 | {
40 | $('[data-date-picker]').datepicker({
41 | beforeShow: function(input, inst){
42 | $('#ui-datepicker-div').addClass('wpsl-datepicker');
43 | }
44 | });
45 | }
46 |
47 | return self.bindEvents();
48 | }
--------------------------------------------------------------------------------
/assets/js/source/admin/simple-locator-admin.search-history.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Search History Map
3 | */
4 | var SimpleLocatorAdmin = SimpleLocatorAdmin || {};
5 | SimpleLocatorAdmin.SearchHistory = function()
6 | {
7 | var self = this;
8 | var $ = jQuery;
9 |
10 | self.locations;
11 |
12 | self.selectors = {
13 | container : 'data-simple-locator-search-history-map',
14 | perPage : 'data-simple-locator-history-per-page'
15 | }
16 |
17 | self.bindEvents = function()
18 | {
19 | $(document).ready(function(){
20 | if ( $('[' + self.selectors.container + ']').length < 1 ) return;
21 | self.locations = search_history_locations;
22 | self.loadMap();
23 | });
24 | $('[' + self.selectors.perPage + ']').on('change', function(){
25 | $(this).parents('form').submit();
26 | });
27 | }
28 |
29 | /**
30 | * Load the Map
31 | */
32 | self.loadMap = function()
33 | {
34 | var mapstyles = wpsl_locator_searchhistory.mapstyles;
35 | var mappin = ( wpsl_locator_searchhistory.mappin ) ? wpsl_locator_searchhistory.mappin : '';
36 | var bounds = new google.maps.LatLngBounds();
37 | var locations = self.locations;
38 | var container = $('[' + self.selectors.container + ']');
39 |
40 | var mapOptions = {
41 | mapTypeId: 'roadmap',
42 | mapTypeControl: false,
43 | zoom: 8,
44 | styles: mapstyles,
45 | scrollwheel: false,
46 | panControl : false
47 | }
48 |
49 | var infoWindow = new google.maps.InfoWindow(), marker, i;
50 | var map = new google.maps.Map( container[0], mapOptions );
51 |
52 | // Loop through array of markers & place each one on the map
53 | for( i = 0; i < locations.length; i++ ) {
54 | var position = new google.maps.LatLng(locations[i].latitude, locations[i].longitude);
55 | bounds.extend(position);
56 |
57 | var marker = new google.maps.Marker({
58 | position: position,
59 | map: map,
60 | title: locations[i].search_term,
61 | icon: mappin
62 | });
63 |
64 | locations[i].infowindow = '' + locations[i].date + ' ';
65 | locations[i].infowindow += '';
66 | locations[i].infowindow += wpsl_locator_searchhistory.searchTerm + ': ' + locations[i].search_term;
67 | locations[i].infowindow += ' ' + wpsl_locator_searchhistory.searchTermFormatted + ': ' + locations[i].search_term_formatted;
68 | locations[i].infowindow += ' ' + wpsl_locator_searchhistory.userIp + ': ' + locations[i].user_ip;
69 | locations[i].infowindow += ' ' + wpsl_locator_searchhistory.distance + ': ' + locations[i].distance;
70 | locations[i].infowindow += '
';
71 |
72 | // Info window for each marker
73 | google.maps.event.addListener(marker, 'click', (function(marker, i){
74 | return function() {
75 | infoWindow.setContent(locations[i].infowindow);
76 | infoWindow.open(map, marker);
77 | }
78 | })(marker, i));
79 |
80 | // Center the Map
81 | map.fitBounds(bounds);
82 | var listener = google.maps.event.addListener(map, "idle", function() {
83 | if ( locations.length < 2 ) {
84 | map.setZoom(13);
85 | }
86 | google.maps.event.removeListener(listener);
87 | });
88 | }
89 |
90 | // Fit the map bounds to all the pins
91 | var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) {
92 | google.maps.event.removeListener(boundsListener);
93 | });
94 |
95 | }
96 |
97 | return self.bindEvents();
98 | }
--------------------------------------------------------------------------------
/assets/js/source/simple-locator.default-map.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Show a Default Map if the option is selected
3 | * @package simple-locator
4 | */
5 | var SimpleLocator = SimpleLocator || {};
6 | SimpleLocator.DefaultMap = function()
7 | {
8 | var self = this;
9 | var $ = jQuery;
10 |
11 | self.mapIndex;
12 |
13 | self.selectors = {
14 | map : 'data-simple-locator-default-enabled'
15 | }
16 |
17 | self.bindEvents = function()
18 | {
19 | $(document).ready(function(){
20 | if ( wpsl_locator.default_user_center === 'true' ) return; // See geolocation for user-centered automatic maps
21 | self.queueDefaultMaps();
22 | });
23 | }
24 |
25 | /**
26 | * Queue the default map
27 | */
28 | self.queueDefaultMaps = function(errors)
29 | {
30 | var maps = $('[' + self.selectors.map + ']');
31 | $.each(maps, function(){
32 | var map = $(this);
33 | self.setMapIndex(map);
34 | self.loadDefault(map);
35 | });
36 | }
37 |
38 | /**
39 | * Set the map index for a map
40 | */
41 | self.setMapIndex = function(map)
42 | {
43 | var wrappers = $('[' + SimpleLocator.selectors.resultsWrapper + ']');
44 | var currentWrapper = $(map).parents('[' + SimpleLocator.selectors.resultsWrapper + ']');
45 | self.mapIndex = $(wrappers).index(currentWrapper);
46 | }
47 |
48 | /**
49 | * Load the default map
50 | */
51 | self.loadDefault = function(map)
52 | {
53 | var latitude = wpsl_locator.default_latitude;
54 | var longitude = wpsl_locator.default_longitude;
55 | $(map).removeClass('loading');
56 |
57 | var center = new google.maps.LatLng(latitude, longitude);
58 | var mapOptions = {
59 | center: center,
60 | zoom: parseInt(wpsl_locator.default_zoom),
61 | styles: wpsl_locator.mapstyles
62 | }
63 | // Override options if custom options are set
64 | if ( wpsl_locator.custom_map_options === '1' ) mapOptions = wpsl_locator.map_options;
65 | mapOptions.center = center;
66 | SimpleLocator.maps[self.mapIndex] = new google.maps.Map(map[0],mapOptions);
67 | }
68 |
69 | return self.bindEvents();
70 | }
--------------------------------------------------------------------------------
/assets/js/source/simple-locator.errors.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Error Handling
3 | * @package simple-locator
4 | */
5 | var SimpleLocator = SimpleLocator || {};
6 | SimpleLocator.Errors = function()
7 | {
8 | var self = this;
9 | var $ = jQuery;
10 |
11 | self.error;
12 | self.form;
13 | self.formContainer;
14 |
15 | self.bindEvents = function()
16 | {
17 | $(document).on('simple-locator-error', function(e, form, message){
18 | self.form = form;
19 | self.formContainer = $(form).parents('[' + SimpleLocator.selectors.formContainer + ']');
20 | self.toggleError(message);
21 | $(document).trigger('simple-locator-error-message', [form, message]);
22 | self.clearMap();
23 | wpsl_error(message, self.form);
24 | });
25 | }
26 |
27 | self.toggleError = function(message)
28 | {
29 | $(self.formContainer).removeClass('loading').addClass('has-error');
30 | $(self.formContainer).find('[' + SimpleLocator.selectors.formError + ']').text(message).show();
31 | }
32 |
33 | /**
34 | * Remove all the markers from the map
35 | */
36 | self.clearMap = function()
37 | {
38 | var wrappers = $('[' + SimpleLocator.selectors.resultsWrapper + ']');
39 | var mapIndex = $(self.formContainer).index(wrappers);
40 | if ( !SimpleLocator.markers[mapIndex] ) SimpleLocator.markers[mapIndex] = [];
41 | for (var i = 0; i < SimpleLocator.markers[mapIndex].length; i++){
42 | SimpleLocator.markers[mapIndex][i].setMap(null);
43 | }
44 | SimpleLocator.markers[mapIndex] = [];
45 | if ( wpsl_locator.includeuserpin === '' ) return;
46 | if ( !SimpleLocator.userPin[mapIndex] ) return;
47 | SimpleLocator.userPin[mapIndex].setMap(null);
48 | SimpleLocator.userPin[mapIndex] = null;
49 | }
50 |
51 | return self.bindEvents();
52 | }
--------------------------------------------------------------------------------
/assets/js/source/simple-locator.factory.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Primary Simple Locator Initialization
3 | * @package Simple Locator
4 | * @author Kyle Phillips - https://github.com/kylephillips
5 | *
6 | * Document Events:
7 | * simple-locator-error[form, message]
8 | * simple-locator-address-geocoded[results, form]
9 | * simple-locator-autocomplete-changed[place, form]
10 | * simple-locator-form-success[results, form]
11 | * simple-locator-infowindow-opened[mapIndex, markerIndex]
12 | * simple-locator-geolocation-available-set[available]
13 | * simple-locator-geolocation-success[form]
14 | * simple-locator-marker-clicked[marker, markerIndex, form, locationId]
15 | * simple-locator-results-rendered[listIndex, form]
16 | */
17 |
18 | jQuery(document).ready(function(){
19 | new SimpleLocator.Factory;
20 | });
21 |
22 | var SimpleLocator = SimpleLocator || {};
23 |
24 | // DOM Selectors
25 | SimpleLocator.selectors = {
26 | resultsWrapper : 'data-simple-locator-results-wrapper',
27 | form : 'data-simple-locator-form',
28 | formContainer : 'data-simple-locator-form-container',
29 | formError : 'data-simple-locator-form-error',
30 | results : 'data-simple-locator-results',
31 | map : 'data-simple-locator-map',
32 | mapNonAjax : 'data-simple-locator-map-non-ajax',
33 | inputAddress : 'data-simple-locator-input-address',
34 | inputLatitude : 'data-simple-locator-input-latitude',
35 | inputLongitude : 'data-simple-locator-input-longitude',
36 | inputUnit : 'data-simple-locator-input-unit',
37 | inputDistance : 'data-simple-locator-input-distance',
38 | inputFormattedLocation : 'data-simple-locator-input-formatted-location',
39 | inputGeocode : 'data-simple-locator-input-geocode',
40 | inputLimit : 'data-simple-locator-input-limit',
41 | submitButton : 'data-simple-locator-submit',
42 | infoWindowLink : 'data-simple-locator-open-infowindow',
43 | geoButton : 'data-simple-locator-geolocation-button',
44 | ajaxForm : 'data-simple-locator-ajax-form',
45 | paginationButton : 'data-simple-locator-pagination',
46 | pageJumpForm : 'data-simple-locator-page-jump-form'
47 | }
48 |
49 | // API Endpoints
50 | SimpleLocator.endpoints = {
51 | search : wpsl_locator.rest_url + '/search',
52 | locations : wpsl_locator.rest_url + '/locations'
53 | }
54 |
55 | // Map Objects
56 | SimpleLocator.maps = [];
57 |
58 | // Map Markers
59 | SimpleLocator.markers = [];
60 | SimpleLocator.userPin = [];
61 | SimpleLocator.formData = [];
62 | SimpleLocator.infoWindow;
63 | SimpleLocator.utilities;
64 |
65 | SimpleLocator.mapservice = wpsl_locator.mapservice;
66 |
67 | /**
68 | * Primary Simple Locator Class
69 | */
70 | SimpleLocator.Factory = function()
71 | {
72 | var self = this;
73 | var $ = jQuery;
74 |
75 | self.init = function()
76 | {
77 | SimpleLocator.utilities = new SimpleLocator.Utilities;
78 | new SimpleLocator.Geocoder;
79 | new SimpleLocator.Geolocation;
80 | new SimpleLocator.PlacesAutocomplete;
81 | new SimpleLocator.DefaultMap;
82 | new SimpleLocator.ResultsMapNonAjax;
83 | new SimpleLocator.SingleLocation;
84 | new SimpleLocator.AllLocations;
85 | new SimpleLocator.Form;
86 | new SimpleLocator.ResultsMap;
87 | new SimpleLocator.ResultsList;
88 | new SimpleLocator.InfoWindowOpen;
89 | new SimpleLocator.Errors;
90 | }
91 |
92 | return self.init();
93 | }
--------------------------------------------------------------------------------
/assets/js/source/simple-locator.functions-deprecated.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Callback functions available to users
3 | * Place in Theme scripts to perform actions after map has rendered
4 | * Theme scripts should be enqueued with a script dependency for 'simple-locator'
5 | * Deprecated as of version 2 in place of events.
6 | */
7 |
8 | // Deprecated global vars replaced with scoped variables
9 | var active_form = '';
10 | var formatted_address = '';
11 | var googlemaps_response = '';
12 |
13 | // Replaced with data-simple-locator-open-infowindow attribute on link
14 | function openInfoWindow(id){
15 | google.maps.event.trigger(SimpleLocator.markers[0][id], 'click');
16 | var lat = SimpleLocator.markers[0][id].getPosition().lat();
17 | var lng = SimpleLocator.markers[0][id].getPosition().lng();
18 | var position = new google.maps.LatLng(lat,lng);
19 | SimpleLocator.maps[0].panTo(position);
20 | SimpleLocator.maps[0].fitBounds(position);
21 | SimpleLocator.maps[0].setZoom(12);
22 | return false;
23 | }
24 |
25 | // Runs before form has been submitted/after click
26 | // Replaced with event: simple-locator-before-submit[form]
27 | function wpsl_before_submit(active_form, formelements){}
28 |
29 | // Runs after map & results render
30 | // Replaced with two events: simple-locator-map-rendered[mapIndex, form], simple-locator-results-rendered[listIndex, form]
31 | function wpsl_after_render(active_form){}
32 |
33 | // Runs on click event on a map marker
34 | // Replaced with event: simple-locator-marker-clicked[marker, index, form, post_id]
35 | function wpsl_click_marker(marker, i, active_form, post_id){}
36 |
37 | // Runs if no results were returned from the query
38 | // Replaced with event: simple-locator-error[error, form, message]
39 | function wpsl_no_results(location, active_form){}
40 |
41 | // Runs on form error
42 | // Replaced with event: simple-locator-error[error, form, message]
43 | function wpsl_error(message, active_form){}
44 |
45 | // Runs immediately on form success, pre-render of map/results
46 | // Replaced with event: simple-locator-form-success[data, form]
47 | function wpsl_success(resultcount, results, active_form){}
48 |
49 | // Returns the Google Maps Response
50 | function wpsl_googlemaps_response(){
51 | return googlemaps_response;
52 | }
53 |
54 | // Runs after locations map has rendered
55 | // Replaced with event: simple-locator-all-locations-rendered[map]
56 | function wpsl_all_locations_rendered(map){}
57 |
58 | // Runs after clicking on a marker in all locations map
59 | // Replaced with event: simple-locator-all-locations-marker-clicked[marker, infoWindow]
60 | function wpsl_all_locations_marker_clicked(marker, infoWindow){}
61 |
62 | function wpsl_googlemaps_response(){
63 | return googlemaps_response;
64 | }
--------------------------------------------------------------------------------
/assets/js/source/simple-locator.geocoder.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Geocode an Address
3 | * @package simple-locator
4 | */
5 | var SimpleLocator = SimpleLocator || {};
6 | SimpleLocator.Geocoder = function()
7 | {
8 | var self = this;
9 | var $ = jQuery;
10 |
11 | self.form;
12 | self.searchTerm;
13 | self.results = [];
14 |
15 | /**
16 | * Get coordinates and formatted for a provided address
17 | * @param address string
18 | * @param form object
19 | * @return array
20 | */
21 | self.getCoordinates = function(form)
22 | {
23 | self.form = form;
24 | self.searchTerm = $(self.form).find('[' + SimpleLocator.selectors.inputAddress + ']').val();
25 | var allowempty = $(self.form).attr('data-simple-locator-form-allow-empty');
26 | if ( typeof allowempty !== 'undefined' && allowempty == 'true' ){
27 | if ( typeof self.searchTerm == 'undefined' || self.searchTerm == '' ){
28 | $(document).trigger('simple-locator-address-geocoded', [self.results, self.form]);
29 | return;
30 | }
31 | }
32 | if ( SimpleLocator.mapservice === 'google' ) self.queryGoogleMaps();
33 | }
34 |
35 | /**
36 | * Query Google
37 | */
38 | self.queryGoogleMaps = function()
39 | {
40 | geocoder = new google.maps.Geocoder();
41 | geocoder.geocode({
42 | 'address' : self.searchTerm
43 | }, function(results, status){
44 | if ( status == google.maps.GeocoderStatus.OK ){
45 | googlemaps_response = results; // deprecated
46 | self.results['latitude'] = results[0].geometry.location.lat();
47 | self.results['longitude'] = results[0].geometry.location.lng();
48 | self.results['formatted_address'] = results[0].formatted_address;
49 | if ( wpsl_locator.jsdebug === '1' ){
50 | console.log('Google Geocode Response');
51 | console.log(self.results);
52 | }
53 | $(document).trigger('simple-locator-address-geocoded', [self.results, self.form]);
54 | } else {
55 | $(document).trigger('simple-locator-error', [self.form, wpsl_locator.notfounderror]);
56 | self.removeLoading();
57 | }
58 | });
59 | }
60 |
61 | /**
62 | * Remove Loading
63 | */
64 | self.removeLoading = function()
65 | {
66 | $(self.form).parents('[' + SimpleLocator.selectors.formContainer + ']').removeClass('loading');
67 | }
68 | }
--------------------------------------------------------------------------------
/assets/js/source/simple-locator.infowindow-open.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Open an infowindow when clicking a link
3 | * @package simple-locator
4 | */
5 | var SimpleLocator = SimpleLocator || {};
6 | SimpleLocator.InfoWindowOpen = function()
7 | {
8 | var self = this;
9 | var $ = jQuery;
10 |
11 | self.mapIndex;
12 | self.markerIndex;
13 |
14 | self.bindEvents = function()
15 | {
16 | $(document).on('click', '[' + SimpleLocator.selectors.infoWindowLink + ']', function(e){
17 | e.preventDefault();
18 | self.setIndexes($(this));
19 | self.openInfoWindow();
20 | });
21 | }
22 |
23 | /**
24 | * Set the map index
25 | */
26 | self.setIndexes = function(link)
27 | {
28 | var activeList = $(link).parents('[' + SimpleLocator.selectors.resultsWrapper + ']');
29 | var lists = $('[' + SimpleLocator.selectors.resultsWrapper + ']');
30 | self.mapIndex = $(activeList).index(lists);
31 | self.markerIndex = parseInt($(link).attr(SimpleLocator.selectors.infoWindowLink));
32 | }
33 |
34 | /**
35 | * Open the infowindow
36 | */
37 | self.openInfoWindow = function()
38 | {
39 | google.maps.event.trigger(SimpleLocator.markers[self.mapIndex][self.markerIndex], 'click');
40 | $(document).trigger('simple-locator-infowindow-opened', [self.mapIndex, self.markerIndex]);
41 | }
42 |
43 | return self.bindEvents();
44 | }
--------------------------------------------------------------------------------
/assets/js/source/simple-locator.places-autocomplete.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Enable Google Maps Places Autocomplete on Fields
3 | * @package simple-locator
4 | */
5 | var SimpleLocator = SimpleLocator || {};
6 | SimpleLocator.PlacesAutocomplete = function()
7 | {
8 | var self = this;
9 | var $ = jQuery;
10 |
11 | self.selectors = {
12 | input : 'data-simple-locator-autocomplete'
13 | }
14 |
15 | self.bindEvents = function()
16 | {
17 | $(document).ready(function(){
18 | self.enableAutocomplete();
19 | });
20 | }
21 |
22 | self.enableAutocomplete = function()
23 | {
24 | var inputs = $('[' + self.selectors.input + ']');
25 | $.each(inputs, function(i, v){
26 | var options = {};
27 | if ( wpsl_locator.custom_autocomplete ) options = wpsl_locator.autocomplete_options;
28 | var autocomplete = new google.maps.places.Autocomplete(this, options);
29 | var submitBtn = $(this).parents('[' + SimpleLocator.selectors.form + ']').find('[' + SimpleLocator.selectors.submitButton + ']');
30 | var form = $(this).parents('form');
31 | google.maps.event.addListener(autocomplete, 'place_changed', function(){
32 | $(document).trigger('simple-locator-autocomplete-changed', [autocomplete.getPlace(), form]);
33 | });
34 | });
35 | }
36 |
37 | return self.bindEvents();
38 | }
--------------------------------------------------------------------------------
/assets/js/source/simple-locator.single-location.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Display a single location map
3 | * @package simple-locator
4 | */
5 | var SimpleLocator = SimpleLocator || {};
6 | SimpleLocator.SingleLocation = function()
7 | {
8 | var self = this;
9 | var $ = jQuery;
10 |
11 | self.selectors = {
12 | mapContainer : 'data-simple-locator-single-map',
13 | latitude : 'data-latitude',
14 | longitude : 'data-longitude',
15 | title : 'data-title'
16 | }
17 |
18 | self.bindEvents = function()
19 | {
20 | $(document).ready(function(){
21 | self.loadAllMaps();
22 | });
23 | }
24 |
25 | self.loadAllMaps = function()
26 | {
27 | var maps = $('[' + self.selectors.mapContainer + ']');
28 | $.each(maps, function(){
29 | self.loadMap($(this));
30 | });
31 | }
32 |
33 | /**
34 | * Load the map
35 | */
36 | self.loadMap = function(container)
37 | {
38 | var latitude = parseFloat($(container).attr(self.selectors.latitude));
39 | var longitude = parseFloat($(container).attr(self.selectors.longitude));
40 | var title = $(container).attr(self.selectors.title);
41 | var mappin = ( wpsl_locator.mappinsingle ) ? wpsl_locator.mappinsingle : '';
42 | var position = new google.maps.LatLng( latitude, longitude );
43 | var options = {
44 | zoom: 12,
45 | styles: wpsl_locator.mapstyles
46 | };
47 |
48 | // Override options if custom options are set
49 | if ( wpsl_locator.custom_map_options === '1' ) options = wpsl_locator.map_options;
50 | options.center = position;
51 |
52 | var map = new google.maps.Map(container[0], options);
53 | var marker = new google.maps.Marker({
54 | position: position,
55 | map: map,
56 | icon: mappin,
57 | title: title
58 | });
59 | $(container).removeClass('loading');
60 | $(document).trigger('simple-locator-single-map-rendered', [map, marker, container]);
61 | }
62 |
63 | return self.bindEvents();
64 | }
--------------------------------------------------------------------------------
/assets/js/source/simple-locator.utilities.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Utility Functions
3 | * @package simple-locator
4 | */
5 | var SimpleLocator = SimpleLocator || {};
6 | SimpleLocator.Utilities = function()
7 | {
8 | var self = this;
9 | var $ = jQuery;
10 |
11 | /**
12 | * Get the currently displayed radius/distance of a map
13 | * @return int
14 | */
15 | self.getMapRadius = function(map)
16 | {
17 | var bounds = map.getBounds();
18 | var center = bounds.getCenter();
19 | var ne = bounds.getNorthEast();
20 | var r = 3963.0; // radius of earth in miles
21 |
22 | var lat1 = center.lat() / 57.2958;
23 | var lon1 = center.lng() / 57.2958;
24 | var lat2 = ne.lat() / 57.2958;
25 | var lon2 = ne.lng() / 57.2958;
26 |
27 | var dis = r * Math.acos(Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1));
28 | return dis;
29 | }
30 |
31 | /**
32 | * Get a map center point
33 | * @return array [latitude, longitude]
34 | */
35 | self.getMapCenterPoint = function(map)
36 | {
37 | var bounds = map.getBounds();
38 | var center = bounds.getCenter();
39 | var latlng = [center.lat(), center.lng()];
40 | return latlng;
41 | }
42 |
43 | /**
44 | * Cluster markers if set to do so
45 | */
46 | self.clusterMarkers = function(map, markers)
47 | {
48 | var options = {
49 | map: map,
50 | markers: markers
51 | }
52 | if ( typeof wpsl_locator.cluster_renderer !== 'undefined' && wpsl_locator.cluster_renderer !== '' ) options.renderer = wpsl_locator.cluster_renderer;
53 | if ( wpsl_locator.marker_clusters === '1' && typeof markerClusterer.MarkerClusterer !== 'undefined' ){
54 | const markerCluster = new markerClusterer.MarkerClusterer(options);
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/assets/screenshot-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-1.png
--------------------------------------------------------------------------------
/assets/screenshot-10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-10.png
--------------------------------------------------------------------------------
/assets/screenshot-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-2.png
--------------------------------------------------------------------------------
/assets/screenshot-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-3.png
--------------------------------------------------------------------------------
/assets/screenshot-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-4.png
--------------------------------------------------------------------------------
/assets/screenshot-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-5.png
--------------------------------------------------------------------------------
/assets/screenshot-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-6.png
--------------------------------------------------------------------------------
/assets/screenshot-7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-7.png
--------------------------------------------------------------------------------
/assets/screenshot-8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-8.png
--------------------------------------------------------------------------------
/assets/screenshot-9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/assets/screenshot-9.png
--------------------------------------------------------------------------------
/assets/scss/_admin-loading.scss:
--------------------------------------------------------------------------------
1 | .wpsl-icon-spinner {
2 | position: relative;
3 | top: 5px;
4 | width: 40px;
5 | vertical-align: top;
6 | // display: none;
7 | }
8 |
9 | .wpsl-icon-spinner-image {
10 | animation: wpslrotate linear 1.5s infinite;
11 | position: absolute;
12 | line-height: .1;
13 | }
14 |
15 | @keyframes wpslrotate {
16 | 0% {
17 | transform: rotate(0deg);
18 | transform-origin: center center;
19 | }
20 | 50% {
21 | transform: rotate(180deg);
22 | transform-origin: center center;
23 | }
24 | 100% {
25 | transform: rotate(360deg);
26 | transform-origin: center center;
27 | }
28 | }
--------------------------------------------------------------------------------
/assets/scss/_admin-location-map.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Map in location listing (post list table)
3 | // --------------------------------------------------
4 |
5 | // Hide the column data is stored in
6 | th.column-wpsl-coordinates,
7 | td.column-wpsl-coordinates {
8 | // display: none;
9 | }
10 |
11 | // The post listing map
12 | .wpsl-post-listing-map {
13 | background-color: $white;
14 | margin: 2em 0;
15 | height: 400px;
16 | }
--------------------------------------------------------------------------------
/assets/scss/_admin-quick-edit.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Location Quick Edit
3 | // --------------------------------------------------
4 | .simple-locator-quick-edit-alert {
5 | background-color: $red;
6 | color: $white;
7 | padding: .5em;
8 | margin-bottom: .5em;
9 | display: none;
10 | }
11 |
12 | .simple-locator-quick-edit-spinner {
13 | display: none;
14 | float: right;
15 | width: 30px;
16 | height: 30px;
17 | margin-right: 5px;
18 | position: relative;
19 | top: 2px;
20 | img {
21 | width: 24px;
22 | height: 24px;
23 | }
24 | }
25 |
26 | .simple-locator-quick-edit {
27 | h3 {
28 | color: #555;
29 | font-size: 12px;
30 | text-transform: uppercase;
31 | margin: 0 0 1em 0;
32 | }
33 | .inner {
34 | display: flex;
35 | justify-content: space-between;
36 | margin-bottom: 1em;
37 | }
38 | .map {
39 | width: 49%;
40 | background-color: rgba($black, .03);
41 | }
42 | .fields {
43 | width: 49%;
44 | @include clearfix;
45 | .field {
46 | position: relative;
47 | padding: 5px 0 5px 150px;
48 | label {
49 | position: absolute;
50 | left: 0;
51 | top: 10px;
52 | }
53 | input, select {
54 | width: 100%;
55 | }
56 | }
57 | }
58 | .buttons {
59 | @include clearfix;
60 | button {
61 | float: right;
62 | &:first-child {
63 | float: left;
64 | }
65 | }
66 | .button-primary {
67 | margin-left: 5px;
68 | }
69 | } // .buttons
70 | } // .dealer-quick-edit
--------------------------------------------------------------------------------
/assets/scss/_alerts.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Alerts
3 | // --------------------------------------------------
4 | .wpsl-error,
5 | .wpsl-info {
6 | display: block;
7 | padding: .75rem 1.25rem;
8 | border-radius: 3px;
9 | margin: 0;
10 | margin-bottom: 10px;
11 | background-color: #f2dede;
12 | color: #a94442;
13 | border: 1px solid #ebcccc;
14 | }
15 |
16 | .wpsl-info {
17 | background-color: rgba($blue, .2);
18 | border-color: rgba($blue, .15);
19 | color: $black;
20 | padding: .75em;
21 | }
--------------------------------------------------------------------------------
/assets/scss/_buttons.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Buttons
3 | // --------------------------------------------------
4 | .button-danger {
5 | text-decoration: none;
6 | display: inline-block;
7 | background: transparent;
8 | background-color: $red;
9 | border: 1px solid $red;
10 | border-radius: 2px;
11 | line-height: 30px;
12 | padding: 0px 10px;
13 | cursor: pointer;
14 | color: $white;
15 | box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, .3);
16 | &:hover, &:active, &:focus {
17 | background: transparent;
18 | background-color: darken($red, 8%);
19 | border-color: darken($red, 8%);;
20 | color: $white;
21 | }
22 | &:disabled {
23 | opacity: .5;
24 | }
25 | }
--------------------------------------------------------------------------------
/assets/scss/_datepicker.scss:
--------------------------------------------------------------------------------
1 | //
2 | // JQuery UI Datepicker for Nested Pages
3 | // --------------------------------------------------
4 | .wpsl-datepicker.ui-datepicker {
5 | background-color: $white;
6 | font-size: 90%;
7 | box-shadow: 0px 0px 3px 0px rgba(0,0,0,.4);
8 | border-radius: 3px;
9 | padding: 0;
10 | width: auto;
11 |
12 | // Prev & Next
13 | .ui-datepicker-next, .ui-datepicker-prev {
14 | position: absolute;
15 | color: $white;
16 | top: 0px;
17 | right: 0px;
18 | cursor: pointer;
19 | display: block;
20 | width: 35px;
21 | height: 35px;
22 | font-size: 0;
23 | background: url('../images/datepicker-arrow-next.png');
24 | background-position: center;
25 | opacity: 1;
26 | transition: opacity 200ms ease;
27 | &:hover {
28 | opacity: .5;
29 | transition: opacity 200ms ease;
30 | }
31 | }
32 |
33 | .ui-datepicker-calendar {
34 | margin: 0;
35 | }
36 |
37 | .ui-datepicker-prev {
38 | right: auto;
39 | left: 0px;
40 | background: url('../images/datepicker-arrow-prev.png');
41 | }
42 |
43 | .ui-datepicker-header {
44 | padding: 0;
45 | }
46 |
47 | // Month & Year
48 | .ui-datepicker-title {
49 | background-color: darken($white, 90%);
50 | text-align: center;
51 | color: $white;
52 | height: 35px;
53 | line-height: 35px;
54 | border-radius: 3px 3px 0 0;
55 | margin: 0;
56 | }
57 |
58 | // Calendar Table
59 | .ui-datepicker-calendar {
60 | border-collapse: collapse;
61 | table {
62 | width: auto;
63 | }
64 | th, td {
65 | text-align: center;
66 | width: 30px;
67 | height: 30px;
68 | }
69 | // Days
70 | th {
71 | background-color: darken($white, 10%);
72 | text-transform: uppercase;
73 | font-size: 11px;
74 | letter-spacing: 1px;
75 | padding: 0;
76 | }
77 | td {
78 | border-top: 1px solid darken($white, 8%);
79 | border-left: 1px solid darken($white, 8%);
80 | padding: 0;
81 | &:first-child {
82 | border-left: 0;
83 | }
84 | }
85 | a {
86 | text-align: center;
87 | padding: 0;
88 | text-decoration: none;
89 | color: $black;
90 | display: block;
91 | background-color: $white;
92 | transition: all 200ms ease;
93 | width: 30px;
94 | height: 30px;
95 | line-height: 30px;
96 | &.ui-state-active {
97 | background-color: darken($white, 90%);
98 | color: $white;
99 | }
100 | &:hover {
101 | background-color: $black;
102 | color: $white;
103 | transition: all 200ms ease;
104 | }
105 | }
106 | }
107 |
108 | }
--------------------------------------------------------------------------------
/assets/scss/_form-results.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Form Results
3 | // --------------------------------------------------
4 | .wpsl-results {
5 | clear: both;
6 | ul {
7 | @include unstyled();
8 | @include clearfix();
9 | li {
10 | float: left;
11 | width: 46%;
12 | clear: both;
13 | margin:0 0 20px 0 !important;
14 | list-style: none !important;
15 | &:nth-child(even){
16 | float: right;
17 | clear: none;
18 | }
19 | }
20 | }
21 | .gm-style-iw h4 {
22 | margin: 0 0 .5em 0;
23 | }
24 | } // .wpsl-results
--------------------------------------------------------------------------------
/assets/scss/_form.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Form
3 | // --------------------------------------------------
4 | .simple-locator-form {
5 | form {
6 | margin-bottom: 20px;
7 | }
8 | label {
9 | display: block;
10 | }
11 | .address-input {
12 | float: left;
13 | width: 60%;
14 | input[type='text'],
15 | input[type='tel']{
16 | width: 100%;
17 | box-sizing: border-box;
18 | }
19 | }
20 | .distance {
21 | float: right;
22 | clear: none;
23 | width: 35%;
24 | select {
25 | width: 100%;
26 | }
27 | }
28 | .submit {
29 | clear: both;
30 | padding-top: 20px;
31 | margin-bottom: 20px;
32 | }
33 | .geo_button_cont {
34 | display: inline-block;
35 | vertical-align: top;
36 | }
37 | &.loading {
38 | .wpsl-icon-spinner {
39 | display: inline-block;
40 | }
41 | }
42 | }
43 |
44 | .wpsl-taxonomy-filters {
45 | clear: both;
46 | }
47 |
48 | .wpsl-icon-spinner {
49 | position: relative;
50 | top: 5px;
51 | width: 40px;
52 | vertical-align: top;
53 | display: none;
54 | &.visible {
55 | display: inline-block;
56 | margin-left: 5px;
57 | }
58 | }
59 |
60 | .wpsl-icon-spinner-image {
61 | animation: wpslrotate linear 1.5s infinite;
62 | position: absolute;
63 | line-height: .1;
64 | }
65 |
66 | @keyframes wpslrotate {
67 | 0% {
68 | transform: rotate(0deg);
69 | transform-origin: center center;
70 | }
71 | 50% {
72 | transform: rotate(180deg);
73 | transform-origin: center center;
74 | }
75 | 100% {
76 | transform: rotate(360deg);
77 | transform-origin: center center;
78 | }
79 | }
--------------------------------------------------------------------------------
/assets/scss/_maps.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Maps
3 | // --------------------------------------------------
4 | .wpsl-map {
5 | clear: both;
6 | width: 100%;
7 | height: 250px;
8 | margin: 20px 0px;
9 | img {
10 | width: auto;
11 | max-width: none !important;
12 | }
13 | &.loading {
14 | display: none;
15 | }
16 | }
--------------------------------------------------------------------------------
/assets/scss/_meta-fields.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Meta Fields for Post Type
3 | // --------------------------------------------------
4 | .wpsl-meta label {
5 | display: block;
6 | }
7 | .wpsl-meta input[type='text'], .wpsl-meta select{
8 | width: 100%;
9 | height: 40px;
10 | }
11 | .wpsl-meta textarea {
12 | width: 100%;
13 | height: 80px;
14 | }
15 | .wpsl-meta hr {
16 | clear: both;
17 | background: transparent;
18 | border: 0;
19 | }
20 |
21 | /* Clearfix */
22 | .wpsl-meta, .wpsl-meta .latlng {
23 | zoom:1;
24 | }
25 | .wpsl-meta:before, .wpsl-meta:after, .wpsl-meta .latlng:before, .wpsl-meta .latlng:after {
26 | content: " "; /* 1 */
27 | display: table; /* 2 */
28 | }
29 | .wpsl-meta:after, .wpsl-meta .latlng:after {
30 | clear: both;
31 | }
32 |
33 | /* Settings */
34 |
35 | /* Fields */
36 | .wpsl-meta p {
37 | float: left;
38 | }
39 | .wpsl-meta p.full {
40 | float: none;
41 | clear: both;
42 | }
43 | .wpsl-meta p.city {
44 | width: 50%;
45 | margin-right: 5%;
46 | }
47 | .wpsl-meta p.state {
48 | width: 20%;
49 | margin-right: 5%;
50 | }
51 | .wpsl-meta p.zip {
52 | width: 20%;
53 | float: right;
54 | }
55 | .wpsl-meta p.half {
56 | width: 48%;
57 | float: left;
58 | }
59 | .wpsl-meta p.right {
60 | float: right;
61 | }
62 |
63 | /* Latitude & Longitude */
64 | .wpsl-meta .latlng {
65 | clear: both;
66 | background-color: rgba(0,0,0,.05);
67 | padding: 15px;
68 | margin: 20px 0;
69 | border-radius: 6px;
70 | max-width: none;
71 | }
72 | .wpsl-meta input:disabled {
73 | cursor: not-allowed;
74 | }
75 | .wpsl-meta .latlng span {
76 | display: block;
77 | font-style: oblique;
78 | border-radius: 3px;
79 | }
80 | .wpsl-meta .latlng p {
81 | float: left;
82 | width: 48%;
83 | }
84 | .wpsl-meta .latlng p.lat {
85 | float: right;
86 | }
87 |
88 | #wpslmap {
89 | display: none;
90 | clear: both;
91 | height: 300px;
92 | background-color: rgba(0,0,0,.05);
93 | }
--------------------------------------------------------------------------------
/assets/scss/_mixins.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Mixins
3 | // --------------------------------------------------
4 |
5 | @mixin clearfix {
6 | zoom:1;
7 | &:before,
8 | &:after {
9 | content: " "; /* 1 */
10 | display: table; /* 2 */
11 | }
12 | &:after {
13 | clear: both;
14 | }
15 | }
16 |
17 | @mixin unstyled {
18 | list-style-type:none;
19 | margin:0;
20 | padding:0;
21 | }
22 |
23 | .pull-right {
24 | float:right;
25 | }
26 |
27 | @mixin translate($x, $y) {
28 | -webkit-transform: translate($x, $y);
29 | -ms-transform: translate($x, $y); // IE9 only
30 | -o-transform: translate($x, $y);
31 | transform: translate($x, $y);
32 | }
33 |
34 | @mixin transition-transform($transition...) {
35 | -webkit-transition: -webkit-transform $transition;
36 | -moz-transition: -moz-transform $transition;
37 | -o-transition: -o-transform $transition;
38 | transition: transform $transition;
39 | }
--------------------------------------------------------------------------------
/assets/scss/_modals.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Modals
3 | // --------------------------------------------------
4 | .wpsl-modal-backdrop {
5 | position: fixed;
6 | width: 100%;
7 | height: 100%;
8 | background-color: rgba(0,0,0,.85);
9 | top: 0;
10 | left: 0;
11 | z-index: 1000;
12 | visibility: hidden;
13 | opacity: 0;
14 | transition: all 500ms ease;
15 | &.active {
16 | visibility: visible;
17 | opacity: 1;
18 | transition: all 200ms ease;
19 | }
20 | }
21 |
22 | .wpsl-modal-content {
23 | z-index: 1001;
24 | position: fixed;
25 | top: 50%;
26 | top: -200%;
27 | left: 50%;
28 | width: 50%;
29 | background-color: $white;
30 | border-radius: 2px;
31 | transform: translateX(-50%);
32 | transition: all 500ms ease;
33 | &.small {
34 | width: 400px;
35 | }
36 | &.active {
37 | top: 50px;
38 | transition: all 200ms ease;
39 | }
40 | }
41 |
42 | .wpsl-modal-content-body {
43 | padding: 1em;
44 | max-height: 300px;
45 | overflow: auto;
46 | @include clearfix;
47 | &.no-padding {
48 | padding: 0;
49 | }
50 | }
51 |
52 | .wpsl-modal-content-footer {
53 | @include clearfix;
54 | padding: .7em;
55 | border-top: 1px solid rgba(#000, .1);
56 | .button-primary {
57 | float: right;
58 | }
59 | }
60 |
61 |
62 | @media (max-width: 767px)
63 | {
64 | h3 {
65 | line-height: 1.3;
66 | }
67 | .wpsl-modal-content {
68 | width: 90%;
69 | &.small {
70 | width: 90%;
71 | }
72 | &.active {
73 | top: 20px;
74 | }
75 | }
76 | .wpsl-modal-content-body {
77 | height: 300px;
78 | overflow-y: scroll;
79 | -webkit-overflow-scrolling: touch;
80 | overflow-x: hidden;
81 | }
82 | .wpsl-modal-video {
83 | width: 100%;
84 | &.modal-content.active {
85 | padding: 0;
86 | }
87 | }
88 | }
89 |
90 | @media print {
91 | .wpsl-modal-backdrop,
92 | .wpsl-modal-content {
93 | display: none;
94 | }
95 | }
--------------------------------------------------------------------------------
/assets/scss/_pagination.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Pagination
3 | // --------------------------------------------------
4 | .wpsl-pagination-button {
5 | float: left;
6 | &.button-previous {
7 | margin-right: 10px;
8 | }
9 | }
10 |
11 | .wpsl-results-current-count {
12 | opacity: .5;
13 | }
14 |
15 | .wpsl-form-page-selection {
16 | clear: both;
17 | padding-top: 1em;
18 | font-style: oblique;
19 | opacity: .5;
20 | }
21 |
22 | .wpsl-pagination {
23 | @include clearfix;
24 | }
25 |
26 | .wpsl-jump-to-page-form {
27 | float: right;
28 | .current-page,
29 | .total-pages {
30 | display: inline-block;
31 | margin: 0;
32 | }
33 | button[type="submit"]{
34 | display: inline-block;
35 | float: none;
36 | margin-left: 8px;
37 | }
38 | input[type="tel"]{
39 | display: inline-block;
40 | width: 50px;
41 | text-align: center;
42 | margin: 0 3px;
43 | }
44 | }
--------------------------------------------------------------------------------
/assets/scss/_settings-default-map.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Default Map Settings
3 | // --------------------------------------------------
4 | .wpsl-settings .row .wpsl-default-map {
5 | .search-form {
6 | @include clearfix;
7 | position: relative;
8 | padding: 8px 90px 8px 8px;
9 | background-color: $gray-lighter;
10 | border: 1px solid $border;
11 | }
12 | input[type="text"]{
13 | float: left;
14 | height: 28px;
15 | margin: 0;
16 | }
17 | button {
18 | position: absolute;
19 | width: 77px;
20 | right: 8px;
21 | }
22 | }
23 |
24 | #wpsl-default {
25 | clear: both;
26 | height: 250px;
27 | width: 100%;
28 | }
--------------------------------------------------------------------------------
/assets/scss/_settings-import-previous.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Previous Imports on Step One
3 | // --------------------------------------------------
4 | .wpsl-previous-imports {
5 |
6 | .import {
7 | background-color: $white;
8 | border-top: 1px solid darken($white, 12%);
9 | &.first {
10 | border-top: 0;
11 | }
12 | } // .import
13 |
14 | .import-title {
15 | @include clearfix;
16 | padding: 8px;
17 | h4 {
18 | margin: 0;
19 | position: relative;
20 | top: 3px;
21 | }
22 | a {
23 | float: right;
24 | position: relative;
25 | z-index: 1;
26 | }
27 | }
28 |
29 | .import-body {
30 | display: none;
31 | padding: 8px;
32 | border-top: 1px solid darken($white, 12%);
33 | @include clearfix;
34 | }
35 |
36 | .import-meta {
37 | float: left;
38 | width: 45%;
39 | }
40 |
41 | .wpsl-import-save-template {
42 | float: right;
43 | margin-top: 1em;
44 | width: 45%;
45 | background-color: darken($white, 6%);
46 | padding: 1em;
47 | button {
48 | display: block;
49 | }
50 | input[type="text"]{
51 | width: 100%;
52 | margin-bottom: 10px;
53 | }
54 | }
55 |
56 | .import-footer {
57 | padding: 8px 0;
58 | clear: both;
59 | .button-danger {
60 | margin-right: 10px;
61 | }
62 | p {
63 | margin: 0;
64 | }
65 | }
66 |
67 | } // .wpsl-previous-imports
--------------------------------------------------------------------------------
/assets/scss/_settings-import-templates.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Import Templates on Step One
3 | // --------------------------------------------------
4 | .wpsl-import-template-list {
5 | .row.import-template {
6 |
7 | .title {
8 | @include clearfix;
9 | padding: 8px;
10 | // border-top: 1px solid darken($white, 12%);
11 | .button {
12 | float: right;
13 | position: relative;
14 | top: -5px;
15 | }
16 | p {
17 | margin: 0;
18 | padding-top: 5px;
19 | }
20 | }
21 | &.first .title {
22 | border-top: 0;
23 | }
24 | } // .row
25 | h4 {
26 | margin: 0;
27 | }
28 | .details {
29 | padding: 5px;
30 | display: none;
31 | .columns {
32 | width: 100%;
33 | border-collapse: collapse;
34 | }
35 | th, td {
36 | text-align: left;
37 | padding: 5px;
38 | }
39 | th {
40 | background-color: darken($white, 50%);
41 | font-weight: normal;
42 | color: $white;
43 | }
44 | tbody tr:nth-child(even){
45 | background-color: darken($white, 6%);
46 | }
47 | }
48 | .summary {
49 | background-color: darken($white, 6%);
50 | padding: 5px;
51 | li {
52 | @include clearfix;
53 | }
54 | }
55 | } // .wpsl-import-template-list
--------------------------------------------------------------------------------
/assets/scss/_settings-map-options.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Map Style Choices
3 | // --------------------------------------------------
4 | .wpsl-settings {
5 | .map-styles-header {
6 | padding: 1em;
7 | h3 {
8 | margin: 0 0 8px 0;
9 | }
10 | p {
11 | margin: 0;
12 | }
13 | }
14 | }
15 | .wpsl-settings-map-style-choice {
16 | ul {
17 | @include unstyled;
18 | @include clearfix;
19 | padding: 1em 1em 1em 0;
20 | max-height: 400px;
21 | overflow: auto;
22 | }
23 | li {
24 | float: left;
25 | width: 48%;
26 | margin: 0 0 2em 0;
27 | box-sizing: border-box;
28 | clear: both;
29 | &:nth-child(even){
30 | float: right;
31 | clear: none;
32 | }
33 | .map {
34 | display: block;
35 | width: 100%;
36 | height: 150px;
37 | background-repeat: no-repeat;
38 | background-size: 40px;
39 | background-position: center;
40 | box-sizing: border-box;
41 | transition: all 200ms ease;
42 | }
43 | h4 {
44 | margin: 0;
45 | background-color: $gray-lighter;
46 | border: 1px solid $border-light;
47 | border-bottom: 0;
48 | padding: 5px;
49 | text-align: center;
50 | font-weight: normal;
51 | text-transform: uppercase;
52 | letter-spacing: .05em;
53 | font-size: .9em;
54 | }
55 | .choose-style {
56 | display: block;
57 | text-align: center;
58 | background-color: darken(#fff, 50%);
59 | padding: 8px 0;
60 | color: #fff;
61 | text-decoration: none;
62 | transition: all 200ms ease;
63 | box-sizing: border-box;
64 | &:focus, &:active {
65 | outline: none;
66 | box-shadow: none;
67 | }
68 | &:hover {
69 | background-color: #0074a2;
70 | }
71 | }
72 | &.active {
73 | .map {
74 | border: 4px solid #0074a2;
75 | border-bottom: 0;
76 | transition: all 200ms ease;
77 | }
78 | .choose-style {
79 | border: 4px solid #0074a2;
80 | border-top: 0;
81 | border-bottom: 0;
82 | background-color: #0074a2;
83 | }
84 | }
85 | }
86 | } // wpsl-map-style-choices
87 | .wpsl-settings-map-style-custom {
88 | padding-top: 1em;
89 | .wpsl-alert {
90 | margin: 0;
91 | }
92 | }
93 |
94 |
95 |
--------------------------------------------------------------------------------
/assets/scss/_settings-posttypes.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Post Type Settings
3 | // --------------------------------------------------
4 | .latlng {
5 | background-color: rgba($black, .08);
6 | padding: 20px;
7 | margin-top: 20px;
8 | @include clearfix;
9 | }
10 |
11 | .wpsl-show-hidden {
12 | display: block;
13 | margin-bottom: 20px;
14 | }
15 |
16 | .wpsl-left-field,
17 | .wpsl-right-field {
18 | float: left;
19 | width: 45%;
20 | select {
21 | width: 100%;
22 | }
23 | label {
24 | margin: 0;
25 | }
26 | }
27 |
28 | .wpsl-degree-info {
29 | clear: both;
30 | padding-top: 15px;
31 | margin: 0;
32 | font-style: oblique;
33 | }
34 |
35 | .wpsl-right-field {
36 | float: right;
37 | }
38 |
39 | .wpsl-posttype-settings-labels {
40 | .post-type-row {
41 | display: table;
42 | width: 100%;
43 | padding: .5em;
44 | border-top: 1px solid $border-light;
45 | box-sizing: border-box;
46 | &:first-child {
47 | border: 0;
48 | }
49 | }
50 | label {
51 | display: table-cell;
52 | width: 30%;
53 | }
54 | .post-type-field {
55 | display: table-cell;
56 | width: 70%;
57 | }
58 | }
59 |
60 | .wpsl-red {
61 | color: $red;
62 | }
63 |
64 | .wpsl-acf-map-setting {
65 | @extend .latlng;
66 | h3 {
67 | font-size: 16px;
68 | margin-top: 0;
69 | }
70 | select {
71 | width: 100%;
72 | }
73 | }
74 |
75 |
76 |
--------------------------------------------------------------------------------
/assets/scss/_settings-results-fields.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Settings - Results Fields
3 | // --------------------------------------------------
4 | .wpsl-results-field-selector {
5 | background-color: rgba($black, .05);
6 | border: 1px solid $border-light;
7 | padding: 8px;
8 | @include clearfix;
9 | .left, .right {
10 | width: 48%;
11 | position: relative;
12 | float: left;
13 | padding-right: 55px;
14 | box-sizing: border-box;
15 | @include clearfix;
16 | label {
17 | display: block;
18 | }
19 | select {
20 | float: left;
21 | width: 100%;
22 | }
23 | button {
24 | position: absolute;
25 | width: 50px;
26 | right: 0;
27 | bottom: 0;
28 | }
29 | }
30 | .right {
31 | float: right;
32 | }
33 | }
34 |
35 | .wpsl-limit-setting {
36 | input[type="text"]{
37 | width: 100%;
38 | }
39 | }
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/assets/scss/_settings-search-history.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Search History
3 | // --------------------------------------------------
4 | .wpsl-search-history-actions {
5 | background-color: $gray-lighter;
6 | padding: 1em;
7 | box-sizing: border-box;
8 | @include clearfix;
9 | form, .button {
10 | float: left;
11 | }
12 | form.right {
13 | float: right;
14 | }
15 | .button {
16 | margin-right: 1em;
17 | }
18 | }
19 | .wpsl-search-history-pagination {
20 | li {
21 | display: inline-block;
22 | margin-left: .5em;
23 | &:first-child {
24 | margin: 0;
25 | }
26 | }
27 | &.bottom {
28 | border-top: 1px solid $border-light;
29 | padding: 1em;
30 | @include clearfix;
31 | ul {
32 | margin: 0;
33 | float: right;
34 | }
35 | }
36 | }
37 | .wpsl-search-history-table-header {
38 | clear: both;
39 | border-top: 1px solid $border-light;
40 | @include clearfix;
41 | padding: 1em;
42 | h3 {
43 | display: inline-block;
44 | vertical-align: top;
45 | margin: 0;
46 | line-height: 30px;
47 | font-size: 1em;
48 | }
49 | select {
50 | float: right;
51 | margin: 0;
52 | }
53 | .wpsl-search-history-pagination {
54 | float: right;
55 | margin-left: 10px;
56 | ul {
57 | margin: 0;
58 | }
59 | }
60 | }
61 | .wpsl-search-history-form {
62 | background-color: $white;
63 | position: relative;
64 | @include clearfix;
65 | label {
66 | display: block;
67 | }
68 | .inputs {
69 | @include clearfix;
70 | padding: 1em 100px 1em 1em;
71 | }
72 | .keyword {
73 | float: left;
74 | width: 30%;
75 | box-sizing: border-box;
76 | }
77 | input[type="text"]{
78 | width: 100%;
79 | }
80 | .date-range {
81 | float: left;
82 | width: 70%;
83 | box-sizing: border-box;
84 | padding-left: 1em;
85 | input[type="text"]{
86 | float: left;
87 | width: 48%;
88 | max-width: 120px;
89 | &:last-child {
90 | margin-left: 5px;
91 | // float: right;
92 | }
93 | }
94 | }
95 |
96 | input[type="submit"]{
97 | position: absolute;
98 | right: 1em;
99 | display: block;
100 | width: 80px;
101 | bottom: 1em;
102 | }
103 | h4 {
104 | padding: 0;
105 | margin-top: 0;
106 | }
107 | } // .wpsl-search-history-form
108 |
109 | #wpsl-search-history-map {
110 | height: 300px;
111 | background-color: $white;
112 | }
113 |
114 | .wpsl-search-history-table {
115 | background-color: $white;
116 | width: 100%;
117 | border: 0;
118 | border-collapse: collapse;
119 | th, td {
120 | font-size: .9em;
121 | text-align: left;
122 | border-top: 1px solid darken($white, 8%);
123 | border-left: 1px solid darken($white, 8%);
124 | padding: 5px;
125 | &:first-child {
126 | border-left: 0;
127 | }
128 | }
129 | th {
130 | padding: 1em 5px;
131 | border-top: 0;
132 | border-left-color: rgba($black, .9);
133 | background-color: rgba($black, .8);
134 | color: $white;
135 | line-height: 1.2;
136 | &:last-child {
137 | border-left: 0;
138 | }
139 | }
140 | }
--------------------------------------------------------------------------------
/assets/scss/_variables.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Variables
3 | // --------------------------------------------------
4 | $white : #ffffff;
5 | $black : #000000;
6 | $red : #e14d43;
7 | $blue: #0073aa;
8 | $border: #e1e1e1;
9 | $border-light: #e5e5e5;
10 | $gray-lighter: #f9f9f9; // WP BG
--------------------------------------------------------------------------------
/assets/scss/_widget.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Widget Specific Styles
3 | // --------------------------------------------------
4 | .simple-locator-widget {
5 |
6 | .simple-locator-form {
7 | .address-input, .distance {
8 | float: none;
9 | width: 100%;
10 | }
11 | .address-input {
12 | margin-bottom: 10px;
13 | }
14 | }
15 |
16 | .wpsl-results ul li {
17 | float: none;
18 | width: 100%;
19 | }
20 |
21 | .geo_button_cont {
22 | margin: 0;
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/assets/scss/simple-locator-admin.scss:
--------------------------------------------------------------------------------
1 | @import "_variables.scss";
2 | @import "_mixins.scss";
3 |
4 | // Componenets
5 | @import "_modals.scss";
6 | @import "_icons.scss";
7 | @import "_buttons.scss";
8 | @import "_datepicker.scss";
9 | @import "_admin-loading.scss";
10 | @import "_alerts.scss";
11 |
12 | // PT meta fields
13 | @import "_meta-fields.scss";
14 |
15 | // Settings
16 | @import "_settings-map-options.scss";
17 | @import "_settings-default-map.scss";
18 | @import "_settings-posttypes.scss";
19 | @import "_settings-general.scss";
20 | @import "_settings-results-fields.scss";
21 | @import "_settings-import.scss";
22 | @import "_settings-import-previous.scss";
23 | @import "_settings-import-templates.scss";
24 | @import "_settings-search-history.scss";
25 |
26 | // Additional Views
27 | @import "_admin-location-map.scss";
28 | @import "_admin-quick-edit.scss";
--------------------------------------------------------------------------------
/assets/scss/simple-locator.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Simple Locator Front-End Styles
3 | // --------------------------------------------------
4 | @import "_variables.scss";
5 | @import "_mixins.scss";
6 | @import "_alerts.scss";
7 | @import "_form.scss";
8 | @import "_form-results.scss";
9 | @import "_widget.scss";
10 | @import "_maps.scss";
11 | @import "_pagination.scss";
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "kylephillips/simplelocator",
3 | "description": "Simple Locator for WordPress",
4 | "keywords": ["wordpress", "plugin", "store locator"],
5 | "homepage": "http://locatewp.com",
6 | "license": "GPL",
7 | "authors": [
8 | {
9 | "name": "Kyle Phillips",
10 | "email": "support@nestedpages.com",
11 | "homepage": "https://github.com/kylephillips"
12 | }
13 | ],
14 | "type": "wordpress-plugin",
15 | "require": {
16 | "php": ">=5.3.2",
17 | "composer/installers": "v1.0.6",
18 | "league/csv": "7.0.*@dev",
19 | "guzzlehttp/guzzle": "~6.0"
20 | },
21 | "autoload": {
22 | "psr-4" : {
23 | "SimpleLocator\\" : "app"
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/languages/index.php:
--------------------------------------------------------------------------------
1 | Simple Locator plugin requires'.$flag.' version '.$version.' or greater.','Plugin Activation Error', array( 'response'=>200, 'back_link'=>TRUE ) );
40 | }
41 |
42 | if ( !class_exists('Bootstrap') ) :
43 | define('SIMPLELOCATOR_DIR', __DIR__);
44 | define('SIMPLELOCATOR_URI', __FILE__);
45 | wpsimplelocator_check_versions();
46 | require('vendor/autoload.php');
47 | require_once('app/SimpleLocator.php');
48 | SimpleLocator::init();
49 | endif;
--------------------------------------------------------------------------------
/templates/search-form.php:
--------------------------------------------------------------------------------
1 |
14 |
57 |
58 | ';
--------------------------------------------------------------------------------
/views/post-meta/error-modal.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
--------------------------------------------------------------------------------
/views/post-meta/location-meta.php:
--------------------------------------------------------------------------------
1 | form_fields->order();
4 | ?>
5 |
47 |
--------------------------------------------------------------------------------
/views/search-results.php:
--------------------------------------------------------------------------------
1 | search_data['results']) < 1 ) ? false : true;
7 | $output = '';
10 |
11 | // No Results
12 | if ( !$has_results ) $output .= $this->results_info->noResultsFoundError();
13 |
14 | // Results
15 | if ( $has_results ) :
16 | $output .= $this->results_info->resultsHeader();
17 | $output .= '
' . $this->results_info->newSearchLink() . '
';
18 | $output .= $this->results_info->currentResultCounts();
19 |
20 | $output .= '
request['mapheight']) && $this->request['mapheight'] !== "" ) $output .= 'style="height:' . $this->request['mapheight'] . 'px;"';
22 | $output .= ' data-latitude="' . $this->request['latitude'] . '"';
23 | $output .= ' data-longitude="' . $this->request['longitude'] . '"';
24 | $output .= '>
';
25 |
26 | $results_output = '
';
27 | foreach($this->search_data['results'] as $result) :
28 | $results_output .= $result['output'];
29 | endforeach;
30 | $results_output .= '
';
31 | $output .= apply_filters('simple_locator_non_ajax_results_output', $results_output, $this->request, $this->search_data);
32 |
33 | $output .= '';
39 | endif;
40 |
41 | $output .= '
';
--------------------------------------------------------------------------------
/views/settings/defaultmap.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 | settings_repo->showDefaultMap() ) echo 'checked'; ?> />
12 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
40 |
41 |
42 | settings_repo->defaultMap('user_location') == 'true' ) echo 'checked'; ?> />
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/views/settings/import-0.php:
--------------------------------------------------------------------------------
1 | ';
8 | elseif ( !$apikey ) :
9 | echo '' . __('Import functionality requires a Google Maps Server API key. The key must have the Geocoding API enabled, and your server\'s IP address must be whitelisted in the Google Developer Console. To enter an API key, visit the Simple Locator general settings tab.', 'simple-locator') . '
';
10 | else :
11 | // Steps
12 | if ( isset($_GET['step']) && in_array($_GET['step'], array('1', '2', '3')) ) {
13 | include 'import-' . sanitize_text_field($_GET['step']) . '.php';
14 | } else {
15 | include 'import-1.php';
16 | }
17 | endif;
18 | ?>
19 |
--------------------------------------------------------------------------------
/views/settings/import-errors.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kylephillips/simple-locator/a3642546de47a78f5d9781ba2fb86ad8d21c6c0c/views/settings/import-errors.php
--------------------------------------------------------------------------------
/views/settings/result-field-custom-selection.php:
--------------------------------------------------------------------------------
1 | field_repo->getFieldsForPostType($this->post_type);
3 | $post_type = get_post_type_object($this->post_type);
4 | $image_sizes = get_intermediate_image_sizes();
5 | ?>
6 |
7 |
8 | labels->name; ?>
9 |
10 |
11 |
12 |
13 |
14 | ' . $field . '';
17 | }
18 | ?>
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/views/settings/resultsfields.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 | settings_repo->resultsFormatting(), 'wpsl_results_fields_formatted', [
13 | 'media_buttons' => false,
14 | 'textarea_name' => 'wpsl_results_fields_formatted[output]',
15 | 'tabindex' => 1,
16 | 'textarea_rows' => 12,
17 | 'teeny' => true,
18 | 'wpautop' => true
19 | ]); ?>
20 |
21 |
22 |
23 |
27 |
28 | settings_repo->resultsFormatting('default'), 'wpsl_results_fields_formatted_default', [
32 | 'media_buttons' => false,
33 | 'textarea_name' => 'wpsl_results_fields_formatted_default[output]',
34 | 'tabindex' => 1,
35 | 'textarea_rows' => 12,
36 | 'teeny' => true,
37 | 'wpautop' => true
38 | ]); ?>
39 |
40 |
41 |
42 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/views/settings/settings.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
26 |
35 |
--------------------------------------------------------------------------------
/views/singular-post.php:
--------------------------------------------------------------------------------
1 | location_data['latitude'] !== "") && ($this->location_data['longitude'] !== "") ) :
6 | $out = '
';
7 | endif;
8 |
9 | // It's the built in location post type, safe to use fields
10 | if ( ($this->settings_repo->getLocationPostType() == 'location') && (isset($this->location_data['additionalfields'])) && ($this->location_data['additionalfields'] == 'show') ) :
11 |
12 | $out .= '';
13 |
14 | // Address
15 | $out .= '
';
16 | if ( isset($this->location_data['address']) && $this->location_data['address'] !== "" )
17 | $out .= $this->location_data['address'];
18 | if ( isset($this->location_data['city']) && $this->location_data['city'] !== "" )
19 | $out .= ' ' . $this->location_data['city'];
20 | if ( isset($this->location_data['state']) && $this->location_data['state'] !== "" )
21 | $out .= ', ' . $this->location_data['state'];
22 | if ( isset($this->location_data['zip']) && $this->location_data['zip'] !== "" )
23 | $out .= ' ' . $this->location_data['zip'];
24 | $out .= '
';
25 |
26 | // Website
27 | if ( (isset($this->location_data['website'])) && ($this->location_data['website'] !== "") ){
28 | $url = \SimpleLocator\Helpers::checkURL($this->location_data['website']);
29 | $out .= '
';
33 | }
34 |
35 | // Phone
36 | if ( isset($this->location_data['phone']) && $this->location_data['phone'] !== "" ){
37 | $out .= '
';
38 | $out .= __('Phone', 'simple-locator') . ': ' . $this->location_data['phone'];
39 | $out .= '
';
40 | }
41 |
42 | // Additional info
43 | if ( isset($this->location_data['additionalinfo']) && $this->location_data['additionalinfo'] !== "" ){
44 | $out .= '
';
45 | $out .= $this->location_data['additionalinfo'];
46 | $out .= '
';
47 | }
48 |
49 | $out .= '
';
50 |
51 | endif; // Post type
52 |
53 |
--------------------------------------------------------------------------------
/views/widget-options.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | (Comma Separated Numbers)' ); ?>
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------