エクラの新着コメント 2.0

[diary:174002]
[beforeExec]
Fx.u = 27879;
Lo.ini = function(){
Fx.max = Number(Re_com(Re.ini.responseText));
if(Fx.loc.match(/up=(\d)/)) Fx.max += Number(RegExp.$1);
Fx.p = Fx.loc.match(/page=(\d+)/) ? Number(RegExp.$1) : 0;
Fx.CNT = Fx.CNT2 = Fx.p ? Fx.p * 50 : Fx.max;
Fx.num = 0;
Fx.fg = Fx.p ? true : false;
var s = "\x3cdiv class='lin'>",st = Math.floor(Fx.max / 50);
for(var i = st; i > 0; i--){
s += "\x3ca href='main.html?diary=174002&page=" + i + "'>P" + ("00" + i).slice(-3) + "\x3c/a> ";
if(i % 100 == 0) s += "\x3c/div>\x3cdiv class='lin'>";
}
s += "\x3c/div>";
var o = Fap(Fid("linkDisp"), Fce("div")); o.className = "link";
echo(o,s);
Fx.e(Re_uri(Fx.CNT));
};
Re_com = function(s){
s = s.replace(/\r?\n/g, "");
return s.match(/\x3ctextarea[^>]+>(.+?)\x3c\/textarea>/) ? RegExp.$1 : "";
};
Re_user = function(s){
s = s.match(/投稿者: ([^<]+)/) ? RegExp.$1 : "-";
return s.replace(/^\s+|\s+$/g, "");
};
Re_uri = function(n){
return "/cgi-bin/diary_editor.cgi?oid=" + Vis.oid + ";type=comments;id=" + n;
};
entry = function(){
if(Vis.login) Fx.e(Re_uri(Fx.u), "ini");
};
Lo.update = function(){
echo("update", "(" + (new Date()).toLocaleString() + " ... update.)");
};
up2 = function(o,fg,a){
echo(o, fg? '※コメント数の最大値が更新されました。\x3cspan id="update">\x3c/span>' : a);
if(fg) Fx.e(Re_uri(Fx.u) + ";mode=update;text=" + a, "update");
};
Lo.entry = function(){
var s = Re.entry.responseText,user = Re_user(s),c = Re_com(s),a = Fid("listDisp"),o = Fce("div");
Fx.fg ? Fap(a,o) : a.insertBefore(o, a.firstChild);
echo(o, '\x3cspan class="Res">R' + Fx.CNT + '\x3c/span> \x3cspan class="user">' + user + '\x3c/span> \x3ca href="main.html?diary=172233&page=' + Fx.CNT + '">編集\x3c/a> : \x3cspan class="msg">' + c + '\x3c/span>');
if(!Fx.fg){
if(user == "-"){
var max = Fx.CNT - 1; Fx.max = max;
max == Fx.CNT2 ?
up2(o,0,"※コメント数の最大値に変更はありませんでした。") : up2(o,1,max);
Fx.fg = true;
Fx.CNT = Fx.CNT2;
}
}
Fx.num++;
Fx.CNT += Fx.fg ? -1 : 1;
if(Fx.num < 50) Fx.e(Re_uri(Fx.CNT));
else {
if(!Fx.fg) up2(o,1,Fx.CNT - 1);
o = Fap(a, Fce("div"));
if(Fx.p) echo(o, "\x3ca href='main.html?diary=174002&page=" + (Fx.p - 1) + "'>次のページ");
}
};
window.onerror = function(){ return true; };
[/beforeExec]
[cssText]
#linkDisp { width:30%; float:right; }
.lin { margin:0em .5em 1em .5em;
border:1px solid darkgreen; padding:.5em; border-radius:1em;
-moz-border-radius:1em;
}
.lin a { text-decoration:underline; }
#listDisp { margin-right:30%;}
#listDisp div {
line-height:1.4em; padding:.5em 1em;
border-top:3px dotted #ccc; font-size:10.5pt;
}
#listDisp .user { color:darkgreen; }
#listDisp .msg {
color:#896952;
}
#update { color:darkgreen; }
.m1 { text-align:center; margin-bottom:1em;
color:#808080;
}
[/cssText]
[body]
<$$div id="header">
<$$img src="files/yosei_2.gif" alt="" /> <$$a href="main.html?diary=174002">#174002 ログイン限定 エクラの新着コメント(全50件)<$$/a>
<$$/div>
<$$div id="linkDisp">
<$$div class="m1"><$$img src="MIHOn/nancyan_hazuki.gif" alt="" /><$$br /><$$br />
コメントノートのいろいろ(^-^y
<$$/div>
<$$/div>
<$$div id="listDisp"><$$/div>
[/body]
[exec]
document.title = "エクラの新着コメント 2.0";
entry();
[/exec]
[/diary:174002]

■仕様書