OSDN Git Service

commit iepg adding on web function.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Tue, 1 Sep 2009 08:43:22 +0000 (08:43 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Tue, 1 Sep 2009 08:43:22 +0000 (08:43 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@139 4e526526-5e11-4fc0-8910-f8fd03428081

Rec10WEB/trunk/src/fin.htm
Rec10WEB/trunk/src/iepg_show.htm
Rec10WEB/trunk/src/rec10web.py
Rec10WEB/trunk/src/schedule.htm

index 386be00..16042b2 100644 (file)
@@ -4,11 +4,13 @@
     <head>
         <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
         <meta http-equiv="refresh" content="3; url=rec10web.py">
+        <meta http-equiv="refresh" content="3; url=<!--url_for_replace_fin//-->">
         <title>Rec10 Simple Web Interface ver.0.7.0</title>
     </head>
     <body>
     <h1>Rec10 Simple Web Interface ver.0.7.0</h1><br>
     <br>
+    <!--text_for_replace_fin//-->
     予約が終了しました。移動します。
     </body>
 </html>
index 71f27ca..cb71370 100644 (file)
@@ -1,12 +1,12 @@
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <meta http-equiv="Content-Style-Type" content="text/css">
-    <meta http-equiv="Content-Script-Type" content="text/javascript">
-    <title>Rec10 Simple Web Interface ver.0.7.0 iEPGデータ表示</title>
-    <script src="./dojo/dojo/dojo.js" djConfig="parseOnLoad:true">
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Style-Type" content="text/css">
+        <meta http-equiv="Content-Script-Type" content="text/javascript">
+        <title>Rec10 Simple Web Interface ver.0.7.0 iEPGデータ表示</title>
+        <script src="./dojo/dojo/dojo.js" djConfig="parseOnLoad:true">
         </script>
         <!-- テーマの読み込み -->
         <style type="text/css">
             dojo.require("dijit.form.Button");
             dojo.require("dijit.form.TextBox");
             dojo.require("dojo.data.ItemFileWriteStore");
-            dojo.require("dijit.form.ValidationTextBox");
             dojo.require("dojox.data.CsvStore");
             dojo.require("dijit.form.TextBox");
-            dojo.require("dojox.grid.cells.dijit")
+            dojo.require("dojox.grid.Selection");
             var iepgstore = new dojox.data.CsvStore({url:'./iepgdatum.csv'});
-            //var iepgStructure=[
-            //    {name:"ID",field:"id",width:"30px"},
-            //    {name:"チャンネル",field:"name",width:"200px"},
-            //    {name:"chtxt",field:"chtxt",width:"100px"}
-            //]
-            function changeGrid(grid){
-                var s=dijit.byId("iepgGrid").store.getValue(dijit.byId("iepgGrid").getItem(grid.rowIndex),"id");
-                var str=dijit.byId("iepg_delnum").value;
-                str=str+","+s;
-                dijit.byId("iepg_delnum").setValue(str);
-            };
-            dojo.addOnLoad(function(){
-                dojo.connect(dijit.byId("iepgGrid"),"onRowClick",changeGrid);
-                dojo.connect(dijit.byId("del"),"onClick",function(e){
-                    dijit.byId("MainForm").submit();
-                });
-            });
+            function click(){
+                var items=dijit.byId("iepgGrid").selection.getSelected();
+                var str="";
+                for (i=0;i<items.length;i++){
+                    var s=dijit.byId("iepgGrid").store.getValue(items[i],"id");
+                    str=str+s+",";
+                }
+                dijit.byId("iepgdelnum").setValue(str);
+            }
         </script>
-  </head>
-  <body class="tundra">
-    <div dojoType="dijit.form.Form" action="rec10web.py" onExecute="this.submit()" id="MainForm">
-        <h1>Rec10 Simple Web Interface ver.0.7.0 iEPGデータ表示</h1><br>
-        <table dojoType="dojox.grid.DataGrid"
-            id="iepgGrid"
-            jsid="iepgGrid"
-            store="iepgstore"
-            query="{id:'*'}"
-            autoHeight="true"
-            width="100%"
-            autoHeight="true"
-            autoWidth="true"
-            clientSort="true"
-            onRowClick="changeGrid"
-            >
-            <thead>
-                <tr>
-                    <th field="id" width="30px">ID</th>
-                    <th field="name" width="200px">チャンネル</th>
-                    <th field="chtxt" width="100px">chtxt</th>
-                </tr>
-            </thead>
-        </table>
+    </head>
+    <body class="tundra">
+        <div dojoType="dijit.form.Form" action="rec10web.py" onExecute="this.submit()">
+            <h1>Rec10 Simple Web Interface ver.0.7.0 iEPGデータ表示</h1><br>
+            <table dojoType="dojox.grid.DataGrid"
+                   id="iepgGrid"
+                   jsid="iepgGrid"
+                   store="iepgstore"
+                   query="{id:'*'}"
+                   autoHeight="true"
+                   width="100%"
+                   autoHeight="true"
+                   autoWidth="true"
+                   clientSort="true"
+                   onClick="click"
+                   >
+                <thead>
+                    <tr>
+                        <th field="id" width="30px">ID</th>
+                        <th field="name" width="200px">チャンネル</th>
+                        <th field="chtxt" width="100px">chtxt</th>
+                    </tr>
+                </thead>
+            </table>
+            <div dojoType="dijit.form.Button" type="submit">DEL</div>
+            <div name="exec"
+                 dojoType="dijit.form.TextBox"
+                 value="iepg-del"
+                 style="display:none">
+            </div>
+            <div dojoType="dijit.form.TextBox"
+                 name="iepgdelnum"
+                 id="iepgdelnum"
+                 value=""
+                 style="display:none">
+            </div>
         </div>
-        <div dojoType="dijit.form.Button" type="submit" id="del">DEL</div>
-        <div name="exec"
-             dojoType="dijit.form.ValidationTextBox"
-             value="iepg-del"
-             style="display:none">
-        </div>
-        <div name="iepg_delnum:"
-             id="iepg_delnum"
-             dojoType="dijit.form.TextBox"
-             value=""
-             style="display:none">
-        </div>
-    </div>
-  </body>
+    </body>
 </html>
index f8bc820..b6a1e66 100644 (file)
@@ -273,6 +273,11 @@ def readiEPGshow():
     ret=f.read()
     f.close()
     return ret
+def get_fin(string,refreshurl):
+    htmdate=readRecFinisSimple()
+    htmdate=htmdate.replace('<!--text_for_replace_fin//-->',string)
+    htmdate=htmdate.replace('<!--url_for_replace_fin//-->',refreshurl)
+    return htmdate
 def mode_iepg_add(station):
     htmdate=readiEPGadd()
     htmdate=htmdate.replace("<!--text_for_replace_chtxt_input//-->",getchtxt())
@@ -280,14 +285,25 @@ def mode_iepg_add(station):
     htmdate=htmdate.replace("<!--iepg_title-value//-->",station)
     return htmdate
 def mode_iepg_fin():
-    htmdate=readiEPGfin()
-    return htmdate
+    s="epgデータの追加を完了しました。<br>\n録画を行う場合はもう一度おねがいします。<br>"
+    u="rec10web.py?exec=iepg-show"
+    return get_fin(s,u)
 def mode_iepg_show():
     htmdate=readiEPGshow()
     return htmdate
 def mode_schedule():
     htmdate=readRecSchedule()
     return htmdate
+def mode_recfin():
+    s="予約が終了しました。移動します。"
+    u="rec10web.py?exec=schedule"
+    return get_fin(s,u)
+def mode_recover():
+    s="予約が終了しました。移動します。"
+    u="rec10web.py?exec=schedule"
+    return get_fin(s,u)
+def mode_del():
+    ""
 def mode_edit():
     editnum=exect.replace("edit:","")
     htmdate= readHtmlEdit()
@@ -416,7 +432,7 @@ if f.getfirst('type')=="keyday":
     if dayt:
         rett=rett+reserv_recday(title, chtxt, btime, etime, deltahour, opts, deltaday, dayt)
     if rett=="":
-        htmdate=readRecFinisSimple()
+        htmdate=mode_recfin()
     else:
         htmdate=readRecFinisOver()
     chtxt=""
@@ -424,7 +440,7 @@ if f.getfirst('type')=="keyday":
 if (chtxt != "")and(title != "")and(btime!="")and(etime!="")and(opts!="")and(exect=="yes"):
     restxt=reserv(type, title, chtxt, btime, etime, deltahour, opts, deltaday)
     if restxt=="":
-        htmdate=readRecFinisSimple()
+        htmdate=mode_recfin()
     elif restxt=="over":
         htmdate=readRecFinisOver()
     exect=""
@@ -432,7 +448,7 @@ if (chtxt != "")and(title != "")and(btime!="")and(etime!="")and(opts!="")and(re.
     editnum=exect.replace("edit-exec:","")
     restxt=change_reserv(editnum,type, title, chtxt, btime, etime, deltahour, opts, deltaday)
     if restxt=="":
-        htmdate=readRecFinisSimple()
+        htmdate=mode_recfin()
     elif restxt=="over":
         htmdate=readRecFinisOver()
     exect=""
index 3f24689..beecb2c 100644 (file)
@@ -8,7 +8,7 @@
         <link href="./dojo/dojox/grid/_grid/Grid.css" rel="stylesheet" type="text/css">
         <link href="./dojo/dojox/grid/_grid/tundraGrid.css" rel="stylesheet" type="text/css">
         <title>Rec10Web Schedule管理</title>
-        <script type="text/javascript" src="../dojo/dojo.js" djConfig="parseOnLoad: true"></script>
+        <script type="text/javascript" src="./dojo/dojo.js" djConfig="parseOnLoad: true"></script>
         <script type="text/javascript">
             <!--
             dojo.require('dojox.grid.Grid');