From 0060f37e6c2c0b5ccf85e116cebd48f2bd380429 Mon Sep 17 00:00:00 2001 From: dongresource Date: Wed, 29 Jun 2022 00:57:30 +0200 Subject: [PATCH] Clean up semicolons, whitespace and a typo --- assets/js/eastereggs.js | 8 ++++---- assets/js/gameclient.js | 10 +++++----- assets/js/serverselector.js | 34 +++++++++++++++++----------------- index.html | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/assets/js/eastereggs.js b/assets/js/eastereggs.js index ac2bc39..8b4eb5f 100644 --- a/assets/js/eastereggs.js +++ b/assets/js/eastereggs.js @@ -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(); - } -} \ No newline at end of file + } +} diff --git a/assets/js/gameclient.js b/assets/js/gameclient.js index 2de0421..3b66f2f 100644 --- a/assets/js/gameclient.js +++ b/assets/js/gameclient.js @@ -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(); -} \ No newline at end of file +} diff --git a/assets/js/serverselector.js b/assets/js/serverselector.js index 5a3d0e9..baaf706 100644 --- a/assets/js/serverselector.js +++ b/assets/js/serverselector.js @@ -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']) { diff --git a/index.html b/index.html index a127b81..7c39202 100644 --- a/index.html +++ b/index.html @@ -62,7 +62,7 @@