From 68de2c4bdab84ae56ddad0db48c48b40f0ca536c Mon Sep 17 00:00:00 2001 From: thlo Date: Tue, 27 Aug 2013 22:08:08 +0200 Subject: New Overlay Menu for RecCmd Handling Make YouTube entry optional (Select Screen option is configurable through widget.conf) First 3D iter function for 3D TVs and 3D BDs. --- smarttv-client/Javascript/Data.js | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'smarttv-client/Javascript/Data.js') diff --git a/smarttv-client/Javascript/Data.js b/smarttv-client/Javascript/Data.js index d2673fe..7933de6 100755 --- a/smarttv-client/Javascript/Data.js +++ b/smarttv-client/Javascript/Data.js @@ -112,6 +112,66 @@ Data.getVideoCount = function() { Data.deleteElm = function (pos) { Data.getCurrentItem().childs.remove(pos); }; + +//-------------------------------------------------- +//--------------------- RecCmds -------------------- +//-------------------------------------------------- + +var RecCmds = { + cmds : new Item, + folderList : [], +}; + +RecCmds.reset = function() { + this.cmds = null; + this.cmds = new Item; + this.folderList = []; + Main.log("RecCmds.reset: folderList.push. this.folderList.length= " + this.folderList.length); +}; + +RecCmds.completed= function() { + this.folderList.push({item : this.cmds, id: 0}); + Main.log("---------- completed ------------"); + Main.log("RecCmds.completed: Data.folderList.length= " + this.folderList.length); +}; + +RecCmds.selectFolder = function (idx, first_idx) { + this.folderList.push({item : this.getCurrentItem().childs[idx], id: idx, first:first_idx}); + Main.log("RecCmds.selectFolder: folderList.push. this.folderList.length= " + this.folderList.length); +}; + +RecCmds.folderUp = function () { + itm = this.folderList.pop(); + Main.log("RecCmds.folderUp: folderList.pop. this.folderList.length= " + this.folderList.length); + return itm; +}; + +RecCmds.isRootFolder = function() { + Main.log("RecCmds.isRootFolder: this.folderList.length= " + this.folderList.length); + if (this.folderList.length == 1) + return true; + else + return false; +}; + +RecCmds.addItem = function(t_list, pyld) { + this.cmds.addChild(t_list, pyld, 0); +}; + +RecCmds.dumpFolderStruct = function(){ + Main.log("---------- RecCmds.dumpFolderStruct ------------"); + this.cmds.print(0); + Main.log("---------- RecCmds.dumpFolderStruct Done -------"); +}; + +RecCmds.getCurrentItem = function () { + return this.folderList[this.folderList.length-1].item; +}; + +RecCmds.getVideoCount = function() { + return this.folderList[this.folderList.length-1].item.childs.length; +}; + //----------------------------------------- function Item() { this.title = "root"; -- cgit v1.2.3