From: Jaroslav Kysela Date: Mon, 26 Oct 2015 15:18:35 +0000 (+0100) Subject: WEBUI: Fix the top information (CSV parsing) X-Git-Tag: v4.2.1~1762 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f61e2597bafea73892543b7e121198972fbff661;p=thirdparty%2Ftvheadend.git WEBUI: Fix the top information (CSV parsing) --- diff --git a/src/webui/static/app/tvheadend.js b/src/webui/static/app/tvheadend.js index 9060aac22..f36d058ea 100644 --- a/src/webui/static/app/tvheadend.js +++ b/src/webui/static/app/tvheadend.js @@ -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])