epgd.eventDetail = function (id) { this.id = id; this.data = null; this.expire = 0; } epgd.eventDetail.prototype.imgPath = false; epgd.eventDetail.prototype.load = function (channelId, time) { var self = this; epgd.ajax({ url: epgd.login.url + "data/event?" + (channelId && time ? "channelid=" + channelId + "&time=" + time : "id=" + this.id), async: false, cache: false }, function (data) { self.data = data.event; self.id = data.id; self.expire = epgd.utils.now().getTime() + 900000; }); //15*60*1000 return this; } epgd.eventDetail.prototype.render = function () { if (this.expire < epgd.utils.now().getTime()) this.load(); if (!this.data) return ''; this.win.render(this); }; epgd.eventDetail.prototype.doRecord = function (eData) { if (eData === true) return epgd.tr.pages.eventDetail.record; // eData = getTitle eData = eData || this.data; var tData = { id: eData.timerid, eventid: eData.id, channelid: eData.channelid, title: eData.title, evStartTime: eData.starttime, evDuration: eData.duration, category: eData.category, shorttext: eData.shorttext, expression: eData.title }; if (tData.eventid) epgd.pages.timerList.dialog.render(tData); else epgd.pages.searchTimerList.dialog.render(tData); } epgd.eventDetail.prototype.doRepeat = function (checkAvail) { if (checkAvail) return true; var win = this.win, $repeatHdl = win.$con.find('.repeat'), searchData; if (!$repeatHdl.length) { 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 = $('

' + epgd.tr.pages.eventDetail.repeat + '

').appendTo(win.$con); searchData = { searchfields: 1, expression: this.data.title, searchmode: 1, casesensitiv: 1, fromEventDetail: true }; if (this.data.shorttext) { searchData.searchfields1= 2; searchData.expression1 = this.data.shorttext; } epgd.pages.search.search.call(this, $('
').appendTo(win.$con), searchData); } else $repeatHdl.click(); } epgd.eventDetail.prototype.doPlay = function (checkAvail) { var t = parseInt(epgd.utils.now().getTime() / 1000, 10) - this.data.starttime; if (t < 0 || t > this.data.duration) return false; if (checkAvail) return true; epgd.vdrs.current.switchChannel(this.data.channelid); } epgd.eventDetail.prototype.doPrev = function (checkAvail) { var t = this.data.starttime - 500, self = this; if (t < epgd.profile.minEventTime) return false; if (checkAvail) return true; epgd.utils.loader.process(function () { new epgd.eventDetail().load(self.data.channelid, t).render(); }); } epgd.eventDetail.prototype.doNext = function (checkAvail) { var t = this.data.starttime + this.data.duration + 500, self = this; if (t > epgd.profile.maxEventTime) return false; if (checkAvail) return true; epgd.utils.loader.process(function () { new epgd.eventDetail().load(self.data.channelid, t).render(); }); } epgd.eventDetail.win = function () { this._create(); this.closed = true; this.detail = null; var win = this; $(window).bind("epgd_close.eventDetail", function () { if (!win.closed) { //win.$win.css('left', ''); win.$win.css('z-Index', ''); win.$win.hide(); $(document).unbind("keyup.eventDetail"); win.closed = true; win.$openDialogs && win.$openDialogs.removeClass("ui-state-disabled"); } }); $(window).bind("resize.eventDetail", function (ev) { if (!win.closed) { try { win.$win.css("max-width", $(window).width()); win.$win.show().position({ of: window }); win.$con.accordion("refresh"); } catch (e) { } if (parseInt(win.$win.css('top'), 10) < 69) win.$win.css('top', '69px'); }; }); } epgd.eventDetail.win.prototype._create = function () { this.imgPath = epgd.profile.eventImgPath ? epgd.profile.eventImgPath + '?no=0&maxW=270&maxH=146&id=' : false; this.movieImgPath = epgd.profile.movieMediaPath ? epgd.profile.movieMediaPath + '?actor_id=0&movie_id=' : false; this.movieActorImgPath = epgd.profile.movieMediaPath ? epgd.profile.movieMediaPath + '?maxW=60&maxH=90&media_type=4&actor_id=' : false; this.serieImgPath = epgd.profile.serieImgPath ? epgd.profile.serieImgPath + '?actor_id=0&series_id=' : false; this.serieActorImgPath = epgd.profile.serieImgPath ? epgd.profile.serieImgPath + '?maxW=60&maxH=90&season_number=0&episode_id=0&media_type=11&actor_id=' : false; this.$win = $('
' + '
' + '
' + '
' + '
' + '
' + '
').appendTo(document.body); this.$con = this.$win.find(':first :last'); var win = this, tr = epgd.tr.pages.eventDetail, toolbar = this.$win.find('.toolbar')[0]; this.$rec= $('