summaryrefslogtreecommitdiff
path: root/smarttv-client/Javascript/OverlayMenu.js
diff options
context:
space:
mode:
authorthlo <smarttv640@gmail.com>2014-06-09 12:56:48 +0200
committerthlo <smarttv640@gmail.com>2014-06-09 12:56:48 +0200
commit478222ca3bee5e20432dcc052a74e955d3fa255a (patch)
tree618002e1c41fa1143eaf0b669723a32f016d2041 /smarttv-client/Javascript/OverlayMenu.js
parent1f4c5de1370cacfb1b514d833860c372c3ff3767 (diff)
downloadvdr-plugin-smarttvweb-478222ca3bee5e20432dcc052a74e955d3fa255a.tar.gz
vdr-plugin-smarttvweb-478222ca3bee5e20432dcc052a74e955d3fa255a.tar.bz2
* Time zone and no time source issue fixedWv1.00Pv1.00
* Commands Menu Entry (when enabled in plugin) * Fix of sorting bug (blue key in recordings) * Improved buffering tuning for Live * Fixes with respect to using HLS for Recordings * Touch Remote Control support * New 21:9 crop (picture size key) * Making additional notifications (such as Recording has finished) optional * Show Language Code for Audio Track Select * Bug Fixes
Diffstat (limited to 'smarttv-client/Javascript/OverlayMenu.js')
-rw-r--r--smarttv-client/Javascript/OverlayMenu.js69
1 files changed, 65 insertions, 4 deletions
diff --git a/smarttv-client/Javascript/OverlayMenu.js b/smarttv-client/Javascript/OverlayMenu.js
index 64a7eba..b337c8a 100644
--- a/smarttv-client/Javascript/OverlayMenu.js
+++ b/smarttv-client/Javascript/OverlayMenu.js
@@ -1,7 +1,8 @@
var OverlayMenu = {
menu : [],
scrollDur : 300,
- scrollFlip : 100
+ scrollFlip : 100,
+ returnCallback : null
};
OverlayMenu.init = function () {
@@ -42,7 +43,7 @@ OverlayMenu.hide = function() {
$(this.inputElm).blur();
$("#ovlTable").remove();
Main.enableKeys();
-
+
};
OverlayMenu.createStyleSheet = function () {
@@ -210,6 +211,7 @@ OverlayMenu.createHelpItem = function(url, msg) {
OverlayMenu.reset = function () {
+ this.returnCallback = null;
this.btnSelected = 0;
for (var i =0; i <= OverlayMenu.menu.length; i++) {
$(this.elmName + i).removeClass('ovlmn-itm-selected').addClass('ovl-itm');
@@ -295,8 +297,13 @@ OverlayMenu.onInput = function () {
case tvKey.KEY_RETURN:
case tvKey.KEY_EXIT:
OverlayMenu.hide();
- if (this.returnCallback != null)
- this.returnCallback();
+ Main.log("OverlayMenu.onInput -> Exit");
+
+ if (Main.state == Main.eCMDS)
+ Main.changeState(0);
+
+ if (OverlayMenu.returnCallback != null)
+ OverlayMenu.returnCallback();
break;
}
@@ -374,3 +381,57 @@ RecCmdHandler.selectCallback = function (idx) {
Server.execRecCmd(RecCmds.getCurrentItem().childs[idx].payload.cmd, RecCmdHandler.guid);
}
};
+
+
+//-----------------------------------------------------------------------
+var CmdHandler = {
+ guid : ""
+};
+
+
+CmdHandler.showMenu = function (guid) {
+ this.guid = guid;
+ RecCmds.reset();
+ Server.fetchCmdsList(); // calls RecCmdHandler.createRecCmdOverlay() when finished
+ OverlayMenu.reset();
+ OverlayMenu.menu = [];
+
+};
+
+CmdHandler.fillMenuArray = function () {
+ for (var i = 0; i < RecCmds.getVideoCount(); i++) {
+ var self = this;
+ OverlayMenu.menu.push ({title: RecCmds.getCurrentItem().childs[i].title, func : function (idx) { self.selectCallback(idx); } });
+ }
+
+};
+
+CmdHandler.createCmdOverlay = function () {
+ //called, when Server.fetchRecCmdsList() is finished.
+ Main.log("CmdHandler.createCmdOverlay for guid " + CmdHandler.guid);
+ Main.logToServer("CmdHandler.createCmdOverlay for guid " + CmdHandler.guid);
+ if (RecCmds.getVideoCount()== 0) {
+ Main.log("CmdHandler.createCmdOverlay: RecCmds is empty" );
+ Main.logToServer("CmdHandler.createCmdOverlay: RecCmds is empty" );
+ return;
+ }
+ CmdHandler.fillMenuArray();
+
+ OverlayMenu.show();
+};
+
+CmdHandler.selectCallback = function (idx) {
+ Main.logToServer("CmdHandler.selectCallback idx= " + idx + " t= " + RecCmds.getCurrentItem().childs[idx].title);
+ if (RecCmds.getCurrentItem().childs[idx].isFolder == true) {
+ Main.logToServer("CmdHandler.selectCallback isFolder");
+ RecCmds.selectFolder(idx, 0);
+
+ OverlayMenu.reset();
+ OverlayMenu.menu = [];
+ CmdHandler.fillMenuArray();
+ }
+ else {
+ Main.logToServer("CmdHandler.selectCallback idx= " + idx + " cmd= " + RecCmds.getCurrentItem().childs[idx].payload.cmd);
+ Server.execCmd(RecCmds.getCurrentItem().childs[idx].payload.cmd);
+ }
+};