Skip to content

Commit 8ce3c5b

Browse files
committed
further solari formatting cleanups
1 parent 8f59c82 commit 8ce3c5b

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

‎js/solari.js‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function ToUpper(code) {
8181
}
8282

8383
//constructs the solariBoard within the given div. If no parameter is given, adds the board to "body"
84-
function addSolariBoard(){
84+
function addSolariBoard() {
8585
$("body").append("<div id=\"solariBoardDiv\"></div>");
8686
addSolariBoard("solariBoardDiv");
8787
}
@@ -95,7 +95,7 @@ function addSolariBoard(divSelector) {
9595
"<div id=\"solari\" class=\"panel\">" +
9696
"<div id=\"departures\">" +
9797
"<header class=\"solari-board-header rounded\"> " +
98-
"<div class=\"solari-board-icon\"> </div>" +
98+
"<div class=\"solari-board-icon\"> </div>" +
9999
"<div class=\"clockContainer\">" +
100100
"<ul class=\"clockList\">" +
101101
"<li id=\"hours\">12</li>" +
@@ -314,6 +314,7 @@ function GetFailBoard() {
314314
}
315315
return board;
316316
}
317+
317318
function updateSolariBoard() {
318319
dataSync = true;
319320
$.post('../example/postJson.py', //replace this with your own script
@@ -336,21 +337,21 @@ function updateSolariBoard() {
336337

337338

338339
if (!failboard && typeof solariData === 'undefined') {
339-
window.setTimeout(updateSolariBoard,1000);
340+
window.setTimeout(updateSolariBoard, 1000);
340341
return;
341342
}
342343

343344
try {
344-
if (solariData.length === 0){
345+
if (solariData.length === 0) {
345346
clearBoard();
346347
return;
347348
}
348349
}
349-
catch(err){}
350+
catch(err) {}
350351

351352
//Format the "Next Due" box
352353
$("#arrivals .solari-board-header, #arrivals .solari-board-columns").show(1000);
353-
if (!failboard){
354+
if (!failboard) {
354355
new_board = solariData;
355356
var i;
356357
//the next due box should display the next available time, which may not be from the first case
@@ -363,18 +364,17 @@ function updateSolariBoard() {
363364
var next_due_row = solariData[i];
364365
time = next_due_row.sTime;
365366
var timeDelta = Date.parse(next_due_row.sDate).getTime() - new Date().getTime();
366-
var nOffset = Math.ceil(timeDelta / (1000 * 60 * 60 * 24)); //divide my miliseconds per day
367+
var nOffset = Math.ceil(timeDelta / (1000 * 60 * 60 * 24)); //divide my miliseconds per day
367368
var offset = (nOffset === 0 ? "" : nOffset.toString() + "d"); //hide if next due is today
368-
if(status_override){
369-
if (time){
369+
if(status_override) {
370+
if (time) {
370371
var hrsDelta = Number(time.substring(0,2)) - new Date().getHours();
371372
nOffset += hrsDelta < 0 ? -1 : 0; // if the time difference is negative, which means we are within 24 hours of due, so reduce day offset by 1
372-
if (nOffset < 0)
373+
if (nOffset < 0) {
373374
new_board[0].nStatus = 3; // if we've past the due date
374-
else if (nOffset === 0 && hrsDelta < 2 && hrsDelta >= 0 ){
375+
} else if (nOffset === 0 && hrsDelta < 2 && hrsDelta >= 0 ) {
375376
new_board[0].nStatus =1; //due within 2 hours
376-
}
377-
else{
377+
} else {
378378
new_board[0].nStatus = failboard ? 1 : 2;
379379
}
380380
}

0 commit comments

Comments
 (0)