Mercurial > epgrec.yaz
annotate templates/index.html @ 172:2a944f0c15c5
merged from upstream
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 30 Apr 2010 12:21:17 +0900 |
parents | 1e93ea03ebd9 |
children |
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 { | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
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="javascript:PRG.customform(' + prgID + ')" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">予約カスタマイズ</a></div>'; |
1 | 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 = { | |
122 | 82 chdialog:function(chash){ |
77 | 83 $('#channelDialog').dialog('close'); |
122 | 84 var skip = $('#ch_title_'+chash+' .ch_skip').html(); |
85 var st_name = $('#ch_title_'+chash+' .ch_name').html(); | |
86 var sid = $('#ch_title_'+chash+' .ch_sid').html(); | |
87 var disc = $('#ch_title_'+chash+' .ch_disc').html(); | |
77 | 88 |
122 | 89 var str = '<div class="prg_title">'; |
90 str += st_name; | |
91 str += '</div>'; | |
92 str += '<form method="post" action="setChannelInfo.php">'; | |
93 // スキップ | |
125 | 94 str += '<div class="prg_channel"><span class="labelLeft">視聴しない:</span>'; |
95 str += '<span>'; | |
122 | 96 if( skip == 1 ) { |
97 str += '<input type="checkbox" name="n_skip_name" id="id_ch_skip" value="'+skip+'" checked />'; | |
98 } | |
99 else { | |
100 str += '<input type="checkbox" name="n_skip_name" id="id_ch_skip" value="'+skip+'" />'; | |
101 } | |
125 | 102 str += '</span></div>'; |
122 | 103 // サービスID |
104 str += '<div class="prg_channel"><span class="labelLeft">サービスID:</span>'; | |
105 str += '<span><input type="text" name="n_sid" size="20" id="id_sid" value="'; | |
106 str += sid; | |
107 str += '" /></span></div>'; | |
108 | |
109 str += '<input type="hidden" name="n_channel_disc" id="id_disc" value="'; | |
110 str += disc; | |
111 str += '" />'; | |
112 str += '<input type="hidden" name="n_channel_hash" id="id_hash" value="'; | |
113 str += chash; | |
114 str += '" />'; | |
115 | |
116 | |
117 str += '</form>'; | |
118 | |
119 str += '<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.chupdate()" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">更新</a></div>'; | |
120 | |
121 $('#channelDialog').html(str); | |
122 $('#channelDialog').dialog('open', 'center'); | |
77 | 123 }, |
124 chupdate:function() { | |
125 var v_sid = $('#id_sid').val(); | |
126 var v_channel_disc = $('#id_disc').val(); | |
123 | 127 var v_hash = $('#id_hash').val(); |
128 var v_skip = $('#id_ch_skip').attr('checked'); | |
125 | 129 var n_skip = v_skip ? 1 : 0; |
130 | |
123 | 131 $.post('setChannelInfo.php', { channel_disc: v_channel_disc, |
132 sid: v_sid, | |
125 | 133 skip: n_skip |
123 | 134 }, function(data) { |
135 if(data.match(/^error/i)){ | |
136 alert(data); | |
137 } | |
138 else { | |
139 var old_skip = $('#ch_title_'+v_hash+' .ch_skip').html(); | |
125 | 140 if( old_skip != n_skip ) { |
123 | 141 if( v_skip ) { |
124
aa48eb5f1993
mod: ͥ륹åJavaScript
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
123
diff
changeset
|
142 (INISet.num_ch)--; |
123 | 143 $('#ch_title_'+v_hash ).addClass('ch_title_skip'); |
124
aa48eb5f1993
mod: ͥ륹åJavaScript
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
123
diff
changeset
|
144 $('#tv_chs_'+v_hash ).addClass('ch_set_skip'); |
128 | 145 $('#ch_title_str_'+v_hash ).addClass('ch_skip_color'); |
124
aa48eb5f1993
mod: ͥ륹åJavaScript
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
123
diff
changeset
|
146 $('#ch_title_'+v_hash+' .ch_skip').html('1'); |
123 | 147 } |
148 else { | |
124
aa48eb5f1993
mod: ͥ륹åJavaScript
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
123
diff
changeset
|
149 (INISet.num_ch)++; |
123 | 150 $('#ch_title_'+v_hash ).removeClass('ch_title_skip'); |
124
aa48eb5f1993
mod: ͥ륹åJavaScript
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
123
diff
changeset
|
151 $('#tv_chs_'+v_hash ).removeClass('ch_set_skip'); |
128 | 152 $('#ch_title_str_'+v_hash ).removeClass('ch_skip_color'); |
124
aa48eb5f1993
mod: ͥ륹åJavaScript
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
123
diff
changeset
|
153 $('#ch_title_'+v_hash+' .ch_skip').html('0'); |
123 | 154 } |
128 | 155 if( PRG.F_Skip == 1 ) { |
156 PRG.chSkipHide(); | |
157 } | |
158 else { | |
159 $('#ch_title_bar div.ch_title_skip').show(); | |
160 $('#tv_chs div.ch_set_skip').show(); | |
161 } | |
123 | 162 } |
163 } | |
77 | 164 $('#channelDialog').dialog('close'); |
165 }); | |
166 }, | |
1 | 167 rec:function(id){ |
168 $.get(INISet.prgRecordURL, { program_id: id } ,function(data){ | |
169 if(data.match(/^error/i)){ | |
170 alert(data); | |
18
19cd7816b2c1
change: draw main program table too fast.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
171 $('#floatBox4Dialog').dialog('close'); |
1 | 172 }else{ |
173 $('#prgID_' + id).addClass('prg_rec'); | |
174 $('#floatBox4Dialog').dialog('close'); | |
175 } | |
176 }); | |
177 }, | |
178 cancel:function(id){ | |
179 $.get(INISet.prgCancelURL, { program_id: id } ,function(data){ | |
180 if(data.match(/^error/i)){ | |
181 alert(data); | |
18
19cd7816b2c1
change: draw main program table too fast.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
182 $('#floatBox4Dialog').dialog('close'); |
1 | 183 }else{ |
184 $('#prgID_' + id).removeClass('prg_rec'); | |
185 $('#floatBox4Dialog').dialog('close'); | |
186 } | |
187 }); | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
188 }, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
189 customform:function(id) { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
190 $('#floatBox4Dialog').dialog('close'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
191 $.get('reservationform.php', { program_id: id }, function(data) { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
192 if(data.match(/^error/i)){ |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
193 alert(data); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
194 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
195 else { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
196 var str = data; |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
197 str += '<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.customrec()" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">予約する</a></div>'; |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
198 $('#floatBox4Dialog').html(str); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
199 $('#floatBox4Dialog').dialog('open', 'center'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
200 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
201 }); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
202 }, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
203 customrec:function() { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
204 var id_syear = $('#id_syear').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
205 var id_smonth = $('#id_smonth').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
206 var id_sday = $('#id_sday').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
207 var id_shour = $('#id_shour').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
208 var id_smin = $('#id_smin').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
209 var id_eyear = $('#id_eyear').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
210 var id_emonth = $('#id_emonth').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
211 var id_eday = $('#id_eday').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
212 var id_ehour = $('#id_ehour').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
213 var id_emin = $('#id_emin').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
214 var id_channel_id = $('#id_channel_id').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
215 var id_record_mode = $('#id_record_mode').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
216 var id_title = $('#id_title').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
217 var id_description = $('#id_description').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
218 var id_category_id = $('#id_category_id ').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
219 var id_program_id = $('#id_program_id').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
220 var with_program_id = $('#id_program_id').attr('checked'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
221 |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
222 if( ! with_program_id ) id_program_id = 0; |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
223 |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
224 $.post('customReservation.php', { syear: id_syear, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
225 smonth: id_smonth, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
226 sday: id_sday, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
227 shour: id_shour, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
228 smin: id_smin, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
229 eyear: id_eyear, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
230 emonth: id_emonth, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
231 eday: id_eday, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
232 ehour: id_ehour, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
233 emin: id_emin, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
234 channel_id: id_channel_id, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
235 record_mode: id_record_mode, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
236 title: id_title, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
237 description: id_description, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
238 category_id: id_category_id, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
239 program_id: id_program_id }, function(data) { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
240 if(data.match(/^error/i)){ |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
241 $('#floatBox4Dialog').dialog('close'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
242 alert(data); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
243 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
244 else { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
245 var id = parseInt(data); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
246 if( id ) { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
247 $('#prgID_' + id).addClass('prg_rec'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
248 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
249 $('#floatBox4Dialog').dialog('close'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
250 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
251 }); |
120 | 252 }, |
123 | 253 F_Skip: 1, |
121 | 254 chSkipShow:function() { |
255 $('#float_titles').width(INISet.num_all_ch * INISet.ch_width + 80); | |
256 $('#tv_chs').width(INISet.num_all_ch * INISet.ch_width ); | |
257 $('#tvtimes2').css( { left: INISet.num_all_ch * INISet.ch_width + 40 } ).show(); | |
258 tvtimes_scroll(); | |
259 $('#ch_title_bar div.ch_title_skip').show(); | |
260 $('#tv_chs div.ch_set_skip').show(); | |
125 | 261 nowBar.INI(); |
121 | 262 }, |
263 chSkipHide:function() { | |
264 $('#ch_title_bar div.ch_title_skip').hide(); | |
265 $('#tv_chs div.ch_set_skip').hide(); | |
266 $('#float_titles').width( INISet.num_ch * INISet.ch_width + 80 ); | |
267 $('#tv_chs').width( INISet.num_ch * INISet.ch_width ); | |
268 $('#tvtimes2').css( { left: INISet.num_ch * INISet.ch_width + 40 }).show(); | |
269 tvtimes_scroll(); | |
125 | 270 nowBar.INI(); |
121 | 271 }, |
120 | 272 toggle:function() { |
123 | 273 if( this.F_Skip ) { |
121 | 274 this.chSkipShow(); |
125 | 275 this.F_Skip = 0; |
120 | 276 } |
277 else { | |
121 | 278 this.chSkipHide(); |
125 | 279 this.F_Skip = 1; |
120 | 280 } |
1 | 281 } |
282 } | |
283 var CTG = { | |
284 CN:'ctg', | |
285 CV:'0.1', | |
286 defaultCk:[], | |
287 INI:function(){ | |
288 var Ck = this.CkGet()[1]; | |
289 if(Ck){ $.each(Ck.split(','), function(){CTG.select(this);})} | |
290 }, | |
291 select:function(ctg){ | |
292 if($('#category_select .ctg-hide.ctg_'+ctg).length){ | |
293 $('#tv_chs .ctg_'+ctg).removeClass('ctg-hide'); | |
294 $('#category_select a.ctg_'+ctg).removeClass('ctg-hide'); | |
295 } else { | |
296 $('#tv_chs .ctg_'+ctg).addClass('ctg-hide'); | |
297 $('#category_select a.ctg_'+ctg).addClass('ctg-hide'); | |
298 } | |
299 this.oCk(); | |
300 }, | |
301 toggle:function (){$('#category_select ul').toggle();}, | |
302 oCk:function(){ | |
303 var T=$('#category_select ul li a.ctg-hide'); | |
304 var X=[]; | |
305 $.each(T.get(), function(){ | |
306 $(this).attr('class').match(/ctg_([^ ]+)/); | |
307 var TMC=RegExp.$1; | |
308 X.push(TMC); | |
309 }); | |
310 this.CkSet([X.join(',')]); | |
311 }, | |
312 CkGet:function (){ | |
313 var Ck = MDA.Cookie.get(this.CN); | |
314 if(!Ck){return this.defaultCk}; | |
315 Ck=Ck.replace(/^([^;]+;)/,''); | |
316 return Ck.split('+'); | |
317 }, | |
318 CkSet:function(V){ | |
319 MDA.Cookie.set(this.CN,'ver='+this.CV+'+'+V.join('+')); | |
320 } | |
321 }; | |
322 var nowBar = { | |
323 defaultID:'tableNowBas', | |
324 startTime:null, | |
325 endTime:null, | |
326 INI:function(){ | |
327 if (INISet.tableStartTime && INISet.tableStartTime && INISet.dotMin) { | |
328 $('#tvtable').append('<div id="' + this.defaultID + '" style="display:none">now</div>'); | |
329 this.startTime = new Date(INISet.tableStartTime); | |
330 this.endTime = new Date(INISet.tableEndTime); | |
331 $('#' + this.defaultID).width($('#float_titles').width()); | |
332 this.ch(); | |
333 } | |
334 }, | |
335 ch:function(){ | |
336 var now = new Date(); | |
337 if(this.startTime){ | |
338 if((now >= this.startTime) && (this.endTime >= now)){ | |
339 // console.log((now - this.startTime) / 60000); | |
340 $('#' + this.defaultID).css({top:(now - this.startTime) / 60000 * INISet.dotMin}).show() | |
341 } else { | |
342 $('#' + this.defaultID).hide() | |
343 } | |
344 } | |
345 } | |
346 } | |
347 | |
348 MDA.SCR = { | |
349 CN:'scr', | |
350 CV:'0.1', | |
351 defaultCk:{md:'',x:0,y:0}, | |
352 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'}], | |
353 INI:function(){ | |
354 // this.defaultCk.y = $('#float_titles').position().top; | |
355 $.each(this.jqSel, function(){ | |
356 var md = this.md; | |
357 $(this.sel).click(function(){MDA.SCR.oCk(md)}) | |
358 }); | |
359 var Ck = this.CkGet(); | |
360 // console.log(Ck); | |
361 var x = (Ck.md.indexOf('x')>-1)?Ck.x:this.defaultCk.x; | |
362 var y = (Ck.md.indexOf('y')>-1)?Ck.y:this.defaultCk.y; | |
363 if (Ck.md) { | |
364 window.scrollBy(x, y); | |
365 } | |
366 this.CkClear(); | |
367 }, | |
368 channel:{ | |
369 save:function(){}, | |
370 load:function(){} | |
371 }, | |
372 time: { | |
373 }, | |
374 oCk:function(xy){ | |
375 this.CkSet(['md=' + ((!xy)?'xy':xy), | |
376 'x=' + $(document ).scrollLeft(), | |
377 'y=' + $(document ).scrollTop()]); | |
378 }, | |
379 CkGet:function (){ | |
380 var Ck = MDA.Cookie.get(this.CN); | |
381 if(!Ck){return this.defaultCk}; | |
382 Ck=Ck.replace(/^([^;]+;)/,'').split('+'); | |
383 var ret = {}; | |
384 $.each(Ck, function(){ | |
385 var str = this.split('=', 2); | |
386 ret[str[0]] = str[1]; | |
387 }) | |
388 return ret; | |
389 }, | |
390 CkSet:function(V){ | |
391 MDA.Cookie.set(this.CN,'ver='+this.CV+'+'+V.join('+')); | |
392 }, | |
393 CkClear:function(){ | |
394 MDA.Cookie.del(this.CN); | |
395 } | |
396 }; | |
397 | |
398 $(document).ready(function () { | |
399 MDA.Cookie.CookieName = 'tvProgmas_'; | |
400 CTG.toggle(); | |
401 tvtimes_scroll(); | |
402 prg_hover(); | |
403 var DG = $('#floatBox4Dialog'); | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
18
diff
changeset
|
404 DG.dialog({title:'録画予約',width:600}); |
1 | 405 DG.dialog('close'); |
77 | 406 |
407 var DG2 = $('#channelDialog'); | |
125 | 408 DG2.dialog({title:'チャンネル情報',width:480}); |
77 | 409 DG2.dialog('close'); |
410 | |
121 | 411 // PRG.toggle(); |
120 | 412 |
1 | 413 nowBar.INI(); |
414 CTG.INI(); | |
415 MDA.SCR.INI(); // 番組表の位置保存 | |
416 }); | |
417 | |
418 | |
419 </script> | |
420 | |
421 <style type="text/css"> | |
422 <!-- | |
423 body {padding:0;margin:0;font-size:10pt;} | |
424 a {text-decoration:none;} | |
425 | |
426 .bold {font-weight:bold;} | |
427 .small {font-size:75%;} | |
428 | |
429 h2 {padding: 4px} | |
430 | |
431 #float_titles {position:absolute;background-image: url(imgs/trancBG50.png);} | |
432 | |
433 #float_titles div.set.ctg_sel {background-color:#BBB;color:#3CF} | |
434 #float_titles .ctg_sel a{color:#111;} | |
435 | |
436 #float_titles div.set {float:left;background-color:#444;padding:4px;margin:4px;} | |
437 #float_titles span.title {float:left;color:#ACF;} | |
438 #float_titles ul {float:left;padding:0;margin:0;} | |
439 #float_titles ul li {float:left;list-style:none;margin:0 0 0 4px;} | |
440 #float_titles li a{padding:1px 4px;background-color:#555;color:#FFF;} | |
441 #float_titles li.selected a{background-color:#48B;} | |
442 #float_titles li a:hover{background-color:#28D;} | |
443 | |
444 #float_titles, #tvtable {} | |
445 #tvtable {line-height:1.2em;width:100%;position:relative;} | |
446 #tvtimes,#tvtimes2 {position:absolute; background-image: url(imgs/trancBG70.png);} | |
447 #tvtimes,#tvtimes2, .tvtimeDM {width:40px;} | |
448 #tv_chs {padding-left:40px;padding-right:40px;} | |
449 .tvtime { | |
34 | 450 height:{/literal}{$height_per_hour}{literal}px; |
1 | 451 color:#EEE; |
452 text-align:center; | |
453 font-weight:bold; | |
454 font-size:120%; | |
455 background-image: url(imgs/dot2.gif); | |
456 background-repeat: repeat-x; | |
457 background-position: left bottom; | |
458 } | |
459 #tvtable div.tvtimetop {padding:8px 0px;} | |
34 | 460 |
461 #tvtable div.ch_set {width:{/literal}{$ch_set_width}{literal}px;float:left;background-color:#BBB;} | |
121 | 462 .ch_set_skip { display: none; } |
34 | 463 |
464 | |
1 | 465 #tvtable div.ch_title, #tvtable div.prg {margin-right:2px;} |
466 #tvtable div.ch_title {padding:8px 0px;background-color:#333;color:#DDD;font-weight:bold;text-align:center} | |
128 | 467 .ch_title_skip { display: none;} |
468 .ch_skip_color { color: red;} | |
120 | 469 |
122 | 470 .ch_disc {display :none;} |
471 .ch_skip {display :none;} | |
472 .ch_sid {display :none;} | |
473 .ch_name {display :none;} | |
474 .ch_hash {display :none;} | |
475 | |
1 | 476 #tvtable div.prg { |
477 overflow:hidden; | |
478 color:#444; | |
479 background-image: url(imgs/dot2.gif); | |
480 background-image: url(imgs/prg_bg2.png); | |
481 background-repeat: repeat-x; | |
482 background-position: left bottom; | |
483 -moz-border-radius: 0.6em 0.6em 0.3em 0.3em; | |
484 -webkit-border-radius: 0.6em; | |
485 -webkit-border-bottom-right-radius: 0.3em; | |
486 -webkit-border-bottom-left-radius: 0.3em; | |
487 } | |
488 #tvtable div.prg_none {background-color:#eee;} | |
489 #tvtable div.prg_dummy {margin:3px 6px;} | |
490 #tvtable div.prg_title {color:#111;font-weight:bold;} | |
491 #tvtable div.prg_subtitle {font-size:80%;} | |
492 #tvtable div.prg_desc {font-size:80%;} | |
493 | |
494 #tvtable div.prg_start,#tvtable div.prg_duration,#tvtable div.prg_channel ,#tvtable div.prg_id {display: none;} | |
495 | |
496 #tvtable div.ctg_news, #category_select a.ctg_news {background-color: #FFFFD8;} | |
497 #tvtable div.ctg_etc, #category_select a.ctg_etc {background-color: #FFFFFF;} | |
498 #tvtable div.ctg_information, #category_select a.ctg_information {background-color: #F2D8FF;} | |
499 #tvtable div.ctg_sports, #category_select a.ctg_sports {background-color: #D8FFFF;} | |
500 #tvtable div.ctg_cinema, #category_select a.ctg_cinema {background-color: #FFD8D8;} | |
501 #tvtable div.ctg_music, #category_select a.ctg_music {background-color: #D8D8FF;} | |
502 #tvtable div.ctg_drama, #category_select a.ctg_drama {background-color: #D8FFD8;} | |
503 #tvtable div.ctg_anime, #category_select a.ctg_anime {background-color: #FFE4C8;} | |
504 #tvtable div.ctg_variety, #category_select a.ctg_variety {background-color: #FFD2EB;} | |
505 #tvtable div.ctg_10, #category_select a.ctg_10 {background-color: #E4F4F4;} | |
506 #tvtable div.ctg-hide, #category_select a.ctg-hide {background-color: #F8F8F8;color:#888;} | |
507 #tvtable div.ctg-hide .prg_title, #category_select a.ctg-hide .prg_title{color:#666;} | |
508 #tvtable div.prg_rec {background-color: #F55;color:#FEE} | |
509 #tvtable div.prg_rec .prg_title,#tvtable div.prg_hover .prg_title {color:white;} | |
510 #tvtable div.prg_hover {background-color: #28D;color:#EFF} | |
511 | |
512 #float_titles { z-index:100} | |
34 | 513 #float_titles div.ch_title {width:{/literal}{$ch_set_width}{literal}px;float:left;color:#FFF;font-weight:bold;text-align:center} |
1 | 514 #float_titles div.ch_title div{padding:8px 0px;margin:0 6px 0 4px;background-image: url(imgs/trancBG50.png);} |
515 | |
120 | 516 |
1 | 517 #float_follows {position:absolute;} |
518 #prg_info { | |
519 display:none; | |
520 position:absolute; | |
521 top:0;left:0; | |
522 width:100%; | |
523 background-color:#246; | |
524 color:#BDF; | |
525 height:80px; | |
526 } | |
527 #prg_info div.prg_dummy{margin:4px 20px;} | |
528 #prg_info div.prg_title {font-weight:bold;font-size:120%;color:#FFF;} | |
529 #prg_info span.prg_sub {color:#FFF;} | |
530 | |
531 #tableNowBas {position:absolute;background:red;width:100%;top:190px;height:2px;overflow:hidden;} | |
532 | |
533 | |
534 #floatBox4Dialog .prg_title{font-size:120%;font-weight:bold;padding:0.4em 0;text-align:center;} | |
535 #floatBox4Dialog .prg_rec_cfg{background:#EEE;padding:1em 2em;margin:0.4em 0;} | |
536 #floatBox4Dialog .labelLeft {width:8em;float:left;text-align:right;} | |
537 #floatBox4Dialog .button {padding:0.4em 1em;} | |
77 | 538 |
539 #channelDialog .prg_title{font-size:120%;font-weight:bold;padding:0.4em 0;text-align:center;} | |
540 #channelDialog .prg_rec_cfg{background:#EEE;padding:1em 2em;margin:0.4em 0;} | |
541 #channelDialog .labelLeft {width:8em;float:left;text-align:right;} | |
542 #channelDialog .button {padding:0.4em 1em;} | |
543 | |
1 | 544 --> |
545 </style> | |
546 | |
547 | |
548 {/literal} | |
549 | |
550 | |
551 </head> | |
552 | |
553 <body> | |
554 | |
555 <h2>{$sitetitle}</h2> | |
556 | |
557 | |
120 | 558 <div id="float_titles" style="width: {math equation="x + 80" x=$chs_width }px;height:120px;"> |
1 | 559 <div id="float_follows"> |
560 | |
41 | 561 <div class="set"> |
562 <ul> | |
563 <li><a href="envSetting.php">環境設定</a></li> | |
564 </ul> | |
565 </div> | |
566 | |
1 | 567 <div class="set ctg_sel" id="category_select"> |
568 <span class="title"><a href="javascript:CTG.toggle()">強調表示</a></span> | |
569 | |
570 <ul> | |
571 {foreach from=$cats item=cat} | |
572 <li><a href="javascript:CTG.select('{$cat.name_en}');" class="ctg_{$cat.name_en}">{$cat.name_jp}</a></li> | |
573 {/foreach} | |
574 </ul> | |
575 </div> | |
576 | |
577 <div id="time_selects"> | |
578 <div class="set" id="jump-broadcast" > | |
579 <span class="title">放送波選択</span> | |
580 <ul> | |
581 {foreach from=$types item=type } | |
582 <li {$type.selected}><a class="jump" href="{$type.link}">{$type.name}</a></li> | |
583 {/foreach} | |
584 </ul><br style="clear:left;" /> | |
585 </div> | |
586 | |
587 <div class="set" id="jump-time"> | |
588 <span class="title">時間</span> | |
589 <ul> | |
590 {foreach from=$toptimes item=top} | |
591 <li><a class="jump" href="{$top.link}">{$top.hour}~</a></li> | |
592 {/foreach} | |
593 </ul><br style="clear:left;" /> | |
594 </div> | |
120 | 595 |
596 <div class="set"> | |
597 <ul><li><a class="jump" href="javascript:PRG.toggle()">チャンネル表示</a></li></ul> | |
598 </div> | |
599 | |
1 | 600 <br style="clear:left;" /> |
601 | |
602 <div class="set"> | |
603 <ul> | |
604 <li><a href="programTable.php">番組検索</a></li> | |
605 <li><a href="reservationTable.php">録画予約一覧</a></li> | |
606 <li><a href="recordedTable.php">録画済一覧</a></li> | |
607 </ul> | |
608 </div> | |
609 | |
610 <div class="set" id="jump-day" > | |
611 <span class="title">日付</span> | |
612 <ul> | |
613 {foreach from=$days item=day} | |
614 <li {$day.selected}><a {if $day.d eq "現在" } class="jump-today" {else} class="jump" {/if} href="{$day.link}">{$day.d}{$day.ofweek}</a></li> | |
615 {/foreach} | |
616 </ul><br style="clear:left;" /> | |
617 </div> | |
618 | |
619 | |
620 </div> | |
621 <br style="clear:left;" /> | |
622 <div id="prg_info"><div class="dummy">test</div></div> | |
623 </div> | |
624 | |
120 | 625 |
626 <!-- チャンネル局名 --> | |
627 <div id="ch_title_bar" style="position:absolute;bottom:0;"> | |
1 | 628 <div class="tvtimeDM" style="float:left;"> </div> |
629 {foreach from=$programs item=program } | |
122 | 630 <div id="ch_title_{$program.ch_hash}" class="ch_title{if $program.skip == 1 } ch_title_skip{/if}" > |
631 <div class="ch_hash">{$program.ch_hash}</div> | |
632 <div class="ch_disc">{$program.channel_disc}</div> | |
633 <div class="ch_skip">{$program.skip}</div> | |
634 <div class="ch_sid">{$program.sid}</div> | |
635 <div class="ch_name">{$program.station_name}</div> | |
129 | 636 <div id="ch_title_str_{$program.ch_hash}" {if $program.skip == 1 }class="ch_skip_color" {/if} style="cursor: pointer;" onClick="javascript:PRG.chdialog('{$program.ch_hash}')" >{$program.station_name}</div> |
120 | 637 </div> |
1 | 638 {/foreach} |
639 </div> | |
120 | 640 |
1 | 641 <br style="clear:left;" /> |
642 <div id="prg_info"><div class="dummy"> </div></div> | |
643 </div> | |
644 | |
645 <div id="float_titles_dummy" style="width:1410px;height:120px;"> </div> | |
646 | |
647 | |
648 <div id="tvtable"> | |
649 | |
650 <div id="tvtimes"> | |
651 {foreach from=$tvtimes item=time} | |
652 <div class="tvtime">{$time}</div> | |
653 {/foreach} | |
654 </div> | |
655 | |
656 <div id="tv_chs" style="width: {$chs_width}px" > | |
657 {foreach from=$programs item=program } | |
122 | 658 <div id="tv_chs_{$program.ch_hash}" class="ch_set{if $program.skip == 1 } ch_set_skip{/if}" > |
121 | 659 <div class="ch_programs" > |
1 | 660 {foreach from=$program.list item=item } |
661 <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;"> | |
662 <div class="prg_dummy"> | |
663 <div class="prg_title">{$item.title|escape}</div> | |
664 <div class="prg_subtitle">{$item.starttime}</div> | |
665 <div class="prg_desc">{$item.description|escape}</div> | |
666 <div class="prg_channel">{$item.channel}</div> | |
667 <div class="prg_start">{$item.prg_start}</div> | |
668 <div class="prg_duration">{$item.duration}</div> | |
669 <div class="prg_id">{$item.id}</div> | |
670 </div> | |
671 </div> | |
672 {/foreach} | |
673 </div> | |
674 </div> | |
675 {/foreach} | |
676 </div> | |
677 | |
678 <div id="tvtimes2" style="top : 0px; left: {math equation="x + 40" x=$chs_width}px" > | |
679 {foreach from=$tvtimes item=time} | |
680 <div class="tvtime">{$time}</div> | |
681 {/foreach} | |
682 </div> | |
683 </div> | |
684 | |
685 | |
686 | |
687 <div id="floatBox4Dialog">jQuery UI Dialog</div> | |
77 | 688 <div id="channelDialog">jQuery UI Dialog</div> |
1 | 689 |
690 {literal} | |
691 <script type="text/javascript"> | |
692 var INISet = { | |
120 | 693 {/literal} |
1 | 694 prgRecordURL : 'simpleReservation.php', // 簡易予約 |
695 prgRecordPlusURL : 'recordp.php', // 詳細予約 | |
696 prgCancelURL : 'cancelReservation.php', // 予約キャンセル | |
120 | 697 dotMin : {$height_per_min}, |
698 tableStartTime : '{$top_time}', | |
699 tableEndTime : '{$last_time}', | |
700 ch_width : {$ch_set_width}, | |
701 num_ch : {$num_ch}, | |
702 num_all_ch : {$num_all_ch} | |
703 {literal} | |
1 | 704 } |
705 </script> | |
706 {/literal} | |
707 </body> | |
708 </html> |