日記の全索引取得

[diary:175885]
[beforeExec]
yearDat = [];
data = [];
dt = "_._." + "._._";
infoOpa = 1.0;
dateData = "";
titleData = "";
isLoad = true;

infoOff = function(){
var o = Fid("infoDisp");
o.style.opacity = infoOpa;
infoOpa += -.1;
if(infoOpa > 0) setTimeout(infoOff, 100);
else o.style.display = "none";
};
ini = function(){
Fx.user = Fx.loc.match(/user=([0-9a-z\-]+)/) ? RegExp.$1 : "";
Fx.sort = Fx.loc.match(/sort=title/) ? true : false;
if(Fx.user != "") iniLoad();
else Fid("infoDisp").style.display = "none";
};

iniLoad = function(){
document.title = Fx.user + "@eclat : 日記の全索引";
isTop = Fx.user != "yadokari" && self != top;
infoMsg(1);
Fx.e("/home/" + Fx.user + "/diary/menu.html", "dat");
};
infoMsg = function(fg){
echo("infoDisp", Fx.user + "@eclatさんの日記のデータを取得しています... " +
(fg ? "" : (yearMax - yearDat.length) + " / " + yearMax + " : " + data.length)
);
};
Lo.dat = function(s){
s.replace(/href="(\/home\/[0-9a-z\-]+\/diary\/\d{4})(\/|\/01\/)"/g, function(e0, e1, e2){
yearDat.push(e1 + e2); return "";
});
yearMax = yearDat.length;
infoMsg(0);
entry();
};

entry = function(){
var u = yearDat.shift();
infoMsg(0);
Fx.d2 = u.match(/\/01\/$/);
Fx.e(u, "e1");
};

Lo.e1 = function(s){
s = s.replace(/ title="[^"]+"/g, "");
var re = Fx.d2 ? /id="A(\d+)">\s*\x3cdiv class="entry_date">(\d{4}) (\d+\/\d+) (\d+:\d+)\x3c\/div>.+?(\x3ca[^>]+>)(.*?)(\x3c\/a>)/g :
/id="(\d+)"\-\->\x3cli>\x3cspan class="time">(\d{4}) (\d+\/\d+) (\d+:\d+)\x3c\/span> (\x3ca[^>]+>)(.*?)(\x3c\/a>)/g;
var u1 = 'uri=/cgi-bin/diary.cgi?oid=' + Fx.user + ';n=1;s=';
s.replace(re, function(e0,e1,e2,e3,e4,e5,e6,e7){
data.push(
e6.replace(/^[  ]+/, "") + dt + '\x3cli>\x3cspan class="time">' +
'\x3ca href="/home/nancyan/main.html?no=103&' + u1 + e1 + '">' + e2 + "\x3c/a> | " +
'\x3ca href="/home/yadokari/main.html?diary=172198&' + u1 + e1 + '">' + e3 + "\x3c/a> | " +
'\x3ca href="http://nancyan.main.jp/nancyan/io.php?' + u1 + e1 + '">' + e4 + "\x3c/a> | " +
'\x3ca href="/home/yadokari/main.html?diary=172231&page=' + e1 + '" class="eDisp">' + e1 + "\x3c/a> | " +
e5.replace(/(href=")/, "$1http://nancyan.main.jp/nancyan/io.php?uri=") + "(io.php)\x3c/a> \x3c/span> " +
(isTop ? e5.replace(/(\x3ca )/, '$1 target="_blank"') : e5) +
e6.replace(/^( | |)+$/, '\x3cspan class="space">(空白)\x3c/span>') + e7 + "\x3c/li>"
); return "";
});
loEntry();
};
listSort = function(fg){
listDataEcho(fg ? titleData : dateData);
};
listDataEcho= function(s){
echo("listDisp", '\x3cdiv class="listInfo">\x3cspan class="infoLogo">' +
(isLoad ? '\x3ca href="/home/' + Fx.user + '/" target="_blank">' : '') + Fx.user + '@eclat' + (isLoad ? '\x3c/a>' : '') +
'さんの日記の全索引です。総数は' + data.length + '件あります。\x3cbr />' +
'※リストの並び替えは<$$button onclick="listSort(0)">日付順<$$/button><$$button onclick="listSort(1)">タイトル順<$$/button>からどうぞ。\x3c/div>' + s
);
};
loRep = function(str){
return ("\x3col>" + data.join("") + "\x3c/ol>").replace(/(\x3col>|\x3c\/li>).+?_\._\.\._\._/g, "$1\n");
};
loEntry = function(){
if(yearDat.length > 0){
entry();
} else {
dateData = loRep(data);
data.sort();
Fid("userMsg").style.display = "block";
titleData = loRep(data);
listDataEcho(Fx.sort ? titleData : dateData);
infoOff();
}
};
[/beforeExec]
[cssText]
html {
padding-left:60px;
background:#fff url(http://nancyan.main.jp/image/futari/r/ringnote.gif) repeat-y fixed;
}
body {
padding:14px 20px;
background:url(/home/yadokari/files/kabe12.gif);
}
#headerDisp {
background:url(/home/yadokari/files/yosei_0.gif) no-repeat;
margin-left:3em;
padding-left:68px; padding-top:16px;
.headInfo {
margin-bottom:12px; padding-top:16px;
}
.headInfo a { font-size:18pt; }
#form1 {
text-align:right; font-size:90%;
margin:0em 1em;
}
label { cursor:pointer; }
#listDisp {
font:90%/1.54 "メイリオ",meiryo;
}
#listDisp ol { margin-top:.5em; }
#listDisp li {
border-bottom:1px solid #ccc;
}
.listInfo {
margin-left:3em;
background:url(/home/yadokari/files/yosei_2.gif) no-repeat;
padding-left:68px; padding-top:16px; padding-bottom:8px;
}
.space { color:tomato; }
a { text-decoration:none; }
a:link { steelblue; }
a:hover { color:magenta; }
a.eDisp {
display:inline-block;
text-align:right; min-width:4em;
}
#infoDisp {
position:absolute; top:200px; left:200px; width:500px;
background:#fff url(/home/yadokari/files/yukikko2b.gif) no-repeat left top;
padding:220px 30px 30px 30px;
}
span.time { color:pink; }
#userMsg {
font-size:90%; line-height:1.35em;
display:none; margin-left:8em; margin-top:1em;
}
#eclatLinksDisp {
font:90%/1.3 meiryo,"メイリオ";
color:#a0a0a0;
border:2px solid steelblue;
padding:8px; margin:.25em 1em 1em 1em;
border-radius:8px; -moz-border-radius:8px;
}
.bold { color:#000; }
[/cssText]
[body]
<$$div id="headerDisp">
<$$div class="headInfo"><$$a href="main.html?diary=175885">日記の全索引取得<$$/a><$$/div>
<$$form id="form1" method="get" action="/home/yadokari/main.html" charset="utf-8">
<$$input type="hidden" name="diary" value="175885" />
<$$input type="text" name="user" id="formUser" size="20" />@eclat
<$$label><$$input id="rad0" type="radio" name="sort" value="date" checked="checked" />投稿順<$$/label>
<$$label><$$input id="rad1" type="radio" name="sort" value="title" />タイトル順<$$/label>
<$$input type="submit" value="取得" />
<$$/form>
<$$/div>

<$$div id="userMsg">
※年数は<$$strong>旧103<$$/strong>,日付は<$$strong>新103<$$/strong>,時刻は<$$strong>io.php<$$/strong>,記事番号は<$$strong>eDisp<$$/strong>へのリンクを設けています。<$$br />
※フレームでの表示の時は、タイトルのリンクに<$$strong>_blank<$$/strong>の<$$strong>target<$$/strong>を設けています。
<$$/div>
<$$div id="listDisp"><$$/div>
<$$div id="infoDisp"><$$/div>
<$$div id="colum">
 

<$$/div>
[/body]
[exec]
document.title = "日記の全索引取得";
ini();
[/exec]
[/diary:175885]


■仕様書 2012 09/28 16:15 Wrote