金在炯 | 조회 3995 |추천 0 | 2010.10.12. 01:46
//
│가요 & 일반악보 게시판의 다른 글 더보기▶
(function() {
var SearchArticles = {
RELATED_ARTICLES_SIZE: 6,
showRelatedSearchArticles: function () {
WICafeSearch.relatedArticles('1DG5J', '비와당신 박중훈 악보', SearchArticles.RELATED_ARTICLES_SIZE, {
callback: function (articles) {
var table = daum.$('related-articles');
var tbody = SearchArticles.makeItem('tbody', '');
var maxCount = 5;
var count = 0;
for (var i = 0; i < articles.length; i++) {
if (SearchArticles.isCurrentArticle(articles[i]) || count >= maxCount) {
continue;
}
tbody.appendChild(SearchArticles.makeSearchResultArticleData(articles[i]));
count++;
}
if(count > 0) {
table.appendChild(tbody);
daum.Element.show(daum.$('related-articles-area'));
}
}
});
},
isCurrentArticle: function (article) {
var dataid = CAFEAPP.ui.DATAID || '';
var fldid = CAFEAPP.FLDID || '';
var grpid = CAFEAPP.GRPID || '';
if (article.grpid == grpid && article.fldid == fldid && article.dataid == dataid) {
return true;
}
return false;
},
makeSearchResultArticleData: function (article) {
var tr = this.makeItem('tr', '');
tr.appendChild(this.makeDataid(article, 'dataid line'));
tr.appendChild(this.makeTitle(article, 'title line'));
tr.appendChild(this.makeNickname(article, 'nickname line'));
tr.appendChild(this.makeRegdt(article.regdtshow, 'regdt p11 txt_sub line'));
return tr;
},
makeItem: function (tag, className) {
var tag = document.createElement(tag);
tag.className = className;
return tag;
},
makeDataid: function (article, className) {
var span = this.makeItem('td', className);
var anchor = this.makeAnchor(article);
anchor.appendChild(document.createTextNode(article.dataid));
span.appendChild(anchor);
return span;
},
makeTitle: function (article, className) {
var title = '';
if (article.headcont != null && article.headcont != '') {
title += '[' + article.headcont + '] ';
}
title += article.dataname;
var span = this.makeItem('td', className);
var anchor = this.makeAnchor(article);
anchor.innerHTML = title;
span.appendChild(anchor);
if (article.shrtcmtcnt != null && article.shrtcmtcnt != '') {
var commentCount = this.makeItem('a', 'cmtcnt txt_point num');
commentCount.appendChild(document.createTextNode('[' + article.shrtcmtcnt + ']'));
span.appendChild(commentCount);
}
if (article.addimgyn != null && article.addimgyn == 'Y') {
var img = this.makeItem('img', 'icon_file_photo');
img.src = 'http://i1.daumcdn.net/cafeimg/cf_img2/img_blank2.gif';
img.width = 11;
img.height = 11;
span.appendChild(img);
}
return span;
},
makeNickname : function (article, className) {
var span = this.makeItem('td', className);
var anchor = document.createElement('a');
anchor.appendChild(document.createTextNode(article.nickname));
anchor.href = 'xxjavascript:;';
daum.Event.addEvent(anchor, 'click', function() {
showSideView(this, article.e_userid, article.encnickname);
});
span.appendChild(anchor);
return span;
},
makeRegdt: function (text, className) {
var span = this.makeItem('td', className);
var textNode = document.createTextNode(text);
span.appendChild(textNode);
return span;
},
makeAnchor: function (article) {
var anchor = document.createElement('a');
var grpid = article.grpid;
var fldid = article.fldid;
var bbsdepth = article.bbsdepth;
anchor.href = '/_c21_/bbs_read?grpid=' + grpid + '&fldid=' + fldid + '&contentval=' + bbsdepth;
return anchor;
}
};
SearchArticles.showRelatedSearchArticles();
})();
var daum_ad_test = false;
var daum_ad_adunit = "DAU-cefb643fe";
var daum_ad_pubid = "daum_search";
var daum_ad_page_url = "cafe.daum.net";
var daum_ad_bold_font = false;
try {
var txtElement = daum.$$('body')[0];
var txtSubElement = daum.$$('.txt_sub')[0];
var daum_ad_color_font = daum.Element.getStyle(txtElement, "color");
var daum_ad_color_link = daum.Element.getStyle(txtSubElement, "color");
} catch(e){}
new function(d,m,e,k,f){var g,l,h,c;h=d.document;e=e||"utf-8";f=f||d;c=0;g=function(b,a){null!=b.attachEvent?b.attachEvent("xxonload",a):b.addEventListener("load",a,!1)};l=function(){null!=k&&2>c&&(c=2,k.call(f))};g(d,function(){setTimeout(function(){var b,a;if(1>c)return c=1,b=h.getElementsByTagName("script")[0],a=h.createElement("script"),a.type="text/javascript",a.async=!0,a.defer=!0,a.src=m,a.charset=e,g(a,l),b.parentNode.insertBefore(a,b)},0)})}(window, "http://ma.biz.daum.net/script/show_ads.js", "euc-kr");
|
|
댓글 2