Skip to content

Commit 962f828

Browse files
committed
fix: minifying issues
There was some issues when using the minifier ($debug = false). They were caused by missing semicolons (don't ask). So, now minifying should work like a charm.
1 parent 59d3c43 commit 962f828

File tree

6 files changed

+18
-48
lines changed

6 files changed

+18
-48
lines changed

index.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// Set to false to enable the miinified versions of JS and CSS files
88
// that should speed up content delivery on production websites
9-
$debug = true;
9+
$debug = false;
1010

1111
// Set to the IP of the GTA server that has live_map. Make sure it has the trailing slash (/)
1212
$gtaServer = "http://127.0.0.1:30120/";
@@ -167,7 +167,7 @@
167167
<a id="toggleLive" href="#">Live update <span id="live_enabled" class="label label-danger pull-right">off</span></a>
168168
</li>
169169
-->
170-
170+
171171
<li>
172172
<a id="reconnect" href="#">Connect <span id="connection" class="label label-danger pull-right">disconnected</span></a>
173173
</li>

js/src/controls.js

+1-1
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){

js/src/markers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ var types = {
199199
DollarSignCircled : {},
200200
Crosshair2 : {},
201201
DollarSignSquared : {id: 434}
202-
}
202+
};
203203

204204
function generateBlipShit(){
205205
var currentX = 0, currentY = 0, currentId = 0;
@@ -229,7 +229,7 @@ function generateBlipShit(){
229229
anchor: new google.maps.Point( customImageWidth/2, customImageHeight ),
230230
scaledSize: new google.maps.Size( 1024/2,1024/2 ),
231231
origin: new google.maps.Point( customImageWidth * currentX , customImageHeight * currentY ),
232-
}
232+
};
233233
}
234234
}
235235

js/src/objects.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ function EuclideanProjection() {
66
this.scaleLat = 2;
77
this.scaleLng = 2;
88
this.offsetLat = 0;
9-
this.offsetLng = 0
9+
this.offsetLng = 0;
1010
}
1111

1212
EuclideanProjection.prototype.fromLatLngToPoint = function(latLng, opt_point) {
1313
var point = opt_point || new google.maps.Point(0, 0);
1414
var origin = this.pixelOrigin_;
1515
point.x = (origin.x + (latLng.lng() + this.offsetLng) * this.scaleLng * this.pixelsPerLonDegree_);
1616
point.y = (origin.y + (-1 * latLng.lat() + this.offsetLat) * this.scaleLat * this.pixelsPerLonDegree_);
17-
return point
17+
return point;
1818
};
1919

2020
EuclideanProjection.prototype.fromPointToLatLng = function(point) {
2121
var me = this;
2222
var origin = me.pixelOrigin_;
2323
var lng = (((point.x - origin.x) / me.pixelsPerLonDegree_) / this.scaleLng) - this.offsetLng;
2424
var lat = ((-1 * (point.y - origin.y) / me.pixelsPerLonDegree_) / this.scaleLat) - this.offsetLat;
25-
return new google.maps.LatLng(lat, lng, true)
25+
return new google.maps.LatLng(lat, lng, true);
2626
};
2727

2828
function Coordinates(x, y, z) {
2929
this.x = x;
3030
this.y = y;
31-
this.z = z
31+
this.z = z;
3232
}
3333

3434
function MarkerObject(reference, position, type, description, data) {

js/src/socket.js

+2-32
Original file line numberDiff line numberDiff line change
@@ -54,41 +54,11 @@ function onMessage(e){
5454
}
5555

5656
function onError(e){
57-
// from http://stackoverflow.com/a/28396165
58-
var reason;
59-
// See http://tools.ietf.org/html/rfc6455#section-7.4.1
60-
if (event.code == 1000)
61-
reason = "Normal closure, meaning that the purpose for which the connection was established has been fulfilled.";
62-
else if(event.code == 1001)
63-
reason = "An endpoint is \"going away\", such as a server going down or a browser having navigated away from a page.";
64-
else if(event.code == 1002)
65-
reason = "An endpoint is terminating the connection due to a protocol error";
66-
else if(event.code == 1003)
67-
reason = "An endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).";
68-
else if(event.code == 1004)
69-
reason = "Reserved. The specific meaning might be defined in the future.";
70-
else if(event.code == 1005)
71-
reason = "No status code was actually present.";
72-
else if(event.code == 1006)
73-
reason = "The connection was closed abnormally, e.g., without sending or receiving a Close control frame";
74-
else if(event.code == 1007)
75-
reason = "An endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [http://tools.ietf.org/html/rfc3629] data within a text message).";
76-
else if(event.code == 1008)
77-
reason = "An endpoint is terminating the connection because it has received a message that \"violates its policy\". This reason is given either if there is no other sutible reason, or if there is a need to hide specific details about the policy.";
78-
else if(event.code == 1009)
79-
reason = "An endpoint is terminating the connection because it has received a message that is too big for it to process.";
80-
else if(event.code == 1010) // Note that this status code is not used by the server, because it can fail the WebSocket handshake instead.
81-
reason = "An endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake. <br /> Specifically, the extensions that are needed are: " + event.reason;
82-
else if(event.code == 1011)
83-
reason = "A server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.";
84-
else if(event.code == 1015)
85-
reason = "The connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).";
86-
else
87-
reason = "Unknown reason (Server is probably down)";
88-
57+
var reason = "Unknown reason (Server is probably down)";
8958
//$("#socket_error").text(reason);
9059
console.log("Socket error: " + reason);
9160
}
61+
9262
function onClose(e){
9363
$("#connection").removeClass("label-success")
9464
.removeClass("label-warning")

js/src/utils.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function convertToGame(lat, lng) {
1616
return result = {
1717
x: rX,
1818
y: rY
19-
}
19+
};
2020
}
2121

2222
function convertToGameCoord(lat, lng) {
@@ -26,7 +26,7 @@ function convertToGameCoord(lat, lng) {
2626
x: rX,
2727
y: rY,
2828
z: 0
29-
}
29+
};
3030
}
3131

3232
function convertToMap(x, y) {
@@ -35,25 +35,25 @@ function convertToMap(x, y) {
3535
return result = {
3636
lat: rLat,
3737
lng: rLng
38-
}
38+
};
3939
}
4040

4141
function convertToMapGMAP(x, y) {
4242
var rLng = map_1_lng + (x - game_1_x) * (map_1_lng - map_2_lng) / (game_1_x - game_2_x);
4343
var rLat = map_1_lat + (y - game_1_y) * (map_1_lat - map_2_lat) / (game_1_y - game_2_y);
44-
return new google.maps.LatLng(rLat, rLng)
44+
return new google.maps.LatLng(rLat, rLng);
4545
}
4646

4747
function convertToMapGMAPcoord(coord) {
4848
var rLng = map_1_lng + (coord.x - game_1_x) * (map_1_lng - map_2_lng) / (game_1_x - game_2_x);
4949
var rLat = map_1_lat + (coord.y - game_1_y) * (map_1_lat - map_2_lat) / (game_1_y - game_2_y);
50-
return new google.maps.LatLng(rLat, rLng)
50+
return new google.maps.LatLng(rLat, rLng);
5151
}
5252

5353
function stringCoordToFloat(coord) {
5454
return result = {
5555
x: parseFloat(coord.x),
5656
y: parseFloat(coord.y),
5757
z: parseFloat(coord.z),
58-
}
59-
};
58+
};
59+
};

0 commit comments

Comments
 (0)