Skip to content

Commit 615b0e9

Browse files
committed
fix: minifying issues
Setting "$debug" to false now correctly minifies the JS code. Before, it would minify it but syntax errors (missing semicolons) would cause the code to not execute. I've also added final_newline to the editor config (I can't remember where but, I heard it's better to have them).
1 parent fad1c0e commit 615b0e9

9 files changed

+53
-340
lines changed

.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ indent_size = 4
66
end_of_line = crlf
77
charset = utf-8
88
trim_trailing_whitespace = true
9-
insert_final_newline = false
9+
insert_final_newline = true
1010

1111
[*.md]
12-
trim_trailing_whitespace = false
12+
trim_trailing_whitespace = false

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,4 @@
203203

204204
</body>
205205

206-
</html>
206+
</html>

js/src/controls.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $(document).ready(function(){
4444

4545
$("#blips_enabled").removeClass("label-success").removeClass("label-danger")
4646
.addClass( _showBlips ? "label-success" : "label-danger")
47-
.text(_showBlips ? "on" : "off")
47+
.text(_showBlips ? "on" : "off");
4848
});
4949

5050
$("#reconnect").click(function(e){
@@ -53,4 +53,4 @@ $(document).ready(function(){
5353
$("#connection").removeClass("label-success").removeClass("label-danger").addClass("label-warning").text("reconnecting");
5454
connect();
5555
});
56-
});
56+
});

js/src/init.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function globalInit() {
1515

1616
function initPage() {
1717
$(window).on("load resize", function() {
18-
$(".map-tab-content").height((($("#tab-content").height() - $(".page-title-1").height()) - ($("#map-overlay-global-controls").height() * 4.2)))
18+
$(".map-tab-content").height((($("#tab-content").height() - $(".page-title-1").height()) - ($("#map-overlay-global-controls").height() * 4.2)));
1919
});
2020
}
2121

@@ -79,4 +79,4 @@ function initMarkers(debugOnly) {
7979
} else {
8080
createMarker(false, false, new MarkerObject("True Map Center", new Coordinates(0, 0, 0), MarkerTypes[6], "", ""), "");
8181
}
82-
}
82+
}

js/src/map.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function createMarker(animated, draggable, objectRef, title) {
152152

153153
var name = objectRef.reference;
154154
if (name == "@DEBUG@@Locator") {
155-
name = "@Locator"
155+
name = "@Locator";
156156
}
157157
objectRef.position = stringCoordToFloat(objectRef.position);
158158
var coord = convertToMapGMAP(objectRef.position.x, objectRef.position.y);
@@ -163,7 +163,7 @@ function createMarker(animated, draggable, objectRef, title) {
163163
var html = '<div class="row info-body-row"><strong>Position:</strong>&nbsp;X {' + objectRef.position.x.toFixed(4) + "} Y {" + objectRef.position.y.toFixed(4) + "} Z {" + objectRef.position.z.toFixed(4) + "}</div>";
164164

165165
if (objectRef.description != ""){
166-
html += '<div class="row info-body-row"><strong>Description:</strong>&nbsp;' + objectRef.description + "</div>"
166+
html += '<div class="row info-body-row"><strong>Description:</strong>&nbsp;' + objectRef.description + "</div>";
167167
}
168168

169169
var infoContent = '<div class="info-window"><div class="info-header-box"><div class="info-header">' + name + '</div></div><div class="clear"></div><div id=info-body>' + html + "</div></div>";
@@ -191,43 +191,43 @@ function createMarker(animated, draggable, objectRef, title) {
191191
});
192192
google.maps.event.addListener(marker, "click", function() {
193193
if (_MAP_currentMarker) {
194-
_MAP_currentMarker.popup.close()
194+
_MAP_currentMarker.popup.close();
195195
}
196196
_MAP_currentMarker = marker;
197-
marker.popup.open(map, this)
197+
marker.popup.open(map, this);
198198
});
199199
google.maps.event.addListener(marker, "drag", function() {
200200
var posConverted = convertToGame(marker.position.lat(), marker.position.lng());
201201
objectRef.position.x = posConverted.x;
202202
objectRef.position.y = posConverted.y;
203203
if (objectRef.reference == "@DEBUG@@Locator") {
204204
$("#locator_x").val(posConverted.x);
205-
$("#locator_y").val(posConverted.y)
205+
$("#locator_y").val(posConverted.y);
206206
}
207207
});
208208
if (name == "@DEBUG@@Locator") {
209-
$("#marker-list").append('<div id="marker_' + marker.id + '" data-id="' + marker.id + '" class="marker-item"><div class="marker-desc"><span class="marker_name">@Locator</span></div><div class="marker-options"><a href="#" class="marker_view" title="View"><img src="images/icons/view.png" alt="View" height="16" width="16" /></a> </div></div><div class="clear"></div>')
209+
$("#marker-list").append('<div id="marker_' + marker.id + '" data-id="' + marker.id + '" class="marker-item"><div class="marker-desc"><span class="marker_name">@Locator</span></div><div class="marker-options"><a href="#" class="marker_view" title="View"><img src="images/icons/view.png" alt="View" height="16" width="16" /></a> </div></div><div class="clear"></div>');
210210
} else {
211-
$("#marker-list").append('<div id="marker_' + marker.id + '" data-id="' + marker.id + '" class="marker-item"><div class="marker-desc"><span class="marker_name">' + name + '</span></div><div class="marker-options"><a href="#" class="marker_view" title="View"><img src="images/icons/view.png" alt="View" height="16" width="16" /></a> / <a href="#" class="marker_delete" title="Delete"><img src="images/icons/delete.png" alt="Delete" height="16" width="16" /></a></div></div><div class="clear"></div>')
211+
$("#marker-list").append('<div id="marker_' + marker.id + '" data-id="' + marker.id + '" class="marker-item"><div class="marker-desc"><span class="marker_name">' + name + '</span></div><div class="marker-options"><a href="#" class="marker_view" title="View"><img src="images/icons/view.png" alt="View" height="16" width="16" /></a> / <a href="#" class="marker_delete" title="Delete"><img src="images/icons/delete.png" alt="Delete" height="16" width="16" /></a></div></div><div class="clear"></div>');
212212
}
213213
_MAP_markerStore.push(marker);
214214
return _MAP_markerStore.length;
215215
}
216216

217217
function setMapCenter(lat, lng) {
218218
map.setCenter(new google.maps.LatLng(lat, lng));
219-
map.setZoom(6)
219+
map.setZoom(6);
220220
}
221221

222222
function setMapCenterGMAP(coord) {
223223
map.setCenter(coord);
224-
map.setZoom(6)
224+
map.setZoom(6);
225225
}
226226

227227
function clearAllMarkers() {
228228
for (var i = 0; i < _MAP_markerStore.length; i++) {
229229
if (_MAP_markerStore[i] != "NULL") {
230-
_MAP_markerStore[i].setMap(null)
230+
_MAP_markerStore[i].setMap(null);
231231
}
232232
}
233233
_MAP_markerStore.length = 0;
@@ -241,12 +241,12 @@ function clearMarker(id) {
241241
if (_MAP_markerStore[id] != "NULL") {
242242
_MAP_markerStore[id].setMap(null);
243243
_MAP_markerStore[id] = "NULL";
244-
$("#marker_" + id).remove()
244+
$("#marker_" + id).remove();
245245
}
246246
}
247247

248248
function getMarker(id) {
249249
if (_MAP_markerStore[id] != "NULL") {
250-
return _MAP_markerStore[id]
250+
return _MAP_markerStore[id];
251251
}
252-
};
252+
};

js/src/markers.js

+1-207
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ var MarkerTypes = {
2828

2929
// FUCK ME, GTA HAS A LOT OF FUCKING BLIPS
3030
var types = {
31-
<<<<<<< Updated upstream
3231
Standard: {id: 1, x: 0, y: 0},
3332
Jet: {id: 16},
3433
Lift: {id: 36},
@@ -232,211 +231,6 @@ function generateBlipShit(){
232231
origin: new google.maps.Point( customImageWidth * currentX , customImageHeight * currentY ),
233232
};
234233
}
235-
=======
236-
Standard: {id: 1, x: 0, y: 0},
237-
Jet: {id: 16},
238-
Lift: {id: 36},
239-
RaceFinish : {id: 38},
240-
Safehouse : {id: 40},
241-
PoliceHelicopter: {id: 43},
242-
ChatBubble : {id: 47},
243-
Garage2 : {id: 50},
244-
Drugs : {},
245-
Store : {},
246-
PoliceCar : {id: 56},
247-
PoliceStation : {id: 60, x : 12, y: 0},
248-
Hospital : {},
249-
Helicopter : {id: 64},
250-
StrangersAndFreaks : {},
251-
252-
ArmoredTruck : { x : 0, y:1 },
253-
TowTruck : {id: 68},
254-
Barber : {id: 71},
255-
LosSantosCustoms : {},
256-
Clothes : {},
257-
TattooParlor : {id: 75},
258-
Simeon : {},
259-
Lester : {},
260-
Michael : {},
261-
Trevor : {},
262-
Rampage : {id: 84, x : 11},
263-
VinewoodTours : {},
264-
Lamar : {},
265-
Franklin : {id: 88},
266-
Chinese : {},
267-
268-
Airport : {x : 0, y: 2},
269-
Bar : {id: 93},
270-
BaseJump : {},
271-
CarWash : {id: 100, x: 4},
272-
ComedyClub : {id: 102},
273-
Dart : {},
274-
Fib : {id: 106, x: 9},
275-
Bank : {id: 108, x: 11}, // These are generally "banks". Original: DollarSign
276-
Golf : {},
277-
AmmuNation : {},
278-
Exile : {id: 112},
279-
280-
ShootingRange : {id: 119, x: 1, y: 3},
281-
Solomon : {},
282-
StripClub : {},
283-
Tennis : {},
284-
Triathlon : {id: 126, x: 7},
285-
OffRoadRaceFinish : {},
286-
Key : {id: 134, x: 10},
287-
MovieTheater : {},
288-
Music : {},
289-
Marijuana : {id: 140, x:14 },
290-
Hunting : {},
291-
292-
ArmsTraffickingGround : {id: 147, y: 4, x: 0},
293-
Nigel : {id: 149},
294-
AssaultRifle : {},
295-
Bat : {},
296-
Grenade : {},
297-
Health : {},
298-
Knife : {},
299-
Molotov : {},
300-
Pistol : {},
301-
Rpg : {},
302-
Shotgun : {},
303-
Smg : {},
304-
Sniper : {},
305-
PointOfInterest: {id: 162},
306-
GtaOPassive : {},
307-
GtaOUsingMenu : {},
308-
309-
Minigun : {id: 173, x:0, y: 5},
310-
GrenadeLauncher : {},
311-
Armor : {},
312-
Castle : {},
313-
Camera : {id: 184, x: 7},
314-
Handcuffs : {id: 188, x: 11},
315-
Yoga : {id: 197},
316-
Cab : {},
317-
Shrink: {id: 205},
318-
Epsilon : {},
319-
320-
PersonalVehicleCar : {id: 225, x: 5, y: 6},
321-
PersonalVehicleBike : {},
322-
Custody : {id: 237, x:10},
323-
ArmsTraffickingAir : {id: 251},
324-
Fairground : {id: 266, x: 15},
325-
326-
PropertyManagement : {x: 0, y: 7},
327-
Altruist : {id: 269},
328-
Chop : {id: 273, x: 3},
329-
Hooker : {id: 279, x: 7},
330-
Friend : {},
331-
GtaOMission: {id: 304, x: 14},
332-
GtaOSurvival : {},
333-
334-
CrateDrop : { x:0, y:8},
335-
PlaneDrop : {},
336-
Sub : {},
337-
Race : {},
338-
Deathmatch : {},
339-
ArmWrestling : {},
340-
AmmuNationShootingRange : {id: 313},
341-
RaceAir : {},
342-
RaceCar : {},
343-
RaceSea : {},
344-
GarbageTruck : {id: 318, x:11},
345-
SafehouseForSale : {id: 350, x:14},
346-
Package : {},
347-
348-
MartinMadrazo: {x:0, y: 9},
349-
Boost: {id: 354},
350-
Devin : {},
351-
Marina : {},
352-
Garage : {},
353-
GolfFlag : {},
354-
Hangar : {},
355-
Helipad : {},
356-
JerryCan : {},
357-
Masks : {},
358-
HeistSetup : {},
359-
PickupSpawn : {id: 365},
360-
BoilerSuit : {},
361-
Completed : {},
362-
Rockets : {},
363-
GarageForSale : {},
364-
365-
HelipadForSale : {x: 0, y: 10},
366-
MarinaForSale : {},
367-
HangarForSale : {},
368-
Business : {id: 374},
369-
BusinessForSale : {},
370-
RaceBike : {},
371-
Parachute : {},
372-
TeamDeathmatch : {},
373-
RaceFoot : {},
374-
VehicleDeathmatch : {},
375-
Barry : {},
376-
Dom : {},
377-
MaryAnn : {},
378-
Cletus : {},
379-
Josh : {},
380-
Minute : {},
381-
382-
Omega: {x:0, y:11},
383-
Tonya : {},
384-
Paparazzo : {},
385-
Abigail : {id: 400},
386-
Blimp : {},
387-
Repair : {},
388-
Testosterone : {},
389-
Dinghy : {},
390-
Fanatic : {},
391-
CaptureBriefcase : {id: 408},
392-
LastTeamStanding : {},
393-
Boat : {},
394-
CaptureHouse : {},
395-
JerryCan2 : {id: 415, x: 14},
396-
CaptureAmericanFlag : {id: 419},
397-
398-
CaptureFlag : {x:0, y: 12},
399-
Tank : {},
400-
GunCar : {id: 426, x: 3},
401-
Speedboat : {},
402-
Heist : {},
403-
Stopwatch : {id: 430},
404-
DollarSignCircled : {},
405-
Crosshair2 : {},
406-
DollarSignSquared : {id: 434}
407-
}
408-
409-
function generateBlipShit(){
410-
var currentX = 0, currentY = 0, currentId = 0;
411-
for(var blipName in types){
412-
var blip = types[blipName];
413-
414-
if(typeof(blip.id) != 'undefined'){
415-
currentId = blip.id;
416-
}else{
417-
currentId ++;
418-
}
419-
420-
if(typeof(blip.x) != 'undefined'){
421-
currentX = blip.x;
422-
}else{
423-
currentX ++;
424-
}
425-
426-
if(typeof(blip.y) != 'undefined'){
427-
currentY = blip.y;
428-
}
429-
430-
MarkerTypes[currentId] = {
431-
name: blipName.replace(/([A-Z0-9])/g, ' $1').trim(),
432-
icon: "blips_texturesheet.png",
433-
size: new google.maps.Size( customImageWidth, customImageHeight ),
434-
anchor: new google.maps.Point( customImageWidth/2, customImageHeight ),
435-
scaledSize: new google.maps.Size( 1024/2,1024/2 ),
436-
origin: new google.maps.Point( customImageWidth * currentX , customImageHeight * currentY ),
437-
}
438-
}
439-
>>>>>>> Stashed changes
440234
}
441235

442-
generateBlipShit();
236+
generateBlipShit();

0 commit comments

Comments
 (0)