Clean up semicolons, whitespace and a typo

This commit is contained in:
dongresource 2022-06-29 00:57:30 +02:00
parent 9bfe3d6d99
commit 0060f37e6c
4 changed files with 27 additions and 27 deletions

View File

@ -3,9 +3,9 @@ var today = new Date();
// Check Christmas season: Date constructor in Javascript uses an index
// so 11 is Dec. of this year, and 12 is Jan. of the next
var christmasBegin = new Date(today.getFullYear(), 11, 23);
var christmasBegin = new Date(today.getFullYear(), 11, 23);
var christmasEnd = new Date(today.getFullYear(), 12, 8);
var sf
var sf;
if((today >= christmasBegin && today <= christmasEnd)) {
console.log("Christmas Activated.");
@ -15,5 +15,5 @@ if((today >= christmasBegin && today <= christmasEnd)) {
function stopEasterEggs(){
if (sf != null) {
sf.destroy();
}
}
}
}

View File

@ -40,11 +40,11 @@ function onResize() {
}
function launchGame() {
gameRunning = true
gameRunning = true;
var sel = document.getElementById("of-serverselector");
sel.remove()
sel.remove();
document.body.style.overflow = "hidden";
var object = document.createElement('object');
@ -75,6 +75,6 @@ function launchGame() {
var div = document.getElementById('client');
object.appendChild(embed);
div.appendChild(object);
document.title = "OpenFusion"
document.title = "OpenFusion";
onResize();
}
}

View File

@ -3,9 +3,9 @@ var remotefs = remote.require('fs-extra');
var dns = remote.require('dns');
var userdir = remote.require('app').getPath('userData');
var versionarray
var serverarray
var config
var versionarray;
var serverarray;
var config;
function enableServerListButtons() {
$('#of-connect-button').removeClass('disabled');
@ -35,7 +35,7 @@ function addServer() {
server['version'] = $("#addserver-versionselect option:selected").text();
//server['endpoint'] =
jsontomodify['servers'].push(server)
jsontomodify['servers'].push(server);
remotefs.writeFileSync(userdir+"\\servers.json", JSON.stringify(jsontomodify, null, 4));
loadServerList();
@ -99,13 +99,13 @@ function loadServerList() {
$.each(serverarray, function( key, value ) {
// Create the row, and populate the cells
var row = document.createElement('tr');
row.className = 'server-listing-entry'
row.className = 'server-listing-entry';
row.setAttribute('id', value.uuid);
var cellName = document.createElement('td');
cellName.textContent = value.description
cellName.textContent = value.description;
var cellVersion = document.createElement('td');
cellVersion.textContent = value.version
cellVersion.className = 'text-monospace'
cellVersion.textContent = value.version;
cellVersion.className = 'text-monospace';
row.appendChild(cellName);
row.appendChild(cellVersion);
@ -121,7 +121,7 @@ function loadServerList() {
function setGameInfo(serverUUID) {
var result = serverarray.filter(function(obj) {return (obj.uuid === serverUUID);})[0];
var gameversion = versionarray.filter(function(obj) {return (obj.name === result.version);})[0];
if(config['cache-swapping']) { // if cache swapping property exists AND is `true`, run cache swapping logic
// Cache folder renaming
var cachedir = userdir + '\\..\\..\\LocalLow\\Unity\\Web Player\\Cache';
@ -157,7 +157,7 @@ function setGameInfo(serverUUID) {
remotefs.writeFileSync(__dirname+"\\assetInfo.php", asseturl);
if (result.hasOwnProperty('endpoint')) {
var httpendpoint = result.endpoint.replace("https://", "http://")
var httpendpoint = result.endpoint.replace("https://", "http://");
remotefs.writeFileSync(__dirname+"\\rankurl.txt", httpendpoint+"getranks");
// Write these out too
remotefs.writeFileSync(__dirname+"\\sponsor.php", httpendpoint+"upsell/sponsor.png");
@ -179,7 +179,7 @@ function setGameInfo(serverUUID) {
address = result.ip.substr(0, sepPos);
port = result.ip.substr(sepPos + 1);
} else {
address = result.ip
address = result.ip;
port = 23000 // default
}
@ -227,11 +227,11 @@ function connectToServer() {
});
}
// If applicable, deselect currently selected server.
function deselectServer() {
disableServerListButtons();
$(".server-listing-entry").removeClass('bg-primary');
}
// If applicable, deselect currently selected server.
function deselectServer() {
disableServerListButtons();
$(".server-listing-entry").removeClass('bg-primary');
}
$('#server-table').on('click', '.server-listing-entry', function(event) {
enableServerListButtons();
@ -251,7 +251,7 @@ $('#of-editservermodal').on('show.bs.modal', function (e) {
if(value["uuid"] == getSelectedServer()) {
$("#editserver-descinput")[0].value = value['description'];
$("#editserver-ipinput")[0].value = value['ip'];
var versionIndex = -1;
$.each($("#editserver-versionselect")[0], function( key, val ) {
if(val.text === value['version']) {

View File

@ -62,7 +62,7 @@
</div>
<div class="modal-footer">
<div class="row flex-fill">
<div class="col"><button class="btn btn-primary border rounded border-primary pb-1 pt-1 mr-2 pl-2 pr-2" data-toggle="tooltip" data-bs-tooltip="" type="button" title="Github Page" onclick="window.open(&#39;https://github.com/OpenFusionProject/OpenFusion&#39;,&#39;_blank&#39;);"><i class="fab fa-github" style="font-size: 24px;"></i></button><button class="btn btn-primary border rounded border-primary pb-1 pt-1 pl-2 pr-2" data-toggle="tooltip" data-bs-tooltip="" type="button" title="DIscord Chat" onclick="window.open(&#39;https://discord.gg/DYavckB&#39;,&#39;_blank&#39;);"><i class="fab fa-discord" style="font-size: 24px; position:relative; top: 1px;"></i></button></div>
<div class="col"><button class="btn btn-primary border rounded border-primary pb-1 pt-1 mr-2 pl-2 pr-2" data-toggle="tooltip" data-bs-tooltip="" type="button" title="Github Page" onclick="window.open(&#39;https://github.com/OpenFusionProject/OpenFusion&#39;,&#39;_blank&#39;);"><i class="fab fa-github" style="font-size: 24px;"></i></button><button class="btn btn-primary border rounded border-primary pb-1 pt-1 pl-2 pr-2" data-toggle="tooltip" data-bs-tooltip="" type="button" title="Discord Chat" onclick="window.open(&#39;https://discord.gg/DYavckB&#39;,&#39;_blank&#39;);"><i class="fab fa-discord" style="font-size: 24px; position:relative; top: 1px;"></i></button></div>
<div class="col text-right"><button class="btn btn-primary border rounded border-primary" type="button" data-dismiss="modal">Close</button></div>
</div>
</div>