Update custom.html
parent
bf994d9acc
commit
426768eb11
|
|
@ -254,30 +254,31 @@ function renderBackground(l) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderTable(l) {
|
function renderTable(l) {
|
||||||
|
var foundNumber = findNextScheduleIndex();
|
||||||
|
var yellowIndex = 3;
|
||||||
|
if (foundNumber < 3) { yellowIndex = foundNumber; }
|
||||||
for(var x = 0;x<=numberOfItemsShown;x++){
|
for(var x = 0;x<=numberOfItemsShown;x++){
|
||||||
g.setColor(255,255,255);
|
g.setColor(255,255,255);
|
||||||
g.drawRect(rectStartX,rectStart+(x*20),rectEndX,rectEnd+(20*x));
|
g.drawRect(rectStartX,rectStart+(x*20),rectEndX,rectEnd+(20*x));
|
||||||
|
}
|
||||||
g.setColor(255,205,0);
|
g.setColor(255,205,0);
|
||||||
g.drawRect(rectStartX,rectStart+(2*20),rectEndX,rectEnd+(2*20));
|
g.drawRect(rectStartX,rectStart+(yellowIndex*20),rectEndX,rectEnd+(20*yellowIndex));
|
||||||
g.setColor(255,0,0);
|
g.setColor(255,0,0);
|
||||||
g.drawRect(rectStartX,rectStart+(currentPositionTable*20),rectEndX,rectEnd+(20*currentPositionTable));
|
g.drawRect(rectStartX,rectStart+(currentPositionTable*20),rectEndX,rectEnd+(20*currentPositionTable));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function renderTableText(l) {
|
function renderTableText(l) {
|
||||||
var foundNumber = findNextScheduleIndex();
|
|
||||||
var foundSchedule = getScheduleTable();
|
var foundSchedule = getScheduleTable();
|
||||||
|
var foundNumber = findNextScheduleIndex();
|
||||||
|
var startNumber = foundNumber - 2;
|
||||||
|
if (startNumber < 0) { startNumber = 0; }
|
||||||
|
var endNumber = startNumber + 8 - (foundNumber - startNumber);
|
||||||
|
if (endNumber > foundSchedule.length-1) { endNumber = foundSchedule.length-1; }
|
||||||
|
|
||||||
|
|
||||||
var scheduleHourUpdated;
|
var scheduleHourUpdated;
|
||||||
var scheduleMinuteUpdated;
|
var scheduleMinuteUpdated;
|
||||||
var beforeFoundNumber = foundNumber - 2;
|
for(var currentNumber = startNumber; currentNumber<=endNumber; currentNumber++){
|
||||||
for(var x = 0;x<=numberOfItemsShown;x++){
|
|
||||||
var currentNumber = beforeFoundNumber + x;
|
|
||||||
if (beforeFoundNumber + x < 0) {
|
|
||||||
currentNumber = foundSchedule.length + beforeFoundNumber + x;
|
|
||||||
} else if (beforeFoundNumber + x > foundSchedule.length - 1) {
|
|
||||||
currentNumber = beforeFoundNumber + x - foundSchedule.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
scheduleMinuteUpdatedStart = updateMinutesToCurrentTime(foundSchedule[currentNumber].sm);
|
scheduleMinuteUpdatedStart = updateMinutesToCurrentTime(foundSchedule[currentNumber].sm);
|
||||||
scheduleHourUpdatedStart = foundSchedule[currentNumber].sh;
|
scheduleHourUpdatedStart = foundSchedule[currentNumber].sh;
|
||||||
scheduleMinuteUpdatedEnd = updateMinutesToCurrentTime(foundSchedule[currentNumber].em);
|
scheduleMinuteUpdatedEnd = updateMinutesToCurrentTime(foundSchedule[currentNumber].em);
|
||||||
|
|
@ -288,7 +289,7 @@ function renderTableText(l){
|
||||||
}
|
}
|
||||||
schduleDay = updateDay(3,foundSchedule[currentNumber].dow);
|
schduleDay = updateDay(3,foundSchedule[currentNumber].dow);
|
||||||
g.setFont("8x12");
|
g.setFont("8x12");
|
||||||
g.drawString(scheduleHourUpdatedStart+":"+scheduleMinuteUpdatedStart+"-"+scheduleHourUpdatedEnd+":"+scheduleMinuteUpdatedEnd+" "+schduleDay+" "+scheduleDecriptionUpdated,13,50+(x*20));
|
g.drawString(scheduleHourUpdatedStart+":"+scheduleMinuteUpdatedStart+"-"+scheduleHourUpdatedEnd+":"+scheduleMinuteUpdatedEnd+" "+schduleDay+" "+scheduleDecriptionUpdated,13,50+(currentNumber*20));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -364,14 +365,18 @@ function renderLoading(l){
|
||||||
function renderInformation(l){
|
function renderInformation(l){
|
||||||
var foundNumber = findNextScheduleIndex();
|
var foundNumber = findNextScheduleIndex();
|
||||||
var foundSchedule = getScheduleTable();
|
var foundSchedule = getScheduleTable();
|
||||||
|
var startNumber = foundNumber - 2;
|
||||||
|
if (startNumber < 0) { startNumber = 0; }
|
||||||
|
|
||||||
|
if ((startNumber+currentPositionTable) <= foundSchedule.length-1) {
|
||||||
scheduleMinuteUpdatedStart = updateMinutesToCurrentTime(foundSchedule[foundNumber].sm);
|
scheduleMinuteUpdatedStart = updateMinutesToCurrentTime(foundSchedule[foundNumber].sm);
|
||||||
scheduleHourUpdatedStart = foundSchedule[foundNumber].sh;
|
scheduleHourUpdatedStart = foundSchedule[foundNumber].sh;
|
||||||
scheduleMinuteUpdatedEnd = updateMinutesToCurrentTime(foundSchedule[foundNumber].em);
|
scheduleMinuteUpdatedEnd = updateMinutesToCurrentTime(foundSchedule[foundNumber].em);
|
||||||
scheduleHourUpdatedEnd = foundSchedule[foundNumber].eh;
|
scheduleHourUpdatedEnd = foundSchedule[foundNumber].eh;
|
||||||
scheduleDay = updateDay(1,foundSchedule[((foundNumber-2)+currentPositionTable)].dow);
|
scheduleDay = updateDay(1,foundSchedule[(startNumber+currentPositionTable)].dow);
|
||||||
g.setColor(255,255,255);
|
g.setColor(255,255,255);
|
||||||
g.setFont("8x12",2);
|
g.setFont("8x12",2);
|
||||||
var splitClassNames = splitter(foundSchedule[((foundNumber-2)+currentPositionTable)].cn, 15);
|
var splitClassNames = splitter(foundSchedule[(startNumber+currentPositionTable)].cn, 15);
|
||||||
var currentY = 5;
|
var currentY = 5;
|
||||||
for (var j=0; j < splitClassNames.length; j++) {
|
for (var j=0; j < splitClassNames.length; j++) {
|
||||||
g.drawString(splitClassNames[j],13,currentY+50);
|
g.drawString(splitClassNames[j],13,currentY+50);
|
||||||
|
|
@ -381,6 +386,7 @@ function renderInformation(l){
|
||||||
g.drawString(schduleDay,13,currentY+50);
|
g.drawString(schduleDay,13,currentY+50);
|
||||||
g.drawString(scheduleHourUpdatedStart+":"+scheduleMinuteUpdatedStart+"-"+scheduleHourUpdatedEnd+":"+scheduleMinuteUpdatedEnd,13,currentY+15+50);
|
g.drawString(scheduleHourUpdatedStart+":"+scheduleMinuteUpdatedStart+"-"+scheduleHourUpdatedEnd+":"+scheduleMinuteUpdatedEnd,13,currentY+15+50);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var Layout = require("Layout");
|
var Layout = require("Layout");
|
||||||
var layout = new Layout(
|
var layout = new Layout(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue