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

View File

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

View File

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

View File

@ -62,7 +62,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<div class="row flex-fill"> <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 class="col text-right"><button class="btn btn-primary border rounded border-primary" type="button" data-dismiss="modal">Close</button></div>
</div> </div>
</div> </div>