1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="scroller">
<head>
<meta http-equiv="refresh" content="600; URL=vdradmin.pl?aktion=prog_timeline" />
<meta http-equiv="content-type" content="text/html;charset=<?% charset %?>" />
<title>VDRAdmin-AM - <?% gettext('Timeline') %?></title>
<link href="style.css" rel="stylesheet" media="screen" type="text/css" />
<?% IF usercss %?>
<link href="user.css" rel="stylesheet" media="screen" type="text/css" />
<?% END %?>
<script type="text/javascript" language="JavaScript1.2" src="library.js"></script>
<?%-
USE date;
show_hours = config.ZEITRAHMEN || 1; # Zeitrahmen der angezeigt werden soll in Stunden
times = config.TIMES.split(',\s*');
px_per_min = 3; # Make it configurable?
# now_sec is the requested browser time in seconds since 1970
# start_sec is the start time of the table in seconds since 1970
# end_sec is the end time of the table in seconds since 1970
# end_min is the end time of the table in minutes since start of the table
# diff_sec is the offset from start_sec to now_sec
diff_sec = now_sec % 1800; # time since last 30 minutes interval
start_sec = now_sec - diff_sec;
end_min = 60 * show_hours;
end_sec = start_sec + (end_min * 60);
-%?>
<!-- TimeLine: start_sec="<?% date.format(start_sec, '%H:%M') %?>" request="<?% date.format(date.now, '%H:%M') %?>" end_sec="<?% date.format(end_sec, '%H:%M') %?>" -->
<style type="text/css">
table.prgname {
border-width:1px;
border-style:none;
border-spacing:0px;
padding:0px;
margin:0px;
text-align:left;
table-layout:fixed;
overflow:hidden;
}
td.prgname {
margin: 0 2px;
overflow:hidden;
}
.prgtable, .timertable {
border-width: 1px 1px 0px 1px;
border-style: solid none none solid;
border-spacing:0px;
padding:0px;
margin:0px;
text-align:left;
table-layout:fixed;
overflow:hidden;
}
td.prgtable,
td.timertable {
padding: 0 2px;
overflow:hidden;
}
#bigtable { position:absolute; top:0; left: 0; z-index: 1; }
</style>
<script type="text/javascript" language="JavaScript1.2">
var show_tooltips = <?% config.TL_TOOLTIP ? "true" : "false" %?>;
</script>
<?% IF config.TL_TOOLTIP %?>
<script type="text/javascript" language="JavaScript1.2" src="infobox.js"></script>
<?% END %?>
<script type="text/javascript" language="JavaScript1.2" src="timeline.js"></script>
<script type="text/javascript" language="JavaScript1.2">
var trans = new Translation("<?% gettext('now') %?>",
"<?% gettext('o\'clock') %?>",
"<?% gettext('to') %?>");
var redraw_w;
var redraw_h;
function Redraw()
{
if (redraw_w != GetWindowW() || redraw_h != GetWindowH())
{
Go('<?% nowurl %?>&time=<?% date.format(now_sec, '%H:%M') %?>');
}
}
function AddEvent(counter, vdr_id, epg_id, start_sec, stop_sec, title, timer, summary)
{
var e = new EPGEvent(epg_id, start_sec, stop_sec, title, timer, summary);
<?% IF config.TL_TOOLTIP %?>
maketip("VDR-" + vdr_id + "-" + counter, title,
"<?% gettext('Duration:') %?> " + e.start_str + " - " + e.stop_str
+ " (" + Div(stop_sec - start_sec, 60) + " <?% gettext('min') %?>)");
<?% END %?>
return e;
}
function Go(x)
{
if(x =="nothing") {
document.forms[0].reset();
document.forms[0].elements[0].blur();
return;
} else {
parent.frames[1].location.href = x;
document.forms[0].elements[0].blur();
}
}
</script>
</head>
<body id="prog_timeline">
<?% IF config.TL_TOOLTIP %?>
<div id="infodiv" style="position:absolute; visibility:hidden; z-index:20; top:0px; left:0px;"></div>
<?% END %?>
<script type="text/javascript" language="JavaScript">
window.onresize = Redraw;
redraw_w = GetWindowW();
redraw_h = GetWindowH();
var channels = new Array();
var events;
<?%
index = 0;
FOREACH name = shows2.keys.nsort;
counter = 0;
%?>
events = new Array();
<?%
FOREACH show = shows2.${name};
%?>
events[<?% counter %?>] = AddEvent(<?% counter %?>, <?% show.vdr_id %?>, "<?% show.anchor %?>", <?% show.start %?>, <?% show.stop %?>, "<?% show.title | html %?>", <?% show.timer %?>, <?% show.summary ? 1 : 0 %?>);
<?%
counter = counter + 1;
END;
%?>
channels[<?% index %?>] = new ChannelInfo(<?% show.vdr_id %?>, "<?% shows.${name}.first.progname %?>", "<?% shows.${name}.first.proglink %?>", events);
<?%
index = index + 1;
END;
%?>
</script>
<form action="<?% nowurl %?>" method="get" name="FormName">
<script type="text/javascript" language="JavaScript1.2">
var tl = new TimeLine(<?% now_sec %?>, "<?% nowurl %?>", <?% px_per_min %?>, <?% end_min %?>);
var popup_width = <?% config.GUI_POPUP_WIDTH %?>;
var popup_height = <?% config.GUI_POPUP_HEIGHT %?>;
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="heading">
<tr>
<td class="col_title">
<h1><?% date.format(now_sec, "%A,") %?> <?% now %?> <?% gettext('o\'clock') %?></h1>
</td>
<td class="col_other">
<?% gettext('Channel group:') %?>
<select name="select_wanted_channels" size="1" class="submit" onchange="window.open(this.options[this.selectedIndex].value, '_self')">
<?% FOREACH ch_grp = ch_groups %?>
<option value="<?% ch_grp.url %?>" <?% IF ch_grp.selected %?>selected="selected"<?% END %?> ><?% ch_grp.title %?></option>
<?% END %?>
</select>
<?% gettext('What\'s on:') %?>
<select name="Auswahl" class="submit" onchange="Go(this.form.Auswahl.options[this.form.Auswahl.options.selectedIndex].value)">
<?% select_now = (now == date.format(date.now, '%H:%M')) %?>
<script type="text/javascript" language="JavaScript1.2">
BuildOption("", 0, "-");
BuildOption("", <?% select_now ? 1 : 0 %?>, "<?% gettext('now') %?>");
<?% FOREACH timer = times %?>
<?% timer_o_dopp = timer | replace('\:', '') %?>
BuildOption("<?% timer_o_dopp %?>", <?% !select_now && (now == timer) ? 1 : 0 %?>, "<?% timer %?>");
<?% END %?>
</script>
</select>
<?% gettext('at:') %?>
<input type="text" name="time" size="5" value="<?% now | html %?>" />
<?% gettext('o\'clock') %?>
<input type="hidden" name="aktion" value="prog_timeline" />
<script type="text/javascript" language="JavaScript1.2">
BuildHiddenFrameInput();
</script>
</td>
</tr>
</table>
<?% IF error_msg %?>
<div class="error"><?% error_msg %?></div>
<?% END %?>
<?% IF shows.size() > 0 %?>
<script type="text/javascript" language="JavaScript1.2">
BuildContent();
</script>
<p>
<noscript>
<center>
<h1><?% gettext('You need JavaScript to use the timeline!') %?></h1>
</center>
</noscript>
</p>
<?% ELSE %?>
<div id="content">
<div class="warning"><?% gettext('No EPG information available') %?></div>
</div>
<?% END %?>
</form>
</body>
</html>
|