diff options
author | thlo <t.lohmar@gmx.de> | 2013-03-17 11:34:56 +0100 |
---|---|---|
committer | thlo <t.lohmar@gmx.de> | 2013-03-17 11:34:56 +0100 |
commit | ec487342e840d92dbe556a5cede0073d11fb2862 (patch) | |
tree | 21a8a46d1ffd747bedd79ef6f790d8b6c7b966dd /smarttv-client/Javascript/Timers.js | |
parent | 73c9e696423fa6826d381b6beb9cf2f3f39852ce (diff) | |
download | vdr-plugin-smarttvweb-ec487342e840d92dbe556a5cede0073d11fb2862.tar.gz vdr-plugin-smarttvweb-ec487342e840d92dbe556a5cede0073d11fb2862.tar.bz2 |
Widget v0.92:
* Widget version number on select screen.
* Configurable timeout for direct access.
* Direct access takes first digit.
* Pause-Key toggles between pause and play.
* First version of info overlay.
* Bug fixes.
Diffstat (limited to 'smarttv-client/Javascript/Timers.js')
-rw-r--r-- | smarttv-client/Javascript/Timers.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/smarttv-client/Javascript/Timers.js b/smarttv-client/Javascript/Timers.js new file mode 100644 index 0000000..c7110c7 --- /dev/null +++ b/smarttv-client/Javascript/Timers.js @@ -0,0 +1,64 @@ +var Timers = {
+ haveRapi : false,
+ timerList : {}
+};
+
+Timers.init = function() {
+ var url = "http://192.168.1.122:8002/info.xml";
+ $.ajax({
+ url: url,
+ type : "GET",
+ success : function(data, status, XHR ) {
+ Timers.haveRapi = true;
+ Main.log ("Timers: Got response");
+ Timers.readTimers();
+
+ },
+ error : function (jqXHR, status, error) {
+ Timers.haveRapi = false;
+ Main.log ("Timers: Not found!!!");
+ }
+ });
+};
+
+Timers.readTimers = function () {
+ if (Timers.haveRapi == false) {
+ Main.log ("Timers.readTimers: no restful API!!!");
+ return;
+ }
+ var url = "http://192.168.1.122:8002/timers.xml";
+ $.ajax({
+ url: url,
+ type : "GET",
+ success : function(data, status, XHR ) {
+ Main.log ("Timers.readTimer: Success");
+ Main.log(" Count= " + $(data).find("count").text());
+ $(data).find("timer").each(function () {
+ Main.log("timer: ");
+ Timers.curItem = {};
+ $(this).find("param").each(function () {
+ Main.log(" + " + $(this).attr("name") + " val= " +$(this).text());
+ Timers.curItem[$(this).attr("name")] = $(this).text();
+ });
+/* for (var prop in Timers.curItem) {
+ Main.log (" -" + prop + " : " + Timers.curItem[prop]);
+ }
+ */
+ Main.log("Adding id " +Timers.curItem["id"]);
+ Timers.timerList[Timers.curItem["id"]] = Timers.curItem;
+ Timers.curItem = {};
+ });
+ Main.log("Summary");
+ for (var id in Timers.timerList) {
+ Main.log (id + " : ");
+ for (var prop in Timers.timerList[id]) {
+ Main.log (" - " + prop + " : " + Timers.timerList[id][prop]);
+ }
+
+ }
+ },
+ error : function (jqXHR, status, error) {
+ Main.log ("Timers.readTimer: Failure");
+ }
+ });
+};
\ No newline at end of file |