From: Jaroslav Kysela Date: Thu, 5 May 2016 14:03:14 +0000 (+0200) Subject: webui: replace 'Play' text with the play image for channels / services / DVR, cleanups X-Git-Tag: v4.2.1~572 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb067e2e047f64f82df9e248270c052140028d8a;p=thirdparty%2Ftvheadend.git webui: replace 'Play' text with the play image for channels / services / DVR, cleanups --- diff --git a/src/webui/static/app/chconf.js b/src/webui/static/app/chconf.js index 6c9aae0c2..34ab1d80f 100644 --- a/src/webui/static/app/chconf.js +++ b/src/webui/static/app/chconf.js @@ -234,8 +234,7 @@ tvheadend.channel_tab = function(panel, index) if (r.data['number']) title += r.data['number'] + ' : '; title += r.data['name']; - return "" + _('Play') + ""; + return tvheadend.playLink('play/stream/channel/' + r.id, title); } } ], diff --git a/src/webui/static/app/dvr.js b/src/webui/static/app/dvr.js index 633161c86..1da74d23f 100644 --- a/src/webui/static/app/dvr.js +++ b/src/webui/static/app/dvr.js @@ -451,8 +451,7 @@ tvheadend.dvr_finished = function(panel, index) { var title = r.data['disp_title']; if (r.data['episode']) title += ' / ' + r.data['episode']; - return '' + _('Play') + ''; + return tvheadend.playLink('play/dvrfile/' + r.id, title); } }], tbar: [downloadButton, rerecordButton, moveButton], @@ -589,8 +588,7 @@ tvheadend.dvr_failed = function(panel, index) { var title = r.data['disp_title']; if (r.data['episode']) title += ' / ' + r.data['episode']; - return '' + _('Play') + ''; + return tvheadend.playLink('play/dvrfile/' + r.id, title); } }], tbar: [downloadButton, rerecordButton, moveButton], diff --git a/src/webui/static/app/ext.css b/src/webui/static/app/ext.css index 86a9069c1..b1a5b6ad4 100644 --- a/src/webui/static/app/ext.css +++ b/src/webui/static/app/ext.css @@ -984,6 +984,13 @@ font-weight: bold; } +.playlink { + margin: -1px; + width: 14px; + height: 14px; + cursor: pointer; +} + /** vim: ts=4:sw=4:nu:fdc=4:nospell * * Ext.ux.grid.RowActions.css diff --git a/src/webui/static/app/mpegts.js b/src/webui/static/app/mpegts.js index cc6664092..18bab39ff 100644 --- a/src/webui/static/app/mpegts.js +++ b/src/webui/static/app/mpegts.js @@ -121,9 +121,12 @@ tvheadend.muxes = function(panel, index) header: _('Play'), tooltip: _('Play'), renderer: function(v, o, r) { - var title = r.data['name'] + ' / ' + r.data['network']; - return "" + _("Play") + ""; + var title = r.data['name']; + if (r.data['network']) { + if (title) title += ' / '; + title += r.data['network']; + } + return tvheadend.playLink('play/stream/mux/' + r.id, title); } } ], @@ -317,9 +320,12 @@ tvheadend.services = function(panel, index) header: _('Play'), tooltip: _('Play'), renderer: function(v, o, r) { - var title = r.data['svcname'] + ' / ' + r.data['provider']; - return "" + _('Play') + ""; + var title = r.data['svcname']; + if (r.data['provider']) { + if (title) title += ' / '; + title += r.data['provider']; + } + return tvheadend.playLink('play/stream/service/' + r.id, title); } }, { diff --git a/src/webui/static/app/tvheadend.js b/src/webui/static/app/tvheadend.js index bb73a61e4..988827924 100644 --- a/src/webui/static/app/tvheadend.js +++ b/src/webui/static/app/tvheadend.js @@ -417,6 +417,16 @@ tvheadend.niceDate = function(dt) { '
' + d.toLocaleTimeString() + '
'; } +/* + * + */ +tvheadend.playLink = function(link, title) { + if (title) title = '?title=' + encodeURIComponent(title); + return '' + + '' + _('Play') + ''; +} + /** * Displays a mediaplayer using the html5 video element */