From 1044ac9a2151e887b4bc1995f74b04715a0348f8 Mon Sep 17 00:00:00 2001 From: horchi Date: Tue, 25 Jul 2017 15:54:58 +0200 Subject: 2017-07-25: version 1.1.120 (rechner)\n - added: show constable in eventdetail, if episodename is available\n - added: show constable extracol 1-3 in eventdetail \n - fixed: if recording view was reloaded the functionallity in bar was lost\n \n --- HISTORY.h | 9 +- http/src/js/eventDetail.js | 155 +++++++++--------- http/src/js/pages.records.js | 367 ++++++++++++++++++++++--------------------- http/www/epgd.js | 2 +- 4 files changed, 271 insertions(+), 262 deletions(-) diff --git a/HISTORY.h b/HISTORY.h index 933432a..bec972e 100644 --- a/HISTORY.h +++ b/HISTORY.h @@ -4,8 +4,8 @@ * ----------------------------------- */ -#define _VERSION "1.1.120" -#define VERSION_DATE "28.06.2017" +#define _VERSION "1.1.121" +#define VERSION_DATE "25.07.2017" #define DB_API 4 #ifdef GIT_REV @@ -16,6 +16,11 @@ /* * ------------------------------------ +2017-07-25: version 1.1.120 (rechner) + - added: show constable in eventdetail, if episodename is available + - added: show constable extracol 1-3 in eventdetail + - fixed: if recording view was reloaded the functionallity in bar was lost + 2017-06-28: version 1.1.119 (rechner) - added: Link to osd2web, if available 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 = $('

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

').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(/^/i, ''); desc= '
' + terms.episodeoverview + '
' + desc; } @@ -290,47 +290,50 @@ epgd.eventDetail.win.prototype.render = function (detail) { + (e.year ? tr.year + '' + e.year + '
' : ''); info2 = (ep.part ? tr.part + '' + ep.part + (ep.parts ? ' / ' + ep.parts + '' : '') + '
' : '') + (ep.season ? tr.season + '' + ep.season + '
' : '') - + (ep.number ? tr.number + '' + ep.number + '
' : ''); + + (ep.number ? tr.number + '' + ep.number + '
' : '') + + (ep.extracol1 ? ep.extracol1 + '
' : '') + + (ep.extracol2 ? ep.extracol2 + '
' : '') + + (ep.extracol3 ? ep.extracol3 + '
' : ''); /* - 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 += '
' + '' + epgd.utils.formatDateTime(terms.starttime) + '' + parseInt(terms.duration / 60, 10) + ' ' + epgd.tr.minutes + '' - + '
' + terms.title + + '
' + terms.title + (terms.shorttext ? '
' + terms.shorttext + '
' : '') - + '
'; + + ''; } this.$con = $('

' + $.datepicker.formatDate(isMobile ? 'd. M y' : 'd. MM yy', epgd.utils.date(e.starttime)) + '
' @@ -366,7 +369,7 @@ epgd.eventDetail.win.prototype.render = function (detail) { + '
' + (desc ? desc.replace(/\n/g, '
') : '') + '
' + '

' + extInfo - + (e.category == 'Serie' || sc.isSerie ? '

' + tr.constabelInfo + '

' + + (e.category == 'Serie' || sc.isSerie || ep.episodename ? '

' + tr.constabelInfo + '

' + '' + epgd.tr.edit + '' + '' + epgd.tr.pages.eventDetail.addConstableLink + '' + 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 = '' + tr.season + '' + tr.part + '' + tr.number + '' + tr.title + '', 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 += '' + m[1] + ''; - } else { + thead += '' + m[1] + ''; + } else { m = line.split(/\t/); if (m.length > 3) - tbody += '' + m.join('') + ''; - } + tbody += '' + m.join('') + ''; + } } $pre.html(data).hide().before('Raw'); - $pre.before('' + thead + '' + tbody + '
'); - } else - ui.newPanel.find('#cRaw').html(epgd.tr.error.noData); - epgd.utils.loader.close(); - }); - ui.newHeader.removeAttr('data-conti'); + $pre.before('' + thead + '' + tbody + '
'); + } 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 () { diff --git a/http/src/js/pages.records.js b/http/src/js/pages.records.js index 640a27a..0aadd5d 100644 --- a/http/src/js/pages.records.js +++ b/http/src/js/pages.records.js @@ -1,180 +1,181 @@ -epgd.pages.records = { +epgd.pages.records = { render: function () { - if (!(epgd.login.rights & epgd.rights.umRecordings) == epgd.rights.umRecordings) return epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error }); + if (!(epgd.login.rights & epgd.rights.umRecordings) == epgd.rights.umRecordings) return epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error }); if (!epgd.profile.recordSubFolderSort) epgd.profile.recordSubFolderSort = 1; - $('#menu_records').addClass("menu-active"); - var tr = epgd.tr.pages.records; - + $('#menu_records').addClass("menu-active"); + var tr = epgd.tr.pages.records; + if (!this.$bar) { - this.$bar = $('
' - + '' - + epgd.pages.help.getIcon('recRefresh') + '   ' - + epgd.tr.pages.search.search + epgd.pages.help.getIcon('recSearch') + '' - + '' - + '' - + '' - + '' - + '0' - + '' - + '   ' - + tr.ddLabel + epgd.pages.help.getIcon('recDD') - + '
' - +'
'); - this.$trash = this.$bar.find('.i-trash').droppable({ - accept: ".rec", - hoverClass: "ui-state-hover", - tolerance: "pointer", - drop: function (ev, ui) { - var elem = ui.helper.context; - epgd.utils.confirm(epgd.tr.pages.records.deleteMessage.replace("$src$", elem.getAttribute('data-path')), function (ok) { - ok && epgd.pages.records.del(elem); - }); - return false; - } - }).click(function () { - var $recs = $("#records").find('.rec.selected'); - $recs.length && epgd.utils.confirm(epgd.tr.confirmDelete + ($recs.length > 1 ? '
' + $recs.length + epgd.tr.entries : ''), function (ok) { - ok && $recs.each(function () { - epgd.pages.records.del(this); - }); - }); - }); + this.$bar = $('
' + + '' + + epgd.pages.help.getIcon('recRefresh') + '   ' + + epgd.tr.pages.search.search + epgd.pages.help.getIcon('recSearch') + '' + + '' + + '' + + '' + + '' + + '0' + + '' + + '   ' + + tr.ddLabel + epgd.pages.help.getIcon('recDD') + + '
' + +'
'); + this.$trash = this.$bar.find('.i-trash'); this.curSearch = { pattern: '', searchValue: '', hits: $(), cur: 0, $count: this.$bar.find('#rSCnt') , fromStart: this.$bar.find('#rSVal').prev('button')[0] , toEnd: this.$bar.find('#rSVal').next('button')[0] } - epgd.pages.help.initButtons(this.$bar); - } - this.$bar.insertAfter(epgd.$menu); - epgd.$menu.checkMenuSize(); + } + this.$bar.insertAfter(epgd.$menu); + this.$trash.droppable({ + accept: ".rec", + hoverClass: "ui-state-hover", + tolerance: "pointer", + drop: function (ev, ui) { + var elem = ui.helper.context; + epgd.utils.confirm(epgd.tr.pages.records.deleteMessage.replace("$src$", elem.getAttribute('data-path')), function (ok) { + ok && epgd.pages.records.del(elem); + }); + return false; + } + }).click(function () { + var $recs = $("#records").find('.rec.selected'); + $recs.length && epgd.utils.confirm(epgd.tr.confirmDelete + ($recs.length > 1 ? '
' + $recs.length + epgd.tr.entries : ''), function (ok) { + ok && $recs.each(function () { + epgd.pages.records.del(this); + }); + }); + }); + epgd.pages.help.initButtons(this.$bar); + epgd.$menu.checkMenuSize(); $(window).bind("epgd_close.records", function () { epgd.pages.records.$bar.remove(); epgd.$menu.checkMenuSize(); $(window).unbind(".records"); - }); - epgd.$con.html('
'); + }); + epgd.$con.html('
'); epgd.utils.loader.process(function () { epgd.ajax({ url: epgd.login.url + "data/recordings", cache: false }, function (data) { - var recs = data.recordings, - rec, key, paths, t, p, i, - tree = { f: {}, r: [] }, - vdrs = {}, - vdr, v, - html = '', - min = ' ' + epgd.tr.minutes, - $divs, - sortFunc = epgd.profile.recordSubFolderSort == 6 ? function (a, b) { return a.starttime > b.starttime ? -1 : 1 } - : epgd.profile.recordSubFolderSort == 5 ? function (a, b) { return a.starttime > b.starttime ? 1 : -1 } - : epgd.profile.recordSubFolderSort == 4 ? function (a, b) { return a.path > b.path ? -1 : 1 } - : epgd.profile.recordSubFolderSort == 3 ? function (a, b) { return a.path > b.path ? 1 : -1 } - : epgd.profile.recordSubFolderSort == 2 ? function (a, b) { return a.tit > b.tit ? -1 : 1 } - : function (a, b) { return a.tit > b.tit ? 1 : -1 }; - + var recs = data.recordings, + rec, key, paths, t, p, i, + tree = { f: {}, r: [] }, + vdrs = {}, + vdr, v, + html = '', + min = ' ' + epgd.tr.minutes, + $divs, + sortFunc = epgd.profile.recordSubFolderSort == 6 ? function (a, b) { return a.starttime > b.starttime ? -1 : 1 } + : epgd.profile.recordSubFolderSort == 5 ? function (a, b) { return a.starttime > b.starttime ? 1 : -1 } + : epgd.profile.recordSubFolderSort == 4 ? function (a, b) { return a.path > b.path ? -1 : 1 } + : epgd.profile.recordSubFolderSort == 3 ? function (a, b) { return a.path > b.path ? 1 : -1 } + : epgd.profile.recordSubFolderSort == 2 ? function (a, b) { return a.tit > b.tit ? -1 : 1 } + : function (a, b) { return a.tit > b.tit ? 1 : -1 }; + for (vdr in epgd.vdrs.list) { - v = epgd.vdrs.list[vdr]; - if (!v.usecommonrecfolder) - vdrs[vdr] = { f: {}, r: [] }; + v = epgd.vdrs.list[vdr]; + if (!v.usecommonrecfolder) + vdrs[vdr] = { f: {}, r: [] }; html += '
VDR - ' + v.name + ': ' + v.videodir + ' - ' + parseInt(v.videofree / 1000, 10) + ' GB ' + tr.available + ' / ' + parseInt(v.videototal / 1000, 10) + ' GB
'; - } - if (!$('#dragdrop').parent().length) //.append(html) - return false; - epgd.$con.find('#records').before(html); - html = ''; - + } + if (!$('#dragdrop').parent().length) //.append(html) + return false; + epgd.$con.find('#records').before(html); + html = ''; + for (i in recs) { - rec = recs[i]; - t = vdrs[rec.vdruuid] || tree; - paths = rec.path.split('/'); - paths.pop(); + rec = recs[i]; + t = vdrs[rec.vdruuid] || tree; + paths = rec.path.split('/'); + paths.pop(); for (p = 0; p < paths.length; p++) { - key = paths[p].replace(/_/g, ' '); + key = paths[p].replace(/_/g, ' '); t = t.f[key] || (t.f[key] = { f: {}, r: [] }); - } + } t.r.push(rec); - } - + } + function checkTree(t) { - var hasContent = false, - subFolder, subTree; - t.cnt = 0; + var hasContent = false, + subFolder, subTree; + t.cnt = 0; for (subFolder in t.f) { - subTree = t.f[subFolder]; - if (subTree.r.length == 1) - t.r.push(subTree.r.pop()); - checkTree(subTree); + subTree = t.f[subFolder]; + if (subTree.r.length == 1) + t.r.push(subTree.r.pop()); + checkTree(subTree); if (checkTree(subTree)) { hasContent = true; t.cnt += subTree.cnt; - } else + } else delete t.f[subFolder]; - } - if (!hasContent) - delete t.f; - t.cnt += t.r.length; + } + if (!hasContent) + delete t.f; + t.cnt += t.r.length; return hasContent || t.r.length > 0; - } - + } + function renderTree(t) { Object.keys(t.f).sort().forEach(function (subFolder) { - var subTree = t.f[subFolder], - i; - html += subFolder ? '

(' + (subTree.cnt) + ')' + subFolder + '

' : '
'; - subTree.f && renderTree(subTree); + var subTree = t.f[subFolder], + i; + html += subFolder ? '

(' + (subTree.cnt) + ')' + subFolder + '

' : '
'; + subTree.f && renderTree(subTree); if (subTree.r.length) { for (i in subTree.r) { - rec = subTree.r[i]; - rec.tit = ((rec.name != subFolder ? rec.name : '') - + (subFolder != rec.title && (rec.title != rec.name) ? '
' + rec.title : '') - + (rec.shorttext && (rec.shorttext != rec.name) ? '' + rec.shorttext + '' : '')) || subFolder; - rec.html = '
' - + '' + epgd.utils.formatDateTime(rec.starttime) + '' + parseInt(rec.duration / 60, 10) + min + '' - + rec.tit + rec = subTree.r[i]; + rec.tit = ((rec.name != subFolder ? rec.name : '') + + (subFolder != rec.title && (rec.title != rec.name) ? '
' + rec.title : '') + + (rec.shorttext && (rec.shorttext != rec.name) ? '' + rec.shorttext + '' : '')) || subFolder; + rec.html = '
' + + '' + epgd.utils.formatDateTime(rec.starttime) + '' + parseInt(rec.duration / 60, 10) + min + '' + + rec.tit + '
'; }; subTree.r.sort(sortFunc); for (i in subTree.r) { html += subTree.r[i].html; } - } + } html += '
'; }); - } - - p = {}; - if (checkTree(tree)) - p[tr.commonRecFolder] = tree; + } + + p = {}; + if (checkTree(tree)) + p[tr.commonRecFolder] = tree; for (vdr in vdrs) { - t = vdrs[vdr]; + t = vdrs[vdr]; if (checkTree(t)) { p['VDR - ' + epgd.vdrs.list[vdr].name] = t; } - } - renderTree({ f: p }); - - $divs = epgd.$con.find('#records').html(html); + } + renderTree({ f: p }); + + $divs = epgd.$con.find('#records').html(html); if (!$divs.length) return false; $divs = $divs.click(epgd.pages.records.action).find('>div'); - if ($divs.length == 1) + if ($divs.length == 1) $divs.first().toggleClass('open'); - epgd.pages.records.$menu = $('
    ' - + '
  •   ' + epgd.tr.pages.eventDetail.title + '
  • ' - + '
  •   ' + epgd.tr.pages.timerList.folder + '
  • ' - + '
  •   ' + epgd.tr.pages.timerList.recordTime + '
  • ' + epgd.pages.records.$menu = $('
      ' + + '
    •   ' + epgd.tr.pages.eventDetail.title + '
    • ' + + '
    •   ' + epgd.tr.pages.timerList.folder + '
    • ' + + '
    •   ' + epgd.tr.pages.timerList.recordTime + '
    • ' + '
    ').hide().appendTo(epgd.$con); $('#dragdrop').change(); epgd.pages.records.curSearch.$recs = null; epgd.utils.loader.close(); }); },true); - }, + }, search: function (searchValue) { var cs = this.curSearch, - sLength, - $recs, + sLength, + $recs, pattern, fromStart = cs.fromStart.checked, toEnd = cs.toEnd.checked; @@ -219,7 +220,7 @@ epgd.pages.records = { this.searchMove(0); } else cs.$count.parent().hide(); - }, + }, searchMove: function (dir) { this.curSearch.cur += dir; var n = this.curSearch.hits[this.curSearch.cur]; @@ -232,15 +233,15 @@ epgd.pages.records = { $(n).css({ 'background-color': 'green' }); window.setTimeout(function () { $(n).css({ 'background-color': '' }); },1500); } - }, + }, action: function (ev) { - var elem = ev.target; // aktueller Sortiebutton, bzw. inital jquery-elment - if (elem.nodeName == 'MARK') - elem = elem.parentNode; + var elem = ev.target; // aktueller Sortiebutton, bzw. inital jquery-elment + if (elem.nodeName == 'MARK') + elem = elem.parentNode; if (elem.nodeName == 'M') { epgd.pages.records.$menu.show().position({ - my: "left top", - at: "left bottom", + my: "left top", + at: "left bottom", of: elem }).find('a').removeClass('ui-state-highlight'); epgd.pages.records.$menu.find('a[data-sort=' + (elem.curSort || epgd.profile.recordSubFolderSort) +']').addClass('ui-state-highlight'); @@ -255,23 +256,23 @@ epgd.pages.records = { epgd.pages.records.$menu.hide(); $(document).unbind('.recmenu'); }).bind("keyup.recmenu", function (e) { - if (e.keyCode == 27) + if (e.keyCode == 27) $(document).trigger("click.recmenu"); }); return false; - } - - if (elem.nodeName == 'I' || elem.nodeName == 'SPAN') - elem = elem.parentNode; + } + + if (elem.nodeName == 'I' || elem.nodeName == 'SPAN') + elem = elem.parentNode; if (elem.nodeName == 'B') { - elem = elem.parentNode; - if (!elem.recDetail) - elem.recDetail = new epgd.recordDetail(elem); + elem = elem.parentNode; + if (!elem.recDetail) + elem.recDetail = new epgd.recordDetail(elem); epgd.utils.loader.process(function () { elem.recDetail.render(); }); } else if (elem.nodeName == 'H4') { - elem = elem.parentNode; + elem = elem.parentNode; if (elem.nodeName == 'DIV' && elem.className.indexOf('folder') >= 0) { if (elem.className.indexOf('open') == -1) { if ($(window).width() < 500) { @@ -285,7 +286,7 @@ epgd.pages.records = { } } else $(elem).closest('.rec').toggleClass('selected'); - }, + }, dd: function (enable) { var $records = $("#records"), $recs = $records.find('.rec').has('.ui-draggable'); @@ -307,7 +308,7 @@ epgd.pages.records = { document.body.style.paddingTop = epgd.pages.records.$bar.height() + 'px'; document.body.scrollTop -= ev.pageY - $(ev.delegateTarget).closest('.folder').offset().top; /*$(document).bind("keyup.dd", [this], function (ev) { - if (ev.keyCode == 27) + if (ev.keyCode == 27) $.ui.ddmanager.dragStop($(ev.data[0]).draggable("instance"), ev); //$(ev.data[0]).draggable("cancel"); }); */ }, @@ -320,44 +321,44 @@ epgd.pages.records = { } else if ($recs.length){ $recs.draggable(enable ? "enable" : "disable"); } - }, + }, __dropSettings: { accept: ".rec", hoverClass: "ui-state-hover", tolerance: 'pointer', drop: function (ev, ui) { console.log("Dropped!", ev, ui); - var $elem = $(ev.target), - path = ''; + var $elem = $(ev.target), + path = ''; do { path = $elem.text().replace(/^\(.*\)/,'') + '/' + path; $elem = $elem.parent(); - } while (($elem = $elem.prevAll('h4')).length); + } while (($elem = $elem.prevAll('h4')).length); epgd.pages.records.move(ui.draggable.context, path.slice(path.indexOf('/', 2) + 1).replace(/ /g, '_'),ev.target.parentNode) - return false; + return false; } - }, - update: function () { - epgd.ajax({ url: epgd.login.url + "data/updaterecordings" }, function (data) { - epgd.utils.topInfo(epgd.tr.pages.records.refreshMessage.replace('$sec$', 5), { autoClose: 5000 }); - $(window).trigger("epgd_close.records"); - window.setTimeout(function () { epgd.pages.records.render(); }, 5000); - }); - }, - move: function (elem, path, folder) { - var curPath = elem.getAttribute('data-path').split('/'), - name = curPath.pop(), // 2016-08-21.11.18.59-0.rec entfernen - i, - endPos= 0; - curPath = curPath.join('/') + '/'; + }, + update: function () { + epgd.ajax({ url: epgd.login.url + "data/updaterecordings" }, function (data) { + epgd.utils.topInfo(epgd.tr.pages.records.refreshMessage.replace('$sec$', 5), { autoClose: 5000 }); + $(window).trigger("epgd_close.records"); + window.setTimeout(function () { epgd.pages.records.render(); }, 5000); + }); + }, + move: function (elem, path, folder) { + var curPath = elem.getAttribute('data-path').split('/'), + name = curPath.pop(), // 2016-08-21.11.18.59-0.rec entfernen + i, + endPos= 0; + curPath = curPath.join('/') + '/'; for (i = 0; i < Math.min(path.length, curPath.length) && path[i] == curPath[i]; i++) { if (path[i] == '/') endPos= i; - } - curPath = window.prompt(epgd.tr.pages.records.moveMessage.replace("$src$", curPath), path.concat(curPath.slice(endPos)).replace(/\/{2,}/g, '/').replace(/\/$/, '')); - if (curPath) { - epgd.ajax({ url: epgd.login.url + 'data/renamerecording?starttime=' + elem.getAttribute('data-start') + '&md5path=' + elem.getAttribute('data-md5') + '&owner=' + elem.getAttribute('data-owner') + '&name=' + curPath.replace(/\//g, '~'), async: true }, function (data) { - data = data.result; + } + curPath = window.prompt(epgd.tr.pages.records.moveMessage.replace("$src$", curPath), path.concat(curPath.slice(endPos)).replace(/\/{2,}/g, '/').replace(/\/$/, '')); + if (curPath) { + epgd.ajax({ url: epgd.login.url + 'data/renamerecording?starttime=' + elem.getAttribute('data-start') + '&md5path=' + elem.getAttribute('data-md5') + '&owner=' + elem.getAttribute('data-owner') + '&name=' + curPath.replace(/\//g, '~'), async: true }, function (data) { + data = data.result; if (data && data.state == 200) { var $elem = $(elem), $counter = $elem.prevAll('h4').find('span'), @@ -390,15 +391,15 @@ epgd.pages.records = { epgd.pages.records.sort(folder); epgd.utils.topInfo(epgd.tr.dataSaved); epgd.pages.records.__updateRec(elem); - } + } else { - epgd.utils.topInfo(data.message, { isError: 1 }); + epgd.utils.topInfo(data.message, { isError: 1 }); return false; - } - }); - } - return !!curPath; - }, + } + }); + } + return !!curPath; + }, __updateRec: function (elem, cnt) { epgd.ajax({ url: epgd.login.url + 'data/recording?starttime=' + elem.getAttribute('data-start') + '&path=' + elem.getAttribute('data-path') + '&owner=' + elem.getAttribute('data-owner') + '&'+cnt, async: true }, function (data) { $(elem).attr('data-md5', data.recording.md5path).draggable("enable").removeClass("ui-state-disabled"); @@ -411,20 +412,20 @@ epgd.pages.records = { window.setTimeout(epgd.pages.records.__updateRec, 3000,elem,++cnt); return true; }); - }, + }, del: function (elem) { epgd.ajax({ url: epgd.login.url + 'data/deleterecording?starttime=' + elem.getAttribute('data-start') + '&md5path=' + elem.getAttribute('data-md5') + '&owner=' + elem.getAttribute('data-owner'), async: true }, function (data) { - data = data.result; + data = data.result; if (data && data.state == 200) { - epgd.utils.topInfo(elem.getAttribute('data-path') + '
    ' + epgd.tr.dataSaved); + epgd.utils.topInfo(elem.getAttribute('data-path') + '
    ' + epgd.tr.dataSaved); $(elem).parents('.folder:not(:last)').find('>h4>span').each(function () { this.innerHTML = '(' + (parseInt(this.innerHTML.slice(1, -1), 10) - 1) + ')'; - }); - $(elem).remove(); - } else + }); + $(elem).remove(); + } else epgd.utils.topInfo(elem.getAttribute('data-path') + '
    ' + data.message, { isError: 1 }); - }); - }, + }); + }, sort: function (con, sort) { var $elems = $(con).find('>div.rec'), dir = sort % 2 ? 1 : -1, @@ -440,9 +441,9 @@ epgd.pages.records = { $(con).find('>div.folder').each(function () { epgd.pages.records.sort(this, sort); }); - } -}; -/* + } +}; +/* $.widget("ui.draggable", $.ui.draggable, { _mouseStart: function (ev) { if (this.options.beforeStart && this.options.beforeStart(ev) === false) diff --git a/http/www/epgd.js b/http/www/epgd.js index a1c7d51..7fba5d6 100644 --- a/http/www/epgd.js +++ b/http/www/epgd.js @@ -1 +1 @@ -var epgd={};epgd.tr={oClock:"Uhr",minutes:"min",save:"speichern",copy:"kopieren",apply:"übernehmen",close:"schließen",clear:"löschen",yes:"ja",no:"nein",edit:"bearbeiten",cancel:"abbrechen",del:"löschen",test:"testen",reload:"neu laden",advanced:"erweitert",markAll:"alle markieren",markNone:"keinen markieren",markToggle:"Markierung umdrehen",confirmDelete:"Willst du wirklich löschen?",dataSaved:"Daten wurden gespeichert",dataDeleted:"Daten wurden gelöscht",dataSend:"Daten wurden gesendet",channel:"Kanal",date:"Datum",entries:" Einträge",error:{error:"Fehler",common:"Es ist ein allgemeiner Fehler aufgetreten",serverNotResponse:"Der Server konnte nicht erreicht werden!",notImplemented:"Dieses Feature ist zur Zeit noch nicht implementiert",forbidden:"Zugriff verweigert!",noData:"Für diese Anfrage konnten keine Daten ermittelt werden!",emptyField:"Bitte fülle das Feld $field$ aus!",invalid:"Der eingegebene Wert ist ungültig!"},menu:{now:"Programm",magazine:"Magazin",timer:"Timer",records:"Aufnahmen",search:"Suche",options:"Einstellungen",help:"Hilfe"},pages:{now:{at:"am"},timer:{timerList:"Timer",searchTimerList:"Suchtimer",timersDone:"kürzliche Aufträge",timerListDone:"Auftragshistorie",timerJobList:"asynchrone Aufträge",messageList:"Systemmeldungen"},timerList:{empty:"Keine Timer vorhanden!",startTime:"Anfang",endTime:"Ende",folder:"Verzeichnis",file:"Dateiname",recordTime:"Aufnahmezeit",lifetime:"Lebenszeit",prio:"Priorität",inactive:"Inaktiv",newTimer:"Neuen Timer anlegen",namingMode:"Ermittlung des Dateinamens",namingModes:["VDR","Auto","Constable","Serie","Kategorisiert","Usermode","Template"],template:"Template",templateFields:{"%title%":": Titel (EPG)","%shorttext%":": Untertitel (EPG)","%starttime%":": Startzeit (EPG)","%year%":": Jahr (EPG)","%category%":": Kategorie (EPG)","%episodname%":": Titel der Serie (constabel)","%shortname%":": Kurz-Titel der Serie (constabel, optional)","%partname%":": Name der Folge (constabel)","%season%":": Staffel (constabel)","%part%":": Teil der Staffel (constabel)","%number%":": Nummer über alle Staffeln (constabel)","%extracol1%":": Zusätzliche Angaben z.B. bei Tatort die Ermittler (constabel, optional)","%extracol2%":": ... z.B. bei Tatort der Ort (constabel, optional)","%extracol3%":": ... z.B. bei Tatort der Sender (constabel, optional)"},episode:"Serientitel",noEpgMatch:"Ignoriere fehlende EPG Info",noRepeat:"Wiederholungen vermeiden",searchTimerReload:"Suchtimer updaten",chInclude:"Auf Kanäle einschränken",chExclude:"Kanäle ausschließen",nextDays:"innerhalb der nächsten $field$ Tage",confirmSaveBigResult:"Die Suche ergibt $cnt$ Treffer, trotzdem speichern?",timerStates:{D:"gelöscht",E:"Fehler",F:"Aufnahme erfolgreich",P:"wartet auf Aufnahmebeginn",R:"nimmt gerade auf...",U:"unbekannt"},timerActions:{C:"Timer wurde erstellt und muss noch von einem VDR übernommen werden",D:"Timer wurde gelöscht und muss noch im VDR gelöscht werden",F:"Zuweisung Timer an VDR fehlgeschlagen",M:"Timer wurde verändert und muss noch vom VDR verarbeitet werden"},doneStates:{f:"Timer konnte nicht erstellt werden",C:"Timer bereits erstellt",D:"Timer gelöscht",F:"Aufnahme fehlgeschlagen",Q:"Timer in Vorbereitung",R:"Aufnahme fertig"},messageStates:{N:"Neu",R:"gelesen"},messageTypes:{I:"Information",W:"Warnung",E:"Fehler",F:"Fataler Fehler"},chFormat:"bevorzugtes Sendeformat"},eventDetail:{record:"Aufnehmen",repeat:"Wiederholungen",ch_switch:"umschalten",eventNext:"nachfolgend",eventPrev:"vorher",parentalrating:"ab ",mergeSrc:"Quelle ",genre:"Genre",category:"Kategorie",country:"Land",year:"Jahr",season:"Staffel",part:"Folge",number:"Folge Insgesamt",extentedInfo:"weitere Informationen",scrapperMovieInfo:"Filminformation",scrapperSerieInfo:"Serieninformation",constabelInfo:"Constabel Episodenliste",addConstableLink:"Link erzeugen",loginConstable:"Login",title:"Titel",original_title:"Originaltitel",runtime:"Laufzeit",lang:"Sprache",release_date:"Erscheinungsdatum",actors:"Schauspieler",network:"Netzwerk",seriesstatus:"Status",gueststars:"Gäste",homepage:"Webseite",popularity:"Beliebtheit",vote_average:"ø Bewertung",extInfo:{director:"Regie",camera:"Kamera",screenplay:"Drehbuch",producer:"Produktion",music:"Musik",moderator:"Moderator",commentator:"Kommentator",guest:"Gäste",info:"Info",other:"Sonstige"}},options:{profile:"allgemein",editChannels:"Kanäle bearbeiten",editUser:"Benutzer bearbeiten"},editChannels:{menu:{channelList:"Kanalliste",referenceList:"Referenzliste",insertAsText:"als Text einfügen",extentEmptyChannelNames:"leere Kanalnamen ergänzen",applyAllChannelNames:"Alle Kanalnamen übernehmen",applyChannelSort:"Kanalsortierung übernehmen"},headline:"Sortierung der Kanäle durch drag und drop, Blockmarkierung durch zus. gedrückter shift-Taste",checkWeb:"Kanal in Webansicht anzeigen",checkVDR:"Kanal zum VDR übertragen",desc_insertList:"Kopiere den Inhalt einer channels.conf in das Textfeld unten. Eine vollständige Liste gibt es beispielsweise hier:"},editUser:{user:"Benutzer",sel:"auswählen",add:"neu anlegen",active:"Aktiv",inActive:"Inaktiv",rights:{label:"Rechte",umConfig:"Konfiguration lesen",umConfigEdit:"Konfiguration ändern",umConfigUsers:"Benutzer konfigurieren",umTimer:"Timer lesen",umTimerEdit:"Timer bearbeiten",umSearchTimer:"Suchtimer lesen",umSearchTimerEdit:"Suchtimer bearbeiten",umFsk:"FSK",umRecordings:"Aufnahmen lesen",umRecordingsEdit:"Aufnahmen editieren"}},help:{url:"lang/hilfe.html",noHelp:"Hierzu konnte kein Hilfstext gefunden werden"},search:{search:"suchen",searchName:"Name",searchExpression:"Suchausdruck",caseSensitive:"Klein-/Großschreibung",searchModes:["exakte Übereinstimmung","regulärer Ausdruck","Muster","enthalten in"],searchFields:["Titel","Kurztext","Beschreibung"],empty:"Leider nichts gefunden.",matchdensity:"Treffergenauigkeit"},login:{label:"Login",userName:"Benutzername",password:"Passwort",loggedAlwaysIn:"angemeldet bleiben",logout:"Abmelden",error:"Fehler beim Anmelden!",logoutMessage:"Du wurdest abgemeldet!",needLogin:"Login erforderlich"},records:{ddLabel:"Drag und Drop",refreshMessage:"Aufnahmelisten werden neu geladen, Seite lädt in $sec$ Sekunden neu",moveMessage:"Aufnahme verschieben von \n$src$\nnach",notFoundMessage:"Aufnahme nicht gefunden, ggf einmal aktualisieren",deleteMessage:"Soll die Aufnahme $src$ wirklich gelöscht werden?",available:"Verfügbar",commonRecFolder:"gemeinsame Aufnahmen",similarTimer:"ähnliche Sendung aufnehmen"},profile:{mailReceiver:"eMail",sendTCC:"sende Mail bei Timerkonflikten",sendMessages:"sende Mail bei Systemmeldungen",magazinePan:"Scrollgeschwindigkeit in Minuten
    (0 = aus)",magazinePanDelay:"Auslöseverzögerung",maxListEntries:"maximal Anzahl Einträge, die auf einmal vom Server geladen werden sollen, z.B. bei Suchen, Suchtimern usw.",system:{label:"epgd Backend"},vdr:{startWithSched:"EPG Menü startet mit Schedule"},record:{subFolderSort:"Sortierung der Unterordner"}}},dateTimePicker:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayNamesMin:["So","Mo","Di","Mi","Do","Fr","Sa"],weekHeader:"KW",timeOnlyTitle:"Zeit wählen",timeText:"Sendungsbeginn",timeTextBetween:"zwischen",prevText:"<Zurück",nextText:"Vor>",currentText:"Jetzt",closeText:"Fertig",hourText:"Stunde",minuteText:"Minute",secondText:"Sekunde",millisecText:"Millisekunde",microsecText:"Mikrosekunde",timezoneText:"Zeitzone",timeFormat:"HH:mm",dateFormat:"D, dd.mm.yy",amNames:["vorm.","AM","A"],pmNames:["nachm.","PM","P"],isRTL:false,showMonthAfterYear:false,yearSuffix:""}};epgd.profile={needLogin:-1,channelLogoPath:"data/channellogo",eventImgPath:"data/eventimg",movieMediaPath:"data/moviemedia",serieImgPath:"data/seriesmedia",movieActorPath:"http://www.themoviedb.org/person/",serieSeasonPath:"http://www.thetvdb.com/?tab=seasonall&id=",constabelEditPath:"https://www.eplists.de/eplist.cgi?action=edit&back=&file=",constabelLinkPath:"https://www.eplists.de/eplist.cgi?action=show_form_redir&linkname=",minEventTime:0,maxEventTime:0,logoShowName:0};epgd.userProfile_defaults={defaultVDRuuid:"",constabelLoginPath:false,pickerFirstDay:"6",quickTimes:"",startWithSched:0,startPage:"menu_options",namingModeSerie:"0",namingModeSearchSerie:"0",namingModeMovie:"0",namingModeSearchMovie:"0",namingModeSerieTemplate:"",namingModeSearchSerieTemplate:"",namingModeMovieTemplate:"",namingModeSearchMovieTemplate:"",chFormat:"",timerDefaultVDRuuid:"",searchAdv:"0",mailReceiver:"",messageMailTypes:"",magazinePan:10,magazinePanDelay:400,maxListEntries:100,ratings:"",recordSubFolderSort:1};epgd.profile_load=function(b){var a=$.extend(epgd.profile,epgd.userProfile_defaults);epgd.ajax({url:epgd.login.url+"data/parameters",async:false,cache:false,dataType:"json"},function(l){var m,g,d,c,e,h={};for(g in l.parameters){m=l.parameters[g];c=a[m.name];if(c!=undefined&&c!=m.value){a[m.name]=m.type===0?parseInt(m.value,10):m.value;h[m.name]=c;if(m.name.indexOf("logo")==0){epgd.channels.isDirty=true}}}if(epgd.utils.timeOffset==null){epgd.utils.timeOffset=(l.timezone-new Date().getTimezoneOffset()*60)*1000;e=epgd.utils.now();epgd.$dtPicker.datetimepicker("setDate",new Date(e.setMinutes(parseInt(e.getMinutes()/15,10)*15)))}if(!a.minEventTime){e=epgd.utils.now();a.minEventTime=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0).getTime()/1000;h.minEventTime=0}if(!a.maxEventTime){a.maxEventTime=a.minEventTime+8*24*60*60-60;h.maxEventTime=0}for(d in h){$(window).trigger("profile_updated",h);break}epgd.channels.isDirty&&epgd.channels.load()})};epgd.pages={};epgd.login={user:"",session:"",rights:-1,url:""};epgd.rights={umConfig:2,umConfigEdit:4+2,umConfigUsers:8,umTimer:64,umTimerEdit:128+64,umSearchTimer:256+64,umSearchTimerEdit:512+256+128+64,umFsk:4096,umRecordings:32768,umRecordingsEdit:65536+32768};epgd.utils={timeOffset:null,now:function(){return new Date(new Date().getTime()-this.timeOffset)},date:function(a){return new Date(a*1000-this.timeOffset)},unixTime:function(a){return a?parseInt((a.getTime()+this.timeOffset)/1000,10):0},formatTime:function(a){var b=new Date(a*1000-this.timeOffset);return new String(100+b.getHours()).slice(1)+":"+new String(100+b.getMinutes()).slice(1)},formatDateTime:function(b,a){var c=new Date(b*1000-this.timeOffset);return $.datepicker.formatDate((a||epgd.tr.dateTimePicker.dateFormat),c)+" "+new String(100+c.getHours()).slice(1)+":"+new String(100+c.getMinutes()).slice(1)},formatDate:function(b,a){var c=new Date(b*1000-this.timeOffset);return $.datepicker.formatDate((a||epgd.tr.dateTimePicker.dateFormat),c)},popup:function(b,c){var d=$(window),a;c=$.extend({autoOpen:true,dialogClass:"popup",show:{effect:"blind",duration:1000},hide:{effect:"explode",duration:1000},width:400,height:200,maxWidth:d.width()*0.8,maxHeight:d.height()*0.7},c);a=$('

    '+b+"

    ").dialog(c);c.autoClose&&window.setTimeout(function(){a.dialog("close").dialog("destroy")},c.autoClose);return a},confirm:function(a,c){var b={modal:true,buttons:{}};b.buttons[epgd.tr.yes]=function(){$(this).dialog("close");c(true)};b.buttons[epgd.tr.no]=function(){$(this).dialog("close");c(false)};this.popup(a,b)},topInfo:function(b,c){var e=c&&c.isError,d,a;c=$.extend({autoClose:e?0:3000,className:"ui-state-"+(e?"error":"highlight")},c);a=(c.autoClose||3000)/2;d=$('
    '+b+'
    ').appendTo(epgd.$menu).animate({opacity:0.4},a,function(){d.animate({opacity:1},a)});c.autoClose&&window.setTimeout(function(){d.remove()},c.autoClose)},sendMail:function(c,a,b,d){epgd.ajax({url:epgd.login.url+"data/sendmail",type:"post",data:JSON.stringify({receiver:(d||epgd.profile.mailReceiver),subject:c,body:a,mimetype:b})},function(e){e=e.result;if(e&&e.state==200){epgd.utils.topInfo(epgd.tr.dataSend)}else{epgd.utils.topInfo(e.message,{isError:1})}epgd.profile_load()})},loader:{$win:$('
    '),cnt:0,process:function(b,c){var a=this;this.cnt++;this.$win.appendTo(document.body).stop().animate({opacity:0.7},{always:function(){try{b()}catch(d){epgd.utils.log((d.message||"common error")+"\n"+(d.stack||""),0);a.close()}!c&&a.close()}},200)},close:function(){if(this.cnt>0){this.cnt--;this.cnt==0&&this.$win.remove()}}},addAutoComplete:function(d,b){var c=$(d),e=c[0].className,a=c[0].style.width||"";$(d).autocomplete($.extend({minLength:0,multiselect:false,create:function(i,m){var l=$(this).autocomplete("instance"),n=l.options,k,h;l.selectedItems={};if(n.multiselect){l.multiselect=$("
    ").addClass("ui-autocomplete-multiselect ui-state-default ui-widget "+e).css("width",a).insertBefore(l.element).append(l.element).bind("click.autocomplete",function(){l.element.focus()});l.menu.element.css({height:"300px","overflow-y":"auto"});k=parseInt(l.element.css("fontSize")||10,10);function g(p){var o=$(this);o.width(1).width(this.scrollWidth+k-1)}h=$.ui.keyCode;l.element.bind({"keydown.autocomplete":function(p){if((this.value==="")&&(p.keyCode==h.BACKSPACE)){var o=l.element.prev();delete l.selectedItems[o.text()];o.remove()}},"focus.autocomplete blur.autocomplete":function(){l.multiselect.toggleClass("ui-state-active")},"keypress.autocomplete change.autocomplete focus.autocomplete blur.autocomplete":g}).trigger("change");n.select=n.select||function(p,o){if(!l.selectedItems[o.item.label]){$("
    ").addClass("ui-autocomplete-multiselect-item").text(o.item.label).append($("").addClass("ui-icon ui-icon-close").click(function(){var q=$(this).parent();delete l.selectedItems[q.text()];q.remove()})).insertBefore(l.element);l.selectedItems[o.item.label]=o.item}l._value("");return false}}else{n.select=n.select||function(p,o){l.selectedItems[0]=o.item;l._value(o.item.label);return false}}}},b)).focus(function(){$(this).autocomplete("search","")})},getAutoCompleteValues:function(i,c){c=c||"";var b="",a=","+c,g,d;try{g=$(i).autocomplete("instance").selectedItems;for(d in g){b+=a+g[d].value+c}}catch(h){}return b.slice(1)},setAutoCompleteValues:function(g,a){var d=$(g).autocomplete("instance"),c,b,e;d.multiselect&&d.multiselect.find(">div").remove();d.selectedItems={};if(a){for(b=0;b',e;for(e in a){c+='
  • '+e+""+a[e]+"
  • "}b.$placeholders=$(c+"
").hide().insertAfter(b).click(function(i){var k=i.target.nodeName=="B"?$(i.target).text():i.target.nodeName=="LI"?$(i.target.firstChild).text():null,l=$(b).prop("selectionStart"),h=$(b).val();if(k){$(b).val(h.substring(0,l)+k+h.substring(l,h.length)).focus();l+=k.length;if(b.setSelectionRange){b.setSelectionRange(l,l)}else{if(b.createTextRange){h=b.createTextRange();h.collapse(true);h.moveEnd("character",l);h.moveStart("character",l);h.select()}}}$(this).hide()});$(b).keydown(function(h){if(h.key==d){$(document).one("click",function(){b.$placeholders.hide()});b.blur();return !b.$placeholders.show().position({my:"left top",at:"left bottom",of:b})}})},inherits:function(a,c){var b=function(){};b.prototype=c.prototype;a.prototype=new b();a.prototype.constructor=a;a.base=c.prototype;return a},log:function(a,c){console.log("error:"+a);try{$.ajax({url:"data/log",type:"get",async:true,cache:false,data:"level="+(c||0)+"&message="+escape(a)})}catch(b){}}};epgd.init=function(){epgd.$con=$('
').appendTo(document.body);$.datepicker.setDefaults(epgd.tr.dateTimePicker);$.datepicker.setDefaults({showOtherMonths:true,selectOtherMonths:true});$.timepicker.setDefaults(epgd.tr.dateTimePicker);$.timepicker.setDefaults({timeInput:true,controlType:{create:function(b,g,e,h,c,a,d){if(e=="hour"){if(!b.inst.settings.timeOnly){$("#ui-datepicker-div").width(($(window).width()>500?430:230)+"px")}$("0246810
121416182022").appendTo(g).bind("click",{tp_inst:b,obj:g,unit:e},$.timepicker.quicklink)}else{if(e=="minute"){$("0153045").appendTo(g).bind("click",{tp_inst:b,obj:g,unit:e},$.timepicker.quicklink)}else{if(e=="second"&&epgd.profile.quickTimes){g.closest("dl").find(".ui_tpicker_time").removeClass().bind("click",{tp_inst:b,obj:g,unit:"time"},$.timepicker.quicklink).html('').replace(/~/g,'");if(b.inst.settings.alwaysSetTime){epgd.pages.help.initButtons(b.inst.dpDiv.find(".ui-datepicker-buttonpane").append(epgd.pages.help.getButton("datepicker")))}else{$('").appendTo(b.inst.dpDiv.find(".ui-datepicker-buttonpane")).click(function(){b.$input.val("");$.datepicker._hideDatepicker()})}return g}else{return g}}}$('').prependTo(g).spinner({min:c,max:a,step:d,change:function(k,i){if(k.originalEvent!==undefined){b._onTimeChange()}b._onSelectHandler()},spin:function(k,i){b.control.value(b,g,e,i.value);b._onTimeChange();b._onSelectHandler()}});return g},options:function(a,d,c,b,e){if(typeof(b)=="string"&&e!==undefined){return d.find(".ui-timepicker-input").spinner(b,e)}return d.find(".ui-timepicker-input").spinner(b)},value:function(a,d,b,g){try{if(g!==undefined){return d.find(".ui-timepicker-input").spinner("value",g)}return d.find(".ui-timepicker-input").spinner("value")}catch(c){return false}}}});epgd.$menu=$('").appendTo(document.body).find("ul").hide();epgd.$menu.$maxBut=$('').insertBefore(epgd.$menu).click(function(){epgd.$menu.parent().toggleClass("open")});epgd.$menu.checkMenuSize=function(a,b){if(window.wrm_i){if(window.wrm_w==$(window).width()){window.clearInterval(window.wrm_i);delete window.wrm_i;epgd.$menu.parent().removeClass("mini").width(window.wrm_w).offset({left:$(window).scrollLeft()});epgd.$menu.checkMenuSize(null,b)}else{window.wrm_w=$(window).width()}return}if(a){window.wrm_w=$(window).width();if(!window.wrm_i){window.wrm_i=window.setInterval(epgd.$menu.checkMenuSize,200,null,b)}}else{if(epgd.$menu.height()>40){epgd.$menu.parent().addClass("mini")}window.setTimeout(function(){document.body.style.paddingTop=(epgd.$menu.parent().height()+10)+"px";b&&window.setTimeout(b,200)},200)}};$(window).bind("resize",epgd.$menu.checkMenuSize);epgd.$dtPicker=$('').appendTo(document.body).hide().bind("click",function(){$(this).datepicker("show");return false});epgd.$dtPicker.datetimepicker({beforeShow:function(){this.$overlay=$("
").addClass("ui-widget-overlay ui-front").appendTo(document.body)},onClose:function(){this.$overlay.remove();$(window).trigger("datepicker")},calendarStart:function(){var a=new Date(epgd.profile.minEventTime*1000);leadDays=(a.getDay()-parseInt(epgd.profile.pickerFirstDay,10)+7)%7;a.setHours(12,0);a.setDate(a.getDate()-leadDays);return a}});epgd.$menu.menu({position:{at:"left bottom"},select:function(a,b){var c=b.item.attr("id");if(!c||c.indexOf("menu_")!=0||(a.originalEvent&&a.originalEvent.target.nodeName!="A"&&a.originalEvent.target.nodeName!="LI")){return false}$(window).trigger("epgd_close");epgd.$menu.parent().removeClass("open");$(".menu-active",this).removeClass("menu-active");$(document.body).append(epgd.$dtPicker.hide());epgd.$menu.checkMenuSize(null,function(){try{b.item.addClass("menu-active").parent().parent(".ui-menu-item").addClass("menu-active");epgd.pages[c.slice(5)].render()}catch(d){epgd.utils.popup(epgd.tr.error.common,{title:epgd.tr.error.error});epgd.utils.log((d.message||"common error")+"\n"+(d.stack||""),2)}})}});$(window).bind("epgd_close",function(){$(".epgPopUp").dialog("destroy")}).bind("profile_updated",function(b,a){if(a.minEventTime!=undefined){epgd.$dtPicker.datetimepicker("option",{minDateTime:new Date((epgd.profile.minEventTime=parseInt(epgd.profile.minEventTime,10))*1000),minDate:new Date(epgd.profile.minEventTime*1000)})}if(a.maxEventTime!=undefined){epgd.$dtPicker.datetimepicker("option",{maxDateTime:new Date((epgd.profile.maxEventTime=parseInt(epgd.profile.maxEventTime,10))*1000),maxDate:new Date(epgd.profile.maxEventTime*1000)})}if(a.pickerFirstDay!=undefined){epgd.$dtPicker.datetimepicker("option",{firstDay:epgd.profile.pickerFirstDay})}if(a.defaultVDRuuid!=undefined){$("#menu_vdrs > select").val(epgd.profile.defaultVDRuuid)}if(a.quickTimes!=undefined){epgd.pages.magazine.initQT()}if(a.needLogin!=undefined){epgd.pages.login.doLogin()}}).bind("login_changed",function(a,b){epgd.$menu.html("").hide();epgd.$con.html("");if(epgd.login.rights){epgd.$menu.append('");epgd.$menu.append('");(epgd.login.rights&epgd.rights.umTimer)==epgd.rights.umTimer&&epgd.$menu.append("
  • "+epgd.tr.menu.timer+'
  • ");(epgd.login.rights&epgd.rights.umRecordings)==epgd.rights.umRecordings&&epgd.$menu.append('");epgd.$menu.append('");epgd.$menu.append("
  • "+epgd.tr.menu.options+'
  • ");epgd.$menu.append('");epgd.$menu.append('')}epgd.profile.needLogin=="1"&&epgd.$menu.append('");if(epgd.login.user!=b.user){epgd.profile_load();epgd.channels.isDirty=true;epgd.vdrs.list=null}epgd.channels.load();epgd.vdrs.load();epgd.$menu.show().menu("refresh");epgd.$menu.menu("select",{target:$(epgd.login.rights?(location.hash||"#"+epgd.profile.startPage||"#menu_profile"):"#menu_login")})}).bind("vdrs_load",function(){html="";for(var a in epgd.vdrs.list){html+='"}$("").replaceAll("#menu_vdrs > select").show().change(function(){var b=epgd.vdrs.current=epgd.vdrs.get(this[this.selectedIndex].value);if(b&&b.osd2webp){$("#osd2web").prop("target","osd2web_"+b.name).prop("href","http://"+b.ip+":"+b.osd2webp).click(function(c){c.stopPropagation();return true}).show()}else{$("#osd2web").hide()}}).mousedown(function(b){b.stopPropagation();return true}).click(function(b){return false}).change()}).bind("unload",function(){if(epgd.login.session){epgd.pages.login.doLogin("logout")}});epgd.pages.now.init();epgd.pages.magazine.init();epgd.profile_load();if(epgd.profile.needLogin==-1){epgd.profile.needLogin=0;epgd.pages.login.doLogin()}window.setInterval(epgd.profile_load,3600000)};window.onerror=function(i,g,b,d,c){var a=!d?"":"\ncolumn: "+d;a+=!c?"":"\nerror: "+c.stack;try{epgd.utils.log(i+"\nline: "+b+a,2)}catch(h){}return true};$.widget("custom.catcomplete",$.ui.autocomplete,{_create:function(){this._super();this.widget().menu("option","items","> :not(.ui-autocomplete-category)")},_renderMenu:function(c,b){var d=this,a="";$.each(b,function(g,h){var e;if(h.category!=a){c.append("
  • "+h.category+"
  • ");a=h.category}e=d._renderItemData(c,h);if(h.category){e.attr("aria-label",h.category+" : "+h.label)}})}});$.datepicker._gotoToday=function(c){var b=this._getInst($(c)[0]),a=epgd.utils.now();this._base_gotoToday(c);this._setTime(b,a);this._setDate(b,a);this._hideDatepicker()};$.timepicker.quicklink=function(b){var g=b.target.nodeName=="I"?b.target.firstChild:b.target,a,i=null,h=false;try{a=b.data.tp_inst||$.datepicker._getInst(epgd.$dtPicker[0]).settings.timepicker}catch(c){epgd.utils.log((c.message||"common error")+"\n"+(c.stack||""),2);return false}if(g.nodeName=="U"){if(b.data.unit=="time"){i=$.datepicker.parseTime(a._defaults.timeFormat,g.innerHTML,a._defaults)}else{if(b.data.unit=="hour"){i={hour:parseInt(g.innerHTML,10),minute:a.minute}}}if(i){if(i.hour"+$('label[for="'+a.id+'"]').text()+"
    ":"")+"
    "+b+"
    ",{autoClose:3000});a&&a.focus();return false},loadFolder:function(){var a=this;epgd.ajax({url:epgd.login.url+"data/recordingdirs"},function(d){if(d.recordingdirs.length){var b=[],c=epgd.vdrs.list,e;$.each(d.recordingdirs,function(h,g){e=c[g.vdruuid];b.push({value:g.directory,category:e?e.name:"-"})});$(a.form.tFolder).catcomplete("option","source",b)}})},close:function(){if(this.$win){this.$win.dialog("close")}},create:function(){var d=this.options,c=epgd.tr.pages.timerList,b="",a;for(a=1;a'+epgd.tr.dateTimePicker.dayNamesShort[a]}b+=''+epgd.tr.dateTimePicker.dayNamesShort[0];this.$win=$('
    '+b+'


    ');!d.embed&&this.$win.appendTo(document.body).dialog(d);this.$win[0].list=this.list;this.form=this.$win.find("form")[0];$(this.form.tFolder).catcomplete({minLength:0,maxHeight:300}).focus(function(){$(this).catcomplete("search","")});$(this.form.tType).change(function(){if(this.selectedIndex<0){this.selectedIndex=0}this.form.className=this.form.className.replace(/ ?type./,"")+" type"+this[this.selectedIndex].value});$(this.form.tNameMode).change(function(){this.form.tTemplate.parentNode.style.display=(this.selectedIndex==6)?"block":"none"});epgd.utils.addPlaceholders(this.form.tTemplate,"%",c.templateFields);this.loadFolder()},render:function(b){b=b||{};if(!this.$win){this.create()}!this.options.embed&&this.$win.dialog("open").dialog("moveToTop");var c=this.form,e,a;c.tSName.focus();if(b.id){c.tID.value=b.id;this.$win.parent().find("#tBDel").show();this.$win.parent().find("#tBToggle").hide()}else{c.tID.value="";this.$win.parent().find("#tBDel").hide();this.$win.parent().find("#tBToggle").show()}$(c.tType).val(b.type||"R").change();$(c.tVdr).val(b.vdruuid||epgd.profile.timerDefaultVDRuuid);e=b.weekdays||0;for(a=0,f=1;a
    ');$(a.tWeek[0]).parent().before('

      -
    ');$(a.tNameMode).after(' ');$(a.tFolder).parent().after('
    ');$(this.form.tStart).datetimepicker({minDateTime:epgd.utils.now()});$(this.form.tEnd).timepicker({});epgd.utils.addAutoComplete(a.tChannel,{source:epgd.channels.autoCompleteData});a.tFile=$(a).find("#tFile")[0];a.tEvTime=$(a).find("#tEvTime")[0];a.tTitle=$(a).find("#tTitle").click(function(){if(a.tEvID.value){epgd.utils.loader.process(function(){new epgd.eventDetail(a.tEvID.value).render()})}})[0]};epgd.timerDialog.prototype.render=function(a){a=a||{};epgd.timerDialog.base.render.call(this,a);var b=this.form,c;b.tFile.innerHTML=a.file||"...";b.tEvID.value=a.eventid||"";epgd.utils.setAutoCompleteValues(b.tChannel,a.channelid?[a.channelid]:null);b.tTitle.innerHTML=a.title||"";b.tEvTime.innerHTML=a.evStartTime?epgd.utils.formatDateTime(a.evStartTime)+" - "+epgd.utils.formatTime(a.evStartTime+a.evDuration):"";$([b.tStart,b.tEnd]).datetimepicker("option","disabled",!!a.eventid);if(a.day||!a.evStartTime){if(a.starttime){c=epgd.utils.date((a.day+parseInt(a.starttime/100,10)*60*60+(a.starttime%100)*60))}else{if(a.day){c=epgd.utils.date(a.day)}else{c=epgd.utils.now()}}$(b.tStart).datetimepicker("setDate",c);$(b.tStart).datetimepicker("setTime",c);if(a.endtime){c=epgd.utils.date((a.day+parseInt(a.endtime/100,10)*60*60+(a.endtime%100)*60))}else{c=new Date(c.getTime()+2*60*60000)}$(b.tEnd).datetimepicker("setTime",c)}else{$([b.tStart,b.tEnd]).val("...")}b.tNameMode.selectedIndex=typeof a.namingmode=="undefined"?parseInt(a.category=="Serie"?epgd.profile.namingModeSerie:epgd.profile.namingModeMovie,10):a.namingmode;b.tTemplate.value=a.template||(a.category=="Serie"?epgd.profile.namingModeSerieTemplate:epgd.profile.namingModeMovieTemplate);$(b.tNameMode).change()};epgd.timerDialog.prototype.getData=function(g){var b=this.form,e,a,c={};if(b.tEvID.value){c.eventid=parseInt(b.tEvID.value,10)}c.active=b.tInactive.checked?0:1;if(b.tID.value){c.id=parseInt(b.tID.value,10)}if(b.tStart.value&&b.tStart.value!="..."){e=$(b.tStart).datepicker("getDate");c.starttime=e.getHours()*100+e.getMinutes();e.setHours(0);e.setMinutes(0);c.day=parseInt(e.getTime()/1000,10);c.endtime=parseInt(b.tEnd.value.replace(":",""),10)}else{if(!c.eventid&&!g){return this.showError(epgd.tr.error.emptyField.replace("$field$",epgd.tr.pages.timerList.recordTime),b.tStart)}}c.weekdays=0;for(a=0,f=1;a
    ').insertAfter(this.form)))}else{this.searchResultList.$con.find("tbody").empty()}if(!this.searchResultList.$con.parent().length){this.searchResultList.$con.insertAfter(this.form);this.searchResultList.init()}this.searchResultList.update(b||this.getData());this.searchResultList.$con[0].scrollIntoView(true)};epgd.searchTimerDialog.prototype.create=function(){epgd.searchTimerDialog.base.create.call(this);var c=epgd.tr.pages.timerList,e=epgd.tr.pages.search,d="",b=this.form,a;for(a in e.searchModes){d+='"}if(!epgd.categories){epgd.categories=[];epgd.ajax({url:"data/categories",async:false},function(g){epgd.categories=g.categories})}if(!epgd.genres){epgd.genres=[];epgd.ajax({url:"data/genres",async:false},function(g){epgd.genres=g.genres})}$(b.tSName).parent().parent().after('
       
    '+[""].concat(e.searchFields).join('')+'
    '+c.episode+' '+epgd.tr.pages.eventDetail.season+' '+epgd.tr.pages.eventDetail.part+'
    '+epgd.tr.pages.eventDetail.category+'
    '+epgd.tr.pages.eventDetail.genre+'
    GoldTippTagesTippTopTipp
    '+epgd.tr.pages.eventDetail.year+'
    '+c.noEpgMatch+'
    '+[""].concat(e.searchFields).join('')+'
    "+epgd.pages.help.getIcon("sTChannels")+'
    ");$(b.tWeek[0]).before(""+epgd.tr.dateTimePicker.timeTextBetween+' - ').parent().append('
    '+c.nextDays.replace("$field$",'')+"").insertAfter(b.tTime.parentNode);$([b.tStart,b.tEnd]).timepicker({alwaysSetTime:false});$([b.tTime,b.tRepeat,b.tAdv]).change(function(){$(this).parent().next().toggle(this.checked)});$([b.tSFSeason,b.tSFSPart,b.tSFYear]).change(function(){this.value=this.value.replace(/[^0-9-]/g,"");if(this.value.length==1&&this.value=="-"){this.value=""}});$(b.tType).append('");epgd.utils.addAutoComplete(b.tChannels,{source:epgd.channels.autoCompleteData,multiselect:true});epgd.utils.addAutoComplete(b.tSFCat,{source:epgd.categories,multiselect:true});epgd.utils.addAutoComplete(b.tSFGenre,{source:epgd.genres,multiselect:true})};epgd.searchTimerDialog.prototype.render=function(b){b=b||{searchfields:1};epgd.searchTimerDialog.base.render.call(this,b);var c=this.form,e,a;c.tExpr.value=b.expression||"";$(c.tSMode).val(b.searchmode||4);c.tCaseSens.checked=b.casesensitiv==1;e=b.searchfields||0;for(a=0,f=1;a0;$(c.tRepeat).change();c.tSFEpisode.value=b.episodename||"";c.tSFSeason.value=b.season||"";c.tSFSPart.value=b.seasonpart||"";c.tSFYear.value=b.year||"";epgd.utils.setAutoCompleteValues(c.tSFCat,new String(b.category).replace(/'/g,"").split(","));epgd.utils.setAutoCompleteValues(c.tSFGenre,new String(b.genre).replace(/'/g,"").split(","));e=b.tipp||"";for(a=0;a=0}c.tSFNoEpgMatch.checked=b.noepgmatch==1;c.tAdv.checked=b.episodename||b.season||b.seasonpart||b.year||b.category||b.genre||b.tipp||b.noepgmatch;$(c.tAdv).change();epgd.utils.setAutoCompleteValues(c.tChannels,new String(b.channelids).split(","));if(b.chexclude){c.tChExclude1.checked=1}else{c.tChExclude0.checked=1}c.tChFormat.value=b.chformat||(b.id?"":epgd.profile.chFormat);c.tNameMode.defaultIndex=parseInt(b.category=="Serie"?epgd.profile.namingModeSearchSerie:epgd.profile.namingModeSearchMovie,10);c.tNameMode.selectedIndex=typeof b.namingmode=="undefined"?c.tNameMode.defaultIndex:b.namingmode;c.tTemplate.value=typeof b.template=="undefined"?(b.category=="Serie"?epgd.profile.namingModeSearchSerieTemplate:epgd.profile.namingModeSearchMovieTemplate):b.template;$(c.tNameMode).change();this.$win.parent().find("#tBCopy").toggle(!!b.id)};epgd.searchTimerDialog.prototype.getData=function(g){var b=this.form,e,a,c={expression:b.tExpr.value};if(b.tSFSeason.value){c.season=b.tSFSeason.value}if(b.tSFSPart.value){c.seasonpart=b.tSFSPart.value}if(b.tSFYear.value){c.year=b.tSFYear.value}if(!g){if(!c.expression){return this.showError(epgd.tr.error.emptyField.replace("$field$",epgd.tr.pages.search.searchExpression),b.tExpr)}if(c.season&&!/^[0-9]{0,3}-?[0-9]{0,3}$/.test(c.season)){return this.showError(epgd.tr.error.invalid,b.tSFSeason)}if(c.seasonpart&&!/^[0-9]{0,3}-?[0-9]{0,3}$/.test(c.seasonpart)){return this.showError(epgd.tr.error.invalid,b.tSFSPart)}if(c.year&&!/^((19|20)[0-9]{2})?(-|-(19|20)[0-9]{2})?$/.test(c.year)){return this.showError(epgd.tr.error.invalid,b.tSFYear)}}if(b.tID.value){c.id=parseInt(b.tID.value,10)}if(b.tSFEpisode.value){c.episodename=b.tSFEpisode.value}c.category=epgd.utils.getAutoCompleteValues(b.tSFCat,"'");c.genre=epgd.utils.getAutoCompleteValues(b.tSFGenre,"'");e="";for(a=0;a50){epgd.utils.confirm(epgd.tr.pages.timerList.confirmSaveBigResult.replace("$cnt$",d.count),function(k){k&&epgd.searchTimerDialog.base.save.call(a,h)})}else{epgd.searchTimerDialog.base.save.call(a,h,e,c,g)}epgd.utils.loader.close()})},true)};epgd.searchDialog=epgd.utils.inherits(function(){epgd.searchTimerDialog.call(this,{id:"search",embed:true,buttons:null});this.searchResultList=new epgd.searchResultList({empty:epgd.tr.pages.search.empty},this)},epgd.searchTimerDialog);epgd.searchDialog.prototype.create=function(){epgd.searchDialog.base.create.call(this);var c=this.form,b=this,a=$('
    ').appendTo(this.$win);$('").insertAfter(c.tExpr).after('  ");$(c.tType).parent().hide().parent().css("border-top","1px solid #ccc").insertAfter($(c.tVdr.parentNode.parentNode).hide());$('').insertAfter(c.tSName).click(function(){b.form.tID.value="";b.form.tSName.value+=" copy";b.form.tSName.select()}).prop("disabled",true);$('').insertAfter(c.tSName).click(function(){b.list.del(this.form.tID.value,function(){b.form.tID.value="";b.loadSavedSearch()})}).prop("disabled",true);$('').insertAfter(c.tSName).click(function(){var e=b.getData();if(!e.name){return this.showError(epgd.tr.error.invalid,c.tSName)}b.save(e,null,null,function(){b.loadSavedSearch()})});$(c).submit(function(){b.search(a);return false});this.$win.find("#sExpr").keyup(function(d){if(d.keyCode==13){this.form.sSearch.click();$(this).blur()}}).focus();this.$win.find("#sAdv").change(function(){$(c).toggleClass("noAdv",!this.checked);b.resize()}).prop("checked",epgd.profile.searchAdv=="1").change();$(c.tSName).autocomplete({minLength:0,maxHeight:300,source:function(){return false},select:function(e,g){var h=g.item.data||{id:""};if(h.id){b.render(h);b.form.sSearch.click();$([c.tDel,c.tCopy,c.tInactive]).prop("disabled",false);return false}else{c.tID.value="";$([c.tDel,c.tCopy,c.tInactive]).prop("disabled",true)}}}).focus(function(){$(this).autocomplete("search","")});this.loadSavedSearch()};epgd.searchDialog.prototype.loadSavedSearch=function(){var a=this.form;epgd.ajax({url:epgd.login.url+"data/searchtimers?type=S"},function(c){var b=[];$.each(c.searchtimers,function(e,d){b.push({value:d.name||d.expression,label:d.name||d.expression,data:d})});$(a.tSName).autocomplete("option","source",b)})};epgd.searchDialog.prototype.resize=function(){var a=this.$win.find("#searchResult"),b=$(window).height()-a.offset().top-20;if(b<100){a.css({height:"auto","overflow-y":"visible"})}else{a.css({height:b+"px","overflow-y":"auto"})}};epgd.searchDialog.prototype.render=function(a){if(!epgd.$con.find("#search").length){$("#menu_search").addClass("menu-active");this.create();epgd.$con.html("");this.$win.appendTo(epgd.$con)}a=a||{searchfields:1};a.type="S";epgd.searchDialog.base.render.call(this,a)};epgd.searchDialog.prototype.close=function(){};epgd.channels={list:null,autoCompleteData:null,isDirty:false,selBox:$('')[0],load:function(){if(!this.list||this.isDirty){epgd.ajax({url:epgd.login.url+"data/channels",async:false,cache:false},function(d){var b=(epgd.profile.channelLogoPath?epgd.profile.channelLogoPath+"?maxW=70&maxH=50&id=":false),e="",c={},a=[];d.channels&&$.each(d.channels,function(g,h){var k=h.channelid||g;if(h.name){h.html='
    '+(b?''+h.name+''+(epgd.profile.logoShowName=="1"?h.name:""):h.name)+"
    ";h.visible&1&&(e+='")}else{h.html='
    '+k+"
    ";h.visible&1&&(e+='")}c[k]=h;a.push({label:h.name,value:k})});epgd.channels.list=c;epgd.channels.autoCompleteData=a;$(epgd.channels.selBox).html(e);$(window).trigger("channels_load");this.dirty=false})}},getHtml:function(b){var a=this.list[b];return a?a.html:'
    '+b+"
    "},getName:function(b){var a=this.list[b];return a?a.name:b}};epgd.eventDetail=function(a){this.id=a;this.data=null;this.expire=0};epgd.eventDetail.prototype.imgPath=false;epgd.eventDetail.prototype.load=function(b,c){var a=this;epgd.ajax({url:epgd.login.url+"data/event?"+(b&&c?"channelid="+b+"&time="+c:"id="+this.id),async:false,cache:false},function(d){a.data=d.event;a.id=d.id;a.expire=epgd.utils.now().getTime()+900000});return this};epgd.eventDetail.prototype.render=function(){if(this.expire'+epgd.tr.pages.eventDetail.repeat+"").appendTo(d.$con);b={searchfields:1,expression:this.data.title,searchmode:1,casesensitiv:1,fromEventDetail:true};if(this.data.shorttext){b.searchfields1=2;b.expression1=this.data.shorttext}epgd.pages.search.search.call(this,$('
    ').appendTo(d.$con),b)}else{a.click()}};epgd.eventDetail.prototype.doPlay=function(b){var a=parseInt(epgd.utils.now().getTime()/1000,10)-this.data.starttime;if(a<0||a>this.data.duration){return false}if(b){return true}epgd.vdrs.current.switchChannel(this.data.channelid)};epgd.eventDetail.prototype.doPrev=function(c){var b=this.data.starttime-500,a=this;if(bepgd.profile.maxEventTime){return false}if(c){return true}epgd.utils.loader.process(function(){new epgd.eventDetail().load(a.data.channelid,b).render()})};epgd.eventDetail.win=function(){this._create();this.closed=true;this.detail=null;var a=this;$(window).bind("epgd_close.eventDetail",function(){if(!a.closed){a.$win.css("z-Index","");a.$win.hide();$(document).unbind("keyup.eventDetail");a.closed=true;a.$openDialogs&&a.$openDialogs.removeClass("ui-state-disabled")}});$(window).bind("resize.eventDetail",function(b){if(!a.closed){try{a.$win.css("max-width",$(window).width());a.$win.show().position({of:window});a.$con.accordion("refresh")}catch(c){}if(parseInt(a.$win.css("top"),10)<69){a.$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 c=this,b=epgd.tr.pages.eventDetail,a=this.$win.find(".toolbar")[0];this.$rec=$('
    '}}u="";for(q in b.extInfo){if(t[q]){u+=""+b.extInfo[q]+""+t[q]+""}}if(t.scraper&&(a=t.scraper.movie||t.scraper.serie)){a.media=a.media||[];if(a.actors){w="";for(q in a.actors){c=a.actors[q];w+="
    "+(this.movieActorImgPath&&c.actorid?'':"")+''+c.actorname+""+(c.actorrole||"")+"
    "}}if(t.scraper.movie){a.isMovie=true;if(a.media&&this.movieImgPath){if(!p&&a.media["1"]){p=this.movieImgPath+a.movieid+"&media_type=1&maxW=270&maxH=146"}if(a.media["3"]){o=this.movieImgPath+a.movieid+"&media_type=3&maxW=400&maxH=999"}else{if(a.media["1"]){o=this.movieImgPath+a.movieid+"&media_type=1&maxW=400&maxH=999"}}}if(a.actors){w="";for(q in a.actors){c=a.actors[q];w+="
    "+(this.movieActorImgPath?'':"")+''+c.actorname+""+(c.actorrole||"")+"
    "}}if(a.overview){s='
    '+a.overview+"

    "+s}u="

    "+b.scrapperMovieInfo+'

    '+(a.media["1"]&&this.movieImgPath?'':"")+(a.title?"":"")+(a.originaltitle?"":"")+(a.runtime?"":"")+(a.movie_release_date?"":"")+(a.genres?"":"")+(a.voteaverage?"":"")+(a.popularity?"":"")+u+(a.budget?"":"")+(a.revenue?"":"")+(a.homepage?"":"")+"
    "+b.title+""+a.title+"
    "+b.original_title+""+a.originaltitle+"
    "+b.runtime+""+a.runtime+" "+epgd.tr.minutes+"
    "+b.release_date+""+a.movie_release_date+"
    "+b.genre+""+a.genres.replace(/^\||\|$/g,"").replace(/ ?\| ?/g,", ")+"
    "+b.vote_average+'
    ('+a.voteaverage.toFixed(1)+" / 10)
    "+b.popularity+""+a.popularity.toFixed(1)+"
    Budget$"+a.budget+"
    Einnahmen$"+a.revenue+"
    "+b.homepage+''+a.homepage+"
    "+(a.media["0"]&&this.movieImgPath?'':"")}else{a.isSerie=true;if(a.actors){w="";for(q in a.actors){c=a.actors[q];w+="
    "+(this.serieActorImgPath?'':"")+""+c.actorname+""+(c.actorrole?c.actorrole.replace(/\|/g,"
    "):"")+"
    "}}l=a.episode;if(l){if(l.episodeoverview){if(t.longdescription&&l.episodeoverview.length>t.longdescription.length){s=s.replace(/^/i,"")}s='
    '+l.episodeoverview+"
    "+s}s="
    "+l.episodename+"
    "+s;if(l.episodegueststars){w+='
    '+b.gueststars+"

    "+l.episodegueststars.replace(/^\||\|$/g,"").replace(/\|/g,"
    ")}}if(!p&&a.media["10"]&&this.serieImgPath){p=this.serieImgPath+a.seriesid+"&season_number="+l.seasonnumber+"&episode_id="+l.episodeid+"&media_type=10&maxW=270&maxH=146"}if(a.media["7"]){o=this.serieImgPath+a.seriesid+"&season_number=0&episode_id=0&media_type=7&maxW=400&maxh=999"}if(a.seriesoverview){s+=s?'
    Serienbeschreibung
    '+a.seriesoverview+"
    ":"
    "+a.seriesoverview+"
    "}u="

    "+b.scrapperSerieInfo+'

    '+(a.media["1"]&&this.serieImgPath?'':"")+(a.media["10"]&&this.serieImgPath?'':"")+(a.seriesname?"":"")+(a.seriesnetwork?"":"")+(a.seriesstatus?"":"")+(a.seriesfirstaired?"":"")+(a.seriesgenre?"":"")+(a.seriesrating?"":"")+u+(epgd.profile.serieSeasonPath?'":"")+"
    "+b.title+""+a.seriesname+"
    "+b.network+""+a.seriesnetwork+"
    "+b.seriesstatus+""+a.seriesstatus+"
    "+b.release_date+""+a.seriesfirstaired+"
    "+b.genre+""+a.seriesgenre.replace(/^\||\|$/g,"").replace(/ ?\| ?/g,", ")+"
    "+b.vote_average+'
    ('+a.seriesrating.toFixed(1)+" / 10)
    '+b.homepage+"
    "+(a.media["6"]&&this.serieImgPath?'':"")+(a.media["3"]&&this.serieImgPath?'':"")}}else{a={};u="

    "+b.extentedInfo+'

    "+(x.partname?"":"")+(t.year?"":"")+(x.lang?"":"")+u+"
    '+b.title+""+t.title+"
    "+b.part+""+x.partname+"
    "+b.release_date+""+t.year+"
    "+b.lang+""+x.lang+"
    "}if(!w&&t.actor){w=t.actor.replace(/, /g,"
    ")}w&&(u+='
    '+b.actors+"
    "+w+"
    ");u&&(u+="
    ");k=(t.path?epgd.tr.pages.timerList.folder+"
    "+t.path.replace(/\//g," / ")+"
    ":"")+(t.genre?(b.genre+""+t.genre+"
    "):"")+(t.category?b.category+""+t.category+"
    ":"")+(t.country?b.country+""+t.country+"
    ":"")+(t.year?b.year+""+t.year+"
    ":"");h=(x.part?b.part+""+x.part+(x.parts?" / "+x.parts+"":"")+"
    ":"")+(x.season?b.season+""+x.season+"
    ":"")+(x.number?b.number+""+x.number+"
    ":"");if(t.recordings){for(q in t.recordings){l=t.recordings[q];r+='
    '+epgd.utils.formatDateTime(l.starttime)+""+parseInt(l.duration/60,10)+" "+epgd.tr.minutes+'
    '+l.title+(l.shorttext?'
    '+l.shorttext+"
    ":"")+"
    "}}this.$con=$('

    '+$.datepicker.formatDate(n?"d. M y":"d. MM yy",epgd.utils.date(t.starttime))+"
    "+(n?"":t.title)+'
    '+epgd.utils.formatTime(t.starttime)+" – "+epgd.utils.formatTime(t.starttime+t.duration)+" "+epgd.tr.oClock+" | "+parseInt(t.duration/60,10)+" "+epgd.tr.minutes+'

    '+(p?'':"")+'
    '+epgd.channels.getHtml(t.channelid)+(g>0&&g<=100?'
    ':"")+'
    '+(t.flags&&t.flags.indexOf("16:9")>0?'':"")+(t.audio&&t.audio.indexOf("DolbyDigital")>=0?'':"")+(t.flags&&t.flags.indexOf("Live")>0?"Live":"")+(t.parentalrating?'
    '+b.parentalrating+t.parentalrating+"
    ":"")+"
    "+(t.merge?"
    "+b.mergeSrc+t.merge+"
    ":"")+"
    "+(d?'
    '+d+"
    ":"")+'
    '+t.title+(x.partname?"
    "+x.partname+"":(t.shorttext?"
    "+t.shorttext+"":""))+'
    '+(t.tipp?''+t.tipp+"":"")+(t.txtrating?""+t.txtrating+"":"")+(t.shortreview||"")+"
    "+(k?'
    '+k+"
    ":"")+(h?'
    '+h+"
    ":"")+(o?'':"")+'
    '+(s?s.replace(/\n/g,"
    "):"")+"
    "+u+(t.category=="Serie"||a.isSerie?'

    '+b.constabelInfo+'

    '+epgd.tr.edit+''+epgd.tr.pages.eventDetail.addConstableLink+""+epgd.pages.help.getButton("constabel",true)+(epgd.profile.constabelLoginPath?'":"")+'
    ':"")+(r?"

    "+epgd.tr.menu.records+'

    '+r+"
    ":"")+"
    ").replaceAll(this.$con);this.$con.accordion({heightStyle:"fill",header:"h3",active:0,beforeActivate:function(e,i){if(i.newHeader.attr("data-conti")){epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/proxy?id=constabel&title="+encodeURIComponent(encodeURIComponent(i.newHeader.attr("data-conti")))+"&_"+new Date().getTime(),dataType:"html",contentType:"text/plain; charset=utf-8"},function(E){if(E.indexOf("Error:")==-1){var F=i.newPanel.find("#cRaw"),D=""+b.season+""+b.part+""+b.number+""+b.title+"",B="",A=E.split(/\r?\n/),z,y,C;for(C=0;C"}}else{y=z.split(/\t/);if(y.length>3){B+=""+y.join("")+""}}}F.html(E).hide().before('Raw');F.before(""+D+""+B+"
    ")}else{i.newPanel.find("#cRaw").html(epgd.tr.error.noData)}epgd.utils.loader.close()});i.newHeader.removeAttr("data-conti")},true)}}});this.$rec.toggleClass("hasTimer",!!t.timerid).prop("title",this.detail.doRecord(true));this.$play.toggle(this.detail.doPlay(true));this.$prev.toggle(this.detail.doPrev(true));this.$next.toggle(this.detail.doNext(true));this.$con.find(".channel .i-tv").click(function(){epgd.vdrs.current.switchChannel(this.parentNode.id)});this.closed=false;q=Math.max.apply(null,this.$win.siblings(".ui-front:visible").map(function(){return +$(this).css("z-index")}).get());if(q>=+this.$win.css("z-index")){this.$win.css("z-index",q+1)}$(window).trigger("resize.eventDetail");this.$openDialogs=$(".ui-dialog:visible:not(.ui-state-disabled)").addClass("ui-state-disabled");$(document).bind("keyup.eventDetail",function(i){if(i.keyCode==27){$(window).trigger("epgd_close.eventDetail")}});epgd.pages.help.initButtons(this.$con)};epgd.recordDetail=epgd.utils.inherits(function(a){this.elem=a;return epgd.eventDetail.call(this)},epgd.eventDetail);epgd.recordDetail.prototype.load=function(){var a=this;epgd.ajax({url:epgd.login.url+"data/recording?starttime="+this.elem.getAttribute("data-start")+"&md5path="+this.elem.getAttribute("data-md5")+"&owner="+this.elem.getAttribute("data-owner"),async:false},function(b){a.data=b.recording});return this};epgd.recordDetail.prototype.doRecord=function(a){if(a===true){return epgd.tr.pages.records.similarTimer}epgd.eventDetail.prototype.doRecord.call(this,a)};epgd.recordDetail.prototype.doPlay=function(a){if(a){return true}epgd.ajax({url:epgd.login.url+"data/replayrecording?vdruuid="+(!epgd.vdrs.list[this.data.vdruuid].usecommonrecfolder?this.data.vdruuid:epgd.vdrs.current.uuid)+"&starttime="+this.data.starttime+"&md5path="+this.data.md5path+"&owner="+(this.data.owner||""),cache:false},function(b){epgd.utils.popup(b.result.message,{title:"VDR",autoClose:5000})})};epgd.recordDetail.prototype.doPrev=function(b){var a=$(this.elem).prev(".rec");if(!a.length){return false}if(b){return true}a.find("B").click()};epgd.recordDetail.prototype.doNext=function(b){var a=$(this.elem).next(".rec");if(!a.length){return false}if(b){return true}a.find("B").click()};epgd.doneTimerDetail=epgd.utils.inherits(function(a){this.tr=a;return epgd.eventDetail.call(this)},epgd.eventDetail);epgd.doneTimerDetail.prototype.load=function(){var a=this;epgd.ajax({url:epgd.login.url+"data/donetimer?id="+this.tr.tData.id,async:false,cache:false},function(c){var b=c.donetimer;if(b.state){b.cntlongdescription=epgd.pages.timerListDone.stateIcons[b.state]}b.episode={lang:b.episodelang,season:b.episodeseason,part:b.episodepart};a.id=c.id;a.expire=epgd.utils.now().getTime()+900000;delete b.timerid;delete b.id;a.data=b});return this};epgd.doneTimerDetail.prototype.doRecord=function(a){if(a===true){return epgd.tr.pages.records.similarTimer}epgd.eventDetail.prototype.doRecord.call(this,a)};epgd.doneTimerDetail.prototype.doPlay=function(a){return false};epgd.doneTimerDetail.prototype.doPrev=function(b){var a=$(this.tr).prev("tr");if(!a.length){return false}if(b){return true}a.find("td").click()};epgd.doneTimerDetail.prototype.doNext=function(b){var a=$(this.tr).next("tr");if(!a.length){return false}if(b){return true}a.find("td").click()};$(document).ready(function(){epgd.eventDetail.prototype.win=new epgd.eventDetail.win()});epgd.pages.editChannels={render:function(){if(!(epgd.login.rights&epgd.rights.umConfigEdit)==epgd.rights.umConfigEdit){return epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}var i=epgd.tr.pages.editChannels,m=epgd.$con,e,l="",h="",k,c,d,g,b,a;for(d in epgd.channels.list){a=epgd.channels.list[d];k=[];for(g in a.sources){c=a.sources[g];k[c.merge]="
  • "+g+'
  • '}l+='
  • '+d+'
  • '}for(b in epgd.vdrs.list){h+='
  • '+epgd.vdrs.list[b].name+"
  • "}e=m.html('
    '+epgd.tr.pages.editChannels.headline+'
    Web
    channel-idchannel-name
    ').find("button");e.click(function(){var n=this.$menu.show();$(document).bind("click.ui_menu",function(o){if(!$(o.target).closest(".ui-menu").length){n.hide();$(this).unbind("click.ui_menu")}});return false})[0].$menu=$('").hide().insertAfter(e).menu({select:function(p,q){var s=q.item,n,r,o="";if(!s.attr("data-id")){s=s.parents("li[data-id]:first")}switch(s.attr("data-id")){case"getChannelNames":o='[value=""]';case"getAllChannelNames":epgd.utils.loader.process(function(){var t=[];$("#pageEditChannelsSource li").each(function(){t[this.lastChild.innerHTML]=this.firstChild.innerHTML});$("#pageEditChannels > li > input"+o).each(function(){this.value=t[this.previousSibling.innerHTML]||this.value})});break;case"getOrder":epgd.utils.loader.process(function(){var u=$("#pageEditChannels"),t;$($("#pageEditChannelsSource span").get().reverse()).each(function(){t=u.find("> li > span:contains("+this.innerHTML+")");if(t.length){t.parent().prependTo(u)}})});break;case"insertList":$('

    '+i.desc_insertList+' channelpedia.yavdr.com

    ').dialog({modal:true,width:500,height:400}).find("textarea").change(function(){epgd.pages.editChannels.insertReferenceList(this.value);$(this).parent().dialog("destroy")});break;case"loadList":if(q.item.attr("data-url")){epgd.ajax({url:epgd.login.url+"data/proxy?id="+q.item.attr("data-url"),dataType:"html",contentType:"text/plain; charset=utf-8"},epgd.pages.editChannels.insertReferenceList);break}case"channelpedia":n=$('
    ");this.$trash=this.$bar.find(".i-trash").droppable({accept:".rec",hoverClass:"ui-state-hover",tolerance:"pointer",drop:function(c,d){var b=d.helper.context;epgd.utils.confirm(epgd.tr.pages.records.deleteMessage.replace("$src$",b.getAttribute("data-path")),function(e){e&&epgd.pages.records.del(b)});return false}}).click(function(){var b=$("#records").find(".rec.selected");b.length&&epgd.utils.confirm(epgd.tr.confirmDelete+(b.length>1?"
    "+b.length+epgd.tr.entries:""),function(c){c&&b.each(function(){epgd.pages.records.del(this)})})});this.curSearch={pattern:"",searchValue:"",hits:$(),cur:0,$count:this.$bar.find("#rSCnt"),fromStart:this.$bar.find("#rSVal").prev("button")[0],toEnd:this.$bar.find("#rSVal").next("button")[0]};epgd.pages.help.initButtons(this.$bar)}this.$bar.insertAfter(epgd.$menu);epgd.$menu.checkMenuSize();$(window).bind("epgd_close.records",function(){epgd.pages.records.$bar.remove();epgd.$menu.checkMenuSize();$(window).unbind(".records")});epgd.$con.html('
    ');epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/recordings",cache:false},function(x){var b=x.recordings,g,y,o,l,n,r,m={f:{},r:[]},d={},s,k,h="",q=" "+epgd.tr.minutes,u,e=epgd.profile.recordSubFolderSort==6?function(p,i){return p.starttime>i.starttime?-1:1}:epgd.profile.recordSubFolderSort==5?function(p,i){return p.starttime>i.starttime?1:-1}:epgd.profile.recordSubFolderSort==4?function(p,i){return p.path>i.path?-1:1}:epgd.profile.recordSubFolderSort==3?function(p,i){return p.path>i.path?1:-1}:epgd.profile.recordSubFolderSort==2?function(p,i){return p.tit>i.tit?-1:1}:function(p,i){return p.tit>i.tit?1:-1};for(s in epgd.vdrs.list){k=epgd.vdrs.list[s];if(!k.usecommonrecfolder){d[s]={f:{},r:[]}}h+="
    VDR - "+k.name+": "+k.videodir+" - "+parseInt(k.videofree/1000,10)+" GB "+a.available+" / "+parseInt(k.videototal/1000,10)+" GB
    "}if(!$("#dragdrop").parent().length){return false}epgd.$con.find("#records").before(h);h="";for(r in b){g=b[r];l=d[g.vdruuid]||m;o=g.path.split("/");o.pop();for(n=0;n0}function c(i){Object.keys(i.f).sort().forEach(function(v){var t=i.f[v],p;h+=v?'

    ('+(t.cnt)+')'+v+"

    ":"
    ";t.f&&c(t);if(t.r.length){for(p in t.r){g=t.r[p];g.tit=((g.name!=v?g.name:"")+(v!=g.title&&(g.title!=g.name)?"
    "+g.title:"")+(g.shorttext&&(g.shorttext!=g.name)?""+g.shorttext+"":""))||v;g.html='
    '+epgd.utils.formatDateTime(g.starttime)+""+parseInt(g.duration/60,10)+q+""+g.tit+"
    "}t.r.sort(e);for(p in t.r){h+=t.r[p].html}}h+="
    "})}n={};if(w(m)){n[a.commonRecFolder]=m}for(s in d){l=d[s];if(w(l)){n["VDR - "+epgd.vdrs.list[s].name]=l}}c({f:n});u=epgd.$con.find("#records").html(h);if(!u.length){return false}u=u.click(epgd.pages.records.action).find(">div");if(u.length==1){u.first().toggleClass("open")}epgd.pages.records.$menu=$('
    •   '+epgd.tr.pages.eventDetail.title+'
    •   '+epgd.tr.pages.timerList.folder+'
    •   '+epgd.tr.pages.timerList.recordTime+"
    ").hide().appendTo(epgd.$con);$("#dragdrop").change();epgd.pages.records.curSearch.$recs=null;epgd.utils.loader.close()})},true)},search:function(e){var c=this.curSearch,h,b,d,a=c.fromStart.checked,g=c.toEnd.checked;if(!c.$recs){c.$recs=epgd.$con.find("#records .rec,h4")}if(typeof e=="string"){c.searchValue=e.replace(//g,">")}d=(a?">"+c.searchValue:c.searchValue).toLowerCase()+(g?"<":"");if(d==c.pattern){return}h=c.searchValue.length;b=c.$recs;if(c.hits.length){$(c.hits).each(function(){this.innerHTML=this.innerHTML.replace(/([^<]+)<\/mark>/gi,"$1")}).parents(".tmp-open").removeClass("tmp-open");if(d.indexOf(c.pattern)==0){b=$(c.hits)}else{c.cur=0}c.hits=[]}else{c.cur=0}c.pattern=d;if(h>2){b.each(function(){var i=this.innerHTML.toLowerCase().indexOf(d);if(i>0){c.hits.push(this);$(this).parents(".folder").addClass("tmp-open");do{if(a){i++}this.innerHTML=this.innerHTML.slice(0,i)+""+c.searchValue+""+this.innerHTML.slice(i+h)}while((i=this.innerHTML.toLowerCase().indexOf(d,i+13))>0)}});c.$count.text(c.hits.length).parent().show();this.searchMove(0)}else{c.$count.parent().hide()}},searchMove:function(a){this.curSearch.cur+=a;var b=this.curSearch.hits[this.curSearch.cur];if(!b){this.curSearch.cur=a<0?this.curSearch.hits.length-1:0;b=this.curSearch.hits[this.curSearch.cur]}if(b){b.scrollIntoView(false);$(b).css({"background-color":"green"});window.setTimeout(function(){$(b).css({"background-color":""})},1500)}},action:function(b){var a=b.target;if(a.nodeName=="MARK"){a=a.parentNode}if(a.nodeName=="M"){epgd.pages.records.$menu.show().position({my:"left top",at:"left bottom",of:a}).find("a").removeClass("ui-state-highlight");epgd.pages.records.$menu.find("a[data-sort="+(a.curSort||epgd.profile.recordSubFolderSort)+"]").addClass("ui-state-highlight");$(document).one("click.recmenu",function(d){if(d.target.nodeName=="A"){var c=d.target.parentNode.getAttribute("data-type");if(c){a.curSort=d.target.getAttribute("data-sort");epgd.pages.records.sort(a.parentNode.parentNode,a.curSort)}}epgd.pages.records.$menu.hide();$(document).unbind(".recmenu")}).bind("keyup.recmenu",function(c){if(c.keyCode==27){$(document).trigger("click.recmenu")}});return false}if(a.nodeName=="I"||a.nodeName=="SPAN"){a=a.parentNode}if(a.nodeName=="B"){a=a.parentNode;if(!a.recDetail){a.recDetail=new epgd.recordDetail(a)}epgd.utils.loader.process(function(){a.recDetail.render()})}else{if(a.nodeName=="H4"){a=a.parentNode;if(a.nodeName=="DIV"&&a.className.indexOf("folder")>=0){if(a.className.indexOf("open")==-1){if($(window).width()<500){$(a).siblings(".open").removeClass("open");document.body.scrollTop=$(a).offset().top-35}$(a).addClass("open")}else{$(a).removeClass("open")}}}else{$(a).closest(".rec").toggleClass("selected")}}},dd:function(b){var c=$("#records"),a=c.find(".rec").has(".ui-draggable");if(b&&a.length==0){c.find("h4").droppable(this.__dropSettings);a.end().draggable({cancle:"b",revert:"invalid",distance:15,helper:function(){return $(this).clone().css("display","block")},appendTo:"body",cursor:"pointer",cursorAt:{left:-15,top:5},start:function(d,e){$(document).trigger("click.recmenu");$(document.body).addClass("dd-open");document.body.style.paddingTop=epgd.pages.records.$bar.height()+"px";document.body.scrollTop-=d.pageY-$(d.delegateTarget).closest(".folder").offset().top},stop:function(d,e){$(document.body).removeClass("dd-open");epgd.$menu.checkMenuSize()}})}else{if(a.length){a.draggable(b?"enable":"disable")}}},__dropSettings:{accept:".rec",hoverClass:"ui-state-hover",tolerance:"pointer",drop:function(b,c){console.log("Dropped!",b,c);var a=$(b.target),d="";do{d=a.text().replace(/^\(.*\)/,"")+"/"+d;a=a.parent()}while((a=a.prevAll("h4")).length);epgd.pages.records.move(c.draggable.context,d.slice(d.indexOf("/",2)+1).replace(/ /g,"_"),b.target.parentNode);return false}},update:function(){epgd.ajax({url:epgd.login.url+"data/updaterecordings"},function(a){epgd.utils.topInfo(epgd.tr.pages.records.refreshMessage.replace("$sec$",5),{autoClose:5000});$(window).trigger("epgd_close.records");window.setTimeout(function(){epgd.pages.records.render()},5000)})},move:function(e,h,d){var g=e.getAttribute("data-path").split("/"),b=g.pop(),c,a=0;g=g.join("/")+"/";for(c=0;ch4>span").each(function(){this.innerHTML="("+(parseInt(this.innerHTML.slice(1,-1),10)-1)+")"});p=o.find("span");p.text("("+(parseInt(p.text().slice(1,-1),10)+1)+")");for(l=0;l.folder>h4").each(function(){if(this.lastChild.nodeValue==m[l]){o=$(this.parentNode);p=o.find("span");p.text("("+(parseInt(p.text().slice(1,-1),10)+1)+")");return true}else{return false}}).length==0){for(;l(1)'+m[l]+"
    ").droppable(epgd.pages.records.__dropSettings).wrap('
    ').parent().appendTo(o)}}}k.appendTo(o);epgd.pages.records.sort(d);epgd.utils.topInfo(epgd.tr.dataSaved);epgd.pages.records.__updateRec(e)}else{epgd.utils.topInfo(n.message,{isError:1});return false}})}return !!g},__updateRec:function(b,a){epgd.ajax({url:epgd.login.url+"data/recording?starttime="+b.getAttribute("data-start")+"&path="+b.getAttribute("data-path")+"&owner="+b.getAttribute("data-owner")+"&"+a,async:true},function(c){$(b).attr("data-md5",c.recording.md5path).draggable("enable").removeClass("ui-state-disabled")},function(d,c){if(!a){a=0}else{if(a>=5){return epgd.utils.popup(epgd.tr.pages.records.notFoundMessage,{title:epgd.tr.error.error})}}window.setTimeout(epgd.pages.records.__updateRec,3000,b,++a);return true})},del:function(a){epgd.ajax({url:epgd.login.url+"data/deleterecording?starttime="+a.getAttribute("data-start")+"&md5path="+a.getAttribute("data-md5")+"&owner="+a.getAttribute("data-owner"),async:true},function(b){b=b.result;if(b&&b.state==200){epgd.utils.topInfo(a.getAttribute("data-path")+"
    "+epgd.tr.dataSaved);$(a).parents(".folder:not(:last)").find(">h4>span").each(function(){this.innerHTML="("+(parseInt(this.innerHTML.slice(1,-1),10)-1)+")"});$(a).remove()}else{epgd.utils.topInfo(a.getAttribute("data-path")+"
    "+b.message,{isError:1})}})},sort:function(a,d){var e=$(a).find(">div.rec"),b=d%2?1:-1,c;if(!d){d=$(">h4>m",a)[0].curSort||epgd.profile.recordSubFolderSort}if(d<3){e.sort(function(h,g){return h.lastChild.innerHTML>g.lastChild.innerHTML?b:-b}).appendTo(a)}else{c=d<5?"data-path":"data-start";e.sort(function(h,g){return h.getAttribute(c)>g.getAttribute(c)?b:-b}).appendTo(a)}$(a).find(">div.folder").each(function(){epgd.pages.records.sort(this,d)})}};epgd.sortTable=function(a){this.o=$.extend({conSel:epgd.$con,empty:"",right:1},a)};epgd.sortTable.prototype={sortIcons:'',update:function(){},hideHead:function(){var a=this.$con.find("thead:first").hide().find(">tr>th");this.$con.find("tbody:first").html(''+this.o.empty+(a.last().find(".i-doc-new").wrapAll("
    ").parent().html()||"")+"")},showHead:function(){this.$con.find(">table>thead").show();this.filter();this.sort()},getTable:function(){},action:function(a,c,b){switch(c){case"refresh":this.update();break;case"detail":if(!a[0].eventDetail){a[0].eventDetail=new epgd.eventDetail(b)}epgd.utils.loader.process(function(){a[0].eventDetail.render()});break}},render:function(a,b){this.trs=[];this.$con=a||$(this.o.conSel);this.$con.empty();if(!(epgd.login.rights&this.o.right)==this.o.right){return epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}this.$con.html(this.getTable());this.init();this.update(b)},init:function(){var b=this,a=0;this.$con.find(">table").click(function(h){var e=$(h.target),g=e[0],i=g.getAttribute("data-evId"),k,c;if(i){b.action(e,"detail",i)}else{if(h.target.className=="i-tv"){epgd.vdrs.current.switchChannel(h.target.parentNode.id)}else{e=e.closest("span.sort");if(e.length){e.parent().parent().find(".ui-state-highlight").removeClass("ui-state-highlight");e.addClass("ui-state-highlight");b.sort(e)}else{e=$(g).closest("span.edit");if(e.length){b.action(e,e[0].className.match(/i-([a-z0-9-]+)/)[1])}if(b.o.selectable){if(g.nodeName=="TD"){e=$(g).parent().toggleClass("selected");if(h.shiftKey&&this.lastSel){c=$(this.lastSel);k=e.index()-c.index();if(k>0){c.nextAll(":lt("+k+"):visible").toggleClass("selected",c.hasClass("selected"))}else{c.prevAll(":lt("+-k+"):visible").toggleClass("selected",c.hasClass("selected"))}}else{this.lastSel=e[0]}}else{if(g.nodeName=="B"){k=g.getAttribute("data-t");$(b.trs).filter(":visible").toggleClass("selected",k==1?true:k==0?false:undefined);return false}}}}return false}}}).find(">thead>tr").find(">th").each(function(){this.cIndex=a;a+=this.colSpan}).end().find('[data-defaultSort="1"]>span.sort:last,[data-defaultSort="-1"]>span.sort:first').addClass("ui-state-highlight");this.$con.find(">table>thead input.filter").keyup(function(){b.filter()}).each(function(){if(!this.result){this.result=$('').insertAfter(this)[0]}})},sort:function(e){e=e||this.$con.find(">table>thead .ui-state-highlight");if(!e.length){return}var c=e.parent()[0],g=(e.hasClass("i-sort-name-down")?-1:1),a=this.trs,b,h;if(!c.sortInfo){c=c.cIndex;for(b=0;bk?1*g:l==k?0:-1*g)});this.$con.find(">table>tbody").append(a.slice())},filter:function(){var b={},a,d,e,c;this.$con.find(">table>thead input.filter").each(function(){if(this.value){b[this.parentNode.cIndex]=[this.value.toLowerCase(),0,this.result||{}]}else{if(this.result){this.result.innerHTML=""}}});for(a=0;a
      '+(b.length?"
    1. "+b.join("
    2. ")+"
    3. ":"")+'
      '+(a.length>1?"
    • "+a.slice(1).replace(/,/g,"
    • ")+"
    • ":"")+"
    ").dialog({modal:true,buttons:[{text:epgd.tr.apply,click:function(){var e="";$(this).find("ol > li").each(function(){e+=","+this.innerHTML});c.value=e.slice(1);$(this).dialog("close")}},{text:epgd.tr.cancel,click:function(){$(this).dialog("close")}}]}).find("ul,ol").sortable({connectWith:"ul,ol"}).disableSelection()};epgd.timerListBase=epgd.utils.inherits(function(a,b){this.dialog=b;if(this.dialog){this.dialog.list=this}if(!a.conSel){a.conSel="#content"}if(!a.empty){a.empty=epgd.tr.pages.timerList.empty}epgd.sortTable.call(this,a)},epgd.sortTable);epgd.timerListBase.prototype.getTable=function(){var a=epgd.tr.pages.timerList;return'
    '+epgd.tr.channel+this.sortIcons+''+a.startTime+this.sortIcons+' '+a.endTime+''+epgd.tr.pages.eventDetail.title+this.sortIcons+' VDR'+this.sortIcons+' '+this.sortIcons+(this.o.addNew?'':"")+(this.o.selectable?'
    ':"")+"
    "};epgd.timerListBase.prototype.update=function(){var a=this;epgd.utils.loader.process(function(){a.$con.find("tbody").empty();epgd.ajax({url:epgd.login.url+a.o.updateUrl,async:false,cache:false},function(g){if(!g.timers.length){a.hideHead()}else{var b=[],i=a.editIcons,h="DF",e={D:'
    '+epgd.tr.pages.timerList.timerStates.D+"
    ",E:'
    '+epgd.tr.pages.timerList.timerStates.E+"
    ",F:'
    '+epgd.tr.pages.timerList.timerStates.F+"
    ",R:'
    '+epgd.tr.pages.timerList.timerStates.R+"
    ",P:'
    '+epgd.tr.pages.timerList.timerStates.P+"
    ",U:'
    '+epgd.tr.pages.timerList.timerStates.U+"
    "},d=epgd.tr.pages.timerList.timerActions,c='$title$';$.each(g.timers,function(n,k){k.action=k.action?k.action.toUpperCase():"A";k.state=k.state?k.state.toUpperCase():"U";var m=epgd.vdrs.list[k.vdruuid]||{name:"--"},l=$(""+epgd.channels.getHtml(k.channelid)+""+(k.action!="A"?'
    '+d[k.action]+"
    ":e[k.state])+(k.info||"")+''+(k.day?epgd.utils.formatDate(k.day):"-")+""+new String(100+parseInt(k.starttime/100,10)).slice(1)+":"+new String(100+parseInt(k.starttime%100,10)).slice(1)+""+new String(100+parseInt(k.endtime/100,10)).slice(1)+":"+new String(100+parseInt(k.endtime%100,10)).slice(1)+"'+(k.title||"")+"
    "+(k.shorttext||""):">")+""+m.name+"
    "+(k.directory?k.directory+"~":"")+(k.file||"")+""+(k.autotimerid?c.replace("$id$",k.autotimerid).replace("$title$",k.autotimername||k.expression||epgd.tr.pages.timer.searchTimerList):"")+(h.indexOf(k.state)==-1?i:"")+"")[0];l.tData=k;b.push(l)});a.trs=b;a.showHead()}epgd.utils.loader.close();$(window).trigger("timerlist_updated",a)})},true)};epgd.timerListBase.prototype.action=function(a,d,b){var c;switch(d){case"edit":case"doc-new":this.dialog.render(a.closest("tr")[0].tData);break;case"trash":this.del(this.getSelectedIds(a));break;case"flashlight":c=a.attr("data-id"),list=this;$(window).one("searchTimerList_updated",function(){list.$con.find("tbody>tr").each(function(){if(this.tData.id==c){epgd.pages.searchTimerList.dialog.render(this.tData);return false}})});epgd.$menu.menu("select",{target:"#menu_searchTimerList"});break;default:epgd.sortTable.prototype.action.call(this,a,d,b)}};epgd.timerListBase.prototype.editIcons='';epgd.timerListBase.prototype.getSelectedIds=function(a){var b=[];if(a[0].parentNode.nodeName=="TH"){$(this.trs).filter(".selected:visible").each(function(){b.push(this.tData.id)})}else{b.push(a.closest("tr")[0].tData.id)}return b};epgd.timerListBase.prototype.del=function(c,d,e){var b=this,a=$.isArray(c)?c:[parseInt(c,10)];c&&a.length&&epgd.utils.confirm(epgd.tr.confirmDelete+(a.length>1?"
    "+a.length+epgd.tr.entries:""),function(g){g&&b.saveArray(a,e||"delete",d)})};epgd.timerListBase.prototype.saveArray=function(c,g,e){var b=this,a=$.isArray(c)?c:[parseInt(c,10)],d={};d[g]=a;c&&a.length&&this.save(d,null,function(k){try{var h=",";$(k.responseJSON.result.failed).each(function(){h+=a[this]+","});if(h.length>1){$(b.trs).each(function(){if(h.indexOf(","+this.tData.id+",")>=0){this.style.backgroundColor="red"}})}}catch(i){}return false},e)};epgd.timerListBase.prototype.save=function(d,b,a,c){if(!d){return false}var e=this;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+(b||e.o.saveUrl),type:"post",data:JSON.stringify(d)},function(g){g=g.result;if(g.state==200){epgd.utils.topInfo(epgd.tr.dataSaved)}else{epgd.utils.topInfo(g.message,{isError:1})}epgd.utils.loader.close();e.$con&&e.$con.parent().length&&e.update();c&&c.call(e)},a)},true);return true};epgd.searchResultList=epgd.utils.inherits(function(a,b){epgd.timerListBase.call(this,$.extend({saveUrl:"data/save-searchtimer"},a),b)},epgd.timerListBase);epgd.searchResultList.prototype.getTable=function(){var a=epgd.tr.pages.timerList;return'
    '+epgd.tr.channel+this.sortIcons+''+a.startTime+this.sortIcons+""+a.endTime+""+epgd.tr.pages.eventDetail.title+this.sortIcons+"
    "};epgd.searchResultList.prototype.update=function(b){if(!b){return false}var a=this;b.id&&delete b.id;b.name&&delete b.name;b.max=epgd.profile.maxListEntries;epgd.utils.loader.process(function(){a.$con.find("tbody").empty();epgd.ajax({url:epgd.login.url+"data/search",type:"post",data:JSON.stringify(b)},function(e){var c=[],d;if(!e.events||!e.events.length){a.hideHead()}else{e.count>b.max&&epgd.utils.popup("Achtung! Es wurden "+e.count+" Ergebnisse gefunden. Angezeigt werden aber nur "+b.max+".
    Das Nachladen ist noch nicht implementiert! Der Wert kann in den Einstellungen angepasst werden");$.each(e.events,function(l,h){var k="",g="",i;if(h.dones){for(d in h.dones){i=h.dones[d];g+=''+i.state+"";if(i.state=="R"){k=' class="ui-state-disabled"'}}}c.push($(""+epgd.channels.getHtml(h.channelid)+''+epgd.utils.formatDate(h.starttime)+""+epgd.utils.formatTime(h.starttime)+""+epgd.utils.formatTime(h.starttime+h.duration)+''+h.title+"
    "+(h.shorttext||"")+""+g+"").tooltip()[0])});a.trs=c;a.showHead()}epgd.utils.loader.close();a.dialog&&a.dialog.resize&&window.setTimeout(function(){a.dialog.resize()},100)})},true)};epgd.searchTimerTimerList=epgd.utils.inherits(function(a,b){epgd.timerListBase.call(this,$.extend({saveUrl:"data/save-timer",updateUrl:"data/timers?state=P,R"},a),b)},epgd.timerListBase);epgd.searchTimerTimerList.prototype.getTable=function(){var a=epgd.tr.pages.timerList;return'
    '+epgd.tr.channel+this.sortIcons+''+a.startTime+this.sortIcons+""+a.endTime+""+epgd.tr.pages.eventDetail.title+this.sortIcons+"VDR"+this.sortIcons+"
    "};epgd.searchTimerTimerList.prototype.update=function(b){if(!b){return false}var a=this;epgd.utils.loader.process(function(){a.$con.find("tbody").empty();epgd.ajax({url:epgd.login.url+a.o.updateUrl+"&autotimerid="+b.id,async:true,cache:false},function(d){var c=[],e='';if(!d.timers.length){a.hideHead()}else{$.each(d.timers,function(k,g){var i=epgd.vdrs.list[g.vdruuid]||{name:"--"},h=$(""+epgd.channels.getHtml(g.channelid)+''+(g.day?$.datepicker.formatDate(epgd.tr.dateTimePicker.dateFormat,epgd.utils.date(g.day)):"-")+""+new String(100+parseInt(g.starttime/100,10)).slice(1)+":"+new String(100+parseInt(g.starttime%100,10)).slice(1)+""+new String(100+parseInt(g.endtime/100,10)).slice(1)+":"+new String(100+parseInt(g.endtime%100,10)).slice(1)+"'+g.title+"
    "+(g.shorttext||""):">")+""+i.name+"
    "+g.file+""+e+"")[0];h.tData=g;c.push(h)});a.trs=c;a.showHead()}a.dialog&&a.dialog.resize&&window.setTimeout(function(){a.dialog.resize()},100);epgd.utils.loader.close()})})};epgd.pages.timerList=new epgd.timerListBase({updateUrl:"data/timers?state=P,R",saveUrl:"data/save-timer",selectable:true,addNew:true,right:epgd.rights.umTimer},new epgd.timerDialog());epgd.pages.timersDone=new epgd.timerListBase({updateUrl:"data/timers?state=D,F,E&action=A",right:epgd.rights.umTimer});epgd.pages.timersDone.getTable=function(){return epgd.timerListBase.prototype.getTable.call(this).replace('data-defaultSort="1"','data-defaultSort="-1"')};epgd.pages.timerListDone=new epgd.timerListBase({updateUrl:"data/donetimers",saveUrl:"data/store-donetimers",selectable:true,right:epgd.rights.umTimer});epgd.pages.timerListDone.getTable=function(){return'
    '+this.sortIcons+''+epgd.tr.pages.timerList.recordTime+this.sortIcons+""+epgd.tr.pages.eventDetail.title+' '+this.sortIcons+''+epgd.tr.channel+this.sortIcons+''+this.sortIcons+'
    '};epgd.pages.timerListDone.action=function(a,c,b){if(c=="detail"&&!a[0].eventDetail){a[0].eventDetail=new epgd.doneTimerDetail(a.parent()[0])}epgd.timerListBase.prototype.action.call(this,a,c,b)};epgd.pages.timerListDone.stateIcons={D:'
    '+epgd.tr.pages.timerList.doneStates.D+"
    ",F:'
    '+epgd.tr.pages.timerList.doneStates.F+"
    ",f:'
    '+epgd.tr.pages.timerList.doneStates.f+"
    ",R:'
    '+epgd.tr.pages.timerList.doneStates.R+"
    ",C:'
    '+epgd.tr.pages.timerList.doneStates.C+"
    ",Q:'
    '+epgd.tr.pages.timerList.doneStates.Q+"
    "};epgd.pages.timerListDone.update=function(){var a=this;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+a.o.updateUrl,async:false,cache:false},function(h){a.$con.find("tbody").empty();if(!h.donetimers.length){a.hideHead()}else{var b=[],g,e,d,c='$title$';for(e in h.donetimers){d=h.donetimers[e];g=$(""+(d.state&&a.stateIcons[d.state]||"")+''+epgd.utils.formatDateTime(d.starttime)+"
    "+parseInt(d.duration/60,10)+" "+epgd.tr.minutes+''+(d.title||"")+"
    "+(d.shorttext||"")+''+epgd.channels.getHtml(d.channelid)+''+(d.autotimerid?c.replace("$id$",d.autotimerid).replace("$title$",d.autotimername||d.expression||epgd.tr.pages.timer.searchTimerList):"")+"")[0];g.tData=d;b.push(g)}a.trs=b;a.showHead()}epgd.utils.loader.close();$(window).trigger("timerlist_updated",a)})},true)};epgd.pages.timerJobList=new epgd.timerListBase({updateUrl:"data/timers?notaction=A",saveUrl:"data/delete-timerjobs",selectable:true,right:epgd.rights.umTimer},new epgd.timerDialog());epgd.pages.searchTimerList=new epgd.timerListBase({saveUrl:"data/save-searchtimer",right:epgd.rights.umSearchTimer},new epgd.searchTimerDialog());epgd.pages.searchTimerList.getTable=function(){var a=epgd.tr.pages.timerList;return'
    '+epgd.tr.pages.search.searchName+"/"+epgd.tr.pages.search.searchExpression+' '+this.sortIcons+"hits"+this.sortIcons+'VDR'+this.sortIcons+'
    '};epgd.pages.searchTimerList.action=function(c,e,d){epgd.timerListBase.prototype.action.call(this,c,e,d);switch(e){case"link-ext":this.triggerUpdate();break;case"down-dir":if(!c[0].tList){var b={$td:c.parent().css("position","relative"),tdHeight:c.parent().outerHeight()+10,data:c.parent().parent()[0].tData,resize:function(){var g=this.list.$con.find(">table").addClass("sub");g.width(this.$td.parent().outerWidth());this.$td.height(this.tdHeight+g.outerHeight(true)+10)},toggle:function(g){this.list.$con.toggle(g);if(g){this.$td.css("height","100px");this.list.update(this.data)}else{this.$td.css("height","auto")}}},a={conSel:$('
    ').appendTo(document.body)};c[0].tList=b.data.type=="S"?new epgd.searchResultList(a,b):new epgd.searchTimerTimerList(a,b);c[0].tList.render();b.$td.append(b.list.$con)}c[0].tList.dialog.toggle(true);c.removeClass("i-down-dir").addClass("i-right-dir");break;case"right-dir":c.removeClass("i-right-dir").addClass("i-down-dir");if(c[0].tList){c[0].tList.dialog.toggle(false)}break}};epgd.pages.searchTimerList.update=function(){var a=this;this.$con.find("tbody").empty();epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/searchtimers",async:false,cache:false},function(d){var b=[],e=a.editIcons,c={V:"i-tv",R:"i-record",S:"i-search"};if(!d.searchtimers.length){a.hideHead()}else{$.each(d.searchtimers,function(k,g){var i=epgd.vdrs.list[g.vdruuid]||{name:"--"},h=$("
    '+(g.name||g.expression)+"
    --":' data-sort="'+new String("00000"+g.hits).slice(-5)+'">'+g.hits)+""+i.name+""+e+"")[0];h.tData=g;b.push(h)});a.trs=b;a.showHead()}epgd.utils.loader.close();$(window).trigger("searchTimerList_updated",a)})})};epgd.pages.searchTimerList.triggerUpdate=function(){var a=this;epgd.ajax({url:epgd.login.url+"data/updatesearchtimer"},function(b){if(b.result.state==200){epgd.utils.topInfo(epgd.tr.dataSaved)}else{epgd.utils.topInfo(b.message,{isError:1})}a.update()})};epgd.pages.search=new epgd.searchDialog();epgd.pages.messageList=new epgd.timerListBase({saveUrl:"data/markmessages",selectable:true});epgd.pages.messageList.getTable=function(){return'
    id'+this.sortIcons+'Typ '+this.sortIcons+'Zeit'+this.sortIcons+'Titel '+this.sortIcons+'infotext '+this.sortIcons+'
    Status
    '+this.sortIcons+'
    '};epgd.pages.messageList.update=function(b){var a=this;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/messages",async:false,cache:false},function(l){a.$con.find("tbody").empty();if(!l.messages.length){a.hideHead()}else{var c=[],k,h,g,e={N:''+epgd.tr.pages.timerList.messageStates.N+"",R:''+epgd.tr.pages.timerList.messageStates.R+""},d={E:'
    '+epgd.tr.pages.timerList.timerStates.E+"
    ",F:'
    '+epgd.tr.pages.timerList.timerStates.F+"
    ",I:'
    '+epgd.tr.pages.timerList.messageTypes.I+"
    ",W:'
    '+epgd.tr.pages.timerList.messageTypes.W+"
    "};for(h in l.messages){g=l.messages[h];k=$(''+g.id+""+(d[g.type]||"")+''+epgd.utils.formatDateTime(g.updsp)+""+g.title+""+g.text+''+(e[g.state]||"")+"")[0];k.tData=g;c.push(k)}a.trs=c;a.$con.find(">table>tbody").append(c.sort(function(m,i){return m.tData.state==i.tData.state?m.tData.state.updsp>i.tData.state.updsp?-1:1:m.tData.state>i.tData.state}).slice());a.showHead()}epgd.utils.loader.close();$(window).trigger("messagelist_updated",a)})},true)};epgd.pages.messageList.action=function(b,g,e){var c=this.getSelectedIds(b),d=null,a;if(c){switch(g){case"check":d=b[0].parentNode.nodeName=="TH"?"R":"N";break;case"check-empty":d=b[0].parentNode.nodeName=="TH"?"N":"R";break;case"trash":d="D";break}if(d){for(a in c){c[a]={id:c[a],state:d}}d=="D"?this.del(c,null,"messages"):this.saveArray(c,"messages");return true}}return epgd.timerListBase.prototype.action.call(this,b,g,e)};epgd.vdr=function(a,b){this.uuid=a;$.extend(this,b)};epgd.vdr.prototype.switchChannel=function(a){epgd.ajax({url:epgd.login.url+"data/channelswitch?uuid="+this.uuid+"&channel="+a,cache:false},function(b){epgd.utils.popup(b.result.message,{title:"VDR",autoClose:5000})})};epgd.vdr.prototype.wol=function(){epgd.ajax({url:epgd.login.url+"data/wakeupvdr?uuid="+this.uuid,cache:false},function(a){epgd.utils.popup(a.result.message,{title:"VDR",autoClose:5000})})};epgd.vdrs={list:null,current:null,load:function(){if(!this.list){this.list={};epgd.ajax({url:epgd.login.url+"data/vdrs",async:false},function(b){var a;for(a in b.vdrs){epgd.vdrs.list[a]=new epgd.vdr(a,b.vdrs[a])}if(!epgd.vdrs.current){if(epgd.profile.defaultVDRuuid){epgd.vdrs.current=epgd.vdrs.list[epgd.profile.defaultVDRuuid];if(!epgd.vdrs.current){epgd.utils.log("the default VDR ("+epgd.profile.defaultVDRuuid+" is invalid! Please change this in Web Interface/options)")}}if(!epgd.vdrs.current){for(a in epgd.vdrs.list){epgd.vdrs.current=epgd.vdrs.list[a];break}}if(!epgd.vdrs.current){epgd.utils.log("no VDR found",2);epgd.vdrs.current=new epgd.vdr("000-missing-vdr-000",{name:"no VDR found"})}}$(window).trigger("vdrs_load")})}},get:function(a){return this.list[(a||this.current)]||{}}};epgd.pages.vdrs={render:function(){epgd.$con.html('
    ')}}; \ No newline at end of file +var epgd={};epgd.tr={oClock:"Uhr",minutes:"min",save:"speichern",copy:"kopieren",apply:"übernehmen",close:"schließen",clear:"löschen",yes:"ja",no:"nein",edit:"bearbeiten",cancel:"abbrechen",del:"löschen",test:"testen",reload:"neu laden",advanced:"erweitert",markAll:"alle markieren",markNone:"keinen markieren",markToggle:"Markierung umdrehen",confirmDelete:"Willst du wirklich löschen?",dataSaved:"Daten wurden gespeichert",dataDeleted:"Daten wurden gelöscht",dataSend:"Daten wurden gesendet",channel:"Kanal",date:"Datum",entries:" Einträge",error:{error:"Fehler",common:"Es ist ein allgemeiner Fehler aufgetreten",serverNotResponse:"Der Server konnte nicht erreicht werden!",notImplemented:"Dieses Feature ist zur Zeit noch nicht implementiert",forbidden:"Zugriff verweigert!",noData:"Für diese Anfrage konnten keine Daten ermittelt werden!",emptyField:"Bitte fülle das Feld $field$ aus!",invalid:"Der eingegebene Wert ist ungültig!"},menu:{now:"Programm",magazine:"Magazin",timer:"Timer",records:"Aufnahmen",search:"Suche",options:"Einstellungen",help:"Hilfe"},pages:{now:{at:"am"},timer:{timerList:"Timer",searchTimerList:"Suchtimer",timersDone:"kürzliche Aufträge",timerListDone:"Auftragshistorie",timerJobList:"asynchrone Aufträge",messageList:"Systemmeldungen"},timerList:{empty:"Keine Timer vorhanden!",startTime:"Anfang",endTime:"Ende",folder:"Verzeichnis",file:"Dateiname",recordTime:"Aufnahmezeit",lifetime:"Lebenszeit",prio:"Priorität",inactive:"Inaktiv",newTimer:"Neuen Timer anlegen",namingMode:"Ermittlung des Dateinamens",namingModes:["VDR","Auto","Constable","Serie","Kategorisiert","Usermode","Template"],template:"Template",templateFields:{"%title%":": Titel (EPG)","%shorttext%":": Untertitel (EPG)","%starttime%":": Startzeit (EPG)","%year%":": Jahr (EPG)","%category%":": Kategorie (EPG)","%episodname%":": Titel der Serie (constabel)","%shortname%":": Kurz-Titel der Serie (constabel, optional)","%partname%":": Name der Folge (constabel)","%season%":": Staffel (constabel)","%part%":": Teil der Staffel (constabel)","%number%":": Nummer über alle Staffeln (constabel)","%extracol1%":": Zusätzliche Angaben z.B. bei Tatort die Ermittler (constabel, optional)","%extracol2%":": ... z.B. bei Tatort der Ort (constabel, optional)","%extracol3%":": ... z.B. bei Tatort der Sender (constabel, optional)"},episode:"Serientitel",noEpgMatch:"Ignoriere fehlende EPG Info",noRepeat:"Wiederholungen vermeiden",searchTimerReload:"Suchtimer updaten",chInclude:"Auf Kanäle einschränken",chExclude:"Kanäle ausschließen",nextDays:"innerhalb der nächsten $field$ Tage",confirmSaveBigResult:"Die Suche ergibt $cnt$ Treffer, trotzdem speichern?",timerStates:{D:"gelöscht",E:"Fehler",F:"Aufnahme erfolgreich",P:"wartet auf Aufnahmebeginn",R:"nimmt gerade auf...",U:"unbekannt"},timerActions:{C:"Timer wurde erstellt und muss noch von einem VDR übernommen werden",D:"Timer wurde gelöscht und muss noch im VDR gelöscht werden",F:"Zuweisung Timer an VDR fehlgeschlagen",M:"Timer wurde verändert und muss noch vom VDR verarbeitet werden"},doneStates:{f:"Timer konnte nicht erstellt werden",C:"Timer bereits erstellt",D:"Timer gelöscht",F:"Aufnahme fehlgeschlagen",Q:"Timer in Vorbereitung",R:"Aufnahme fertig"},messageStates:{N:"Neu",R:"gelesen"},messageTypes:{I:"Information",W:"Warnung",E:"Fehler",F:"Fataler Fehler"},chFormat:"bevorzugtes Sendeformat"},eventDetail:{record:"Aufnehmen",repeat:"Wiederholungen",ch_switch:"umschalten",eventNext:"nachfolgend",eventPrev:"vorher",parentalrating:"ab ",mergeSrc:"Quelle ",genre:"Genre",category:"Kategorie",country:"Land",year:"Jahr",season:"Staffel",part:"Folge",number:"Folge Insgesamt",extentedInfo:"weitere Informationen",scrapperMovieInfo:"Filminformation",scrapperSerieInfo:"Serieninformation",constabelInfo:"Constabel Episodenliste",addConstableLink:"Link erzeugen",loginConstable:"Login",title:"Titel",original_title:"Originaltitel",runtime:"Laufzeit",lang:"Sprache",release_date:"Erscheinungsdatum",actors:"Schauspieler",network:"Netzwerk",seriesstatus:"Status",gueststars:"Gäste",homepage:"Webseite",popularity:"Beliebtheit",vote_average:"ø Bewertung",extInfo:{director:"Regie",camera:"Kamera",screenplay:"Drehbuch",producer:"Produktion",music:"Musik",moderator:"Moderator",commentator:"Kommentator",guest:"Gäste",info:"Info",other:"Sonstige"}},options:{profile:"allgemein",editChannels:"Kanäle bearbeiten",editUser:"Benutzer bearbeiten"},editChannels:{menu:{channelList:"Kanalliste",referenceList:"Referenzliste",insertAsText:"als Text einfügen",extentEmptyChannelNames:"leere Kanalnamen ergänzen",applyAllChannelNames:"Alle Kanalnamen übernehmen",applyChannelSort:"Kanalsortierung übernehmen"},headline:"Sortierung der Kanäle durch drag und drop, Blockmarkierung durch zus. gedrückter shift-Taste",checkWeb:"Kanal in Webansicht anzeigen",checkVDR:"Kanal zum VDR übertragen",desc_insertList:"Kopiere den Inhalt einer channels.conf in das Textfeld unten. Eine vollständige Liste gibt es beispielsweise hier:"},editUser:{user:"Benutzer",sel:"auswählen",add:"neu anlegen",active:"Aktiv",inActive:"Inaktiv",rights:{label:"Rechte",umConfig:"Konfiguration lesen",umConfigEdit:"Konfiguration ändern",umConfigUsers:"Benutzer konfigurieren",umTimer:"Timer lesen",umTimerEdit:"Timer bearbeiten",umSearchTimer:"Suchtimer lesen",umSearchTimerEdit:"Suchtimer bearbeiten",umFsk:"FSK",umRecordings:"Aufnahmen lesen",umRecordingsEdit:"Aufnahmen editieren"}},help:{url:"lang/hilfe.html",noHelp:"Hierzu konnte kein Hilfstext gefunden werden"},search:{search:"suchen",searchName:"Name",searchExpression:"Suchausdruck",caseSensitive:"Klein-/Großschreibung",searchModes:["exakte Übereinstimmung","regulärer Ausdruck","Muster","enthalten in"],searchFields:["Titel","Kurztext","Beschreibung"],empty:"Leider nichts gefunden.",matchdensity:"Treffergenauigkeit"},login:{label:"Login",userName:"Benutzername",password:"Passwort",loggedAlwaysIn:"angemeldet bleiben",logout:"Abmelden",error:"Fehler beim Anmelden!",logoutMessage:"Du wurdest abgemeldet!",needLogin:"Login erforderlich"},records:{ddLabel:"Drag und Drop",refreshMessage:"Aufnahmelisten werden neu geladen, Seite lädt in $sec$ Sekunden neu",moveMessage:"Aufnahme verschieben von \n$src$\nnach",notFoundMessage:"Aufnahme nicht gefunden, ggf einmal aktualisieren",deleteMessage:"Soll die Aufnahme $src$ wirklich gelöscht werden?",available:"Verfügbar",commonRecFolder:"gemeinsame Aufnahmen",similarTimer:"ähnliche Sendung aufnehmen"},profile:{mailReceiver:"eMail",sendTCC:"sende Mail bei Timerkonflikten",sendMessages:"sende Mail bei Systemmeldungen",magazinePan:"Scrollgeschwindigkeit in Minuten
    (0 = aus)",magazinePanDelay:"Auslöseverzögerung",maxListEntries:"maximal Anzahl Einträge, die auf einmal vom Server geladen werden sollen, z.B. bei Suchen, Suchtimern usw.",system:{label:"epgd Backend"},vdr:{startWithSched:"EPG Menü startet mit Schedule"},record:{subFolderSort:"Sortierung der Unterordner"}}},dateTimePicker:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayNamesMin:["So","Mo","Di","Mi","Do","Fr","Sa"],weekHeader:"KW",timeOnlyTitle:"Zeit wählen",timeText:"Sendungsbeginn",timeTextBetween:"zwischen",prevText:"<Zurück",nextText:"Vor>",currentText:"Jetzt",closeText:"Fertig",hourText:"Stunde",minuteText:"Minute",secondText:"Sekunde",millisecText:"Millisekunde",microsecText:"Mikrosekunde",timezoneText:"Zeitzone",timeFormat:"HH:mm",dateFormat:"D, dd.mm.yy",amNames:["vorm.","AM","A"],pmNames:["nachm.","PM","P"],isRTL:false,showMonthAfterYear:false,yearSuffix:""}};epgd.profile={needLogin:-1,channelLogoPath:"data/channellogo",eventImgPath:"data/eventimg",movieMediaPath:"data/moviemedia",serieImgPath:"data/seriesmedia",movieActorPath:"http://www.themoviedb.org/person/",serieSeasonPath:"http://www.thetvdb.com/?tab=seasonall&id=",constabelEditPath:"https://www.eplists.de/eplist.cgi?action=edit&back=&file=",constabelLinkPath:"https://www.eplists.de/eplist.cgi?action=show_form_redir&linkname=",minEventTime:0,maxEventTime:0,logoShowName:0};epgd.userProfile_defaults={defaultVDRuuid:"",constabelLoginPath:false,pickerFirstDay:"6",quickTimes:"",startWithSched:0,startPage:"menu_options",namingModeSerie:"0",namingModeSearchSerie:"0",namingModeMovie:"0",namingModeSearchMovie:"0",namingModeSerieTemplate:"",namingModeSearchSerieTemplate:"",namingModeMovieTemplate:"",namingModeSearchMovieTemplate:"",chFormat:"",timerDefaultVDRuuid:"",searchAdv:"0",mailReceiver:"",messageMailTypes:"",magazinePan:10,magazinePanDelay:400,maxListEntries:100,ratings:"",recordSubFolderSort:1};epgd.profile_load=function(b){var a=$.extend(epgd.profile,epgd.userProfile_defaults);epgd.ajax({url:epgd.login.url+"data/parameters",async:false,cache:false,dataType:"json"},function(l){var m,g,d,c,e,h={};for(g in l.parameters){m=l.parameters[g];c=a[m.name];if(c!=undefined&&c!=m.value){a[m.name]=m.type===0?parseInt(m.value,10):m.value;h[m.name]=c;if(m.name.indexOf("logo")==0){epgd.channels.isDirty=true}}}if(epgd.utils.timeOffset==null){epgd.utils.timeOffset=(l.timezone-new Date().getTimezoneOffset()*60)*1000;e=epgd.utils.now();epgd.$dtPicker.datetimepicker("setDate",new Date(e.setMinutes(parseInt(e.getMinutes()/15,10)*15)))}if(!a.minEventTime){e=epgd.utils.now();a.minEventTime=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0).getTime()/1000;h.minEventTime=0}if(!a.maxEventTime){a.maxEventTime=a.minEventTime+8*24*60*60-60;h.maxEventTime=0}for(d in h){$(window).trigger("profile_updated",h);break}epgd.channels.isDirty&&epgd.channels.load()})};epgd.pages={};epgd.login={user:"",session:"",rights:-1,url:""};epgd.rights={umConfig:2,umConfigEdit:4+2,umConfigUsers:8,umTimer:64,umTimerEdit:128+64,umSearchTimer:256+64,umSearchTimerEdit:512+256+128+64,umFsk:4096,umRecordings:32768,umRecordingsEdit:65536+32768};epgd.utils={timeOffset:null,now:function(){return new Date(new Date().getTime()-this.timeOffset)},date:function(a){return new Date(a*1000-this.timeOffset)},unixTime:function(a){return a?parseInt((a.getTime()+this.timeOffset)/1000,10):0},formatTime:function(a){var b=new Date(a*1000-this.timeOffset);return new String(100+b.getHours()).slice(1)+":"+new String(100+b.getMinutes()).slice(1)},formatDateTime:function(b,a){var c=new Date(b*1000-this.timeOffset);return $.datepicker.formatDate((a||epgd.tr.dateTimePicker.dateFormat),c)+" "+new String(100+c.getHours()).slice(1)+":"+new String(100+c.getMinutes()).slice(1)},formatDate:function(b,a){var c=new Date(b*1000-this.timeOffset);return $.datepicker.formatDate((a||epgd.tr.dateTimePicker.dateFormat),c)},popup:function(b,c){var d=$(window),a;c=$.extend({autoOpen:true,dialogClass:"popup",show:{effect:"blind",duration:1000},hide:{effect:"explode",duration:1000},width:400,height:200,maxWidth:d.width()*0.8,maxHeight:d.height()*0.7},c);a=$('

    '+b+"

    ").dialog(c);c.autoClose&&window.setTimeout(function(){a.dialog("close").dialog("destroy")},c.autoClose);return a},confirm:function(a,c){var b={modal:true,buttons:{}};b.buttons[epgd.tr.yes]=function(){$(this).dialog("close");c(true)};b.buttons[epgd.tr.no]=function(){$(this).dialog("close");c(false)};this.popup(a,b)},topInfo:function(b,c){var e=c&&c.isError,d,a;c=$.extend({autoClose:e?0:3000,className:"ui-state-"+(e?"error":"highlight")},c);a=(c.autoClose||3000)/2;d=$('
    '+b+'
    ').appendTo(epgd.$menu).animate({opacity:0.4},a,function(){d.animate({opacity:1},a)});c.autoClose&&window.setTimeout(function(){d.remove()},c.autoClose)},sendMail:function(c,a,b,d){epgd.ajax({url:epgd.login.url+"data/sendmail",type:"post",data:JSON.stringify({receiver:(d||epgd.profile.mailReceiver),subject:c,body:a,mimetype:b})},function(e){e=e.result;if(e&&e.state==200){epgd.utils.topInfo(epgd.tr.dataSend)}else{epgd.utils.topInfo(e.message,{isError:1})}epgd.profile_load()})},loader:{$win:$('
    '),cnt:0,process:function(b,c){var a=this;this.cnt++;this.$win.appendTo(document.body).stop().animate({opacity:0.7},{always:function(){try{b()}catch(d){epgd.utils.log((d.message||"common error")+"\n"+(d.stack||""),0);a.close()}!c&&a.close()}},200)},close:function(){if(this.cnt>0){this.cnt--;this.cnt==0&&this.$win.remove()}}},addAutoComplete:function(d,b){var c=$(d),e=c[0].className,a=c[0].style.width||"";$(d).autocomplete($.extend({minLength:0,multiselect:false,create:function(i,m){var l=$(this).autocomplete("instance"),n=l.options,k,h;l.selectedItems={};if(n.multiselect){l.multiselect=$("
    ").addClass("ui-autocomplete-multiselect ui-state-default ui-widget "+e).css("width",a).insertBefore(l.element).append(l.element).bind("click.autocomplete",function(){l.element.focus()});l.menu.element.css({height:"300px","overflow-y":"auto"});k=parseInt(l.element.css("fontSize")||10,10);function g(p){var o=$(this);o.width(1).width(this.scrollWidth+k-1)}h=$.ui.keyCode;l.element.bind({"keydown.autocomplete":function(p){if((this.value==="")&&(p.keyCode==h.BACKSPACE)){var o=l.element.prev();delete l.selectedItems[o.text()];o.remove()}},"focus.autocomplete blur.autocomplete":function(){l.multiselect.toggleClass("ui-state-active")},"keypress.autocomplete change.autocomplete focus.autocomplete blur.autocomplete":g}).trigger("change");n.select=n.select||function(p,o){if(!l.selectedItems[o.item.label]){$("
    ").addClass("ui-autocomplete-multiselect-item").text(o.item.label).append($("").addClass("ui-icon ui-icon-close").click(function(){var q=$(this).parent();delete l.selectedItems[q.text()];q.remove()})).insertBefore(l.element);l.selectedItems[o.item.label]=o.item}l._value("");return false}}else{n.select=n.select||function(p,o){l.selectedItems[0]=o.item;l._value(o.item.label);return false}}}},b)).focus(function(){$(this).autocomplete("search","")})},getAutoCompleteValues:function(i,c){c=c||"";var b="",a=","+c,g,d;try{g=$(i).autocomplete("instance").selectedItems;for(d in g){b+=a+g[d].value+c}}catch(h){}return b.slice(1)},setAutoCompleteValues:function(g,a){var d=$(g).autocomplete("instance"),c,b,e;d.multiselect&&d.multiselect.find(">div").remove();d.selectedItems={};if(a){for(b=0;b',e;for(e in a){c+='
  • '+e+""+a[e]+"
  • "}b.$placeholders=$(c+"").hide().insertAfter(b).click(function(i){var k=i.target.nodeName=="B"?$(i.target).text():i.target.nodeName=="LI"?$(i.target.firstChild).text():null,l=$(b).prop("selectionStart"),h=$(b).val();if(k){$(b).val(h.substring(0,l)+k+h.substring(l,h.length)).focus();l+=k.length;if(b.setSelectionRange){b.setSelectionRange(l,l)}else{if(b.createTextRange){h=b.createTextRange();h.collapse(true);h.moveEnd("character",l);h.moveStart("character",l);h.select()}}}$(this).hide()});$(b).keydown(function(h){if(h.key==d){$(document).one("click",function(){b.$placeholders.hide()});b.blur();return !b.$placeholders.show().position({my:"left top",at:"left bottom",of:b})}})},inherits:function(a,c){var b=function(){};b.prototype=c.prototype;a.prototype=new b();a.prototype.constructor=a;a.base=c.prototype;return a},log:function(a,c){console.log("error:"+a);try{$.ajax({url:"data/log",type:"get",async:true,cache:false,data:"level="+(c||0)+"&message="+escape(a)})}catch(b){}}};epgd.init=function(){epgd.$con=$('
    ').appendTo(document.body);$.datepicker.setDefaults(epgd.tr.dateTimePicker);$.datepicker.setDefaults({showOtherMonths:true,selectOtherMonths:true});$.timepicker.setDefaults(epgd.tr.dateTimePicker);$.timepicker.setDefaults({timeInput:true,controlType:{create:function(b,g,e,h,c,a,d){if(e=="hour"){if(!b.inst.settings.timeOnly){$("#ui-datepicker-div").width(($(window).width()>500?430:230)+"px")}$("0246810
    121416182022").appendTo(g).bind("click",{tp_inst:b,obj:g,unit:e},$.timepicker.quicklink)}else{if(e=="minute"){$("0153045").appendTo(g).bind("click",{tp_inst:b,obj:g,unit:e},$.timepicker.quicklink)}else{if(e=="second"&&epgd.profile.quickTimes){g.closest("dl").find(".ui_tpicker_time").removeClass().bind("click",{tp_inst:b,obj:g,unit:"time"},$.timepicker.quicklink).html('').replace(/~/g,'");if(b.inst.settings.alwaysSetTime){epgd.pages.help.initButtons(b.inst.dpDiv.find(".ui-datepicker-buttonpane").append(epgd.pages.help.getButton("datepicker")))}else{$('").appendTo(b.inst.dpDiv.find(".ui-datepicker-buttonpane")).click(function(){b.$input.val("");$.datepicker._hideDatepicker()})}return g}else{return g}}}$('').prependTo(g).spinner({min:c,max:a,step:d,change:function(k,i){if(k.originalEvent!==undefined){b._onTimeChange()}b._onSelectHandler()},spin:function(k,i){b.control.value(b,g,e,i.value);b._onTimeChange();b._onSelectHandler()}});return g},options:function(a,d,c,b,e){if(typeof(b)=="string"&&e!==undefined){return d.find(".ui-timepicker-input").spinner(b,e)}return d.find(".ui-timepicker-input").spinner(b)},value:function(a,d,b,g){try{if(g!==undefined){return d.find(".ui-timepicker-input").spinner("value",g)}return d.find(".ui-timepicker-input").spinner("value")}catch(c){return false}}}});epgd.$menu=$('").appendTo(document.body).find("ul").hide();epgd.$menu.$maxBut=$('').insertBefore(epgd.$menu).click(function(){epgd.$menu.parent().toggleClass("open")});epgd.$menu.checkMenuSize=function(a,b){if(window.wrm_i){if(window.wrm_w==$(window).width()){window.clearInterval(window.wrm_i);delete window.wrm_i;epgd.$menu.parent().removeClass("mini").width(window.wrm_w).offset({left:$(window).scrollLeft()});epgd.$menu.checkMenuSize(null,b)}else{window.wrm_w=$(window).width()}return}if(a){window.wrm_w=$(window).width();if(!window.wrm_i){window.wrm_i=window.setInterval(epgd.$menu.checkMenuSize,200,null,b)}}else{if(epgd.$menu.height()>40){epgd.$menu.parent().addClass("mini")}window.setTimeout(function(){document.body.style.paddingTop=(epgd.$menu.parent().height()+10)+"px";b&&window.setTimeout(b,200)},200)}};$(window).bind("resize",epgd.$menu.checkMenuSize);epgd.$dtPicker=$('').appendTo(document.body).hide().bind("click",function(){$(this).datepicker("show");return false});epgd.$dtPicker.datetimepicker({beforeShow:function(){this.$overlay=$("
    ").addClass("ui-widget-overlay ui-front").appendTo(document.body)},onClose:function(){this.$overlay.remove();$(window).trigger("datepicker")},calendarStart:function(){var a=new Date(epgd.profile.minEventTime*1000);leadDays=(a.getDay()-parseInt(epgd.profile.pickerFirstDay,10)+7)%7;a.setHours(12,0);a.setDate(a.getDate()-leadDays);return a}});epgd.$menu.menu({position:{at:"left bottom"},select:function(a,b){var c=b.item.attr("id");if(!c||c.indexOf("menu_")!=0||(a.originalEvent&&a.originalEvent.target.nodeName!="A"&&a.originalEvent.target.nodeName!="LI")){return false}$(window).trigger("epgd_close");epgd.$menu.parent().removeClass("open");$(".menu-active",this).removeClass("menu-active");$(document.body).append(epgd.$dtPicker.hide());epgd.$menu.checkMenuSize(null,function(){try{b.item.addClass("menu-active").parent().parent(".ui-menu-item").addClass("menu-active");epgd.pages[c.slice(5)].render()}catch(d){epgd.utils.popup(epgd.tr.error.common,{title:epgd.tr.error.error});epgd.utils.log((d.message||"common error")+"\n"+(d.stack||""),2)}})}});$(window).bind("epgd_close",function(){$(".epgPopUp").dialog("destroy")}).bind("profile_updated",function(b,a){if(a.minEventTime!=undefined){epgd.$dtPicker.datetimepicker("option",{minDateTime:new Date((epgd.profile.minEventTime=parseInt(epgd.profile.minEventTime,10))*1000),minDate:new Date(epgd.profile.minEventTime*1000)})}if(a.maxEventTime!=undefined){epgd.$dtPicker.datetimepicker("option",{maxDateTime:new Date((epgd.profile.maxEventTime=parseInt(epgd.profile.maxEventTime,10))*1000),maxDate:new Date(epgd.profile.maxEventTime*1000)})}if(a.pickerFirstDay!=undefined){epgd.$dtPicker.datetimepicker("option",{firstDay:epgd.profile.pickerFirstDay})}if(a.defaultVDRuuid!=undefined){$("#menu_vdrs > select").val(epgd.profile.defaultVDRuuid)}if(a.quickTimes!=undefined){epgd.pages.magazine.initQT()}if(a.needLogin!=undefined){epgd.pages.login.doLogin()}}).bind("login_changed",function(a,b){epgd.$menu.html("").hide();epgd.$con.html("");if(epgd.login.rights){epgd.$menu.append('");epgd.$menu.append('");(epgd.login.rights&epgd.rights.umTimer)==epgd.rights.umTimer&&epgd.$menu.append("
  • "+epgd.tr.menu.timer+'
  • ");(epgd.login.rights&epgd.rights.umRecordings)==epgd.rights.umRecordings&&epgd.$menu.append('");epgd.$menu.append('");epgd.$menu.append("
  • "+epgd.tr.menu.options+'
  • ");epgd.$menu.append('");epgd.$menu.append('')}epgd.profile.needLogin=="1"&&epgd.$menu.append('");if(epgd.login.user!=b.user){epgd.profile_load();epgd.channels.isDirty=true;epgd.vdrs.list=null}epgd.channels.load();epgd.vdrs.load();epgd.$menu.show().menu("refresh");epgd.$menu.menu("select",{target:$(epgd.login.rights?(location.hash||"#"+epgd.profile.startPage||"#menu_profile"):"#menu_login")})}).bind("vdrs_load",function(){html="";for(var a in epgd.vdrs.list){html+='"}$("").replaceAll("#menu_vdrs > select").show().change(function(){var b=epgd.vdrs.current=epgd.vdrs.get(this[this.selectedIndex].value);if(b&&b.osd2webp){$("#osd2web").prop("target","osd2web_"+b.name).prop("href","http://"+b.ip+":"+b.osd2webp).click(function(c){c.stopPropagation();return true}).show()}else{$("#osd2web").hide()}}).mousedown(function(b){b.stopPropagation();return true}).click(function(b){return false}).change()}).bind("unload",function(){if(epgd.login.session){epgd.pages.login.doLogin("logout")}});epgd.pages.now.init();epgd.pages.magazine.init();epgd.profile_load();if(epgd.profile.needLogin==-1){epgd.profile.needLogin=0;epgd.pages.login.doLogin()}window.setInterval(epgd.profile_load,3600000)};window.onerror=function(i,g,b,d,c){var a=!d?"":"\ncolumn: "+d;a+=!c?"":"\nerror: "+c.stack;try{epgd.utils.log(i+"\nline: "+b+a,2)}catch(h){}return true};$.widget("custom.catcomplete",$.ui.autocomplete,{_create:function(){this._super();this.widget().menu("option","items","> :not(.ui-autocomplete-category)")},_renderMenu:function(c,b){var d=this,a="";$.each(b,function(g,h){var e;if(h.category!=a){c.append("
  • "+h.category+"
  • ");a=h.category}e=d._renderItemData(c,h);if(h.category){e.attr("aria-label",h.category+" : "+h.label)}})}});$.datepicker._gotoToday=function(c){var b=this._getInst($(c)[0]),a=epgd.utils.now();this._base_gotoToday(c);this._setTime(b,a);this._setDate(b,a);this._hideDatepicker()};$.timepicker.quicklink=function(b){var g=b.target.nodeName=="I"?b.target.firstChild:b.target,a,i=null,h=false;try{a=b.data.tp_inst||$.datepicker._getInst(epgd.$dtPicker[0]).settings.timepicker}catch(c){epgd.utils.log((c.message||"common error")+"\n"+(c.stack||""),2);return false}if(g.nodeName=="U"){if(b.data.unit=="time"){i=$.datepicker.parseTime(a._defaults.timeFormat,g.innerHTML,a._defaults)}else{if(b.data.unit=="hour"){i={hour:parseInt(g.innerHTML,10),minute:a.minute}}}if(i){if(i.hour"+$('label[for="'+a.id+'"]').text()+"":"")+"
    "+b+"
    ",{autoClose:3000});a&&a.focus();return false},loadFolder:function(){var a=this;epgd.ajax({url:epgd.login.url+"data/recordingdirs"},function(d){if(d.recordingdirs.length){var b=[],c=epgd.vdrs.list,e;$.each(d.recordingdirs,function(h,g){e=c[g.vdruuid];b.push({value:g.directory,category:e?e.name:"-"})});$(a.form.tFolder).catcomplete("option","source",b)}})},close:function(){if(this.$win){this.$win.dialog("close")}},create:function(){var d=this.options,c=epgd.tr.pages.timerList,b="",a;for(a=1;a'+epgd.tr.dateTimePicker.dayNamesShort[a]}b+=''+epgd.tr.dateTimePicker.dayNamesShort[0];this.$win=$('
    '+b+'


    ');!d.embed&&this.$win.appendTo(document.body).dialog(d);this.$win[0].list=this.list;this.form=this.$win.find("form")[0];$(this.form.tFolder).catcomplete({minLength:0,maxHeight:300}).focus(function(){$(this).catcomplete("search","")});$(this.form.tType).change(function(){if(this.selectedIndex<0){this.selectedIndex=0}this.form.className=this.form.className.replace(/ ?type./,"")+" type"+this[this.selectedIndex].value});$(this.form.tNameMode).change(function(){this.form.tTemplate.parentNode.style.display=(this.selectedIndex==6)?"block":"none"});epgd.utils.addPlaceholders(this.form.tTemplate,"%",c.templateFields);this.loadFolder()},render:function(b){b=b||{};if(!this.$win){this.create()}!this.options.embed&&this.$win.dialog("open").dialog("moveToTop");var c=this.form,e,a;c.tSName.focus();if(b.id){c.tID.value=b.id;this.$win.parent().find("#tBDel").show();this.$win.parent().find("#tBToggle").hide()}else{c.tID.value="";this.$win.parent().find("#tBDel").hide();this.$win.parent().find("#tBToggle").show()}$(c.tType).val(b.type||"R").change();$(c.tVdr).val(b.vdruuid||epgd.profile.timerDefaultVDRuuid);e=b.weekdays||0;for(a=0,f=1;a
    ');$(a.tWeek[0]).parent().before('

      -
    ');$(a.tNameMode).after(' ');$(a.tFolder).parent().after('
    ');$(this.form.tStart).datetimepicker({minDateTime:epgd.utils.now()});$(this.form.tEnd).timepicker({});epgd.utils.addAutoComplete(a.tChannel,{source:epgd.channels.autoCompleteData});a.tFile=$(a).find("#tFile")[0];a.tEvTime=$(a).find("#tEvTime")[0];a.tTitle=$(a).find("#tTitle").click(function(){if(a.tEvID.value){epgd.utils.loader.process(function(){new epgd.eventDetail(a.tEvID.value).render()})}})[0]};epgd.timerDialog.prototype.render=function(a){a=a||{};epgd.timerDialog.base.render.call(this,a);var b=this.form,c;b.tFile.innerHTML=a.file||"...";b.tEvID.value=a.eventid||"";epgd.utils.setAutoCompleteValues(b.tChannel,a.channelid?[a.channelid]:null);b.tTitle.innerHTML=a.title||"";b.tEvTime.innerHTML=a.evStartTime?epgd.utils.formatDateTime(a.evStartTime)+" - "+epgd.utils.formatTime(a.evStartTime+a.evDuration):"";$([b.tStart,b.tEnd]).datetimepicker("option","disabled",!!a.eventid);if(a.day||!a.evStartTime){if(a.starttime){c=epgd.utils.date((a.day+parseInt(a.starttime/100,10)*60*60+(a.starttime%100)*60))}else{if(a.day){c=epgd.utils.date(a.day)}else{c=epgd.utils.now()}}$(b.tStart).datetimepicker("setDate",c);$(b.tStart).datetimepicker("setTime",c);if(a.endtime){c=epgd.utils.date((a.day+parseInt(a.endtime/100,10)*60*60+(a.endtime%100)*60))}else{c=new Date(c.getTime()+2*60*60000)}$(b.tEnd).datetimepicker("setTime",c)}else{$([b.tStart,b.tEnd]).val("...")}b.tNameMode.selectedIndex=typeof a.namingmode=="undefined"?parseInt(a.category=="Serie"?epgd.profile.namingModeSerie:epgd.profile.namingModeMovie,10):a.namingmode;b.tTemplate.value=a.template||(a.category=="Serie"?epgd.profile.namingModeSerieTemplate:epgd.profile.namingModeMovieTemplate);$(b.tNameMode).change()};epgd.timerDialog.prototype.getData=function(g){var b=this.form,e,a,c={};if(b.tEvID.value){c.eventid=parseInt(b.tEvID.value,10)}c.active=b.tInactive.checked?0:1;if(b.tID.value){c.id=parseInt(b.tID.value,10)}if(b.tStart.value&&b.tStart.value!="..."){e=$(b.tStart).datepicker("getDate");c.starttime=e.getHours()*100+e.getMinutes();e.setHours(0);e.setMinutes(0);c.day=parseInt(e.getTime()/1000,10);c.endtime=parseInt(b.tEnd.value.replace(":",""),10)}else{if(!c.eventid&&!g){return this.showError(epgd.tr.error.emptyField.replace("$field$",epgd.tr.pages.timerList.recordTime),b.tStart)}}c.weekdays=0;for(a=0,f=1;a
    ').insertAfter(this.form)))}else{this.searchResultList.$con.find("tbody").empty()}if(!this.searchResultList.$con.parent().length){this.searchResultList.$con.insertAfter(this.form);this.searchResultList.init()}this.searchResultList.update(b||this.getData());this.searchResultList.$con[0].scrollIntoView(true)};epgd.searchTimerDialog.prototype.create=function(){epgd.searchTimerDialog.base.create.call(this);var c=epgd.tr.pages.timerList,e=epgd.tr.pages.search,d="",b=this.form,a;for(a in e.searchModes){d+='"}if(!epgd.categories){epgd.categories=[];epgd.ajax({url:"data/categories",async:false},function(g){epgd.categories=g.categories})}if(!epgd.genres){epgd.genres=[];epgd.ajax({url:"data/genres",async:false},function(g){epgd.genres=g.genres})}$(b.tSName).parent().parent().after('
       
    '+[""].concat(e.searchFields).join('')+'
    '+c.episode+' '+epgd.tr.pages.eventDetail.season+' '+epgd.tr.pages.eventDetail.part+'
    '+epgd.tr.pages.eventDetail.category+'
    '+epgd.tr.pages.eventDetail.genre+'
    GoldTippTagesTippTopTipp
    '+epgd.tr.pages.eventDetail.year+'
    '+c.noEpgMatch+'
    '+[""].concat(e.searchFields).join('')+'
    "+epgd.pages.help.getIcon("sTChannels")+'
    ");$(b.tWeek[0]).before(""+epgd.tr.dateTimePicker.timeTextBetween+' - ').parent().append('
    '+c.nextDays.replace("$field$",'')+"").insertAfter(b.tTime.parentNode);$([b.tStart,b.tEnd]).timepicker({alwaysSetTime:false});$([b.tTime,b.tRepeat,b.tAdv]).change(function(){$(this).parent().next().toggle(this.checked)});$([b.tSFSeason,b.tSFSPart,b.tSFYear]).change(function(){this.value=this.value.replace(/[^0-9-]/g,"");if(this.value.length==1&&this.value=="-"){this.value=""}});$(b.tType).append('");epgd.utils.addAutoComplete(b.tChannels,{source:epgd.channels.autoCompleteData,multiselect:true});epgd.utils.addAutoComplete(b.tSFCat,{source:epgd.categories,multiselect:true});epgd.utils.addAutoComplete(b.tSFGenre,{source:epgd.genres,multiselect:true})};epgd.searchTimerDialog.prototype.render=function(b){b=b||{searchfields:1};epgd.searchTimerDialog.base.render.call(this,b);var c=this.form,e,a;c.tExpr.value=b.expression||"";$(c.tSMode).val(b.searchmode||4);c.tCaseSens.checked=b.casesensitiv==1;e=b.searchfields||0;for(a=0,f=1;a0;$(c.tRepeat).change();c.tSFEpisode.value=b.episodename||"";c.tSFSeason.value=b.season||"";c.tSFSPart.value=b.seasonpart||"";c.tSFYear.value=b.year||"";epgd.utils.setAutoCompleteValues(c.tSFCat,new String(b.category).replace(/'/g,"").split(","));epgd.utils.setAutoCompleteValues(c.tSFGenre,new String(b.genre).replace(/'/g,"").split(","));e=b.tipp||"";for(a=0;a=0}c.tSFNoEpgMatch.checked=b.noepgmatch==1;c.tAdv.checked=b.episodename||b.season||b.seasonpart||b.year||b.category||b.genre||b.tipp||b.noepgmatch;$(c.tAdv).change();epgd.utils.setAutoCompleteValues(c.tChannels,new String(b.channelids).split(","));if(b.chexclude){c.tChExclude1.checked=1}else{c.tChExclude0.checked=1}c.tChFormat.value=b.chformat||(b.id?"":epgd.profile.chFormat);c.tNameMode.defaultIndex=parseInt(b.category=="Serie"?epgd.profile.namingModeSearchSerie:epgd.profile.namingModeSearchMovie,10);c.tNameMode.selectedIndex=typeof b.namingmode=="undefined"?c.tNameMode.defaultIndex:b.namingmode;c.tTemplate.value=typeof b.template=="undefined"?(b.category=="Serie"?epgd.profile.namingModeSearchSerieTemplate:epgd.profile.namingModeSearchMovieTemplate):b.template;$(c.tNameMode).change();this.$win.parent().find("#tBCopy").toggle(!!b.id)};epgd.searchTimerDialog.prototype.getData=function(g){var b=this.form,e,a,c={expression:b.tExpr.value};if(b.tSFSeason.value){c.season=b.tSFSeason.value}if(b.tSFSPart.value){c.seasonpart=b.tSFSPart.value}if(b.tSFYear.value){c.year=b.tSFYear.value}if(!g){if(!c.expression){return this.showError(epgd.tr.error.emptyField.replace("$field$",epgd.tr.pages.search.searchExpression),b.tExpr)}if(c.season&&!/^[0-9]{0,3}-?[0-9]{0,3}$/.test(c.season)){return this.showError(epgd.tr.error.invalid,b.tSFSeason)}if(c.seasonpart&&!/^[0-9]{0,3}-?[0-9]{0,3}$/.test(c.seasonpart)){return this.showError(epgd.tr.error.invalid,b.tSFSPart)}if(c.year&&!/^((19|20)[0-9]{2})?(-|-(19|20)[0-9]{2})?$/.test(c.year)){return this.showError(epgd.tr.error.invalid,b.tSFYear)}}if(b.tID.value){c.id=parseInt(b.tID.value,10)}if(b.tSFEpisode.value){c.episodename=b.tSFEpisode.value}c.category=epgd.utils.getAutoCompleteValues(b.tSFCat,"'");c.genre=epgd.utils.getAutoCompleteValues(b.tSFGenre,"'");e="";for(a=0;a50){epgd.utils.confirm(epgd.tr.pages.timerList.confirmSaveBigResult.replace("$cnt$",d.count),function(k){k&&epgd.searchTimerDialog.base.save.call(a,h)})}else{epgd.searchTimerDialog.base.save.call(a,h,e,c,g)}epgd.utils.loader.close()})},true)};epgd.searchDialog=epgd.utils.inherits(function(){epgd.searchTimerDialog.call(this,{id:"search",embed:true,buttons:null});this.searchResultList=new epgd.searchResultList({empty:epgd.tr.pages.search.empty},this)},epgd.searchTimerDialog);epgd.searchDialog.prototype.create=function(){epgd.searchDialog.base.create.call(this);var c=this.form,b=this,a=$('
    ').appendTo(this.$win);$('").insertAfter(c.tExpr).after('  ");$(c.tType).parent().hide().parent().css("border-top","1px solid #ccc").insertAfter($(c.tVdr.parentNode.parentNode).hide());$('').insertAfter(c.tSName).click(function(){b.form.tID.value="";b.form.tSName.value+=" copy";b.form.tSName.select()}).prop("disabled",true);$('').insertAfter(c.tSName).click(function(){b.list.del(this.form.tID.value,function(){b.form.tID.value="";b.loadSavedSearch()})}).prop("disabled",true);$('').insertAfter(c.tSName).click(function(){var e=b.getData();if(!e.name){return this.showError(epgd.tr.error.invalid,c.tSName)}b.save(e,null,null,function(){b.loadSavedSearch()})});$(c).submit(function(){b.search(a);return false});this.$win.find("#sExpr").keyup(function(d){if(d.keyCode==13){this.form.sSearch.click();$(this).blur()}}).focus();this.$win.find("#sAdv").change(function(){$(c).toggleClass("noAdv",!this.checked);b.resize()}).prop("checked",epgd.profile.searchAdv=="1").change();$(c.tSName).autocomplete({minLength:0,maxHeight:300,source:function(){return false},select:function(e,g){var h=g.item.data||{id:""};if(h.id){b.render(h);b.form.sSearch.click();$([c.tDel,c.tCopy,c.tInactive]).prop("disabled",false);return false}else{c.tID.value="";$([c.tDel,c.tCopy,c.tInactive]).prop("disabled",true)}}}).focus(function(){$(this).autocomplete("search","")});this.loadSavedSearch()};epgd.searchDialog.prototype.loadSavedSearch=function(){var a=this.form;epgd.ajax({url:epgd.login.url+"data/searchtimers?type=S"},function(c){var b=[];$.each(c.searchtimers,function(e,d){b.push({value:d.name||d.expression,label:d.name||d.expression,data:d})});$(a.tSName).autocomplete("option","source",b)})};epgd.searchDialog.prototype.resize=function(){var a=this.$win.find("#searchResult"),b=$(window).height()-a.offset().top-20;if(b<100){a.css({height:"auto","overflow-y":"visible"})}else{a.css({height:b+"px","overflow-y":"auto"})}};epgd.searchDialog.prototype.render=function(a){if(!epgd.$con.find("#search").length){$("#menu_search").addClass("menu-active");this.create();epgd.$con.html("");this.$win.appendTo(epgd.$con)}a=a||{searchfields:1};a.type="S";epgd.searchDialog.base.render.call(this,a)};epgd.searchDialog.prototype.close=function(){};epgd.channels={list:null,autoCompleteData:null,isDirty:false,selBox:$('')[0],load:function(){if(!this.list||this.isDirty){epgd.ajax({url:epgd.login.url+"data/channels",async:false,cache:false},function(d){var b=(epgd.profile.channelLogoPath?epgd.profile.channelLogoPath+"?maxW=70&maxH=50&id=":false),e="",c={},a=[];d.channels&&$.each(d.channels,function(g,h){var k=h.channelid||g;if(h.name){h.html='
    '+(b?''+h.name+''+(epgd.profile.logoShowName=="1"?h.name:""):h.name)+"
    ";h.visible&1&&(e+='")}else{h.html='
    '+k+"
    ";h.visible&1&&(e+='")}c[k]=h;a.push({label:h.name,value:k})});epgd.channels.list=c;epgd.channels.autoCompleteData=a;$(epgd.channels.selBox).html(e);$(window).trigger("channels_load");this.dirty=false})}},getHtml:function(b){var a=this.list[b];return a?a.html:'
    '+b+"
    "},getName:function(b){var a=this.list[b];return a?a.name:b}};epgd.eventDetail=function(a){this.id=a;this.data=null;this.expire=0};epgd.eventDetail.prototype.imgPath=false;epgd.eventDetail.prototype.load=function(b,c){var a=this;epgd.ajax({url:epgd.login.url+"data/event?"+(b&&c?"channelid="+b+"&time="+c:"id="+this.id),async:false,cache:false},function(d){a.data=d.event;a.id=d.id;a.expire=epgd.utils.now().getTime()+900000});return this};epgd.eventDetail.prototype.render=function(){if(this.expire'+epgd.tr.pages.eventDetail.repeat+"").appendTo(d.$con);b={searchfields:1,expression:this.data.title,searchmode:1,casesensitiv:1,fromEventDetail:true};if(this.data.shorttext){b.searchfields1=2;b.expression1=this.data.shorttext}epgd.pages.search.search.call(this,$('
    ').appendTo(d.$con),b)}else{a.click()}};epgd.eventDetail.prototype.doPlay=function(b){var a=parseInt(epgd.utils.now().getTime()/1000,10)-this.data.starttime;if(a<0||a>this.data.duration){return false}if(b){return true}epgd.vdrs.current.switchChannel(this.data.channelid)};epgd.eventDetail.prototype.doPrev=function(c){var b=this.data.starttime-500,a=this;if(bepgd.profile.maxEventTime){return false}if(c){return true}epgd.utils.loader.process(function(){new epgd.eventDetail().load(a.data.channelid,b).render()})};epgd.eventDetail.win=function(){this._create();this.closed=true;this.detail=null;var a=this;$(window).bind("epgd_close.eventDetail",function(){if(!a.closed){a.$win.css("z-Index","");a.$win.hide();$(document).unbind("keyup.eventDetail");a.closed=true;a.$openDialogs&&a.$openDialogs.removeClass("ui-state-disabled")}});$(window).bind("resize.eventDetail",function(b){if(!a.closed){try{a.$win.css("max-width",$(window).width());a.$win.show().position({of:window});a.$con.accordion("refresh")}catch(c){}if(parseInt(a.$win.css("top"),10)<69){a.$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 c=this,b=epgd.tr.pages.eventDetail,a=this.$win.find(".toolbar")[0];this.$rec=$('
    '}}u="";for(q in b.extInfo){if(t[q]){u+=""+b.extInfo[q]+""+t[q]+""}}if(t.scraper&&(a=t.scraper.movie||t.scraper.serie)){a.media=a.media||[];if(a.actors){w="";for(q in a.actors){c=a.actors[q];w+="
    "+(this.movieActorImgPath&&c.actorid?'':"")+''+c.actorname+""+(c.actorrole||"")+"
    "}}if(t.scraper.movie){a.isMovie=true;if(a.media&&this.movieImgPath){if(!p&&a.media["1"]){p=this.movieImgPath+a.movieid+"&media_type=1&maxW=270&maxH=146"}if(a.media["3"]){o=this.movieImgPath+a.movieid+"&media_type=3&maxW=400&maxH=999"}else{if(a.media["1"]){o=this.movieImgPath+a.movieid+"&media_type=1&maxW=400&maxH=999"}}}if(a.actors){w="";for(q in a.actors){c=a.actors[q];w+="
    "+(this.movieActorImgPath?'':"")+''+c.actorname+""+(c.actorrole||"")+"
    "}}if(a.overview){s='
    '+a.overview+"

    "+s}u="

    "+b.scrapperMovieInfo+'

    '+(a.media["1"]&&this.movieImgPath?'':"")+(a.title?"":"")+(a.originaltitle?"":"")+(a.runtime?"":"")+(a.movie_release_date?"":"")+(a.genres?"":"")+(a.voteaverage?"":"")+(a.popularity?"":"")+u+(a.budget?"":"")+(a.revenue?"":"")+(a.homepage?"":"")+"
    "+b.title+""+a.title+"
    "+b.original_title+""+a.originaltitle+"
    "+b.runtime+""+a.runtime+" "+epgd.tr.minutes+"
    "+b.release_date+""+a.movie_release_date+"
    "+b.genre+""+a.genres.replace(/^\||\|$/g,"").replace(/ ?\| ?/g,", ")+"
    "+b.vote_average+'
    ('+a.voteaverage.toFixed(1)+" / 10)
    "+b.popularity+""+a.popularity.toFixed(1)+"
    Budget$"+a.budget+"
    Einnahmen$"+a.revenue+"
    "+b.homepage+''+a.homepage+"
    "+(a.media["0"]&&this.movieImgPath?'':"")}else{a.isSerie=true;if(a.actors){w="";for(q in a.actors){c=a.actors[q];w+="
    "+(this.serieActorImgPath?'':"")+""+c.actorname+""+(c.actorrole?c.actorrole.replace(/\|/g,"
    "):"")+"
    "}}l=a.episode;if(l){if(l.episodeoverview){if(t.longdescription&&l.episodeoverview.length>t.longdescription.length){s=s.replace(/^/i,"")}s='
    '+l.episodeoverview+"
    "+s}s="
    "+l.episodename+"
    "+s;if(l.episodegueststars){w+='
    '+b.gueststars+"

    "+l.episodegueststars.replace(/^\||\|$/g,"").replace(/\|/g,"
    ")}}if(!p&&a.media["10"]&&this.serieImgPath){p=this.serieImgPath+a.seriesid+"&season_number="+l.seasonnumber+"&episode_id="+l.episodeid+"&media_type=10&maxW=270&maxH=146"}if(a.media["7"]){o=this.serieImgPath+a.seriesid+"&season_number=0&episode_id=0&media_type=7&maxW=400&maxh=999"}if(a.seriesoverview){s+=s?'
    Serienbeschreibung
    '+a.seriesoverview+"
    ":"
    "+a.seriesoverview+"
    "}u="

    "+b.scrapperSerieInfo+'

    '+(a.media["1"]&&this.serieImgPath?'':"")+(a.media["10"]&&this.serieImgPath?'':"")+(a.seriesname?"":"")+(a.seriesnetwork?"":"")+(a.seriesstatus?"":"")+(a.seriesfirstaired?"":"")+(a.seriesgenre?"":"")+(a.seriesrating?"":"")+u+(epgd.profile.serieSeasonPath?'":"")+"
    "+b.title+""+a.seriesname+"
    "+b.network+""+a.seriesnetwork+"
    "+b.seriesstatus+""+a.seriesstatus+"
    "+b.release_date+""+a.seriesfirstaired+"
    "+b.genre+""+a.seriesgenre.replace(/^\||\|$/g,"").replace(/ ?\| ?/g,", ")+"
    "+b.vote_average+'
    ('+a.seriesrating.toFixed(1)+" / 10)
    '+b.homepage+"
    "+(a.media["6"]&&this.serieImgPath?'':"")+(a.media["3"]&&this.serieImgPath?'':"")}}else{a={};u="

    "+b.extentedInfo+'

    "+(x.partname?"":"")+(t.year?"":"")+(x.lang?"":"")+u+"
    '+b.title+""+t.title+"
    "+b.part+""+x.partname+"
    "+b.release_date+""+t.year+"
    "+b.lang+""+x.lang+"
    "}if(!w&&t.actor){w=t.actor.replace(/, /g,"
    ")}w&&(u+='
    '+b.actors+"
    "+w+"
    ");u&&(u+="
    ");k=(t.path?epgd.tr.pages.timerList.folder+"
    "+t.path.replace(/\//g," / ")+"
    ":"")+(t.genre?(b.genre+""+t.genre+"
    "):"")+(t.category?b.category+""+t.category+"
    ":"")+(t.country?b.country+""+t.country+"
    ":"")+(t.year?b.year+""+t.year+"
    ":"");h=(x.part?b.part+""+x.part+(x.parts?" / "+x.parts+"":"")+"
    ":"")+(x.season?b.season+""+x.season+"
    ":"")+(x.number?b.number+""+x.number+"
    ":"")+(x.extracol1?x.extracol1+"
    ":"")+(x.extracol2?x.extracol2+"
    ":"")+(x.extracol3?x.extracol3+"
    ":"");if(t.recordings){for(q in t.recordings){l=t.recordings[q];r+='
    '+epgd.utils.formatDateTime(l.starttime)+""+parseInt(l.duration/60,10)+" "+epgd.tr.minutes+'
    '+l.title+(l.shorttext?'
    '+l.shorttext+"
    ":"")+"
    "}}this.$con=$('

    '+$.datepicker.formatDate(n?"d. M y":"d. MM yy",epgd.utils.date(t.starttime))+"
    "+(n?"":t.title)+'
    '+epgd.utils.formatTime(t.starttime)+" – "+epgd.utils.formatTime(t.starttime+t.duration)+" "+epgd.tr.oClock+" | "+parseInt(t.duration/60,10)+" "+epgd.tr.minutes+'

    '+(p?'':"")+'
    '+epgd.channels.getHtml(t.channelid)+(g>0&&g<=100?'
    ':"")+'
    '+(t.flags&&t.flags.indexOf("16:9")>0?'':"")+(t.audio&&t.audio.indexOf("DolbyDigital")>=0?'':"")+(t.flags&&t.flags.indexOf("Live")>0?"Live":"")+(t.parentalrating?'
    '+b.parentalrating+t.parentalrating+"
    ":"")+"
    "+(t.merge?"
    "+b.mergeSrc+t.merge+"
    ":"")+"
    "+(d?'
    '+d+"
    ":"")+'
    '+t.title+(x.partname?"
    "+x.partname+"":(t.shorttext?"
    "+t.shorttext+"":""))+'
    '+(t.tipp?''+t.tipp+"":"")+(t.txtrating?""+t.txtrating+"":"")+(t.shortreview||"")+"
    "+(k?'
    '+k+"
    ":"")+(h?'
    '+h+"
    ":"")+(o?'':"")+'
    '+(s?s.replace(/\n/g,"
    "):"")+"
    "+u+(t.category=="Serie"||a.isSerie||x.episodename?'

    '+b.constabelInfo+'

    '+epgd.tr.edit+''+epgd.tr.pages.eventDetail.addConstableLink+""+epgd.pages.help.getButton("constabel",true)+(epgd.profile.constabelLoginPath?'":"")+'
    ':"")+(r?"

    "+epgd.tr.menu.records+'

    '+r+"
    ":"")+"
    ").replaceAll(this.$con);this.$con.accordion({heightStyle:"fill",header:"h3",active:0,beforeActivate:function(e,i){if(i.newHeader.attr("data-conti")){epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/proxy?id=constabel&title="+encodeURIComponent(encodeURIComponent(i.newHeader.attr("data-conti")))+"&_"+new Date().getTime(),dataType:"html",contentType:"text/plain; charset=utf-8"},function(E){if(E.indexOf("Error:")==-1){var F=i.newPanel.find("#cRaw"),D=""+b.season+""+b.part+""+b.number+""+b.title+"",B="",A=E.split(/\r?\n/),z,y,C;for(C=0;C"}}else{y=z.split(/\t/);if(y.length>3){B+=""+y.join("")+""}}}F.html(E).hide().before('Raw');F.before(""+D+""+B+"
    ")}else{i.newPanel.find("#cRaw").html(epgd.tr.error.noData)}epgd.utils.loader.close()});i.newHeader.removeAttr("data-conti")},true)}}});this.$rec.toggleClass("hasTimer",!!t.timerid).prop("title",this.detail.doRecord(true));this.$play.toggle(this.detail.doPlay(true));this.$prev.toggle(this.detail.doPrev(true));this.$next.toggle(this.detail.doNext(true));this.$con.find(".channel .i-tv").click(function(){epgd.vdrs.current.switchChannel(this.parentNode.id)});this.closed=false;q=Math.max.apply(null,this.$win.siblings(".ui-front:visible").map(function(){return +$(this).css("z-index")}).get());if(q>=+this.$win.css("z-index")){this.$win.css("z-index",q+1)}$(window).trigger("resize.eventDetail");this.$openDialogs=$(".ui-dialog:visible:not(.ui-state-disabled)").addClass("ui-state-disabled");$(document).bind("keyup.eventDetail",function(i){if(i.keyCode==27){$(window).trigger("epgd_close.eventDetail")}});epgd.pages.help.initButtons(this.$con)};epgd.recordDetail=epgd.utils.inherits(function(a){this.elem=a;return epgd.eventDetail.call(this)},epgd.eventDetail);epgd.recordDetail.prototype.load=function(){var a=this;epgd.ajax({url:epgd.login.url+"data/recording?starttime="+this.elem.getAttribute("data-start")+"&md5path="+this.elem.getAttribute("data-md5")+"&owner="+this.elem.getAttribute("data-owner"),async:false},function(b){a.data=b.recording});return this};epgd.recordDetail.prototype.doRecord=function(a){if(a===true){return epgd.tr.pages.records.similarTimer}epgd.eventDetail.prototype.doRecord.call(this,a)};epgd.recordDetail.prototype.doPlay=function(a){if(a){return true}epgd.ajax({url:epgd.login.url+"data/replayrecording?vdruuid="+(!epgd.vdrs.list[this.data.vdruuid].usecommonrecfolder?this.data.vdruuid:epgd.vdrs.current.uuid)+"&starttime="+this.data.starttime+"&md5path="+this.data.md5path+"&owner="+(this.data.owner||""),cache:false},function(b){epgd.utils.popup(b.result.message,{title:"VDR",autoClose:5000})})};epgd.recordDetail.prototype.doPrev=function(b){var a=$(this.elem).prev(".rec");if(!a.length){return false}if(b){return true}a.find("B").click()};epgd.recordDetail.prototype.doNext=function(b){var a=$(this.elem).next(".rec");if(!a.length){return false}if(b){return true}a.find("B").click()};epgd.doneTimerDetail=epgd.utils.inherits(function(a){this.tr=a;return epgd.eventDetail.call(this)},epgd.eventDetail);epgd.doneTimerDetail.prototype.load=function(){var a=this;epgd.ajax({url:epgd.login.url+"data/donetimer?id="+this.tr.tData.id,async:false,cache:false},function(c){var b=c.donetimer;if(b.state){b.cntlongdescription=epgd.pages.timerListDone.stateIcons[b.state]}b.episode={lang:b.episodelang,season:b.episodeseason,part:b.episodepart};a.id=c.id;a.expire=epgd.utils.now().getTime()+900000;delete b.timerid;delete b.id;a.data=b});return this};epgd.doneTimerDetail.prototype.doRecord=function(a){if(a===true){return epgd.tr.pages.records.similarTimer}epgd.eventDetail.prototype.doRecord.call(this,a)};epgd.doneTimerDetail.prototype.doPlay=function(a){return false};epgd.doneTimerDetail.prototype.doPrev=function(b){var a=$(this.tr).prev("tr");if(!a.length){return false}if(b){return true}a.find("td").click()};epgd.doneTimerDetail.prototype.doNext=function(b){var a=$(this.tr).next("tr");if(!a.length){return false}if(b){return true}a.find("td").click()};$(document).ready(function(){epgd.eventDetail.prototype.win=new epgd.eventDetail.win()});epgd.pages.editChannels={render:function(){if(!(epgd.login.rights&epgd.rights.umConfigEdit)==epgd.rights.umConfigEdit){return epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}var i=epgd.tr.pages.editChannels,m=epgd.$con,e,l="",h="",k,c,d,g,b,a;for(d in epgd.channels.list){a=epgd.channels.list[d];k=[];for(g in a.sources){c=a.sources[g];k[c.merge]="
  • "+g+'
  • '}l+='
  • '+d+'
  • '}for(b in epgd.vdrs.list){h+='
  • '+epgd.vdrs.list[b].name+"
  • "}e=m.html('
    '+epgd.tr.pages.editChannels.headline+'
    Web
    channel-idchannel-name
    ').find("button");e.click(function(){var n=this.$menu.show();$(document).bind("click.ui_menu",function(o){if(!$(o.target).closest(".ui-menu").length){n.hide();$(this).unbind("click.ui_menu")}});return false})[0].$menu=$('").hide().insertAfter(e).menu({select:function(p,q){var s=q.item,n,r,o="";if(!s.attr("data-id")){s=s.parents("li[data-id]:first")}switch(s.attr("data-id")){case"getChannelNames":o='[value=""]';case"getAllChannelNames":epgd.utils.loader.process(function(){var t=[];$("#pageEditChannelsSource li").each(function(){t[this.lastChild.innerHTML]=this.firstChild.innerHTML});$("#pageEditChannels > li > input"+o).each(function(){this.value=t[this.previousSibling.innerHTML]||this.value})});break;case"getOrder":epgd.utils.loader.process(function(){var u=$("#pageEditChannels"),t;$($("#pageEditChannelsSource span").get().reverse()).each(function(){t=u.find("> li > span:contains("+this.innerHTML+")");if(t.length){t.parent().prependTo(u)}})});break;case"insertList":$('

    '+i.desc_insertList+' channelpedia.yavdr.com

    ').dialog({modal:true,width:500,height:400}).find("textarea").change(function(){epgd.pages.editChannels.insertReferenceList(this.value);$(this).parent().dialog("destroy")});break;case"loadList":if(q.item.attr("data-url")){epgd.ajax({url:epgd.login.url+"data/proxy?id="+q.item.attr("data-url"),dataType:"html",contentType:"text/plain; charset=utf-8"},epgd.pages.editChannels.insertReferenceList);break}case"channelpedia":n=$('
    ");this.$trash=this.$bar.find(".i-trash");this.curSearch={pattern:"",searchValue:"",hits:$(),cur:0,$count:this.$bar.find("#rSCnt"),fromStart:this.$bar.find("#rSVal").prev("button")[0],toEnd:this.$bar.find("#rSVal").next("button")[0]}}this.$bar.insertAfter(epgd.$menu);this.$trash.droppable({accept:".rec",hoverClass:"ui-state-hover",tolerance:"pointer",drop:function(c,d){var b=d.helper.context;epgd.utils.confirm(epgd.tr.pages.records.deleteMessage.replace("$src$",b.getAttribute("data-path")),function(e){e&&epgd.pages.records.del(b)});return false}}).click(function(){var b=$("#records").find(".rec.selected");b.length&&epgd.utils.confirm(epgd.tr.confirmDelete+(b.length>1?"
    "+b.length+epgd.tr.entries:""),function(c){c&&b.each(function(){epgd.pages.records.del(this)})})});epgd.pages.help.initButtons(this.$bar);epgd.$menu.checkMenuSize();$(window).bind("epgd_close.records",function(){epgd.pages.records.$bar.remove();epgd.$menu.checkMenuSize();$(window).unbind(".records")});epgd.$con.html('
    ');epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/recordings",cache:false},function(x){var b=x.recordings,g,y,o,l,n,r,m={f:{},r:[]},d={},s,k,h="",q=" "+epgd.tr.minutes,u,e=epgd.profile.recordSubFolderSort==6?function(p,i){return p.starttime>i.starttime?-1:1}:epgd.profile.recordSubFolderSort==5?function(p,i){return p.starttime>i.starttime?1:-1}:epgd.profile.recordSubFolderSort==4?function(p,i){return p.path>i.path?-1:1}:epgd.profile.recordSubFolderSort==3?function(p,i){return p.path>i.path?1:-1}:epgd.profile.recordSubFolderSort==2?function(p,i){return p.tit>i.tit?-1:1}:function(p,i){return p.tit>i.tit?1:-1};for(s in epgd.vdrs.list){k=epgd.vdrs.list[s];if(!k.usecommonrecfolder){d[s]={f:{},r:[]}}h+="
    VDR - "+k.name+": "+k.videodir+" - "+parseInt(k.videofree/1000,10)+" GB "+a.available+" / "+parseInt(k.videototal/1000,10)+" GB
    "}if(!$("#dragdrop").parent().length){return false}epgd.$con.find("#records").before(h);h="";for(r in b){g=b[r];l=d[g.vdruuid]||m;o=g.path.split("/");o.pop();for(n=0;n0}function c(i){Object.keys(i.f).sort().forEach(function(v){var t=i.f[v],p;h+=v?'

    ('+(t.cnt)+')'+v+"

    ":"
    ";t.f&&c(t);if(t.r.length){for(p in t.r){g=t.r[p];g.tit=((g.name!=v?g.name:"")+(v!=g.title&&(g.title!=g.name)?"
    "+g.title:"")+(g.shorttext&&(g.shorttext!=g.name)?""+g.shorttext+"":""))||v;g.html='
    '+epgd.utils.formatDateTime(g.starttime)+""+parseInt(g.duration/60,10)+q+""+g.tit+"
    "}t.r.sort(e);for(p in t.r){h+=t.r[p].html}}h+="
    "})}n={};if(w(m)){n[a.commonRecFolder]=m}for(s in d){l=d[s];if(w(l)){n["VDR - "+epgd.vdrs.list[s].name]=l}}c({f:n});u=epgd.$con.find("#records").html(h);if(!u.length){return false}u=u.click(epgd.pages.records.action).find(">div");if(u.length==1){u.first().toggleClass("open")}epgd.pages.records.$menu=$('
    •   '+epgd.tr.pages.eventDetail.title+'
    •   '+epgd.tr.pages.timerList.folder+'
    •   '+epgd.tr.pages.timerList.recordTime+"
    ").hide().appendTo(epgd.$con);$("#dragdrop").change();epgd.pages.records.curSearch.$recs=null;epgd.utils.loader.close()})},true)},search:function(e){var c=this.curSearch,h,b,d,a=c.fromStart.checked,g=c.toEnd.checked;if(!c.$recs){c.$recs=epgd.$con.find("#records .rec,h4")}if(typeof e=="string"){c.searchValue=e.replace(//g,">")}d=(a?">"+c.searchValue:c.searchValue).toLowerCase()+(g?"<":"");if(d==c.pattern){return}h=c.searchValue.length;b=c.$recs;if(c.hits.length){$(c.hits).each(function(){this.innerHTML=this.innerHTML.replace(/([^<]+)<\/mark>/gi,"$1")}).parents(".tmp-open").removeClass("tmp-open");if(d.indexOf(c.pattern)==0){b=$(c.hits)}else{c.cur=0}c.hits=[]}else{c.cur=0}c.pattern=d;if(h>2){b.each(function(){var i=this.innerHTML.toLowerCase().indexOf(d);if(i>0){c.hits.push(this);$(this).parents(".folder").addClass("tmp-open");do{if(a){i++}this.innerHTML=this.innerHTML.slice(0,i)+""+c.searchValue+""+this.innerHTML.slice(i+h)}while((i=this.innerHTML.toLowerCase().indexOf(d,i+13))>0)}});c.$count.text(c.hits.length).parent().show();this.searchMove(0)}else{c.$count.parent().hide()}},searchMove:function(a){this.curSearch.cur+=a;var b=this.curSearch.hits[this.curSearch.cur];if(!b){this.curSearch.cur=a<0?this.curSearch.hits.length-1:0;b=this.curSearch.hits[this.curSearch.cur]}if(b){b.scrollIntoView(false);$(b).css({"background-color":"green"});window.setTimeout(function(){$(b).css({"background-color":""})},1500)}},action:function(b){var a=b.target;if(a.nodeName=="MARK"){a=a.parentNode}if(a.nodeName=="M"){epgd.pages.records.$menu.show().position({my:"left top",at:"left bottom",of:a}).find("a").removeClass("ui-state-highlight");epgd.pages.records.$menu.find("a[data-sort="+(a.curSort||epgd.profile.recordSubFolderSort)+"]").addClass("ui-state-highlight");$(document).one("click.recmenu",function(d){if(d.target.nodeName=="A"){var c=d.target.parentNode.getAttribute("data-type");if(c){a.curSort=d.target.getAttribute("data-sort");epgd.pages.records.sort(a.parentNode.parentNode,a.curSort)}}epgd.pages.records.$menu.hide();$(document).unbind(".recmenu")}).bind("keyup.recmenu",function(c){if(c.keyCode==27){$(document).trigger("click.recmenu")}});return false}if(a.nodeName=="I"||a.nodeName=="SPAN"){a=a.parentNode}if(a.nodeName=="B"){a=a.parentNode;if(!a.recDetail){a.recDetail=new epgd.recordDetail(a)}epgd.utils.loader.process(function(){a.recDetail.render()})}else{if(a.nodeName=="H4"){a=a.parentNode;if(a.nodeName=="DIV"&&a.className.indexOf("folder")>=0){if(a.className.indexOf("open")==-1){if($(window).width()<500){$(a).siblings(".open").removeClass("open");document.body.scrollTop=$(a).offset().top-35}$(a).addClass("open")}else{$(a).removeClass("open")}}}else{$(a).closest(".rec").toggleClass("selected")}}},dd:function(b){var c=$("#records"),a=c.find(".rec").has(".ui-draggable");if(b&&a.length==0){c.find("h4").droppable(this.__dropSettings);a.end().draggable({cancle:"b",revert:"invalid",distance:15,helper:function(){return $(this).clone().css("display","block")},appendTo:"body",cursor:"pointer",cursorAt:{left:-15,top:5},start:function(d,e){$(document).trigger("click.recmenu");$(document.body).addClass("dd-open");document.body.style.paddingTop=epgd.pages.records.$bar.height()+"px";document.body.scrollTop-=d.pageY-$(d.delegateTarget).closest(".folder").offset().top},stop:function(d,e){$(document.body).removeClass("dd-open");epgd.$menu.checkMenuSize()}})}else{if(a.length){a.draggable(b?"enable":"disable")}}},__dropSettings:{accept:".rec",hoverClass:"ui-state-hover",tolerance:"pointer",drop:function(b,c){console.log("Dropped!",b,c);var a=$(b.target),d="";do{d=a.text().replace(/^\(.*\)/,"")+"/"+d;a=a.parent()}while((a=a.prevAll("h4")).length);epgd.pages.records.move(c.draggable.context,d.slice(d.indexOf("/",2)+1).replace(/ /g,"_"),b.target.parentNode);return false}},update:function(){epgd.ajax({url:epgd.login.url+"data/updaterecordings"},function(a){epgd.utils.topInfo(epgd.tr.pages.records.refreshMessage.replace("$sec$",5),{autoClose:5000});$(window).trigger("epgd_close.records");window.setTimeout(function(){epgd.pages.records.render()},5000)})},move:function(e,h,d){var g=e.getAttribute("data-path").split("/"),b=g.pop(),c,a=0;g=g.join("/")+"/";for(c=0;ch4>span").each(function(){this.innerHTML="("+(parseInt(this.innerHTML.slice(1,-1),10)-1)+")"});p=o.find("span");p.text("("+(parseInt(p.text().slice(1,-1),10)+1)+")");for(l=0;l.folder>h4").each(function(){if(this.lastChild.nodeValue==m[l]){o=$(this.parentNode);p=o.find("span");p.text("("+(parseInt(p.text().slice(1,-1),10)+1)+")");return true}else{return false}}).length==0){for(;l(1)'+m[l]+"
    ").droppable(epgd.pages.records.__dropSettings).wrap('
    ').parent().appendTo(o)}}}k.appendTo(o);epgd.pages.records.sort(d);epgd.utils.topInfo(epgd.tr.dataSaved);epgd.pages.records.__updateRec(e)}else{epgd.utils.topInfo(n.message,{isError:1});return false}})}return !!g},__updateRec:function(b,a){epgd.ajax({url:epgd.login.url+"data/recording?starttime="+b.getAttribute("data-start")+"&path="+b.getAttribute("data-path")+"&owner="+b.getAttribute("data-owner")+"&"+a,async:true},function(c){$(b).attr("data-md5",c.recording.md5path).draggable("enable").removeClass("ui-state-disabled")},function(d,c){if(!a){a=0}else{if(a>=5){return epgd.utils.popup(epgd.tr.pages.records.notFoundMessage,{title:epgd.tr.error.error})}}window.setTimeout(epgd.pages.records.__updateRec,3000,b,++a);return true})},del:function(a){epgd.ajax({url:epgd.login.url+"data/deleterecording?starttime="+a.getAttribute("data-start")+"&md5path="+a.getAttribute("data-md5")+"&owner="+a.getAttribute("data-owner"),async:true},function(b){b=b.result;if(b&&b.state==200){epgd.utils.topInfo(a.getAttribute("data-path")+"
    "+epgd.tr.dataSaved);$(a).parents(".folder:not(:last)").find(">h4>span").each(function(){this.innerHTML="("+(parseInt(this.innerHTML.slice(1,-1),10)-1)+")"});$(a).remove()}else{epgd.utils.topInfo(a.getAttribute("data-path")+"
    "+b.message,{isError:1})}})},sort:function(a,d){var e=$(a).find(">div.rec"),b=d%2?1:-1,c;if(!d){d=$(">h4>m",a)[0].curSort||epgd.profile.recordSubFolderSort}if(d<3){e.sort(function(h,g){return h.lastChild.innerHTML>g.lastChild.innerHTML?b:-b}).appendTo(a)}else{c=d<5?"data-path":"data-start";e.sort(function(h,g){return h.getAttribute(c)>g.getAttribute(c)?b:-b}).appendTo(a)}$(a).find(">div.folder").each(function(){epgd.pages.records.sort(this,d)})}};epgd.sortTable=function(a){this.o=$.extend({conSel:epgd.$con,empty:"",right:1},a)};epgd.sortTable.prototype={sortIcons:'',update:function(){},hideHead:function(){var a=this.$con.find("thead:first").hide().find(">tr>th");this.$con.find("tbody:first").html(''+this.o.empty+(a.last().find(".i-doc-new").wrapAll("
    ").parent().html()||"")+"")},showHead:function(){this.$con.find(">table>thead").show();this.filter();this.sort()},getTable:function(){},action:function(a,c,b){switch(c){case"refresh":this.update();break;case"detail":if(!a[0].eventDetail){a[0].eventDetail=new epgd.eventDetail(b)}epgd.utils.loader.process(function(){a[0].eventDetail.render()});break}},render:function(a,b){this.trs=[];this.$con=a||$(this.o.conSel);this.$con.empty();if(!(epgd.login.rights&this.o.right)==this.o.right){return epgd.utils.popup(epgd.tr.error.forbidden,{title:epgd.tr.error.error})}this.$con.html(this.getTable());this.init();this.update(b)},init:function(){var b=this,a=0;this.$con.find(">table").click(function(h){var e=$(h.target),g=e[0],i=g.getAttribute("data-evId"),k,c;if(i){b.action(e,"detail",i)}else{if(h.target.className=="i-tv"){epgd.vdrs.current.switchChannel(h.target.parentNode.id)}else{e=e.closest("span.sort");if(e.length){e.parent().parent().find(".ui-state-highlight").removeClass("ui-state-highlight");e.addClass("ui-state-highlight");b.sort(e)}else{e=$(g).closest("span.edit");if(e.length){b.action(e,e[0].className.match(/i-([a-z0-9-]+)/)[1])}if(b.o.selectable){if(g.nodeName=="TD"){e=$(g).parent().toggleClass("selected");if(h.shiftKey&&this.lastSel){c=$(this.lastSel);k=e.index()-c.index();if(k>0){c.nextAll(":lt("+k+"):visible").toggleClass("selected",c.hasClass("selected"))}else{c.prevAll(":lt("+-k+"):visible").toggleClass("selected",c.hasClass("selected"))}}else{this.lastSel=e[0]}}else{if(g.nodeName=="B"){k=g.getAttribute("data-t");$(b.trs).filter(":visible").toggleClass("selected",k==1?true:k==0?false:undefined);return false}}}}return false}}}).find(">thead>tr").find(">th").each(function(){this.cIndex=a;a+=this.colSpan}).end().find('[data-defaultSort="1"]>span.sort:last,[data-defaultSort="-1"]>span.sort:first').addClass("ui-state-highlight");this.$con.find(">table>thead input.filter").keyup(function(){b.filter()}).each(function(){if(!this.result){this.result=$('').insertAfter(this)[0]}})},sort:function(e){e=e||this.$con.find(">table>thead .ui-state-highlight");if(!e.length){return}var c=e.parent()[0],g=(e.hasClass("i-sort-name-down")?-1:1),a=this.trs,b,h;if(!c.sortInfo){c=c.cIndex;for(b=0;bk?1*g:l==k?0:-1*g)});this.$con.find(">table>tbody").append(a.slice())},filter:function(){var b={},a,d,e,c;this.$con.find(">table>thead input.filter").each(function(){if(this.value){b[this.parentNode.cIndex]=[this.value.toLowerCase(),0,this.result||{}]}else{if(this.result){this.result.innerHTML=""}}});for(a=0;a
      '+(b.length?"
    1. "+b.join("
    2. ")+"
    3. ":"")+'
      '+(a.length>1?"
    • "+a.slice(1).replace(/,/g,"
    • ")+"
    • ":"")+"
    ").dialog({modal:true,buttons:[{text:epgd.tr.apply,click:function(){var e="";$(this).find("ol > li").each(function(){e+=","+this.innerHTML});c.value=e.slice(1);$(this).dialog("close")}},{text:epgd.tr.cancel,click:function(){$(this).dialog("close")}}]}).find("ul,ol").sortable({connectWith:"ul,ol"}).disableSelection()};epgd.timerListBase=epgd.utils.inherits(function(a,b){this.dialog=b;if(this.dialog){this.dialog.list=this}if(!a.conSel){a.conSel="#content"}if(!a.empty){a.empty=epgd.tr.pages.timerList.empty}epgd.sortTable.call(this,a)},epgd.sortTable);epgd.timerListBase.prototype.getTable=function(){var a=epgd.tr.pages.timerList;return'
    '+epgd.tr.channel+this.sortIcons+''+a.startTime+this.sortIcons+' '+a.endTime+''+epgd.tr.pages.eventDetail.title+this.sortIcons+' VDR'+this.sortIcons+' '+this.sortIcons+(this.o.addNew?'':"")+(this.o.selectable?'
    ':"")+"
    "};epgd.timerListBase.prototype.update=function(){var a=this;epgd.utils.loader.process(function(){a.$con.find("tbody").empty();epgd.ajax({url:epgd.login.url+a.o.updateUrl,async:false,cache:false},function(g){if(!g.timers.length){a.hideHead()}else{var b=[],i=a.editIcons,h="DF",e={D:'
    '+epgd.tr.pages.timerList.timerStates.D+"
    ",E:'
    '+epgd.tr.pages.timerList.timerStates.E+"
    ",F:'
    '+epgd.tr.pages.timerList.timerStates.F+"
    ",R:'
    '+epgd.tr.pages.timerList.timerStates.R+"
    ",P:'
    '+epgd.tr.pages.timerList.timerStates.P+"
    ",U:'
    '+epgd.tr.pages.timerList.timerStates.U+"
    "},d=epgd.tr.pages.timerList.timerActions,c='$title$';$.each(g.timers,function(n,k){k.action=k.action?k.action.toUpperCase():"A";k.state=k.state?k.state.toUpperCase():"U";var m=epgd.vdrs.list[k.vdruuid]||{name:"--"},l=$(""+epgd.channels.getHtml(k.channelid)+""+(k.action!="A"?'
    '+d[k.action]+"
    ":e[k.state])+(k.info||"")+''+(k.day?epgd.utils.formatDate(k.day):"-")+""+new String(100+parseInt(k.starttime/100,10)).slice(1)+":"+new String(100+parseInt(k.starttime%100,10)).slice(1)+""+new String(100+parseInt(k.endtime/100,10)).slice(1)+":"+new String(100+parseInt(k.endtime%100,10)).slice(1)+"'+(k.title||"")+"
    "+(k.shorttext||""):">")+""+m.name+"
    "+(k.directory?k.directory+"~":"")+(k.file||"")+""+(k.autotimerid?c.replace("$id$",k.autotimerid).replace("$title$",k.autotimername||k.expression||epgd.tr.pages.timer.searchTimerList):"")+(h.indexOf(k.state)==-1?i:"")+"")[0];l.tData=k;b.push(l)});a.trs=b;a.showHead()}epgd.utils.loader.close();$(window).trigger("timerlist_updated",a)})},true)};epgd.timerListBase.prototype.action=function(a,d,b){var c;switch(d){case"edit":case"doc-new":this.dialog.render(a.closest("tr")[0].tData);break;case"trash":this.del(this.getSelectedIds(a));break;case"flashlight":c=a.attr("data-id"),list=this;$(window).one("searchTimerList_updated",function(){list.$con.find("tbody>tr").each(function(){if(this.tData.id==c){epgd.pages.searchTimerList.dialog.render(this.tData);return false}})});epgd.$menu.menu("select",{target:"#menu_searchTimerList"});break;default:epgd.sortTable.prototype.action.call(this,a,d,b)}};epgd.timerListBase.prototype.editIcons='';epgd.timerListBase.prototype.getSelectedIds=function(a){var b=[];if(a[0].parentNode.nodeName=="TH"){$(this.trs).filter(".selected:visible").each(function(){b.push(this.tData.id)})}else{b.push(a.closest("tr")[0].tData.id)}return b};epgd.timerListBase.prototype.del=function(c,d,e){var b=this,a=$.isArray(c)?c:[parseInt(c,10)];c&&a.length&&epgd.utils.confirm(epgd.tr.confirmDelete+(a.length>1?"
    "+a.length+epgd.tr.entries:""),function(g){g&&b.saveArray(a,e||"delete",d)})};epgd.timerListBase.prototype.saveArray=function(c,g,e){var b=this,a=$.isArray(c)?c:[parseInt(c,10)],d={};d[g]=a;c&&a.length&&this.save(d,null,function(k){try{var h=",";$(k.responseJSON.result.failed).each(function(){h+=a[this]+","});if(h.length>1){$(b.trs).each(function(){if(h.indexOf(","+this.tData.id+",")>=0){this.style.backgroundColor="red"}})}}catch(i){}return false},e)};epgd.timerListBase.prototype.save=function(d,b,a,c){if(!d){return false}var e=this;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+(b||e.o.saveUrl),type:"post",data:JSON.stringify(d)},function(g){g=g.result;if(g.state==200){epgd.utils.topInfo(epgd.tr.dataSaved)}else{epgd.utils.topInfo(g.message,{isError:1})}epgd.utils.loader.close();e.$con&&e.$con.parent().length&&e.update();c&&c.call(e)},a)},true);return true};epgd.searchResultList=epgd.utils.inherits(function(a,b){epgd.timerListBase.call(this,$.extend({saveUrl:"data/save-searchtimer"},a),b)},epgd.timerListBase);epgd.searchResultList.prototype.getTable=function(){var a=epgd.tr.pages.timerList;return'
    '+epgd.tr.channel+this.sortIcons+''+a.startTime+this.sortIcons+""+a.endTime+""+epgd.tr.pages.eventDetail.title+this.sortIcons+"
    "};epgd.searchResultList.prototype.update=function(b){if(!b){return false}var a=this;b.id&&delete b.id;b.name&&delete b.name;b.max=epgd.profile.maxListEntries;epgd.utils.loader.process(function(){a.$con.find("tbody").empty();epgd.ajax({url:epgd.login.url+"data/search",type:"post",data:JSON.stringify(b)},function(e){var c=[],d;if(!e.events||!e.events.length){a.hideHead()}else{e.count>b.max&&epgd.utils.popup("Achtung! Es wurden "+e.count+" Ergebnisse gefunden. Angezeigt werden aber nur "+b.max+".
    Das Nachladen ist noch nicht implementiert! Der Wert kann in den Einstellungen angepasst werden");$.each(e.events,function(l,h){var k="",g="",i;if(h.dones){for(d in h.dones){i=h.dones[d];g+=''+i.state+"";if(i.state=="R"){k=' class="ui-state-disabled"'}}}c.push($(""+epgd.channels.getHtml(h.channelid)+''+epgd.utils.formatDate(h.starttime)+""+epgd.utils.formatTime(h.starttime)+""+epgd.utils.formatTime(h.starttime+h.duration)+''+h.title+"
    "+(h.shorttext||"")+""+g+"").tooltip()[0])});a.trs=c;a.showHead()}epgd.utils.loader.close();a.dialog&&a.dialog.resize&&window.setTimeout(function(){a.dialog.resize()},100)})},true)};epgd.searchTimerTimerList=epgd.utils.inherits(function(a,b){epgd.timerListBase.call(this,$.extend({saveUrl:"data/save-timer",updateUrl:"data/timers?state=P,R"},a),b)},epgd.timerListBase);epgd.searchTimerTimerList.prototype.getTable=function(){var a=epgd.tr.pages.timerList;return'
    '+epgd.tr.channel+this.sortIcons+''+a.startTime+this.sortIcons+""+a.endTime+""+epgd.tr.pages.eventDetail.title+this.sortIcons+"VDR"+this.sortIcons+"
    "};epgd.searchTimerTimerList.prototype.update=function(b){if(!b){return false}var a=this;epgd.utils.loader.process(function(){a.$con.find("tbody").empty();epgd.ajax({url:epgd.login.url+a.o.updateUrl+"&autotimerid="+b.id,async:true,cache:false},function(d){var c=[],e='';if(!d.timers.length){a.hideHead()}else{$.each(d.timers,function(k,g){var i=epgd.vdrs.list[g.vdruuid]||{name:"--"},h=$(""+epgd.channels.getHtml(g.channelid)+''+(g.day?$.datepicker.formatDate(epgd.tr.dateTimePicker.dateFormat,epgd.utils.date(g.day)):"-")+""+new String(100+parseInt(g.starttime/100,10)).slice(1)+":"+new String(100+parseInt(g.starttime%100,10)).slice(1)+""+new String(100+parseInt(g.endtime/100,10)).slice(1)+":"+new String(100+parseInt(g.endtime%100,10)).slice(1)+"'+g.title+"
    "+(g.shorttext||""):">")+""+i.name+"
    "+g.file+""+e+"")[0];h.tData=g;c.push(h)});a.trs=c;a.showHead()}a.dialog&&a.dialog.resize&&window.setTimeout(function(){a.dialog.resize()},100);epgd.utils.loader.close()})})};epgd.pages.timerList=new epgd.timerListBase({updateUrl:"data/timers?state=P,R",saveUrl:"data/save-timer",selectable:true,addNew:true,right:epgd.rights.umTimer},new epgd.timerDialog());epgd.pages.timersDone=new epgd.timerListBase({updateUrl:"data/timers?state=D,F,E&action=A",right:epgd.rights.umTimer});epgd.pages.timersDone.getTable=function(){return epgd.timerListBase.prototype.getTable.call(this).replace('data-defaultSort="1"','data-defaultSort="-1"')};epgd.pages.timerListDone=new epgd.timerListBase({updateUrl:"data/donetimers",saveUrl:"data/store-donetimers",selectable:true,right:epgd.rights.umTimer});epgd.pages.timerListDone.getTable=function(){return'
    '+this.sortIcons+''+epgd.tr.pages.timerList.recordTime+this.sortIcons+""+epgd.tr.pages.eventDetail.title+' '+this.sortIcons+''+epgd.tr.channel+this.sortIcons+''+this.sortIcons+'
    '};epgd.pages.timerListDone.action=function(a,c,b){if(c=="detail"&&!a[0].eventDetail){a[0].eventDetail=new epgd.doneTimerDetail(a.parent()[0])}epgd.timerListBase.prototype.action.call(this,a,c,b)};epgd.pages.timerListDone.stateIcons={D:'
    '+epgd.tr.pages.timerList.doneStates.D+"
    ",F:'
    '+epgd.tr.pages.timerList.doneStates.F+"
    ",f:'
    '+epgd.tr.pages.timerList.doneStates.f+"
    ",R:'
    '+epgd.tr.pages.timerList.doneStates.R+"
    ",C:'
    '+epgd.tr.pages.timerList.doneStates.C+"
    ",Q:'
    '+epgd.tr.pages.timerList.doneStates.Q+"
    "};epgd.pages.timerListDone.update=function(){var a=this;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+a.o.updateUrl,async:false,cache:false},function(h){a.$con.find("tbody").empty();if(!h.donetimers.length){a.hideHead()}else{var b=[],g,e,d,c='$title$';for(e in h.donetimers){d=h.donetimers[e];g=$(""+(d.state&&a.stateIcons[d.state]||"")+''+epgd.utils.formatDateTime(d.starttime)+"
    "+parseInt(d.duration/60,10)+" "+epgd.tr.minutes+''+(d.title||"")+"
    "+(d.shorttext||"")+''+epgd.channels.getHtml(d.channelid)+''+(d.autotimerid?c.replace("$id$",d.autotimerid).replace("$title$",d.autotimername||d.expression||epgd.tr.pages.timer.searchTimerList):"")+"")[0];g.tData=d;b.push(g)}a.trs=b;a.showHead()}epgd.utils.loader.close();$(window).trigger("timerlist_updated",a)})},true)};epgd.pages.timerJobList=new epgd.timerListBase({updateUrl:"data/timers?notaction=A",saveUrl:"data/delete-timerjobs",selectable:true,right:epgd.rights.umTimer},new epgd.timerDialog());epgd.pages.searchTimerList=new epgd.timerListBase({saveUrl:"data/save-searchtimer",right:epgd.rights.umSearchTimer},new epgd.searchTimerDialog());epgd.pages.searchTimerList.getTable=function(){var a=epgd.tr.pages.timerList;return'
    '+epgd.tr.pages.search.searchName+"/"+epgd.tr.pages.search.searchExpression+' '+this.sortIcons+"hits"+this.sortIcons+'VDR'+this.sortIcons+'
    '};epgd.pages.searchTimerList.action=function(c,e,d){epgd.timerListBase.prototype.action.call(this,c,e,d);switch(e){case"link-ext":this.triggerUpdate();break;case"down-dir":if(!c[0].tList){var b={$td:c.parent().css("position","relative"),tdHeight:c.parent().outerHeight()+10,data:c.parent().parent()[0].tData,resize:function(){var g=this.list.$con.find(">table").addClass("sub");g.width(this.$td.parent().outerWidth());this.$td.height(this.tdHeight+g.outerHeight(true)+10)},toggle:function(g){this.list.$con.toggle(g);if(g){this.$td.css("height","100px");this.list.update(this.data)}else{this.$td.css("height","auto")}}},a={conSel:$('
    ').appendTo(document.body)};c[0].tList=b.data.type=="S"?new epgd.searchResultList(a,b):new epgd.searchTimerTimerList(a,b);c[0].tList.render();b.$td.append(b.list.$con)}c[0].tList.dialog.toggle(true);c.removeClass("i-down-dir").addClass("i-right-dir");break;case"right-dir":c.removeClass("i-right-dir").addClass("i-down-dir");if(c[0].tList){c[0].tList.dialog.toggle(false)}break}};epgd.pages.searchTimerList.update=function(){var a=this;this.$con.find("tbody").empty();epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/searchtimers",async:false,cache:false},function(d){var b=[],e=a.editIcons,c={V:"i-tv",R:"i-record",S:"i-search"};if(!d.searchtimers.length){a.hideHead()}else{$.each(d.searchtimers,function(k,g){var i=epgd.vdrs.list[g.vdruuid]||{name:"--"},h=$("
    '+(g.name||g.expression)+"
    --":' data-sort="'+new String("00000"+g.hits).slice(-5)+'">'+g.hits)+""+i.name+""+e+"")[0];h.tData=g;b.push(h)});a.trs=b;a.showHead()}epgd.utils.loader.close();$(window).trigger("searchTimerList_updated",a)})})};epgd.pages.searchTimerList.triggerUpdate=function(){var a=this;epgd.ajax({url:epgd.login.url+"data/updatesearchtimer"},function(b){if(b.result.state==200){epgd.utils.topInfo(epgd.tr.dataSaved)}else{epgd.utils.topInfo(b.message,{isError:1})}a.update()})};epgd.pages.search=new epgd.searchDialog();epgd.pages.messageList=new epgd.timerListBase({saveUrl:"data/markmessages",selectable:true});epgd.pages.messageList.getTable=function(){return'
    id'+this.sortIcons+'Typ '+this.sortIcons+'Zeit'+this.sortIcons+'Titel '+this.sortIcons+'infotext '+this.sortIcons+'
    Status
    '+this.sortIcons+'
    '};epgd.pages.messageList.update=function(b){var a=this;epgd.utils.loader.process(function(){epgd.ajax({url:epgd.login.url+"data/messages",async:false,cache:false},function(l){a.$con.find("tbody").empty();if(!l.messages.length){a.hideHead()}else{var c=[],k,h,g,e={N:''+epgd.tr.pages.timerList.messageStates.N+"",R:''+epgd.tr.pages.timerList.messageStates.R+""},d={E:'
    '+epgd.tr.pages.timerList.timerStates.E+"
    ",F:'
    '+epgd.tr.pages.timerList.timerStates.F+"
    ",I:'
    '+epgd.tr.pages.timerList.messageTypes.I+"
    ",W:'
    '+epgd.tr.pages.timerList.messageTypes.W+"
    "};for(h in l.messages){g=l.messages[h];k=$(''+g.id+""+(d[g.type]||"")+''+epgd.utils.formatDateTime(g.updsp)+""+g.title+""+g.text+''+(e[g.state]||"")+"")[0];k.tData=g;c.push(k)}a.trs=c;a.$con.find(">table>tbody").append(c.sort(function(m,i){return m.tData.state==i.tData.state?m.tData.state.updsp>i.tData.state.updsp?-1:1:m.tData.state>i.tData.state}).slice());a.showHead()}epgd.utils.loader.close();$(window).trigger("messagelist_updated",a)})},true)};epgd.pages.messageList.action=function(b,g,e){var c=this.getSelectedIds(b),d=null,a;if(c){switch(g){case"check":d=b[0].parentNode.nodeName=="TH"?"R":"N";break;case"check-empty":d=b[0].parentNode.nodeName=="TH"?"N":"R";break;case"trash":d="D";break}if(d){for(a in c){c[a]={id:c[a],state:d}}d=="D"?this.del(c,null,"messages"):this.saveArray(c,"messages");return true}}return epgd.timerListBase.prototype.action.call(this,b,g,e)};epgd.vdr=function(a,b){this.uuid=a;$.extend(this,b)};epgd.vdr.prototype.switchChannel=function(a){epgd.ajax({url:epgd.login.url+"data/channelswitch?uuid="+this.uuid+"&channel="+a,cache:false},function(b){epgd.utils.popup(b.result.message,{title:"VDR",autoClose:5000})})};epgd.vdr.prototype.wol=function(){epgd.ajax({url:epgd.login.url+"data/wakeupvdr?uuid="+this.uuid,cache:false},function(a){epgd.utils.popup(a.result.message,{title:"VDR",autoClose:5000})})};epgd.vdrs={list:null,current:null,load:function(){if(!this.list){this.list={};epgd.ajax({url:epgd.login.url+"data/vdrs",async:false},function(b){var a;for(a in b.vdrs){epgd.vdrs.list[a]=new epgd.vdr(a,b.vdrs[a])}if(!epgd.vdrs.current){if(epgd.profile.defaultVDRuuid){epgd.vdrs.current=epgd.vdrs.list[epgd.profile.defaultVDRuuid];if(!epgd.vdrs.current){epgd.utils.log("the default VDR ("+epgd.profile.defaultVDRuuid+" is invalid! Please change this in Web Interface/options)")}}if(!epgd.vdrs.current){for(a in epgd.vdrs.list){epgd.vdrs.current=epgd.vdrs.list[a];break}}if(!epgd.vdrs.current){epgd.utils.log("no VDR found",2);epgd.vdrs.current=new epgd.vdr("000-missing-vdr-000",{name:"no VDR found"})}}$(window).trigger("vdrs_load")})}},get:function(a){return this.list[(a||this.current)]||{}}};epgd.pages.vdrs={render:function(){epgd.$con.html('
    ')}}; \ No newline at end of file -- cgit v1.2.3