Version Description
- Fixed: internal updates to ajax functions with nonces
Download this release
Release Info
Developer | chrisvrichardson |
Plugin | MapPress Easy Google Maps |
Version | 2.53.9 |
Comparing to | |
See all releases |
Code changes from version 2.53.8 to 2.53.9
- js/mappress.min.js +1 -1
- js/mappress_editor.min.js +1 -1
- languages/mappress-google-maps-for-wordpress.pot +17 -17
- mappress.php +4 -3
- mappress_map.php +7 -2
- mappress_template.php +3 -0
- readme.txt +5 -2
js/mappress.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var mapp=window.mapp||{};+function(n){mapp.Map=function(n,t){this.defaults={center:null,editable:null,height:null,initialOpenDirections:null,initialOpenInfo:null,layers:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,pois:null,postid:null,query:null,sel:null,title:null,width:null,zoom:null};this.highlight=null;this.iw=null;this.places=null;this.poi=null;this.settings=t?t:{};this.templates=null;this.dir_=null;this.div={};this.layers_={};this.map_=null;this.pois_=[];this.xhr_;this.zindex_=0;_.extend(this,this.defaults,n,this.settings)};mapp.Map.prototype={display:function(){var t=this,i;if(this.div.layout=this.sel?n(".mapp-layout",this.sel):n("#"+this.name+"-layout"),n.each(["canvas","controls","dialog","directions","filters","iw","list","menu","search"],function(i,r){t.div[r]=n(".mapp-"+r,t.div.layout)}),this.sanity()===!0){this.templates=this.editable?{loop:"edit-loop",item:"edit-item",popup:"edit-popup"}:this.query?{loop:"map-loop",item:"mashup-item",popup:"mashup-popup"}:{loop:"map-loop",item:"map-item",popup:"map-popup"};mappl10n.options.engine=="leaflet"?(i=_.extend({attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap<\/a>',minZoom:0,scrollWheelZoom:!1,worldCopyJump:!0,zoomControl:null},this.mapOpts),i.minZoom=isNaN(parseInt(i.minZoom))?0:parseInt(i.minZoom),this.map_=new L.Map(this.div.canvas.get(0),i),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_),this.iw=L.popup(),this.iw.setContent(this.div.iw.get(0))):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),i=_.extend({backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,keyboardShortcuts:!1,mapTypeControl:!0,mapTypeControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},minZoom:0,scaleControl:!0,scrollwheel:!1,streetViewControl:!this.editable&&!this.query},this.mapOpts),i.minZoom=isNaN(parseInt(i.minZoom))?0:parseInt(i.minZoom),this.map_.setOptions(i),this.iw=mappl10n.options.iwType=="ib"||this.editable?new mapp.InfoBox(this):new google.maps.InfoWindow,this.iw.setContent(this.div.iw.get(0)),this.addLayers());this.addStyles();this.addControls();this.addMenu();this.setMapTypeId(this.mapTypeId,!0);this.places=new mapp.Places(n(".mapp-places",this.div.search),{map:t});this.editable&&this.places.sel.focus();n(this.places).on("search.mapp",function(n,i){t.search(i)});this.addEvents("click drag",function(){t.close()});this.toggleView("mini",this.div.layout.width()<mappl10n.options.mini);this.div.layout.on("click","[data-mapp-action]",function(i){var r=n(this).attr("data-mapp-action");i.preventDefault();t.action(r,n(this).attr("data-mapp-"+r),n(this))});this.div.filters.on("change",function(){t.ajaxQuery()});n(window).resize(function(){t.resize()});this.places.parse(this.center,function(n){t.center=n&&n.geometry&&n.geometry.location?{lat:n.geometry.location.lat,lng:n.geometry.location.lng}:null;t.query?t.ajaxQuery(function(){t.initCenter()}):(t.setPois(t.pois),t.initCenter())})}},initCenter:function(){var n=this;this.recenter();this.renderList();this.query&&mappl10n.options.search&&!this.editable&&this.addSearchMove();mappl10n.options.engine=="leaflet"?this.initOpen():mapp.event.addListenerOnce(n.map_,"idle",function(){n.initOpen()})},initOpen:function(){var n=this.pois_.length?this.pois_[0]:null;this.initialOpenDirections?this.openDirections(null,n):n&&this.initialOpenInfo&&n.open()},search:function(n){var i,t,f,u,r;n&&n.geometry&&(i=n.geometry.location?n.geometry.location:null,t=n.geometry.viewport?n.geometry.viewport:null,mappl10n.options.engine=="leaflet"?(f=new L.LatLng(i.lat,i.lng),r=f.toBounds(mappl10n.options.radius*1e3)):(u=new google.maps.Circle({center:i,radius:mappl10n.options.radius*1e3}),r=t?new google.maps.LatLngBounds(new google.maps.LatLng(t.sw.lat,t.sw.lng),new google.maps.LatLng(t.ne.lat,t.ne.lng)).union(u.getBounds()):u.getBounds()),this.fitBounds(r),this.setView(i))},load:function(n){_.extend(this,this.defaults,n,this.settings);this.setMapTypeId(this.mapTypeId,!0);this.setPois(this.pois);this.recenter()},action:function(t,i,r){var f=this,u;switch(t){case"center":this.toggleView("menu",!1);this.close();this.recenter();break;case"dir":this.openDirections(null,this.poi);break;case"dir-from":this.openDirections(this.poi,null);break;case"filters-reset":this.div.filters.find(":input").each(function(){this.type=="checkbox"||this.type=="radio"?n(this).prop("checked",!1):n(this).val("")});this.ajaxQuery();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate(function(n){f.search(n)});break;case"layer":this.toggleLayer(i);this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":u=r.attr("data-mapp-poi");this.open(this.pois_[u]);break;case"show":this.div.layout.show();this.resize();this.initCenter();break;case"view-map":this.toggleView("list",!1);break;case"view-list":this.toggleView("list",!0);break;default:return!0}},dialog:function(n,t){var i=this;n?(this.div.dialog.html(n),this.div.dialog.show(),t&&(clearTimeout(this.dialog.fade),this.dialog.fade=setTimeout(function(){i.dialog(null)},4e3))):this.div.dialog.hide()},addEvents:function(n,t){n=n.split(" ");for(var i=0;i<n.length;i++)mapp.event.addListener(this.map_,n[i],t)},close:function(){mappl10n.options.engine=="leaflet"?this.map_.closePopup():this.iw.close();this.select(null);n(this).triggerHandler("mapp.close")},openDirections:function(n,t){var i=n?n.getAddress():"",r=t?t.getAddress():"";n?n.open():t&&t.open();this.dir_||(this.dir_=new mapp.Directions(this.div.directions,this));this.dir_.open(i,r)},sanity:function(){if(!this.div.canvas.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);if(mappl10n.options.autoupdate==="tc")return mapp.lib.log("Maps API missing (800001)");if(typeof _=="undefined")return mapp.lib.alert("ERROR: underscore.js not loaded. Check cacheing / optimizing plugins.");if(mappl10n.options.engine=="leaflet"){if(typeof L=="undefined")return mapp.lib.alert("ERROR: Unable to load Leaflet")}else{if(typeof google=="undefined")return mapp.lib.alert("ERROR: Google Maps API not loaded");n(document).ready(function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&mapp.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")})}return!0},select:function(t){if(t){var i=n.inArray(t,this.pois_),r=n('[data-mapp-poi="'+i+'"]',this.div.list);mapp.lib.scrollTo(this.div.list,r);t.setZIndex(++this.zindex_)}this.poi=t},setHighlight:function(n){this.highlight&&(mappl10n.options.engine=="leaflet"?this.highlight.remove():this.highlight.setMap(null));n&&(mappl10n.options.engine=="leaflet"?this.highlight=new L.Marker(n.getPosition()).addTo(this.map_):(this.highlight=new google.maps.Marker({position:n.getPosition()}),this.highlight.setMap(this.map_)))},getMap:function(){return this.map_},renderList:function(){var i=this.getBounds(),r=0,u=this,t;if(!this.editable)for(t=0;t<this.pois_.length;t++)this.pois_[t].visible=this.pois_[t].type!="kml",this.query&&i&&!i.contains(this.pois_[t].getPosition())&&(this.pois_[t].visible=!1),r+=this.pois_[t].visible;this.div.list.html(mapp.lib.template(this.templates.loop,{map:this,pois:this.pois_,count:r}));this.editable&&n(".mapp-items",u.sel).sortable({axis:"y",cursor:"move",delay:200,update:function(){u.sortPois(n(this).sortable("toArray",{attribute:"data-mapp-poi"}))}})},getPois:function(){return this.pois_},insertPoi:function(n){var t=this;this.pois_.unshift(n);n.setMap(this);t.renderList();this.select(n)},removePoi:function(t){var r=this,i=n.inArray(t,this.pois_);i!=-1&&(this.pois_[i].setMap(null),this.pois_.splice(i,1),r.renderList())},resetPois:function(){for(i=0;i<this.pois_.length;i++)this.pois_[i].setMap(null);this.pois_=[];this.zindex_=0},setPois:function(n){var t,i;if(this.resetPois(),n){for(t=0;t<n.length;t++)i=new mapp.Poi(n[t]),this.pois_.push(i),i.id=this.pois_.length-1,i.setMap(this),i.setZIndex(this.zindex_+n.length-1-t);this.zindex_+=n.length-1}this.renderList()},sortPois:function(n){for(var r,t=Array(),i=0;i<n.length;i++){if(r=parseInt(n[i]),isNaN(r))return!1;t.push(this.pois_[r])}if(t.length!=this.pois_.length)return!1;this.pois_=t;this.renderList()},open:function(t,i){var r=null,u;if(this.close(),this.select(t),mappl10n.options.mashupClick!="poi"&&t.postid&&t.url){mappl10n.options.mashupClick=="post"?window.location.assign(t.url):window.open(t.url);return}this.toggleView("list",!1);i&&i.featureData?r=i.featureData:i&&i.propagatedFrom&&i.propagatedFrom.feature&&i.propagatedFrom.feature.properties&&(r=i.propagatedFrom.feature.properties);this.div.iw.html(t.render("popup",r));mappl10n.options.engine=="leaflet"?(this.iw.setLatLng(t.getPosition()),this.iw.options.offset=t.getAnchorPoint(),this.map_.openPopup(this.iw)):(u=new google.maps.MVCObject,u.setValues({position:t.getPosition(i),anchorPoint:t.getAnchorPoint(i)}),this.iw.open(this.map_,u));n(this).triggerHandler("mapp.open",t)},renderMenu:function(){var t=this;for(layer in this.layers_)this.layers_[layer].getMap()&&n('[data-mapp-layer="'+layer+'"]',this.div.layout).addClass("mapp-active")},addStyles:function(){var u=this,l,f,r,i;if(mappl10n.options.engine=="leaflet"){if(this.editable){for(l=[],f=L.control.layers(),r=0;r<mappl10n.options.baseLayers.length;r++){var o=mappl10n.options.baseLayers[r],s=mappl10n.options.providers[o.provider],h=n.extend({},s,o);f.addBaseLayer(L.tileLayer(s.url,h),h.label)}mappl10n.options.baseLayers.length>1&&f.addTo(this.map_)}this.map_.on("baselayerchange",function(n){u.mapTypeId=n.layer.options.name})}else{var t=mappl10n.options.styles?mappl10n.options.styles:[],e=mappl10n.options.style,c=["roadmap","satellite","terrain","hybrid"];if(e&&typeof t[e]!="undefined"&&this.map_.setOptions({styles:t[e]}),this.editable){for(i in t)this.map_.mapTypes.set(i,new google.maps.StyledMapType(t[i],{name:i})),c.push(i);this.map_.setOptions({mapTypeControlOptions:{mapTypeIds:c,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else this.mapTypeId&&typeof t[this.mapTypeId]!="undefined"&&this.map_.setOptions({styles:t[this.mapTypeId]});mapp.event.addListener(this.map_,"maptypeid_changed",function(){u.mapTypeId=u.map_.getMapTypeId()})}},addControls:function(){var n=this;this.div.controls.html(mapp.lib.template("map-controls",{map:this}))},addLayers:function(){var u,i,t,r;for(this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer},u=n.makeArray(this.layers),i=0;i<u.length;i++)t=n.trim(u[i]),r=t.split(".").pop(),this.layers_[t]?this.toggleLayer(t):r=="kml"||r=="kmz"?this.layers_[t]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:t}):r=="json"&&(this.layers_[t]=new google.maps.Data({map:this.map_}).loadGeoJson(t))},addMenu:function(){var t=this;n("body").on("click",function(i){var r=n(i.target),u=r.attr("data-mapp-action");r==t.div.filters||u=="filters-toggle"||r.closest(t.div.filters).length||t.toggleView("filters",!1);r==t.div.menu||u=="menu-toggle"||r.closest(t.div.menu).length||t.toggleView("menu",!1)})},toggleLayer:function(t,i){var r=this;i=typeof i!="undefined"?i:this.layers_[t].getMap()==null;n.each(["traffic","bicycling","transit"],function(n,t){r.layers_[t].setMap(null)});i&&this.layers_[t].setMap(this.map_)},togglePois:function(n){n=!!n;for(var t=0;t<this.pois_.length;t++)this.pois_[t].setVisible(n)},toggleView:function(n,t){t=typeof t=="undefined"?!this.div.layout.hasClass("mapp-view-"+n):t;this.div.layout.toggleClass("mapp-view-"+n,t);n=="menu"&&t&&this.renderMenu();n=="directions"&&this.resize()},resize:function(){var n=this.getCenter();this.toggleView("mini",this.div.layout.width()<mappl10n.options.mini);mappl10n.options.engine=="leaflet"?this.map_.invalidateSize():mapp.event.trigger(this.map_,"resize");n&&this.setView(n)},recenter:function(){var t=this.center&&this.center.lat&&this.center.lng?this.center:null,n=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null,i,r;if(t&&!n&&this.query){this.search({geometry:{location:{lat:t.lat,lng:t.lng}}});return}if(t){this.setView(t,n?n:1);return}if(this.pois_.length==0){this.setView({lat:0,lng:0},n?n:1);return}if(this.pois_.length==1){this.pois_[0].center(n);return}for(bounds=mappl10n.options.engine=="leaflet"?new L.LatLngBounds:new google.maps.LatLngBounds,i=0;i<this.pois_.length;i++)r=this.pois_[i].getBounds(),bounds=r?mappl10n.options.engine=="leaflet"?bounds.extend(r):bounds.union(r):bounds.extend(this.pois_[i].getPosition());n?this.setView(bounds.getCenter().toJSON(),n):this.fitBounds(bounds)},toJSON:function(){var n;for(this.pois=[],n=0;n<this.pois_.length;n++)this.pois.push(this.pois_[n].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:this.mapTypeId,metaKey:this.metaKey,pois:this.pois,title:this.title,width:this.width,zoom:this.zoom}},ajaxSave:function(n){var t=this,i=JSON.stringify(this),r=!this.mapid||!this.postid?mappl10n.options.postid:this.postid;mapp.lib.ajax({type:"POST",data:{action:"mapp_save",map:i,postid:r},callback:function(i){i.status=="OK"&&(t.mapid||(t.mapid=i.data.mapid),n())}})},fitBounds:function(n,t){var t=mappl10n.options.engine=="leaflet"&&t?{paddingTopLeft:[t.left,t.top],paddingBottomRight:[t.right,t.bottom]}:t;return this.map_.fitBounds(n,t)},getBounds:function(){try{return this.map_.getBounds()}catch(n){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(n){return null}},getMapTypeId:function(n){return mappl10n.options.engine=="leaflet"?"roadmap":this.map_.getMapTypeId(n)},setMapTypeId:function(t){var s=this,i,r,e,u,o,f;if(mappl10n.options.engine=="leaflet")for(this.map_.eachLayer(function(n){s.map_.removeLayer(n)}),t=!this.editable&&mappl10n.options.style&&t=="streets"?mappl10n.options.style:t,t=_.findIndex(mappl10n.options.baseLayers,{name:t})>=0?t:mappl10n.options.baseLayers[0].name,i=0;i<mappl10n.options.baseLayers.length;i++)r=mappl10n.options.baseLayers[i],e=mappl10n.options.providers[r.provider],r.name==t&&(u=n.extend({},e,r),o=L.tileLayer(u.url,u),o.addTo(this.map_));else f=n.inArray(t,["roadmap","satellite","terrain","hybrid"])!=-1,t=this.editable?f||typeof mappl10n.options.styles[t]!="undefined"?t:"roadmap":f?t:"roadmap",this.map_.setMapTypeId(t)},setView:function(n,t,i){mappl10n.options.engine=="leaflet"?(t==null&&(t=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(n,t,i)):(n=n&&!n.toJSON?{lat:parseFloat(n.lat),lng:parseFloat(n.lng)}:n,t=t?parseInt(t):null,n&&this.map_.setCenter(n),t&&this.map_.setZoom(t))}};mapp.Map.ajaxGet=function(n,t,i){mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:n},callback:function(n){if(n.status=="OK"){var r=new mapp.Map(n.data.map,t);i(r)}}})};mapp.Map.ajaxDelete=function(n,t){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:n},callback:function(n){n.status=="OK"&&t&&t()}})}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Directions=function(t,i){this.sel=n(t);this.map=i;this.directionsRenderer=null;this.directionsService=null;this.placesService=null;var r=this;this.sel.on("keydown",function(n){n.which==13?(r.getDirections(),n.preventDefault()):n.which==27&&r.close()});this.sel.on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action"),u=n(".mapp-dir-daddr",r.sel).val(),f=n(".mapp-dir-saddr",r.sel).val();t.preventDefault();switch(i){case"dir-cancel":r.close();break;case"dir-get":r.getDirections();break;case"dir-myloc":r.map.places.geolocate(function(t){n(".mapp-dir-saddr",r.sel).val(t.name);r.getDirections()});break;case"dir-swap":n(".mapp-dir-saddr",r.sel).val(u);n(".mapp-dir-daddr",r.sel).val(f);r.getDirections()}});this.open=function(t,i){if(mappl10n.options.directions=="google"){this.openGoogle(t,i);return}this.map.toggleView("directions",!0);n(".mapp-dir-addr",this.sel).removeClass("mapp-error");n(".mapp-dir-saddr",this.sel).val(t);n(".mapp-dir-daddr",this.sel).val(i);n(".mapp-dir-get",this.sel).focus();n(".mapp-dir-saddr",this.sel).focus()};this.close=function(){this.map.toggleView("directions",!1);this.directionsRenderer&&(this.directionsRenderer.setPanel(null),this.directionsRenderer.getMap()&&(this.directionsRenderer.setMap(null),this.map.togglePois(!0)))};this.getDirections=function(){this.map.close();this.openGoogle(n(".mapp-dir-saddr",this.sel).val(),n(".mapp-dir-daddr",this.sel).val());return};this.openGoogle=function(n,t){var i=mappl10n.options.directionsServer;i.toLowerCase().indexOf("http")==-1&&(i="https://"+i);i+="?saddr="+encodeURIComponent(n);i+="&daddr="+encodeURIComponent(t);window.open(i)}}}(jQuery);mapp=window.mapp||{};mapp.geocoders={};+function(n){mapp.geocoders.Algolia=function(n){this.map=n;this.places=algoliasearch.initPlaces()};mapp.geocoders.Algolia.prototype={geocode:function(n,t){var i=this;this.getPredictions(n,function(i){i&&i.hits.length?t({formatted_address:i.hits[0].locale_names[0],name:n,geometry:{location:{lat:i.hits[0]._geoloc.lat,lng:i.hits[0]._geoloc.lng}}}):t(null)})},getDetails:function(n,t){if(mappl10n.options.geocoder=="nominatim")return this.getNominatimDetails(n,t);if(mappl10n.options.geocoder=="mapbox"&&mappl10n.options.mapbox)return this.getMapboxDetails(n,t);t({formatted_address:n.value,name:n.name,geometry:{location:n.latlng}});return},getNominatimDetails:function(t,i){url="https://nominatim.openstreetmap.org/search?format=json&limit=1&q="+encodeURIComponent(t.value);url=mappl10n.options.country?url+"&countrycodes="+mappl10n.options.country.toLowerCase():url;url=mappl10n.options.language?url+"&accept-language="+mappl10n.options.language.toLowerCase():url;n.getJSON(url,function(n){if(n&&n.length){var r=n[0],u=r.boundingbox&&r.boundingbox.length==4?{sw:{lat:r.boundingbox[0],lng:r.boundingbox[2]},ne:{lat:r.boundingbox[1],lng:r.boundingbox[3]}}:null;i({formatted_address:r.display_name,name:t.name,geometry:{location:{lat:r.lat,lng:r.lon},viewport:u}})}else i({formatted_address:t.value,name:t.name,geometry:{location:t.latlng}})})},getMapboxDetails:function(t,i){url="https://api.mapbox.com/geocoding/v5/mapbox.places/"+encodeURIComponent(t.value)+".json?access_token="+mappl10n.options.mapbox;url=mappl10n.options.country?url+"&country="+mappl10n.options.country.toLowerCase():url;url=mappl10n.options.language?url+"&language="+mappl10n.options.language.toLowerCase():url;n.getJSON(url,function(n){if(n&&n.features&&n.features.length>0){var r=n.features[0],u=r.bbox&&r.bbox.length==4?{sw:{lat:r.bbox[1],lng:r.bbox[0]},ne:{lat:r.bbox[3],lng:r.bbox[2]}}:null;i({formatted_address:r.place_name,name:t.name,geometry:{location:{lat:r.center[1],lng:r.center[0]},viewport:u}})}else i({formatted_address:t.value,name:t.name,geometry:{location:t.latlng}})})},getPredictions:function(n,t){this.places.search({query:n,language:mappl10n.options.language},function(n,i){n||!i?t(null):t(i)})}}}(jQuery);+function(n){mapp.geocoders.Google=function(t){this.map=t;this.token=null;this.types=this.map.editable?null:["geocode"];var i=n('<div style="display:none">').appendTo("body");this.placesService=new google.maps.places.PlacesService(i.get(0));this.autocompleteService=new google.maps.places.AutocompleteService;i.remove()};mapp.geocoders.Google.prototype={geocode:function(t,i){var r=this;this.getPredictions(t,function(t){t&&n.isArray(t)?r.getDetails(t[0],function(n){i(n)}):i(null)})},getDetails:function(n,t){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;this.token=null;var i={placeId:n.place_id,sessionToken:this.token};this.placesService.getDetails(i,function(n,i){if(i=="OK"&&n&&n.geometry){if(n.geometry.location&&(n.geometry.location=n.geometry.location.toJSON()),n.geometry.viewport){var r=n.geometry.viewport.toJSON();n.geometry.viewport={sw:{lat:r.south,lng:r.west},ne:{lat:r.north,lng:r.east}}}t(n)}else t(null)})},getPredictions:function(n,t){var i,r;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;i=this.map.getMap().getBounds();i=i?i:new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180));r={input:n,bounds:i,sessionToken:this.token,types:this.types};this.autocompleteService.getPlacePredictions(r,function(n,i){i=="OK"&&n&&n.length?t(n):(i==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):i==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),t(null))})}}}(jQuery);mapp=window.mapp||{};mapp.Icons={};mapp.Icons.get=function(){var n="https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png";return mappl10n.options.engine=="leaflet"?L.icon({iconUrl:n,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:n}};mapp.Icons.getUrl=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp=window.mapp||{};+function(n){mapp.InfoBox=function(t,i){var f=n.extend({border:20},i),u=null,r=null,o,e=this;r=n('<div class="mapp-ib-wrapper" tabindex="0"><div class="mapp-ib" tabindex="0"><\/div><div class="mapp-ib-tip"><\/div><\/div>').appendTo(t.getMap().getDiv());jQuery(window).resize(function(){e.close()});r.on("keydown",function(n){n.which==27&&e.close()});r.on("click",".mapp-close",function(){e.close()});this.getContent=function(){return n(".mapp-ib",r)};this.setContent=function(t){n(".mapp-ib",r).empty().append(t)};this.open=function(n,t){u=t;this.setMap(n)};this.onAdd=function(){o=!1;var t=n(":input",r);r.show();t.length?t.first().focus():r.focus();google.maps.event.trigger(e,"domready")};this.draw=function(){var l=this.getMap(),a=n(".mapp-ib-body",r),s=this.getProjection().fromLatLngToContainerPixel(u.position),t,h,c,i,e;o||(o=!0,t={width:n(":first-child",l.getDiv()).width(),height:n(":first-child",l.getDiv()).height()},r.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"}),h=r.outerWidth(!0),c=r.outerHeight(!0),c>t.height+u.anchorPoint.y-2*f.border&&(c=t.height+u.anchorPoint.y-2*f.border,r.css({"max-height":c+2})),i=s.x,e=s.y,i+h/2>t.width&&(i=t.width-h/2),i-h/2<0&&(i=h/2),e-c+u.anchorPoint.y<f.border&&(e=c-u.anchorPoint.y+f.border),e>t.height&&(e=t.height),(s.x-i||s.y-e)&&l.panBy(s.x-i,s.y-e),r.css({left:i-h/2,bottom:t.height-e-u.anchorPoint.y}))};this.close=function(){r.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))};this.onRemove=function(){r.hide()}};mappl10n.options.engine!="leaflet"&&(mapp.InfoBox.prototype=new google.maps.OverlayView)}(jQuery);mapp=window.mapp||{};+function(n){mapp.lib={ajax:function(t){var i=this;return n.extend({type:"GET",data:null,spinner:null,callback:n.noop},t),t.spinner&&t.spinner.show(),n.ajax({type:t.type,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,r,u){if(t.spinner&&t.spinner.hide(),n.status!="OK"){var f=typeof n=="object"?n.status:n;i.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+r+"\r\nResponseText="+u.responseText)}if(n.output){i.log("AJAX Output\r\n"+n.output);return}t.callback&&t.callback(n,u)},error:function(n,r,u){(t.spinner&&t.spinner.hide(),r!="cancel")&&typeof u!="undefined"&&u!=""&&i.alert("AJAX ERROR\r\nTextStatus="+r+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},alert:function(n){mappl10n.options.admin||mappl10n.options.debug?alert(n):window.console&&console.error(n)},jqVersionCheck:function(t){if(typeof n=="undefined"||typeof t=="undefined")return!1;for(t=t.split("."),v=n.fn.jquery.split("."),i=0;i<t.length;i++){var r=parseInt(t[i]),u=typeof v[i]!="undefined"?parseInt(v[i]):0;if(u!=r)return u>r}return!0},log:function(n){window.console&&console.error(n)},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var i=n.scrollTop(),u=n.height(),r=i+t.position().top,f=r+t.outerHeight(!0);r<i?n.scrollTop(r):f>i+u&&n.scrollTop(f-u)}},template:function(t,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[t]){var r=mappl10n.options.templates?mappl10n.options.template[t]:n("#mapp-tmpl-"+t).html();if(r)mapp.lib.templates[t]=_.template(r.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});else return""}return mapp.lib.templates[t](i)}};mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+n.fn.jquery);n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-layout",r).each(function(){var i=n(this).find(".mapp-canvas").attr("id"),t=window[i];t.resize();t.recenter()})})}(jQuery);+function(){mappl10n.options.engine=="leaflet"&&(L.LatLng.prototype.toJSON=function(){return{lat:this.lat,lng:this.lng}},L.LatLngBounds.prototype.toJSON=function(){return{south:this.getSouth(),west:this.getWest(),north:this.getNorth(),east:this.getEast()}},L.LatLng.prototype.toUrlValue=function(){return Math.round(this.lat*1e6)/1e6+", "+Math.round(this.lng*1e6)/1e6});mapp.event={addListener:function(n,t,i){if(mappl10n.options.engine=="leaflet")n.on(t,i);else google.maps.event.addListener(n,t,i)},addListenerOnce:function(n,t,i){if(mappl10n.options.engine=="leaflet")n.once(t,i);else google.maps.event.addListenerOnce(n,t,i)},clearInstanceListeners:function(n){mappl10n.options.engine=="leaflet"?n.off():google.maps.event.clearInstanceListeners(n)},clearListeners:function(n,t){mappl10n.options.engine=="leaflet"?n.off(t):google.maps.event.clearListeners(n,"rightclick")},trigger:function(n,t,i){mappl10n.options.engine=="leaflet"?n.fire(t,i):google.maps.event.trigger(n,t,i)}}}(jQuery);mapp=window.mapp||{};jQuery.fn.AlgoliaAutocomplete=jQuery.fn.autocomplete.noConflict();+function(n){mapp.Places=function(t,i){var r=this;this.sel=n(t);this.opts=n.extend({map:null},i);this.geocoder=mappl10n.options.engine=="leaflet"?new mapp.geocoders.Algolia(this.opts.map):new mapp.geocoders.Google(this.opts.map);this.sel.on("keydown",function(t){if(t.which==13){t.preventDefault();var i=r.parseLatLng(r.sel.val());i&&(n(r).triggerHandler("search.mapp",i),r.sel.AlgoliaAutocomplete("close"),t.stopImmediatePropagation());r.sel.val().substring(0,4)=="http"&&(n(r).triggerHandler("search.mapp",r.sel.val()),r.sel.AlgoliaAutocomplete("close"),t.stopImmediatePropagation())}});this.autocomplete()};mapp.Places.prototype={parse:function(t,i){var f=this,u=t&&t.name?n.trim(t.name):n.trim(t),r;if(!u){i(null);return}if(u=="user"){this.geolocate(function(n){i(n)});return}if(t&&t.geometry){i(t);return}if(r=this.parseLatLng(t),r){i(r);return}this.geocoder.geocode(t,function(n){i(n)})},parseLatLng:function(t){var i,e,r,u,f;return t.lat&&t.lng?i=t:(e=t&&t.name?n.trim(t.name):n.trim(t),r=e.split(","),r.length==2&&(u=parseFloat(r[0]),f=parseFloat(r[1]),isNaN(u)||isNaN(f)||(i={lat:u,lng:f}))),i?{name:i.lat+", "+i.lng,geometry:{location:i}}:null},geolocate:function(n){var t=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){var i={lat:t.coords.latitude,lng:t.coords.longitude};n({name:i.lat+", "+i.lng,geometry:{location:i}})},function(t){var i=t&&t.message?" : "+t.message:"";alert(mappl10n.no_geolocate+i);n(null)},{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4})},autocomplete:function(){var t=this,r,i,u;this.sel.on("autocomplete:selected",function(i,r){t.geocoder.getDetails(r,function(i){t.parse(i,function(i){i&&n(t).triggerHandler("search.mapp",i)})})});r={empty:'<div class="list-group search-results-dropdown"><div class="list-group-item">'+mappl10n.no_results+"<\/div><\/div>",header:'<div class="list-group search-results-dropdown">'};mappl10n.options.engine=="leaflet"?(i={algoliasearch:algoliasearch,templates:r},mappl10n.options.country&&(i.countries=[mappl10n.options.country]),mappl10n.options.language&&(i.language=mappl10n.options.language),u=placesAutocompleteDataset(i)):u={display:"description",source:function(n,i){t.geocoder.getPredictions(n,function(n){matches=n;i(matches)})},templates:r};this.sel.AlgoliaAutocomplete({autoselect:!0,cssClasses:{prefix:"mapp-aa"},debug:!1,hint:!0,highlight:!0,minLength:1},u)}}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Poi=function(t){var u,f,r,o,i,e,h,s;if(this.defaults={address:null,body:null,iconid:null,kml:null,map:null,overlay:null,postid:null,props:null,title:"",url:null,type:null,viewport:null},n.extend(this,this.defaults,t),t&&t.correctedAddress&&(this.address=t.correctedAddress),mappl10n.options.engine=="leaflet"&&this.isPoly()&&(this.type=null),t.viewport&&t.viewport.sw&&t.viewport.ne&&(u=t.viewport.sw,f=t.viewport.ne,this.viewport=mappl10n.options.engine=="leaflet"?new L.LatLngBounds(L.latLng(u.lat,u.lng),L.latLng(f.lat,f.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(u.lat,u.lng),new google.maps.LatLng(f.lat,f.lng))),r=[],o=[],!t.overlay)switch(this.type){case"polygon":if(t.poly&&t.poly.paths)for(i=0;i<t.poly.paths.length;i++){for(r=[],e=0;e<t.poly.paths[i].length;e++)r.push(new google.maps.LatLng(t.poly.paths[i][e].lat,t.poly.paths[i][e].lng));o.push(new google.maps.MVCArray(r))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(o)});this.setColors(t.poly);break;case"polyline":if(t.poly&&t.poly.path)for(i=0;i<t.poly.path.length;i++)r.push(new google.maps.LatLng(t.poly.path[i].lat,t.poly.path[i].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(r)});this.setColors(t.poly);break;case"circle":h=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Circle({center:h,radius:parseFloat(t.poly.radius)});this.setColors(t.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(t.poly);break;case"kml":s=t.kml&&t.kml.url?t.kml.url:"";this.overlay=mappl10n.options.engine=="leaflet"?omnivore.kml(s):new google.maps.KmlLayer(s,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:this.overlay=mappl10n.options.engine=="leaflet"?L.marker([t.point.lat,t.point.lng],{title:t.title}):new google.maps.Marker({position:new google.maps.LatLng(t.point.lat,t.point.lng),title:t.title})}t.type||this.setIcon(t.iconid)};mapp.Poi.prototype={toJSON:function(){var n={address:this.address,body:this.body,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},u=this.getPosition(),i,t,r;if(n.point=u.toJSON(),i=this.viewport?this.viewport:this.getBounds(),i&&(t=i.toJSON(),n.viewport={sw:{lat:t.south,lng:t.west},ne:{lat:t.north,lng:t.east}}),this.type=="kml"&&(n.kml=this.kml),this.isPoly()){n.poly=this.getColors();switch(this.type){case"circle":n.poly.radius=this.overlay.getRadius();break;case"polyline":n.poly.path=[];this.overlay.getPath().forEach(function(t){n.poly.path.push(t.toJSON())});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push(n.toJSON())});n.poly.paths.push(i)});break;case"rectangle":r=this.overlay.getBounds();n.viewport={sw:r.getSouthWest().toJSON(),ne:r.getNorthEast().toJSON()}}}return n},setMap:function(n){var t=this;if(this.map=n,mapp.event.clearInstanceListeners(this.overlay),n==null){mappl10n.options.engine=="leaflet"?this.overlay.remove():this.overlay.setMap(null);return}this.type=="kml"&&(mappl10n.options.engine=="leaflet"?(mapp.event.addListenerOnce(this.overlay,"ready",function(){t.viewport=t.overlay.getBounds()}),mapp.event.addListenerOnce(this.overlay,"error",function(){alert(mappl10n.kml_error)})):(mapp.event.addListener(this.overlay,"defaultviewport_changed",function(){t.viewport=t.overlay.getDefaultViewport()}),mapp.event.addListener(this.overlay,"status_changed",function(){var n=t.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)})));mapp.event.addListener(this.overlay,"click",function(n){t.open(n)});this.setEditable(this.map.editable);mappl10n.options.engine=="leaflet"?this.overlay.addTo(n.getMap()):this.overlay.setMap(n.getMap())},setEditable:function(n){var t=this;this.type!="kml"&&(mappl10n.options.engine=="leaflet"?this.overlay.options.draggable=n:this.overlay.setDraggable(n),this.isPoly()&&this.overlay.setEditable(n),mapp.event.clearListeners(this.overlay,"rightclick"),mapp.event.clearListeners(this.overlay,"dragstart"),n&&(mapp.event.addListener(this.overlay,"dragstart",function(){t.viewport=null;t.map.close()}),(this.type=="polygon"||this.type=="polyline")&&mapp.event.addListener(this.overlay,"rightclick",function(n){n.vertex!=null&&t.overlay.getPath().getLength()>2&&t.overlay.getPath().removeAt(n.vertex)})))},setZIndex:function(n){mappl10n.options.engine=="leaflet"?this.type||this.overlay.setZIndexOffset(n):this.overlay.set("zIndex",n)},setIcon:function(n){this.type||typeof mapp.Icons=="undefined"||(this.iconid=n,mappl10n.options.engine=="leaflet"?this.overlay.setIcon(mapp.Icons.get(n)):(this.overlay.setIcon(null),this.overlay.setIcon(mapp.Icons.get(n))))},setVisible:function(n){typeof this.overlay.setVisible!="undefined"&&this.overlay.setVisible(n)},setColors:function(n){var i={};for(var t in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})n&&typeof n[t]!="undefined"&&(i[t]=n[t]);this.overlay.setOptions(i)},setTemplateColors:function(n,t,i){var r=this.type=="polyline"?{strokeColor:n,strokeOpacity:t/100,strokeWeight:i}:{fillColor:n,fillOpacity:t/100,strokeColor:n,strokeWeight:i,strokeOpacity:1};this.setColors(r)},getColors:function(){var t={};for(var n in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})typeof this.overlay[n]!="undefined"&&(t[n]=this.overlay[n]);return t},getTemplateColors:function(){var n=this.getColors();return this.type=="polyline"?{color:n.strokeColor,opacity:n.strokeOpacity*100,weight:n.strokeWeight}:{color:n.fillColor,opacity:n.fillOpacity*100,weight:n.strokeWeight}},center:function(n){var t=this.getBounds();if(typeof n=="number"){this.map.setView(this.getPosition(),n);return}if(!t){this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));return}this.map.fitBounds(t);this.map.setView(this.getPosition(),n)},open:function(n){this.map.open(this,n)},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;switch(this.type){case"polyline":n=new google.maps.LatLngBounds;this.overlay.getPath().forEach(function(t){n.extend(t)});break;case"polygon":n=new google.maps.LatLngBounds;this.overlay.getPaths().forEach(function(t){t.forEach(function(t){n.extend(t)})});break;case"rectangle":case"circle":n=this.overlay.getBounds();break;case"kml":n=mappl10n.options.engine=="leaflet"?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport();n=n?n:this.viewport;break;default:return this.viewport}return n},getPosition:function(n){if(!this.type)return mappl10n.options.engine=="leaflet"?this.overlay.getLatLng():this.overlay.getPosition();if(this.type=="kml"&&n&&n.latLng)return n.latLng;var t=this.getBounds();return t?t.getCenter():mappl10n.options.engine=="leaflet"?new L.latLng(0,0):new google.maps.LatLng(0,0)},getAddress:function(){return this.address?this.address:this.getPosition().toUrlValue()},getAnchorPoint:function(n){var t=this.isPoly()?"poly":this.type;switch(t){case"kml":return mappl10n.options.engine=="leaflet"?[0,0]:n&&n.pixelOffset?new google.maps.Point(n.pixelOffset.width,n.pixelOffset.height):new google.maps.Point(0,0);case"poly":return mappl10n.options.engine=="leaflet"?[0,0]:new google.maps.Point(0,0);default:return mappl10n.options.engine=="leaflet"?this.overlay.options.icon.options.popupAnchor?this.overlay.options.icon.options.popupAnchor:[0,-32]:typeof this.overlay.anchorPoint!="undefined"?this.overlay.anchorPoint:new google.maps.Point(0,-32)}},render:function(n,t){var i=_.extend(this,{icon:mapp.Icons.getUrl(this.iconid)});return t&&(i.body=t.description,i.title=t.name),mapp.lib.template(this.map.templates[n],{poi:i,colors:this.getTemplateColors()})}}}(jQuery);mapp=window.mapp||{};mapp.widgets={};+function(n){mapp.widgets.Grid=function(t,i){this.el=n(t);this.options=jQuery.extend({action:null,sortable:!1},i);var r=this;this.table=n("table",this.el);this.template=n("script",this.el).html().replace(new RegExp("'","g"),'"');this.el.on("click",function(t){var u=n(t.target),i=u.attr("data-mapp-action");i&&(r[i](t),t.preventDefault())})};mapp.widgets.Grid.prototype={add:function(){this.table.show();var t=n(this.template).appendTo(this.table);n(":input:eq(0)",t).focus()},remove:function(t){var i=n(t.target).closest("tr").remove();n("tbody > tr",this.table).length||this.table.hide()}}}(jQuery);+function(n){mapp.widgets.Popup=function(t,i){var r,u;if(this.activeToggle=null,this.content=t,this.el=null,r=this,this.options=n.extend({max:!1,modal:!1,position:null,toggle:null},i),this.options.modal?this.el=this.content.addClass("mapp-popup-fixed"):(this.el=n('<div class="mapp-popup">'),this.setContent(t)),this.el.attr("tabindex",0),this.options.max&&this.el.addClass("mapp-popup-max"),this.el.hide(),!this.options.modal)n(document).on("click.mapp.popup",function(t){n.contains(r.el.get(0),t.target)||r.el.get(0)==t.target||r.close()});if(this.options.toggle){u=typeof this.options.toggle=="string"?this.options.toggle:this.options.toggle.selector;n(document).on("click",u,function(t){r.activeToggle=n(this);r.open();t.stopPropagation()})}this.el.on("click",".mapp-close",function(){r.close()});this.el.on("keydown",function(n){n.which==27&&r.close()});return this};mapp.widgets.Popup.prototype={close:function(){this.el&&this.el.is(":visible")&&(this.backdrop&&(this.backdrop.remove(),n("body").removeClass("mapp-popup-modal")),this.el.hide(),this.activeToggle&&this.activeToggle.focus(),this.el.trigger("closed.mapp.popup"))},open:function(){var t=this;this.options.modal||this.el.parent().length||this.el.appendTo("body");this.el.show();this.options.modal?(this.backdrop=n('<div class="mapp-popup-backdrop"><\/div>'),this.el.after(this.backdrop),n("body").addClass("mapp-popup-modal")):this.el.position(n.extend({my:"center bottom",at:"center top-5",of:this.activeToggle,collision:"flipfit"},this.options.position));this.el.focus();this.el.trigger("open.mapp.popup")},setContent:function(n){this.el.empty();this.el.append('<span class="mapp-close">').append(n)},toggle:function(){this.el.is(":visible")?this.close():this.open()}}}(jQuery);+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop();window[n.name]=new mapp.Map(n);window[n.name].display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
|
1 |
+
var mapp=window.mapp||{};+function(n){mapp.Map=function(n,t){this.defaults={center:null,editable:null,height:null,initialOpenDirections:null,initialOpenInfo:null,layers:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,pois:null,postid:null,query:null,sel:null,title:null,width:null,zoom:null};this.highlight=null;this.iw=null;this.places=null;this.poi=null;this.settings=t?t:{};this.templates=null;this.dir_=null;this.div={};this.layers_={};this.map_=null;this.pois_=[];this.xhr_;this.zindex_=0;_.extend(this,this.defaults,n,this.settings)};mapp.Map.prototype={display:function(){var t=this,i;if(this.div.layout=this.sel?n(".mapp-layout",this.sel):n("#"+this.name+"-layout"),n.each(["canvas","controls","dialog","directions","filters","iw","list","menu","search"],function(i,r){t.div[r]=n(".mapp-"+r,t.div.layout)}),this.sanity()===!0){this.templates=this.editable?{loop:"edit-loop",item:"edit-item",popup:"edit-popup"}:this.query?{loop:"map-loop",item:"mashup-item",popup:"mashup-popup"}:{loop:"map-loop",item:"map-item",popup:"map-popup"};mappl10n.options.engine=="leaflet"?(i=_.extend({attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap<\/a>',minZoom:0,scrollWheelZoom:!1,worldCopyJump:!0,zoomControl:null},this.mapOpts),i.minZoom=isNaN(parseInt(i.minZoom))?0:parseInt(i.minZoom),this.map_=new L.Map(this.div.canvas.get(0),i),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_),this.iw=L.popup(),this.iw.setContent(this.div.iw.get(0))):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),i=_.extend({backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,keyboardShortcuts:!1,mapTypeControl:!0,mapTypeControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},minZoom:0,scaleControl:!0,scrollwheel:!1,streetViewControl:!this.editable&&!this.query},this.mapOpts),i.minZoom=isNaN(parseInt(i.minZoom))?0:parseInt(i.minZoom),this.map_.setOptions(i),this.iw=mappl10n.options.iwType=="ib"||this.editable?new mapp.InfoBox(this):new google.maps.InfoWindow,this.iw.setContent(this.div.iw.get(0)),this.addLayers());this.addStyles();this.addControls();this.addMenu();this.setMapTypeId(this.mapTypeId,!0);this.places=new mapp.Places(n(".mapp-places",this.div.search),{map:t});this.editable&&this.places.sel.focus();n(this.places).on("search.mapp",function(n,i){t.search(i)});this.addEvents("click drag",function(){t.close()});this.toggleView("mini",this.div.layout.width()<mappl10n.options.mini);this.div.layout.on("click","[data-mapp-action]",function(i){var r=n(this).attr("data-mapp-action");i.preventDefault();t.action(r,n(this).attr("data-mapp-"+r),n(this))});this.div.filters.on("change",function(){t.ajaxQuery()});n(window).resize(function(){t.resize()});this.places.parse(this.center,function(n){t.center=n&&n.geometry&&n.geometry.location?{lat:n.geometry.location.lat,lng:n.geometry.location.lng}:null;t.query?t.ajaxQuery(function(){t.initCenter()}):(t.setPois(t.pois),t.initCenter())})}},initCenter:function(){var n=this;this.recenter();this.renderList();this.query&&mappl10n.options.search&&!this.editable&&this.addSearchMove();mappl10n.options.engine=="leaflet"?this.initOpen():mapp.event.addListenerOnce(n.map_,"idle",function(){n.initOpen()})},initOpen:function(){var n=this.pois_.length?this.pois_[0]:null;this.initialOpenDirections?this.openDirections(null,n):n&&this.initialOpenInfo&&n.open()},search:function(n){var i,t,f,u,r;n&&n.geometry&&(i=n.geometry.location?n.geometry.location:null,t=n.geometry.viewport?n.geometry.viewport:null,mappl10n.options.engine=="leaflet"?(f=new L.LatLng(i.lat,i.lng),r=f.toBounds(mappl10n.options.radius*1e3)):(u=new google.maps.Circle({center:i,radius:mappl10n.options.radius*1e3}),r=t?new google.maps.LatLngBounds(new google.maps.LatLng(t.sw.lat,t.sw.lng),new google.maps.LatLng(t.ne.lat,t.ne.lng)).union(u.getBounds()):u.getBounds()),this.fitBounds(r),this.setView(i))},load:function(n){_.extend(this,this.defaults,n,this.settings);this.setMapTypeId(this.mapTypeId,!0);this.setPois(this.pois);this.recenter()},action:function(t,i,r){var f=this,u;switch(t){case"center":this.toggleView("menu",!1);this.close();this.recenter();break;case"dir":this.openDirections(null,this.poi);break;case"dir-from":this.openDirections(this.poi,null);break;case"filters-reset":this.div.filters.find(":input").each(function(){this.type=="checkbox"||this.type=="radio"?n(this).prop("checked",!1):n(this).val("")});this.ajaxQuery();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate(function(n){f.search(n)});break;case"layer":this.toggleLayer(i);this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":u=r.attr("data-mapp-poi");this.open(this.pois_[u]);break;case"show":this.div.layout.show();this.resize();this.initCenter();break;case"view-map":this.toggleView("list",!1);break;case"view-list":this.toggleView("list",!0);break;default:return!0}},dialog:function(n,t){var i=this;n?(this.div.dialog.html(n),this.div.dialog.show(),t&&(clearTimeout(this.dialog.fade),this.dialog.fade=setTimeout(function(){i.dialog(null)},4e3))):this.div.dialog.hide()},addEvents:function(n,t){n=n.split(" ");for(var i=0;i<n.length;i++)mapp.event.addListener(this.map_,n[i],t)},close:function(){mappl10n.options.engine=="leaflet"?this.map_.closePopup():this.iw.close();this.select(null);n(this).triggerHandler("mapp.close")},openDirections:function(n,t){var i=n?n.getAddress():"",r=t?t.getAddress():"";n?n.open():t&&t.open();this.dir_||(this.dir_=new mapp.Directions(this.div.directions,this));this.dir_.open(i,r)},sanity:function(){if(!this.div.canvas.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);if(mappl10n.options.autoupdate==="tc")return mapp.lib.log("Maps API missing (800001)");if(typeof _=="undefined")return mapp.lib.alert("ERROR: underscore.js not loaded. Check cacheing / optimizing plugins.");if(mappl10n.options.engine=="leaflet"){if(typeof L=="undefined")return mapp.lib.alert("ERROR: Unable to load Leaflet")}else{if(typeof google=="undefined")return mapp.lib.alert("ERROR: Google Maps API not loaded");n(document).ready(function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&mapp.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")})}return!0},select:function(t){if(t){var i=n.inArray(t,this.pois_),r=n('[data-mapp-poi="'+i+'"]',this.div.list);mapp.lib.scrollTo(this.div.list,r);t.setZIndex(++this.zindex_)}this.poi=t},setHighlight:function(n){this.highlight&&(mappl10n.options.engine=="leaflet"?this.highlight.remove():this.highlight.setMap(null));n&&(mappl10n.options.engine=="leaflet"?this.highlight=new L.Marker(n.getPosition()).addTo(this.map_):(this.highlight=new google.maps.Marker({position:n.getPosition()}),this.highlight.setMap(this.map_)))},getMap:function(){return this.map_},renderList:function(){var i=this.getBounds(),r=0,u=this,t;if(!this.editable)for(t=0;t<this.pois_.length;t++)this.pois_[t].visible=this.pois_[t].type!="kml",this.query&&i&&!i.contains(this.pois_[t].getPosition())&&(this.pois_[t].visible=!1),r+=this.pois_[t].visible;this.div.list.html(mapp.lib.template(this.templates.loop,{map:this,pois:this.pois_,count:r}));this.editable&&n(".mapp-items",u.sel).sortable({axis:"y",cursor:"move",delay:200,update:function(){u.sortPois(n(this).sortable("toArray",{attribute:"data-mapp-poi"}))}})},getPois:function(){return this.pois_},insertPoi:function(n){var t=this;this.pois_.unshift(n);n.setMap(this);t.renderList();this.select(n)},removePoi:function(t){var r=this,i=n.inArray(t,this.pois_);i!=-1&&(this.pois_[i].setMap(null),this.pois_.splice(i,1),r.renderList())},resetPois:function(){for(i=0;i<this.pois_.length;i++)this.pois_[i].setMap(null);this.pois_=[];this.zindex_=0},setPois:function(n){var t,i;if(this.resetPois(),n){for(t=0;t<n.length;t++)i=new mapp.Poi(n[t]),this.pois_.push(i),i.id=this.pois_.length-1,i.setMap(this),i.setZIndex(this.zindex_+n.length-1-t);this.zindex_+=n.length-1}this.renderList()},sortPois:function(n){for(var r,t=Array(),i=0;i<n.length;i++){if(r=parseInt(n[i]),isNaN(r))return!1;t.push(this.pois_[r])}if(t.length!=this.pois_.length)return!1;this.pois_=t;this.renderList()},open:function(t,i){var r=null,u;if(this.close(),this.select(t),mappl10n.options.mashupClick!="poi"&&t.postid&&t.url){mappl10n.options.mashupClick=="post"?window.location.assign(t.url):window.open(t.url);return}this.toggleView("list",!1);i&&i.featureData?r=i.featureData:i&&i.propagatedFrom&&i.propagatedFrom.feature&&i.propagatedFrom.feature.properties&&(r=i.propagatedFrom.feature.properties);this.div.iw.html(t.render("popup",r));mappl10n.options.engine=="leaflet"?(this.iw.setLatLng(t.getPosition()),this.iw.options.offset=t.getAnchorPoint(),this.map_.openPopup(this.iw)):(u=new google.maps.MVCObject,u.setValues({position:t.getPosition(i),anchorPoint:t.getAnchorPoint(i)}),this.iw.open(this.map_,u));n(this).triggerHandler("mapp.open",t)},renderMenu:function(){var t=this;for(layer in this.layers_)this.layers_[layer].getMap()&&n('[data-mapp-layer="'+layer+'"]',this.div.layout).addClass("mapp-active")},addStyles:function(){var u=this,l,f,r,i;if(mappl10n.options.engine=="leaflet"){if(this.editable){for(l=[],f=L.control.layers(),r=0;r<mappl10n.options.baseLayers.length;r++){var o=mappl10n.options.baseLayers[r],s=mappl10n.options.providers[o.provider],h=n.extend({},s,o);f.addBaseLayer(L.tileLayer(s.url,h),h.label)}mappl10n.options.baseLayers.length>1&&f.addTo(this.map_)}this.map_.on("baselayerchange",function(n){u.mapTypeId=n.layer.options.name})}else{var t=mappl10n.options.styles?mappl10n.options.styles:[],e=mappl10n.options.style,c=["roadmap","satellite","terrain","hybrid"];if(e&&typeof t[e]!="undefined"&&this.map_.setOptions({styles:t[e]}),this.editable){for(i in t)this.map_.mapTypes.set(i,new google.maps.StyledMapType(t[i],{name:i})),c.push(i);this.map_.setOptions({mapTypeControlOptions:{mapTypeIds:c,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else this.mapTypeId&&typeof t[this.mapTypeId]!="undefined"&&this.map_.setOptions({styles:t[this.mapTypeId]});mapp.event.addListener(this.map_,"maptypeid_changed",function(){u.mapTypeId=u.map_.getMapTypeId()})}},addControls:function(){var n=this;this.div.controls.html(mapp.lib.template("map-controls",{map:this}))},addLayers:function(){var u,i,t,r;for(this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer},u=n.makeArray(this.layers),i=0;i<u.length;i++)t=n.trim(u[i]),r=t.split(".").pop(),this.layers_[t]?this.toggleLayer(t):r=="kml"||r=="kmz"?this.layers_[t]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:t}):r=="json"&&(this.layers_[t]=new google.maps.Data({map:this.map_}).loadGeoJson(t))},addMenu:function(){var t=this;n("body").on("click",function(i){var r=n(i.target),u=r.attr("data-mapp-action");r==t.div.filters||u=="filters-toggle"||r.closest(t.div.filters).length||t.toggleView("filters",!1);r==t.div.menu||u=="menu-toggle"||r.closest(t.div.menu).length||t.toggleView("menu",!1)})},toggleLayer:function(t,i){var r=this;i=typeof i!="undefined"?i:this.layers_[t].getMap()==null;n.each(["traffic","bicycling","transit"],function(n,t){r.layers_[t].setMap(null)});i&&this.layers_[t].setMap(this.map_)},togglePois:function(n){n=!!n;for(var t=0;t<this.pois_.length;t++)this.pois_[t].setVisible(n)},toggleView:function(n,t){t=typeof t=="undefined"?!this.div.layout.hasClass("mapp-view-"+n):t;this.div.layout.toggleClass("mapp-view-"+n,t);n=="menu"&&t&&this.renderMenu();n=="directions"&&this.resize()},resize:function(){var n=this.getCenter();this.toggleView("mini",this.div.layout.width()<mappl10n.options.mini);mappl10n.options.engine=="leaflet"?this.map_.invalidateSize():mapp.event.trigger(this.map_,"resize");n&&this.setView(n)},recenter:function(){var t=this.center&&this.center.lat&&this.center.lng?this.center:null,n=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null,i,r;if(t&&!n&&this.query){this.search({geometry:{location:{lat:t.lat,lng:t.lng}}});return}if(t){this.setView(t,n?n:1);return}if(this.pois_.length==0){this.setView({lat:0,lng:0},n?n:1);return}if(this.pois_.length==1){this.pois_[0].center(n);return}for(bounds=mappl10n.options.engine=="leaflet"?new L.LatLngBounds:new google.maps.LatLngBounds,i=0;i<this.pois_.length;i++)r=this.pois_[i].getBounds(),bounds=r?mappl10n.options.engine=="leaflet"?bounds.extend(r):bounds.union(r):bounds.extend(this.pois_[i].getPosition());n?this.setView(bounds.getCenter().toJSON(),n):this.fitBounds(bounds)},toJSON:function(){var n;for(this.pois=[],n=0;n<this.pois_.length;n++)this.pois.push(this.pois_[n].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:this.mapTypeId,metaKey:this.metaKey,pois:this.pois,title:this.title,width:this.width,zoom:this.zoom}},ajaxSave:function(n){var t=this,i=JSON.stringify(this),r=!this.mapid||!this.postid?mappl10n.options.postid:this.postid;mapp.lib.ajax({type:"POST",data:{action:"mapp_save",map:i,postid:r,nonce:mappl10n.options.nonce},callback:function(i){i.status=="OK"&&(t.mapid||(t.mapid=i.data.mapid),n())}})},fitBounds:function(n,t){var t=mappl10n.options.engine=="leaflet"&&t?{paddingTopLeft:[t.left,t.top],paddingBottomRight:[t.right,t.bottom]}:t;return this.map_.fitBounds(n,t)},getBounds:function(){try{return this.map_.getBounds()}catch(n){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(n){return null}},getMapTypeId:function(n){return mappl10n.options.engine=="leaflet"?"roadmap":this.map_.getMapTypeId(n)},setMapTypeId:function(t){var s=this,i,r,e,u,o,f;if(mappl10n.options.engine=="leaflet")for(this.map_.eachLayer(function(n){s.map_.removeLayer(n)}),t=!this.editable&&mappl10n.options.style&&t=="streets"?mappl10n.options.style:t,t=_.findIndex(mappl10n.options.baseLayers,{name:t})>=0?t:mappl10n.options.baseLayers[0].name,i=0;i<mappl10n.options.baseLayers.length;i++)r=mappl10n.options.baseLayers[i],e=mappl10n.options.providers[r.provider],r.name==t&&(u=n.extend({},e,r),o=L.tileLayer(u.url,u),o.addTo(this.map_));else f=n.inArray(t,["roadmap","satellite","terrain","hybrid"])!=-1,t=this.editable?f||typeof mappl10n.options.styles[t]!="undefined"?t:"roadmap":f?t:"roadmap",this.map_.setMapTypeId(t)},setView:function(n,t,i){mappl10n.options.engine=="leaflet"?(t==null&&(t=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(n,t,i)):(n=n&&!n.toJSON?{lat:parseFloat(n.lat),lng:parseFloat(n.lng)}:n,t=t?parseInt(t):null,n&&this.map_.setCenter(n),t&&this.map_.setZoom(t))}};mapp.Map.ajaxGet=function(n,t,i){mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:n,nonce:mappl10n.options.nonce},callback:function(n){if(n.status=="OK"){var r=new mapp.Map(n.data.map,t);i(r)}}})};mapp.Map.ajaxDelete=function(n,t){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:n,nonce:mappl10n.options.nonce},callback:function(n){n.status=="OK"&&t&&t()}})}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Directions=function(t,i){this.sel=n(t);this.map=i;this.directionsRenderer=null;this.directionsService=null;this.placesService=null;var r=this;this.sel.on("keydown",function(n){n.which==13?(r.getDirections(),n.preventDefault()):n.which==27&&r.close()});this.sel.on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action"),u=n(".mapp-dir-daddr",r.sel).val(),f=n(".mapp-dir-saddr",r.sel).val();t.preventDefault();switch(i){case"dir-cancel":r.close();break;case"dir-get":r.getDirections();break;case"dir-myloc":r.map.places.geolocate(function(t){n(".mapp-dir-saddr",r.sel).val(t.name);r.getDirections()});break;case"dir-swap":n(".mapp-dir-saddr",r.sel).val(u);n(".mapp-dir-daddr",r.sel).val(f);r.getDirections()}});this.open=function(t,i){if(mappl10n.options.directions=="google"){this.openGoogle(t,i);return}this.map.toggleView("directions",!0);n(".mapp-dir-addr",this.sel).removeClass("mapp-error");n(".mapp-dir-saddr",this.sel).val(t);n(".mapp-dir-daddr",this.sel).val(i);n(".mapp-dir-get",this.sel).focus();n(".mapp-dir-saddr",this.sel).focus()};this.close=function(){this.map.toggleView("directions",!1);this.directionsRenderer&&(this.directionsRenderer.setPanel(null),this.directionsRenderer.getMap()&&(this.directionsRenderer.setMap(null),this.map.togglePois(!0)))};this.getDirections=function(){this.map.close();this.openGoogle(n(".mapp-dir-saddr",this.sel).val(),n(".mapp-dir-daddr",this.sel).val());return};this.openGoogle=function(n,t){var i=mappl10n.options.directionsServer;i.toLowerCase().indexOf("http")==-1&&(i="https://"+i);i+="?saddr="+encodeURIComponent(n);i+="&daddr="+encodeURIComponent(t);window.open(i)}}}(jQuery);mapp=window.mapp||{};mapp.geocoders={};+function(n){mapp.geocoders.Algolia=function(n){this.map=n;this.places=algoliasearch.initPlaces()};mapp.geocoders.Algolia.prototype={geocode:function(n,t){var i=this;this.getPredictions(n,function(i){i&&i.hits.length?t({formatted_address:i.hits[0].locale_names[0],name:n,geometry:{location:{lat:i.hits[0]._geoloc.lat,lng:i.hits[0]._geoloc.lng}}}):t(null)})},getDetails:function(n,t){if(mappl10n.options.geocoder=="nominatim")return this.getNominatimDetails(n,t);if(mappl10n.options.geocoder=="mapbox"&&mappl10n.options.mapbox)return this.getMapboxDetails(n,t);t({formatted_address:n.value,name:n.name,geometry:{location:n.latlng}});return},getNominatimDetails:function(t,i){url="https://nominatim.openstreetmap.org/search?format=json&limit=1&q="+encodeURIComponent(t.value);url=mappl10n.options.country?url+"&countrycodes="+mappl10n.options.country.toLowerCase():url;url=mappl10n.options.language?url+"&accept-language="+mappl10n.options.language.toLowerCase():url;n.getJSON(url,function(n){if(n&&n.length){var r=n[0],u=r.boundingbox&&r.boundingbox.length==4?{sw:{lat:r.boundingbox[0],lng:r.boundingbox[2]},ne:{lat:r.boundingbox[1],lng:r.boundingbox[3]}}:null;i({formatted_address:r.display_name,name:t.name,geometry:{location:{lat:r.lat,lng:r.lon},viewport:u}})}else i({formatted_address:t.value,name:t.name,geometry:{location:t.latlng}})})},getMapboxDetails:function(t,i){url="https://api.mapbox.com/geocoding/v5/mapbox.places/"+encodeURIComponent(t.value)+".json?access_token="+mappl10n.options.mapbox;url=mappl10n.options.country?url+"&country="+mappl10n.options.country.toLowerCase():url;url=mappl10n.options.language?url+"&language="+mappl10n.options.language.toLowerCase():url;n.getJSON(url,function(n){if(n&&n.features&&n.features.length>0){var r=n.features[0],u=r.bbox&&r.bbox.length==4?{sw:{lat:r.bbox[1],lng:r.bbox[0]},ne:{lat:r.bbox[3],lng:r.bbox[2]}}:null;i({formatted_address:r.place_name,name:t.name,geometry:{location:{lat:r.center[1],lng:r.center[0]},viewport:u}})}else i({formatted_address:t.value,name:t.name,geometry:{location:t.latlng}})})},getPredictions:function(n,t){this.places.search({query:n,language:mappl10n.options.language},function(n,i){n||!i?t(null):t(i)})}}}(jQuery);+function(n){mapp.geocoders.Google=function(t){this.map=t;this.token=null;this.types=this.map.editable?null:["geocode"];var i=n('<div style="display:none">').appendTo("body");this.placesService=new google.maps.places.PlacesService(i.get(0));this.autocompleteService=new google.maps.places.AutocompleteService;i.remove()};mapp.geocoders.Google.prototype={geocode:function(t,i){var r=this;this.getPredictions(t,function(t){t&&n.isArray(t)?r.getDetails(t[0],function(n){i(n)}):i(null)})},getDetails:function(n,t){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;this.token=null;var i={placeId:n.place_id,sessionToken:this.token};this.placesService.getDetails(i,function(n,i){if(i=="OK"&&n&&n.geometry){if(n.geometry.location&&(n.geometry.location=n.geometry.location.toJSON()),n.geometry.viewport){var r=n.geometry.viewport.toJSON();n.geometry.viewport={sw:{lat:r.south,lng:r.west},ne:{lat:r.north,lng:r.east}}}t(n)}else t(null)})},getPredictions:function(n,t){var i,r;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;i=this.map.getMap().getBounds();i=i?i:new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180));r={input:n,bounds:i,sessionToken:this.token,types:this.types};this.autocompleteService.getPlacePredictions(r,function(n,i){i=="OK"&&n&&n.length?t(n):(i==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):i==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),t(null))})}}}(jQuery);mapp=window.mapp||{};mapp.Icons={};mapp.Icons.get=function(){var n="https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png";return mappl10n.options.engine=="leaflet"?L.icon({iconUrl:n,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:n}};mapp.Icons.getUrl=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp=window.mapp||{};+function(n){mapp.InfoBox=function(t,i){var f=n.extend({border:20},i),u=null,r=null,o,e=this;r=n('<div class="mapp-ib-wrapper" tabindex="0"><div class="mapp-ib" tabindex="0"><\/div><div class="mapp-ib-tip"><\/div><\/div>').appendTo(t.getMap().getDiv());jQuery(window).resize(function(){e.close()});r.on("keydown",function(n){n.which==27&&e.close()});r.on("click",".mapp-close",function(){e.close()});this.getContent=function(){return n(".mapp-ib",r)};this.setContent=function(t){n(".mapp-ib",r).empty().append(t)};this.open=function(n,t){u=t;this.setMap(n)};this.onAdd=function(){o=!1;var t=n(":input",r);r.show();t.length?t.first().focus():r.focus();google.maps.event.trigger(e,"domready")};this.draw=function(){var l=this.getMap(),a=n(".mapp-ib-body",r),s=this.getProjection().fromLatLngToContainerPixel(u.position),t,h,c,i,e;o||(o=!0,t={width:n(":first-child",l.getDiv()).width(),height:n(":first-child",l.getDiv()).height()},r.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"}),h=r.outerWidth(!0),c=r.outerHeight(!0),c>t.height+u.anchorPoint.y-2*f.border&&(c=t.height+u.anchorPoint.y-2*f.border,r.css({"max-height":c+2})),i=s.x,e=s.y,i+h/2>t.width&&(i=t.width-h/2),i-h/2<0&&(i=h/2),e-c+u.anchorPoint.y<f.border&&(e=c-u.anchorPoint.y+f.border),e>t.height&&(e=t.height),(s.x-i||s.y-e)&&l.panBy(s.x-i,s.y-e),r.css({left:i-h/2,bottom:t.height-e-u.anchorPoint.y}))};this.close=function(){r.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))};this.onRemove=function(){r.hide()}};mappl10n.options.engine!="leaflet"&&(mapp.InfoBox.prototype=new google.maps.OverlayView)}(jQuery);mapp=window.mapp||{};+function(n){mapp.lib={ajax:function(t){var i=this;return n.extend({type:"GET",data:null,spinner:null,callback:n.noop},t),t.spinner&&t.spinner.show(),n.ajax({type:t.type,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,r,u){if(t.spinner&&t.spinner.hide(),n.status!="OK"){var f=typeof n=="object"?n.status:n;i.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+r+"\r\nResponseText="+u.responseText)}if(n.output){i.log("AJAX Output\r\n"+n.output);return}t.callback&&t.callback(n,u)},error:function(n,r,u){(t.spinner&&t.spinner.hide(),r!="cancel")&&typeof u!="undefined"&&u!=""&&i.alert("AJAX ERROR\r\nTextStatus="+r+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},alert:function(n){mappl10n.options.admin||mappl10n.options.debug?alert(n):window.console&&console.error(n)},jqVersionCheck:function(t){if(typeof n=="undefined"||typeof t=="undefined")return!1;for(t=t.split("."),v=n.fn.jquery.split("."),i=0;i<t.length;i++){var r=parseInt(t[i]),u=typeof v[i]!="undefined"?parseInt(v[i]):0;if(u!=r)return u>r}return!0},log:function(n){window.console&&console.error(n)},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var i=n.scrollTop(),u=n.height(),r=i+t.position().top,f=r+t.outerHeight(!0);r<i?n.scrollTop(r):f>i+u&&n.scrollTop(f-u)}},template:function(t,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[t]){var r=mappl10n.options.templates?mappl10n.options.template[t]:n("#mapp-tmpl-"+t).html();if(r)mapp.lib.templates[t]=_.template(r.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});else return""}return mapp.lib.templates[t](i)}};mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+n.fn.jquery);n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-layout",r).each(function(){var i=n(this).find(".mapp-canvas").attr("id"),t=window[i];t.resize();t.recenter()})})}(jQuery);+function(){mappl10n.options.engine=="leaflet"&&(L.LatLng.prototype.toJSON=function(){return{lat:this.lat,lng:this.lng}},L.LatLngBounds.prototype.toJSON=function(){return{south:this.getSouth(),west:this.getWest(),north:this.getNorth(),east:this.getEast()}},L.LatLng.prototype.toUrlValue=function(){return Math.round(this.lat*1e6)/1e6+", "+Math.round(this.lng*1e6)/1e6});mapp.event={addListener:function(n,t,i){if(mappl10n.options.engine=="leaflet")n.on(t,i);else google.maps.event.addListener(n,t,i)},addListenerOnce:function(n,t,i){if(mappl10n.options.engine=="leaflet")n.once(t,i);else google.maps.event.addListenerOnce(n,t,i)},clearInstanceListeners:function(n){mappl10n.options.engine=="leaflet"?n.off():google.maps.event.clearInstanceListeners(n)},clearListeners:function(n,t){mappl10n.options.engine=="leaflet"?n.off(t):google.maps.event.clearListeners(n,"rightclick")},trigger:function(n,t,i){mappl10n.options.engine=="leaflet"?n.fire(t,i):google.maps.event.trigger(n,t,i)}}}(jQuery);mapp=window.mapp||{};jQuery.fn.AlgoliaAutocomplete=jQuery.fn.autocomplete.noConflict();+function(n){mapp.Places=function(t,i){var r=this;this.sel=n(t);this.opts=n.extend({map:null},i);this.geocoder=mappl10n.options.engine=="leaflet"?new mapp.geocoders.Algolia(this.opts.map):new mapp.geocoders.Google(this.opts.map);this.sel.on("keydown",function(t){if(t.which==13){t.preventDefault();var i=r.parseLatLng(r.sel.val());i&&(n(r).triggerHandler("search.mapp",i),r.sel.AlgoliaAutocomplete("close"),t.stopImmediatePropagation());r.sel.val().substring(0,4)=="http"&&(n(r).triggerHandler("search.mapp",r.sel.val()),r.sel.AlgoliaAutocomplete("close"),t.stopImmediatePropagation())}});this.autocomplete()};mapp.Places.prototype={parse:function(t,i){var f=this,u=t&&t.name?n.trim(t.name):n.trim(t),r;if(!u){i(null);return}if(u=="user"){this.geolocate(function(n){i(n)});return}if(t&&t.geometry){i(t);return}if(r=this.parseLatLng(t),r){i(r);return}this.geocoder.geocode(t,function(n){i(n)})},parseLatLng:function(t){var i,e,r,u,f;return t.lat&&t.lng?i=t:(e=t&&t.name?n.trim(t.name):n.trim(t),r=e.split(","),r.length==2&&(u=parseFloat(r[0]),f=parseFloat(r[1]),isNaN(u)||isNaN(f)||(i={lat:u,lng:f}))),i?{name:i.lat+", "+i.lng,geometry:{location:i}}:null},geolocate:function(n){var t=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){var i={lat:t.coords.latitude,lng:t.coords.longitude};n({name:i.lat+", "+i.lng,geometry:{location:i}})},function(t){var i=t&&t.message?" : "+t.message:"";alert(mappl10n.no_geolocate+i);n(null)},{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4})},autocomplete:function(){var t=this,r,i,u;this.sel.on("autocomplete:selected",function(i,r){t.geocoder.getDetails(r,function(i){t.parse(i,function(i){i&&n(t).triggerHandler("search.mapp",i)})})});r={empty:'<div class="list-group search-results-dropdown"><div class="list-group-item">'+mappl10n.no_results+"<\/div><\/div>",header:'<div class="list-group search-results-dropdown">'};mappl10n.options.engine=="leaflet"?(i={algoliasearch:algoliasearch,templates:r},mappl10n.options.country&&(i.countries=[mappl10n.options.country]),mappl10n.options.language&&(i.language=mappl10n.options.language),u=placesAutocompleteDataset(i)):u={display:"description",source:function(n,i){t.geocoder.getPredictions(n,function(n){matches=n;i(matches)})},templates:r};this.sel.AlgoliaAutocomplete({autoselect:!0,cssClasses:{prefix:"mapp-aa"},debug:!1,hint:!0,highlight:!0,minLength:1},u)}}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Poi=function(t){var u,f,r,o,i,e,h,s;if(this.defaults={address:null,body:null,iconid:null,kml:null,map:null,overlay:null,postid:null,props:null,title:"",url:null,type:null,viewport:null},n.extend(this,this.defaults,t),t&&t.correctedAddress&&(this.address=t.correctedAddress),mappl10n.options.engine=="leaflet"&&this.isPoly()&&(this.type=null),t.viewport&&t.viewport.sw&&t.viewport.ne&&(u=t.viewport.sw,f=t.viewport.ne,this.viewport=mappl10n.options.engine=="leaflet"?new L.LatLngBounds(L.latLng(u.lat,u.lng),L.latLng(f.lat,f.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(u.lat,u.lng),new google.maps.LatLng(f.lat,f.lng))),r=[],o=[],!t.overlay)switch(this.type){case"polygon":if(t.poly&&t.poly.paths)for(i=0;i<t.poly.paths.length;i++){for(r=[],e=0;e<t.poly.paths[i].length;e++)r.push(new google.maps.LatLng(t.poly.paths[i][e].lat,t.poly.paths[i][e].lng));o.push(new google.maps.MVCArray(r))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(o)});this.setColors(t.poly);break;case"polyline":if(t.poly&&t.poly.path)for(i=0;i<t.poly.path.length;i++)r.push(new google.maps.LatLng(t.poly.path[i].lat,t.poly.path[i].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(r)});this.setColors(t.poly);break;case"circle":h=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Circle({center:h,radius:parseFloat(t.poly.radius)});this.setColors(t.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(t.poly);break;case"kml":s=t.kml&&t.kml.url?t.kml.url:"";this.overlay=mappl10n.options.engine=="leaflet"?omnivore.kml(s):new google.maps.KmlLayer(s,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:this.overlay=mappl10n.options.engine=="leaflet"?L.marker([t.point.lat,t.point.lng],{title:t.title}):new google.maps.Marker({position:new google.maps.LatLng(t.point.lat,t.point.lng),title:t.title})}t.type||this.setIcon(t.iconid)};mapp.Poi.prototype={toJSON:function(){var n={address:this.address,body:this.body,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},u=this.getPosition(),i,t,r;if(n.point=u.toJSON(),i=this.viewport?this.viewport:this.getBounds(),i&&(t=i.toJSON(),n.viewport={sw:{lat:t.south,lng:t.west},ne:{lat:t.north,lng:t.east}}),this.type=="kml"&&(n.kml=this.kml),this.isPoly()){n.poly=this.getColors();switch(this.type){case"circle":n.poly.radius=this.overlay.getRadius();break;case"polyline":n.poly.path=[];this.overlay.getPath().forEach(function(t){n.poly.path.push(t.toJSON())});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push(n.toJSON())});n.poly.paths.push(i)});break;case"rectangle":r=this.overlay.getBounds();n.viewport={sw:r.getSouthWest().toJSON(),ne:r.getNorthEast().toJSON()}}}return n},setMap:function(n){var t=this;if(this.map=n,mapp.event.clearInstanceListeners(this.overlay),n==null){mappl10n.options.engine=="leaflet"?this.overlay.remove():this.overlay.setMap(null);return}this.type=="kml"&&(mappl10n.options.engine=="leaflet"?(mapp.event.addListenerOnce(this.overlay,"ready",function(){t.viewport=t.overlay.getBounds()}),mapp.event.addListenerOnce(this.overlay,"error",function(){alert(mappl10n.kml_error)})):(mapp.event.addListener(this.overlay,"defaultviewport_changed",function(){t.viewport=t.overlay.getDefaultViewport()}),mapp.event.addListener(this.overlay,"status_changed",function(){var n=t.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)})));mapp.event.addListener(this.overlay,"click",function(n){t.open(n)});this.setEditable(this.map.editable);mappl10n.options.engine=="leaflet"?this.overlay.addTo(n.getMap()):this.overlay.setMap(n.getMap())},setEditable:function(n){var t=this;this.type!="kml"&&(mappl10n.options.engine=="leaflet"?this.overlay.options.draggable=n:this.overlay.setDraggable(n),this.isPoly()&&this.overlay.setEditable(n),mapp.event.clearListeners(this.overlay,"rightclick"),mapp.event.clearListeners(this.overlay,"dragstart"),n&&(mapp.event.addListener(this.overlay,"dragstart",function(){t.viewport=null;t.map.close()}),(this.type=="polygon"||this.type=="polyline")&&mapp.event.addListener(this.overlay,"rightclick",function(n){n.vertex!=null&&t.overlay.getPath().getLength()>2&&t.overlay.getPath().removeAt(n.vertex)})))},setZIndex:function(n){mappl10n.options.engine=="leaflet"?this.type||this.overlay.setZIndexOffset(n):this.overlay.set("zIndex",n)},setIcon:function(n){this.type||typeof mapp.Icons=="undefined"||(this.iconid=n,mappl10n.options.engine=="leaflet"?this.overlay.setIcon(mapp.Icons.get(n)):(this.overlay.setIcon(null),this.overlay.setIcon(mapp.Icons.get(n))))},setVisible:function(n){typeof this.overlay.setVisible!="undefined"&&this.overlay.setVisible(n)},setColors:function(n){var i={};for(var t in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})n&&typeof n[t]!="undefined"&&(i[t]=n[t]);this.overlay.setOptions(i)},setTemplateColors:function(n,t,i){var r=this.type=="polyline"?{strokeColor:n,strokeOpacity:t/100,strokeWeight:i}:{fillColor:n,fillOpacity:t/100,strokeColor:n,strokeWeight:i,strokeOpacity:1};this.setColors(r)},getColors:function(){var t={};for(var n in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})typeof this.overlay[n]!="undefined"&&(t[n]=this.overlay[n]);return t},getTemplateColors:function(){var n=this.getColors();return this.type=="polyline"?{color:n.strokeColor,opacity:n.strokeOpacity*100,weight:n.strokeWeight}:{color:n.fillColor,opacity:n.fillOpacity*100,weight:n.strokeWeight}},center:function(n){var t=this.getBounds();if(typeof n=="number"){this.map.setView(this.getPosition(),n);return}if(!t){this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));return}this.map.fitBounds(t);this.map.setView(this.getPosition(),n)},open:function(n){this.map.open(this,n)},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;switch(this.type){case"polyline":n=new google.maps.LatLngBounds;this.overlay.getPath().forEach(function(t){n.extend(t)});break;case"polygon":n=new google.maps.LatLngBounds;this.overlay.getPaths().forEach(function(t){t.forEach(function(t){n.extend(t)})});break;case"rectangle":case"circle":n=this.overlay.getBounds();break;case"kml":n=mappl10n.options.engine=="leaflet"?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport();n=n?n:this.viewport;break;default:return this.viewport}return n},getPosition:function(n){if(!this.type)return mappl10n.options.engine=="leaflet"?this.overlay.getLatLng():this.overlay.getPosition();if(this.type=="kml"&&n&&n.latLng)return n.latLng;var t=this.getBounds();return t?t.getCenter():mappl10n.options.engine=="leaflet"?new L.latLng(0,0):new google.maps.LatLng(0,0)},getAddress:function(){return this.address?this.address:this.getPosition().toUrlValue()},getAnchorPoint:function(n){var t=this.isPoly()?"poly":this.type;switch(t){case"kml":return mappl10n.options.engine=="leaflet"?[0,0]:n&&n.pixelOffset?new google.maps.Point(n.pixelOffset.width,n.pixelOffset.height):new google.maps.Point(0,0);case"poly":return mappl10n.options.engine=="leaflet"?[0,0]:new google.maps.Point(0,0);default:return mappl10n.options.engine=="leaflet"?this.overlay.options.icon.options.popupAnchor?this.overlay.options.icon.options.popupAnchor:[0,-32]:typeof this.overlay.anchorPoint!="undefined"?this.overlay.anchorPoint:new google.maps.Point(0,-32)}},render:function(n,t){var i=_.extend(this,{icon:mapp.Icons.getUrl(this.iconid)});return t&&(i.body=t.description,i.title=t.name),mapp.lib.template(this.map.templates[n],{poi:i,colors:this.getTemplateColors()})}}}(jQuery);mapp=window.mapp||{};mapp.widgets={};+function(n){mapp.widgets.Grid=function(t,i){this.el=n(t);this.options=jQuery.extend({action:null,sortable:!1},i);var r=this;this.table=n("table",this.el);this.template=n("script",this.el).html().replace(new RegExp("'","g"),'"');this.el.on("click",function(t){var u=n(t.target),i=u.attr("data-mapp-action");i&&(r[i](t),t.preventDefault())})};mapp.widgets.Grid.prototype={add:function(){this.table.show();var t=n(this.template).appendTo(this.table);n(":input:eq(0)",t).focus()},remove:function(t){var i=n(t.target).closest("tr").remove();n("tbody > tr",this.table).length||this.table.hide()}}}(jQuery);+function(n){mapp.widgets.Popup=function(t,i){var r,u;if(this.activeToggle=null,this.content=t,this.el=null,r=this,this.options=n.extend({max:!1,modal:!1,position:null,toggle:null},i),this.options.modal?this.el=this.content.addClass("mapp-popup-fixed"):(this.el=n('<div class="mapp-popup">'),this.setContent(t)),this.el.attr("tabindex",0),this.options.max&&this.el.addClass("mapp-popup-max"),this.el.hide(),!this.options.modal)n(document).on("click.mapp.popup",function(t){n.contains(r.el.get(0),t.target)||r.el.get(0)==t.target||r.close()});if(this.options.toggle){u=typeof this.options.toggle=="string"?this.options.toggle:this.options.toggle.selector;n(document).on("click",u,function(t){r.activeToggle=n(this);r.open();t.stopPropagation()})}this.el.on("click",".mapp-close",function(){r.close()});this.el.on("keydown",function(n){n.which==27&&r.close()});return this};mapp.widgets.Popup.prototype={close:function(){this.el&&this.el.is(":visible")&&(this.backdrop&&(this.backdrop.remove(),n("body").removeClass("mapp-popup-modal")),this.el.hide(),this.activeToggle&&this.activeToggle.focus(),this.el.trigger("closed.mapp.popup"))},open:function(){var t=this;this.options.modal||this.el.parent().length||this.el.appendTo("body");this.el.show();this.options.modal?(this.backdrop=n('<div class="mapp-popup-backdrop"><\/div>'),this.el.after(this.backdrop),n("body").addClass("mapp-popup-modal")):this.el.position(n.extend({my:"center bottom",at:"center top-5",of:this.activeToggle,collision:"flipfit"},this.options.position));this.el.focus();this.el.trigger("open.mapp.popup")},setContent:function(n){this.el.empty();this.el.append('<span class="mapp-close">').append(n)},toggle:function(){this.el.is(":visible")?this.close():this.open()}}}(jQuery);+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop();window[n.name]=new mapp.Map(n);window[n.name].display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
|
js/mappress_editor.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var mapp=window.mapp||{};+function(n){mapp.Media=function(){this.editor=null;this.map=null;this.settings=null;this.sel=n(".mapp-media");this.items=null;var t=this;this.initialize=function(){this.find();this.sel.on("change",".mapp-media-list-type",function(){var i=n(".mapp-media-list-type",this.sel).val();n(".mapp-media-search").val("");n(".mapp-media-search").toggle(i=="all");t.find()});this.sel.on("keydown",".mapp-media-search",function(n){if(n.which==13)return!1});this.sel.on("input",".mapp-media-search",function(){t.find()});this.settings={editable:!0,name:"mapp0"};this.sel.on("click","[data-mapp-media]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media");t[r]()});this.sel.on("click",".mapp-media-list .mapp-item",function(){n(".mapp-media-list .mapp-item",this.sel).removeClass("mapp-active");n(this).addClass("mapp-active")});this.sel.on("click",".mapp-media-list [data-mapp-media-list]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media-list"),u=n(this).closest(".mapp-item"),f=u.attr("data-mapp-mapid");return t[r](f),!1});this.sel.on("change",".mapp-media-viewport",function(){n(this).is(":checked")||(t.map.center=t.map.zoom=null,t.map.recenter())});n(".mapp-media-size").click(function(t){var i=n(this).data("width"),r=n(this).data("height");n(".mapp-media-width").val(i);n(".mapp-media-height").val(r);t.preventDefault()});n("#publish, #post-preview").click(function(){t.save()});n(".mapp-media-title").keydown(function(n){n.which==13&&(n.preventDefault(),t.save())})};this.add=function(){var n=new mapp.Map(this.settings);n.width=mappl10n.options.sizes[mappl10n.options.size].width;n.height=mappl10n.options.sizes[mappl10n.options.size].height;t.open(n)};this.cancel=function(){t.closeEditor()};this.closeEditor=function(){this.editor.close();this.map=null;this.editor=null;n(".mapp-media-edit-panel").hide();n(".mapp-media-list-panel").show()};this.edit=function(n){mapp.Map.ajaxGet(n,this.settings,function(n){t.open(n)})};this.find=function(){var t=this;this.items!==null?this.renderList():(n(".spinner",this.sel).css("visibility","visible"),mapp.lib.ajax({type:"GET",data:{action:"mapp_find"},callback:function(i){i.status=="OK"&&(n(".spinner",this.sel).css("visibility","hidden"),t.items=_.sortBy(i.data,"post_title"),t.renderList())}}))};this.insert=function(n){n=n?n:this.map.mapid;var t='[mappress mapid="'+n+'"]';send_to_editor(t)};this.open=function(t){this.map=t;n(".mapp-edit",this.sel).html(mapp.lib.template("edit-map"));var i=this.map.mapid;i?n(".mapp-media-mapid").text(i):n(".mapp-media-mapid").text("");n(".mapp-media-title").val(this.map.title);n(".mapp-media-width").val(this.map.width);n(".mapp-media-height").val(this.map.height);n(".mapp-media-viewport").prop("checked",!!(this.map.center&&this.map.zoom));n(".mapp-media-edit-panel").show();n(".mapp-media-list-panel").hide();this.editor=new mapp.Editor(this.map)};this.remove=function(n){if(confirm(mappl10n.delete_map_prompt)){var t=_.findIndex(this.items,{mapid:n});t>-1&&(this.items.splice(t,1),mapp.Map.ajaxDelete(n),this.renderList())}};this.renderList=function(){var t=null,i=400,r=null,u=n(".mapp-media-list-type",this.sel).val(),f=n(".mapp-media-search",this.sel).val().toLowerCase();t=u=="all"?_.filter(this.items,function(n){return n.post_title&&n.post_title.toLowerCase().indexOf(f)!=-1||n.map_title&&n.map_title.toLowerCase().indexOf(f)!=-1}):_.filter(this.items,function(n){return n.postid==mappl10n.options.postid});t.length>i?(r=mappl10n.more.replace("%d",i).replace("%d",t.length),t=t.slice(0,i)):r="";n(".mapp-media-list",this.sel).html(mapp.lib.template("media-list",{items:t,type:u,more:r}))};this.save=function(){var t=this;this.map&&(this.map.title=n.trim(n(".mapp-media-title").val()),this.map.width=n(".mapp-media-width").val(),this.map.height=n(".mapp-media-height").val(),n(".mapp-media-viewport").prop("checked")?(this.map.center=this.map.getMap().getCenter().toJSON(),this.map.zoom=this.map.getMap().getZoom()):(this.map.center=null,this.map.zoom=null),this.map.ajaxSave(function(){var i=t.map.mapid?t.map.mapid.toString():null,r=_.findIndex(t.items,function(n){return n.mapid==i});r==-1?t.items.unshift({mapid:i,map_title:t.map.title,postid:mappl10n.options.postid,post_title:n("#title").val()||n("#post-title-0").val()}):t.items[r].map_title=t.map.title;t.renderList();t.closeEditor()}))};this.initialize.apply(this)}}(jQuery);+function(n){mapp.Editor=function(t){this.drawingManager=null;this.map=t;this.poiEditor=null;this.sel=n(".mapp-edit");var i=this;this.initialize=function(){this.map.display();this.poiEditor=new mapp.PoiEditor(this.map);this.initDrawingManager();n(this.map.places).off("search.mapp");n(this.map.places).on("search.mapp",function(n,t){i.insertPoi(t)});this.sel.on("click","[data-mapp-editor]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-editor");i[r]()})};this.close=function(){this.map.close()};this.insertPoi=function(n){var t;if(n)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.close(),n.geometry){var i=n.formatted_address?n.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,r=n.name==i?"":i,t=new mapp.Poi({address:i,body:r,iconid:this.poiEditor.lastIcon,point:n.geometry.location,title:n.name,viewport:n.geometry.viewport?n.geometry.viewport:null});this.map.insertPoi(t);t.center()}else n.overlay&&(t=new mapp.Poi({body:"",iconid:n.type=="marker"?null:"poly",overlay:n.overlay,title:n.type=="marker"?n.overlay.getPosition().toUrlValue(6):mappl10n.shape,type:n.type=="marker"?null:n.type}),this.map.insertPoi(t))};this.initDrawingManager=function(){};this.layer=function(){var n=window.prompt(mappl10n.layer);n&&i.insertPoi(n)};this.initialize.apply(this)};mapp.PoiEditor=function(t){this.map=t;this.poi=null;this.sel=null;this.lastIcon=null;var i=this;this.initialize=function(){this.sel=n(this.map.iw.getContent());n(this.map).on("mapp.open",function(n,t){i.render(t)});n(this.map).on("mapp.close",function(){i.mce(!1)});this.sel.on("click","[data-mapp-poi]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-poi");i[r]()});this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",function(){var t=n(this).hasClass("mapp-poi-visual");i.mce(t)});this.sel.on("keydown",function(t){t.which==13&&t.target!=n("#mapp-poi-body")&&(t.preventDefault(),i.save())});this.sel.on("change","[data-mapp-iconpicker]",function(){i.poi.setIcon(n("[data-mapp-iconpicker]").attr("data-mapp-iconid"));i.lastIcon=i.poi.iconid;i.map.renderList()});this.sel.on("change","[data-mapp-colorpicker]",function(){i.poi.setTemplateColors(n("[data-mapp-colorpicker]").attr("data-mapp-color"),n("[data-mapp-colorpicker]").attr("data-mapp-opacity"),n("[data-mapp-colorpicker]").attr("data-mapp-weight"));i.map.renderList()})};this.cancel=function(){this.map.close()};this.initMCE=function(){var n,t,i;typeof tinyMCE!="undefined"&&typeof tinyMCE.init!="undefined"&&(n="en",typeof tinyMCEPreInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit.content!="undefined"&&(t=window.tinyMCEPreInit.mceInit.content,n=typeof t.language!="undefined"?t.language:"en"),i={mode:"none",height:"75px",convert_urls:!1,language:n,menubar:!1,plugins:"wordpress,paste,wplink,textcolor,image",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link,unlink,image",toolbar2:"",toolbar3:"",toolbar4:""},tinyMCE.init(i),this.mce(!0))};this.mce=function(t){var r=t?"mceAddEditor":"mceRemoveEditor";typeof tinyMCE!="undefined"&&tinyMCE.execCommand(r,!1,"mapp-poi-body");n(".mapp-poi-visual, .mapp-poi-html",i.sel).removeClass("mapp-active");t?n(".mapp-poi-visual",i.sel).addClass("mapp-active"):n(".mapp-poi-html",i.sel).addClass("mapp-active")};this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.close(),this.map.removePoi(this.poi))};this.render=function(t){this.poi=t;n("[data-mapp-iconpicker]").trigger("refresh");n("[data-mapp-colorpicker]").trigger("refresh");this.initMCE()};this.save=function(){typeof tinyMCE!="undefined"&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save();this.poi.title=n(".mapp-poi-title").val();this.poi.body=n(".mapp-poi-body").val();this.map.renderList();this.map.close()};this.initialize.apply(this)}}(jQuery)
|
1 |
+
var mapp=window.mapp||{};+function(n){mapp.Media=function(){this.editor=null;this.map=null;this.settings=null;this.sel=n(".mapp-media");this.items=null;var t=this;this.initialize=function(){this.find();this.sel.on("change",".mapp-media-list-type",function(){var i=n(".mapp-media-list-type",this.sel).val();n(".mapp-media-search").val("");n(".mapp-media-search").toggle(i=="all");t.find()});this.sel.on("keydown",".mapp-media-search",function(n){if(n.which==13)return!1});this.sel.on("input",".mapp-media-search",function(){t.find()});this.settings={editable:!0,name:"mapp0"};this.sel.on("click","[data-mapp-media]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media");t[r]()});this.sel.on("click",".mapp-media-list .mapp-item",function(){n(".mapp-media-list .mapp-item",this.sel).removeClass("mapp-active");n(this).addClass("mapp-active")});this.sel.on("click",".mapp-media-list [data-mapp-media-list]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media-list"),u=n(this).closest(".mapp-item"),f=u.attr("data-mapp-mapid");return t[r](f),!1});this.sel.on("change",".mapp-media-viewport",function(){n(this).is(":checked")||(t.map.center=t.map.zoom=null,t.map.recenter())});n(".mapp-media-size").click(function(t){var i=n(this).data("width"),r=n(this).data("height");n(".mapp-media-width").val(i);n(".mapp-media-height").val(r);t.preventDefault()});n("#publish, #post-preview").click(function(){t.save()});n(".mapp-media-title").keydown(function(n){n.which==13&&(n.preventDefault(),t.save())})};this.add=function(){var n=new mapp.Map(this.settings);n.width=mappl10n.options.sizes[mappl10n.options.size].width;n.height=mappl10n.options.sizes[mappl10n.options.size].height;t.open(n)};this.cancel=function(){t.closeEditor()};this.closeEditor=function(){this.editor.close();this.map=null;this.editor=null;n(".mapp-media-edit-panel").hide();n(".mapp-media-list-panel").show()};this.edit=function(n){mapp.Map.ajaxGet(n,this.settings,function(n){t.open(n)})};this.find=function(){var t=this;this.items!==null?this.renderList():(n(".spinner",this.sel).css("visibility","visible"),mapp.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(i){i.status=="OK"&&(n(".spinner",this.sel).css("visibility","hidden"),t.items=_.sortBy(i.data,"post_title"),t.renderList())}}))};this.insert=function(n){n=n?n:this.map.mapid;var t='[mappress mapid="'+n+'"]';send_to_editor(t)};this.open=function(t){this.map=t;n(".mapp-edit",this.sel).html(mapp.lib.template("edit-map"));var i=this.map.mapid;i?n(".mapp-media-mapid").text(i):n(".mapp-media-mapid").text("");n(".mapp-media-title").val(this.map.title);n(".mapp-media-width").val(this.map.width);n(".mapp-media-height").val(this.map.height);n(".mapp-media-viewport").prop("checked",!!(this.map.center&&this.map.zoom));n(".mapp-media-edit-panel").show();n(".mapp-media-list-panel").hide();this.editor=new mapp.Editor(this.map)};this.remove=function(n){if(confirm(mappl10n.delete_map_prompt)){var t=_.findIndex(this.items,{mapid:n});t>-1&&(this.items.splice(t,1),mapp.Map.ajaxDelete(n),this.renderList())}};this.renderList=function(){var t=null,i=400,r=null,u=n(".mapp-media-list-type",this.sel).val(),f=n(".mapp-media-search",this.sel).val().toLowerCase();t=u=="all"?_.filter(this.items,function(n){return n.post_title&&n.post_title.toLowerCase().indexOf(f)!=-1||n.map_title&&n.map_title.toLowerCase().indexOf(f)!=-1}):_.filter(this.items,function(n){return n.postid==mappl10n.options.postid});t.length>i?(r=mappl10n.more.replace("%d",i).replace("%d",t.length),t=t.slice(0,i)):r="";n(".mapp-media-list",this.sel).html(mapp.lib.template("media-list",{items:t,type:u,more:r}))};this.save=function(){var t=this;this.map&&(this.map.title=n.trim(n(".mapp-media-title").val()),this.map.width=n(".mapp-media-width").val(),this.map.height=n(".mapp-media-height").val(),n(".mapp-media-viewport").prop("checked")?(this.map.center=this.map.getMap().getCenter().toJSON(),this.map.zoom=this.map.getMap().getZoom()):(this.map.center=null,this.map.zoom=null),this.map.ajaxSave(function(){var i=t.map.mapid?t.map.mapid.toString():null,r=_.findIndex(t.items,function(n){return n.mapid==i});r==-1?t.items.unshift({mapid:i,map_title:t.map.title,postid:mappl10n.options.postid,post_title:n("#title").val()||n("#post-title-0").val()}):t.items[r].map_title=t.map.title;t.renderList();t.closeEditor()}))};this.initialize.apply(this)}}(jQuery);+function(n){mapp.Editor=function(t){this.drawingManager=null;this.map=t;this.poiEditor=null;this.sel=n(".mapp-edit");var i=this;this.initialize=function(){this.map.display();this.poiEditor=new mapp.PoiEditor(this.map);this.initDrawingManager();n(this.map.places).off("search.mapp");n(this.map.places).on("search.mapp",function(n,t){i.insertPoi(t)});this.sel.on("click","[data-mapp-editor]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-editor");i[r]()})};this.close=function(){this.map.close()};this.insertPoi=function(n){var t;if(n)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.close(),n.geometry){var i=n.formatted_address?n.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,r=n.name==i?"":i,t=new mapp.Poi({address:i,body:r,iconid:this.poiEditor.lastIcon,point:n.geometry.location,title:n.name,viewport:n.geometry.viewport?n.geometry.viewport:null});this.map.insertPoi(t);t.center()}else n.overlay&&(t=new mapp.Poi({body:"",iconid:n.type=="marker"?null:"poly",overlay:n.overlay,title:n.type=="marker"?n.overlay.getPosition().toUrlValue(6):mappl10n.shape,type:n.type=="marker"?null:n.type}),this.map.insertPoi(t))};this.initDrawingManager=function(){};this.layer=function(){var n=window.prompt(mappl10n.layer);n&&i.insertPoi(n)};this.initialize.apply(this)};mapp.PoiEditor=function(t){this.map=t;this.poi=null;this.sel=null;this.lastIcon=null;var i=this;this.initialize=function(){this.sel=n(this.map.iw.getContent());n(this.map).on("mapp.open",function(n,t){i.render(t)});n(this.map).on("mapp.close",function(){i.mce(!1)});this.sel.on("click","[data-mapp-poi]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-poi");i[r]()});this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",function(){var t=n(this).hasClass("mapp-poi-visual");i.mce(t)});this.sel.on("keydown",function(t){t.which==13&&t.target!=n("#mapp-poi-body")&&(t.preventDefault(),i.save())});this.sel.on("change","[data-mapp-iconpicker]",function(){i.poi.setIcon(n("[data-mapp-iconpicker]").attr("data-mapp-iconid"));i.lastIcon=i.poi.iconid;i.map.renderList()});this.sel.on("change","[data-mapp-colorpicker]",function(){i.poi.setTemplateColors(n("[data-mapp-colorpicker]").attr("data-mapp-color"),n("[data-mapp-colorpicker]").attr("data-mapp-opacity"),n("[data-mapp-colorpicker]").attr("data-mapp-weight"));i.map.renderList()})};this.cancel=function(){this.map.close()};this.initMCE=function(){var n,t,i;typeof tinyMCE!="undefined"&&typeof tinyMCE.init!="undefined"&&(n="en",typeof tinyMCEPreInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit.content!="undefined"&&(t=window.tinyMCEPreInit.mceInit.content,n=typeof t.language!="undefined"?t.language:"en"),i={mode:"none",height:"75px",convert_urls:!1,language:n,menubar:!1,plugins:"wordpress,paste,wplink,textcolor,image",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link,unlink,image",toolbar2:"",toolbar3:"",toolbar4:""},tinyMCE.init(i),this.mce(!0))};this.mce=function(t){var r=t?"mceAddEditor":"mceRemoveEditor";typeof tinyMCE!="undefined"&&tinyMCE.execCommand(r,!1,"mapp-poi-body");n(".mapp-poi-visual, .mapp-poi-html",i.sel).removeClass("mapp-active");t?n(".mapp-poi-visual",i.sel).addClass("mapp-active"):n(".mapp-poi-html",i.sel).addClass("mapp-active")};this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.close(),this.map.removePoi(this.poi))};this.render=function(t){this.poi=t;n("[data-mapp-iconpicker]").trigger("refresh");n("[data-mapp-colorpicker]").trigger("refresh");this.initMCE()};this.save=function(){typeof tinyMCE!="undefined"&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save();this.poi.title=n(".mapp-poi-title").val();this.poi.body=n(".mapp-poi-body").val();this.map.renderList();this.map.close()};this.initialize.apply(this)}}(jQuery)
|
languages/mappress-google-maps-for-wordpress.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
Â
# This file is distributed under the same license as the MapPress Maps for WordPress plugin.
|
3 |
Â
msgid ""
|
4 |
Â
msgstr ""
|
5 |
-
"Project-Id-Version: MapPress Maps for WordPress 2.53.
|
6 |
Â
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
Â
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
Â
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
Â
"MIME-Version: 1.0\n"
|
10 |
Â
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
Â
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2020-
|
13 |
Â
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
Â
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
Â
|
@@ -158,7 +158,7 @@ msgid "MapPress Settings"
|
|
158 |
Â
msgstr ""
|
159 |
Â
|
160 |
Â
#: mappress.php:314
|
161 |
-
#: mappress.php:
|
162 |
Â
msgid "Version"
|
163 |
Â
msgstr ""
|
164 |
Â
|
@@ -218,36 +218,36 @@ msgstr ""
|
|
218 |
Â
msgid "Shape"
|
219 |
Â
msgstr ""
|
220 |
Â
|
221 |
-
#: mappress.php:
|
222 |
Â
msgid "Improve this map"
|
223 |
Â
msgstr ""
|
224 |
Â
|
225 |
-
#: mappress.php:
|
226 |
-
#: mappress.php:
|
227 |
Â
msgid "Streets"
|
228 |
Â
msgstr ""
|
229 |
Â
|
230 |
-
#: mappress.php:
|
231 |
Â
msgid "Outdoors"
|
232 |
Â
msgstr ""
|
233 |
Â
|
234 |
-
#: mappress.php:
|
235 |
Â
msgid "Light"
|
236 |
Â
msgstr ""
|
237 |
Â
|
238 |
-
#: mappress.php:
|
239 |
Â
msgid "Dark"
|
240 |
Â
msgstr ""
|
241 |
Â
|
242 |
-
#: mappress.php:
|
243 |
Â
msgid "Satellite"
|
244 |
Â
msgstr ""
|
245 |
Â
|
246 |
-
#: mappress.php:
|
247 |
Â
msgid "Satellite Streets"
|
248 |
Â
msgstr ""
|
249 |
Â
|
250 |
-
#: mappress.php:
|
251 |
Â
msgid "Settings"
|
252 |
Â
msgstr ""
|
253 |
Â
|
@@ -260,24 +260,24 @@ msgstr ""
|
|
260 |
Â
msgid "MapPress"
|
261 |
Â
msgstr ""
|
262 |
Â
|
263 |
-
#: mappress_map.php:
|
264 |
Â
msgid "Map not found"
|
265 |
Â
msgstr ""
|
266 |
Â
|
267 |
-
#: mappress_map.php:
|
268 |
Â
#: pro/mappress_pro_settings.php:37
|
269 |
Â
msgid "Filter"
|
270 |
Â
msgstr ""
|
271 |
Â
|
272 |
-
#: mappress_map.php:
|
273 |
Â
msgid "Show map"
|
274 |
Â
msgstr ""
|
275 |
Â
|
276 |
-
#: mappress_map.php:
|
277 |
Â
msgid "Map"
|
278 |
Â
msgstr ""
|
279 |
Â
|
280 |
-
#: mappress_map.php:
|
281 |
Â
msgid "List"
|
282 |
Â
msgstr ""
|
283 |
Â
|
2 |
Â
# This file is distributed under the same license as the MapPress Maps for WordPress plugin.
|
3 |
Â
msgid ""
|
4 |
Â
msgstr ""
|
5 |
+
"Project-Id-Version: MapPress Maps for WordPress 2.53.9\n"
|
6 |
Â
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
Â
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
Â
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
Â
"MIME-Version: 1.0\n"
|
10 |
Â
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
Â
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2020-04-02T22:06:20+00:00\n"
|
13 |
Â
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
Â
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
Â
|
158 |
Â
msgstr ""
|
159 |
Â
|
160 |
Â
#: mappress.php:314
|
161 |
+
#: mappress.php:766
|
162 |
Â
msgid "Version"
|
163 |
Â
msgstr ""
|
164 |
Â
|
218 |
Â
msgid "Shape"
|
219 |
Â
msgstr ""
|
220 |
Â
|
221 |
+
#: mappress.php:440
|
222 |
Â
msgid "Improve this map"
|
223 |
Â
msgstr ""
|
224 |
Â
|
225 |
+
#: mappress.php:456
|
226 |
+
#: mappress.php:475
|
227 |
Â
msgid "Streets"
|
228 |
Â
msgstr ""
|
229 |
Â
|
230 |
+
#: mappress.php:457
|
231 |
Â
msgid "Outdoors"
|
232 |
Â
msgstr ""
|
233 |
Â
|
234 |
+
#: mappress.php:458
|
235 |
Â
msgid "Light"
|
236 |
Â
msgstr ""
|
237 |
Â
|
238 |
+
#: mappress.php:459
|
239 |
Â
msgid "Dark"
|
240 |
Â
msgstr ""
|
241 |
Â
|
242 |
+
#: mappress.php:460
|
243 |
Â
msgid "Satellite"
|
244 |
Â
msgstr ""
|
245 |
Â
|
246 |
+
#: mappress.php:461
|
247 |
Â
msgid "Satellite Streets"
|
248 |
Â
msgstr ""
|
249 |
Â
|
250 |
+
#: mappress.php:549
|
251 |
Â
msgid "Settings"
|
252 |
Â
msgstr ""
|
253 |
Â
|
260 |
Â
msgid "MapPress"
|
261 |
Â
msgstr ""
|
262 |
Â
|
263 |
+
#: mappress_map.php:166
|
264 |
Â
msgid "Map not found"
|
265 |
Â
msgstr ""
|
266 |
Â
|
267 |
+
#: mappress_map.php:428
|
268 |
Â
#: pro/mappress_pro_settings.php:37
|
269 |
Â
msgid "Filter"
|
270 |
Â
msgstr ""
|
271 |
Â
|
272 |
+
#: mappress_map.php:461
|
273 |
Â
msgid "Show map"
|
274 |
Â
msgstr ""
|
275 |
Â
|
276 |
+
#: mappress_map.php:465
|
277 |
Â
msgid "Map"
|
278 |
Â
msgstr ""
|
279 |
Â
|
280 |
+
#: mappress_map.php:466
|
281 |
Â
msgid "List"
|
282 |
Â
msgstr ""
|
283 |
Â
|
mappress.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Maps for WordPress
|
|
4 |
Â
Plugin URI: https://www.mappresspro.com/mappress
|
5 |
Â
Author URI: https://www.mappresspro.com/chris-contact
|
6 |
Â
Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
|
7 |
-
Version: 2.53.
|
8 |
Â
Author: Chris Richardson
|
9 |
Â
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Â
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
|
@@ -35,7 +35,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
|
|
35 |
Â
}
|
36 |
Â
|
37 |
Â
class Mappress {
|
38 |
-
const VERSION = '2.53.
|
39 |
Â
|
40 |
Â
static
|
41 |
Â
$baseurl,
|
@@ -423,7 +423,8 @@ class Mappress {
|
|
423 |
Â
'iconsUrl' => (self::$pro) ? Mappress_Icons::$icons_url : null,
|
424 |
Â
'language' => self::get_language(),
|
425 |
Â
'mapbox' => self::get_api_keys()->mapbox,
|
426 |
-
'mini' =>
|
Â
|
|
427 |
Â
'postid' => ($post) ? $post->ID : null, // Note: GT => numeric, classic => string
|
428 |
Â
'pro' => self::$pro,
|
429 |
Â
'siteUrl' => site_url(),
|
4 |
Â
Plugin URI: https://www.mappresspro.com/mappress
|
5 |
Â
Author URI: https://www.mappresspro.com/chris-contact
|
6 |
Â
Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
|
7 |
+
Version: 2.53.9
|
8 |
Â
Author: Chris Richardson
|
9 |
Â
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Â
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
|
35 |
Â
}
|
36 |
Â
|
37 |
Â
class Mappress {
|
38 |
+
const VERSION = '2.53.9';
|
39 |
Â
|
40 |
Â
static
|
41 |
Â
$baseurl,
|
423 |
Â
'iconsUrl' => (self::$pro) ? Mappress_Icons::$icons_url : null,
|
424 |
Â
'language' => self::get_language(),
|
425 |
Â
'mapbox' => self::get_api_keys()->mapbox,
|
426 |
+
'mini' => 600,
|
427 |
+
'nonce' => wp_create_nonce('mappress'),
|
428 |
Â
'postid' => ($post) ? $post->ID : null, // Note: GT => numeric, classic => string
|
429 |
Â
'pro' => self::$pro,
|
430 |
Â
'siteUrl' => site_url(),
|
mappress_map.php
CHANGED
@@ -131,6 +131,7 @@ class Mappress_Map extends Mappress_Obj {
|
|
131 |
Â
}
|
132 |
Â
|
133 |
Â
static function ajax_find() {
|
Â
|
|
134 |
Â
Mappress::ajax_response('OK', self::find($_GET));
|
135 |
Â
}
|
136 |
Â
|
@@ -156,6 +157,8 @@ class Mappress_Map extends Mappress_Obj {
|
|
156 |
Â
}
|
157 |
Â
|
158 |
Â
static function ajax_get() {
|
Â
|
|
Â
|
|
159 |
Â
ob_start();
|
160 |
Â
$mapid = (isset($_GET['mapid'])) ? $_GET['mapid'] : null;
|
161 |
Â
$map = ($mapid) ? self::get($mapid) : null;
|
@@ -230,8 +233,9 @@ class Mappress_Map extends Mappress_Obj {
|
|
230 |
Â
}
|
231 |
Â
|
232 |
Â
static function ajax_save() {
|
233 |
-
|
234 |
Â
|
Â
|
|
235 |
Â
$mapdata = (isset($_POST['map'])) ? json_decode(stripslashes($_POST['map']), true) : null;
|
236 |
Â
$postid = (isset($_POST['postid'])) ? $_POST['postid'] : null;
|
237 |
Â
|
@@ -274,8 +278,9 @@ class Mappress_Map extends Mappress_Obj {
|
|
274 |
Â
}
|
275 |
Â
|
276 |
Â
static function ajax_delete() {
|
277 |
-
|
278 |
Â
|
Â
|
|
279 |
Â
$mapid = (isset($_POST['mapid'])) ? $_POST['mapid'] : null;
|
280 |
Â
$result = Mappress_Map::delete($mapid);
|
281 |
Â
|
131 |
Â
}
|
132 |
Â
|
133 |
Â
static function ajax_find() {
|
134 |
+
check_ajax_referer('mappress', 'nonce');
|
135 |
Â
Mappress::ajax_response('OK', self::find($_GET));
|
136 |
Â
}
|
137 |
Â
|
157 |
Â
}
|
158 |
Â
|
159 |
Â
static function ajax_get() {
|
160 |
+
check_ajax_referer('mappress', 'nonce');
|
161 |
+
|
162 |
Â
ob_start();
|
163 |
Â
$mapid = (isset($_GET['mapid'])) ? $_GET['mapid'] : null;
|
164 |
Â
$map = ($mapid) ? self::get($mapid) : null;
|
233 |
Â
}
|
234 |
Â
|
235 |
Â
static function ajax_save() {
|
236 |
+
check_ajax_referer('mappress', 'nonce');
|
237 |
Â
|
238 |
+
ob_start();
|
239 |
Â
$mapdata = (isset($_POST['map'])) ? json_decode(stripslashes($_POST['map']), true) : null;
|
240 |
Â
$postid = (isset($_POST['postid'])) ? $_POST['postid'] : null;
|
241 |
Â
|
278 |
Â
}
|
279 |
Â
|
280 |
Â
static function ajax_delete() {
|
281 |
+
check_ajax_referer('mappress', 'nonce');
|
282 |
Â
|
283 |
+
ob_start();
|
284 |
Â
$mapid = (isset($_POST['mapid'])) ? $_POST['mapid'] : null;
|
285 |
Â
$result = Mappress_Map::delete($mapid);
|
286 |
Â
|
mappress_template.php
CHANGED
@@ -33,6 +33,7 @@ class Mappress_Template extends Mappress_Obj {
|
|
33 |
Â
}
|
34 |
Â
|
35 |
Â
static function ajax_delete() {
|
Â
|
|
36 |
Â
$name = (isset($_POST['name'])) ? $_POST['name'] : null;
|
37 |
Â
$filepath = get_stylesheet_directory() . '/' . $name . '.php';
|
38 |
Â
|
@@ -44,6 +45,7 @@ class Mappress_Template extends Mappress_Obj {
|
|
44 |
Â
}
|
45 |
Â
|
46 |
Â
static function ajax_get() {
|
Â
|
|
47 |
Â
$name = (isset($_GET['name'])) ? $_GET['name'] : null;
|
48 |
Â
|
49 |
Â
$filename = $name . '.php';
|
@@ -68,6 +70,7 @@ class Mappress_Template extends Mappress_Obj {
|
|
68 |
Â
|
69 |
Â
|
70 |
Â
static function ajax_save() {
|
Â
|
|
71 |
Â
$name = (isset($_POST['name'])) ? $_POST['name'] : null;
|
72 |
Â
$content = (isset($_POST['content'])) ? stripslashes($_POST['content']) : null;
|
73 |
Â
$filepath = get_stylesheet_directory() . '/' . $name . '.php';
|
33 |
Â
}
|
34 |
Â
|
35 |
Â
static function ajax_delete() {
|
36 |
+
check_ajax_referer('mappress', 'nonce');
|
37 |
Â
$name = (isset($_POST['name'])) ? $_POST['name'] : null;
|
38 |
Â
$filepath = get_stylesheet_directory() . '/' . $name . '.php';
|
39 |
Â
|
45 |
Â
}
|
46 |
Â
|
47 |
Â
static function ajax_get() {
|
48 |
+
check_ajax_referer('mappress', 'nonce');
|
49 |
Â
$name = (isset($_GET['name'])) ? $_GET['name'] : null;
|
50 |
Â
|
51 |
Â
$filename = $name . '.php';
|
70 |
Â
|
71 |
Â
|
72 |
Â
static function ajax_save() {
|
73 |
+
check_ajax_referer('mappress', 'nonce');
|
74 |
Â
$name = (isset($_POST['name'])) ? $_POST['name'] : null;
|
75 |
Â
$content = (isset($_POST['content'])) ? stripslashes($_POST['content']) : null;
|
76 |
Â
$filepath = get_stylesheet_directory() . '/' . $name . '.php';
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: chrisvrichardson
|
|
3 |
Â
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4339298
|
4 |
Â
Tags: leaflet, openstreetmap, osm, mapbox, map box, google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
|
5 |
Â
Requires at least: 4.5
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 2.53.
|
8 |
Â
|
9 |
Â
== Description ==
|
10 |
Â
MapPress adds beautiful, interactive Google or Leaflet maps to WordPress.
|
@@ -86,6 +86,9 @@ Please see the plugin documentation pages:
|
|
86 |
Â
|
87 |
Â
== Changelog ==
|
88 |
Â
|
Â
|
|
Â
|
|
Â
|
|
89 |
Â
= 2.53.8 =
|
90 |
Â
* Changed: mashups no longer automatically focus the search box, since this can cause unwanted scrolling
|
91 |
Â
|
3 |
Â
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4339298
|
4 |
Â
Tags: leaflet, openstreetmap, osm, mapbox, map box, google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
|
5 |
Â
Requires at least: 4.5
|
6 |
+
Tested up to: 5.4
|
7 |
+
Stable tag: 2.53.9
|
8 |
Â
|
9 |
Â
== Description ==
|
10 |
Â
MapPress adds beautiful, interactive Google or Leaflet maps to WordPress.
|
86 |
Â
|
87 |
Â
== Changelog ==
|
88 |
Â
|
89 |
+
= 2.53.9 =
|
90 |
+
* Fixed: internal updates to ajax functions with nonces
|
91 |
+
|
92 |
Â
= 2.53.8 =
|
93 |
Â
* Changed: mashups no longer automatically focus the search box, since this can cause unwanted scrolling
|
94 |
Â
|