" + 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(/\n";
s += "<\/div>\n";
}
//ソース置換
var regObj, rep = new Array(
" style=",
" bgcolor=",
" background=",
" onmouseout=",
" onmouseover=",
" onmousedown=",
" onmouseup=",
" onclick=",
" onkeypress=",
" onchange=",
" onselect=",
" onload=",
" onunload=",
" onabort=",
" onerror=",
" onfocus=",
" onblur=",
" onsubmit=",
" onreset=",
"/gi, "//");
html = html.replace(/<\/script>/gi, "<\/script>-->");
html = html.replace(//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();
}