Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI JS: Improved the EPG details dialog
- moved play / search IMBD outside DVR condition
- added stop DVR button (if applicable)
  • Loading branch information
perexg committed Nov 7, 2014
1 parent e012bf8 commit 94daa8b
Showing 1 changed file with 42 additions and 16 deletions.
58 changes: 42 additions & 16 deletions src/webui/static/app/epg.js
Expand Up @@ -125,6 +125,25 @@ tvheadend.epgDetails = function(event) {

var now = new Date();
var buttons = [];
var recording = event.dvrState.indexOf('recording') == 0;

if (!recording) {
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',
text: "Play program"
}));

if (tvheadend.accessUpdate.dvr) {

Expand All @@ -145,22 +164,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"
}));
if (recording) {
buttons.push(new Ext.Button({
handler: stopDVR,
iconCls: 'cancel',
tooltip: 'Stop recording of this program',
text: "Stop DVR"
}));
}

buttons.push(new Ext.Button({
disabled: event.start > now || event.stop < now,
handler: playProgram,
iconCls: 'control_play',
tooltip: 'Play this program',
text: "Play program"
}));

var confcombo = new Ext.form.ComboBox({
store: store,
triggerAction: 'all',
Expand All @@ -178,7 +190,7 @@ tvheadend.epgDetails = function(event) {
handler: recordEvent,
iconCls: 'rec',
tooltip: 'Record now this program',
text: "Record program"
text: 'Record program'
}));
buttons.push(new Ext.Button({
handler: recordSeries,
Expand All @@ -195,6 +207,7 @@ tvheadend.epgDetails = function(event) {
handler: function() { win.close(); },
text: "Close"
}));

}

var win = new Ext.Window({
Expand Down Expand Up @@ -232,6 +245,18 @@ tvheadend.epgDetails = function(event) {
record('api/dvr/autorec/create_by_series');
}

function stopDVR() {
tvheadend.AjaxConfirm({
url: 'api/idnode/delete',
params: {
uuid: event.dvrUuid,
},
success: function(d) {
win.close();
}
});
}

function record(url) {
Ext.Ajax.request({
url: url,
Expand Down Expand Up @@ -303,6 +328,7 @@ tvheadend.epg = function() {
{ name: 'starRating' },
{ name: 'ageRating' },
{ name: 'genre' },
{ name: 'dvrUuid' },
{ name: 'dvrState' },
{ name: 'serieslinkId' }
])
Expand Down

0 comments on commit 94daa8b

Please sign in to comment.