From bde105ec76493a7e32d83b881f1ee5a46ebac6df Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Fri, 11 Jan 2013 22:11:48 +0100 Subject: timerlist changes --- index.html | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- settings.js | 4 ++-- 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 416c6d3..a3cdb1b 100644 --- a/index.html +++ b/index.html @@ -948,6 +948,7 @@ function setOSDtimer() { var x = toi.schedulerService.getBookingIds("SwitchOnly", 0, 0) if (x.length !== 0) { tijd = toi.schedulerService.getNextStartTime("SwitchOnly"); + alert ("XXXX" + tijd); date = new Date(tijd*1000); tijd = date.toUTCString(); tijd = new Date(tijd); @@ -1472,10 +1473,29 @@ function onKeyMenu(keyCode) { isSetupMenu = 0; mainmenu.style.opacity = 0; break; + case "Left": break; case "Right": break; + case "Up": + if (menu == 2) { + timerID = timerID - 1; + if (timerID < 0) { + timerID = timer.length; + } + InitMenu(menu); + } + break; + case "Down": + if (menu == 2) { + timerID = timerID + 1; + if (timerID == timer.length + 1) { + timerID = 0; + } + InitMenu(menu); + } + break; case "Red": if (menu == 1) { if(showClock == 0 ) { @@ -1556,7 +1576,6 @@ function onKeyMenu(keyCode) { break; case KEY_3: if (menu == 0) { - isTimerMenu = 1; LoadTimers(); menu = 2; } else if (menu == 1) { @@ -1636,20 +1655,42 @@ if(menu == 1) { if(menu == 2) { // Timers menu - mainmenu.innerHTML = "

Timers

\n   Press OK to remove a timer \n" + booking + "\n\n\n\n   0 - MainMenu 
"; -} + var booking = ""; + var x = timerID; + if (timer.length !== 0) { do { x = x + 1; } while (!timer[x] && (x < timer.length)) } + timerID = x - 1; + x = x - 1; + for (var i=0;i<10;i++) { + if (timer.length !== 0) { do { x = x + 1; } while (!timer[x] && (x < timer.length)) } + + if ( i == 0 ) { + booking = booking + "*"; + } else { + booking = booking + " "; + } + + if (timer.length > x) { + booking = booking + timer[x]; + } else { + booking = booking +"\n"; + } + } + + mainmenu.innerHTML = "

Timers

\n   Press OK to remove a timer \n" + booking + "   0 - MainMenu 
"; } +} // end of initmenu + function LoadTimers() { - booking = ""; + var booking = ""; var x = toi.schedulerService.getBookingIds("*", 0, 0); for (var i=0;i