// // 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.2 2005/01/21 12:33:00 fuktommy Exp $ // // 使い方: // 次のようなHTMLファイルを作る: // // // // // // 次のように呼び出す: // shingetsu.html // shingetsu.html?list.cgi/P2P // // 動作確認: // Mozilla Firefox 1.0 // Microsoft Internet Explorer 6.0 (古い版のみチェック済み) // // // 各種変数 // host = "fuktommy.ddo.jp"; port = 80; // // クッキーを読み込み、変数を設定する // 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 == "shost") { host = val; } else if (key == "sport") { 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) +"; " + "expires=" + day.toGMTString(); } // // ジャンプの動作 // function jump() { host = document.jump.host.value; port = document.jump.port.value; path = document.jump.path.value; path = path.substr(1, path.length); printCookie("shost", host); printCookie("sport", port); location.href = "http://" + host + ":" + port + "/" + path; } // // ジャンプ用のフォームを出力する // function printForm(msg, path) { document.write('

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

'); document.jump.host.value = host; document.jump.port.value = port; document.jump.path.value = path; } // // リンクの表示 // 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('
'); } // // 一式の表示 // function printBody() { readCookie(); printForm("ゲートウェイの選択", location.search); printLink(); printMotd(); }