]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
WEBUI: Fix the top information (CSV parsing)
authorJaroslav Kysela <perex@perex.cz>
Mon, 26 Oct 2015 15:18:35 +0000 (16:18 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 26 Oct 2015 15:18:35 +0000 (16:18 +0100)
src/webui/static/app/tvheadend.js

index 9060aac2229de5ef3ff54fc60a2d405e8e7fbd24..f36d058ea9e831fd305e468c2c2f0fc655756f4e 100644 (file)
@@ -15,6 +15,19 @@ tvheadend.regexEscape = function(s) {
     return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
 }
 
+tvheadend.fromCSV = function(s) {
+  var a = s.split(',');
+  var r = [];
+  for (var i in a) {
+    var v = a[i];
+    if (v[0] == '"' && v[v.length-1] == '"')
+      r.push(v.substring(1, v.length - 1));
+    else
+      r.push(v);
+  }
+  return r;
+}
+
 /**
  * Displays a help popup window
  */
@@ -627,7 +640,7 @@ tvheadend.RootTabPanel = Ext.extend(Ext.TabPanel, {
     },
 
     setInfoArea: function(info_area) {
-        this.info_area = info_area.split(',');
+        this.info_area = tvheadend.fromCSV(info_area);
         this.on('beforetabchange', function(tp, p) {
             for (var k in this.extra)
                 if (p == this.extra[k])