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/js/pages.now.js') 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