});
} // load
- function previousEvent(b, e) {
- --current_index;
- load(store,current_index,updateit);
- }
- function nextEvent(b, e) {
- ++current_index;
- var cbWin = b.findParentByType(Ext.Window);
- load(store,current_index,updateit);
- }
- function dvrAlternativeShowings(eventId) {
- var store = getAlternativeShowingsStore(eventId);
-
- var detailsfcn = function(grid, rec, act, row) {
- var store = grid.getStore();
- var event = store.getAt(row);
- var data = event.data;
- new tvheadend.epgDetails(grid, row);
- };
-
- var eventdetails = new Ext.ux.grid.RowActions({
- id: 'details',
- header: _('Details'),
- tooltip: _('Details'),
- width: 67,
- dataIndex: 'actions',
- callbacks: {
- 'recording': detailsfcn,
- 'recordingError': detailsfcn,
- 'scheduled': detailsfcn,
- 'completed': detailsfcn,
- 'completedError': detailsfcn
- },
- actions: [
- {
- iconCls: 'broadcast_details',
- qtip: _('Broadcast details'),
- cb: detailsfcn
- },
- {
- iconIndex: 'dvrState'
- }
- ]
- });
-
- var epgView = new Ext.ux.grid.livegrid.GridView({
- nearLimit: 100,
- loadMask: {
- msg: _('Buffering. Please wait…')
- },
- });
-
- var grid = new Ext.ux.grid.livegrid.GridPanel({
- store: store,
- plugins: [eventdetails],
- iconCls: 'epg',
- view: epgView,
- cm: new Ext.grid.ColumnModel({
- columns: [
- eventdetails,
- {
- width: 250,
- id: 'title',
- header: _("Title"),
- tooltip: _("Title"),
- dataIndex: 'title',
- },
- {
- width: 250,
- id: 'extratext',
- header: _("Extra text"),
- tooltip: _("Extra text: subtitle or summary or description"),
- dataIndex: 'extratext',
- renderer: dvrRenderExtraText
- },
- {
- width: 200,
- id: 'start',
- header: _("Start Time"),
- tooltip: _("Start Time"),
- dataIndex: 'start',
- renderer: dvrRenderDate
- },
- {
- width: 200,
- id: 'stop',
- header: _("End Time"),
- tooltip: _("End Time"),
- dataIndex: 'stop',
- renderer: dvrRenderDate
- },
- {
- width: 250,
- id: 'channelName',
- header: _("Channel"),
- tooltip: _("Channel"),
- dataIndex: 'channelName',
- },
- ],
- }),
- }); // grid
-
-
- var windowHeight = Ext.getBody().getViewSize().height - 150;
-
- win = new Ext.Window({
- title: 'Alternative Showings',
- iconCls: 'info',
- layout: 'fit',
- width: 1200,
- height: windowHeight,
- constrainHeader: true,
- buttonAlign: 'center',
- autoScroll: true,
- items: grid,
- });
- // Handle comet updates until user closes dialog.
- var update = function(m) {
- tvheadend.epgCometUpdate(m, store);
- };
- tvheadend.comet.on('epg', update);
- win.on('close', function(panel, opts) {
- tvheadend.comet.un('epg', update);
- });
-
- win.show();
- updateDialogFanart(d);
- checkButtonAvailability(win.fbar)
- }
-
- function load(store, index, cb) {
- var uuid = store.getAt(index).id;
- tvheadend.loading(1);
- Ext.Ajax.request({
- url: 'api/idnode/load',
- params: {
- uuid: uuid,
- list: 'channel_icon,disp_title,disp_subtitle,disp_summary,episode_disp,start_real,stop_real,' +
- 'duration,disp_description,status,filesize,comment,duplicate,' +
- 'autorec_caption,timerec_caption,image,copyright_year,credits,keyword,category,' +
- 'first_aired,genre,channelname,fanart_image,broadcast',
- },
- success: function(d) {
- d = json_decode(d);
- tvheadend.loading(0),
- cb(d);
- },
- failure: function(d) {
- tvheadend.loading(0);
- }
- });
- } // load
-
function previousEvent() {
--current_index;
load(store,current_index,updateit);