diff options
Diffstat (limited to 'http/src/js/eventDetail.js')
-rw-r--r-- | http/src/js/eventDetail.js | 155 |
1 files changed, 79 insertions, 76 deletions
diff --git a/http/src/js/eventDetail.js b/http/src/js/eventDetail.js index 8ff8548..939b7ff 100644 --- a/http/src/js/eventDetail.js +++ b/http/src/js/eventDetail.js @@ -45,14 +45,14 @@ epgd.eventDetail.prototype.doRepeat = function (checkAvail) { $repeatHdl = win.$con.find('.repeat'), searchData; if (!$repeatHdl.length) { - if (!this.searchResultList) {
- this.searchResultList = new epgd.searchResultList(null, {
- resize: function () {
+ if (!this.searchResultList) { + this.searchResultList = new epgd.searchResultList(null, { + resize: function () { win.$con.last().find('td[data-evId="' + win.detail.data.id + '"]').parent().remove(); win.$con.accordion("refresh"); - $repeatHdl.click();
- }
- });
+ $repeatHdl.click(); + } + }); } $repeatHdl = $('<h3 class="repeat">' + epgd.tr.pages.eventDetail.repeat + '</h3>').appendTo(win.$con); searchData = { searchfields: 1, expression: this.data.title, searchmode: 1, casesensitiv: 1, fromEventDetail: true }; @@ -238,7 +238,7 @@ epgd.eventDetail.win.prototype.render = function (detail) { terms = sc.episode; if (terms) { if (terms.episodeoverview){ - if ( e.longdescription && terms.episodeoverview.length > e.longdescription.length)
+ if ( e.longdescription && terms.episodeoverview.length > e.longdescription.length) desc = desc.replace(/^<div.+<\/div>/i, ''); desc= '<div title="episodeoverview">' + terms.episodeoverview + '</div>' + desc; } @@ -290,47 +290,50 @@ epgd.eventDetail.win.prototype.render = function (detail) { + (e.year ? tr.year + '<b>' + e.year + '</b><br />' : ''); info2 = (ep.part ? tr.part + '<b>' + ep.part + (ep.parts ? ' / ' + ep.parts + '' : '') + '</b><br />' : '') + (ep.season ? tr.season + '<b>' + ep.season + '</b><br />' : '') - + (ep.number ? tr.number + '<b>' + ep.number + '</b><br />' : ''); + + (ep.number ? tr.number + '<b>' + ep.number + '</b><br />' : '') + + (ep.extracol1 ? ep.extracol1 + '<br />' : '') + + (ep.extracol2 ? ep.extracol2 + '<br />' : '') + + (ep.extracol3 ? ep.extracol3 + '<br />' : ''); /* - e.recordings = [
- {
- "matchdensityshorttext": 12,
- "owner": "7F13E490-09B3-401C-B26C-8B7F2F111014",
- "name": "Star Wars: Episode III - Die Rache der Sith",
- "duration": 10736,
- "path": "Die_Biene_Maja/S03E04/2014-03-23.06.53.29-0.rec",
- "md5path": "f6abd21ea13f52626723b3321c7a8c42",
- "matchdensitytitle": 68,
- "starttime": 1395553980,
- "title": "Star Wars: Episode III - Die Rache der Sith",
- "shorttext": "Science-Fiction (USA 2005)"
- },
- {
- "matchdensityshorttext": 48,
- "owner": "7F13E490-09B3-401C-B26C-8B7F2F111014",
- "name": "Star Wars: Das Erwachen der Macht",
- "duration": 8783,
- "path": "Das_Traumhotel/2016-05-15.18.28.64-0.rec",
- "md5path": "0279b0d04b68e891ef2b7e6d8bcdd059",
- "matchdensitytitle": 70,
- "starttime": 1463329680,
- "title": "Star Wars: Das Erwachen der Macht",
- "sho__rttext": "Star Wars - Episode VII: The Force Awakens"
- }
- ];
+ e.recordings = [ + { + "matchdensityshorttext": 12, + "owner": "7F13E490-09B3-401C-B26C-8B7F2F111014", + "name": "Star Wars: Episode III - Die Rache der Sith", + "duration": 10736, + "path": "Die_Biene_Maja/S03E04/2014-03-23.06.53.29-0.rec", + "md5path": "f6abd21ea13f52626723b3321c7a8c42", + "matchdensitytitle": 68, + "starttime": 1395553980, + "title": "Star Wars: Episode III - Die Rache der Sith", + "shorttext": "Science-Fiction (USA 2005)" + }, + { + "matchdensityshorttext": 48, + "owner": "7F13E490-09B3-401C-B26C-8B7F2F111014", + "name": "Star Wars: Das Erwachen der Macht", + "duration": 8783, + "path": "Das_Traumhotel/2016-05-15.18.28.64-0.rec", + "md5path": "0279b0d04b68e891ef2b7e6d8bcdd059", + "matchdensitytitle": 70, + "starttime": 1463329680, + "title": "Star Wars: Das Erwachen der Macht", + "sho__rttext": "Star Wars - Episode VII: The Force Awakens" + } + ]; */ if (e.recordings) - for (i in e.recordings) {
- terms= e.recordings[i];
+ for (i in e.recordings) { + terms= e.recordings[i]; recordings += '<div class="rec" data-start="' + terms.starttime + '" data-owner="' + (terms.owner || '') + '" data-md5="' + terms.md5path + '" data-path="' + terms.path + '">' + '<em>' + epgd.utils.formatDateTime(terms.starttime) + '</em><u>' + parseInt(terms.duration / 60, 10) + ' ' + epgd.tr.minutes + '</u><b onclick="new epgd.recordDetail(this.parentNode).render()">' - + '<div class="progress" title="' + terms.matchdensitytitle + '% ' + epgd.tr.pages.search.matchdensity + '"><div style="width:' + terms.matchdensitytitle + '%" ></div></div>' + terms.title
+ + '<div class="progress" title="' + terms.matchdensitytitle + '% ' + epgd.tr.pages.search.matchdensity + '"><div style="width:' + terms.matchdensitytitle + '%" ></div></div>' + terms.title + (terms.shorttext ? '<i><div class="progress" title="' + terms.matchdensityshorttext + '% ' + epgd.tr.pages.search.matchdensity + '"><div style="width:' + terms.matchdensityshorttext + '%" ></div></div>' + terms.shorttext + '</i>' : '') - + '</b></div>';
+ + '</b></div>'; } this.$con = $('<div><h3><div class="date">' + $.datepicker.formatDate(isMobile ? 'd. M y' : 'd. MM yy', epgd.utils.date(e.starttime)) + '</div>' @@ -366,7 +369,7 @@ epgd.eventDetail.win.prototype.render = function (detail) { + '<div class="colFull desc">' + (desc ? desc.replace(/\n/g, '<br />') : '') + '</div>' + '</div>' + extInfo - + (e.category == 'Serie' || sc.isSerie ? '<h3 data-conti="' + constTitle + '"><span>' + tr.constabelInfo + '</span></h3><div class="desc">' + + (e.category == 'Serie' || sc.isSerie || ep.episodename ? '<h3 data-conti="' + constTitle + '"><span>' + tr.constabelInfo + '</span></h3><div class="desc">' + '<a class="iAsButton i-edit" href="' + epgd.profile.constabelEditPath + encodeURIComponent(constTitle) + '.episodes' + '" target="constabel">' + epgd.tr.edit + '</a>' + '<a class="iAsButton i-link-ext" href="' + epgd.profile.constabelLinkPath + encodeURIComponent(constTitle) + '" target="constabel">' + epgd.tr.pages.eventDetail.addConstableLink + '</a>' + epgd.pages.help.getButton('constabel',true) @@ -382,33 +385,33 @@ epgd.eventDetail.win.prototype.render = function (detail) { active: 0, beforeActivate: function(ev, ui){ if (ui.newHeader.attr('data-conti')) { - epgd.utils.loader.process(function () {
- epgd.ajax({ url: epgd.login.url + 'data/proxy?id=constabel&title=' + encodeURIComponent(encodeURIComponent(ui.newHeader.attr('data-conti'))) + '&_' + new Date().getTime(), dataType: "html", contentType: "text/plain; charset=utf-8" }, function (data) {
- if (data.indexOf('Error:') == -1) {
+ epgd.utils.loader.process(function () { + epgd.ajax({ url: epgd.login.url + 'data/proxy?id=constabel&title=' + encodeURIComponent(encodeURIComponent(ui.newHeader.attr('data-conti'))) + '&_' + new Date().getTime(), dataType: "html", contentType: "text/plain; charset=utf-8" }, function (data) { + if (data.indexOf('Error:') == -1) { var $pre = ui.newPanel.find('#cRaw'), thead = '<thead><tr><th>' + tr.season + '</th><th>' + tr.part + '</th><th>' + tr.number + '</th><th>' + tr.title + '</th>', tbody = '<tbody>', lines = data.split(/\r?\n/), line, m, i; - for (i = 0; i < lines.length; i++) {
+ for (i = 0; i < lines.length; i++) { line = lines[i]; - if (line.charAt(0) == '#') {
+ if (line.charAt(0) == '#') { m = line.match(/EXTRACOL[0-9] (.+)/i); if (m) - thead += '<th>' + m[1] + '</th>';
- } else {
+ thead += '<th>' + m[1] + '</th>'; + } else { m = line.split(/\t/); if (m.length > 3) - tbody += '<tr><td>' + m.join('</td><td>') + '</td></tr>';
- }
+ tbody += '<tr><td>' + m.join('</td><td>') + '</td></tr>'; + } } $pre.html(data).hide().before('<a href="#" onclick="return !!$(\'#cRaw\').toggle()[0].scrollIntoView()">Raw</a>'); - $pre.before('<table>' + thead + '</thead>' + tbody + '</tbody></table>');
- } else
- ui.newPanel.find('#cRaw').html(epgd.tr.error.noData);
- epgd.utils.loader.close();
- });
- ui.newHeader.removeAttr('data-conti');
+ $pre.before('<table>' + thead + '</thead>' + tbody + '</tbody></table>'); + } else + ui.newPanel.find('#cRaw').html(epgd.tr.error.noData); + epgd.utils.loader.close(); + }); + ui.newHeader.removeAttr('data-conti'); },true); } } @@ -430,8 +433,8 @@ epgd.eventDetail.win.prototype.render = function (detail) { $(window).trigger("resize.eventDetail"); this.$openDialogs = $('.ui-dialog:visible:not(.ui-state-disabled)').addClass("ui-state-disabled"); $(document).bind("keyup.eventDetail", function (e) { - if (e.keyCode == 27) {
- $(window).trigger("epgd_close.eventDetail");
+ if (e.keyCode == 27) { + $(window).trigger("epgd_close.eventDetail"); } }); epgd.pages.help.initButtons(this.$con); @@ -450,7 +453,7 @@ epgd.recordDetail.prototype.load = function () { }); return this; } -epgd.recordDetail.prototype.doRecord = function (eData) {
+epgd.recordDetail.prototype.doRecord = function (eData) { if (eData === true) return epgd.tr.pages.records.similarTimer; // eData = getTitle epgd.eventDetail.prototype.doRecord.call(this, eData); } @@ -475,47 +478,47 @@ epgd.recordDetail.prototype.doNext = function (checkAvail) { $elem.find('B').click(); } -epgd.doneTimerDetail = epgd.utils.inherits(function (tr) {
+epgd.doneTimerDetail = epgd.utils.inherits(function (tr) { this.tr = tr; - return epgd.eventDetail.call(this);
+ return epgd.eventDetail.call(this); }, epgd.eventDetail); -epgd.doneTimerDetail.prototype.load= function () {
+epgd.doneTimerDetail.prototype.load= function () { var self = this; - epgd.ajax({ url: epgd.login.url + 'data/donetimer?id=' + this.tr.tData.id, async: false, cache: false }, function (data) {
+ epgd.ajax({ url: epgd.login.url + 'data/donetimer?id=' + this.tr.tData.id, async: false, cache: false }, function (data) { var t = data.donetimer; if (t.state) t.cntlongdescription = epgd.pages.timerListDone.stateIcons[t.state]; - t.episode = { lang: t.episodelang, season: t.episodeseason, part: t.episodepart };
+ t.episode = { lang: t.episodelang, season: t.episodeseason, part: t.episodepart }; self.id = data.id; - self.expire = epgd.utils.now().getTime() + 900000;
- delete t.timerid;
- delete t.id;
- self.data = t;
+ self.expire = epgd.utils.now().getTime() + 900000; + delete t.timerid; + delete t.id; + self.data = t; }); - return this;
-};
-epgd.doneTimerDetail.prototype.doRecord= function (eData) {
+ return this; +}; +epgd.doneTimerDetail.prototype.doRecord= function (eData) { if (eData === true) return epgd.tr.pages.records.similarTimer; epgd.eventDetail.prototype.doRecord.call(this, eData); //epgd.pages.searchTimerList.dialog.render(eData || this.data); }; -epgd.doneTimerDetail.prototype.doPlay= function (checkAvail) {
- return false;
+epgd.doneTimerDetail.prototype.doPlay= function (checkAvail) { + return false; }; -epgd.doneTimerDetail.prototype.doPrev= function (checkAvail) {
+epgd.doneTimerDetail.prototype.doPrev= function (checkAvail) { var $elem = $(this.tr).prev('tr'); if (!$elem.length) return false; if (checkAvail) return true; - $elem.find('td').click();
+ $elem.find('td').click(); }; -epgd.doneTimerDetail.prototype.doNext= function (checkAvail) {
+epgd.doneTimerDetail.prototype.doNext= function (checkAvail) { var $elem = $(this.tr).next('tr'); if (!$elem.length) return false; if (checkAvail) return true; - $elem.find('td').click();
-};
+ $elem.find('td').click(); +}; $(document).ready(function () { |