Changeset 249 for binary-improvements/webserver
- Timestamp:
- Aug 7, 2015, 10:18:37 AM (9 years ago)
- Location:
- binary-improvements/webserver
- Files:
-
- 21 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/webserver/ThirdParty-Libs.txt
r173 r249 6 6 - Zoomslider: http://kartena.github.io/Leaflet.zoomslider/ 7 7 - Leaflet MiniMap: https://github.com/Norkart/Leaflet-MiniMap 8 - Leaflet Measure: https://github.com/ljagis/leaflet-measure 8 9 -
binary-improvements/webserver/css/style.css
r247 r249 6 6 margin: 0; 7 7 padding: 0; 8 background-image: url('/static/img/background.jpg'); 9 background-repeat: no-repeat; 10 background-attachment: fixed; 11 background-position: center; 12 color: orange; 13 } 14 15 a { 16 color: #ff6000; 17 text-decoration: none; 18 } 19 20 a:visited { 21 color: #ff6000; 22 text-decoration: none; 8 23 } 9 24 … … 11 26 width: 100%; 12 27 height: 100vh; 13 background-color: #408040;28 /*background-color: #408040;*/ 14 29 } 15 30 … … 19 34 top: 0; 20 35 bottom: 0; 36 } 37 38 .invalidinput { 39 background-color: #f00; 21 40 } 22 41 … … 29 48 width: 200px; 30 49 left: 0; 31 background-color: #408040; 50 border-right: 1px solid rgba(0,0,0,0.3); 51 box-shadow: 3px 0px 14px rgba(0,0,0,0.9); 32 52 } 33 53 … … 53 73 54 74 .adminnavbar #adminmenu .menu_button a { 55 color: #000;75 color: orange; 56 76 text-decoration: none; 57 77 } … … 69 89 margin-bottom: 20px; 70 90 display: none; 71 color: #000;91 /* color: orange; */ 72 92 text-decoration: none; 73 93 } … … 86 106 left: 0px; 87 107 right: 0px; 88 background-color: #408040;108 /*background-color: #408040;*/ 89 109 } 90 110 … … 106 126 right: 0; 107 127 left: 200px; 108 background-color: #408040;128 /*background-color: #408040;*/ 109 129 } 110 130 … … 125 145 } 126 146 127 /* Individual tabs */128 129 .adminmap {130 background-color: #408040;131 bottom: 0;132 }133 134 147 135 148 … … 144 157 left: 10px; 145 158 } 159 160 .inventoryButton { 161 cursor: pointer; 162 } 163 #playerInventoryDialog { 164 display:none; 165 } 166 .playerInventoryDialog { 167 text-shadow: 168 -1px -1px 0 black, 169 1px -1px 0 black, 170 -1px 1px 0 black, 171 1px 1px 0 black; 172 box-shadow: 0 3px 14px rgba(0,0,0,0.4); 173 color: orange; 174 background: rgba(100,100,100,0.6); 175 border: none; 176 } 177 .playerInventoryDialog .ui-dialog-buttonpane { 178 display: none; 179 } 180 .playerInventoryDialog.ui-dialog { 181 z-index:1011 !important; 182 } 183 .ui-widget-overlay { 184 z-index:1010 !important; 185 opacity: 0.4 !important; 186 } 187 .playerInventoryDialog .ui-widget-content { 188 background: transparent; 189 color: orange; 190 } 191 .playerInventoryDialog td { 192 vertical-align: top; 193 } 194 146 195 .invTable { 147 196 table-layout: fixed; … … 150 199 border-collapse: collapse; 151 200 } 152 .invField { 201 #equipmentTable .invFieldText { 202 display: none; 203 } 204 .playerInventoryDialog td.invField { 153 205 width: 58px; 154 206 height: 40px; … … 156 208 margin: 0px; 157 209 border: 1px solid gray; 158 background-color: #303030;210 background-color: black; 159 211 background-size: 58px; 160 212 background-repeat: no-repeat; … … 163 215 text-align: right; 164 216 font-size: 14pt; 165 color: #ffffff;166 217 text-shadow: 167 -1px -1px 0 #000, 168 1px -1px 0 #000, 169 -1px 1px 0 #000, 170 1px 1px 0 #000; 171 } 172 173 #equipmentTable .invFieldText { 174 display: none; 175 } 176 177 .inventoryButton { 178 color: #00ff00; 179 cursor: pointer; 180 } 181 #playerInventoryDialog { 182 display:none; 183 } 184 185 .ui-dialog { 186 z-index:1011 !important; 187 } 188 .ui-widget-overlay { 189 z-index:1010 !important; 190 } 191 192 193 194 /* Map controls */ 195 196 197 .webmap-control a, 198 .webmap-control a:hover { 199 text-decoration: none; 218 -1px -1px 0 black, 219 1px -1px 0 black, 220 -1px 1px 0 black, 221 1px 1px 0 black; 222 } 223 224 225 226 227 /*======================================== 228 - Map 229 */ 230 231 .adminmap { 232 /*background-color: #408040;*/ 233 background-color: transparent; 234 bottom: 0; 235 } 236 237 .adminmap .leaflet-control { 238 background-color: rgba(50,50,50,0.6); 239 color: orange; 240 box-shadow: 0 3px 14px rgba(0,0,0,0.5); 241 } 242 243 .adminmap a, 244 .adminmap a:hover, 245 .adminmap .leaflet-container a, 246 .adminmap .leaflet-container a:hover { 247 text-decoration: none; 248 color: #ff6000; 200 249 } 201 250 202 251 .webmap-control { 203 box-shadow: 0 1px 5px rgba(0,0,0,0.4);204 background: #fff;205 252 border-radius: 5px; 206 253 padding: 6px 10px 6px 6px; 207 color: #333;208 254 white-space: nowrap; 209 255 } 210 256 257 .adminmap .leaflet-popup-tip, 258 .adminmap .leaflet-popup-content-wrapper { 259 background-color: rgba(50,50,50,0.8); 260 color: orange; 261 } 262 -
binary-improvements/webserver/index.html
r245 r249 29 29 <script type="text/javascript" src="leaflet/minimap/Control.MiniMap.js"></script> 30 30 31 <!-- Leaflet Measure --> 32 <link rel="stylesheet" href="leaflet/measure/leaflet-measure.css" /> 33 <script type="text/javascript" src="leaflet/measure/leaflet-measure.min.js"></script> 34 31 35 <!-- Own JS stuff --> 36 <script type="text/javascript" src="js/leaflet.layer.sdtdtiles.js"></script> 32 37 <script type="text/javascript" src="js/leaflet.regionlayer.js"></script> 38 <script type="text/javascript" src="js/leaflet.layer.landclaims.js"></script> 33 39 <script type="text/javascript" src="js/leaflet.control.coordinates.js"></script> 34 40 <script type="text/javascript" src="js/leaflet.control.reloadtiles.js"></script> 35 <script type="text/javascript" src="js/leaflet. layer.landclaims.js"></script>41 <script type="text/javascript" src="js/leaflet.control.gametime.js"></script> 36 42 <script type="text/javascript" src="js/inventory_dialog.js"></script> 37 43 <script type="text/javascript" src="js/util.js"></script> … … 89 95 <div id="playerInventoryDialog" title="Player inventory"> 90 96 Player: <span id="invPlayerName"></span><br/> 97 <br/> 91 98 <table> 92 99 <tr> … … 95 102 <table class="invTable" id="bagTable"> 96 103 </table> 104 <br/> 97 105 </td> 98 106 <td rowspan="2"> -
binary-improvements/webserver/js/inventory_dialog.js
r245 r249 57 57 58 58 $( "#playerInventoryDialog" ).css("z-index", "1010").dialog({ 59 dialogClass: "playerInventoryDialog", 59 60 modal: true, 60 61 width: BAG_COLS*(INV_ITEM_WIDTH+14) + 3*(INV_ITEM_WIDTH+14) + 20, -
binary-improvements/webserver/js/leaflet.control.reloadtiles.js
r244 r249 2 2 options: { 3 3 position: 'bottomleft', 4 autoreload_enable: true, 5 autoreload_minInterval: 30, 6 autoreload_interval: 120, 7 autoreload_defaultOn: false, 4 8 layers: [] 5 9 }, … … 9 13 container = L.DomUtil.create('div', name + ' webmap-control'); 10 14 11 L.DomEvent.on (container, 'mousemove', L.DomEvent.stopPropagation); 15 var stop = L.DomEvent.stopPropagation; 16 L.DomEvent 17 .on (container, 'mousemove', stop) 18 .on (container, 'click', stop) 19 .on (container, 'mousedown', stop) 20 .on (container, 'dblclick', stop); 12 21 13 22 this._map = map; 23 24 this._reloadbutton = $("<a>") 25 .addClass (name+"-btn") 26 .text ("Reload tiles now") 27 .attr ("href", "#") 28 .attr ("title", "Reload tiles now") 29 .on ("click.action", null, this, this._reload); 30 $(container).append (this._reloadbutton); 14 31 15 this._reloadbutton = this._createButton( 16 "Reload tiles", "Reload tiles", 17 name + "-btn", container, this._reload, this); 32 if (this.options.autoreload_enable) { 33 $(container).append ("<br>"); 34 35 this._autocheck = $("<input>") 36 .addClass (name + "-chk") 37 .attr ("type", "checkbox") 38 .attr ("name", "map_reloadtiles_autoreload") 39 .attr ("id", "map_reloadtiles_autoreload") 40 .attr ("value", "1") 41 .on ("change", null, this, this._selectreload); 42 if (this.options.autoreload_defaultOn) { 43 this._autocheck.attr ("checked", "checked"); 44 this._timeout = window.setTimeout ($.proxy (this._reloadTilesEvent, this), this.options.autoreload_interval*1000); 45 } 46 $(container).append (this._autocheck); 47 48 var label1 = $("<label>") 49 .attr ("for", "map_reloadtiles_autoreload"); 50 label1.append ("Reload every "); 51 $(container).append (label1); 52 53 this._reloadinterval = $("<input>") 54 .addClass (name + "-txt") 55 .attr ("name", "map_reloadtiles_autoreload_time") 56 .attr ("type", "text") 57 .attr ("size", "4") 58 .attr ("maxlength", "5") 59 .attr ("value", this.options.autoreload_interval) 60 .on ("input", null, this, this._verifyinterval); 61 $(container).append (this._reloadinterval); 18 62 63 var label2 = $("<label>") 64 .attr ("for", "map_reloadtiles_autoreload"); 65 label2.append (" seconds"); 66 $(container).append (label2); 67 } 68 19 69 return container; 20 70 }, … … 22 72 onRemove: function (map) { 23 73 }, 74 75 _selectreload: function (e) { 76 if (e.data._autocheck.prop ("checked")) { 77 e.data._timeout = window.setTimeout ($.proxy (e.data._reloadTilesEvent, e.data), e.data.options.autoreload_interval*1000); 78 } else { 79 window.clearTimeout (e.data._timeout); 80 } 81 }, 82 83 _verifyinterval: function (e) { 84 var val = e.data._reloadinterval.val (); 85 if (/^[\d]+$/.test (val)) { 86 if (val >= e.data.options.autoreload_minInterval) { 87 e.data._reloadinterval.removeClass ("invalidinput"); 88 e.data.options.autoreload_interval = val; 89 if (e.data._autocheck.prop ("checked")) { 90 window.clearTimeout (e.data._timeout); 91 e.data._timeout = window.setTimeout ($.proxy (e.data._reloadTilesEvent, e.data), e.data.options.autoreload_interval*1000); 92 } 93 } else { 94 e.data._reloadinterval.addClass ("invalidinput"); 95 } 96 } else { 97 e.data._reloadinterval.addClass ("invalidinput"); 98 } 99 }, 24 100 25 101 _reload: function (e) { 26 102 var newTileTime = new Date().getTime(); 27 103 28 for (var i = 0; i < this.options.layers.length; i++) {29 this.options.layers [i].options.time = newTileTime;30 this.options.layers [i].redraw ();104 for (var i = 0; i < e.data.options.layers.length; i++) { 105 e.data.options.layers [i].options.time = newTileTime; 106 e.data.options.layers [i].redraw (); 31 107 } 32 108 }, 33 109 34 _createButton: function (html, title, className, container, fn, context) { 35 var link = L.DomUtil.create('a', className, container); 36 link.innerHTML = html; 37 link.href = '#'; 38 link.title = title; 39 40 var stop = L.DomEvent.stopPropagation; 41 42 L.DomEvent 43 .on(link, 'click', stop) 44 .on(link, 'mousedown', stop) 45 .on(link, 'dblclick', stop) 46 .on(link, 'click', L.DomEvent.preventDefault) 47 .on(link, 'click', fn, context) 48 .on(link, 'click', this._refocusOnMap, context); 49 50 return link; 51 } 110 _reloadTilesEvent: function() { 111 var div = this._div; 112 this._reload ({data: this}); 113 this._timeout = window.setTimeout ($.proxy (this._reloadTilesEvent, this), this.options.autoreload_interval*1000); 114 }, 52 115 53 116 }); -
binary-improvements/webserver/js/map.js
r245 r249 33 33 }); 34 34 35 36 37 38 35 // =============================================================================================== 39 36 // Map and basic tile layers 40 41 var initTime = new Date().getTime();42 37 43 38 map = L.map('tab_map', { … … 48 43 }).setView([0, 0], Math.max(0, mapinfo.maxzoom - 5)); 49 44 50 var tileLayer = L.tileLayer('../map/{z}/{x}/{y}.png?t={time}', { 51 maxZoom: mapinfo.maxzoom + 1, 52 minZoom: Math.max(0, mapinfo.maxzoom - 5), 53 maxNativeZoom: mapinfo.maxzoom, 54 tileSize: mapinfo.tilesize, 55 continuousWorld: true, 56 tms: true, 57 unloadInvisibleTiles: false, 58 time: initTime 59 }); 60 61 // TileLayer w/ TMS=true fix for zoomlevel >= 8 62 tileLayer._getWrapTileNum = function () { 63 return L.point(0, 0); 64 }; 65 66 var tileLayerMiniMap = L.tileLayer('../map/{z}/{x}/{y}.png?t={time}', { 67 maxZoom: mapinfo.maxzoom, 68 minZoom: 0, 69 maxNativeZoom: mapinfo.maxzoom, 70 tileSize: mapinfo.tilesize, 71 continuousWorld: true, 72 tms: true, 73 unloadInvisibleTiles: false, 74 time: initTime 75 }); 76 77 78 45 46 var initTime = new Date().getTime(); 47 var tileLayer = GetSdtdTileLayer (mapinfo, initTime); 48 var tileLayerMiniMap = GetSdtdTileLayer (mapinfo, initTime, true); 79 49 80 50 … … 92 62 93 63 94 95 var baseLayers = { 96 //"Map": tileLayer 97 }; 98 99 var layerControl = L.control.layers(baseLayers, null, { 100 collapsed: false 101 }); 64 var layerControl = L.control.layers({ 65 //"Map": tileLayer 66 }, null, { 67 collapsed: false 68 } 69 ); 102 70 103 71 var layerCount = 0; … … 105 73 106 74 tileLayer.addTo(map); 75 107 76 new L.Control.Coordinates({}).addTo(map); 108 new L.Control.ReloadTiles({layers: [tileLayer, tileLayerMiniMap]}).addTo(map); 77 78 new L.Control.ReloadTiles({ 79 autoreload_enable: true, 80 autoreload_minInterval: 30, 81 autoreload_interval: 120, 82 autoreload_defaultOn: false, 83 layers: [tileLayer, tileLayerMiniMap] 84 }).addTo(map); 85 109 86 layerControl.addOverlay (GetRegionLayer (mapinfo), "Region files"); 87 110 88 var miniMap = new L.Control.MiniMap(tileLayerMiniMap, { 111 89 zoomLevelOffset: -6, … … 113 91 }).addTo(map); 114 92 93 var measure = L.control.measure({ 94 //primaryLengthUnit: "meters", 95 //primaryAreaUnit: "sqmeters", 96 //activeColor: "#ABE67E", 97 //completedColor: "#C8F2BE", 98 position: "bottomleft" 99 }); 100 //measure.addTo(map); 101 102 //new L.Control.GameTime({}).addTo(map); 103 115 104 if (HasPermission ("webapi.getlandclaims")) { 116 105 layerControl.addOverlay (GetLandClaimsLayer (map, mapinfo), "Land claims"); 117 106 layerCount++; 118 107 } 108 119 109 if (HasPermission ("webapi.getplayerslocation")) { 120 110 layerControl.addOverlay (playersOfflineMarkerGroup, "Players (offline) (<span id='mapControlOfflineCount'>0</span>)"); … … 148 138 if (playersMappingList.hasOwnProperty(val.steamid)) { 149 139 marker = playersMappingList[val.steamid].currentPosMarker; 150 marker.setLatLng([val.position.x, val.position.z]);151 140 } else { 152 141 marker = L.marker([val.position.x, val.position.z]).bindPopup( … … 158 147 playersMappingList[val.steamid] = { online: !val.online }; 159 148 } 160 if (playersMappingList[val.steamid].online != val.online) { 161 if (val.online) { 149 if (playersMappingList[val.steamid].online) { 150 playersOnlineMarkerGroup.removeLayer(marker); 151 } else { 152 playersOfflineMarkerGroup.removeLayer(marker); 153 } 154 marker.setLatLng([val.position.x, val.position.z]); 155 if (val.online) { 162 156 marker.setOpacity(1.0); 163 playersOfflineMarkerGroup.removeLayer(marker);164 157 playersOnlineMarkerGroup.addLayer(marker); 165 158 } else { 166 159 marker.setOpacity(0.5); 167 playersOnlineMarkerGroup.removeLayer(marker);168 160 playersOfflineMarkerGroup.addLayer(marker); 169 }170 161 } 162 171 163 val.currentPosMarker = marker; 172 164 playersMappingList[val.steamid] = val; -
binary-improvements/webserver/js/permissions.js
r245 r249 36 36 }) 37 37 .always(function () { 38 $("#nopermissionwarning").attr ("style", "display: block"); 38 if (PermissionCount () == 0) { 39 $("#nopermissionwarning").attr ("style", "display: block"); 40 } 39 41 }) 40 42 } … … 49 51 } 50 52 53 function PermissionCount () { 54 var cnt = 0; 55 for (var i = 0; i < userdata.permissions.length; i++) { 56 if (userdata.permissions [i].allowed) cnt++; 57 } 58 return cnt; 59 } 60 -
binary-improvements/webserver/js/tabs.js
r245 r249 1 var tabElements = {}; 2 var currentTabClass = "current_tab"; 3 4 function OpenTab () { 5 var menuElement = $(this); 6 var linkElement = menuElement.children ("a"); 7 var linkName = linkElement.attr ("href"); 8 9 $("*").removeClass (currentTabClass); 10 menuElement.addClass (currentTabClass); 11 $(linkName).addClass (currentTabClass); 12 } 13 1 14 function InitializeTabs () { 2 15 $("#adminmenu > ul > li").addClass ("menu_button");
Note:
See TracChangeset
for help on using the changeset viewer.