💖execCode D
[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?fn=3;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?fn=1;user=$2$3").
replace(/([\w\-]+\/files\/[\w\-\._]+)\((\d)\)/g,
"\x3cimg src=\"/home/$1\" alt=\"\" class=\"img-$2\" />");
setTimeout(() => {
echo(o, s);
o.classList.remove("ins"); }, 700
);
} else {
alert(s);
}
} else {
echoMain(s);
}
}
};

/* ------- メイン領域への書き込み ------- */

dlsEntry = e => {
let o = e.target;
let obj = o.parentNode.parentNode;
let no = o.textContent - 1;
delayScroll(Fcn(obj, "dateIs")[no], null);
};

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?;es=1;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(/([\w\-]+\/files\/[\w\-\._]+)\((\d)\)/g,
"\x3cimg src=\"/home/$1\" alt=\"\" class=\"img-$2\" />").
replace(/絵([0-9a-z]{3})/g, "\x26#x1f$1;") + 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);
let ds = Fcn(sec, "dateIs");
for(let i = 0; i < ds.length; i++){
let a = Fce("span"); a.className = "dls";
let b = ds[i].parentNode.parentNode;
a.append((Fcn(b, "dls").length + 1));
a.addEventListener("click", dlsEntry, null);
b.childNodes[1].append(a);
}
delayScroll(sec, null);
} else {
if(obj == Fid("m2Doc")){
let a = Ftag("fileView", "span");
for(let i = 0; i < 12; i++) a[i].classList.remove("now", "vis");
}
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";
isAll = xmlUSER == "all";
xmlMonth = null;
cueUser = "new-diary";
cueComment = false;
cueDisp = 0;
let dat = xmlUSER == "new-diary" ? "/3 1570804022 /1 1570803952 /2 1591011361" :
"/2 1570803952";
Cue = dat.split(" ");
cueLoop();
};

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(isAll) xhr("/cgi-bin/diary.cgi?oid=all;n=100", null, allEntry);
else xhr(xmlUSER == "kadoma1428" ? "/cgi-bin/diary.cgi?oid=kadoma1428;n=10" :
"/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]