Refactor favourite implementation and add some tests.
[recordtv.git] / include / doc_single_day.html
blobc06eaecb1d60bd0e1c8a042b54e4e4be53704d36
1 <html>
2 <head>
3 <title>TV Guide</title>
4 <style type="text/css">
5 img.recpic {
6 float: right;
8 div {
9 border-width: 2px;
10 border-style: solid;
11 position: absolute;
12 font-size: small;
13 font-family: verdana, helv, arial, sans-serif;
14 padding-top: 5px;
15 padding-left: 2px;
16 vertical-align: middle;
17 overflow: hidden;
18 height: $heightpx;
20 a:hover {
21 color: red;
23 div.progdiv {
24 border-color: black;
25 background-color: #eef7ee;
27 div.progrecdiv {
28 border-color: black;
29 background-color: #ffdddd;
31 div.timediv {
32 vertical-align: middle;
33 top: 0px;
34 height: 100%;
35 border-right-style: none;
36 border-top-style: none;
37 border-bottom-style: none;
38 border-width: 1px;
40 div.time-bar {
41 border-style: none;
42 position: absolute;
43 left: 10%;
44 top: 0%;
45 width: 89%;
46 height:5%;
47 max-height: 30px;
48 overflow: hidden;
49 padding: 0px;
50 margin: 0px;
52 div.channel-bar {
53 border-style: none;
54 position: absolute;
55 vertical-align: middle;
56 top: 5%;
57 left: 0px;
58 width: 9%;
59 height: 94%;
60 overflow: hidden;
61 padding: 0px;
62 margin: 0px;
64 div.programme-region {
65 border-style: none;
66 position: absolute;
67 left: 10%;
68 top: 5%;
69 width: 89%;
70 height:94%;
71 overflow: auto;
72 padding: 0px;
73 margin: 0px;
75 </style>
76 <script type="text/javascript" language="javascript">
77 <!--
79 function scrollProgrammeRegion()
81 document.getElementById( "time-bar" ).scrollLeft = document.getElementById( "programme-region" ).scrollLeft;
84 function mi( id )
86 if( document.getElementById )
88 el = document.getElementById( id );
89 if( el )
91 if( el.style.overflow != 'auto' )
93 el.title = el.innerHTML
96 if( el.className == 'progdiv' )
98 el.style.backgroundColor = '#ccffcc';
100 else
102 el.style.backgroundColor = '#ffbbbb';
108 function mo( id )
110 if( document.getElementById )
112 el = document.getElementById( id );
113 if( el )
115 el.title = '';
116 el.style.backgroundColor = '';
121 function cl( id )
123 if( document.getElementById )
125 el = document.getElementById( id );
126 if( el )
128 if( el.style.overflow == 'auto' )
130 doUnSelect( el );
132 else
134 makeRequest( 'prog-' + id + '.inc', id );
141 function doSelect( id, text )
143 if( document.prevSelected )
145 doUnSelect( document.prevSelected );
148 if( document.getElementById )
150 el = document.getElementById( id );
151 if( el )
153 document.prevSelected = el;
154 w = el.style.width
155 if( w.substring( 0, w.length - 2 ) < 300 )
157 el.oldWidth = el.style.width;
158 el.style.width = 300;
160 el.style.height = 150;
161 el.style.overflow = 'auto';
162 el.oldInnerHTML = el.innerHTML
163 el.innerHTML = text;
164 el.style.zIndex = 1;
170 function doUnSelect( el )
172 document.prevSelected = 0;
174 el.style.overflow = 'hidden';
175 el.style.height = $height;
176 if( el.oldWidth )
178 el.style.width = el.oldWidth;
180 el.innerHTML = el.oldInnerHTML;
181 el.style.zIndex = 0;
184 function makeRequest( url, arg )
186 var httpRequest;
188 if( window.XMLHttpRequest ) // Mozilla, Safari etc.
190 httpRequest = new XMLHttpRequest();
191 //if (httpRequest.overrideMimeType) {
192 // httpRequest.overrideMimeType('text/xml');
193 // // See note below about this line
196 else if( window.ActiveXObject ) // IE
200 httpRequest = new ActiveXObject( "Msxml2.XMLHTTP" );
202 catch( e )
206 httpRequest = new ActiveXObject( "Microsoft.XMLHTTP" );
208 catch( e )
214 if( !httpRequest )
216 return false;
219 httpRequest.onreadystatechange = function()
221 receiveAnswer( httpRequest, arg );
224 httpRequest.open('GET', url, true);
225 httpRequest.send('');
228 function receiveAnswer( httpRequest, id )
230 if( httpRequest.readyState == 4 )
232 if( httpRequest.status == 200 )
234 doSelect( id, httpRequest.responseText );
240 </script>
241 </head>
242 <body>
244 <div class="time-bar" id="time-bar">
245 $times
246 </div>
248 <div class="channel-bar" id="channel-bar">
249 $channels
250 </div>
252 <div class="programme-region" id="programme-region" onScroll="scrollProgrammeRegion()">
253 $programmes
254 </div>
255 </body>
256 </html>