OSDN Git Service

806fc1ae2cbb047ed8d4327915425ca6673bfe64
[rec10/rec10-git.git] / Rec10WEB / trunk / src / rswi.htm
1
2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <html lang="ja">
4     <head>
5         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
6         <title>Rec10 Simple Web Interface ver.0.4.1a</title>
7         <!-- dojo.jsの読み込み -->
8         <script src="../dojo/dojo.js" djConfig="parseOnLoad:true">
9         </script>
10         <!-- テーマの読み込み -->
11         <style type="text/css">
12             @import "../dojo/resources/dojo.css";
13             @import "../dijit/themes/tundra/tundra.css";
14
15
16         </style>
17         <script type="text/javascript">
18
19             dojo.require("dojo.parser");
20             // ※ ここで、使用するウィジェットの読み込みを行う
21
22             dojo.require("dijit.form.Button");
23             dojo.require("dijit.form.FilteringSelect");
24             dojo.require("dijit.form.ValidationTextBox");
25             dojo.require("dijit.form.NumberSpinner");
26             dojo.require("dijit.form.CheckBox");
27             dojo.require("dijit.form.Form");
28             //dojo.require("dojox.date");
29             function setType(value){
30                 if (value=="rec"){
31                     //alert("Selected "+value);
32                     dijit.byId("deltaday").setDisabled(true);
33                     dijit.byId("deltahour").setDisabled(true);
34                     setDayopt(false);
35                 }else if (value=="key"){
36                     //alert("Selected "+value);
37                     dijit.byId("deltaday").setDisabled(true);
38                     dijit.byId("deltahour").setDisabled(false);
39                     setDayopt(false);
40                 }else if (value=="keyday"){
41                     dijit.byId("deltahour").setDisabled(false);
42                     setDayopt(true);
43                 }else if (value=="keyevery"){
44                     //alert("Selected "+value);
45                     dijit.byId("deltaday").setDisabled(false);
46                     dijit.byId("deltahour").setDisabled(false);
47                     setDayopt(false);
48                 }else if (value=="res"){
49                     //alert("Selected "+value);
50                     dijit.byId("deltaday").setDisabled(true);
51                     dijit.byId("deltahour").setDisabled(true);
52                     setDayopt(false);
53                 }else if (value=="ts2avi"){
54                     dijit.byId("deltaday").setDisabled(true);
55                     dijit.byId("deltahour").setDisabled(true);
56                     setDayopt(false);
57                 }
58
59             }
60             function setDayopt(bool){
61                 dijit.byId("day_Sun").setDisabled(!bool);
62                 dijit.byId("day_Mon").setDisabled(!bool);
63                 dijit.byId("day_Tue").setDisabled(!bool);
64                 dijit.byId("day_Wed").setDisabled(!bool);
65                 dijit.byId("day_Thu").setDisabled(!bool);
66                 dijit.byId("day_Fri").setDisabled(!bool);
67                 dijit.byId("day_Sat").setDisabled(!bool);
68             }
69             function changeSize(){
70                 var str=dijit.byId("opts").value;
71                 var s=dijit.byId("size").value;
72                 str=str.replace("S","");
73                 str=str.replace("H","");
74                 str=str.replace("F","");
75                 str=str.replace("Q","");
76                 str=str+s;
77                 //alert("Selected "+str);
78                 dijit.byId("opts").setValue(str);
79
80             }
81             function setOpts(obj){
82                 if (obj.checked){
83                     var str=dijit.byId("opts").value;
84                     str=str+obj.value;
85                 }else{
86                     var str=dijit.byId("opts").value;
87                     str=str.replace(obj.value,"");
88                 }
89                 dijit.byId("opts").setValue(str);
90             }
91             function changeOpts(){
92                 var str=dijit.byId("opts").value;
93                 if (str.indexOf("a")>-1){
94                     dijit.byId("anime").setChecked(true);
95                 }else{
96                     dijit.byId("anime").setChecked(false);
97                 }
98                 if (str.indexOf("2")>-1){
99                     dijit.byId("2pass").setChecked(true);
100                 }else{
101                     dijit.byId("2pass").setChecked(false);
102                 }
103                 if (str.indexOf("x")>-1){
104                     dijit.byId("xvid").setChecked(true);
105                 }else{
106                     dijit.byId("xvid").setChecked(false);
107                 }
108                 if (str.indexOf("d")>-1){
109                     dijit.byId("dualaudio").setChecked(true);
110                 }else{
111                     dijit.byId("dualaudio").setChecked(false);
112                 }
113                 if (str.indexOf("5")>-1){
114                     dijit.byId("pentaaudio").setChecked(true);
115                 }else{
116                     dijit.byId("pentaaudio").setChecked(false);
117                 }
118                 if (str.indexOf("S")>-1){
119                     dijit.byId("size").setValue("S");
120                 }else if (str.indexOf("H")>-1){
121                     dijit.byId("size").setValue("H");
122                 }else if (str.indexOf("F")>-1){
123                     dijit.byId("size").setValue("F");
124                 }else if (str.indexOf("Q")>-1){
125                     dijit.byId("size").setValue("Q");
126                 }else{
127                     changeSize();
128                 }
129             }
130             function setbtime_now(){
131                 var now =new Date();
132                 now.setMinutes(0,0,0);
133                 setbtime(now);
134             }
135             function setetime_now(){
136                 var ds=dijit.byId("btime").value;
137                 var d=txt2date(ds);
138                 setetime(d);
139             }
140             function setnow(){
141                 var now =new Date();
142                 now.setMinutes(0,0,0);
143                 setbtime(now);
144                 setetime(now);
145             }
146             function txt2date(txt){
147                 var d=new Date;
148                 var ds=txt;
149                 if (ds.length>3){
150                     d.setYear(parseInt(ds.substring(0,4),10));
151                 }
152                 if (ds.length>6){
153                     d.setMonth(parseInt(ds.substring(5,7),10)-1);
154                 }
155                 if (ds.length>9){
156                     d.setDate(parseInt(ds.substring(8,10),10));
157                 }
158                 if (ds.length>12){
159                     d.setHours(parseInt(ds.substring(11,13),10));
160                 }
161                 if (ds.length>15){
162                     d.setMinutes(parseInt(ds.substring(14,16),10));
163                 }
164                 if (ds.length>18){
165                     d.setSeconds(parseInt(ds.substring(17,19),10));
166                 }
167                 return d
168             }
169             function add_btimemin(min){
170                 var ds=dijit.byId("btime").value;
171                 var d=txt2date(ds);
172                 //window.alert(ds.toString()+":"+d.toString());
173                 d.setTime(d.getTime()+min*60*1000);
174                 setbtime(d);
175             }
176             function add_etimemin(min){
177                 var ds=dijit.byId("etime").value;
178                 var d=txt2date(ds);
179                 d.setTime(d.getTime()+min*60*1000);
180                 setetime(d);
181             }
182
183             function setbtime(date){
184                 var nowtxt="";
185                 //window.alert("setbtime");
186                 nowtxt=String(date.getFullYear())+"-";
187                 if (date.getMonth()<10){
188                     nowtxt=nowtxt+"0";
189                 }
190                 nowtxt=nowtxt+String(date.getMonth()+1)+"-";
191                 if (date.getDate()<10){
192                     nowtxt=nowtxt+"0";
193                 }
194                 nowtxt=nowtxt+String(date.getDate())+" ";
195                 if (date.getHours()<10){
196                     nowtxt=nowtxt+"0"
197                 }
198                 nowtxt=nowtxt+String(date.getHours())+":";
199                 if (date.getMinutes()<10){
200                     nowtxt=nowtxt+"0"
201                 }
202                 nowtxt=nowtxt+String(date.getMinutes())+":00";
203                 //console.debug("click");
204                 //window.alert("test");
205                 dijit.byId("btime").setValue(nowtxt);
206             }
207             function setetime(date){
208                 var nowtxt="";
209                 //window.alert("test");
210                 nowtxt=String(date.getFullYear())+"-";
211                 if (date.getMonth()<10){
212                     nowtxt=nowtxt+"0";
213                 }
214                 nowtxt=nowtxt+String(date.getMonth()+1)+"-";
215                 if (date.getDate()<10){
216                     nowtxt=nowtxt+"0";
217                 }
218                 nowtxt=nowtxt+String(date.getDate())+" ";
219                 if (date.getHours()<10){
220                     nowtxt=nowtxt+"0"
221                 }
222                 nowtxt=nowtxt+String(date.getHours())+":";
223                 if (date.getMinutes()<10){
224                     nowtxt=nowtxt+"0"
225                 }
226                 nowtxt=nowtxt+String(date.getMinutes())+":00";
227                 //console.debug("click");
228                 //window.alert("test");
229                 dijit.byId("etime").setValue(nowtxt);
230             }
231             function title2opts(){
232                 var str=dijit.byId("title").value;
233                 var stropt=dijit.byId("opts").Value;
234                 if (stropt==undefined){
235                     stropt="";
236                 }
237                 //stropt=stropt.replace("undefined","");
238                 //stropt=""
239                 if (str.indexOf("(2)")>-1){
240                     //dijit.byId("2pass").setChecked(true);
241                     str=stropt+"d";
242                     dijit.byId("opts").setValue(str);
243                 }else if(str.indexOf("(二)")>-1){
244                     //dijit.byId("2pass").setChecked(true);
245                     str=stropt+"d";
246                     dijit.byId("opts").setValue(str);
247                 }else if(str.indexOf("[二]")>-1){
248                     //dijit.byId("2pass").setChecked(true);
249                     str=stropt+"d";
250                     dijit.byId("opts").setValue(str);
251                 }else if(str.indexOf("(二)")>-1){
252                     //dijit.byId("2pass").setChecked(true);
253                     str=stropt+"d";
254                     dijit.byId("opts").setValue(str);
255                 }else if(str.indexOf("(二)")>-1){
256                     //dijit.byId("2pass").setChecked(true);
257                     str=stropt+"d";
258                     dijit.byId("opts").setValue(str);
259                 }else if(str.indexOf("5.1")>-1){
260                     //dijit.byId("2pass").setChecked(true);
261                     str=stropt+"5";
262                     dijit.byId("opts").setValue(str);
263                 }else if(str.indexOf("5.1")>-1){
264                     //dijit.byId("2pass").setChecked(true);
265                     str=stropt+"5";
266                     dijit.byId("opts").setValue(str);
267                 }
268             }
269             //dojo.addOnLoad(init);
270             function init(){
271                 //dojo.debug("test")
272                 setType("res");
273                 title2opts();
274                 changeSize();
275                 changeOpts();
276                 //changeSize();
277             }
278             dojo.addOnLoad(init);
279         </script>
280     </head>
281     <!-- テーマの読み込み -->
282     <body class="tundra">
283         <div dojoType="dijit.form.Form" action="rec10web.py" onExecute="this.submit()">
284         <h1>Rec10 Simple Web Interface ver.0.4.1a</h1><br>
285         <select name="type"
286                 dojoType="dijit.form.FilteringSelect"
287                 autocomplete="false"
288                 value="<!--type-value//-->"
289                 onChange="setType">
290             <option value="res">通常予約</option>
291             <option value="key">キーワード予約</option>
292             <option value="keyday">曜日予約</option>
293             <option value="keyevery">隔日予約</option>
294             <option value="rec">最終予約</option>
295             <option value="ts2avi">エンコード予約</option>
296         </select>番組名/キーワード
297         <input type="text"
298                length="40"
299                dojoType="dijit.form.TextBox"
300                value="<!--title-value//-->"
301                id="title"
302                name="title">チャンネル
303         <select name="chtxt"
304                 dojoType="dijit.form.FilteringSelect"
305                 autocomplete="false"
306                 value="<!--ch-value//-->"
307                 onChange="setType">
308             <!--text_for_replace_chtxt_input//-->
309         </select>
310         <br><br>開始時刻
311         <div name="btime"
312              id="btime"
313              dojoType="dijit.form.ValidationTextBox"
314              promptmessage="年-月-日 時間:分:秒"
315              value="<!--btime-value//-->"
316              regexp="\d{4}\-\d{2}\-\d{2} \d{2}\:\d{2}\:\d{2}">
317         </div>
318         <div dojoType="dijit.form.Button" onclick="setbtime_now()">現在</div>
319         <div dojoType="dijit.form.Button" onclick="add_btimemin(30)">+30m</div>
320         <div dojoType="dijit.form.Button" onclick="add_btimemin(180)">+3h</div>
321         <div dojoType="dijit.form.Button" onclick="add_btimemin(720)">+12h</div>
322         終了時刻
323         <div name="etime"
324              id="etime"
325              dojoType="dijit.form.ValidationTextBox"
326              promptmessage="年-月-日 時間:分:秒"
327              value="<!--etime-value//-->"
328              regexp="\d{4}\-\d{2}\-\d{2} \d{2}\:\d{2}\:\d{2}">
329         </div>
330         <div dojoType="dijit.form.Button" onclick="setetime_now()">一致</div>
331         <div dojoType="dijit.form.Button" onclick="add_etimemin(5)">+5m</div>
332         <div dojoType="dijit.form.Button" onclick="add_etimemin(30)">+30m</div>
333         <div dojoType="dijit.form.Button" onclick="add_etimemin(60)">+1h</div>
334         <br>
335         <br>隔日周期(days)
336         <input dojoType="dijit.form.NumberSpinner"
337                value="7"
338                smallDelta="1"
339                largeDelta="10"
340                constraints="{min:0,max:24,places:0}"
341                maxlength="2"
342                id="deltaday"
343                name="deltaday">
344         キーワード録画許容誤差(hours)
345         <input dojoType="dijit.form.NumberSpinner"
346                value="3"
347                smallDelta="1"
348                largeDelta="10"
349                constraints="{min:0,max:24,places:0}"
350                maxlength="2"
351                id="deltahour"
352                name="deltahour"><br><br>
353
354         <input type="checkbox"
355                dojoType="dijit.form.CheckBox"
356                id="day_Mon" name="day_Mon" value="1">月曜</input>
357         <input type="checkbox"
358                dojoType="dijit.form.CheckBox"
359                id="day_Tue" name="day_Tue" value="2">火曜</input>
360         <input type="checkbox"
361                dojoType="dijit.form.CheckBox"
362                id="day_Wed" name="day_Wed" value="3">水曜</input>
363         <input type="checkbox"
364                dojoType="dijit.form.CheckBox"
365                id="day_Thu" name="day_Thu" value="4">木曜</input>
366         <input type="checkbox"
367                dojoType="dijit.form.CheckBox"
368                id="day_Fri" name="day_Fri" value="5">金曜</input>
369         <input type="checkbox"
370                dojoType="dijit.form.CheckBox"
371                id="day_Sat" name="day_Sat" value="6">土曜</input>
372         <input type="checkbox"
373                dojoType="dijit.form.CheckBox"
374                id="day_Sun" name="day_Sun" value="7">日曜</input>
375         <br><br>
376         録画サイズ
377         <select name="size"
378                 dojoType="dijit.form.FilteringSelect"
379                 autocomplete="false"
380                 value="<!--size-value//-->"
381                 id="size"
382                 onChange="changeSize">
383             <option selected="selected" value="S">SD画質(720x480)</option>
384             <option value="H">HD画質(1280x720)</option>
385             <option value="Q">WQVG画質(400x240)</option>
386             <option value="F">FULLHD画質(1920x1080)</option>
387             <input type="checkbox"
388                    dojoType="dijit.form.CheckBox"
389                    id="anime" name="anime" value="a"
390                    onClick="setOpts(this)">アニメ</input>
391             <input type="checkbox"
392                    dojoType="dijit.form.CheckBox"
393                    id="dualaudio" name="dualaudio" value="d"
394                    onClick="setOpts(this)">二ヶ国語放送</input>
395             <input type="checkbox"
396                    dojoType="dijit.form.CheckBox"
397                    id="pentaaudio" name="pentaaudio" value="5"
398                    onClick="setOpts(this)">5.1ch放送</input>
399             <input type="checkbox"
400                    dojoType="dijit.form.CheckBox"
401                    id="2pass" name="2pass" value="2"
402                    onClick="setOpts(this)">2passモード</input>
403             <input type="checkbox"
404                    dojoType="dijit.form.CheckBox"
405                    id="xvid" name="xvid" value="x"
406                    onClick="setOpts(this)">Xvidモード</input>
407         </select>
408         Options
409         <div name="opts"
410              dojoType="dijit.form.ValidationTextBox"
411              value="<!--opts-value//-->"
412              onChange="changeOpts"
413              id="opts">
414         </div><div dojoType="dijit.form.Button" type="submit">予約</div>
415         <div name="exec"
416              dojoType="dijit.form.ValidationTextBox"
417              value="yes"
418              style="display:none";>
419              </div>
420     </body>
421 </html>