OSDN Git Service

edit mode
[rec10/rec10-git.git] / Rec10WEB / trunk / src / rswi_edit.htm
1
2
3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <html>
5     <head>
6         <meta http-equive="Content-Type" content="text/html;charset=UTF-8"/>
7         <title>Rec10 Simple Web Interface ver.0.5.0a 編集画面</title>
8         <!-- dojo.jsの読み込み -->
9         <script src="../dojo/dojo.js" djConfig="parseOnLoad:true">
10         </script>
11         <!-- テーマの読み込み -->
12         <style type="text/css">
13             @import "../dojo/resources/dojo.css";
14             @import "../dijit/themes/tundra/tundra.css";
15
16
17         </style>
18         <script type="text/javascript">
19
20             dojo.require("dojo.parser");
21             // ※ ここで、使用するウィジェットの読み込みを行う
22
23             dojo.require("dijit.form.Button");
24             dojo.require("dijit.form.FilteringSelect");
25             dojo.require("dijit.form.ValidationTextBox");
26             dojo.require("dijit.form.NumberSpinner");
27             dojo.require("dijit.form.CheckBox");
28             dojo.require("dijit.form.Form");
29             //dojo.require("dojox.date");
30             function setType(value){
31                 if (value=="rec"){
32                     //alert("Selected "+value);
33                     dijit.byId("deltaday").setDisabled(true);
34                     dijit.byId("deltahour").setDisabled(true);
35                     setDayopt(false);
36                 }else if (value=="key"){
37                     //alert("Selected "+value);
38                     dijit.byId("deltaday").setDisabled(true);
39                     dijit.byId("deltahour").setDisabled(false);
40                     setDayopt(false);
41                 }else if (value=="keyday"){
42                     dijit.byId("deltahour").setDisabled(false);
43                     setDayopt(true);
44                 }else if (value=="keyevery"){
45                     //alert("Selected "+value);
46                     dijit.byId("deltaday").setDisabled(false);
47                     dijit.byId("deltahour").setDisabled(false);
48                     setDayopt(false);
49                 }else if (value=="res"){
50                     //alert("Selected "+value);
51                     dijit.byId("deltaday").setDisabled(true);
52                     dijit.byId("deltahour").setDisabled(true);
53                     setDayopt(false);
54                 }else if (value=="ts2avi"){
55                     dijit.byId("deltaday").setDisabled(true);
56                     dijit.byId("deltahour").setDisabled(true);
57                     setDayopt(false);
58                 }
59
60             }
61             function setDayopt(bool){
62                 dijit.byId("day_Sun").setDisabled(!bool);
63                 dijit.byId("day_Mon").setDisabled(!bool);
64                 dijit.byId("day_Tue").setDisabled(!bool);
65                 dijit.byId("day_Wed").setDisabled(!bool);
66                 dijit.byId("day_Thu").setDisabled(!bool);
67                 dijit.byId("day_Fri").setDisabled(!bool);
68                 dijit.byId("day_Sat").setDisabled(!bool);
69             }
70             function changeSize(){
71                 var str=dijit.byId("opts").value;
72                 var s=dijit.byId("size").value;
73                 str=str.replace("S","");
74                 str=str.replace("H","");
75                 str=str.replace("F","");
76                 str=str.replace("Q","");
77                 str=str+s;
78                 //alert("Selected "+str);
79                 dijit.byId("opts").setValue(str);
80
81             }
82             function setOpts(obj){
83                 if (obj.checked){
84                     var str=dijit.byId("opts").value;
85                     str=str+obj.value;
86                 }else{
87                     var str=dijit.byId("opts").value;
88                     str=str.replace(obj.value,"");
89                 }
90                 dijit.byId("opts").setValue(str);
91             }
92             function changeOpts(){
93                 var str=dijit.byId("opts").value;
94                 if (str.indexOf("a")>-1){
95                     dijit.byId("anime").setChecked(true);
96                 }else{
97                     dijit.byId("anime").setChecked(false);
98                 }
99                 if (str.indexOf("2")>-1){
100                     dijit.byId("2pass").setChecked(true);
101                 }else{
102                     dijit.byId("2pass").setChecked(false);
103                 }
104                 if (str.indexOf("x")>-1){
105                     dijit.byId("xvid").setChecked(true);
106                 }else{
107                     dijit.byId("xvid").setChecked(false);
108                 }
109                 if (str.indexOf("d")>-1){
110                     dijit.byId("dualaudio").setChecked(true);
111                 }else{
112                     dijit.byId("dualaudio").setChecked(false);
113                 }
114                 if (str.indexOf("5")>-1){
115                     dijit.byId("pentaaudio").setChecked(true);
116                 }else{
117                     dijit.byId("pentaaudio").setChecked(false);
118                 }
119                 if (str.indexOf("S")>-1){
120                     dijit.byId("size").setValue("S");
121                 }else if (str.indexOf("H")>-1){
122                     dijit.byId("size").setValue("H");
123                 }else if (str.indexOf("F")>-1){
124                     dijit.byId("size").setValue("F");
125                 }else if (str.indexOf("Q")>-1){
126                     dijit.byId("size").setValue("Q");
127                 }else{
128                     changeSize();
129                 }
130             }
131             function setbtime_now(){
132                 var now =new Date();
133                 now.setMinutes(0,0,0);
134                 setbtime(now);
135             }
136             function setetime_now(){
137                 var ds=dijit.byId("btime").value;
138                 var d=txt2date(ds);
139                 setetime(d);
140             }
141             function setnow(){
142                 var now =new Date();
143                 now.setMinutes(0,0,0);
144                 setbtime(now);
145                 setetime(now);
146             }
147             function txt2date(txt){
148                 var d=new Date;
149                 var ds=txt;
150                 if (ds.length>3){
151                     d.setYear(parseInt(ds.substring(0,4)));
152                 }
153                 if (ds.length>6){
154                     d.setMonth(parseInt(ds.substring(5,7))-1);
155                 }
156                 if (ds.length>9){
157                     d.setDate(parseInt(ds.substring(8,10)));
158                 }
159                 if (ds.length>12){
160                     d.setHours(parseInt(ds.substring(11,13)));
161                 }
162                 if (ds.length>15){
163                     d.setMinutes(parseInt(ds.substring(14,16)));
164                 }
165                 if (ds.length>18){
166                     d.setSeconds(parseInt(ds.substring(17,19)));
167                 }
168                 return d
169             }
170             function add_btimemin(min){
171                 var ds=dijit.byId("btime").value;
172                 var d=txt2date(ds);
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.5.0a 編集画面</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="<!--exec-value//-->"
418              style="display:none";>
419              </div>
420     </body>
421 </html>