Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI JS: EPG - moved IMDB search to a button, add play button handler
  • Loading branch information
perexg committed Oct 31, 2014
1 parent e8d0cad commit c053acd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
33 changes: 23 additions & 10 deletions src/webui/static/app/epg.js
Expand Up @@ -120,19 +120,10 @@ tvheadend.epgDetails = function(event) {
content += '<div class="x-epg-meta">Content Type: ' + genre.join(', ') + '</div>';
}

content += '<div class="x-epg-action"><a target="_blank" href="http://akas.imdb.com/find?q=' + event.title + '">Search IMDB</a></div>';
content += '<div id="related"></div>';
content += '<div id="altbcast"></div>';

now = new Date();
if (event.start < now && event.stop > now) {
var title = event.title;
if (event.episodeOnscreen)
title += ' / ' + event.episodeOnscreen;
content += '<div class="x-epg-action"><a href="play/stream/channel/' + event.channelUuid +
'?title=' + encodeURIComponent(title) + '">Play</a></div>';
}

var now = new Date();
var buttons = [];

if (tvheadend.accessUpdate.dvr) {
Expand All @@ -155,6 +146,15 @@ tvheadend.epgDetails = function(event) {
store.load();

buttons.push(new Ext.Button({
disabled: !event.title,
handler: searchIMDB,
iconCls: 'find',
tooltip: 'Search IMDB (for title)',
text: "Search IMDB"
}));

buttons.push(new Ext.Button({
disabled: event.start > now || event.stop < now,
handler: playProgram,
iconCls: 'control_play',
tooltip: 'Play this program',
Expand Down Expand Up @@ -211,6 +211,19 @@ tvheadend.epgDetails = function(event) {
});
win.show();

function searchIMDB() {
window.open('http://akas.imdb.com/find?q=' +
encodeURIComponent(event.title), '_blank');
}

function playProgram() {
var title = event.title;
if (event.episodeOnscreen)
title += ' / ' + event.episodeOnscreen;
window.open('play/stream/channel/' + event.channelUuid +
'?title=' + encodeURIComponent(title), '_blank');
}

function recordEvent() {
record('api/dvr/entry/create_by_event');
}
Expand Down
4 changes: 4 additions & 0 deletions src/webui/static/app/ext.css
Expand Up @@ -154,6 +154,10 @@
font-style: italic;
}

.find {
background-image: url(../icons/find.png) !important;
}

.add {
background-image: url(../icons/add.png) !important;
}
Expand Down
1 change: 1 addition & 0 deletions src/webui/static/icons/find.png

1 comment on commit c053acd

@nurtext
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.