summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM. Voerman <rekordc@gmail.com>2014-08-10 14:26:07 +0200
committerM. Voerman <rekordc@gmail.com>2014-08-10 14:26:07 +0200
commit4a1aafd810036d069636aa598e1de2fe27587f2d (patch)
tree29014cb02c8f3e17c43e0e8e1e1798eb64d92695
parent9bfe33fff538a3c0b36d1c35afee39287d7e34d0 (diff)
downloadvdr-vipclient-4a1aafd810036d069636aa598e1de2fe27587f2d.tar.gz
vdr-vipclient-4a1aafd810036d069636aa598e1de2fe27587f2d.tar.bz2
fix for [undefined] in server (search)timers menu
-rw-r--r--History3
-rw-r--r--index.html32
-rw-r--r--settings.js2
3 files changed, 23 insertions, 14 deletions
diff --git a/History b/History
index c80aca9..5adc8c2 100644
--- a/History
+++ b/History
@@ -3,6 +3,9 @@ Motorola Vip : 1960, 1910, 1903, 1963.
VDR 1.7.29+
+0.26 Fix for [undefined] in (search)timer menu when there are no (search)timers on server
+
+
0.25 Get recordings from Streamdev, Restfulapi or SmartTVweb.
Check if SmartTVweb is on the server if not turn SmartTVweb options off
Check if Restfulapi is on the server if not turn Restfulapi options off
diff --git a/index.html b/index.html
index 44bb9aa..c7f32b5 100644
--- a/index.html
+++ b/index.html
@@ -3111,10 +3111,11 @@ try {
xmlDoc=xmlhttp.responseXML;
var x=xmlDoc.getElementsByTagName("timer");
maxTimers = x.length;
- timers.length = 0; // clear timers[i] tries to clear crap if current x.length < previous x.length
- for (var i=0;i<x.length;i++)
+ timers.length = 0; // clear timers[i] tries to clear crap if current x.length < previous x.length
+ if (x.length > 0) {
+ for (var i=0;i<x.length;i++)
{
- var fill = "\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003";
+ var fill = "\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003";
timersFlag[i] = x[i].getElementsByTagName("flags")[0].childNodes[0].nodeValue;
timersStrt[i] = Right("000" + x[i].getElementsByTagName("start")[0].childNodes[0].nodeValue,4);
timersStop[i] = Right("000" + x[i].getElementsByTagName("stop")[0].childNodes[0].nodeValue,4);
@@ -3139,8 +3140,9 @@ try {
}
timers[i] += timersDays[i] + "\uE003" + timersStrt[i] + "\uE003" + timersStop[i] + "\uE003" + Left(timersName[i],8) + "\uE003" + Left(timersFile[i],15) + "\n" ;
- timerOK = 1;
- }
+ }
+ }
+ timerOK = 1;
} else if (get_timer == 0) {
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET",(server_ip + RestFulAPI + "/timers.xml"),false); // ?" + new Date().getTime()),false);
@@ -3148,7 +3150,9 @@ try {
xmlDoc=xmlhttp.responseXML;
var x=xmlDoc.getElementsByTagName("timer");
maxTimers = x.length;
- for (var i=0;i<x.length;i++)
+ timers.length = 0; // clear timers[i] tries to clear crap if current x.length < previous x.length
+ if (x.length > 0) {
+ for (var i=0;i<x.length;i++)
{
var fill = "\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003";
timersID[i] = x[i].getElementsByTagName("param")[0].childNodes[0].nodeValue;
@@ -3173,9 +3177,9 @@ try {
timers[i] = "\uE003\uE003\uE003";
}
timers[i] += timersDays[i] + "\uE003" + timersStrt[i] + "\uE003" + timersStop[i] + "\uE003" + Left(timersName[i],8) + "\uE003" + Left(timersFile[i],15) + "\n" ;
- timerOK = 1;
- }
-
+ }
+ }
+ timerOK = 1;
}
} catch(e) {
timerOK = 0;
@@ -3272,10 +3276,11 @@ try {
xmlDoc=xmlhttp.responseXML;
var x=xmlDoc.getElementsByTagName("searchtimer");
maxTimers = x.length;
- searchtimers.length = 0; // clear timers[i] tries to clear crap if current x.length < previous x.length
- for (var i=0;i<x.length;i++)
+ searchtimers.length = 0; // clear timers[i] tries to clear crap if current x.length < previous x.length
+ if (x.length > 0) {
+ for (var i=0;i<x.length;i++)
{
- var fill = "\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003";
+ var fill = "\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003\uE003";
searchtimersID[i] = x[i].getElementsByTagName("id")[0].childNodes[0].nodeValue;
searchtimersSearch[i] = x[i].getElementsByTagName("search")[0].childNodes[0].nodeValue;
searchtimersFlag[i] = x[i].getElementsByTagName("use_as_searchtimer")[0].childNodes[0].nodeValue;
@@ -3332,8 +3337,9 @@ try {
searchtimers[i] += searchtimersSearch[i] + "\uE003\uE003\n" ;
+ }
timerOK = 1;
- }
+ }
} catch(e) {
timerOK = 0;
alert("Get SearchTimers problem: " + e);
diff --git a/settings.js b/settings.js
index 7a5b454..afc8fdc 100644
--- a/settings.js
+++ b/settings.js
@@ -2,7 +2,7 @@
// Default settings
//
-var Version = "0.25";
+var Version = "0.26.1";
server_ip_array = new Array("http://192.168.1.15","http://192.168.3.15","http://easyvdr","http://192.168.3.100","http://192.168.178.19","http://192.168.1.21","http://192.168.2.100","http://192.168.178.52");