Mercurial > epgrec.yaz
annotate templates/index.html @ 20:9ab4184561d9
new file: epgrec_upgrade.php
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Thu, 16 Jul 2009 16:52:54 +0900 |
parents | 19cd7816b2c1 |
children | f3bf1be1a51b |
rev | line source |
---|---|
1 | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
2 "http://www.w3.org/TR/html4/loose.dtd"> | |
3 | |
4 <html> | |
5 <head> | |
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
7 <title>{$sitetitle}</title> | |
8 <meta http-equiv="Content-Style-Type" content="text/css"> | |
9 | |
10 {literal} | |
11 | |
12 <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> | |
13 <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script> | |
14 <link rel="stylesheet" href="start/jquery-ui-1.7.2.custom.css" type="text/css"> | |
15 <script type="text/javascript" src="js/mdabasic.js"></script> | |
16 <script type="text/javascript"> | |
17 function tvtimes_scroll(){ | |
18 var t2max = $('#tvtimes2').position().left; | |
19 var ftmin = $('#float_titles').position().top; | |
20 tvtimes2scrl(); | |
21 $(window).scroll(function () { | |
22 $('#tvtimes').css('left', parseInt($(document ).scrollLeft())); | |
23 var newTop = parseInt($(document ).scrollTop()); | |
24 if(newTop < ftmin) {newTop = ftmin;} | |
25 $('#float_titles').css('top', newTop); | |
26 tvtimes2scrl(); | |
27 $('#float_follows').css('left', parseInt($(document ).scrollLeft())); | |
28 }); | |
29 $(window).resize(function () { tvtimes2scrl();}); | |
30 function tvtimes2scrl(){ | |
31 var inwidth = parseInt($('body').innerWidth()); | |
32 // IE6 | |
33 if ($.browser.msie && $.browser.version == 6){ inwidth = document.documentElement.clientWidth;} | |
34 var newLeft = inwidth - parseInt($('#tvtimes2').width()) + parseInt($( document ).scrollLeft()); | |
35 if(newLeft > t2max ) {newLeft = t2max} | |
36 $('#tvtimes2').css('left', newLeft); | |
37 $('#float_follows').width(inwidth); | |
38 } | |
39 } | |
40 function prg_hover(){ | |
41 function aClick(){ | |
42 var TG = $(this).children('.prg_dummy'); | |
43 var startTime = new Date(TG.children('.prg_start').html()); | |
44 var duration = parseInt(TG.children('.prg_duration').html()); | |
45 var endTime = new Date(startTime.getTime() + duration * 1000); | |
46 var prgID = parseInt(TG.children('.prg_id').html()); | |
47 | |
48 var str = '<div class="prg_title">' + TG.children('.prg_title').html() +'</div>' + | |
49 '<div class="prg_rec_cfg ui-corner-all"><div class="prg_channel"><span class=" labelLeft">チャンネル:</span><span class="bold">' + TG.children('.prg_channel').html() + '</span></div>' + | |
50 '<div class="prg_startTime" style="clear: left"><span class=" labelLeft">日時:</span>' + MDA.Days.time4Disp(startTime) + ' ~ ' + MDA.Days.time4DispH(endTime) + '</div>' + | |
51 '<div class="prg_duration" style="clear: left"><span class=" labelLeft">録画時間:</span><span class="bold">' + parseInt(duration / 60) +'</span>分' + ((duration % 60)>0?'<span class="bold">' + parseInt(duration % 60) + '</span>秒':'') + '</div>' + | |
52 '</div>'; | |
53 if ($(this).hasClass('prg_rec')) { | |
54 str += '<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.cancel(' + prgID + ')" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">予約キャンセル</a></div>'; | |
55 } else { | |
56 str += '<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.rec(' + prgID + ')" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">簡易予約</a> <a href="reservation.php?program_id=' + prgID + '" style="color:red;">予約カスタマイズ</a></div>'; | |
57 } | |
58 $('#floatBox4Dialog').html(str); | |
59 $('#floatBox4Dialog').dialog('open', 'center'); | |
60 }; | |
61 $('.prg').hover( | |
62 function(){ | |
63 $('#tv_chs .prg_hover').removeClass('prg_hover'); | |
64 if($(this).hasClass('prg_none')) return ; | |
65 $(this).addClass('prg_hover'); | |
66 var TG = $(this).children('.prg_dummy'); | |
67 var startTime = new Date(TG.children('.prg_start').html()); | |
68 var duration = parseInt(TG.children('.prg_duration').html()); | |
69 var endTime = new Date(startTime.getTime() + duration * 1000); | |
70 var str = '<div class="prg_title">' + TG.children('.prg_title').html() + '</div>' + | |
71 '<div class="prg_desc"><span class="prg_sub">' + TG.children('.prg_channel').html() + ':' + MDA.Days.time4Disp(startTime) + '~' + MDA.Days.time4DispH(endTime) + ' </span>' + TG.children('.prg_desc').html() + '</div>'; | |
72 $('#prg_info').html('<div class="prg_dummy">' + str + '</div>').show(); | |
73 $(this).click(aClick); | |
74 }, | |
75 function(){ | |
76 $(this).removeClass('prg_hover');$('#prg_info').hide(); | |
77 $(this).unbind('click',aClick); | |
78 } | |
79 ); | |
80 } | |
81 var PRG = { | |
82 rec:function(id){ | |
83 $.get(INISet.prgRecordURL, { program_id: id } ,function(data){ | |
84 if(data.match(/^error/i)){ | |
85 alert(data); | |
18
19cd7816b2c1
change: draw main program table too fast.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
86 $('#floatBox4Dialog').dialog('close'); |
1 | 87 }else{ |
88 $('#prgID_' + id).addClass('prg_rec'); | |
89 $('#floatBox4Dialog').dialog('close'); | |
90 } | |
91 }); | |
92 }, | |
93 cancel:function(id){ | |
94 $.get(INISet.prgCancelURL, { program_id: id } ,function(data){ | |
95 if(data.match(/^error/i)){ | |
96 alert(data); | |
18
19cd7816b2c1
change: draw main program table too fast.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
97 $('#floatBox4Dialog').dialog('close'); |
1 | 98 }else{ |
99 $('#prgID_' + id).removeClass('prg_rec'); | |
100 $('#floatBox4Dialog').dialog('close'); | |
101 } | |
102 }); | |
103 } | |
104 } | |
105 var CTG = { | |
106 CN:'ctg', | |
107 CV:'0.1', | |
108 defaultCk:[], | |
109 INI:function(){ | |
110 var Ck = this.CkGet()[1]; | |
111 if(Ck){ $.each(Ck.split(','), function(){CTG.select(this);})} | |
112 }, | |
113 select:function(ctg){ | |
114 if($('#category_select .ctg-hide.ctg_'+ctg).length){ | |
115 $('#tv_chs .ctg_'+ctg).removeClass('ctg-hide'); | |
116 $('#category_select a.ctg_'+ctg).removeClass('ctg-hide'); | |
117 } else { | |
118 $('#tv_chs .ctg_'+ctg).addClass('ctg-hide'); | |
119 $('#category_select a.ctg_'+ctg).addClass('ctg-hide'); | |
120 } | |
121 this.oCk(); | |
122 }, | |
123 toggle:function (){$('#category_select ul').toggle();}, | |
124 oCk:function(){ | |
125 var T=$('#category_select ul li a.ctg-hide'); | |
126 var X=[]; | |
127 $.each(T.get(), function(){ | |
128 $(this).attr('class').match(/ctg_([^ ]+)/); | |
129 var TMC=RegExp.$1; | |
130 X.push(TMC); | |
131 }); | |
132 this.CkSet([X.join(',')]); | |
133 }, | |
134 CkGet:function (){ | |
135 var Ck = MDA.Cookie.get(this.CN); | |
136 if(!Ck){return this.defaultCk}; | |
137 Ck=Ck.replace(/^([^;]+;)/,''); | |
138 return Ck.split('+'); | |
139 }, | |
140 CkSet:function(V){ | |
141 MDA.Cookie.set(this.CN,'ver='+this.CV+'+'+V.join('+')); | |
142 } | |
143 }; | |
144 var nowBar = { | |
145 defaultID:'tableNowBas', | |
146 startTime:null, | |
147 endTime:null, | |
148 INI:function(){ | |
149 if (INISet.tableStartTime && INISet.tableStartTime && INISet.dotMin) { | |
150 $('#tvtable').append('<div id="' + this.defaultID + '" style="display:none">now</div>'); | |
151 this.startTime = new Date(INISet.tableStartTime); | |
152 this.endTime = new Date(INISet.tableEndTime); | |
153 $('#' + this.defaultID).width($('#float_titles').width()); | |
154 this.ch(); | |
155 } | |
156 }, | |
157 ch:function(){ | |
158 var now = new Date(); | |
159 if(this.startTime){ | |
160 if((now >= this.startTime) && (this.endTime >= now)){ | |
161 // console.log((now - this.startTime) / 60000); | |
162 $('#' + this.defaultID).css({top:(now - this.startTime) / 60000 * INISet.dotMin}).show() | |
163 } else { | |
164 $('#' + this.defaultID).hide() | |
165 } | |
166 } | |
167 } | |
168 } | |
169 | |
170 MDA.SCR = { | |
171 CN:'scr', | |
172 CV:'0.1', | |
173 defaultCk:{md:'',x:0,y:0}, | |
174 jqSel:[{sel:'#jump-time a.jump',md:'x'},{sel:'#jump-day a.jump',md:'xy'},{sel:'#jump-day a.jump-today',md:'x'},{sel:'#jump-broadcast a.jump',md:'y'}], | |
175 INI:function(){ | |
176 // this.defaultCk.y = $('#float_titles').position().top; | |
177 $.each(this.jqSel, function(){ | |
178 var md = this.md; | |
179 $(this.sel).click(function(){MDA.SCR.oCk(md)}) | |
180 }); | |
181 var Ck = this.CkGet(); | |
182 // console.log(Ck); | |
183 var x = (Ck.md.indexOf('x')>-1)?Ck.x:this.defaultCk.x; | |
184 var y = (Ck.md.indexOf('y')>-1)?Ck.y:this.defaultCk.y; | |
185 if (Ck.md) { | |
186 window.scrollBy(x, y); | |
187 } | |
188 this.CkClear(); | |
189 }, | |
190 channel:{ | |
191 save:function(){}, | |
192 load:function(){} | |
193 }, | |
194 time: { | |
195 }, | |
196 oCk:function(xy){ | |
197 this.CkSet(['md=' + ((!xy)?'xy':xy), | |
198 'x=' + $(document ).scrollLeft(), | |
199 'y=' + $(document ).scrollTop()]); | |
200 }, | |
201 CkGet:function (){ | |
202 var Ck = MDA.Cookie.get(this.CN); | |
203 if(!Ck){return this.defaultCk}; | |
204 Ck=Ck.replace(/^([^;]+;)/,'').split('+'); | |
205 var ret = {}; | |
206 $.each(Ck, function(){ | |
207 var str = this.split('=', 2); | |
208 ret[str[0]] = str[1]; | |
209 }) | |
210 return ret; | |
211 }, | |
212 CkSet:function(V){ | |
213 MDA.Cookie.set(this.CN,'ver='+this.CV+'+'+V.join('+')); | |
214 }, | |
215 CkClear:function(){ | |
216 MDA.Cookie.del(this.CN); | |
217 } | |
218 }; | |
219 | |
220 $(document).ready(function () { | |
221 MDA.Cookie.CookieName = 'tvProgmas_'; | |
222 CTG.toggle(); | |
223 tvtimes_scroll(); | |
224 prg_hover(); | |
225 var DG = $('#floatBox4Dialog'); | |
226 DG.dialog({title:'録画予約',width:500}); | |
227 DG.dialog('close'); | |
228 nowBar.INI(); | |
229 CTG.INI(); | |
230 MDA.SCR.INI(); // 番組表の位置保存 | |
231 }); | |
232 | |
233 | |
234 </script> | |
235 | |
236 <style type="text/css"> | |
237 <!-- | |
238 body {padding:0;margin:0;font-size:10pt;} | |
239 a {text-decoration:none;} | |
240 | |
241 .bold {font-weight:bold;} | |
242 .small {font-size:75%;} | |
243 | |
244 h2 {padding: 4px} | |
245 | |
246 #float_titles {position:absolute;background-image: url(imgs/trancBG50.png);} | |
247 | |
248 #float_titles div.set.ctg_sel {background-color:#BBB;color:#3CF} | |
249 #float_titles .ctg_sel a{color:#111;} | |
250 | |
251 #float_titles div.set {float:left;background-color:#444;padding:4px;margin:4px;} | |
252 #float_titles span.title {float:left;color:#ACF;} | |
253 #float_titles ul {float:left;padding:0;margin:0;} | |
254 #float_titles ul li {float:left;list-style:none;margin:0 0 0 4px;} | |
255 #float_titles li a{padding:1px 4px;background-color:#555;color:#FFF;} | |
256 #float_titles li.selected a{background-color:#48B;} | |
257 #float_titles li a:hover{background-color:#28D;} | |
258 | |
259 #float_titles, #tvtable {} | |
260 #tvtable {line-height:1.2em;width:100%;position:relative;} | |
261 #tvtimes,#tvtimes2 {position:absolute; background-image: url(imgs/trancBG70.png);} | |
262 #tvtimes,#tvtimes2, .tvtimeDM {width:40px;} | |
263 #tv_chs {padding-left:40px;padding-right:40px;} | |
264 .tvtime { | |
265 height:120px; | |
266 color:#EEE; | |
267 text-align:center; | |
268 font-weight:bold; | |
269 font-size:120%; | |
270 background-image: url(imgs/dot2.gif); | |
271 background-repeat: repeat-x; | |
272 background-position: left bottom; | |
273 } | |
274 #tvtable div.tvtimetop {padding:8px 0px;} | |
275 #tvtable div.ch_set {width:150px;float:left;background-color:#BBB;} | |
276 #tvtable div.ch_title, #tvtable div.prg {margin-right:2px;} | |
277 #tvtable div.ch_title {padding:8px 0px;background-color:#333;color:#DDD;font-weight:bold;text-align:center} | |
278 #tvtable div.prg { | |
279 overflow:hidden; | |
280 color:#444; | |
281 background-image: url(imgs/dot2.gif); | |
282 background-image: url(imgs/prg_bg2.png); | |
283 background-repeat: repeat-x; | |
284 background-position: left bottom; | |
285 -moz-border-radius: 0.6em 0.6em 0.3em 0.3em; | |
286 -webkit-border-radius: 0.6em; | |
287 -webkit-border-bottom-right-radius: 0.3em; | |
288 -webkit-border-bottom-left-radius: 0.3em; | |
289 } | |
290 #tvtable div.prg_none {background-color:#eee;} | |
291 #tvtable div.prg_dummy {margin:3px 6px;} | |
292 #tvtable div.prg_title {color:#111;font-weight:bold;} | |
293 #tvtable div.prg_subtitle {font-size:80%;} | |
294 #tvtable div.prg_desc {font-size:80%;} | |
295 | |
296 #tvtable div.prg_start,#tvtable div.prg_duration,#tvtable div.prg_channel ,#tvtable div.prg_id {display: none;} | |
297 | |
298 #tvtable div.ctg_news, #category_select a.ctg_news {background-color: #FFFFD8;} | |
299 #tvtable div.ctg_etc, #category_select a.ctg_etc {background-color: #FFFFFF;} | |
300 #tvtable div.ctg_information, #category_select a.ctg_information {background-color: #F2D8FF;} | |
301 #tvtable div.ctg_sports, #category_select a.ctg_sports {background-color: #D8FFFF;} | |
302 #tvtable div.ctg_cinema, #category_select a.ctg_cinema {background-color: #FFD8D8;} | |
303 #tvtable div.ctg_music, #category_select a.ctg_music {background-color: #D8D8FF;} | |
304 #tvtable div.ctg_drama, #category_select a.ctg_drama {background-color: #D8FFD8;} | |
305 #tvtable div.ctg_anime, #category_select a.ctg_anime {background-color: #FFE4C8;} | |
306 #tvtable div.ctg_variety, #category_select a.ctg_variety {background-color: #FFD2EB;} | |
307 #tvtable div.ctg_10, #category_select a.ctg_10 {background-color: #E4F4F4;} | |
308 #tvtable div.ctg-hide, #category_select a.ctg-hide {background-color: #F8F8F8;color:#888;} | |
309 #tvtable div.ctg-hide .prg_title, #category_select a.ctg-hide .prg_title{color:#666;} | |
310 #tvtable div.prg_rec {background-color: #F55;color:#FEE} | |
311 #tvtable div.prg_rec .prg_title,#tvtable div.prg_hover .prg_title {color:white;} | |
312 #tvtable div.prg_hover {background-color: #28D;color:#EFF} | |
313 | |
314 #float_titles { z-index:100} | |
315 #float_titles div.ch_title {width:150px;float:left;color:#FFF;font-weight:bold;text-align:center} | |
316 #float_titles div.ch_title div{padding:8px 0px;margin:0 6px 0 4px;background-image: url(imgs/trancBG50.png);} | |
317 | |
318 #float_follows {position:absolute;} | |
319 #prg_info { | |
320 display:none; | |
321 position:absolute; | |
322 top:0;left:0; | |
323 width:100%; | |
324 background-color:#246; | |
325 color:#BDF; | |
326 height:80px; | |
327 } | |
328 #prg_info div.prg_dummy{margin:4px 20px;} | |
329 #prg_info div.prg_title {font-weight:bold;font-size:120%;color:#FFF;} | |
330 #prg_info span.prg_sub {color:#FFF;} | |
331 | |
332 #tableNowBas {position:absolute;background:red;width:100%;top:190px;height:2px;overflow:hidden;} | |
333 | |
334 | |
335 #floatBox4Dialog .prg_title{font-size:120%;font-weight:bold;padding:0.4em 0;text-align:center;} | |
336 #floatBox4Dialog .prg_rec_cfg{background:#EEE;padding:1em 2em;margin:0.4em 0;} | |
337 #floatBox4Dialog .labelLeft {width:8em;float:left;text-align:right;} | |
338 #floatBox4Dialog .button {padding:0.4em 1em;} | |
339 --> | |
340 </style> | |
341 | |
342 | |
343 {/literal} | |
344 | |
345 | |
346 </head> | |
347 | |
348 <body> | |
349 | |
350 <h2>{$sitetitle}</h2> | |
351 | |
352 | |
353 <div id="float_titles" style="width: {math equation="x + 80" x=$chs_width}px;height:120px;"> | |
354 <div id="float_follows"> | |
355 | |
356 <div class="set ctg_sel" id="category_select"> | |
357 <span class="title"><a href="javascript:CTG.toggle()">強調表示</a></span> | |
358 | |
359 <ul> | |
360 {foreach from=$cats item=cat} | |
361 <li><a href="javascript:CTG.select('{$cat.name_en}');" class="ctg_{$cat.name_en}">{$cat.name_jp}</a></li> | |
362 {/foreach} | |
363 </ul> | |
364 </div> | |
365 | |
366 <div id="time_selects"> | |
367 <div class="set" id="jump-broadcast" > | |
368 <span class="title">放送波選択</span> | |
369 <ul> | |
370 {foreach from=$types item=type } | |
371 <li {$type.selected}><a class="jump" href="{$type.link}">{$type.name}</a></li> | |
372 {/foreach} | |
373 </ul><br style="clear:left;" /> | |
374 </div> | |
375 | |
376 <div class="set" id="jump-time"> | |
377 <span class="title">時間</span> | |
378 <ul> | |
379 {foreach from=$toptimes item=top} | |
380 <li><a class="jump" href="{$top.link}">{$top.hour}~</a></li> | |
381 {/foreach} | |
382 </ul><br style="clear:left;" /> | |
383 </div> | |
384 <br style="clear:left;" /> | |
385 | |
386 <div class="set"> | |
387 <ul> | |
388 <li><a href="programTable.php">番組検索</a></li> | |
389 <li><a href="reservationTable.php">録画予約一覧</a></li> | |
390 <li><a href="recordedTable.php">録画済一覧</a></li> | |
391 </ul> | |
392 </div> | |
393 | |
394 <div class="set" id="jump-day" > | |
395 <span class="title">日付</span> | |
396 <ul> | |
397 {foreach from=$days item=day} | |
398 <li {$day.selected}><a {if $day.d eq "現在" } class="jump-today" {else} class="jump" {/if} href="{$day.link}">{$day.d}{$day.ofweek}</a></li> | |
399 {/foreach} | |
400 </ul><br style="clear:left;" /> | |
401 </div> | |
402 | |
403 | |
404 </div> | |
405 <br style="clear:left;" /> | |
406 <div id="prg_info"><div class="dummy">test</div></div> | |
407 </div> | |
408 | |
409 <div style="position:absolute;bottom:0;"> | |
410 <div class="tvtimeDM" style="float:left;"> </div> | |
411 {foreach from=$programs item=program } | |
412 <div class="ch_title"><div>{$program.station_name}</div></div> | |
413 {/foreach} | |
414 </div> | |
415 <br style="clear:left;" /> | |
416 <div id="prg_info"><div class="dummy"> </div></div> | |
417 </div> | |
418 | |
419 <div id="float_titles_dummy" style="width:1410px;height:120px;"> </div> | |
420 | |
421 | |
422 <div id="tvtable"> | |
423 | |
424 <div id="tvtimes"> | |
425 {foreach from=$tvtimes item=time} | |
426 <div class="tvtime">{$time}</div> | |
427 {/foreach} | |
428 </div> | |
429 | |
430 <div id="tv_chs" style="width: {$chs_width}px" > | |
431 {foreach from=$programs item=program } | |
432 <div class="ch_set" style="width: {$ch_set_width}px" > | |
433 <div class="ch_programs"> | |
434 {foreach from=$program.list item=item } | |
435 <div {if $item.id}id="prgID_{$item.id}"{/if} class="prg {if ! $item.id}prg_none {/if} ctg_{$item.category_name}{if $item.rec gt 0 } prg_rec{/if}" style="height:{$item.height}px;"> | |
436 <div class="prg_dummy"> | |
437 <div class="prg_title">{$item.title|escape}</div> | |
438 <div class="prg_subtitle">{$item.starttime}</div> | |
439 <div class="prg_desc">{$item.description|escape}</div> | |
440 <div class="prg_channel">{$item.channel}</div> | |
441 <div class="prg_start">{$item.prg_start}</div> | |
442 <div class="prg_duration">{$item.duration}</div> | |
443 <div class="prg_id">{$item.id}</div> | |
444 </div> | |
445 </div> | |
446 {/foreach} | |
447 </div> | |
448 </div> | |
449 {/foreach} | |
450 </div> | |
451 | |
452 <div id="tvtimes2" style="top : 0px; left: {math equation="x + 40" x=$chs_width}px" > | |
453 {foreach from=$tvtimes item=time} | |
454 <div class="tvtime">{$time}</div> | |
455 {/foreach} | |
456 </div> | |
457 </div> | |
458 | |
459 | |
460 | |
461 <div id="floatBox4Dialog">jQuery UI Dialog</div> | |
462 | |
463 {literal} | |
464 <script type="text/javascript"> | |
465 var INISet = { | |
466 prgRecordURL : 'simpleReservation.php', // 簡易予約 | |
467 prgRecordPlusURL : 'recordp.php', // 詳細予約 | |
468 prgCancelURL : 'cancelReservation.php', // 予約キャンセル | |
469 dotMin : 2, | |
470 tableStartTime : {/literal}'{$top_time}', | |
471 tableEndTime : '{$last_time}'{literal} | |
472 } | |
473 </script> | |
474 {/literal} | |
475 </body> | |
476 </html> |