情報学部 | 菅沼ホーム |
<!DOCTYPE HTML> <HTML> <HEAD> <TITLE>JavaScript プレゼンテーションシステム</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <LINK REL="stylesheet" TYPE="text/css" HREF="../master.css"> </HEAD> <BODY CLASS="white"> <IFRAME ID="sheet" NAME="sheet" SRC="" WIDTH="79%" HEIGHT="700px" STYLE="margin: 0px; padding: 0px; float: right"></IFRAME> <IFRAME ID="list" NAME="list" SRC="list.htm" WIDTH="20%" HEIGHT="650px" STYLE="margin: 0px; padding: 0px; float: left"></IFRAME> <IFRAME ID="message" NAME="message" SRC="" WIDTH="20%" HEIGHT="50px" STYLE="margin: 0px; padding: 0px; float: left"></IFRAME> </BODY> </HTML>
01 <!DOCTYPE HTML> 02 <HTML> 03 <HEAD> 04 <TITLE>プレゼンテーションシステム</TITLE> 05 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 06 <LINK REL="stylesheet" TYPE="text/css" HREF="../master.css"> 07 <SCRIPT TYPE="text/javascript"> 08 function disp(part) 09 { 10 var str = eval('document.getElementById("' + part + '").style'); 11 if (str.display) 12 str.display = ""; 13 else 14 str.display = "none"; 15 } 16 17 function disp_p(sw, page) 18 { 19 if (sw == 0) { 20 document.set.number.value = page; 21 document.set.submit(); 22 } 23 else { 24 var str = document.getElementById("URL").value; 25 parent.sheet.location.replace(str); 26 document.set.number.value = str; 27 document.set.submit(); 28 } 29 } 30 </SCRIPT> 31 </HEAD> 32 <BODY STYLE="font-size:90%; background-color:#ffffcc"> 33 <P CLASS="center"><B>プレゼンテーション・システム</B></P> 34 35 <P CLASS="center"> 36 <B>指定 URL</B> 37 <INPUT TYPE="button" VALUE="OK" STYLE="font-size: 80%" onClick="disp_p(1, '')"><BR> 38 <INPUT ID="URL" TYPE="text" NAME="url" SIZE="25" VALUE=""> 39 </P> 40 41 <A HREF="white.php" TARGET="sheet" onClick="disp_p(0, 'white/white.php')">白板</A> 42 43 <P> 44 <SPAN onClick="disp('1_sho')" TITLE="クリックによって,表示/非表示の切り替え" CLASS="link">1.第1章</SPAN> 45 <DIV ID="1_sho" STYLE="display: none"> 46 <A HREF="../sheet/s1/sheet001.htm" TARGET="sheet" onClick="disp_p(0, 's1/sheet001.htm')">sheet001</A><BR> 47 <A HREF="../sheet/s1/sheet002.htm" TARGET="sheet" onClick="disp_p(0, 's1/sheet002.htm')">sheet002</A> 48 </DIV> 49 <P> 50 <SPAN onClick="disp('2_sho')" TITLE="クリックによって,表示/非表示の切り替え" CLASS="link">2.第2章</SPAN> 51 <DIV ID="2_sho" STYLE="display: none"> 52 <A HREF="../sheet/s2/sheet001.htm" TARGET="sheet" onClick="disp_p(0, 's2/sheet001.htm')">sheet001</A><BR> 53 <A HREF="../sheet/s2/sheet002.htm" TARGET="sheet" onClick="disp_p(0, 's2/sheet002.htm')">sheet002</A> 54 </DIV> 55 <FORM ACTION="control.php" NAME="set" METHOD="post" TARGET="message"> 56 <INPUT TYPE="hidden" NAME="number" VALUE="-1"> 57 </FORM> 58 </BODY> 59 </HTML>
01 <?php 02 $num = $_POST['number']; 03 $out = fopen("../sheet/number", "wb"); 04 fwrite($out, $num); 05 fclose($out); 06 ?> 07 <!DOCTYPE HTML> 08 <HTML> 09 <HEAD> 10 <TITLE>結果</TITLE> 11 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 12 </HEAD> 13 <BODY> 14 <H3><?php echo $num; ?> を受け取りました</H3> 15 </BODY> 16 </HTML>
001 <!DOCTYPE HTML> 002 003 <HTML> 004 005 <HEAD> 006 007 <TITLE>白板</TITLE> 008 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 009 <LINK REL="stylesheet" TYPE="text/css" HREF="../master.css"> 010 011 <?php // 保存してある状態を呼び出し 012 $n = "0"; 013 $x = ""; 014 $y = ""; 015 $tx = ""; 016 $in = fopen("../sheet/white/data", "rb"); 017 if (filesize("../sheet/white/data") > 0) { 018 $str = fread($in, filesize("../sheet/white/data")); 019 $n = strtok($str, ","); 020 if (intval($n) > 0) { 021 $x = strtok(","); 022 for ($i1 = 1; $i1 < intval($n); $i1++) 023 $x = $x.",".strtok(","); 024 $y = strtok(","); 025 for ($i1 = 1; $i1 < intval($n); $i1++) 026 $y = $y.",".strtok(","); 027 } 028 $tok = strtok(","); 029 if ($tok) { 030 $i1 = 0; 031 $tt = strtok($tok, "\n\r"); 032 while ($tt) { 033 if ($i1 == 0) 034 $tx = $tt; 035 else 036 $tx = $tx."\\n".$tt; 037 $i1++; 038 $tt = strtok("\n\r"); 039 } 040 } 041 } 042 fclose($in); 043 ?> 044 045 <SCRIPT TYPE="text/javascript"> 046 blush = false; // お絵かき用ブラシの状態(絵を描けない状態) 047 x_old = -1; 048 y_old = -1; 049 x_base = -1; 050 y_base = -1; 051 canvas = null; 052 ctx = null; 053 x = new Array(); 054 y = new Array(); 055 n = 0; 056 // 初期設定 057 function draw() { 058 canvas = document.getElementById('canvas_e'); 059 canvas.width = 800; // キャンバス要素の幅 060 canvas.height = 500; // キャンバス要素の高さ 061 x_base = canvas.offsetLeft; // キャンバスの左上のx座標 062 y_base = canvas.offsetTop; // キャンバスの左上のy座標 063 ctx = canvas.getContext('2d'); // キャンバスからコンテキストを取得 064 ctx.lineWidth = 3; // 線の太さ 065 // 描画 066 n = parseInt(<?php echo $n; ?>); 067 if (n > 0) { 068 var str = "<?php echo $x; ?>"; 069 x = str.split(","); 070 str = "<?php echo $y; ?>"; 071 y = str.split(","); 072 blush = false; 073 ctx.beginPath(); 074 ctx.moveTo(x[0], y[0]); 075 for (var i1 = 1; i1 < n; i1++) { 076 if (x[i1] >= 0) 077 ctx.lineTo(x[i1], y[i1]); 078 else { 079 ctx.stroke(); 080 i1++; 081 if (i1 < n) { 082 ctx.beginPath(); 083 ctx.moveTo(x[i1], y[i1]); 084 } 085 } 086 } 087 ctx.stroke(); 088 } 089 // テキスト 090 var text = "<?php echo $tx; ?>"; 091 var tt = text.replace(/\\n/g, "\n"); 092 if (text.length > 0) { 093 document.getElementById("text").value = tt; 094 var str = tt.split("\n"); 095 if (str.length > 0) { 096 ctx.font = "20px 'MS ゴシック'"; 097 var ph = 20; 098 for (var i1 = 0; i1 < str.length; i1++) { 099 ctx.fillText(str[i1], 10, ph); 100 ph += 20; 101 } 102 } 103 } 104 } 105 // イベント処理 106 function m_move(event) { // マウス移動イベント 107 if (blush) { 108 if (navigator.appName.indexOf("Explorer") >= 0) { 109 x_now = event.x - x_base; 110 y_now = event.y - y_base; 111 } 112 else { 113 x_now = event.pageX - x_base; 114 y_now = event.pageY - y_base; 115 } 116 x[n] = x_now; 117 y[n] = y_now; 118 ctx.beginPath(); 119 ctx.moveTo(x_old, y_old); 120 ctx.lineTo(x_now, y_now); 121 ctx.stroke(); 122 n++; 123 x_old = x_now; 124 y_old = y_now; 125 } 126 } 127 128 function m_down(event) { // マウスボタン押下イベント 129 if (!blush) { 130 if (navigator.appName.indexOf("Explorer") >= 0) { 131 x_old = event.x - x_base; 132 y_old = event.y - y_base; 133 } 134 else { 135 x_old = event.pageX - x_base; 136 y_old = event.pageY - y_base; 137 } 138 x[n] = x_old; 139 y[n] = y_old; 140 n++; 141 blush = true; // 描ける状態 142 } 143 } 144 145 function m_up(event) { // マウスボタン離されたイベント 146 if (blush) { 147 if (n == 0 || x[n-1] >= 0) { 148 x[n] = -1; 149 y[n] = -1; 150 n++; 151 } 152 blush = false; // 描けない状態 153 } 154 } 155 // 領域のクリア 156 function clear_text() // 文字 157 { 158 document.getElementById("text").value = ""; 159 ctx.clearRect(0, 0, canvas.width, canvas.height); 160 if (n > 0) { 161 blush = false; 162 ctx.beginPath(); 163 ctx.moveTo(x[0], y[0]); 164 for (var i1 = 1; i1 < n; i1++) { 165 if (x[i1] >= 0) 166 ctx.lineTo(x[i1], y[i1]); 167 else { 168 ctx.stroke(); 169 i1++; 170 if (i1 < n) { 171 ctx.beginPath(); 172 ctx.moveTo(x[i1], y[i1]); 173 } 174 } 175 } 176 ctx.stroke(); 177 } 178 return false; 179 } 180 181 function clear_fig() // 画像 182 { 183 ctx.clearRect(0, 0, canvas.width, canvas.height); 184 n = 0; 185 str = (document.getElementById("text").value).split("\n"); 186 if (str.length > 0) { 187 ctx.font = "20px 'MS ゴシック'"; 188 var ph = 20; 189 for (var i1 = 0; i1 < str.length; i1++) { 190 ctx.fillText(str[i1], 10, ph); 191 ph += 20; 192 } 193 } 194 return false; 195 } 196 197 function clear_all() // すべて 198 { 199 document.getElementById("text").value = ""; 200 ctx.clearRect(0, 0, canvas.width, canvas.height); 201 n = 0; 202 return false; 203 } 204 // 描画領域へテキストエリアの文字列を設定 205 function set_text(str) 206 { 207 if (str == "") 208 str = (document.getElementById("text").value).split("\n"); 209 ctx.font = "20px 'MS ゴシック'"; 210 var ph = 20; 211 for (var i1 = 0; i1 < str.length; i1++) { 212 ctx.fillText(str[i1], 10, ph); 213 ph += 20; 214 } 215 return false; 216 } 217 // データを送信し保存 218 function trans(form) 219 { 220 form.n.value = n; 221 var xx = new Array(); 222 var yy = new Array(); 223 for (var i1 = 0; i1 < n; i1++) { 224 xx[i1] = x[i1]; 225 yy[i1] = y[i1]; 226 } 227 form.x.value = xx; 228 form.y.value = yy; 229 form.t.value = document.getElementById("text").value; 230 form.submit(); 231 } 232 </SCRIPT> 233 234 </HEAD> 235 236 <BODY CLASS="color" onLoad="draw()"> 237 238 <FORM ACTION="keep.php" METHOD="post" TARGET="message"> 239 <P CLASS="center"> 240 <BUTTON STYLE="font-size: 90%; background-color: yellow" onClick="return clear_fig()">画像削除</BUTTON> 241 <BUTTON STYLE="font-size: 90%; background-color: yellow" onClick="return clear_text()">テキスト削除</BUTTON> 242 <BUTTON STYLE="font-size: 90%; background-color: yellow" onClick="return clear_all()">すべて削除</BUTTON> 243 <BUTTON STYLE="font-size: 90%; background-color: pink" onClick="trans(this.form)">送信</BUTTON> 244 <INPUT TYPE="hidden" NAME="n" ID="n" VALUE=""> 245 <INPUT TYPE="hidden" NAME="x" ID="x" VALUE=""> 246 <INPUT TYPE="hidden" NAME="y" ID="y" VALUE=""> 247 <INPUT TYPE="hidden" NAME="t" ID="t" VALUE=""> 248 </P> 249 </FORM> 250 <DIV CLASS="center"> 251 <CANVAS ID="canvas_e" STYLE="background-color: #ffffff;" WIDTH="800" HEIGHT="500" onMouseMove="m_move(event)" onMouseDown="m_down(event)" onMouseUp="m_up(event)"></CANVAS><BR><BR> 252 <TEXTAREA ID="text" COLS="65" ROWS="10" STYLE="font-size: 100%" onBlur="set_text('')"></TEXTAREA> 253 </DIV> 254 255 </BODY> 256 257 </HTML>
<!DOCTYPE HTML> <HTML> <HEAD> <TITLE>プレゼンテーション</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <LINK REL="stylesheet" TYPE="text/css" HREF="../master.css"> </HEAD> <BODY CLASS="white"> <IFRAME ID="control" NAME="control" SRC="control.php" WIDTH="100%" HEIGHT="0px" STYLE="margin: 0px; padding: 0px"></IFRAME> <IFRAME ID="page" NAME="page" SRC="gakuseki.htm" WIDTH="100%" HEIGHT="700px" STYLE="margin: 0px; padding: 0px"></IFRAME> </BODY> </HTML>
01 <!DOCTYPE HTML> 02 03 <HTML> 04 05 <HEAD> 06 07 <TITLE>学籍番号</TITLE> 08 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 09 <LINK REL="stylesheet" TYPE="text/css" HREF="../master.css"> 10 <SCRIPT TYPE="text/javascript"> 11 function gaku_no_set(form1, form2) 12 { 13 var sw = 0; 14 if (form1.no.value.length < 7) { 15 sw = 1; 16 alert("学籍番号,または,メールアドレスを「正しく」入力して下さい!"); 17 } 18 else { 19 if (form1.no.value.length != 7) { 20 if (form1.no.value.indexOf("@") <= 0 || form1.no.value.indexOf(".") <= 0) { 21 sw = 1; 22 alert("メールアドレスを 「正しく」 入力して下さい!"); 23 } 24 } 25 else { 26 if (isNaN(form1.no.value)) { 27 sw = 1; 28 alert("学籍番号を「正しく」入力して下さい!"); 29 } 30 } 31 } 32 if (sw == 0) { 33 form2.no.value = form1.no.value; 34 form2.now.value = "wait.htm"; 35 parent.page.location.replace("wait.htm"); 36 } 37 } 38 </SCRIPT> 39 40 </HEAD> 41 42 <BODY CLASS="color"> 43 <P CLASS="center"> 44 <SPAN CLASS="font15">学籍番号を半角で入力してください</SPAN><BR> 45 <SPAN CLASS="font15">(外部の方は,E-mailアドレスを入力してください)</SPAN> 46 </P> 47 <FORM> 48 <P CLASS="center"> 49 <LABEL FOR="id_no">学籍番号: </LABEL> 50 <INPUT TYPE="text" NAME="no" ID="id_no" SIZE="20" STYLE="font-size: 100%"> 51 <INPUT TYPE="button" VALUE="送信" STYLE="font-size: 90%" onClick="gaku_no_set(this.form, parent.control.document.gakuseki_no)"><BR><BR> 52 <INPUT TYPE="reset" VALUE="リセット" STYLE="font-size: 90%"> 53 </P> 54 </FORM> 55 </BODY> 56 57 </HTML>
<!DOCTYPE HTML> <HTML> <HEAD> <TITLE>プレゼンテーション</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <LINK REL="stylesheet" TYPE="text/css" HREF="../master.css"> </HEAD> <BODY CLASS="color"> <H1>しばらくお待ち下さい!</H1> </BODY> </HTML>
01 <!DOCTYPE HTML> 02 <HTML> 03 <HEAD> 04 <TITLE>プログラミング</TITLE> 05 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 06 <LINK REL="stylesheet" TYPE="text/css" HREF="../master.css"> 07 </HEAD> 08 <BODY CLASS="white"> 09 <form name="gakuseki_no"> 10 <input type="text" name="no" value=""> 11 <input type="text" name="now" value="wait.htm"> 12 <input type="text" name="target" value="wait.htm"> 13 </form> 14 <?php 15 if (strlen($_GET['no']) > 0) { 16 $in = fopen("number", "rb"); 17 $target = fread($in, filesize("number")); 18 fclose($in); 19 ?> 20 <SCRIPT TYPE="text/javascript"> 21 gakuseki_no.no.value = <?php echo "'".$_GET['no']."'"; ?>; 22 gakuseki_no.now.value = <?php echo "'".$_GET['now']."'"; ?>; 23 gakuseki_no.target.value = <?php echo "'".$target."'"; ?>; 24 if (gakuseki_no.target.value != "" && (gakuseki_no.now.value != gakuseki_no.target.value)) { 25 gakuseki_no.now.value = gakuseki_no.target.value; 26 parent.page.location.replace(gakuseki_no.target.value); 27 } 28 </SCRIPT> 29 <?php 30 } 31 ?> 32 <SCRIPT TYPE="text/javascript"> 33 timerID = setInterval("timer()", 10000); 34 function timer() 35 { 36 if (gakuseki_no.no.value != "") { 37 clearInterval(timerID); 38 location.replace("control.php?no="+gakuseki_no.no.value+"&now="+gakuseki_no.now.value); 39 } 40 } 41 </SCRIPT> 42 </BODY> 43 </HTML>
<!DOCTYPE HTML> <HTML> <HEAD> <TITLE>白板</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <LINK REL="stylesheet" TYPE="text/css" HREF="../../master.css"> <?php // 保存してある状態を呼び出し $n = "0"; $x = ""; $y = ""; $tx = ""; $in = fopen("data", "rb"); if (filesize("data") > 0) { $str = fread($in, filesize("data")); $n = strtok($str, ","); if (intval($n) > 0) { $x = strtok(","); for ($i1 = 1; $i1 < intval($n); $i1++) $x = $x.",".strtok(","); $y = strtok(","); for ($i1 = 1; $i1 < intval($n); $i1++) $y = $y.",".strtok(","); } $tok = strtok(","); if ($tok) { $i1 = 0; $tt = strtok($tok, "\n\r"); while ($tt) { if ($i1 == 0) $tx = $tt; else $tx = $tx."\\n".$tt; $i1++; $tt = strtok("\n\r"); } } } fclose($in); ?> <SCRIPT TYPE="text/javascript"> blush = false; // お絵かき用ブラシの状態(絵を描けない状態) x_old = -1; y_old = -1; x_base = -1; y_base = -1; canvas = null; ctx = null; x = new Array(); y = new Array(); n = 0; // 初期設定 function draw() { canvas = document.getElementById('canvas_e'); canvas.width = 800; // キャンバス要素の幅 canvas.height = 500; // キャンバス要素の高さ x_base = canvas.offsetLeft; // キャンバスの左上のx座標 y_base = canvas.offsetTop; // キャンバスの左上のy座標 ctx = canvas.getContext('2d'); // キャンバスからコンテキストを取得 ctx.lineWidth = 3; // 線の太さ // 描画 n = parseInt(<?php echo $n; ?>); if (n > 0) { var str = "<?php echo $x; ?>"; x = str.split(","); str = "<?php echo $y; ?>"; y = str.split(","); blush = false; ctx.beginPath(); ctx.moveTo(x[0], y[0]); for (var i1 = 1; i1 < n; i1++) { if (x[i1] >= 0) ctx.lineTo(x[i1], y[i1]); else { ctx.stroke(); i1++; if (i1 < n) { ctx.beginPath(); ctx.moveTo(x[i1], y[i1]); } } } ctx.stroke(); } // テキスト var text = "<?php echo $tx; ?>"; var tt = text.replace(/\\n/g, "\n"); if (text.length > 0) { var str = tt.split("\n"); if (str.length > 0) { ctx.font = "20px 'MS ゴシック'"; var ph = 20; for (var i1 = 0; i1 < str.length; i1++) { ctx.fillText(str[i1], 10, ph); ph += 20; } } } } </SCRIPT> </HEAD> <BODY CLASS="color" onLoad="draw()"> <DIV CLASS="center"> <BUTTON STYLE="font-size: 90%; background-color: pink" onClick="JavaScript: location.reload();">更新</BUTTON><BR> <CANVAS ID="canvas_e" STYLE="background-color: #ffffff;" WIDTH="800" HEIGHT="500"></CANVAS> </DIV> </BODY> </HTML>
<!DOCTYPE HTML> <HTML> <HEAD> <TITLE>プレゼンテーション</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <LINK REL="stylesheet" TYPE="text/css" HREF="../master.css"> </HEAD> <BODY CLASS="white"> <IFRAME ID="control" NAME="control" SRC="control_n.php" WIDTH="100%" HEIGHT="0px" STYLE="margin: 0px; padding: 0px"></IFRAME> <IFRAME ID="page" NAME="page" SRC="wait.htm" WIDTH="100%" HEIGHT="700px" STYLE="margin: 0px; padding: 0px"></IFRAME> </BODY> </HTML>
<!DOCTYPE HTML> <HTML> <HEAD> <TITLE>プログラミング</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <LINK REL="stylesheet" TYPE="text/css" HREF="../master.css"> </HEAD> <BODY CLASS="white"> <form name="gakuseki_no"> <input type="text" name="now" value="wait.htm"> <input type="text" name="target" value="wait.htm"> </form> <?php $in = fopen("number", "rb"); $target = fread($in, filesize("number")); fclose($in); ?> <SCRIPT TYPE="text/javascript"> gakuseki_no.now.value = <?php echo "'".$_GET['now']."'"; ?>; gakuseki_no.target.value = <?php echo "'".$target."'"; ?>; if (gakuseki_no.target.value != "" && (gakuseki_no.now.value != gakuseki_no.target.value)) { gakuseki_no.now.value = gakuseki_no.target.value; parent.page.location.replace(gakuseki_no.target.value); } timerID = setInterval("timer()", 10000); function timer() { clearInterval(timerID); location.replace("control_n.php?now="+gakuseki_no.now.value); } </SCRIPT> </BODY> </HTML>
情報学部 | 菅沼ホーム |