From 1cb22449f7ce7ffe119b16bbd273177e6a9c4c9e Mon Sep 17 00:00:00 2001 From: thlo Date: Sun, 13 Jan 2013 21:18:14 +0100 Subject: Test Commit --- smarttv-client/Images/helpbar/help_0_9.png | Bin 0 -> 3263 bytes smarttv-client/Images/helpbar/help_back.png | Bin 0 -> 3070 bytes smarttv-client/Images/helpbar/help_blue.png | Bin 0 -> 3524 bytes smarttv-client/Images/helpbar/help_enter.png | Bin 0 -> 2906 bytes smarttv-client/Images/helpbar/help_ff_rew.png | Bin 0 -> 2950 bytes smarttv-client/Images/helpbar/help_green.png | Bin 0 -> 3543 bytes smarttv-client/Images/helpbar/help_ime.png | Bin 0 -> 2886 bytes smarttv-client/Images/helpbar/help_info.png | Bin 0 -> 3129 bytes smarttv-client/Images/helpbar/help_joy.png | Bin 0 -> 367 bytes smarttv-client/Images/helpbar/help_lr.png | Bin 0 -> 2903 bytes smarttv-client/Images/helpbar/help_mode.png | Bin 0 -> 380 bytes smarttv-client/Images/helpbar/help_move.png | Bin 0 -> 2923 bytes smarttv-client/Images/helpbar/help_pre_ch.png | Bin 0 -> 3043 bytes smarttv-client/Images/helpbar/help_red.png | Bin 0 -> 3487 bytes smarttv-client/Images/helpbar/help_size.png | Bin 0 -> 432 bytes smarttv-client/Images/helpbar/help_ud.png | Bin 0 -> 2906 bytes smarttv-client/Images/helpbar/help_user.png | Bin 0 -> 3102 bytes smarttv-client/Images/helpbar/help_video.png | Bin 0 -> 461 bytes smarttv-client/Images/helpbar/help_video2.png | Bin 0 -> 864 bytes smarttv-client/Images/helpbar/help_vod.png | Bin 0 -> 383 bytes smarttv-client/Images/helpbar/help_yellow.png | Bin 0 -> 3577 bytes smarttv-client/Images/helpbar/keyhelp_black.png | Bin 0 -> 7417 bytes smarttv-client/Images/helpbar/mute.png | Bin 0 -> 516 bytes smarttv-client/Images/helpbar/mute2.png | Bin 0 -> 752 bytes smarttv-client/Images/helpbar/tools.png | Bin 0 -> 2943 bytes smarttv-client/Images/helpbar/volume.png | Bin 0 -> 761 bytes smarttv-client/Images/helpbar/web.png | Bin 0 -> 1798 bytes smarttv-client/Images/keypad/kp-button-inv.png | Bin 0 -> 1633 bytes smarttv-client/Images/keypad/kp-button.png | Bin 0 -> 1561 bytes smarttv-client/Images/spinner/loadingBG.png | Bin 0 -> 8054 bytes smarttv-client/Images/spinner/loading_1.png | Bin 0 -> 6393 bytes smarttv-client/Images/spinner/loading_10.png | Bin 0 -> 6319 bytes smarttv-client/Images/spinner/loading_11.png | Bin 0 -> 6408 bytes smarttv-client/Images/spinner/loading_12.png | Bin 0 -> 6384 bytes smarttv-client/Images/spinner/loading_2.png | Bin 0 -> 6465 bytes smarttv-client/Images/spinner/loading_3.png | Bin 0 -> 6437 bytes smarttv-client/Images/spinner/loading_4.png | Bin 0 -> 6388 bytes smarttv-client/Images/spinner/loading_5.png | Bin 0 -> 6433 bytes smarttv-client/Images/spinner/loading_6.png | Bin 0 -> 6432 bytes smarttv-client/Images/spinner/loading_7.png | Bin 0 -> 6506 bytes smarttv-client/Images/spinner/loading_8.png | Bin 0 -> 6516 bytes smarttv-client/Images/spinner/loading_9.png | Bin 0 -> 6467 bytes 42 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 smarttv-client/Images/helpbar/help_0_9.png create mode 100644 smarttv-client/Images/helpbar/help_back.png create mode 100644 smarttv-client/Images/helpbar/help_blue.png create mode 100644 smarttv-client/Images/helpbar/help_enter.png create mode 100644 smarttv-client/Images/helpbar/help_ff_rew.png create mode 100644 smarttv-client/Images/helpbar/help_green.png create mode 100644 smarttv-client/Images/helpbar/help_ime.png create mode 100644 smarttv-client/Images/helpbar/help_info.png create mode 100644 smarttv-client/Images/helpbar/help_joy.png create mode 100644 smarttv-client/Images/helpbar/help_lr.png create mode 100644 smarttv-client/Images/helpbar/help_mode.png create mode 100644 smarttv-client/Images/helpbar/help_move.png create mode 100644 smarttv-client/Images/helpbar/help_pre_ch.png create mode 100644 smarttv-client/Images/helpbar/help_red.png create mode 100644 smarttv-client/Images/helpbar/help_size.png create mode 100644 smarttv-client/Images/helpbar/help_ud.png create mode 100644 smarttv-client/Images/helpbar/help_user.png create mode 100644 smarttv-client/Images/helpbar/help_video.png create mode 100644 smarttv-client/Images/helpbar/help_video2.png create mode 100644 smarttv-client/Images/helpbar/help_vod.png create mode 100644 smarttv-client/Images/helpbar/help_yellow.png create mode 100644 smarttv-client/Images/helpbar/keyhelp_black.png create mode 100644 smarttv-client/Images/helpbar/mute.png create mode 100644 smarttv-client/Images/helpbar/mute2.png create mode 100644 smarttv-client/Images/helpbar/tools.png create mode 100644 smarttv-client/Images/helpbar/volume.png create mode 100644 smarttv-client/Images/helpbar/web.png create mode 100644 smarttv-client/Images/keypad/kp-button-inv.png create mode 100644 smarttv-client/Images/keypad/kp-button.png create mode 100644 smarttv-client/Images/spinner/loadingBG.png create mode 100644 smarttv-client/Images/spinner/loading_1.png create mode 100644 smarttv-client/Images/spinner/loading_10.png create mode 100644 smarttv-client/Images/spinner/loading_11.png create mode 100644 smarttv-client/Images/spinner/loading_12.png create mode 100644 smarttv-client/Images/spinner/loading_2.png create mode 100644 smarttv-client/Images/spinner/loading_3.png create mode 100644 smarttv-client/Images/spinner/loading_4.png create mode 100644 smarttv-client/Images/spinner/loading_5.png create mode 100644 smarttv-client/Images/spinner/loading_6.png create mode 100644 smarttv-client/Images/spinner/loading_7.png create mode 100644 smarttv-client/Images/spinner/loading_8.png create mode 100644 smarttv-client/Images/spinner/loading_9.png diff --git a/smarttv-client/Images/helpbar/help_0_9.png b/smarttv-client/Images/helpbar/help_0_9.png new file mode 100644 index 0000000..309a3fe Binary files /dev/null and b/smarttv-client/Images/helpbar/help_0_9.png differ diff --git a/smarttv-client/Images/helpbar/help_back.png b/smarttv-client/Images/helpbar/help_back.png new file mode 100644 index 0000000..aff9672 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_back.png differ diff --git a/smarttv-client/Images/helpbar/help_blue.png b/smarttv-client/Images/helpbar/help_blue.png new file mode 100644 index 0000000..c0da080 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_blue.png differ diff --git a/smarttv-client/Images/helpbar/help_enter.png b/smarttv-client/Images/helpbar/help_enter.png new file mode 100644 index 0000000..7dcaa38 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_enter.png differ diff --git a/smarttv-client/Images/helpbar/help_ff_rew.png b/smarttv-client/Images/helpbar/help_ff_rew.png new file mode 100644 index 0000000..8d7140e Binary files /dev/null and b/smarttv-client/Images/helpbar/help_ff_rew.png differ diff --git a/smarttv-client/Images/helpbar/help_green.png b/smarttv-client/Images/helpbar/help_green.png new file mode 100644 index 0000000..1cb4725 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_green.png differ diff --git a/smarttv-client/Images/helpbar/help_ime.png b/smarttv-client/Images/helpbar/help_ime.png new file mode 100644 index 0000000..5cdf3c5 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_ime.png differ diff --git a/smarttv-client/Images/helpbar/help_info.png b/smarttv-client/Images/helpbar/help_info.png new file mode 100644 index 0000000..2cfeb3d Binary files /dev/null and b/smarttv-client/Images/helpbar/help_info.png differ diff --git a/smarttv-client/Images/helpbar/help_joy.png b/smarttv-client/Images/helpbar/help_joy.png new file mode 100644 index 0000000..0ded79a Binary files /dev/null and b/smarttv-client/Images/helpbar/help_joy.png differ diff --git a/smarttv-client/Images/helpbar/help_lr.png b/smarttv-client/Images/helpbar/help_lr.png new file mode 100644 index 0000000..f8841e3 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_lr.png differ diff --git a/smarttv-client/Images/helpbar/help_mode.png b/smarttv-client/Images/helpbar/help_mode.png new file mode 100644 index 0000000..d244fb8 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_mode.png differ diff --git a/smarttv-client/Images/helpbar/help_move.png b/smarttv-client/Images/helpbar/help_move.png new file mode 100644 index 0000000..4a03436 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_move.png differ diff --git a/smarttv-client/Images/helpbar/help_pre_ch.png b/smarttv-client/Images/helpbar/help_pre_ch.png new file mode 100644 index 0000000..92827d4 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_pre_ch.png differ diff --git a/smarttv-client/Images/helpbar/help_red.png b/smarttv-client/Images/helpbar/help_red.png new file mode 100644 index 0000000..43e2500 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_red.png differ diff --git a/smarttv-client/Images/helpbar/help_size.png b/smarttv-client/Images/helpbar/help_size.png new file mode 100644 index 0000000..08dd8ad Binary files /dev/null and b/smarttv-client/Images/helpbar/help_size.png differ diff --git a/smarttv-client/Images/helpbar/help_ud.png b/smarttv-client/Images/helpbar/help_ud.png new file mode 100644 index 0000000..df04b3c Binary files /dev/null and b/smarttv-client/Images/helpbar/help_ud.png differ diff --git a/smarttv-client/Images/helpbar/help_user.png b/smarttv-client/Images/helpbar/help_user.png new file mode 100644 index 0000000..bcd2fa1 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_user.png differ diff --git a/smarttv-client/Images/helpbar/help_video.png b/smarttv-client/Images/helpbar/help_video.png new file mode 100644 index 0000000..f029be2 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_video.png differ diff --git a/smarttv-client/Images/helpbar/help_video2.png b/smarttv-client/Images/helpbar/help_video2.png new file mode 100644 index 0000000..efb1fd1 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_video2.png differ diff --git a/smarttv-client/Images/helpbar/help_vod.png b/smarttv-client/Images/helpbar/help_vod.png new file mode 100644 index 0000000..47cdace Binary files /dev/null and b/smarttv-client/Images/helpbar/help_vod.png differ diff --git a/smarttv-client/Images/helpbar/help_yellow.png b/smarttv-client/Images/helpbar/help_yellow.png new file mode 100644 index 0000000..b62fae7 Binary files /dev/null and b/smarttv-client/Images/helpbar/help_yellow.png differ diff --git a/smarttv-client/Images/helpbar/keyhelp_black.png b/smarttv-client/Images/helpbar/keyhelp_black.png new file mode 100644 index 0000000..fd3f143 Binary files /dev/null and b/smarttv-client/Images/helpbar/keyhelp_black.png differ diff --git a/smarttv-client/Images/helpbar/mute.png b/smarttv-client/Images/helpbar/mute.png new file mode 100644 index 0000000..a215cc0 Binary files /dev/null and b/smarttv-client/Images/helpbar/mute.png differ diff --git a/smarttv-client/Images/helpbar/mute2.png b/smarttv-client/Images/helpbar/mute2.png new file mode 100644 index 0000000..e1c63be Binary files /dev/null and b/smarttv-client/Images/helpbar/mute2.png differ diff --git a/smarttv-client/Images/helpbar/tools.png b/smarttv-client/Images/helpbar/tools.png new file mode 100644 index 0000000..f74d00a Binary files /dev/null and b/smarttv-client/Images/helpbar/tools.png differ diff --git a/smarttv-client/Images/helpbar/volume.png b/smarttv-client/Images/helpbar/volume.png new file mode 100644 index 0000000..aa374fe Binary files /dev/null and b/smarttv-client/Images/helpbar/volume.png differ diff --git a/smarttv-client/Images/helpbar/web.png b/smarttv-client/Images/helpbar/web.png new file mode 100644 index 0000000..e3a5739 Binary files /dev/null and b/smarttv-client/Images/helpbar/web.png differ diff --git a/smarttv-client/Images/keypad/kp-button-inv.png b/smarttv-client/Images/keypad/kp-button-inv.png new file mode 100644 index 0000000..a42eef7 Binary files /dev/null and b/smarttv-client/Images/keypad/kp-button-inv.png differ diff --git a/smarttv-client/Images/keypad/kp-button.png b/smarttv-client/Images/keypad/kp-button.png new file mode 100644 index 0000000..697f295 Binary files /dev/null and b/smarttv-client/Images/keypad/kp-button.png differ diff --git a/smarttv-client/Images/spinner/loadingBG.png b/smarttv-client/Images/spinner/loadingBG.png new file mode 100644 index 0000000..5ef6f93 Binary files /dev/null and b/smarttv-client/Images/spinner/loadingBG.png differ diff --git a/smarttv-client/Images/spinner/loading_1.png b/smarttv-client/Images/spinner/loading_1.png new file mode 100644 index 0000000..20f8fd1 Binary files /dev/null and b/smarttv-client/Images/spinner/loading_1.png differ diff --git a/smarttv-client/Images/spinner/loading_10.png b/smarttv-client/Images/spinner/loading_10.png new file mode 100644 index 0000000..b331ecb Binary files /dev/null and b/smarttv-client/Images/spinner/loading_10.png differ diff --git a/smarttv-client/Images/spinner/loading_11.png b/smarttv-client/Images/spinner/loading_11.png new file mode 100644 index 0000000..21593c2 Binary files /dev/null and b/smarttv-client/Images/spinner/loading_11.png differ diff --git a/smarttv-client/Images/spinner/loading_12.png b/smarttv-client/Images/spinner/loading_12.png new file mode 100644 index 0000000..0d26c10 Binary files /dev/null and b/smarttv-client/Images/spinner/loading_12.png differ diff --git a/smarttv-client/Images/spinner/loading_2.png b/smarttv-client/Images/spinner/loading_2.png new file mode 100644 index 0000000..1099ae6 Binary files /dev/null and b/smarttv-client/Images/spinner/loading_2.png differ diff --git a/smarttv-client/Images/spinner/loading_3.png b/smarttv-client/Images/spinner/loading_3.png new file mode 100644 index 0000000..e9ed7cb Binary files /dev/null and b/smarttv-client/Images/spinner/loading_3.png differ diff --git a/smarttv-client/Images/spinner/loading_4.png b/smarttv-client/Images/spinner/loading_4.png new file mode 100644 index 0000000..8e792d5 Binary files /dev/null and b/smarttv-client/Images/spinner/loading_4.png differ diff --git a/smarttv-client/Images/spinner/loading_5.png b/smarttv-client/Images/spinner/loading_5.png new file mode 100644 index 0000000..a328995 Binary files /dev/null and b/smarttv-client/Images/spinner/loading_5.png differ diff --git a/smarttv-client/Images/spinner/loading_6.png b/smarttv-client/Images/spinner/loading_6.png new file mode 100644 index 0000000..4709247 Binary files /dev/null and b/smarttv-client/Images/spinner/loading_6.png differ diff --git a/smarttv-client/Images/spinner/loading_7.png b/smarttv-client/Images/spinner/loading_7.png new file mode 100644 index 0000000..160327d Binary files /dev/null and b/smarttv-client/Images/spinner/loading_7.png differ diff --git a/smarttv-client/Images/spinner/loading_8.png b/smarttv-client/Images/spinner/loading_8.png new file mode 100644 index 0000000..c4abe4b Binary files /dev/null and b/smarttv-client/Images/spinner/loading_8.png differ diff --git a/smarttv-client/Images/spinner/loading_9.png b/smarttv-client/Images/spinner/loading_9.png new file mode 100644 index 0000000..5959995 Binary files /dev/null and b/smarttv-client/Images/spinner/loading_9.png differ -- cgit v1.2.3 From f92e97207c9f6fc740bf4960049758a5a36d6898 Mon Sep 17 00:00:00 2001 From: thlo Date: Sun, 13 Jan 2013 21:28:52 +0100 Subject: Various changes: Folder Support for Live, Spinner, Keyboard, etc --- smarttv-client/CSS/Main.css | 17 +- smarttv-client/Images/leftHalf-bg.png | Bin 138277 -> 155643 bytes smarttv-client/Images/rightHalf-bg.png | Bin 124624 -> 140790 bytes smarttv-client/Javascript/Config.js | 45 ++-- smarttv-client/Javascript/Data.js | 32 +++ smarttv-client/Javascript/Display.js | 75 ++++--- smarttv-client/Javascript/Epg.js | 41 ++++ smarttv-client/Javascript/Helpbar.js | 58 ++++++ smarttv-client/Javascript/Main.js | 170 +++++++-------- smarttv-client/Javascript/Options.js | 367 ++++++++++++++++++++++++++++----- smarttv-client/Javascript/Player.js | 40 ++-- smarttv-client/Javascript/Server.js | 49 +++-- smarttv-client/Javascript/Spinner.js | 51 +++++ smarttv-client/config.xml | 2 +- smarttv-client/index.html | 23 ++- 15 files changed, 742 insertions(+), 228 deletions(-) create mode 100644 smarttv-client/Javascript/Epg.js create mode 100644 smarttv-client/Javascript/Helpbar.js create mode 100644 smarttv-client/Javascript/Spinner.js diff --git a/smarttv-client/CSS/Main.css b/smarttv-client/CSS/Main.css index e3ebaca..ccc6714 100755 --- a/smarttv-client/CSS/Main.css +++ b/smarttv-client/CSS/Main.css @@ -66,7 +66,6 @@ body { position: absolute; left: 0px; top: 0px; width: 960px; height: 540px; - display: none; background: url("../Images/selectScreen-bg.png"); background: -webkit-radial-gradient(80% 80%, ellipse cover, rgba(197,222,234,1) 0%,rgba(138,187,215,1) 31%,rgba(6,109,171,1) 100%); } @@ -226,6 +225,9 @@ body { background: -webkit-linear-gradient(-45deg, #1e5799 0%,#2989d8 41%,#7db9e8 100%); } +.style_videoitem { + display: inline-block; +} .style_videoList { color:#FFFFFF; @@ -383,3 +385,16 @@ body { text-align:center; font-size:14px; } + + +#Spinning { + position:absolute; + left:401px; top:196px; + width:158px; height:147px; + background-image:url("../Images/spinner/loadingBG.png"); + background-repeat:no-repeat; + opacity:0.5; + display:none; + z-index:20; +} + diff --git a/smarttv-client/Images/leftHalf-bg.png b/smarttv-client/Images/leftHalf-bg.png index 0be1542..d91b9b6 100644 Binary files a/smarttv-client/Images/leftHalf-bg.png and b/smarttv-client/Images/leftHalf-bg.png differ diff --git a/smarttv-client/Images/rightHalf-bg.png b/smarttv-client/Images/rightHalf-bg.png index 824f3a8..9cb89ac 100644 Binary files a/smarttv-client/Images/rightHalf-bg.png and b/smarttv-client/Images/rightHalf-bg.png differ diff --git a/smarttv-client/Javascript/Config.js b/smarttv-client/Javascript/Config.js index 1aa2f75..a950641 100755 --- a/smarttv-client/Javascript/Config.js +++ b/smarttv-client/Javascript/Config.js @@ -64,17 +64,14 @@ Config.init = function () { // should switch to the config screen here var res = fileSystemObj.createCommonDir(curWidget.id); if (res == true) { - Config.firstLaunch = true; - - Main.init(); // Obsolete? - - Main.changeState(4); + Config.doFirstLaunch(); return; } else { - Main.init(); - Display.showPopup ("ERROR: Cannot create widget folder"); - Main.logToServer("ERROR: Cannot create widget folder curWidget.id= " +curWidget.id); + Config.doFirstLaunch(); +// Main.init(); + Display.showPopup ("WARNING: Cannot create widget folder. Try Config"); +// Main.logToServer("ERROR: Cannot create widget folder curWidget.id= " +curWidget.id); } return; } @@ -86,6 +83,13 @@ Config.init = function () { Config.fetchConfig(); }; +Config.doFirstLaunch = function () { + Config.firstLaunch = true; +// Main.init(); // Obsolete? + + Main.changeState(4); +}; + Config.fetchConfig = function () { if (this.XHRObj == null) { this.XHRObj = new XMLHttpRequest(); @@ -114,6 +118,7 @@ Config.writeContext = function (addr) { }; Config.updateContext = function (addr) { + Main.log("Config.updateContext with ("+addr+")"); var fileSystemObj = new FileSystem(); var fd = fileSystemObj.openCommonFile(Config.cfgFileName,"w"); @@ -123,6 +128,7 @@ Config.updateContext = function (addr) { Config.serverAddr = addr; Config.serverUrl = "http://" + Config.serverAddr; + Config.fetchConfig(); }; Config.readContext = function () { @@ -141,29 +147,28 @@ Config.readContext = function () { Config.serverUrl = "http://" + Config.serverAddr; } else { - Display.showPopup ("WARNING: Error in Config File. Try widget restart."); + Display.showPopup ("ERROR: Error in Config File. Try widget re-install."); // TODO: I should re-write the config file } } fileSystemObj.closeCommonFile(fd); - } catch (e) { - Main.logToServer("Config.readContext: Error while reading: e= " +e); + Main.log("Config.readContext: Error while reading: e= " +e); var res = fileSystemObj.createCommonDir(curWidget.id); if (res == true) { - Main.logToServer("Config.readContext: Widget Folder created"); - Display.showPopup ("Config Read Error: Try widget restart"); + Main.log("WARNING: ConfigRead Error. Launching Config-Menu from here"); + // Display.showPopup ("Config Read Error: Try widget restart"); + } else { - Main.logToServer("Config.readContext: Widget Folder creation failed"); - Display.showPopup ("Config Read Error: Try re-installing the widget"); - Main.log("-------------- Error: res = false ------------------------"); + Main.log("Config.readContext: Widget Folder creation failed"); + + Display.showPopup ("WARNING: ConfigRead Error and WidgetFolder creation failed.
Launching Config-Menu from here"); +// Main.log("-------------- Error: res = false ------------------------"); } + Config.doFirstLaunch(); - Config.firstLaunch = true; - Main.init(); - Main.changeState(4); } }; @@ -219,6 +224,8 @@ Config.processConfig = function () { return; } else { + Config.firstLaunch = false; + Main.log ("Parsing config XML now"); Main.logToServer("Parsing config XML now"); this.format = Config.getXmlString("format"); diff --git a/smarttv-client/Javascript/Data.js b/smarttv-client/Javascript/Data.js index e7049ee..2b95fa7 100755 --- a/smarttv-client/Javascript/Data.js +++ b/smarttv-client/Javascript/Data.js @@ -48,6 +48,10 @@ Data.dumpFolderStruct = function(){ Main.log("---------- dumpFolderStruct Done -------"); }; +Data.findEpgUpdateTime = function() { + return this.assets.findEpgUpdateTime(Display.GetEpochTime() + 10000, "", 0); + // min, guid, level +}; Data.getCurrentItem = function () { return this.folderList[this.folderList.length-1].item; }; @@ -123,6 +127,34 @@ Item.prototype.addChild = function (key, pyld, level) { } }; +Item.prototype.findEpgUpdateTime = function (min, guid, level) { + var prefix= ""; + for (var i = 0; i < level; i++) + prefix += "-"; + + for (var i = 0; i < this.childs.length; i++) { + if (this.childs[i].isFolder == true) { + var res = this.childs[i].findEpgUpdateTime(min, guid, level+1); + min = res.min; + guid = res.guid; + } + else { + var digi =new Date(this.childs[i].payload['start'] * 1000); + var str = digi.getHours() + ":" + digi.getMinutes(); + + Main.log(prefix + "min= " + min+ " start= " + this.childs[i].payload['start'] + " (" + str+ ") title= " + this.childs[i].title); + + if ((this.childs[i].payload['start'] != 0) && ((this.childs[i].payload['start'] + this.childs[i].payload['dur']) < min)) { + min = this.childs[i].payload['start'] + this.childs[i].payload['dur']; + guid = this.childs[i].payload['guid'] ; + Main.log(prefix + "New Min= " + min + " new id= " + guid + " title= " + this.childs[i].title); + } + } + } + + return { "min": min, "guid" : guid}; +}; + Item.prototype.print = function(level) { var prefix= ""; for (var i = 0; i < level; i++) diff --git a/smarttv-client/Javascript/Display.js b/smarttv-client/Javascript/Display.js index 483a141..218f942 100755 --- a/smarttv-client/Javascript/Display.js +++ b/smarttv-client/Javascript/Display.js @@ -49,10 +49,22 @@ Display.init = function() } for (var i = 0; i <= this.LASTIDX; i++) { - var elm = document.getElementById("video"+i); + var elm = $("#video"+i); + $(elm).css({"width" : "100%", "text-align": "left" }); + $(elm).append($("
").css({ "display": "inline-block", "padding-top": "4px", "padding-bottom": "6px", "width":"20%"})); + $(elm).append($("
").css({ "display": "inline-block", "padding-top": "4px", "padding-bottom": "6px", "width":"70%"})); + $(elm).append($("
").css({ "display": "inline-block", "padding-top": "4px", "padding-bottom": "6px", "width":"5%"})); + +/* $(elm).children("div").eq(0).text ("Hallo1"); + $(elm).children("div").eq(1).text ("Hallo2"); + $(elm).children("div").eq(2).text ("Hallo3"); +*/ +/* + * var elm = document.getElementById("video"+i); elm.style.paddingLeft = "10px"; elm.style.paddingTop = "4px"; elm.style.paddingBottom = "6px"; + */ } var done = false; @@ -76,8 +88,15 @@ Display.init = function() return success; }; +Display.setVideoItem = function (elm, cnt) { + // cnt + $(elm).children("div").eq(0).text (cnt.c1); + $(elm).children("div").eq(1).text (cnt.c2); + $(elm).children("div").eq(2).text (cnt.c3); +}; + Display.putInnerHTML = function (elm, val) { - + alert(Config.deviceType + " " +elm + " " + val); switch (Config.deviceType) { case 0: // Samsung specific handling of innerHtml @@ -133,7 +152,7 @@ Display.resetVideoList = function () { break; } Display.unselectItem(elm); - Display.putInnerHTML(elm, ""); + Display.setVideoItem(elm, {c1: "", c2: "", c3: ""}); } }; @@ -276,7 +295,6 @@ Display.handleDescription =function (selected) { var min = Display.getNumString (digi.getMinutes(), 2); var d_str =""; -// Main.log("handleDescription: " +Data.getCurrentItem().childs[selected].payload.desc); var msg = ""; if (Main.state == 1) { // Live @@ -326,19 +344,24 @@ Display.getNumString =function(num, fmt) { }; Display.getDisplayTitle = function(item) { - var res = ""; + var res = {c1:"", c2:"", c3:""}; switch (Main.state) { case 1: // Live - res = item.title; + if (item.isFolder == true) { + res.c2 = item.title; + res.c3 = "<" + Display.getNumString(item.childs.length, 2) +">"; + } + else { + res.c2 = item.title; + } break; case 2: case 3: // Recordings if (item.isFolder == true) { -// res = "<" + Display.getNumString(item.childs.length, 3) + ">-------- " + item.title; - res = "<" + Display.getNumString(item.childs.length, 3) + ">       - " + item.title; - + res.c1 = "<" + Display.getNumString(item.childs.length, 3) + ">"; + res.c2 = item.title; } else { var digi = new Date(parseInt(item.payload.start*1000)); @@ -348,7 +371,8 @@ Display.getDisplayTitle = function(item) { var min = Display.getNumString (digi.getMinutes(), 2); var d_str = mon + "/" + day + " " + hour + ":" + min; - res = d_str + " - " + item.title; + res.c1 = d_str; + res.c2 = item.title; } break; default: @@ -361,7 +385,9 @@ Display.getDisplayTitle = function(item) { Display.setVideoList = function(selected, first) { // var listHTML = ""; - var first_item = selected; + var res = {}; +// var first_item = selected; + var first_item = first; //thlo var i=0; Main.log("Display.setVideoList title= " +Data.getCurrentItem().childs[selected].title + " selected= " + selected + " first_item= " + first_item); @@ -369,15 +395,14 @@ Display.setVideoList = function(selected, first) { for (i = 0; i <= this.LASTIDX; i++) { if ((first_item+i) >= Data.getVideoCount()) { - listHTML = ""; + res = {c1: "", c2: "", c3: ""}; } else { - listHTML = Display.getDisplayTitle (Data.getCurrentItem().childs[first_item+i]); -// Main.log(" - title[first_item+i]= " +Data.getCurrentItem().childs[(first_item +i)].title + " i= " + i + " listHTML= " + listHTML); -// Main.log(" - listHTML= " + listHTML); + res = Display.getDisplayTitle (Data.getCurrentItem().childs[first_item+i]); } this.videoList[i] = document.getElementById("video"+i); - Display.putInnerHTML(this.videoList[i], listHTML); + + Display.setVideoItem(this.videoList[i], res); this.unselectItem(this.videoList[i]); } @@ -414,6 +439,7 @@ Display.unselectItem = function (item) { Display.setVideoListPosition = function(position, move) { var listHTML = ""; +// var res = {}; //thlo: unused? Main.log ("Display.setVideoListPosition title= " +Data.getCurrentItem().childs[position].title + " move= " +move); this.handleDescription(position); @@ -454,9 +480,7 @@ Display.setVideoListPosition = function(position, move) this.currentWindow = this.FIRSTIDX; for(i = 0; i <= this.LASTIDX; i++) { - listHTML = Display.getDisplayTitle (Data.getCurrentItem().childs[i]); -// listHTML = Data.getCurrentItem().childs[i].title; - Display.putInnerHTML(this.videoList[i], listHTML); + Display.setVideoItem(this.videoList[i], Display.getDisplayTitle (Data.getCurrentItem().childs[i])); if(i == this.currentWindow) this.selectItem(this.videoList[i]); @@ -466,9 +490,7 @@ Display.setVideoListPosition = function(position, move) } else { for(i = 0; i <= this.LASTIDX; i++) { - listHTML = Display.getDisplayTitle (Data.getCurrentItem().childs[i + position - this.currentWindow]); -// listHTML = Data.getCurrentItem().childs[i + position - this.currentWindow].title; - Display.putInnerHTML(this.videoList[i], listHTML); + Display.setVideoItem(this.videoList[i], Display.getDisplayTitle (Data.getCurrentItem().childs[i + position - this.currentWindow])); } } } @@ -479,10 +501,7 @@ Display.setVideoListPosition = function(position, move) this.currentWindow = this.LASTIDX; for(i = 0; i <= this.LASTIDX; i++) { - listHTML = Display.getDisplayTitle (Data.getCurrentItem().childs[i + position - this.currentWindow]); -// listHTML = Data.getCurrentItem().childs[i + position - this.currentWindow].title; - Display.putInnerHTML(this.videoList[i], listHTML); - + Display.setVideoItem(this.videoList[i], Display.getDisplayTitle (Data.getCurrentItem().childs[i + position - this.currentWindow])); if(i == this.currentWindow) this.selectItem(this.videoList[i]); else @@ -491,9 +510,7 @@ Display.setVideoListPosition = function(position, move) } else { for(i = 0; i <= this.LASTIDX; i++) { - listHTML = Display.getDisplayTitle (Data.getCurrentItem().childs[i + position]); -// listHTML = Data.getCurrentItem().childs[i + position].title; - Display.putInnerHTML(this.videoList[i], listHTML); + Display.setVideoItem(this.videoList[i], Display.getDisplayTitle (Data.getCurrentItem().childs[i + position])); } } } diff --git a/smarttv-client/Javascript/Epg.js b/smarttv-client/Javascript/Epg.js new file mode 100644 index 0000000..c400e0e --- /dev/null +++ b/smarttv-client/Javascript/Epg.js @@ -0,0 +1,41 @@ +/* + * Principle: One monitor for each channel + * Nur max 20 + * Oder einer: + * Search once through all entries and look for the lowest expiry. + * Set a timer to update the entry + * check, whether the entry is "on screen" + * +*/ + +var Epg = { + restfulUrl : "" + +}; + +// Should be called after initial config +Epg.init = function () { + if (Config.serverUrl == "") + return; + if (Config.serverUrl.indexOf(':') != -1) { + Main.log ("Epg: Serverurl= " + Config.serverUrl); + this.restfulUrl = Config.serverUrl.splice(0, Config.serverUrl.indexOf(':')) + ":8002"; + } + + Main.log ("Restful API Url= "+ this.restfulUrl); + + $.ajax({ + type: "HEAD", + async: true, + url: this.restfulUrl + "channels.xml", + success: function(message,text,response){ + Main.log("AJAX Response: MSG= " + message + " txt= " + text + " resp= " + response); + } + }); +}; + +Epg.startEpgUpdating = function() { + + var res = Data.findEpgUpdateTime(); + Main.log("GUID= " + res.guid + " Min= " + res.min); +}; \ No newline at end of file diff --git a/smarttv-client/Javascript/Helpbar.js b/smarttv-client/Javascript/Helpbar.js new file mode 100644 index 0000000..0196d78 --- /dev/null +++ b/smarttv-client/Javascript/Helpbar.js @@ -0,0 +1,58 @@ + +var Helpbar = { + isInited : false +}; + +Helpbar.init = function () { + if (this.isInited == false) { + Helpbar.createHelpbar(); + Helpbar.hide(); + } +}; + +Helpbar.show = function () { + $("#helpbar").show(); +}; + +Helpbar.hide = function () { + $("#helpbar").hide(); +}; + +Helpbar.createHelpbar = function() { + this.isInited = true; + var sheet = $("