From f91218077e02bbf57f80a8b8db9797d4dc202034 Mon Sep 17 00:00:00 2001 From: horchi Date: Sat, 24 Jun 2017 14:16:50 +0200 Subject: 2017-06-24: version 1.1.118 (rechner)\n - fixed: Fixed error while click on channel in pageNow View\n\n --- http/src/js/pages.now.js | 136 +++++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'http/src') diff --git a/http/src/js/pages.now.js b/http/src/js/pages.now.js index 8244f33..85832d8 100644 --- a/http/src/js/pages.now.js +++ b/http/src/js/pages.now.js @@ -1,20 +1,20 @@ -epgd.pages.now = { - $ul: null, - timestamp_min: -1, - timestamp_max: 0, - timestamp_cur: 0, - - init: function () { - $(window).bind('channels_load', function () { epgd.pages.timestamp_max = 0; }); - }, - render: function () { +epgd.pages.now = { + $ul: null, + timestamp_min: -1, + timestamp_max: 0, + timestamp_cur: 0, + + init: function () { + $(window).bind('channels_load', function () { epgd.pages.timestamp_max = 0; }); + }, + render: function () { //this.renderTime = new Date().getTime(); if (!window.pages_now) { this.$search = $('
').appendTo($('#menu_now')).click(function () { if (this.curType == '@Now') window.pages_now.setTime(null,'@Now'); - }); - var $searchMenu = this.$searchMenu = $('').appendTo($('#menu_now')).hide(); + }); + var $searchMenu = this.$searchMenu = $('').appendTo($('#menu_now')).hide(); epgd.profile.quickTimes && epgd.profile.quickTimes.replace(/([^=]+)=!?([^~]+)~?/g, function (a, l, v) { $searchMenu.append('
  • ' + l + '
  • '); }); @@ -30,9 +30,9 @@ epgd.pages.now = { }); $(window).bind("epgd_close.pages_now", function () { if (window.pages_now) { - epgd.$dtPicker.hide(); - window.pages_now.$searchMenu.remove(); - window.pages_now.$search.remove(); + epgd.$dtPicker.hide(); + window.pages_now.$searchMenu.remove(); + window.pages_now.$search.remove(); delete window.pages_now; } $(window).unbind(".pages_now"); @@ -43,25 +43,25 @@ epgd.pages.now = { this.$ul = epgd.$con.html('
    ').find('ul') .click(function (ev) { if ($(ev.target).closest('.channel').length) { - $(window).trigger("epgd_close.eventDetail"); - if (ev.target.className == 'i-tv') - epgd.vdrs.current.switchChannel(ev.target.parentNode.id); + $(window).trigger("epgd_close.eventDetail"); + if (ev.target.className == 'i-tv') + epgd.vdrs.current.switchChannel(ev.target.parentNode.id); else { epgd.$menu.menu("select", { target: "#menu_magazine" }); - epgd.pages.magazine.setChannel(ev.target.parentNode.id); - } + epgd.pages.magazine.setChannel($(ev.target).closest('.channel').attr("id")); + } return; - } - var li = $(ev.target).closest('li')[0]; - if (!li) return; - if (!li.eventDetail) - li.eventDetail = new epgd.eventDetail(li.title); + } + var li = $(ev.target).closest('li')[0]; + if (!li) return; + if (!li.eventDetail) + li.eventDetail = new epgd.eventDetail(li.title); epgd.utils.loader.process(function () { li.eventDetail.render(); }); }); this.setTime(null, '@Now'); - }; + }; $('#menu_now').addClass("menu-active").bind("click.pages_now", function (ev) { if ((ev.target == this || ev.target.nodeName == 'A') && window.pages_now) { window.pages_now.$searchMenu.show(); @@ -69,10 +69,10 @@ epgd.pages.now = { } return false; }).append(epgd.$dtPicker.show()); - }, - setTime: function (start, type) { - type = type || '@time'; - var at = ' ' + epgd.tr.pages.now.at; + }, + setTime: function (start, type) { + type = type || '@time'; + var at = ' ' + epgd.tr.pages.now.at; if (type == '@Now' || type == '@time') { this.timestamp_cur = start || epgd.utils.unixTime(epgd.utils.now()); this.load("data/events?time=" + this.timestamp_cur); @@ -85,51 +85,51 @@ epgd.pages.now = { } else { $.timepicker.quicklink({ target: { nodeName: 'U', innerHTML: type }, data: { unit: 'time' } }); $(window).trigger('datepicker'); - } - this.$search[0].curType = type; - this.$search.text(this.$searchMenu.find('li[data-type="' + type + '"]').text() + at); - }, + } + this.$search[0].curType = type; + this.$search.text(this.$searchMenu.find('li[data-type="' + type + '"]').text() + at); + }, load: function (url,type,data) { epgd.utils.loader.process(function () { - pages_now.$ul.empty(); + pages_now.$ul.empty(); epgd.ajax({ url: epgd.login.url + url, async: false, cache: false, type:type,data:data }, function (data) { if (!data.events || !data.events.length) { - epgd.utils.loader.close(); + epgd.utils.loader.close(); return epgd.utils.popup(epgd.tr.error.noData); - } - var imgPath = epgd.profile.eventImgPath ? epgd.profile.eventImgPath + '?no=0&maxW=100&maxH=70&id=' : false, - min = 0, - max = 2000000000, - dFormat = epgd.tr.dateTimePicker.dateFormat.replace(/\.?y+/,''); - now = parseInt(epgd.utils.now().getTime() / 1000, 10); - //maxHeight = 0, + } + var imgPath = epgd.profile.eventImgPath ? epgd.profile.eventImgPath + '?no=0&maxW=100&maxH=70&id=' : false, + min = 0, + max = 2000000000, + dFormat = epgd.tr.dateTimePicker.dateFormat.replace(/\.?y+/,''); + now = parseInt(epgd.utils.now().getTime() / 1000, 10); + //maxHeight = 0, $.each(data.events, function (id, event) { - var end = event.starttime + event.duration, - progress = ((now - event.starttime) / event.duration * 100), - desc = event.shortdescription || event.shorttext; - if (event.starttime > min) min = event.starttime; - if (end < max) max = end; - $('
  • ' - + epgd.channels.getHtml(event.channelid) - + '
    ' + epgd.utils.formatTime(event.starttime) - + ' – ' + epgd.utils.formatTime(end) + ' ' + epgd.tr.oClock - + (event.tipp ? '' + event.tipp + '' : '') - + '
    ' - + (progress > 0 && progress <= 100 ? '
    ' : '
    ' + epgd.utils.formatDate(event.starttime, dFormat) + '
    ') - + '
    ' - + (imgPath && event.imagecount ? '' : '') - + '
    ' + event.title - + (event.numrating ? ' ' : '') - + '
    ' - + (event.genre ? '' + event.genre + ' ' : '') + (desc ? desc.replace(/\n/g, '
    ') : '') - + '
    ' + var end = event.starttime + event.duration, + progress = ((now - event.starttime) / event.duration * 100), + desc = event.shortdescription || event.shorttext; + if (event.starttime > min) min = event.starttime; + if (end < max) max = end; + $('
  • ' + + epgd.channels.getHtml(event.channelid) + + '
    ' + epgd.utils.formatTime(event.starttime) + + ' – ' + epgd.utils.formatTime(end) + ' ' + epgd.tr.oClock + + (event.tipp ? '' + event.tipp + '' : '') + + '
    ' + + (progress > 0 && progress <= 100 ? '
    ' : '
    ' + epgd.utils.formatDate(event.starttime, dFormat) + '
    ') + + '
    ' + + (imgPath && event.imagecount ? '' : '') + + '
    ' + event.title + + (event.numrating ? ' ' : '') + + '
    ' + + (event.genre ? '' + event.genre + ' ' : '') + (desc ? desc.replace(/\n/g, '
    ') : '') + + '
    ' + '
  • ').appendTo(pages_now.$ul); - }); - epgd.pages.now.timestamp_min = min; - epgd.pages.now.timestamp_max = max; + }); + epgd.pages.now.timestamp_min = min; + epgd.pages.now.timestamp_max = max; epgd.utils.loader.close(); }); }, true); - } - -}; + } + +}; -- cgit v1.2.3 From 7d9947657176d68305a428a640879bef1dbb607b Mon Sep 17 00:00:00 2001 From: horchi Date: Mon, 26 Jun 2017 20:12:11 +0200 Subject: 2017-06-25: version 1.1.119 (rechner)\n - fixed: check, if channel list is loaded in magazine View\n\n --- http/src/js/pages.magazine.js | 137 ++++++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 64 deletions(-) (limited to 'http/src') diff --git a/http/src/js/pages.magazine.js b/http/src/js/pages.magazine.js index f5769e2..f413c51 100644 --- a/http/src/js/pages.magazine.js +++ b/http/src/js/pages.magazine.js @@ -30,10 +30,10 @@ epgd.pages.magazine = { }; }); }, - initQT: function () { - var qt = {}; - epgd.profile.quickTimes.replace(/=([0-9]{1,2}):([0-9]{1,2})/g, function (a, h, m) { - qt[parseInt(h,10)] = '

    '; + initQT: function () { + var qt = {}; + epgd.profile.quickTimes.replace(/=([0-9]{1,2}):([0-9]{1,2})/g, function (a, h, m) { + qt[parseInt(h,10)] = '

    '; }); this.qt= qt; }, @@ -99,8 +99,8 @@ epgd.pages.magazine = { epgd.$menu.parent().offset({ 'left': l }); this.pages_magazine.$nav.offset({ 'left': l }); return false; - }) - .bind("datepicker.pages_magazine", function () { + }) + .bind("datepicker.pages_magazine", function () { this.pages_magazine.setTime(epgd.utils.unixTime(epgd.$dtPicker.datetimepicker('getDate') || epgd.utils.now()), true); })[0].pages_magazine = this; @@ -176,13 +176,13 @@ epgd.pages.magazine = { this._initWinBindings(); epgd.$con.empty(); this.$nav.appendTo(epgd.$con).bind("click", this.actionHead); - this.$head.appendTo(epgd.$con).bind('click', function (ev) { + this.$head.appendTo(epgd.$con).bind('click', function (ev) { if (ev.target.className == 'i-tv') - epgd.vdrs.current.switchChannel(ev.target.parentNode.id); + epgd.vdrs.current.switchChannel(ev.target.parentNode.id); }); this.$con.appendTo(epgd.$con).bind("click", this.actionCon).bind("touchend",this.actionConOpen); - if (!$.support.touch && epgd.profile.magazinePan > 0) - this._pan(); + if (!$.support.touch && epgd.profile.magazinePan > 0) + this._pan(); } $(window).trigger("resize.pages_magazine"); if (channel) @@ -193,37 +193,46 @@ epgd.pages.magazine = { $(window).trigger("resize.pages_magazine"); }, _pan: function(){ - var pan = false, - tp = $('
    ').prependTo(epgd.$con)[0], - bot = $('
    ').appendTo(epgd.$con)[0]; - this.timeLineL.pan = -1; - this.timeLineR.pan = 1; - tp.pan = epgd.profile.magazinePan * -30; - bot.pan = epgd.profile.magazinePan * 30; - - window.tp = tp; - window.bp = bot; - window.p = pan; - $([this.timeLineL, this.timeLineR, tp, bot]).mouseover(function (ev) { - if (pan) return; - pan = this.pan; - window.setTimeout(function () { - if (pan) { - var checkPan = window.setInterval(function () { - if (!pan || !window.pages_magazine) - return window.clearInterval(checkPan); - if (pan < -1 || pan > 1) - window.pages_magazine.setTime((window.pages_magazine.$con.scrollTop() + 15) * 30 + epgd.profile.minEventTime + pan, true); - else - window.pages_magazine.setMain(pan); - }, (pan < -1 || pan > 1 ? 100 : 1200)); - } - }, epgd.profile.magazinePanDelay); - }).mouseout(function () { - pan = false; - }); + var pan = false, + tp = $('
    ').prependTo(epgd.$con)[0], + bot = $('
    ').appendTo(epgd.$con)[0]; + this.timeLineL.pan = -1; + this.timeLineR.pan = 1; + tp.pan = epgd.profile.magazinePan * -30; + bot.pan = epgd.profile.magazinePan * 30; + + window.tp = tp; + window.bp = bot; + window.p = pan; + $([this.timeLineL, this.timeLineR, tp, bot]).mouseover(function (ev) { + if (pan) return; + pan = this.pan; + window.setTimeout(function () { + if (pan) { + var checkPan = window.setInterval(function () { + if (!pan || !window.pages_magazine) + return window.clearInterval(checkPan); + if (pan < -1 || pan > 1) + window.pages_magazine.setTime((window.pages_magazine.$con.scrollTop() + 15) * 30 + epgd.profile.minEventTime + pan, true); + else + window.pages_magazine.setMain(pan); + }, (pan < -1 || pan > 1 ? 100 : 1200)); + } + }, epgd.profile.magazinePanDelay); + }).mouseout(function () { + pan = false; + }); + }, + setChannel: function (channel) { + if (this.list.lengt > 0) + this.setMain(0, this.list[channel].index); + else{ + var self= this; + $(window).one("resize.pages_magazine",function(){ + self.setMain(0, self.list[channel].index); + }) + } }, - setChannel: function (channel) { this.setMain(0, this.list[channel].index); }, setMain: function (delta, baseIndex, dontScroll) { var optList = this.select, i = isNaN(baseIndex) ? optList.selectedIndex : baseIndex; @@ -273,12 +282,12 @@ epgd.pages.magazine = { this.scrollEnd = (this.endTime - epgd.profile.minEventTime - 43200) / 30; // 60 * 60 *12 } insHtml && this.update(); - doScroll && this.$con.scrollTop((start - epgd.profile.minEventTime) / 30 - 15); + doScroll && this.$con.scrollTop((start - epgd.profile.minEventTime) / 30 - 15); }, actionHead: function (ev) { var self = epgd.pages.magazine, c; - if (ev.target.nodeName == 'SPAN') { + if (ev.target.nodeName == 'SPAN') { c = ev.target.className; if (c.indexOf('i-left-dir') > -1) self.setMain(-1); @@ -287,7 +296,7 @@ epgd.pages.magazine = { else if (c.indexOf('i-right-dir') > -1) self.setMain(1); else if (c.indexOf('i-forward') > -1) - self.setMain(self.viewCnt); + self.setMain(self.viewCnt); } }, actionConOpen: function (ev) { @@ -355,26 +364,26 @@ epgd.pages.magazine.channel.prototype = { $col = $(self.col), desc,h,d, eTime; - if (first) { - if (insAfter) { - $dt = $col.find('dt:last'); - eTime = $dt[0].eTime; + if (first) { + if (insAfter) { + $dt = $col.find('dt:last'); + eTime = $dt[0].eTime; if ($dt.attr('title') == first.id) - delete data.events[0]; - } else { - eTime = first.starttime; - $dt = $col.find('dt:first'); + delete data.events[0]; + } else { + eTime = first.starttime; + $dt = $col.find('dt:first'); if ($dt.attr('title') == data.events[data.events.length - 1].id) - delete data.events[data.events.length-1]; - } - for (i = 0; i < data.events.length; i++) { - event = data.events[i]; + delete data.events[data.events.length-1]; + } + for (i = 0; i < data.events.length; i++) { + event = data.events[i]; desc = event.shortdescription || event.shorttext; h = event.duration; d = parseInt(h / 60, 10);/*, fav = epgd.profile.fav ? ';border-color:' + epgd.profile.fav(event) : ''*/; h += (event.starttime - eTime); - h = h < 600 ? 20 : parseInt(h / 30, 10); // 20px = 10 Minuten + h = h < 600 ? 20 : parseInt(h / 30, 10); // 20px = 10 Minuten eTime += h * 30; insHtml += '
    ' //' + fav + ' + '
    ' + event.title + '
    ' @@ -383,8 +392,8 @@ epgd.pages.magazine.channel.prototype = { + (event.numrating ? ' ' : '') + (event.tipp ? '' + event.tipp + '' : '') + '
    ' + (event.genre ? '' + event.genre + ' ' : '') + (desc ? desc.replace(/\n/g, '
    ') : '') - + '
    '; - }; + + ''; + }; } else { h = (endTime - startTime) / 30; insHtml = '
    '; @@ -396,13 +405,13 @@ epgd.pages.magazine.channel.prototype = { $col.find('dt:last')[0].eTime = eTime; } else { $col.prepend(insHtml); - if ($dt && $dt.length) { - $dt.css('margin-top', ''); + if ($dt && $dt.length) { + $dt.css('margin-top', ''); h = $dt[0].starttime - eTime; - if (h) { - h = parseInt(h/30,10) + parseInt($dt.css('min-height'), 10); - $dt.css({ "height": h + 'px', "min-height": h + 'px' }) - } + if (h) { + h = parseInt(h/30,10) + parseInt($dt.css('min-height'), 10); + $dt.css({ "height": h + 'px', "min-height": h + 'px' }) + } } else $col.find('dt:last')[0].eTime = eTime; $col.find('dt:first').css('margin-top', parseInt((first.starttime - startTime) / 30, 10))[0].starttime= first; -- cgit v1.2.3 From 65e13cfa23db0c3481f53a0313ef35b9e2e61d19 Mon Sep 17 00:00:00 2001 From: horchi Date: Wed, 28 Jun 2017 21:01:27 +0200 Subject: 2017-06-28: version 1.1.119 (rechner)\n - added: Link to osd2web, if available\n\n --- http/src/css/epgd.less | 306 +++++++++++++++++++++++++------------------------ http/src/js/1_main.js | 305 ++++++++++++++++++++++++------------------------ 2 files changed, 311 insertions(+), 300 deletions(-) (limited to 'http/src') diff --git a/http/src/css/epgd.less b/http/src/css/epgd.less index 51a9c90..ea13b61 100644 --- a/http/src/css/epgd.less +++ b/http/src/css/epgd.less @@ -1,6 +1,6 @@ /* Hier sind Variablen aus Jquery-ui. Sie werden folgendermass erstellt: - aus 3rdParty\jquery-ui-x:x.custom\development-bundle\themes\humanity\jquery-ui.css den Link kopieren und hier einfügen. - Dann diesen Link (nur Auswahl) per regulären Ausdruck + aus 3rdParty\jquery-ui-x:x.custom\development-bundle\themes\humanity\jquery-ui.css den Link kopieren und hier einf�gen. + Dann diesen Link (nur Auswahl) per regul�ren Ausdruck suchen "$([^=]+)=([^&]+)" und ersetzen "@$1: $2; " suchen " ([a-f0-9]{6})" und ersetzen " #$1" */ @@ -120,10 +120,10 @@ h5 { line-height: 1.5; } -.placeholders { - position: absolute; - max-height: 120px; - overflow: auto; +.placeholders { + position: absolute; + max-height: 120px; + overflow: auto; } .ui-dialog{position:fixed} @@ -141,8 +141,8 @@ h5 { margin: 3px; white-space: nowrap; - &[disabled] { - opacity: .35; + &[disabled] { + opacity: .35; } } @@ -236,14 +236,14 @@ select { //border-width: 0px 0px 5px 0px; background-color: #fff; - span.maxi { - display:none; + span.maxi { + display:none; } - - .iAsButton { - padding: 0 2px; - line-height: 21px; - margin-top: 0; + + .iAsButton { + padding: 0 2px; + line-height: 21px; + margin-top: 0; } &.mini{ @@ -277,8 +277,8 @@ select { float: left; min-width: 90%; min-height: 25px; - > a { - width:100%; + > a { + width:100%; } } } @@ -314,9 +314,9 @@ select { overflow: hidden; text-decoration: none; } - - span.ui-menu-icon { - display:none; + + span.ui-menu-icon { + display:none; } } .menu-active { @@ -369,7 +369,9 @@ select { float: right; margin-right: 20px !important; } - +#osd2web { + text-decoration: none; +} .menu-active input, .menu-active select { display: block; visibility: visible; @@ -438,12 +440,12 @@ table.ui-datepicker-calendar { line-height: 1; color: #4d4949; padding: 3px 5px 0 3px; - img { - max-width: 70px; - max-height: 50px; - margin-right: 5px; - margin-bottom: 5px; - display:block; + img { + max-width: 70px; + max-height: 50px; + margin-right: 5px; + margin-bottom: 5px; + display:block; } .i-tv { font-size: 1.8em; @@ -504,14 +506,14 @@ table.ui-datepicker-calendar { box-sizing: border-box; /* Opera/IE 8+ */ } - .desc { - height: 72px; - overflow: hidden; - &:hover{ - min-height: 72px; - height:auto; - overflow-y:visible; - } + .desc { + height: 72px; + overflow: hidden; + &:hover{ + min-height: 72px; + height:auto; + overflow-y:visible; + } } .desc img { @@ -527,8 +529,8 @@ table.ui-datepicker-calendar { float: right; font-size: 0.9em; } - .tipp { - margin:1px 5px 0 0; + .tipp { + margin:1px 5px 0 0; } .title { @@ -552,20 +554,20 @@ table.ui-datepicker-calendar { } } -#magazine-nav{ +#magazine-nav{ // overflow:hidden; - width:100%; - left:-27px; - position:relative; - + width:100%; + left:-27px; + position:relative; + .left, .right { width: 50px; height:54px; border-top: none; border-bottom: none; position: absolute; - z-index: 98; + z-index: 98; top:0; .ui-widget-content { @@ -583,17 +585,17 @@ table.ui-datepicker-calendar { .left { left:0; //border-right: 5px solid white; - } + } .right { right: 0; //border-left: 5px solid white; } -} +} #magazine-head { - margin: 0 0 0 -2%; + margin: 0 0 0 -2%; height: 55px; padding: 0 0 0 54px; overflow:hidden; @@ -608,8 +610,8 @@ table.ui-datepicker-calendar { height: 55px; width:auto; img { - max-width:100px; - float:left; + max-width:100px; + float:left; } } } @@ -658,17 +660,17 @@ table.ui-datepicker-calendar { position: absolute; z-index: 99; - p { + p { position: absolute; - pointer-events:none; - width: 5000px; - height: 180px; - background-color: red !important; - opacity: 0.1; + pointer-events:none; + width: 5000px; + height: 180px; + background-color: red !important; + opacity: 0.1; } - &.tlr{ - p{display:none} + &.tlr{ + p{display:none} } dfn { height: 120px; @@ -863,8 +865,8 @@ table.ui-datepicker-calendar { font-size: 12px; border: 1px solid #ccc; border-radius: 4px; - img { - margin: 0 auto 5px auto; + img { + margin: 0 auto 5px auto; } } @@ -900,17 +902,17 @@ table.ui-datepicker-calendar { box-sizing: border-box; } - .rate { - background-size: 25px; - min-height:40px; - padding-left: 30px; - > span { - display: block; - font-size: 1.2em; - } + .rate { + background-size: 25px; + min-height:40px; + padding-left: 30px; + > span { + display: block; + font-size: 1.2em; + } } - .tipp{ - margin:0 5px 0 0; + .tipp{ + margin:0 5px 0 0; } .stars { @@ -1002,8 +1004,8 @@ table.ui-datepicker-calendar { } } } - .rec { - font-size:0.9em; + .rec { + font-size:0.9em; } } @@ -1062,16 +1064,16 @@ table.ui-datepicker-calendar { color: transparent; float: right; } - -.rate { - background: url() no-repeat left top; - background-size: 18px; - min-height:35px; - padding-left: 25px; - margin: 5px 0; + +.rate { + background: url() no-repeat left top; + background-size: 18px; + min-height:35px; + padding-left: 25px; + margin: 5px 0; float: left; clear:left; - display:block; + display:block; } .rate1{ background-image: url('images/thumb-rate1.svg');} @@ -1081,16 +1083,16 @@ table.ui-datepicker-calendar { .rate5{ background-image: url('images/thumb-rate5.svg');} .rate0{ background:none; height:auto;padding-left:inherit} -.tipp{ - display:block; - float: left; - margin:5px 0; - background-color: rgb(245, 126, 126); - color: white; - border-radius: @ui-cornerRadius; - padding: 1px 3px; - font-size: 0.9em; - font-weight: normal; +.tipp{ + display:block; + float: left; + margin:5px 0; + background-color: rgb(245, 126, 126); + color: white; + border-radius: @ui-cornerRadius; + padding: 1px 3px; + font-size: 0.9em; + font-weight: normal; } #searchResult { @@ -1116,16 +1118,16 @@ table.ui-datepicker-calendar { vertical-align: top; .channel { - img { - max-height:30px; + img { + max-height:30px; } } } /* p { - border-top: 1px solid #ccc; - height: 18px; - margin: 0; + border-top: 1px solid #ccc; + height: 18px; + margin: 0; overflow-y: hidden; &:hover { @@ -1162,8 +1164,8 @@ table.ui-datepicker-calendar { } } } -#timerSearchList { - max-width:750px; +#timerSearchList { + max-width:750px; } .searchDialog { min-width: 320px; @@ -1176,13 +1178,13 @@ table.ui-datepicker-calendar { text-decoration: underline; } - >form{ - >div{ - margin-bottom:5px; - margin-top: 5px; + >form{ + >div{ + margin-bottom:5px; + margin-top: 5px; } - &.noAdv{ - >div + div {display: none} + &.noAdv{ + >div + div {display: none} } } @@ -1215,7 +1217,7 @@ table.ui-datepicker-calendar { } .colBlock { - width:100%; + width:100%; float: left; div { float: left; @@ -1226,14 +1228,14 @@ table.ui-datepicker-calendar { } } } - form.typeS { - .noTypeS, .onlyTypeR {display:none} + form.typeS { + .noTypeS, .onlyTypeR {display:none} } - form.typeV { - .onlyTypeR, .onlyTypeS {display:none} + form.typeV { + .onlyTypeR, .onlyTypeS {display:none} } - form.typeR { - .onlyTypeS {display:none} + form.typeR { + .onlyTypeS {display:none} } } @@ -1281,9 +1283,9 @@ table.ui-datepicker-calendar { h4 { margin: 3px 0; display: inline-block; - span { - font-weight: normal; - padding-right: 3px; + span { + font-weight: normal; + padding-right: 3px; } } @@ -1313,7 +1315,7 @@ table.ui-datepicker-calendar { } } - + } .rec { border: 1px solid @ui-borderColorDefault; @@ -1351,24 +1353,24 @@ table.ui-datepicker-calendar { padding: 2px 0; } } - #recBar{ - font-size:0.9em; - display:inline-block; + #recBar{ + font-size:0.9em; + display:inline-block; } - body.dd-open{ - #ui-menu-top, #recBar{ - display:none !important; - } + body.dd-open{ + #ui-menu-top, #recBar{ + display:none !important; + } #records{ - .folder { - display:block; + .folder { + display:block; } - div.rec{ - display:none; + div.rec{ + display:none; } - } - + } + } .pageEditChannels > li { @@ -1380,11 +1382,11 @@ table.ui-datepicker-calendar { padding-left: 5px; width: 96%; - &.filterHide { - height:0; - overflow:hidden; - margin:0; - border:none; + &.filterHide { + height:0; + overflow:hidden; + margin:0; + border:none; } } @@ -1472,22 +1474,22 @@ table.ui-datepicker-calendar { } } -#page_editUser { - >div { - float:left; - height:350px; - padding-right:20px; - margin-right:20px; - border-right:2px solid #ccc; - } - h2 { - margin: 5px 0 2px 0; - font-size:1em - } - form {float:left} - select{ - overflow:auto; height:200px - } +#page_editUser { + >div { + float:left; + height:350px; + padding-right:20px; + margin-right:20px; + border-right:2px solid #ccc; + } + h2 { + margin: 5px 0 2px 0; + font-size:1em + } + form {float:left} + select{ + overflow:auto; height:200px + } } /* ========================================================================== @@ -1560,10 +1562,10 @@ table.ui-datepicker-calendar { width: 320px; } - #magazine-nav { - top:-10px; - .left{margin-left:-1px;} - .right{margin-right:-1px;} + #magazine-nav { + top:-10px; + .left{margin-left:-1px;} + .right{margin-right:-1px;} } #magazine-head { @@ -1585,14 +1587,14 @@ table.ui-datepicker-calendar { .rec { margin: 2px; padding: 0; - border-bottom-left-radius: 0; + border-bottom-left-radius: 0; border-bottom-right-radius: 0; u { position: inherit; margin-left: 2px; } - } + } } @media only screen and (min-width: 768px) and (max-width:1139px) { diff --git a/http/src/js/1_main.js b/http/src/js/1_main.js index 3a8251a..09e93c4 100644 --- a/http/src/js/1_main.js +++ b/http/src/js/1_main.js @@ -55,10 +55,10 @@ epgd.profile_load = function (doNotCache) { epgd.channels.isDirty = true; } } - if (epgd.utils.timeOffset == null) { - epgd.utils.timeOffset = (data.timezone - new Date().getTimezoneOffset() * 60) * 1000; - now = epgd.utils.now(); - epgd.$dtPicker.datetimepicker('setDate', new Date(now.setMinutes(parseInt(now.getMinutes() / 15, 10) * 15))); + if (epgd.utils.timeOffset == null) { + epgd.utils.timeOffset = (data.timezone - new Date().getTimezoneOffset() * 60) * 1000; + now = epgd.utils.now(); + epgd.$dtPicker.datetimepicker('setDate', new Date(now.setMinutes(parseInt(now.getMinutes() / 15, 10) * 15))); } if (!profile.minEventTime) { now = epgd.utils.now(); @@ -131,7 +131,7 @@ epgd.utils = { width: 400, height:200, maxWidth: $w.width() * 0.8, - maxHeight: $w.height() * 0.7, + maxHeight: $w.height() * 0.7, }, options); $dlg = $('

    ' + txt + '

    ').dialog(options); options.autoClose && window.setTimeout(function () { $dlg.dialog('close').dialog('destroy'); }, options.autoClose); @@ -214,63 +214,63 @@ epgd.utils = { fontSize, kc; inst.selectedItems = {}; - if (o.multiselect) { + if (o.multiselect) { inst.multiselect = $("
    ") .addClass("ui-autocomplete-multiselect ui-state-default ui-widget " + cn) .css("width", w) .insertBefore(inst.element) .append(inst.element) - .bind("click.autocomplete", function () { - inst.element.focus(); + .bind("click.autocomplete", function () { + inst.element.focus(); }); inst.menu.element.css({ "height": "300px", "overflow-y": "auto" }); fontSize = parseInt(inst.element.css("fontSize") || 10, 10); function autoSize(e) { // Hackish autosizing var $this = $(this); - $this.width(1).width(this.scrollWidth + fontSize - 1); + $this.width(1).width(this.scrollWidth + fontSize - 1); }; kc = $.ui.keyCode; - inst.element.bind({ - "keydown.autocomplete": function (e) { - if ((this.value === "") && (e.keyCode == kc.BACKSPACE)) { + inst.element.bind({ + "keydown.autocomplete": function (e) { + if ((this.value === "") && (e.keyCode == kc.BACKSPACE)) { var prev = inst.element.prev(); delete inst.selectedItems[prev.text()]; - prev.remove(); - } + prev.remove(); + } }, // TODO: Implement outline of container - "focus.autocomplete blur.autocomplete": function () { - inst.multiselect.toggleClass("ui-state-active"); + "focus.autocomplete blur.autocomplete": function () { + inst.multiselect.toggleClass("ui-state-active"); }, - "keypress.autocomplete change.autocomplete focus.autocomplete blur.autocomplete": autoSize + "keypress.autocomplete change.autocomplete focus.autocomplete blur.autocomplete": autoSize }).trigger("change"); - o.select = o.select || function (e, ui) { - if (!inst.selectedItems[ui.item.label]) { + o.select = o.select || function (e, ui) { + if (!inst.selectedItems[ui.item.label]) { $("
    ") .addClass("ui-autocomplete-multiselect-item") .text(ui.item.label) .append( $("") .addClass("ui-icon ui-icon-close") - .click(function () { + .click(function () { var item = $(this).parent(); delete inst.selectedItems[item.text()]; - item.remove(); + item.remove(); }) ) .insertBefore(inst.element); - inst.selectedItems[ui.item.label] = ui.item; + inst.selectedItems[ui.item.label] = ui.item; } inst._value(""); - return false; - } - } else { - o.select = o.select || function (e, ui) { - inst.selectedItems[0] = ui.item; - inst._value(ui.item.label); - return false; - } + return false; + } + } else { + o.select = o.select || function (e, ui) { + inst.selectedItems[0] = ui.item; + inst._value(ui.item.label); + return false; + } }; } }, options)).focus(function () { @@ -313,43 +313,43 @@ epgd.utils = { } } }, - addPlaceholders: function (inputSelector, key, placeholders) { - var input = $(inputSelector)[0], - html = '
      ', - p; + addPlaceholders: function (inputSelector, key, placeholders) { + var input = $(inputSelector)[0], + html = '
        ', + p; for (p in placeholders) html += '
      • ' + p + '' + placeholders[p] + '
      • '; - input.$placeholders = $(html + '
      ').hide().insertAfter(input).click(function (ev) { - var placeholder = ev.target.nodeName == 'B' ? $(ev.target).text() : ev.target.nodeName == 'LI' ? $(ev.target.firstChild).text() : null, - cursorPos = $(input).prop('selectionStart'), - v = $(input).val(); - if (placeholder) { - $(input).val(v.substring(0, cursorPos) + placeholder + v.substring(cursorPos, v.length)).focus(); - cursorPos += placeholder.length; - if (input.setSelectionRange) { - input.setSelectionRange(cursorPos, cursorPos); - } - else if (input.createTextRange) { - v = input.createTextRange(); - v.collapse(true); - v.moveEnd('character', cursorPos); - v.moveStart('character', cursorPos); - v.select(); - } - } - $(this).hide(); - }); - $(input).keydown(function (ev) { - if (ev.key == key) { - $(document).one("click", function () { input.$placeholders.hide(); }) - input.blur(); - return !input.$placeholders.show().position({ - my: "left top", - at: "left bottom", - of: input - }); - } - }); + input.$placeholders = $(html + '
    ').hide().insertAfter(input).click(function (ev) { + var placeholder = ev.target.nodeName == 'B' ? $(ev.target).text() : ev.target.nodeName == 'LI' ? $(ev.target.firstChild).text() : null, + cursorPos = $(input).prop('selectionStart'), + v = $(input).val(); + if (placeholder) { + $(input).val(v.substring(0, cursorPos) + placeholder + v.substring(cursorPos, v.length)).focus(); + cursorPos += placeholder.length; + if (input.setSelectionRange) { + input.setSelectionRange(cursorPos, cursorPos); + } + else if (input.createTextRange) { + v = input.createTextRange(); + v.collapse(true); + v.moveEnd('character', cursorPos); + v.moveStart('character', cursorPos); + v.select(); + } + } + $(this).hide(); + }); + $(input).keydown(function (ev) { + if (ev.key == key) { + $(document).one("click", function () { input.$placeholders.hide(); }) + input.blur(); + return !input.$placeholders.show().position({ + my: "left top", + at: "left bottom", + of: input + }); + } + }); }, inherits : function (childClass, parentClass) { var tempClass = function () { }; @@ -392,12 +392,12 @@ epgd.init = function () { } else if (unit == 'second' && epgd.profile.quickTimes) { obj.closest('dl').find('.ui_tpicker_time').removeClass() .bind("click", { tp_inst: tp_inst, obj:obj, unit: 'time' }, $.timepicker.quicklink).html('').replace(/~/g, '' + epgd.tr.clear + '').appendTo(tp_inst.inst.dpDiv.find('.ui-datepicker-buttonpane')).click(function () { + else + $('').appendTo(tp_inst.inst.dpDiv.find('.ui-datepicker-buttonpane')).click(function () { tp_inst.$input.val(''); - $.datepicker._hideDatepicker(); + $.datepicker._hideDatepicker(); }); return obj; } else @@ -446,47 +446,47 @@ epgd.init = function () { epgd.$menu.parent().toggleClass('open'); }); epgd.$menu.checkMenuSize = function (ev, callback) { - if (window.wrm_i) { // interval aktiv? - if (window.wrm_w == $(window).width()) { //Breite vom vorherigen Aufruf und aktuelle Breite gleich? - 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, callback); - } else - window.wrm_w = $(window).width(); - return; - } - if (ev) { - window.wrm_w = $(window).width(); - if (!window.wrm_i) // Interval setzen, um sicher zu sein, dass die Breite jetzt stimmt - window.wrm_i = window.setInterval(epgd.$menu.checkMenuSize, 200,null,callback); - } else { - if (epgd.$menu.height() > 40) - epgd.$menu.parent().addClass('mini'); - window.setTimeout(function () { - document.body.style.paddingTop = (epgd.$menu.parent().height() + 10) + "px"; - callback && window.setTimeout(callback,200); - }, 200); + if (window.wrm_i) { // interval aktiv? + if (window.wrm_w == $(window).width()) { //Breite vom vorherigen Aufruf und aktuelle Breite gleich? + 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, callback); + } else + window.wrm_w = $(window).width(); + return; + } + if (ev) { + window.wrm_w = $(window).width(); + if (!window.wrm_i) // Interval setzen, um sicher zu sein, dass die Breite jetzt stimmt + window.wrm_i = window.setInterval(epgd.$menu.checkMenuSize, 200,null,callback); + } else { + if (epgd.$menu.height() > 40) + epgd.$menu.parent().addClass('mini'); + window.setTimeout(function () { + document.body.style.paddingTop = (epgd.$menu.parent().height() + 10) + "px"; + callback && window.setTimeout(callback,200); + }, 200); } }; //epgd.$menu.show().checkMenuSize(); $(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); + epgd.$dtPicker.datetimepicker({ + beforeShow: function () { + this.$overlay = $("
    ").addClass("ui-widget-overlay ui-front").appendTo(document.body); }, - onClose: function () { + onClose: function () { this.$overlay.remove(); - $(window).trigger('datepicker'); - }, + $(window).trigger('datepicker'); + }, calendarStart: function() { var d= new Date(epgd.profile.minEventTime * 1000) leadDays = (d.getDay() - parseInt(epgd.profile.pickerFirstDay, 10) + 7) % 7; d.setHours(12, 0); d.setDate(d.getDate() - leadDays); return d; - } + } }); epgd.$menu.menu({ @@ -499,14 +499,14 @@ epgd.init = function () { epgd.$menu.parent().removeClass('open'); $(".menu-active", this).removeClass("menu-active"); $(document.body).append(epgd.$dtPicker.hide()); - epgd.$menu.checkMenuSize(null,function () { - try { + epgd.$menu.checkMenuSize(null,function () { + try { ui.item.addClass("menu-active").parent().parent('.ui-menu-item').addClass("menu-active"); - epgd.pages[id.slice(5)].render(); - } catch (e) { - epgd.utils.popup(epgd.tr.error.common, { title: epgd.tr.error.error }); - epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || ''), 2); - } + epgd.pages[id.slice(5)].render(); + } catch (e) { + epgd.utils.popup(epgd.tr.error.common, { title: epgd.tr.error.error }); + epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || ''), 2); + } }); } }); @@ -522,8 +522,8 @@ epgd.init = function () { if (changes["defaultVDRuuid"] != undefined) { $('#menu_vdrs > select').val(epgd.profile.defaultVDRuuid); } - if (changes["quickTimes"] != undefined) { - epgd.pages.magazine.initQT(); + if (changes["quickTimes"] != undefined) { + epgd.pages.magazine.initQT(); } if (changes["needLogin"] != undefined) { epgd.pages.login.doLogin(); @@ -550,7 +550,7 @@ epgd.init = function () { + ((epgd.login.rights & epgd.rights.umConfigUsers) == epgd.rights.umConfigUsers ? '' : '') + ''); epgd.$menu.append(''); - epgd.$menu.append(''); + epgd.$menu.append(''); } epgd.profile.needLogin == "1" && epgd.$menu.append('
    '; } 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) -- cgit v1.2.3 From c9ee5f0c5ebba0f9bee189aa591892a320d7caab Mon Sep 17 00:00:00 2001 From: horchi Date: Tue, 1 Aug 2017 18:03:06 +0200 Subject: 2017-08-01: version 1.1.121 (rechner)\n - fixed: error, if no vdr available\n \n --- http/src/js/1_main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'http/src') diff --git a/http/src/js/1_main.js b/http/src/js/1_main.js index 09e93c4..8c7d689 100644 --- a/http/src/js/1_main.js +++ b/http/src/js/1_main.js @@ -571,14 +571,14 @@ epgd.init = function () { html += ''; } $('').replaceAll('#menu_vdrs > select').show().change(function () { - var vdr= epgd.vdrs.current = epgd.vdrs.get(this[this.selectedIndex].value); + var vdr= epgd.vdrs.current = this.selectedIndex >= 0 ? epgd.vdrs.get(this[this.selectedIndex].value) : {}; if (vdr && vdr.osd2webp) $('#osd2web').prop("target", "osd2web_" + vdr.name) .prop("href", "http://" + vdr.ip + ":" + vdr.osd2webp) .click(function(ev){ ev.stopPropagation(); return true; - }).show(); + }).show(); else $('#osd2web').hide(); }).mousedown(function (ev) { -- cgit v1.2.3