Changeset 157


Ignore:
Timestamp:
Sep 3, 2014, 12:36:43 PM (5 years ago)
Author:
alloc
Message:

Webserver files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/webserver/js/index.js

    r155 r157  
    133133var overlays = {
    134134    "Region files": regionLayer,
    135     "Players (online)" : playersOnlineMarkerGroup,
    136     "Players (offline)" : playersOfflineMarkerGroup
     135    "Players (online) (<span id='mapControlOnlineCount'>0</span>)" : playersOnlineMarkerGroup,
     136    "Players (offline) (<span id='mapControlOfflineCount'>0</span>)" : playersOfflineMarkerGroup
    137137};
    138138
     
    149149
    150150var setPlayerMarkers = function(data) {
     151        var online = 0;
     152        var offline = 0;
    151153        $.each( data, function( key, val ) {
    152154                var marker;
     
    171173                val.currentPosMarker = marker;
    172174                playersMappingList[val.steamid] = val;
     175               
     176                if (val.online)
     177                        online++;
     178                else
     179                        offline++;
    173180        });
     181        $( "#mapControlOnlineCount" ).text( online );
     182        $( "#mapControlOfflineCount" ).text( offline );
    174183}
    175184
Note: See TracChangeset for help on using the changeset viewer.