Jump to content
Sign in to follow this  
majstang

Timeline/TV Guide bug

Recommended Posts

majstang

The latest change in the Timeline seem to have introduced a bug:

 

 

 

  • Fix: Web Interface: The calendar did not display Monday consistently as first day of the week.

 

I have a weeks worth of EPG right now and I can only navigate to sunday. When repeatedly pressing the navigate button its stuck on sunday and does not show mondays EPG. Same thing with the TV Guide.

Share this post


Link to post
Tjod

No! that has nothing to do with the change.

 

The change only affects the calendar widget which appears if you click in a field where you can enter the date,

Share this post


Link to post
majstang

Ok, it's a DST bug! Took some time to figure this one out.

 

I can't get past Sunday with the >> timeline button because the DST change occurs tomorrow sunday the 26:th of October. To get to Monday of 27:th i have to use the calendar widget. This bug is not specific for RS 1.30.1, same error can be spotted if testing many versions back.

 

Below is a stripped XMLTV file which can be imported in RS with the XEPG. WG++ which is the source software that scrubs the XMLTV takes height for the DST change tomorrow by subtracting 1 hour. That change RS takes no notice of.

 

<programme start="20141025162500 +0200" stop="20141025164000 +0200" channel="SE SVT 1 HD">

<programme start="20141028225500 +0100" stop="20141028230000 +0100" channel="SE SVT 1 HD">

 

 

<?xml version="1.0" encoding="UTF-8"?>

<tv generator-info-name="WebGrab+Plus/w MDB & REX Postprocess -- version 1.1.1/55.09 -- Jan van Straaten" generator-info-url="http://www.webgrabplus.com">
<channel id="SE SVT 1 HD">
<display-name lang="sv">SE SVT 1 HD</display-name>
</channel>
<programme start="20141025162500 +0200" stop="20141025164000 +0200" channel="SE SVT 1 HD">
<title lang="sv">This is how I roll</title>
<desc lang="sv">Svensk realityserie från 2014. Nattis har bestämt sig för att åka på sin första musikfestival, hennes föräldrar har dock en helt annan åsikt. De har svårt att släppa taget och inse att Nattis står på tröskeln till vuxenlivet. Kommer de att låta Nattis åka?</desc>
<date>2014</date>
<category lang="sv">Verklighet</category>
<category lang="sv">Underhållning</category>
<episode-num system="onscreen">S01E06/6</episode-num>
</programme>
<programme start="20141028225500 +0100" stop="20141028230000 +0100" channel="SE SVT 1 HD">
<title lang="sv">Rapport</title>
<desc lang="sv">Textat sid. 199.</desc>
<date>2014</date>
<category lang="sv">Nyheter och verklighet</category>
<episode-num system="onscreen">E72/133</episode-num>
</programme>
</tv>

 

  • Like 1

Share this post


Link to post
Griga
Ok, it's a DST bug!

 

Confirmed. However, the bug doesn't seem to be in the (Delphi) RS code. When I use >> for switching from Saturday to Sunday, the Serve_Timeline procedure receives an URL encoded value named "date" containing Sunday October 26th, as the debugger reveales. When I try to switch from Sunday to Monday, date again containes Sunday.

 

Maybe some javascript code simply adds 24 hours, which doesn't work in this case, because Sunday comprises 25 hours due to the DST change... dunno. It takes further researches.

Share this post


Link to post
Griga

Got it. Have a look at Program Files (x86)\DVBViewer\SVCweb\js\timeline.js:

 

Line 42:

 

var ONE_DAY = 24*60*60*1000;

 

Line 686:

 

/**
* increments or decrements the date in the datepicker by the given amount
*/
function moveDate(offset) {
var currDate = datefield.datepicker("getDate");
currDate.setTime(currDate.getTime() + offset * ONE_DAY);
var now = new Date().getTime();
if (currDate.getTime() + 2*ONE_DAY < now || currDate.getTime() - 31*ONE_DAY > now) {
return;
}
datefield.datepicker("setDate", currDate);
guiactionform.submit();
}

Line 1298:

 

$('#nextday').click(function() {
moveDate(+1);
});

 

Javascript experts are invited to fix it. I can't.

Share this post


Link to post
majstang

Good spotting Griga :D

Same error must be in the tvguide.js as well. We can ask mrphlox who is a great webdesigner who made the very nice improvements for the timeline and tv guide.

Share this post


Link to post
majstang

Ok, here is the solution to the DST bug and the other ones lurking in the function moveDate(offset).
I tested it and it works. The javascripters helping me assured DST are now taken into account. Due to obvious reasons its hard to test, but we will know for sure in a year when next winter time change occurs ;)

timeline.js
old function moveDate(offset)

 

 

function moveDate(offset) {
var currDate = datefield.datepicker("getDate");
currDate.setTime(currDate.getTime() + offset * ONE_DAY);
var now = new Date().getTime();
if (currDate.getTime() + 2*ONE_DAY < now || currDate.getTime() - 31*ONE_DAY > now) {
return;
}
datefield.datepicker("setDate", currDate);
guiactionform.submit();
}

 

can be changed to;

 

function moveDate(offset) {
var currDate = datefield.datepicker("getDate");
currDate.setDate(currDate.getDate() + offset);
datefield.datepicker("setDate", currDate);
guiactionform.submit();
}

 

tvguide.js

old function moveDate(offset)

 

function moveDate(offset) {

var currDate = datepicker.datepicker("getDate");
currDate.setTime(currDate.getTime() + parseInt(offset) * 24 * 60 * 60 * 1000);
datepicker.datepicker("setDate", currDate);
$.cookie('tvgdate', datepicker.datepicker("getDate").getTime(), cookieoptions);
document.forms['chnllist'].submit();
}

 

can be changed to;

 

function moveDate(offset) {

var currDate = datepicker.datepicker("getDate");
currDate.setDate( currDate.getDate() + offset );
datepicker.datepicker("setDate", currDate);
$.cookie('tvgdate', datepicker.datepicker("getDate").getTime(), cookieoptions);
document.forms['chnllist'].submit();
}

 

Share this post


Link to post
Griga

Thanks. I've adopted the fix after a short check. It will be part of the next RS release.

Share this post


Link to post
majstang

Sorry to say, but this issue is back for timeline.js :( tvguide.js is still ok though. More bug hunting has to be done...any ideas where in timeline.js to look?

Share this post


Link to post
majstang

Same as last year...bug is still in the timeline javascript code, but next day button on the tvguide works fine. Any javascripter in here who can figure out the timeline.js bug?

Share this post


Link to post
majstang

Its a repeat on the timeline DST bug this year as well for the DMS that is.  

Edited by majstang

Share this post


Link to post
majstang

Hmm...seem not to be working with Chrome. Still not possible to go past 29.10.2017 with "next day" button. I have to use the timeline date widget to go past the 29th.

EDIT: Oh resetting all browser cache was needed. 

Good man janee, thanks:D

Edited by majstang

Share this post


Link to post
Griga
44 minutes ago, majstang said:

Oh resetting all browser cache was needed. 

 

A forced reload with Ctrl + F5 (or maybe Shift + F5 for Chrome) should do the trick as well.

 

 

 

Share this post


Link to post
majstang

Yes, that is preferred. Clearing the entire cache as I was doing isnt very practical when all passwords, autofill words and other "nice to have" stuff disappears. Well, it was years ago I did that last so it was time. 

Puh, Im glad this long lasting bug hunt at last is over:D Surprising turn of events it wasnt located where I thought (looking at timeline.min.js never crossed my mind and it has a very awkward formatting "one-liner").   

Share this post


Link to post
Griga
4 hours ago, majstang said:

timeline.min.js (...) has a very awkward formatting "one-liner"

 

http://jsbeautifier.org/

 

makes it readable.

Share this post


Link to post
majstang
12 hours ago, Griga said:

 

http://jsbeautifier.org/

 

makes it readable.

Yes, it might be a good idea to have all javascript beautified since it might draw more interest from smart folks who have scripting as hobby if it is readable.

Unfortunately these RS javascripts are quite tricky to get a hang of, cuz the function names are shortest possible (not a chance to know what it does and only Lars knew the system behind the naming) and no comments or description at all.

 

The timeline.min.js change:

sssdd2017-10-30-15_43_35.thumb.jpg.482a1b38d4f0b8e5dd64d076c5a9be97.jpg

 

 

 


var needsreload = false; var rsTimeline = function() { var L = false; var t = "timeline 0.5.09"; var K = true; var ai = true; var p = true; var C = true; var ar = true; var Y = true; var ab = true; var H = true; var ap; var c; var D; var at; var u; var x; var aq; var M; var aC; var E; var Q; var aa; var aj; var q = -1; var aB = { path: "/" }; var am = { path: "/", expires: 365 }; var P = false; var V = 14; var j = 13; var F = 24 * 60 * 60 * 1000; var g = 2 * F; var y = 31 * F; var av = 360; var aA = false; var z = null; var s = false; var f = null; var w = -1; var W = false; var ag = false; var e = true; var l = false; function T(aD) { if (l && typeof console != "undefined") { if (aD != "trace") { console.log(aD) } else { console.trace() } } } function au() { var aD = new Object(); aD.x = ap.scrollLeft(); aD.y = ap.scrollTop(); aD.width = ap.width(); aD.height = ap.height(); return aD } function B(aH, aG) { if (aH == null || aH == undefined) { return null } var aF = null; var aE = null, aD = null; aH.children(".epgcell").each(function(aL) { var aI = $(this); var aK = parseInt(aI.css("left")); var aJ = aI.width(); if (aK <= aG && aK + aJ >= aG) { aF = aI; return false } else { if (aK + aJ <= aG) { aE = aI } else { if (aK >= aG) { aD = aI; return false } } } }); if (aF != null) { return aF } else { if (aE != null && aD != null) { if (aG - (parseInt(aE.css("left")) + aE.width()) < parseInt(aD.css("left")) - aG) { return aE } else { return aD } } else { if (aE != null) { return aE } else { return aD } } } return null } function G(aF) { var aE = null; aE = $(".hover").first(); if (aE.length != 1) { aE = null; var aD = au(); var aG = aD.x + aD.width / 2; Q.each(function(aH) { var aI = $(this).position(); if (aI.top >= aD.y + aF) { aE = B($(this), aG); if (aE != null) { return false } } }); if (aE == null) { aE = aa.first(); if (aE.length != 1) { aE = null } } } T("findFocusableElem elem.left=" + aE.css("left")); return aE } function n(aD) { if (!aA && !aD) { return true } if (l) { $("#debug").text("M") } T("enterMouseMode"); if (z != null) { z.removeClass("hover"); z.find(".recicon").css("display", "none") } aa.hover(function() { var aE = $(this); aE.addClass("hover"); if (p) { if (aE.find(".oldentry").length == 0 && aE.find(".istimer").length == 0) { aE.find(".recicon").css("display", "inline") } } }, function() { $(this).removeClass("hover"); if (p) { $(this).find(".recicon").css("display", "none") } }); z = null; aA = false; return true } function A() { if (aA) { return true } if (l) { $("#debug").text("K") } T("enterKeyboardMode"); z = G(0); aa.unbind("mouseenter mouseleave"); $(".hover").removeClass("hover"); $(document).trigger("hideCluetip"); $("#help").css("display", "inline"); aA = true; return true } function m(aG) { if (z == null) { return null } var aF = z.width(); var aE = parseInt(z.css("left")); var aJ = aE + aF / 2; var aI = z.parent(); var aD = null; while (aD == null) { var aH = null; if (aG == "down") { aH = aI.next() } else { if (aG == "up") { aH = aI.prev() } } if (aH == null || aH.length <= 0) { return null } aD = B(aH, aJ); if (aD == null) { aI = aH } else { return aD } } return null } function O(aH) { if (z == null) { return null } var aF = z.width(); var aE = parseInt(z.css("left")); var aK = aE + aF / 2; var aJ = z.parent(); var aG = au(); var aD = null; var aI = aJ.position().top; if (aH == "pagedown") { aJ.nextAll().each(function(aL) { var aN = $(this); if (aN.position().top > aI + aG.height - 50) { return false } var aM = B(aN, aK); if (aM != null) { aD = aM } }) } else { if (aH == "pageup") { aJ.prevAll().each(function(aL) { var aN = $(this); if (aN.position().top < aI - aG.height + 50) { return false } var aM = B(aN, aK); if (aM != null) { aD = aM } }) } } return aD } function af(aG) { if (z == null) { return null } var aF = z.width(); var aE = parseInt(z.css("left")); var aI = aE + aF / 2; var aH = null; if (aG == "top") { aH = Q.first() } else { if (aG == "bottom") { aH = Q.last() } } var aD = null; while (aD == null) { aD = B(aH, aI); if (aD == null) { if (aG == "top") { aH = aH.next() } else { if (aG == "bottom") { aH = aH.prev() } } if (aH == null || aH.length == 0) { return null } } } return aD } function I(aH) { if (z == null) { return null } var aF = z.width(); var aE = parseInt(z.css("left")); var aG = au(); var aD = null; if (aH == "pageright") { z.nextAll().each(function(aK) { var aJ = $(this); var aI = parseInt(aJ.css("left")); if (aD == null || aI <= aE + aG.width) { aD = aJ } else { return false } }) } else { if (aH == "pageleft") { z.prevAll().each(function(aK) { var aJ = $(this); var aI = parseInt(aJ.css("left")); if (aD == null || aI >= aE - aG.width) { aD = aJ } else { return false } }) } } return aD } function i(aE) { if (z == null) { return null } var aD = null; var aF = z.siblings(); if (aE == "fullright") { aD = aF.last() } else { if (aE == "fullleft") { aD = aF.first() } } return aD } function ak(aF, aJ, aI, aH, aM) { if (aF == null) { return } var aL = new Object(); aL.x1 = aF.position().left; aL.y1 = aF.parent().position().top; aL.x2 = aL.x1 + aF.width(); aL.y2 = aL.y1 + aF.height(); var aD = au(); var aG = new Object(); aG.x1 = aD.x + aI; aG.y1 = aD.y + aJ; aG.x2 = aG.x1 + aD.width - aI - aM; aG.y2 = aG.y1 + aD.height - aJ - aH; var aE = (aL.x1 > aG.x1 && aL.y1 > aG.y1 && aL.x2 < aG.x2 && aL.y2 < aG.y2); if (!aE) { var aK = new Object(); if (aL.x1 < aG.x1) { aK.x = aL.x1 - aG.x1 } else { if (aL.x2 > aG.x2) { aK.x = aL.x2 - aG.x2; if (aL.x1 - aK.x < aG.x1) { aK.x = aL.x1 - aG.x1 } } else { aK.x = 0 } } if (aL.y1 < aG.y1) { aK.y = aL.y1 - aG.y1 } else { if (aL.y2 > aG.y2) { aK.y = aL.y2 - aG.y2 } else { aK.y = 0 } } ap.scrollTo({ top: aD.y + aK.y, left: aD.x + aK.x }, 100) } } function ah(aD) { if (z == null) { return false } z.removeClass("hover"); z.find(".recicon").css("display", "none"); z = aD; z.addClass("hover"); if (z.find(".oldentry").length == 0 && z.find(".istimer").length == 0) { z.find(".recicon").css("display", "inline") } if (l) { z.find(".aentry").children().css("color", "#007") } ak(z, 10, 25, 40, 40); $(document).trigger("hideCluetip"); h(); return true } function aw(aG, aF) { var aE = (z == null && $(".hover").length == 0); A(); if (z == null) { return false } aG.preventDefault(); var aD = null; if (aF == "left") { aD = z.prev() } else { if (aF == "right") { aD = z.next() } else { if (aF == "up" || aF == "down") { if (aE) { aD = z } else { aD = m(aF) } } else { if (aF == "pageup" || aF == "pagedown") { aD = O(aF) } else { if (aF == "top" || aF == "bottom") { aD = af(aF) } else { if (aF == "pageleft" || aF == "pageright") { aD = I(aF) } else { if (aF == "fullleft" || aF == "fullright") { aD = i(aF) } } } } } } } if (aD == null || aD.length != 1) { return false } return ah(aD) } function ac() { $.colorbox({ html: '<div id="quickhelp">Hey :)<br>you found the <br><br><span class="title">Quick Help for the keyboard navigation</span><br><br><table><tr><th>Key</th><th>Description</th></tr><tr><td>[Up] [Down]

 

</td><td>Navigate on the EPG panel using cursor keys</td></tr><tr class="bgdark"><td>[PgUp] / [PgDn]</td><td>Navigate one page up / down</td></tr><tr><td>[Home] / [End]</td><td>Navigate to the Beginning / End of the day</td></tr><tr class="bgdark"><td>[Ctrl+Home] / [Ctrl+End]</td><td>Navigate to the Top / Bottom of the page</td></tr><tr><td>[Ctrl+Shift+PgUp]</td><td>Navigate one page left</td></tr><tr class="bgdark"><td>[Ctrl+Shift+PgDn]</td><td>Navigate one page right</td></tr><tr><td colspan="2">&nbsp;</td></tr><tr class="bgdark"><td>[r] or [Return]</td><td>Record the selected program</td></tr><tr><td> or [Spacebar]</td><td>Display EPG details info</td></tr><tr class="bgdark"><td>[d] / [Shift+d]</td><td>Select previous / next day</td></tr><tr><td>[g] / [Shift+g]</td><td>Select previous / next channel group</td></tr><tr class="bgdark"><td>[a] / [Shift+a]</td><td>Decrease / increase font size</td></tr><tr><td>[z] / [Shift+z]</td><td>Decrease / increase display size (zoom)</td></tr><tr class="bgdark"><td>[n]</td><td>Jump to "Now"</td></tr><tr><td>[e]</td><td>Jump to "Evening"</td></tr><tr class="bgdark"><td>[Esc] or [mouseclick]</td><td>Leave the keyboard mode, return to the mouse mode</td></tr><tr><td>[c] / [Shift+c]</td><td>Disable cluetips (i.e. info tooltips) / Enable cluetips</td></tr><tr class="bgdark"><td>[F1] or [h]</td><td>This dialog</td></tr></table><br>Why not map these keys on your remote control?<br><br>Press [Esc] to close this dialog</div>', transition: "none", opacity: "0.75", onOpen: o, onClosed: ad }) } function b(aJ, aF) { A(); var aE = 0; if (z != null) { var aD = au(); aE = z.parent().position().top - aD.y } aJ.preventDefault(); if (aF == "help") { $("#help").click() } if (aF == "mousemode") { n(false) } else { if (aF == "record") { if (z == null) { return false } if (z.find(".oldentry").length == 0) { z.find(".recicon").click() } ah(z) } else { if (aF == "info") { if (z == null) { return false } var aH = z; aH.find(".aentry").click(); A(); ah(aH) } else { if (aF == "day-") { ao(-1) } else { if (aF == "day+") { ao(+1) } else { if (aF == "now") { $(".hover").removeClass("hover"); r(function() { z = G(aE); ah(z) }) } else { if (aF == "eve") { $(".hover").removeClass("hover"); aC.val("29"); v(function() { z = G(aE); ah(z) }) } else { if (aF == "group-") { var aI = u.val(); var aG = null; $("#chnlgroup option").each(function() { if (aG != null && $(this).val() == aI) { u.val(aG.val()); at.submit(); return false } aG = $(this) }) } else { if (aF == "group+") { var aI = u.val(); var aG = null; $("#chnlgroup option").each(function() { if (aG != null && aG.val() == aI) { u.val($(this).val()); at.submit(); return false } aG = $(this) }) } else { if (aF == "font-") { $("#fontminus").click() } else { if (aF == "font+") { $("#fontplus").click() } else { if (aF == "zoom-") { $("#zoomminus").click() } else { if (aF == "zoom+") { $("#zoomplus").click() } else { if (aF == "disablecluetips") { $(document).trigger("hideCluetip"); K = false; n(false); alert("Cluetips have been disabled. Press [Shift+c] to enable them again."); h() } else { if (aF == "enablecluetips") { K = true; n(false); h(); alert("Cluetips have been enabled."); at.submit() } } } } } } } } } } } } } } } return true } function al() { var aG = 0; var aF = 0; var aE = 0; var aD = $(".epgscrollpanebody").width(); Q.each(function(aN) { aG += 1; var aK = $(this).children(".epgcell"); var aO = aK.first(); if (aO.length > 0) { var aJ = parseInt(aO.css("left")); var aI = aO.width(); var aL = aO.next(); if (aL.length > 0) { var aH = parseInt(aL.css("left")); if (aJ + aI > aH) { aF += 1; aO.width(aH - aJ) } } } var aM = aK.last(); if (aM.length > 0) { var aJ = parseInt(aM.css("left")); var aI = aM.width(); if (aJ + aI > aD) { aE += 1; aM.width(aD - aJ) } } }); T("c1=" + aG + ", c2=" + aF + ", c3=" + aE) } function X(aD) { if (aD == 1) { return } var aF = av * aD; if (aF < 45) { aF = 45 } else { if (aF > 2880) { aF = 2880 } } if (aF != av) { av = aF; aq.val(av); if (s) { var aE = ax(); aC.val(aE.nowTimeId) } at.submit() } } function an(aE) { if (aE == 0) { return } var aD = Math.round(V + aE); if (aD < 8 || aD > 18) { return } V = Math.round(V + aE); j = Math.round(j + aE); $(".epgtitle").css("font-size", V + "px"); $(".epgsubtitle").css("font-size", j + "px"); $("body").css("font-size", V + "px"); h() } function ao(aF) { var aE = M.datepicker("getDate"); aE.setDate(aE.getDate() + aF); M.datepicker("setDate", aE); at.submit() } function ax() { var aE = { nowPos: 0, nowDate: new Date(), nowDateStr: "", nowTimeId: -1 }; var aD = aE.nowDate.getHours() * 60 + aE.nowDate.getMinutes(); if (aD < 5 * 60) { aE.nowPos = Math.round((aD / 60 + 19) * av - 500); var aF = aE.nowDate.getTime() - F; aE.nowDateStr = $.datepicker.formatDate("dd.mm.yy", new Date(aF)) } else { aE.nowPos = Math.round((aD / 60 - 5) * av - 500); if (aE.nowPos < 0) { aE.nowPos = 0 } aE.nowDateStr = $.datepicker.formatDate("dd.mm.yy", aE.nowDate) } aE.nowTimeId = Math.round(aE.nowPos * 2 / av + 0.49); return aE } function ay(aD, aH) { var aE = $.datepicker.parseDate("dd.mm.yy", aD); var aG = 60 * aH / av + 5 * 60; var aF = aE.getTime() + (aG * 60 * 1000); return (aF < new Date().getTime()) } function r(aE, aD) { if (aD) { if (U()) { return true } } var aG = ax(); var aF = M.val(); x.val(Math.round(aG.nowPos * 360 / av)); if (aG.nowDateStr !== aF || aG.nowDate.getTime() - f.getTime() > 5 * 60 * 1000) { T("jumpToNow: submit with date " + aG.nowDateStr + ", currenttime=" + x.val() + ", data.nowTimeId=" + aG.nowTimeId); M.val(aG.nowDateStr); at.submit(); return false } else { T("jumpToNow: scrollleft to " + aG.nowPos + ". data.nowDateStr=" + aG.nowDateStr + ", data.nowTimeId=" + aG.nowTimeId); if (aE == null) { ap.scrollLeft(aG.nowPos) } else { ap.scrollTo({ left: aG.nowPos }, 200, { axis: "x", onAfter: aE }) } } return true } function v(aD) { var aE = aC.val(); if (aE != "") { var aF = aE * av / 2; if (aD == null) { ap.scrollLeft(aF) } else { ap.scrollTo({ left: aF }, 200, { axis: "x", onAfter: aD }) } } } function S() { var aD = parseInt(E.css("left")); return (aD > 0 && aD - parseInt(x.val()) == 500) } function U() { var aE = au(); var aD = parseInt(E.css("left")); if (aD >= 0 && aD >= aE.x && aD <= (aE.x + aE.width)) { var aF = M.val(); var aG = ax(); if (aG.nowDateStr == aF) { return true } } return false } function az() { var aF = ap.scrollTop(); var aE = ap.scrollLeft(); c.scrollTop(aF); D.scrollLeft(aE); x.val(Math.round(aE * 360 / av)); var aD = Math.round(aE * 2 / av + 0.49); if (aD != q) { aC.val(aD); q = aD } s = U(); T("syncScroll. top=" + aF + ", left=" + aE + ", followNow=" + s); h() } function h() { if (P || !ab) { return false } else { $.cookie("tlchgrp", u.val(), am); $.cookie("tlzoomx", av, am); $.cookie("tltfont", V, am); $.cookie("tlctips", K, am); $.cookie("tlcdate", M.val(), aB); $.cookie("tlctime", x.val(), aB); $.cookie("tlnow", s, aB); $.cookie("tlvpos", ap.scrollTop(), aB); T("saveGuiState. tlchgrp=" + $.cookie("tlchgrp") + ", tlcdate=" + $.cookie("tlcdate") + ", tlctime=" + $.cookie("tlctime") + ", tldiscard_vpos=" + $.cookie("tldiscard_vpos") + ", tlvpos=" + $.cookie("tlvpos") + ", tlzoomx=" + $.cookie("tlzoomx") + ", tltfont=" + $.cookie("tltfont") + ", tlnow=" + $.cookie("tlnow")); return true } } function ae() { T("restoreGuiState. tlchgrp=" + $.cookie("tlchgrp") + ", tlcdate=" + $.cookie("tlcdate") + ", tlctime=" + $.cookie("tlctime") + ", tldiscard_vpos=" + $.cookie("tldiscard_vpos") + ", tlvpos=" + $.cookie("tlvpos") + ", tlzoomx=" + $.cookie("tlzoomx") + ", tltfont=" + $.cookie("tltfont") + ", tlnow=" + $.cookie("tlnow")); if (!ab) { ap.scrollLeft(x.val()); return true } P = true; var aE = $.cookie("tlchgrp"); var aH = $.cookie("tlzoomx"); var aL = $.cookie("tltfont"); var aS = $.cookie("tlctips"); var aQ = (aE != null && aH != null && aL != null && aS != null); var aN = $.cookie("tlcdate"); var aM = $.cookie("tlctime"); s = ($.cookie("tlnow") === "true"); var aG = parseInt($.cookie("tlvpos")); var aF = ($.cookie("tldiscard_vpos") == "discard"); $.cookie("tldiscard_vpos", null, aB); var aD = ($.cookie("tllazyjump") === "true"); $.cookie("tllazyjump", null, aB); var aI = (aN != null && aM != null); var aR = M.val(); var aP = parseInt(aq.val()); aP = (aP === null || isNaN(aP) || aP == 0) ? 360 : aP; if (aQ) { u.val(aE); if (aI) { var aK = $.datepicker.parseDate("dd.mm.yy", aN).getTime(); var aJ = new Date().getTime(); var aO = aJ - aJ % F; if (aK + g < aO || aK - y > aO) { aN = $.datepicker.formatDate("dd.mm.yy", new Date(aO)) } M.val(aN); x.val(aM); if (aR == "" || aN == "" || (aR != aN && !s) || aP == "" || aH == "" || aP != aH) { T("vdate=" + aR + ", cdate=" + aN + ", vzoom=" + aP + ", czoom=" + aH + ", wrong date or wrong scale -> load again..."); aq.val(aH); P = true; at.submit(); return false } else { T("inplace restore 1"); av = aP; if (s) { T("followNow -> jumpToNow"); ap.scrollLeft(aM * av / 360); if (!r(null, aD)) { $.cookie("tlcdate", M.val(), aB); return false } } else { T("restore hpos=" + aM * av / 360); ap.scrollLeft(aM * av / 360) } if (!aF) { ap.scrollTop(aG) } } } else { if (aP == "" || aH == "" || aP != aH) { T("vzoom=" + aP + ", czoom=" + aH + ", wrong scale -> load again..."); aq.val(aH); P = true; at.submit(); return false } else { T("inplace restore 2"); av = aP; r(null) } } an(parseInt(aL) - V); if (K) { K = (aS === "true") } P = false; az() } else { T("no cookies found -> jumpToNow"); P = false; av = aP; if (!r(null)) { return false } az() } return true } var a = (function() { var aD = 0; return function(aF, aE) { clearTimeout(aD); aD = setTimeout(aF, aE) } })(); function d() { if (K) { if (typeof cluetipsAvailable != "undefined") { K = cluetipsAvailable } } if ($.browser.msie && parseInt($.browser.version) <= 7) { L = true } if (L) { K = false; ai = false; p = false; ar = false; C = false; Y = false; ab = false; H = false } w = -1; if (typeof navigator.oscpu != "undefined") { var aD = navigator.oscpu.search(/Windows NT/); if (aD >= 0) { w = navigator.oscpu.substr(aD + 11) + 0 } } W = false; ag = false; if (typeof navigator.appVersion != "undefined" && $.browser.webkit) { if (navigator.appVersion.match(/Chrome/)) { W = true } else { ag = true } } e = true; if ($.browser.mozilla || W) { if (w > 0 && w < 6) { e = false } else { e = true } } else { if ($.browser.msie || $.browser.opera) { e = false } else { if (ag) { e = true } } } return true } function N() { if ($.browser.mozilla) { ap.focus() } else { if ($.browser.msie || W || ag || $.browser.opera || $.browser.webkit) { $("#jumpnow").focus() } else { ap.focus(); ap.click(); $("#jumpnow").focus() } } } function k(aD) { T("keyHandler key=" + aD.data); switch (aD.data) { case "up": aw(aD, "up"); break; case "down": aw(aD, "down"); break; case "left": case "shift-tab": aw(aD, "left"); break; case "right": case "tab": aw(aD, "right"); break; case "home": aw(aD, "fullleft"); break; case "end": aw(aD, "fullright"); break; case "ctrl+home": aw(aD, "top"); break; case "ctrl+end": aw(aD, "bottom"); break; case "pageup": aw(aD, "pageup"); break; case "pagedown": aw(aD, "pagedown"); break; case "ctrl+shift+pageup": aw(aD, "pageleft"); break; case "ctrl+shift+pagedown": aw(aD, "pageright"); break; case "return": case "r": case "shift+r": b(aD, "record"); break; case "esc": b(aD, "mousemode"); break; case "a": b(aD, "font-"); break; case "shift+a": b(aD, "font+"); break; case "c": b(aD, "disablecluetips"); break; case "shift+c": b(aD, "enablecluetips"); break; case "d": b(aD, "day-"); break; case "shift+d": b(aD, "day+"); break; case "e": case "shift+e": b(aD, "eve"); break; case "g": b(aD, "group-"); break; case "shift+g": b(aD, "group+"); break; case "h": case "shift+h": case "F1": b(aD, "help"); break; case "i": case "shift+i": case "space": b(aD, "info"); break; case "n": case "shift+n": b(aD, "now"); break; case "z": b(aD, "zoom-"); break; case "shift+z": b(aD, "zoom+"); break; default: break } } function o() { if (!ai) { return } $(document).unbind("keydown", k) } function ad() { if (!ai) { return } $(document).bind("keydown", "left", k); $(document).bind("keydown", "right", k); $(document).bind("keydown", "up", k); $(document).bind("keydown", "down", k); $(document).bind("keydown", "tab", k); $(document).bind("keydown", "shift+tab", k); $(document).bind("keydown", "home", k); $(document).bind("keydown", "end", k); $(document).bind("keydown", "pageup", k); $(document).bind("keydown", "pagedown", k); $(document).bind("keydown", "ctrl+home", k); $(document).bind("keydown", "ctrl+end", k); $(document).bind("keydown", "ctrl+shift+pageup", k); $(document).bind("keydown", "ctrl+shift+pagedown", k); $(document).bind("keydown", "return", k); $(document).bind("keydown", "r", k); $(document).bind("keydown", "shift+r", k); $(document).bind("keydown", "esc", k); $(document).bind("keydown", "a", k); $(document).bind("keydown", "shift+a", k); $(document).bind("keydown", "c", k); $(document).bind("keydown", "shift+c", k); $(document).bind("keydown", "d", k); $(document).bind("keydown", "shift+d", k); $(document).bind("keydown", "e", k); $(document).bind("keydown", "shift+e", k); $(document).bind("keydown", "g", k); $(document).bind("keydown", "shift+g", k); $(document).bind("keydown", "h", k); $(document).bind("keydown", "shift+h", k); $(document).bind("keydown", "F1", k); $(document).bind("keydown", "i", k); $(document).bind("keydown", "space", k); $(document).bind("keydown", "shift+i", k); $(document).bind("keydown", "n", k); $(document).bind("keydown", "shift+n", k); $(document).bind("keydown", "z", k); $(document).bind("keydown", "shift+z", k) } function J() { $(".chnlimg").load(function() { R(this) }); $("select#chnlgroup").change(function(aD) { $.cookie("tldiscard_vpos", "discard", aB); at.submit() }); ap.scroll(function(aD) { az() }); aC.change(function() { v(az) }); aj.click(function(aD) { aD.preventDefault(); $(document).trigger("hideCluetip"); $.colorbox({ href: $(this).children(".aentry").attr("href"), transition: "none", opacity: "0.75", innerWidth: "600", maxHeight: "98%", onOpen: function() { o() }, onClosed: function() { ad() } }) }); if (p) { $(".recicon").click(function(aD) { aD.preventDefault(); $(document).trigger("hideCluetip"); o(); dorecord($(this).children("img").attr("aurl"), $(this).children("img").attr("doclose"), false); return false }) } closecallback = function() { if (needsreload) { needsreload = false; if (H) { $.cookie("tllazyjump", true, aB); location.reload(true) } } else { ad() } }; if (K) { a(function() { aj.cluetip({ showTitle: false, attribute: "id", width: 500, positionBy: "auto", ajaxProcess: function(aD) { return aD.replace(/<div class="bgblue".*">/, '<div style="display:none;">') }, fx: { open: "fadeIn", openSpeed: "500" }, hoverIntent: { sensitivity: 7, interval: 250, timeout: 250 }, onActivate: function(aD) { return !aA && K } }) }, 1500) } $("#prevday").click(function() { ao(-1) }); $("#nextday").click(function() { ao(+1) }); $("#jumpnow").click(function() { r(az) }); $("#jumpeve").click(function() { aC.val("29"); v(az) }); if (ar) { $("#fontminus").click(function() { an(-2) }); $("#fontplus").click(function() { an(+2) }) } if (C) { $("#zoomminus").click(function() { X(0.5) }); $("#zoomplus").click(function() { X(2) }) } c.mousewheel(function(aD, aE) { aD.preventDefault(); ap.scrollLeft(ap.scrollLeft() - aE * 90) }); $(".guicontrolpanel").mousewheel(function(aD, aE) { aD.preventDefault(); ap.scrollLeft(ap.scrollLeft() - aE * 90) }); $(".timerow").mousewheel(function(aD, aE) { aD.preventDefault(); ap.scrollLeft(ap.scrollLeft() - aE * 90) }); ap.mousewheel(function(aH, aI, aE, aD) { T("epgscrollpane.mousewheel. delta=" + aI + ", deltaX=" + aE + ", deltaY=" + aD); var aG = false; aH.preventDefault(); if (Y) { if (aE !== undefined && aE !== 0) { if (e) { var aF = (ag ? -180 : 90); T("tilt scroll: epgscrollpane.scrollLeft() + deltaX*amount=" + (ap.scrollLeft() + aE * aF)); ap.scrollLeft(ap.scrollLeft() + aE * aF); aG = true } else { T("tilt scroll: tilt mouse sends also key events -> no scroll"); aG = true } } } if (!aG) { T("epgscrollpane.scrollTop()-delta*50 = " + (ap.scrollTop() - aI * 50)); ap.scrollTop(ap.scrollTop() - aI * 50); n(false) } }); if (Y || ai) { $(".contentbody").mouseover(function(aD) { N() }) } n(true); if (ai) { $("#help").click(ac); $(document).click(function(aD) { n(false) }); $(".guicontrolpanel, .timerow, .chnlscrollpane").mousemove(function(aD) { n(false) }); ad() } at.submit(function() { T("guiactionform.submit"); var aD = ax(); s = U(); h() }) } function R(aE) { myImage = new Image(); var aD = aE; myImage.src = aD.src; if (myImage.width <= myImage.height) { aD.style.height = "38px" } } function Z() { f = new Date(); ap = $("div.epgscrollpane"); c = $("div.chnlscrollpane"); D = $("div.timescrollpane"); at = $("form#guiactionform"); u = $("#chnlgroup"); aC = $("select#time_id"); x = $("input#currenttime"); M = $("input#Date"); aq = $("input#zoomfactorX"); E = $("div.nowmarker"); Q = $(".epgrow"); aa = $(".epgcell"); aj = $(".epginnercell"); d(); $(".chnllist").height($(".chnllist").height() + 17); $(".timerow").width($(".timerow").width() + 17); if (!ae()) { return true } var aD = $("#currdatestr").text(); var aE = aD.substr(0, aD.indexOf(",") + 1); $("#datelabel").text(aE); J(); if (parseInt(E.css("left")) <= 0) { E.css("display", "none") } if (!ar) { $("#fontminus").css("display", "none"); $("#fontplus").css("display", "none") } if (!C) { $("#zoomminus").css("display", "none"); $("#zoomplus").css("display", "none") } if (ai) { al(); N() } return true } return { startup: function() { return Z() } } }(); $(document).ready(function() { rsTimeline.startup() });

 

 

Edited by majstang
Beautified format got shot down by this site software

Share this post


Link to post
janee

Hi,

the code in timeline.min.js  is the same as timeline.js. For the performance the javascript code will compress (.min.js).  see here

If you want to compress the code, you can use webservice like this

For debugging the code, you can rename the timeline.js in timeline.min.js.

The Code above I modifyed by hand.

I hope the information will help you.

Christian

Share this post


Link to post
majstang

Aha, I see:rotfl: I didnt know this. Thanks for the enlightment:)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×