// coerce // function Coerce() { var s = ""; var html, i; s += "< link rel='stylesheet' type='text/css' href='coerce.css'>\n"+ "< base href='" + ext.location.href + "'>\n"+ "< body>\n"; //フレーム有オプション var frm = ext.top.frames; var frmDoc = ext.top.document; if (frm.length) { //対象ページがShiftJISでなかった時の文字化け対策 var msg = { "このページにはフレームが使われています。": "%u3053%u306E%u30DA%u30FC%u30B8%u306B%u306F%u30D5%u30EC%u30FC%u30E0%u304C%u4F7F%u308F%u308C%u3066%u3044%u307E%u3059%u3002", "(<iframe>が含まれています)": "%uFF08%26lt%3Biframe%26gt%3B%u304C%u542B%u307E%u308C%u3066%u3044%u307E%u3059%uFF09", "(フレーム名:": "%28%u30D5%u30EC%u30FC%u30E0%u540D%uFF1A", "なし": "%u306A%u3057", "<noframes>の内容": "%26lt%3Bnoframes%26gt%3B%u306E%u5185%u5BB9" } for (i in msg) msg[i] = unescape(msg[i]); s += "
"; s += "" + msg["このページにはフレームが使われています。"]; if (frmDoc.getElementsByTagName("iframe").length) s += msg["(<iframe>が含まれています)"]; s += "<\/strong>
\n"; for (i = 0; i < frm.length; i++) s += "" + frm[i].location.href + msg["(フレーム名:"] + (frm[i].name ? frm[i].name : msg["なし"]) + ")<\/a>
\n"; html = frmDoc.body.innerHTML; if (frmDoc.getElementsByTagName("noframes").length) { s += "

" + msg["<noframes>の内容"] + "<\/strong><\/p>\n"; s += html.replace(//gi, "//"); html = html.replace(/<\/script>/gi, "<\/script>-->"); html = html.replace(/<noscript/gi, "<span class='noscriptDecoration'><Xnoscript"); html = html.replace(/<\/noscript>/gi, "<\/noscript><\/span>"); s += html; s += "<\/body>"; try { //IEが調子悪い時に起きる例外エラーへの対処 var win = ext.open(); with (win.document) { open(); write(s); close(); title = ext.top.document.title; } win.focus(); closeSelect(); } catch(e) { err(e); } } var someWinObj; // ウィンドウ複製 // function SomeWin() { //未使用 if (someWinObj) { //フレーム有オプション if (ext.top.frames.length) { var i = 0, frm = someWinObj.top.document.getElementsByTagName("frame"); for (; i < frm.length; i++) { frm[i].src = ext.top.frames[i].location.href; } } someWinObj.focus(); closeSelect(); } else { try { someWinObj = window.open(ext.top.location.href); closeSelect(); //setTimeout("SomeWin()", 500); //windowオブジェクトが生成されるまでの時間稼ぎ } catch(e) { err(e); } } } // サーバーチェンジ // function change(selThis) { try { var svr = selThis.value; selThis.selectedIndex = 0; var l = ext.top.location, host = l.host, lh = l.href; if (lh.match(/file:\/\/(|localhost)\//)) lh = unescape(lh.replace(/file:\/\/(|localhost)\//, "")); //"file://localhost/"を削除 if ((l.protocol === "file:" && lh.substr(0, 2) === svr) || host === svr) //"F:" === "F:" return; else if (l.protocol === "file:") lh = lh.replace(lh.substr(0, 2), svr); //"F:/xxx/" -> "http://svr.jp/xxx/" else lh = lh.replace("http://" + host, svr); //"http://svr.jp/xxx/" -> "F:/xxx/" if (svr.match(/^[a-zA-Z]\:/)) { //ローカル行き var q = lh.match(/[?#].+/); //クエリ退避 lh = lh.match(/^[^?#]+/)[0]; //クエリカット if (lh.charAt(lh.length -1) === "/") { //ファイル名がない try { lh += ext.document.getElementsByName("filename")[0].content; } catch (e) { lh += "index.html"; } } if (q) lh += q[0]; } l.href = lh; closeSelect(); } catch(e) { err(e); } } // エクスプローラの起動 // function Explorer() { (new ActiveXObject("Shell.Application")).ShellExecute("explorer", "F:\\"); closeSelect(); } // このページのフォルダを開く // function folderOpen() { try { var path = ext.location.href; var host = /http:\/\/(127.0.0.1|cts.velvet.jp)/; if (ext.location.href.match(host)) path = path.replace(host, "F:"); else if (ext.location.protocol === "file:") path = path.replace("file:///", ""); else return; path = path.replace(/[?#].+/, "").substring(0, path.lastIndexOf("/")).replace(/\//g, "\\"); (new ActiveXObject("Shell.Application")).ShellExecute("explorer", path); closeSelect(); } catch (e) { err(e); } } // ウィンドウを閉じる // function closeSelect() { if (document.all.close.checked) window.close(); } // エラーメッセージ // function err(e) { window.alert("予期せぬ、あるいは不可抗力のエラーが発生しました。\n安全のためスクリプトの実行を中断します。\n\nError Name: " + e.name + "\nError Message: " + e.message + "\nError Number: " + e.number); window.close(); }