Файловый менеджер - Редактировать - /home/lmsyaran/public_html/media/com_easyblog/scripts/location.js
Назад
EasyBlog.module("location",function(e){var t=this;EasyBlog.require().library("throttle-debounce","ui/autocomplete").done(function(){EasyBlog.Controller("Location.Form",{defaultOptions:{language:"en",initialLocation:null,mapType:"ROADMAP","{locationInput}":".locationInput","{locationLatitude}":".locationLatitude","{locationLongitude}":".locationLongitude","{locationMap}":".locationMap","{autoDetectButton}":".autoDetectButton"}},function(t){return{init:function(){var n=e.uid("ext");window[n]=function(){e.___GoogleMaps.resolve()},e.___GoogleMaps||(e.___GoogleMaps=e.Deferred(),EasyBlog.require().script({prefetch:!1},"https://maps.googleapis.com/maps/api/js?sensor=true&language="+t.options.language+"&callback="+n)),e.___GoogleMaps.done(function(){t._init()})},_init:function(n,r){t.geocoder=new google.maps.Geocoder,t.hasGeolocation=navigator.geolocation!==undefined,t.hasGeolocation?t.autoDetectButton().show():t.autoDetectButton().remove(),t.locationInput().autocomplete({delay:300,minLength:0,source:t.retrieveSuggestions,select:function(e,n){t.locationInput().autocomplete("close"),t.setLocation(n.item.location)}}).prop("disabled",!1),t.autocomplete=t.locationInput().autocomplete("widget"),t.autocomplete.addClass("location-suggestion");var i=e.trim(t.options.initialLocation);i&&t.getLocationByAddress(i,function(e){t.setLocation(e[0])}),t.busy(!1)},busy:function(e){t.locationInput().toggleClass("loading",e)},getUserLocations:function(e){t.getLocationAutomatically(function(n){t.userLocations=t.buildDataset(n),e&&e(n)})},getLocationByAddress:function(e,n){t.geocoder.geocode({address:e},n)},getLocationByCoords:function(e,n,r){t.geocoder.geocode({location:new google.maps.LatLng(e,n)},r)},getLocationAutomatically:function(e,n){if(!navigator.geolocation)return n("ERRCODE","Browser does not support geolocation or do not have permission to retrieve location data.");navigator.geolocation.getCurrentPosition(function(n){t.getLocationByCoords(n.coords.latitude,n.coords.longitude,e)},n)},renderMap:function(e,n){t.busy(!0),t.locationMap().show();var r=new google.maps.Map(t.locationMap()[0],{zoom:15,center:e.geometry.location,mapTypeId:google.maps.MapTypeId[t.options.mapType],disableDefaultUI:!0}),i=new google.maps.Marker({position:e.geometry.location,center:e.geometry.location,title:e.formatted_address,map:r}),s=new google.maps.InfoWindow({content:n});google.maps.event.addListener(r,"tilesloaded",function(){s.open(r,i),t.busy(!1)})},setLocation:function(e){if(!e)return;t.locationResolved=!0,t.lastResolvedLocation=e,t.locationInput().val(e.formatted_address),t.locationLatitude().val(e.geometry.location.lat()),t.locationLongitude().val(e.geometry.location.lng()),t.renderMap(e,e.formatted_address)},removeLocation:function(){t.locationResolved=!1,t.locationInput().val(""),t.locationLatitude().val(""),t.locationLongitude().val(""),t.locationMap().hide()},buildDataset:function(t){var n=e.map(t,function(e){return{label:e.formatted_address,value:e.formatted_address,location:e}});return n},retrieveSuggestions:function(e,n){t.busy(!0);var r=e.term,i=function(e){n(e),t.busy(!1)};r==""?i(t.userLocations||[]):t.getLocationByAddress(r,function(e){i(t.buildDataset(e))})},suggestUserLocations:function(){t.hasGeolocation&&t.userLocations&&(t.removeLocation(),t.locationInput().autocomplete("search","")),t.busy(!1)},"{locationInput} blur":function(){setTimeout(function(){var n=e.trim(t.locationInput().val());n==""?t.removeLocation():t.locationResolved?n!=t.lastResolvedLocation.formatted_address&&t.setLocation(t.lastResolvedLocation):t.removeLocation()},250)},"{autoDetectButton} click":function(){t.busy(!0),t.hasGeolocation&&!t.userLocations?t.getUserLocations(t.suggestUserLocations):t.suggestUserLocations()}}}),EasyBlog.Controller("Location.Map",{defaultOptions:{animation:"drop",language:"en",useStaticMap:!1,disableMapsUI:!0,zoom:5,fitBounds:null,minZoom:null,maxZoom:null,center:null,locations:[],mapType:"ROADMAP",width:500,height:400,"{locationMap}":".locationMap"}},function(t){return{init:function(){t.mapLoaded=!1;var n=e.uid("ext");window[n]=function(){e.___GoogleMaps.resolve()};if(t.options.useStaticMap==1){var r="&language="+(t.options.language+""),i="&size="+(t.options.width+"")+"x"+(t.options.height+""),s="&zoom="+(t.options.zoom+""),o="¢er="+(parseFloat(t.options.locations[0].latitude).toFixed(6)+"")+","+(parseFloat(t.options.locations[0].longitude).toFixed(6)+""),u="&maptype="+google.maps.MapTypeId[t.options.mapType],a="&markers=",f="https://maps.googleapis.com/maps/api/staticmap?sensor=false"+r+i;if(t.options.locations.length==1)a+=parseFloat(t.options.locations[0].latitude).toFixed(6)+""+","+(parseFloat(t.options.locations[0].longitude).toFixed(6)+""),f+=s+o+u+a;else{var l=[];e.each(t.options.locations,function(e,t){l.push(parseFloat(t.latitude).toFixed(6)+""+","+(parseFloat(t.longitude).toFixed(6)+""))}),a+=l.join("|"),f+=a+u}t.locationMap().show().html('<img src="'+f+'" />'),t.busy(!1)}else{var n=e.uid("ext");window[n]=function(){e.___GoogleMaps.resolve()},e.___GoogleMaps||(e.___GoogleMaps=e.Deferred(),EasyBlog.require().script({prefetch:!1},"https://maps.googleapis.com/maps/api/js?sensor=true&language="+t.options.language+"&callback="+n)),e.___GoogleMaps.done(function(){t._init()})}},_init:function(){t.options.fitBounds===null&&(t.options.locations.length==1?t.options.fitBounds=!1:t.options.fitBounds=!0),t.options.disableMapsUI=Boolean(t.options.disableMapsUI),t.locations=[],e.each(t.options.locations,function(e,n){n.latitude!="null"&&n.longitude!="null"&&t.locations.push(new google.maps.LatLng(n.latitude,n.longitude))}),t.locations.length>0&&t.renderMap(),t.busy(!1)},busy:function(e){t.locationMap().toggleClass("loading",e)},renderMap:function(){t.busy(!0),t.locationMap().show();var e;t.options.center?e=new google.maps.LatLng(center.latitude,center.longitude):e=t.locations[0],t.map=new google.maps.Map(t.locationMap()[0],{zoom:parseInt(t.options.zoom),minZoom:parseInt(t.options.minZoom),maxZoom:parseInt(t.options.maxZoom),center:e,mapTypeId:google.maps.MapTypeId[t.options.mapType],disableDefaultUI:t.options.disableMapsUI}),google.maps.event.addListener(t.map,"tilesloaded",function(){t.mapLoaded==0&&(t.mapLoaded=!0,t.loadLocations())})},loadLocations:function(){t.bounds=new google.maps.LatLngBounds,t.infoWindow=[];var n=function(){e.each(t.locations,function(e,n){t.bounds.extend(n);var r=function(){t.addMarker(n,t.options.locations[e])};setTimeout(r,100*(e+1))}),t.options.fitBounds&&t.map.fitBounds(t.bounds)};setTimeout(n,500)},addMarker:function(e,n){if(!e)return;var r=new google.maps.Marker({position:e,map:t.map});r.setAnimation(google.maps.Animation.DROP),t.addInfoWindow(r,n)},addInfoWindow:function(n,r){var i=r.content;i||(i=r.address);var s=new google.maps.InfoWindow;s.setContent(i),t.infoWindow.push(s),t.options.locations.length>1?google.maps.event.addListener(n,"click",function(){e.each(t.infoWindow,function(e,t){t.close()}),s.open(t.map,n)}):(google.maps.event.addListener(n,"click",function(){s.open(t.map,n)}),s.open(t.map,n)),r.ratingid&&google.maps.event.addListener(s,"domready",function(){e.each(r.ratingid,function(t,n){eblog.ratings.setup("ebpostmap_"+n+"-ratings",!0,"entry"),e("#ebpostmap_"+n+"-ratings").removeClass("ui-state-disabled"),e("#ebpostmap_"+n+"-ratings-form").find(".blog-rating-text").hide(),e("#ebpostmap_"+n+"-ratings .ratings-value").hide()})})}}}),t.resolve()})});
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка