execCode D backUp
[EXEC-D-DATA]

/* -------- 全てのファイルのエントリ -------- */
mainShow = (e, obj) => {
xmlObj = obj;
if(obj && e.match(/diary_editor.cgi\?oid=([0-9a-z\-]+);type=comments;id=(\d+)/)){
commentEditEntry(e, obj);
return false;
}
if(obj && obj.classList.contains("link_year")){
xhr(e, null, createLinks);
} else {
// 履歴のセット
cueComment = e.match(/#comments/) ? true : false;
if(obj && cueComment) obj.parentNode.classList.add("ins");
if(e.match(/(home\/|oid=)([0-9a-z\-]+)/)) cueUser = RegExp.$2;
xhr(e, null, mainShowEntry);
}
};


/* -------- 年度別以外 -------- */
mainShowEntry = e => {
let s = e.replace(/.+\x3cdiv id="main">/, "").
replace(/\x3c\/div>\t*\x3c\/div>\x3c\/body>.+/, "");
s = axRep(s);
s = createLine(s);
s = commentTagsRep(s);
s = s.replace(/\{\/visUser\/\}/g, e => "ようこそ、" +
(isLogin ? "<a href=\"/home/new-diary/main.html?user=" + FxDec["visUser"] +
"\">" + FxDec["visUser"] + "@eclat</a>さん、" : "") + " いらっしゃいませ");

if(e.match(/( id="A\d+") class="(C\d+")>\x3cdiv>/)){
let one = " " + RegExp.$2 + RegExp.$1;
s = s.replace(/(class="entry)"/, (e,e1) => e1 + one);
} else {
if(s.match(/^[\s\t]*\x3ch2>/)){
// 月別表示
s = monthPageRep(s);
if(xmlMonth != null){
xmlMonth.classList.remove("sect");
xmlMonth.classList.add("bef");
}
xmlMonth = xmlObj;
xmlObj.classList.remove("bef");
xmlObj.classList.add("sect");
} else {
// カテゴリ別の表示
// s = s.split("\x3chr />").reverse().join("");
}
}
if(isCue){ // 先行表示中
xmlObj = null;
echoMain(s);
cueLoop();
} else {
if(cueComment){
if(xmlObj){
const o = xmlObj.parentNode;
s = s.replace(/.+id="responses">/,"").replace(/\x3c\/div>[\t\s]*$/, "").
replace(/(href="\/home\/)([0-9a-z\-]+)\/(" target="_blank")/g,
"$1new-diary/main.html?user=$2$3").
replace(/(\/home\/[\w\-]+\/files\/[\w\-\._]+)\((\d)\)/g,
"\x3cimg src=\"$1\" alt=\"\" class=\"img-$2\" />");
setTimeout(() => {
echo(o, s);
o.classList.remove("ins"); }, 700
);
} else {
alert(s);
}
} else {
echoMain(s);
}
}
};

/* -------- リンクのフック -------- */
axRep = s => {
s = s.replace(/(class="entry_info">)Category : (<a href="\/cgi\-bin\/diary.cgi\?oid=)([a-z0-9\-]+);c=(\d+)/g,
"$1Posted by <span class=\"oid\">$3@eclat</span> : <span class=\"cate\">C$4</span> $2$3;c=$4");

s = s.replace(/\x3ca target="[^"]+" href="http:\/\/www.eclat.cc/g, "<a href=\"");

s = s.replace(/(class="[^"]+)(" href=")([^"]+)/g, (e0,e1,e2,e3) => {
return e3.match(/\/home\/[a-z0-9\-]+\/diary\/|\/cgi\-bin\/diary/) ?
e1 + " ax\" onclick=\"mainShow('" + e3 + "', this); return false" + e2 + e3 : e0;
});

s = s.replace(/(<a )(href=")([^"]+)/g, (e0,e1,e2,e3) => {
return e3.match(/\/home\/[a-z0-9\-]+\/diary\/|\/cgi\-bin\/diary/) ?
e1 + "class=\"ax\" onclick=\"mainShow('" + e3 + "', this); return false\" " + e2 + e3 : e0;
});
return s;
};

/* ------- メイン領域への書き込み ------- */
echoMain = s => {
if(xmlObj && xmlObj.className.match(/tb\-m(\d)/)){
const no = RegExp.$1 - 0;
if(no != mmCNT) dispChg(1, no);
}
if(mmCNT > 2 && !isF2) dispChg(1, 2);
if(isF2 && msCNT != 2) dispChg(0, 2);
const objNo = isF2 ? 3 : mmCNT;
const objPar = "ABCD".charAt(objNo);
s = s.replace(/(id="A)(\d+)(">[\t ]*<div class="entry_date">)/g,
(e0,e1,e2,e3) => e1 + e2 + e3 + "<span class=\"edit\" onclick=\"archiveUpdateEntry(" +
e2 + ", this, " + objNo + ")\">A" + e2 + "\x3c/span> at ");
s = s.replace(/(name="C\d+" id="C\d+" href="\/home\/)([\w\-]+)\/" target="_blank/g,
"$1new-diary/main.html?user=$2");

s = jsCodeRep(s);
s = cssCodeRep(s);
s = docCodeRep(s);
s = s.replace(/【(\d{4}.\d\d\/\d\d \d\d:\d\d)】/g,
"【<span class=\"dateIs\" onclick=\"parMove(this)\">$1</span>】");
s = s.replace(/(<img )src/g, (e0,e1) => e1 + 'onload="createThumbnail(this,' + objNo + ')" src');
s = s.replace(/(\x3cimg class="demon" )title/g, "$1onerror");
s = s.replace(/(\x3cdiv class="comment_element">)(.+?)(\x3c\/div>)/g,
(e0,e1,e2,e3) => e1 + e2.replace(/(\/home\/[\w\-]+\/files\/[\w\-\._]+)\((\d)\)/g,
"\x3cimg src=\"$1\" alt=\"\" class=\"img-$2\" />") + e3);

const obj = Fid(isF2 ? "f2Doc" : "m" + mmCNT + "Doc");
const o = obj.parentNode.classList;
s.match(/\x3ciframe/) ? o.add("frame") : o.remove("frame");

let exCss = evalDec(key(s, "CSS-DATA"));
if(exCss != ""){
echo("exCssDisp", cssDefaultRep(exCss));
}

if(Fid("eTab" + objNo).classList.contains("ape")){
const sec = Fce("div");
sec.className = "sec";
echo(sec, s);
obj.append(sec);
delayScroll(sec, null);
} else {
echo(obj, "<div class='sec'>" + s + "</div>");
obj.parentNode.scrollTo(0,0);
}
eTabCreate(objNo);
};

/* -------- ユーザーエントリ -------- */
xmlEntry = () => {
xmlUSER = document.URL.match(/user=([a-z0-9\-]+)/) ? RegExp.$1 : "new-diary";
xmlMonth = null;
cueUser = "new-diary";
cueComment = false;
cueDisp = 0;
let dat = xmlUSER == "new-diary" ?
"/3 1570804022 /1 1570803952 /2 1590583861" :
":yadokari /2 1288097686";

Cue = dat.split(" ");
if(dat != "" && Cue.length) cueLoop();
else {
if(xmlUSER == "all") xhr("cgi-bin/diary,cgi?oid=all;n=100", null, allEntry);
else xhr("/home/" + xmlUSER + "/diary/", null, createDiaryMenu);
}
if(!isLogin || visUSER != "new-diary") pageLogs("trans");
};

/* -------- メニューの生成 -------- */
createDiaryMenu = e => {
let lev = e.match(/div class="entry C"/) ? -1 :
(e.match(/div class="entry C\d+"/) ? 1 :
(e.match(/oid=[\w\-]+;s="/) ? -2 : 0));
isF2 = false;
if(msCNT != 1) dispChg(0,1);
if(mmCNT != 0) dispChg(1,0);
if(lev == 0) {
doc.body.classList.add("loaded");
echo("m0Doc", `<div class="user-dels">
<p>残念ですが『 <strong>${xmlUSER}</strong> 』さんは退会しています。</p>
<p>履歴で戻るか「左側」のリンク集で進んでください。</p></div>`);
dispChg(0,4); return;
}
echo("fileView", `
<div class="link_title">Source & Page</div>
<div class="masMsg">
HTML構文で全文表示されます。<br />
色分けしています。
</div>
<div class="btn-ul">
<span onclick="fileViewEntry(0, this);">メイン</span>
<span onclick="fileViewEntry(1, this);">メニュ</span>
</div>
<div class="masMsg">
CSSファイルです。<br />
色分けしています。
</div>
<div class="btn-ul">
<span onclick="fileViewEntry(2, this);">共 通</span>
<span onclick="fileViewEntry(3, this);">メイン</span>
<span onclick="fileViewEntry(4, this);">メニュ</span>
<span onclick="fileViewEntry(5, this);">プロフ</span>
<span onclick="fileViewEntry(6, this);">日記帳</span>
<span onclick="fileViewEntry(7, this);">掲示板</span>
<span onclick="fileViewEntry(8, this);">投 稿</span>
<span onclick="fileViewEntry(9, this);">友 達</span>
<span onclick="fileViewEntry(10, this);">リンク</span>
<span onclick="fileViewEntry(11, this);">足 跡</span>
</div>
<div class="masMsg">
コンテンツはインラインです。<br />
領域Bに上書きモードで表示します。
</div>
<div class="btn-ul">
<span onclick="fileShowEntry(0, this)">プロフ</span>
<span onclick="fileShowEntry(3, this)">日記帳</span>
<span onclick="fileShowEntry(4, this)">掲示板</span>
<span onclick="fileShowEntry(1, this)">友 達</span>
<span onclick="fileShowEntry(2, this)">リンク</span>
<span onclick="fileShowEntry(5, this)">足 跡</span>
</div>
<label id="addCssDisp"><input type="checkbox" id="addCss" onclick="addCssEntry()" />足跡でユーザのCSSを変更</label>
<div class="tips">ユーザーリンク(/home/)は<br />
システムへ置換されます。</div>`
);

echo("myLinks", `<div class="link_title">関連リンク</div><ul>
<li>※<a href="/home/log2/main.html?job=bbs;user=${xmlUSER}">log2:bbsで「汎用掲示板」を開く</a></li>
<li>※<a href="/home/log2/main.html?job=bbs;user=kakei;p=4;po=77">job=bbs;user=kakei;p=4;po=77</a></li>
<li>※<a href="/home/${xmlUSER}/" target="_blank">標準のサイトを新規で開く</a></li>
</ul>`
);
if(lev < 0) {
tabsCount("mTab", "F1", "a");
doc.body.classList.add("loaded");
echo("m0Doc", `<div class="user-dels">
残念ですが『 <strong>${xmlUSER}</strong> 』さんは日記を<strong>
${ lev == -1 ? "書いていません" : "全て削除しています"}</strong>。<br />
他のコンテンツは「左側」のファイルの表示でどうぞ。</div>`
);
if(doc.URL.match(/view=(\d+)/)){
viewEntry(RegExp.$1 - 0);
}
return;
}

let s = e.replace(/.+?(<ul c)/, "$1").replace(/<div id="main".+/, "");
s = s.replace(/link_title">.+?</g, "");
s = s.replace(/<\/?(div|ul)[^>]*>/g, "");
let dat = s.split("\x3chr />");

const info = `<div class="create-info">Create by <span>${xmlUSER}@eclat</span></div>`;
dat[2] = dat[2].replace(/ title=[^>]+>/g, ">");
let arc = dat[2];

let ind = dat[2];
let inde = ind.match(/<a class="link_year.+?<\/a>/g);
inde = inde.join(" ").replace(/(<a )/g, "$1target=\"_blank\" ");
echo("index",`
<div class="link_title">Index of</div>
${ info }
<div class="extra" onclick="extraEntry(this, 0)">Index of の拡張</div><div class="extra-info"></div>
<ul id=\"yearDisp" class=\"link_text"><li> ${ inde } </li></ul>
<div id="indexDisp"></div>`
);

arc = arc.replace(/a class="link_year[^>]+>(\d+)\x3c\/a/g,
"span class=\"arc\">$1</span").
replace(/(diary\/)(\d{4})\/(\d\d)(\/")/g, "$1$2\/$3$4 id=\"Mon$2$3\"").
replace(/>0(\d)</g, ">$1<");
echo("archives",`
<div class="link_title">Archives</div>
${ info }
<div class="masMsg">
月毎は降順で表示されます。<br />
追記フラグを随時クリアして。
</div>
<ul class=\"link_text"> ${ axRep(arc) } </ul>`
);

dat[3] = "<li class=\"C0\"><a class=\"category\" href=\"/cgi-bin/diary.cgi?oid=" +
xmlUSER + ";n=10\">全カテゴリ</a></li>" + dat[3];
dat[3] = dat[3].replace(/(>)(<a )/g, "$1<span class=\"date\"></span>$2");
echo("categories",`
<div class="link_title">Categories</div>
${ info }
<div class="extra" onclick="extraEntry(this, 1)">カテゴリの拡張</div>
<ul class=\"link_text"> ${ axRep(dat[3]) } </ul>`
);
echo("latest_articles",`
<div class="link_title">Latest_articles</div>
${ info }
<ul class=\"link_text"> ${ axRep(dat[0]) } </ul>`
);
echo("latest_comments",`
<div class="link_title">Latest_comments</div>
${ info }
<ul class=\"link_text"> ${ axRep(dat[1]) } </ul>`
);

tabsCount("sTab", "F0", "a");
tabsCount("mTab", "F1", "a");
mainShowEntry(e);
doc.body.classList.add("loaded");

if(xmlUSER == "new-diary"){
if(doc.referrer.includes("profile")){
viewEntry(12);
} else {
if(doc.URL.match(/view=(\d+)/)){
viewEntry(RegExp.$1 - 0);
} else {
dispChg(0,2);
const obj = Fcn("f2Doc", "comment_element")[0];
// delayScroll(obj, Fcn("m1Doc", "entry")[0]);
const m = Fcn(Fcn("m0Doc", "entry")[0], "dateIs");
const len = m.length;
delayScroll(obj, m ? m[len - 1] : null);
}
}
} else {
if(xmlUSER != "all"){
if(doc.URL.match(/view=(\d+)/)){
viewEntry(RegExp.$1 - 0);
} else {
delayScroll("categories", "archives");
}
}
}
};

viewEntry = no => {
if(no < 0) no = 0;
const view = Ftag("fileView", "span");
if(no >= view.length) no = 0;
setTimeout(() => {
view[no].click();
setTimeout(() => { delayScroll("fileView", null) }, 1000);
}, 1500);
};

/* -------- 先読み表示 -------- */
cueLoop = () => {
if(Cue.length == 0){ // 処理の終わりで初期値を設定
dispChg(0, 1);
dispChg(1, 1);
isCue = false; // 連続処理の終了
if(xmlUSER == "all") xhr("/cgi-bin/diary.cgi?oid=all;n=100", null, allEntry);
else xhr("/home/" + xmlUSER + "/diary/", null, createDiaryMenu);
return;
}
let dat = Cue.shift();
let a = dat.substring(0,1);
if(a == ":"){ cueUser = dat.substring(1); cueLoop(); return; }
if(a == "/"){
let no = dat.substring(1) - 0;
if(no == 3) isF2 = true;
else {
mmCNT = no;
isF2 = false;
}
cueLoop();
return;
}
isCue = true;
xhr("/home/" + cueUser + dateToOnes(dat), null, mainShowEntry);
};


[/EXEC-D-DATA]