// // shinGETsu - P2P anonymous BBS // // 新月リダイレクタ // // (c) FukTommy // Released under the Creative Commons License // http://creativecommons.org/licenses/by/2.0/jp/ // $Id: shingetsu.js,v 1.3 2005/01/23 17:08:50 fuktommy Exp $ // // 使い方(1): // 次のようなHTMLファイルを作る: // // // // // // 次のように呼び出す: // shingetsu.html // shingetsu.html?list.cgi/P2P // // 使い方(2): // printForm(msg,path), hiddenForm(msg,path) を単独で呼び出す。 // あらかじめ readCookie() を呼んでおくこと。 // // 使い方(3): // hiddenFormLink(id,msg), hiddenFormEntity(id,msg,path) を単独で呼び出す。 // あらかじめ readCookie() を呼んでおくこと。 // // print〜の関数は複数回呼出したり、混ぜて使ったりできます。 // // 動作確認: // Mozilla Firefox 1.0 // Microsoft Internet Explorer 6.0 (古い版のみチェック済み) // // // 各種変数 // host = "fuktommy.ddo.jp"; port = 80; nForm = 0; // // クッキーを読み込み、変数を設定する // function readCookie() { buf = document.cookie + ";"; done = 0; while (! done) { done = 1; n = 0; ikey = buf.indexOf("=", 0); ival = buf.indexOf(";", ikey); if ((ikey >= 0) && (ival > 0)) { done = 0; key = buf.substr(0, ikey); val = buf.substr(ikey+1, ival-ikey-1); if (key == "shingetsu_host") { host = val; } else if (key == "shingetsu_port") { port = val; } buf = buf.substr(ival+1, buf.length); isp = buf.indexOf(" ", 0); while (isp == 0) { buf = buf.substr(1, buf.length); isp = buf.indexOf(" ", 0); } } } } // // クッキーを出力する // function printCookie(key, val) { day = new Date(); year = day.getYear(); if (year < 2000) { year += 1900; } day.setFullYear(year + 1); document.cookie = key + "=" + escape(val) +"; path=/; expires=" + day.toGMTString(); } // // ジャンプの動作 // function jump(id) { host = document.getElementById(id).host.value; port = document.getElementById(id).port.value; path = document.getElementById(id).path.value; path = path.substr(1, path.length); printCookie("shingetsu_host", host); printCookie("shingetsu_port", port); location.href = "http://" + host + ":" + port + "/" + path; } // // ジャンプ用のフォームを出力する // function printFormEntity(id, msg, path) { document.write('

'); document.write(msg + ": "); document.write('http://'); document.write(':'); document.write('/...'); document.write(''); document.write(''); document.write('

'); document.getElementById(id).host.value = host; document.getElementById(id).port.value = port; document.getElementById(id).path.value = path; } // // ジャンプ用のフォームを出力する(一式) // function printForm(msg, path) { id = "shingetsu" + nForm; printFormEntity(id, msg, path); nForm++; } // // リンクの表示 // function printLink() { document.write(''); } // // メッセージの表示 // function printMotd() { document.write('

次の条件に同意した方のみ新月ネットワークに参加できます。

'); document.write('
    '); document.write('
  1. 投稿した記事に使用、改変または再配布の条件を記述するか、'); document.write('それらを無制限に認めること。
  2. '); document.write('
  3. 違法行為に使わないこと。特に著作権を尊重すること。
  4. '); document.write('
  5. 荒らし行為をしないこと。
  6. '); document.write('
'); } // // 表示のON/OFF // function popup(id) { if (document.getElementById(id).style.display == "none") { document.getElementById(id).style.display = "" } else { document.getElementById(id).style.display = "none" } } // // 隠し表示(リンク) // function hiddenFormLink(id, msg) { document.write('' + msg + ''); } // // 隠し表示(フォーム) // function hiddenFormEntity(id, msg, path) { printFormEntity(id, msg, path); document.getElementById(id).style.display = "none"; } // // 隠し表示 // function hiddenForm(msg, path) { id = "shingetsu" + nForm; document.write("

"); hiddenFormLink(id, msg); document.write("

"); hiddenFormEntity(id, msg, path); } // // 一式の表示 // function printBody() { readCookie(); printForm("ゲートウェイの選択", location.search); printLink(); printMotd(); }