From: Jaroslav Kysela Date: Thu, 20 Sep 2018 15:02:12 +0000 (+0200) Subject: epg.js: fix indent X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34f2f007ff53512db1e4e24efe0442eddde84c7c;p=thirdparty%2Ftvheadend.git epg.js: fix indent --- diff --git a/src/webui/static/app/epg.js b/src/webui/static/app/epg.js index 52d12ba08..28f373885 100644 --- a/src/webui/static/app/epg.js +++ b/src/webui/static/app/epg.js @@ -108,250 +108,250 @@ tvheadend.filmAffinityLanguage = function() { }; tvheadend.epgDetails = function(grid, index) { - // We need a unique DOM id in case user opens two dialogs. - var nextButtonId = Ext.id(); - var confcomboButtonId = Ext.id(); - - function getDialogTitle(event) { - var fields = []; - fields.push(_('Broadcast Details')); - var evTitle = event.title; - if (evTitle && evTitle.length) fields.push(evTitle); - var evEp = event.episodeOnscreen; - if (evEp && evEp.length) fields.push(evEp); - var channelName = event.channelName; - if (channelName && channelName.length) fields.push(channelName); - return fields.join(' - '); - } - - function getDialogContent(event) { - var content = ''; - var duration = 0; - var chicon = 0; - - if (event.start && event.stop && event.stop - event.start > 0) - duration = (event.stop - event.start) / 1000; - - if (event.channelIcon != null && event.channelIcon.length > 0) { - content += ''; - chicon = 1; + // We need a unique DOM id in case user opens two dialogs. + var nextButtonId = Ext.id(); + var confcomboButtonId = Ext.id(); + + function getDialogTitle(event) { + var fields = []; + fields.push(_('Broadcast Details')); + var evTitle = event.title; + if (evTitle && evTitle.length) fields.push(evTitle); + var evEp = event.episodeOnscreen; + if (evEp && evEp.length) fields.push(evEp); + var channelName = event.channelName; + if (channelName && channelName.length) fields.push(channelName); + return fields.join(' - '); } - if (chicon) - content += '
'; - var icons = tvheadend.getContentTypeIcons(event, "x-dialog-category-large-icon"); - if (icons) - content += '
' + icons + '
'; - content += '
' + event.title; - // Some OTA have the same subtitle and summary so don't display subtitle - // since summary can be long. - if (event.subtitle && (!event.summary || (event.summary && event.subtitle != event.summary))) - content += " : " + event.subtitle; - if (event.copyright_year) - content += " (" + event.copyright_year + ")"; - content += '
'; - if (event.episodeOnscreen) - content += '
' + event.episodeOnscreen + '
'; - if (event.start) - content += '
' + _('Start Time') + ':' + tvheadend.niceDate(event.start) + '
'; - if (event.stop) - content += '
' + _('End Time') + ':' + tvheadend.niceDate(event.stop) + '
'; - if (event.first_aired) - content += '
' + _('First Aired') + ':' + tvheadend.niceDateYearMonth(event.first_aired, event.start) + '
'; - if (duration) - content += '
' + _('Duration') + ':' + parseInt(duration / 60) + ' ' + _('min') + '
'; - if (chicon) { - content += '
'; /* x-epg-left */ - content += '
'; - } - if (event.image != null && event.image.length > 0) { - content += ''; - } - content += '
'; - if (event.summary) - content += '
' + event.summary + '
'; - if (event.description) - content += '
' + tvheadend.labelFormattingParser(event.description) + '
'; - if (event.summary || event.description) + function getDialogContent(event) { + var content = ''; + var duration = 0; + var chicon = 0; + + if (event.start && event.stop && event.stop - event.start > 0) + duration = (event.stop - event.start) / 1000; + + if (event.channelIcon != null && event.channelIcon.length > 0) { + content += ''; + chicon = 1; + } + + if (chicon) + content += '
'; + var icons = tvheadend.getContentTypeIcons(event, "x-dialog-category-large-icon"); + if (icons) + content += '
' + icons + '
'; + content += '
' + event.title; + // Some OTA have the same subtitle and summary so don't display subtitle + // since summary can be long. + if (event.subtitle && (!event.summary || (event.summary && event.subtitle != event.summary))) + content += " : " + event.subtitle; + if (event.copyright_year) + content += " (" + event.copyright_year + ")"; + content += '
'; + if (event.episodeOnscreen) + content += '
' + event.episodeOnscreen + '
'; + if (event.start) + content += '
' + _('Start Time') + ':' + tvheadend.niceDate(event.start) + '
'; + if (event.stop) + content += '
' + _('End Time') + ':' + tvheadend.niceDate(event.stop) + '
'; + if (event.first_aired) + content += '
' + _('First Aired') + ':' + tvheadend.niceDateYearMonth(event.first_aired, event.start) + '
'; + if (duration) + content += '
' + _('Duration') + ':' + parseInt(duration / 60) + ' ' + _('min') + '
'; + if (chicon) { + content += '
'; /* x-epg-left */ + content += '
'; + } + if (event.image != null && event.image.length > 0) { + content += ''; + } content += '
'; - content += tvheadend.getDisplayCredits(event.credits); - if (event.keyword) - content += tvheadend.sortAndAddArray(event.keyword, _('Keywords')); - if (event.category) - content += tvheadend.sortAndAddArray(event.category, _('Categories')); - if (event.starRating) - content += '
' + _('Star Rating') + ':' + event.starRating + '
'; - if (event.ageRating) - content += '
' + _('Age Rating') + ':' + event.ageRating + '
'; - if (event.genre) { - var genre = []; - Ext.each(event.genre, function(g) { - var g1 = tvheadend.contentGroupLookupName(g); - var g2 = tvheadend.contentGroupFullLookupName(g); - if (g1 == g2) - g1 = ''; - if (g1 || g2) - genre.push((g1 ? '[' + g1 + '] ' : '') + g2); + if (event.summary) + content += '
' + event.summary + '
'; + if (event.description) + content += '
' + tvheadend.labelFormattingParser(event.description) + '
'; + if (event.summary || event.description) + content += '
'; + content += tvheadend.getDisplayCredits(event.credits); + if (event.keyword) + content += tvheadend.sortAndAddArray(event.keyword, _('Keywords')); + if (event.category) + content += tvheadend.sortAndAddArray(event.category, _('Categories')); + if (event.starRating) + content += '
' + _('Star Rating') + ':' + event.starRating + '
'; + if (event.ageRating) + content += '
' + _('Age Rating') + ':' + event.ageRating + '
'; + if (event.genre) { + var genre = []; + Ext.each(event.genre, function(g) { + var g1 = tvheadend.contentGroupLookupName(g); + var g2 = tvheadend.contentGroupFullLookupName(g); + if (g1 == g2) + g1 = ''; + if (g1 || g2) + genre.push((g1 ? '[' + g1 + '] ' : '') + g2); + }); + content += '
' + _('Content Type') + ':' + genre.join(', ') + '
'; + } + var tags = []; + if (event.hd > 1) + tags.push(_('UHDTV')); + else if (event.hd > 0) + tags.push(_('HDTV')); + if ('new' in event && event.new) + tags.push(_('New#EPG').split('#')[0]); + if (event.repeat) + tags.push(_('Repeat#EPG').split('#')[0]); + if (event.widescreen) + tags.push(_('Widescreen')); + if (event.aspect) + tags.push(_('Aspect') + ' ' + (event.aspect / 100.0)); + if (event.lines) + tags.push(_('Lines') + ' ' + event.lines); + if (event.deafsigned) + tags.push(_('Deaf signed#EPG').split('#')[0]); + if (event.subtitled) + tags.push(_('Subtitled#EPG').split('#')[0]); + if (event.audiodesc) + tags.push(_('Audio description#EPG').split('#')[0]); + if (tags.length > 0) + content += '
' + _('Parameters') + ':' + tags.join(', ') + '
'; + + content += ''; + content += '
'; + if (chicon) + content += '
'; /* x-epg-bottom */ + return content; + } // getDialogContent + + function getDialogButtons() { + var now = new Date(); + var buttons = []; + var recording = event.dvrState.indexOf('recording') === 0; + var scheduled = event.dvrState.indexOf('scheduled') === 0; + + var comboGetInfo = new Ext.form.ComboBox({ + store: new Ext.data.ArrayStore({ + data: [ + [1, 'Find info from IMDB', 'imdb.png'], + [2, 'Find info from TheTVDB', 'thetvdb.png'], + [3, 'Find info from FilmAffinity', 'filmaffinity.png'], + ], + id: 0, + fields: ['value', 'text', 'url'] + }), + triggerAction: 'all', + mode: 'local', + tpl : '' + + '
  {text}
' + + '
', + emptyText:'Find info from ...', + valueField: 'value', + displayField: 'text', + width: 160, + forceSelection : true, + editable: false, + listeners: { + select: function(combo, records, index) { + tvheadend.seachTitleWeb(combo.getValue(), event.title); + } + }, }); - content += '
' + _('Content Type') + ':' + genre.join(', ') + '
'; - } - var tags = []; - if (event.hd > 1) - tags.push(_('UHDTV')); - else if (event.hd > 0) - tags.push(_('HDTV')); - if ('new' in event && event.new) - tags.push(_('New#EPG').split('#')[0]); - if (event.repeat) - tags.push(_('Repeat#EPG').split('#')[0]); - if (event.widescreen) - tags.push(_('Widescreen')); - if (event.aspect) - tags.push(_('Aspect') + ' ' + (event.aspect / 100.0)); - if (event.lines) - tags.push(_('Lines') + ' ' + event.lines); - if (event.deafsigned) - tags.push(_('Deaf signed#EPG').split('#')[0]); - if (event.subtitled) - tags.push(_('Subtitled#EPG').split('#')[0]); - if (event.audiodesc) - tags.push(_('Audio description#EPG').split('#')[0]); - if (tags.length > 0) - content += '
' + _('Parameters') + ':' + tags.join(', ') + '
'; - - content += ''; - content += '
'; - if (chicon) - content += '
'; /* x-epg-bottom */ - return content; - } // getDialogContent - - function getDialogButtons() { - var now = new Date(); - var buttons = []; - var recording = event.dvrState.indexOf('recording') === 0; - var scheduled = event.dvrState.indexOf('scheduled') === 0; - - var comboGetInfo = new Ext.form.ComboBox({ - store: new Ext.data.ArrayStore({ - data: [ - [1, 'Find info from IMDB', 'imdb.png'], - [2, 'Find info from TheTVDB', 'thetvdb.png'], - [3, 'Find info from FilmAffinity', 'filmaffinity.png'], - ], - id: 0, - fields: ['value', 'text', 'url'] - }), - triggerAction: 'all', - mode: 'local', - tpl : '' + - '
  {text}
' + - '
', - emptyText:'Find info from ...', - valueField: 'value', - displayField: 'text', - width: 160, - forceSelection : true, - editable: false, - listeners: { - select: function(combo, records, index) { - tvheadend.seachTitleWeb(combo.getValue(), event.title); - } - }, - }); - - if (event.title) - buttons.push(comboGetInfo); - 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) { + if (event.title) + buttons.push(comboGetInfo); + + 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) { + + var store = new Ext.data.JsonStore({ + autoload: true, + root: 'entries', + fields: ['key','val'], + id: 'key', + url: 'api/idnode/load', + baseParams: { + 'enum': 1, + 'class': 'dvrconfig' + }, + sortInfo: { + field: 'val', + direction: 'ASC' + } + }); + store.load(); + + if (recording) { + buttons.push(new Ext.Button({ + handler: stopDVR, + iconCls: 'stopRec', + tooltip: _('Stop recording of this program'), + text: _("Stop recording") + })); + } - var store = new Ext.data.JsonStore({ - autoload: true, - root: 'entries', - fields: ['key','val'], - id: 'key', - url: 'api/idnode/load', - baseParams: { - 'enum': 1, - 'class': 'dvrconfig' - }, - sortInfo: { - field: 'val', - direction: 'ASC' - } - }); - store.load(); + if (scheduled) { + buttons.push(new Ext.Button({ + handler: deleteDVR, + iconCls: 'remove', + tooltip: _('Delete scheduled recording of this program'), + text: _("Delete recording") + })); + } - if (recording) { + var confcombo = new Ext.ux.form.ComboAny({ + id: confcomboButtonId, + store: store, + triggerAction: 'all', + mode: 'local', + valueField: 'key', + displayField: 'val', + name: 'config_name', + emptyText: _('(default DVR Profile)'), + value: '', + editable: false + }); + + buttons.push(confcombo); buttons.push(new Ext.Button({ - handler: stopDVR, - iconCls: 'stopRec', - tooltip: _('Stop recording of this program'), - text: _("Stop recording") + handler: recordEvent, + iconCls: 'rec', + tooltip: _('Record this program now'), + text: _('Record program') })); - } - - if (scheduled) { buttons.push(new Ext.Button({ - handler: deleteDVR, - iconCls: 'remove', - tooltip: _('Delete scheduled recording of this program'), - text: _("Delete recording") + handler: recordSeries, + iconCls: 'autoRec', + tooltip: _('Create an automatic recording rule to record all future programs that match the current query.'), + text: event.serieslinkUri ? _("Record series") : _("Autorec") + })); + buttons.push(new Ext.Button({ + id: nextButtonId, + handler: nextEvent, + iconCls: 'next', + tooltip: _('Go to next event'), + text: _("Next"), })); - } - var confcombo = new Ext.ux.form.ComboAny({ - id: confcomboButtonId, - store: store, - triggerAction: 'all', - mode: 'local', - valueField: 'key', - displayField: 'val', - name: 'config_name', - emptyText: _('(default DVR Profile)'), - value: '', - editable: false - }); + } else { - buttons.push(confcombo); - buttons.push(new Ext.Button({ - handler: recordEvent, - iconCls: 'rec', - tooltip: _('Record this program now'), - text: _('Record program') - })); - buttons.push(new Ext.Button({ - handler: recordSeries, - iconCls: 'autoRec', - tooltip: _('Create an automatic recording rule to record all future programs that match the current query.'), - text: event.serieslinkUri ? _("Record series") : _("Autorec") - })); - buttons.push(new Ext.Button({ - id: nextButtonId, - handler: nextEvent, - iconCls: 'next', - tooltip: _('Go to next event'), - text: _("Next"), - })); - - } else { - - buttons.push(new Ext.Button({ - handler: function() { win.close(); }, - text: _("Close") - })); + buttons.push(new Ext.Button({ + handler: function() { win.close(); }, + text: _("Close") + })); - } - return buttons; - } //getDialogButtons + } + return buttons; + } //getDialogButtons var current_index = index; var event = grid.getStore().getAt(index).data;