diff options
author | horchi <vdr@jwendel.de> | 2017-06-24 14:16:50 +0200 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2017-06-24 14:16:50 +0200 |
commit | f91218077e02bbf57f80a8b8db9797d4dc202034 (patch) | |
tree | 1c9c1a8b7788b01d458dd500ca799b49b9bc7d8a /http/src/js/pages.now.js | |
parent | e0aee67ccc08de9e2b23d2c866aa147128a87202 (diff) | |
download | vdr-epg-daemon-f91218077e02bbf57f80a8b8db9797d4dc202034.tar.gz vdr-epg-daemon-f91218077e02bbf57f80a8b8db9797d4dc202034.tar.bz2 |
2017-06-24: version 1.1.118 (rechner)\n - fixed: Fixed error while click on channel in pageNow View\n\n1.1.118
Diffstat (limited to 'http/src/js/pages.now.js')
-rw-r--r-- | http/src/js/pages.now.js | 136 |
1 files changed, 68 insertions, 68 deletions
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 = $('<div style="float:left;margin-left:5px"></div>').appendTo($('#menu_now')).click(function () {
if (this.curType == '@Now')
window.pages_now.setTime(null,'@Now');
- }); - var $searchMenu = this.$searchMenu = $('<ul class="ui-menu ui-widget ui-widget-content"></ul>').appendTo($('#menu_now')).hide(); + });
+ var $searchMenu = this.$searchMenu = $('<ul class="ui-menu ui-widget ui-widget-content"></ul>').appendTo($('#menu_now')).hide();
epgd.profile.quickTimes && epgd.profile.quickTimes.replace(/([^=]+)=!?([^~]+)~?/g, function (a, l, v) {
$searchMenu.append('<li data-type="' + v + '" class="ui-menu-item ' + (v.indexOf('@') == 0 && v != '@Next' && v != '@Now' ? 'i-search' : 'i-clock') + '">' + l + '</li>');
});
@@ -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('<div id="pageNow"><ul class="teaserList"></ul></div>').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; - $('<li title="' + event.id + '" class="ui-widget-content ui-corner-all">' - + epgd.channels.getHtml(event.channelid) - + '<div class="time' + (event.timerid ? ' hasTimer' : '') + '"><b>' + epgd.utils.formatTime(event.starttime) - + '</b> – ' + epgd.utils.formatTime(end) + ' ' + epgd.tr.oClock - + (event.tipp ? '<b class="tipp">' + event.tipp + '</b>' : '') - + '</div>' - + (progress > 0 && progress <= 100 ? '<div class="progress"><div style="width: ' + progress + '%"></div></div>' : '<div class="date">' + epgd.utils.formatDate(event.starttime, dFormat) + '</div>') - + '<div class="desc">' - + (imgPath && event.imagecount ? '<img src="' + imgPath + event.id + '" />' : '') - + '<div class="title">' + event.title - + (event.numrating ? '<span class="rate rate' + event.numrating + '"> </span>' : '') - + '</div>' - + (event.genre ? '<span>' + event.genre + '</span> ' : '') + (desc ? desc.replace(/\n/g, '<br />') : '') - + '</div>' + 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;
+ $('<li title="' + event.id + '" class="ui-widget-content ui-corner-all">'
+ + epgd.channels.getHtml(event.channelid)
+ + '<div class="time' + (event.timerid ? ' hasTimer' : '') + '"><b>' + epgd.utils.formatTime(event.starttime)
+ + '</b> – ' + epgd.utils.formatTime(end) + ' ' + epgd.tr.oClock
+ + (event.tipp ? '<b class="tipp">' + event.tipp + '</b>' : '')
+ + '</div>'
+ + (progress > 0 && progress <= 100 ? '<div class="progress"><div style="width: ' + progress + '%"></div></div>' : '<div class="date">' + epgd.utils.formatDate(event.starttime, dFormat) + '</div>')
+ + '<div class="desc">'
+ + (imgPath && event.imagecount ? '<img src="' + imgPath + event.id + '" />' : '')
+ + '<div class="title">' + event.title
+ + (event.numrating ? '<span class="rate rate' + event.numrating + '"> </span>' : '')
+ + '</div>'
+ + (event.genre ? '<span>' + event.genre + '</span> ' : '') + (desc ? desc.replace(/\n/g, '<br />') : '')
+ + '</div>'
+ '</li>').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);
- } - -}; + }
+
+};
|