1"use strict";var Usermap={};Usermap.User={};Usermap.User.CoordinatesHandler=Class.extend({_form:null,_locationInput:null,init:function(a){this._locationInput=a;this._form=$("#messageContainer").submit($.proxy(this._submit,this))},_submit:function(a){if(this._form.data("geocodingCompleted")){return true}var b=$.trim($("#geocode").val());if(!b){WCF.Location.GoogleMaps.Util.reverseGeocoding($.proxy(this._reverseGeocoding,this),this._locationInput.getMarker());a.preventDefault();return false}this._setCoordinates()},_reverseGeocoding:function(a){$("#geocode").val(a);this._setCoordinates();this._form.trigger("submit")},_setCoordinates:function(){var a=this._form.find(".formSubmit");$('<input type="hidden" name="latitude" value="'+this._locationInput.getMarker().getPosition().lat()+'" />').appendTo(a);$('<input type="hidden" name="longitude" value="'+this._locationInput.getMarker().getPosition().lng()+'" />').appendTo(a);this._form.data("geocodingCompleted",true)}});Usermap.Map={};Usermap.Map.GoogleMaps={};Usermap.Map.GoogleMaps.Settings={_settings:{},get:function(a){if(a===undefined){return this._settings}if(this._settings[a]!==undefined){return this._settings[a]}return null},set:function(b,c){if($.isPlainObject(b)){for(var a in b){this._settings[a]=b[a]}}else{this._settings[b]=c}}};Usermap.Map.GoogleMaps.Map=Class.extend({_map:null,_markers:[],_infoWindows:[],init:function(b,a){this._mapContainer=$("#"+b);this._mapOptions=$.extend(true,this._getDefaultMapOptions(),a);this._map=new google.maps.Map(this._mapContainer[0],this._mapOptions);this._markers=[];this._infoWindows=[];if(this._mapContainer.parents(".sidebar").length){enquire.register("(max-width: 767px)",{setup:$.proxy(this._addSidebarMapListener,this),deferSetup:true})}this.refresh()},_addInfoWindowEventListener:function(a,b){google.maps.event.addListener(a,"click",$.proxy(function(){b.open(this._map,a)},this))},_addSidebarMapListener:function(){$(".content > .mobileSidebarToggleButton").click($.proxy(this.refresh,this))},_getDefaultMapOptions:function(){var a={};a.center=new google.maps.LatLng(Usermap.Map.GoogleMaps.Settings.get("defaultLatitude"),Usermap.Map.GoogleMaps.Settings.get("defaultLongitude"));a.disableDoubleClickZoom=Usermap.Map.GoogleMaps.Settings.get("disableDoubleClickZoom");a.draggable=Usermap.Map.GoogleMaps.Settings.get("draggable");switch(Usermap.Map.GoogleMaps.Settings.get("mapType")){case"map":a.mapTypeId=google.maps.MapTypeId.ROADMAP;break;case"satellite":a.mapTypeId=google.maps.MapTypeId.SATELLITE;break;case"physical":a.mapTypeId=google.maps.MapTypeId.TERRAIN;break;case"hybrid":default:a.mapTypeId=google.maps.MapTypeId.HYBRID;break}a.mapTypeControl=Usermap.Map.GoogleMaps.Settings.get("mapTypeControl")!="off";if(a.mapTypeControl){switch(Usermap.Map.GoogleMaps.Settings.get("mapTypeControl")){case"dropdown":a.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.DROPDOWN_MENU};break;case"horizontalBar":a.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR};break;default:a.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.DEFAULT};break}}a.scaleControl=Usermap.Map.GoogleMaps.Settings.get("scaleControl");a.scrollwheel=Usermap.Map.GoogleMaps.Settings.get("scrollwheel");a.zoom=Usermap.Map.GoogleMaps.Settings.get("zoom");return a},addDraggableMarker:function(c,b){var a=new google.maps.Marker({clickable:false,draggable:true,map:this._map,position:new google.maps.LatLng(c,b),zIndex:1});this._markers.push(a);return a},addMarker:function(g,e,f,d,c){var b=new google.maps.Marker({map:this._map,position:new google.maps.LatLng(g,e),title:f});if(d){b.setIcon(d)}if(c){var a=new google.maps.InfoWindow({content:c});this._addInfoWindowEventListener(b,a);b.infoWindow=a;this._infoWindows.push(a)}this._markers.push(b);return b},getMarkers:function(){return this._markers},getMap:function(){return this._map},refresh:function(){var a=this._map.getCenter();google.maps.event.trigger(this._map,"resize");this._map.setCenter(a)},refreshBounds:function(){var f=null;var c=null;var d=null;var g=null;for(var a in this._markers){var e=this._markers[a];var h=e.getPosition().lat();var b=e.getPosition().lng();if(f===null){f=c=h;d=g=b}else{if(f>h){f=h}else{if(c<h){c=h}}if(d>h){d=h}else{if(g<b){g=b}}}}this._map.fitBounds(new google.maps.LatLngBounds(new google.maps.LatLng(f,d),new google.maps.LatLng(c,g)))},removeMarkers:function(){for(var a in this._markers){this._markers[a].setMap(null)}this._markers=[]},setBounds:function(a,b){this._map.fitBounds(new google.maps.LatLngBounds(new google.maps.LatLng(b.latitude,b.longitude),new google.maps.LatLng(a.latitude,a.longitude)))},setCenter:function(b,a){this._map.setCenter(new google.maps.LatLng(b,a))}});Usermap.Map.LargeMap=Usermap.Map.GoogleMaps.Map.extend({_additionalParameters:{},_locationSearch:null,_locationSearchInputSelector:null,_markerClusterer:null,_userSearchInput:null,_markersLoaded:false,_bounds:null,_circleUser:null,_circleLocation:null,_buttonCenter:null,_buttonCleanup:null,_buttonFilter:null,_buttonResetFilter:null,_filterOnline:0,_filterFollower:0,_filterTeam:0,_count:0,_loadingOverlay:null,_selectedGroups:[],_markerInfoSave:[],_markerOpen:[],_directionsService:null,_directionsDisplay:null,_searchMarker:[],init:function(d,b,c,a){this._super(d,b);this._additionalParameters=a||{};this._count=0;this._buttonCenter=$("#centerButton");this._buttonCleanup=$("#cleanupButton");this._buttonFilter=$("#filterButton");this._buttonResetFilter=$("#filterResetButton");this._buttonCenter.disable();this._buttonCleanup.disable();this._buttonFilter.disable();this._buttonResetFilter.disable();this._locationSearchInputSelector=c||"";if(this._locationSearchInputSelector){this._locationSearch=new WCF.Location.GoogleMaps.LocationSearch(c,$.proxy(this._locationList,this))}
1this._markerClusterer=new MarkerClusterer(this._map,this._markers,{maxZoom:17,imagePath:Usermap.Map.GoogleMaps.Settings.get("markerClustererImagePath")+"m"});this._markerSpiderfier=new OverlappingMarkerSpiderfier(this._map,{keepSpiderfied:true,markersWontHide:true,markersWontMove:true});this._markerSpiderfier.addListener("click",$.proxy(function(e){if(e.infoWindow){if(e.infoWindow.getMap()){e.infoWindow.close();var f=this._markerOpen.indexOf(e);if(f>-1){this._markerOpen.splice(f,1)}}else{e.infoWindow.open(this._map,e);this._markerOpen.push(e)}}},this));this._proxy=new WCF.Action.Proxy({showLoadingOverlay:true,success:$.proxy(this._success,this)});google.maps.event.addListener(this._map,"idle",$.proxy(this._loadMarkers,this));this._filterOnline=0;this._filterFollower=0;this._filterTeam=0;this._userSearchInput=$("#userSearchInput");$("#searchButton").click($.proxy(this._search,this));$("#routeButton").click($.proxy(this._route,this));this._buttonCenter=$("#centerButton");this._buttonCenter.click($.proxy(this._centerBounds,this));this._buttonCleanup=$("#cleanupButton");this._buttonCleanup.click($.proxy(this._cleanup,this));this._selectedGroups.push(0);this._buttonFilter=$("#filterButton");this._buttonFilter.click($.proxy(this._filter,this));this._buttonResetFilter=$("#filterResetButton");this._buttonResetFilter.click($.proxy(this._filterReset,this));this._buttonResetFilter.hide()},_filterReset:function(){this._filterOnline=0;this._filterFollower=0;this._filterTeam=0;if(this._additionalParameters.userFilter){document.getElementById("onlineFilter").checked=false;document.getElementById("followerFilter").checked=false;document.getElementById("teamFilter").checked=false}if(this._additionalParameters.groupFilter){var a=document.getElementsByName("usermapGroup");if(a.length){for(var b=0;b<a.length;b++){a[b].checked=true}}}this._filter();document.getElementById("filterActive").innerHTML="";this._buttonResetFilter.hide()},_filter:function(){if(this._additionalParameters.groupFilter){var j=document.getElementsByName("usermapGroup");var g=[];for(var i=0;i<j.length;i++){if(j[i].checked==true){g.push(parseInt(j[i].value))}}}this._filterOnline=0;this._filterFollower=0;this._filterTeam=0;if(this._additionalParameters.userFilter){var f=document.getElementById("onlineFilter");if(f.checked==true){this._filterOnline=1}f=document.getElementById("followerFilter");if(f.checked==true){this._filterFollower=1}f=document.getElementById("teamFilter");if(f.checked==true){this._filterTeam=1}}var f=[];var c=0;for(var i=0;i<this._markerInfoSave.length;i++){if(this._additionalParameters.userFilter){if(this._filterOnline&&this._markerInfoSave[i].online!=1){continue}if(this._filterFollower&&this._markerInfoSave[i].follower!=1){continue}if(this._filterTeam&&this._markerInfoSave[i].team!=1){continue}}if(this._additionalParameters.groupFilter){if(j.length){var b=Object.keys(this._markerInfoSave[i].groups);var d=-1;for(var h=0;h<b.length;h++){var a=parseInt(b[h]);d=g.indexOf(a);if(d>-1){break}}if(d<0){continue}}else{continue}}f.push(this._markerInfoSave[i]);c++}this._markerClusterer.clearMarkers();this._markerSpiderfier.clearMarkers();this._bounds=null;this._bounds=new google.maps.LatLngBounds();for(var i=0;i<f.length;i++){var e=f[i];this.addMarker(e.latitude,e.longitude,e.title,e.icon,e.infoWindow,e.dialog,e.location);this._bounds.extend(new google.maps.LatLng(e.latitude,e.longitude))}document.getElementById("filterActive").innerHTML=WCF.Language.get("usermap.user.map.filter.active");this._buttonResetFilter.show()},_cleanup:function(){if(this._circleUser){this._circleUser.setMap(null);this._circleUser=null}if(this._circleLocation){this._circleLocation.setMap(null);this._circleLocation=null}if(this._searchMarker.length){for(var b=0,a=this._searchMarker.length;b<a;b++){this._searchMarker[b].setMap(null)}this._searchMarker=[]}if(this._markerOpen.length){this._markerOpen=[];this._filter()}if(this._directionsDisplay!==null){this._directionsDisplay.setMap(null);this._directionsDisplay=null}if(this._directionsService!==null){this._directionsService=null}},_route:function(){if(this._directionsDisplay!==null){this._directionsDisplay.setMap(null);this._directionsDisplay=null}if(this._directionsService!==null){this._directionsService=null}if(this._searchMarker.length+this._markerOpen.length<2){$('<header class="boxHeadline">'+WCF.Language.get("usermap.user.map.route.error")+"</header>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}else{var a=null;var i=null;var b=0;var c=0;var g=0;var e=[];var d=[];if(this._searchMarker.length){b=0;while(c<25&&b<this._searchMarker.length){g=this._searchMarker[b].getPosition();d.push({location:g,stopover:true});c++;b++}}if(this._markerOpen.length){b=0;while(c<25&&b<this._markerOpen.length){g=this._markerOpen[b].getPosition();d.push({location:g,stopover:true});c++;b++}}if(d.length>1){a=d[0].location;i=d[1].location;d.splice(0,2)}this._directionsService=new google.maps.DirectionsService();this._directionsDisplay=new google.maps.DirectionsRenderer({suppressMarkers:true});this._directionsDisplay.setMap(this.getMap());var f=this._directionsDisplay;var h={origin:a,destination:i,waypoints:d,travelMode:"DRIVING"};this._directionsService.route(h,function(l,m){if(m=="OK"){f.setDirections(l);var q=l.routes[0].legs;var r=l.geocoded_waypoints.length;var k=[];var n=0;var j="";var p="<div><p>"+WCF.Language.get("usermap.user.map.route.found")+"</p><br>";for(var s=0,o=q.length;s<o;s++){if(k.indexOf(q[s].start_address)<0){k.push(q[s].start_address);j+=encodeURIComponent(q[s].start_address)+"/"}if(k.indexOf(q[s].end_address)<0){k.push(q[s].end_address);j+=encodeURIComponent(q[s].end_address)+"/"}n+=q[s].distance.value;p=p.concat("<p>"+q[s].start_address+"</p>");p=p.concat("<p>"+q[s].end_address+"</p>");p=p.concat("<p>"+q[s].distance.text+"</p><br>")}p=p.concat("<p>"+WCF.Language.get("usermap.user.map.route.waypoints")+" "+r+"</p>");p=p.concat("<p>"+WCF.Language.get("usermap.user.map.route.distance")+" "+parseInt(n/1000)+"</p>");p=p.concat('<div class="formSubmit"><a href="https://www.google.com/maps/dir/'+j+' "{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}{if EXTERNAL_LINK_REL_NOFOLLOW} rel="nofollow"{/if}" class="button" > <span>'+WCF.Language.get("usermap.user.map.route.open")+"</span></a></div>");$("<div>"+p+"</div>").wcfDialog({title:WCF.Language.get("usermap.user.map.route")})}else{$('<header class="boxHeadline">'+WCF.Language.get("usermap.user.map.search.error.direction")+"</header>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}})}},_centerBounds:function(){if(Usermap.Map.GoogleMaps.Settings.get("centerOnOpen")){if(this._bounds){this.getMap().fitBounds(this._bounds)}}else{this._map.setCenter(new google.maps.LatLng(Usermap.Map.GoogleMaps.Settings.get("defaultLatitude"),Usermap.Map.GoogleMaps.Settings.get("defaultLongitude")));this._map.setZoom(Usermap.Map.GoogleMaps.Settings.get("zoom"))}},_search:function(){var b=document.getElementById("userSearchInput").value;var c=document.getElementById("geocode").value;if(!b&&!c){$('<header class="boxHeadline">'+WCF.Language.get("usermap.user.map.search.error.bothEmpty")+"</header>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}else{var a=new WCF.Action.Proxy({autoSend:true,showLoadingOverlay:true,data:{actionName:"search",className:"usermap\\data\\usermap\\UsermapAction",parameters:{username:b,location:c},},success:$.proxy(this._searchSuccess,this)})}},_searchSuccess:function(g,c,l){var a=document.getElementById("userSearchInput").value;var h=document.getElementById("geocode").value;var e=g.returnValues;if(a&&h){if(typeof e.userLat==="undefined"&&typeof e.locationLat=="undefined"){$('<header class="boxHeadline">'+WCF.Language.get("usermap.user.map.search.error.bothNotFound")+"</header>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}else{if(typeof e.userLat==="undefined"){$('<header class="boxHeadline">'+WCF.Language.get("usermap.user.map.search.error.userNotFound")+"</header>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}else{if(typeof e.locationLat=="undefined"){$('<header class="boxHeadline">'+WCF.Language.get("usermap.user.map.search.error.locationNotFound")+"</header>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}}}else{if(a){if(typeof e.userLat==="undefined"){$('<header class="boxHeadline">'+WCF.Language.get("usermap.user.map.search.error.userNotFound")+"</header>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}else{if(typeof e.locationLat==="undefined"){$('<header class="boxHeadline">'+WCF.Language.get("usermap.user.map.search.error.locationNotFound")+"</header>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}}this._bounds=new google.maps.LatLngBounds();var d=0;var o=0;if(a&&typeof e.userLat!=="undefined"){if(this._circleUser){this._circleUser.setMap(null);this._circleUser=null}this._circleUser=new google.maps.Circle({strokeColor:"#008000",strokeOpacity:0.8,strokeWeight:1,fillColor:"#008000",fillOpacity:0.1,map:this._map,center:new google.maps.LatLng(e.userLat,e.userLng),radius:2500,editable:false,visible:true});this._bounds.extend(new google.maps.LatLng(e.userLat,e.userLng));d=1;var b={lat:e.userLat,lng:e.userLng};var n=0;if(this._searchMarker.length){for(var m=0,k=this._searchMarker.length;m<k;m++){var i=this._searchMarker[m].getPosition().lat();var j=this._searchMarker[m].getPosition().lng();i=i.toFixed(7);j=j.toFixed(7);if(i==b.lat&&j==b.lng){n=1;break}}}if(n==0){var f=new google.maps.Marker({position:new google.maps.LatLng(b.lat,b.lng),map:this._map,icon:e.icon,title:a,zIndex:999999});f.setMap(this._map);this._searchMarker.push(f)}}if(h&&typeof e.locationLat!=="undefined"){if(this._circleLocation){this._circleLocation.setMap(null);this._circleLocation=null}this._circleLocation=new google.maps.Circle({strokeColor:"#FF0000",strokeOpacity:0.8,strokeWeight:1,fillColor:"#FF0000",fillOpacity:0.1,map:this._map,center:new google.maps.LatLng(e.locationLat,e.locationLng),radius:2500,editable:false,visible:true});this._bounds.extend(new google.maps.LatLng(e.locationLat,e.locationLng));o=1;var b={lat:e.locationLat,lng:e.locationLng};var n=0;if(this._searchMarker.length){for(var m=0,k=this._searchMarker.length;m<k;m++){var i=this._searchMarker[m].getPosition().lat();var j=this._searchMarker[m].getPosition().lng();i=i.toFixed(7);j=j.toFixed(7);if(i==b.lat&&j==b.lng){n=1;break}}}if(n==0){var f=new google.maps.Marker({position:new google.maps.LatLng(b.lat,b.lng),map:this._map,icon:e.icon,title:h,zIndex:999999});f.setMap(this._map);this._searchMarker.push(f)}}if(d&&o){this.getMap().fitBounds(this._bounds)}else{if(d){this._map.fitBounds(this._circleUser.getBounds())}else{this._map.fitBounds(this._circleLocation.getBounds())}}},_addInfoWindowEventListener:function(a,b){},_locationList:function(a){$(this._locationSearchInputSelector).val(a.label)},_loadMarkers:function(){if(this._markersLoaded===false){this._proxy.setOption("data",{className:"usermap\\data\\usermap\\UsermapAction",actionName:"getMapMarkers"});
1this._proxy.sendRequest();this._markersLoaded=true;return true}return false},_success:function(c,f,b){this._bounds=new google.maps.LatLngBounds();if(c.returnValues&&c.returnValues.markers){for(var e=0,d=c.returnValues.markers.length;e<d;e++){var a=c.returnValues.markers[e];this.addMarker(a.latitude,a.longitude,a.title,a.icon,a.infoWindow,a.dialog,a.location);this._markerInfoSave.push(a);this._count++;this._bounds.extend(new google.maps.LatLng(a.latitude,a.longitude))}}if(d&&Usermap.Map.GoogleMaps.Settings.get("centerOnOpen")){this.getMap().fitBounds(this._bounds)}this._buttonCenter.enable();this._buttonCleanup.enable();this._buttonFilter.enable();this._buttonResetFilter.enable()},addMarker:function(c,a,e,d,f,b,g){var h=$(f).get(0);var i=this._super(c,a,e,d,h);this._markerClusterer.addMarker(i);this._markerSpiderfier.addMarker(i);if(b){}return i.infoWindow}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.