diff --git a/src/webui/static/app/dvr.js b/src/webui/static/app/dvr.js index c6e6725..9bc3792 100644 --- a/src/webui/static/app/dvr.js +++ b/src/webui/static/app/dvr.js @@ -5,6 +5,32 @@ /** * */ + +// Function to support some of the label formatting used with kodi +tvheadend.labelFormatting = function(description) { + return description.replace(/\[COLOR\s(.*?)\]/g, '') + .replace(/\[\/COLOR\]/g, '<\/font>') + .replace(/\[B\]/g, '') + .replace(/\[\/B\]/g, '<\/b>') + .replace(/\[I\]/g, '') + .replace(/\[CR\]/g, '
') + .replace(/\[\/I\]/g, '<\/i>') + //.replace(/(?<=\[UPPERCASE\])(.*)(?=\[\/UPPERCASE\])/g, function(match) {return match.toUpperCase();}) // Only work with Chrome + .replace(/\[UPPERCASE\](.*)\[\/UPPERCASE\]/g, function(match) {return match.toUpperCase();}) + .replace(/\[UPPERCASE\]/g, '') + .replace(/\[\/UPPERCASE\]/g, '') + //.replace(/(?<=\[LOWERCASE\])(.*)(?=\[\/LOWERCASE\])/g, function(match) {return match.toLowerCase();}) // Only work with Chrome + //.replace(/\[LOWERCASE\]/g, '') + //.replace(/\[\/LOWERCASE\]/g, '') + .replace(/\[LOWERCASE\](.*)\[\/LOWERCASE\]/g, function(match) {return match.toLowerCase();}) + .replace(/\[lowercase\]/g, '') + .replace(/\[\/lowercase\]/g, '') + //.replace(/(?<=\[CAPITALIZE\])(.*)(?=\[\/CAPITALIZE\])/g, function(match) {return match.split(/\s+/).map(w => w[0].toUpperCase() + w.slice(1)).join(' ');}) // Only work with Chrome + .replace(/\[CAPITALIZE\](.*)\[\/CAPITALIZE\]/g, function(match) {return match.split(/\s+/).map(w => w[0].toUpperCase() + w.slice(1)).join(' ');}) + .replace(/\[CAPITALIZE\]/g, '') + .replace(/\[\/CAPITALIZE\]/g, ''); +}; + tvheadend.dvrDetails = function(uuid) { function showit(d) { @@ -79,7 +105,7 @@ tvheadend.dvrDetails = function(uuid) { if (summary && (!subtitle || subtitle != summary)) content += '
' + summary + '
'; if (desc) { - content += '
' + desc + '
'; + content += '
' + tvheadend.labelFormatting(desc) + '
'; content += '
'; } content += tvheadend.getDisplayCredits(credits); @@ -124,14 +150,17 @@ tvheadend.dvrDetails = function(uuid) { encodeURIComponent(title)+'&searchseriesid=&tab=listseries&function=Search','_blank'); } + var windowHeight = Ext.getBody().getViewSize().height - 100; + var win = new Ext.Window({ title: title, iconCls: 'info', layout: 'fit', width: 650, - height: 450, + height: windowHeight, //450 constrainHeader: true, buttonAlign: 'center', + autoScroll: true, buttons: buttons, html: content }); diff --git a/src/webui/static/app/epg.js b/src/webui/static/app/epg.js index 597bda4..7eeaaf2 100644 --- a/src/webui/static/app/epg.js +++ b/src/webui/static/app/epg.js @@ -152,7 +152,7 @@ tvheadend.epgDetails = function(event) { if (event.summary) content += '
' + event.summary + '
'; if (event.description) - content += '
' + event.description + '
'; + content += '
' + tvheadend.labelFormatting(event.description) + '
'; if (event.summary || event.description) content += '
'; content += tvheadend.getDisplayCredits(event.credits); @@ -304,12 +304,14 @@ tvheadend.epgDetails = function(event) { } + var windowHeight = Ext.getBody().getViewSize().height - 100; + var win = new Ext.Window({ title: _('Broadcast Details'), iconCls: 'broadcast_details', layout: 'fit', width: 675, - height: 450, + height: windowHeight, //450 constrainHeader: true, buttons: buttons, buttonAlign: 'center',