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=$(' '+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=$('