var CPostList = Class.create(); CPostList.prototype = { initialize: function(type,member_uid,cate_info,target_str,sorting_type,start_pos,list_count) { //설정값 저장 this.type = type; this.member_uid = member_uid; if(cate_info) { this.cate_top = cate_info[0]; this.cate_mid = cate_info[1]; this.cate_btm = cate_info[2]; } this.target_str = target_str; this.sorting_type = sorting_type; this.start_pos = parseInt(start_pos); this.list_count = parseInt(list_count); this.page = 1; this.used_postuid = ''; //각종 타이머~ this.overAniHandle = null; this.overTagtipHandle = null; this.slideAniHandle = null; this.MixUping = 0; //리스트 아이템 위치관련 변수 this.nowListUid = -1; this.beforeListUid = -1; //스크롤 이벤트 무시할때 사용할 타이머 this.timerScrollKill = null; //상태 this.isNowPushing = 0; //메인화면 신규포스트 알림 포스트 목록 this.alramNewPost = 0; this.alramNewPostCnt = 0; }, close_pl_replybanner: function() { new Effect.SlideUp($('pl_replybanner'),{duration:0.5}); var now = new Date(); var expire = new Date(now.getTime() + 86400000*3); setCookie('r_plbanner', '1', expire, '/', '.mixsh.com'); }, //Bottom.inc 에서 호출 initActivePage: function() { this.listScroller = this.chkPagePos.bindAsEventListener(this); Event.observe(window, 'scroll', this.listScroller); }, setMemberUid: function(member_uid) { this.member_uid=member_uid; }, toogleFeedPop: function() { tarel = $('pop_feedsel'); if(tarel.visible()) { tarel.hide(); Event.stopObserving(document.body, 'click'); } else { tarel.show(); Event.observe(document.body, 'click', (function(ev){if(ev.element().className!='rss_but'){this.toogleFeedPop();} }).bind(this), false); } }, showTagTip: function(list_uid) { if(this.overTagtipHandle) { clearTimeout(this.overTagtipHandle); this.overTagtipHandle = null; } this.overTagtipHandle = setTimeout((function(){ $('postlist_box'+list_uid).getElementsByClassName('tagtip')[0].observe('mouseout',this.closeTagTip); $('postlist_box'+list_uid).getElementsByClassName('tagtip')[0].show(); }).bind(this),500); }, closeTagTip: function(event,list_uid) { if(this.overTagtipHandle) { clearTimeout(this.overTagtipHandle); this.overTagtipHandle = null; return; } if(list_uid) { $('postlist_box'+list_uid).getElementsByClassName('tagtip')[0].hide(); return; } var el = Event.element(event); if(el.tagName=='DIV') { el.hide(); //Event.stopObserving(el, 'mouseout', this.closeTagTip) } }, onMouseOutList: function(uid,list_uid) { //$('postlist_tagtip'+list_uid).hide(); }, onMouseOverList: function(uid,list_uid) { if(list_uid==this.nowListUid) { return; } //이전에 마우스 오버되었던 컬럼 하일라이팅 제거 if(this.beforeListUid!=-1) { /* $('postlist_box'+this.beforeListUid).setStyle({ background: 'none', borderColor: '#ffffff' }); */ //이전 커멘드 제거 //this.overAniHandle.cancel(); //$('postlist_command'+this.beforeListUid).hide(); //툴팁 제거 //$('postlist_box'+this.beforeListUid).getElementsByClassName('tagtip')[0].hide(); } //마우스 오버된 컬럼 하일라이팅 /* $('postlist_box'+list_uid).setStyle({ background: 'url(http://static.mixsh.net/img/pl_bg2.gif) repeat-x', background: '#f9f9f9', borderColor: '#e9e9e9' }); */ //커멘드 보임 //this.overAniHandle = new Effect.Appear($('postlist_command'+list_uid),{duration:0.5}); /* if(this.overTimeHandle) { clearTimeout(this.overTimeHandle); this.overTimeHandle = null; } this.overTimeHandle = setTimeout(function() { //관련 tagtip 출력 if(Object.isElement(el_tagtip)) { //관련테그 로딩 param ='post_uid='+uid; this.xmlRequest = new Ajax.Request( '/inc/ajax/postlist/get_tagtip.html', { method: 'get', parameters: param, onComplete: (function() { if(this.xmlRequest.transport.responseText) { el_tagtip.update("
"); } }).bind(this) }); this.overAniHandle = Effect.Appear($('postlist_tagtip'+list_uid),{duration:0.5}); } },1000); */ this.nowListUid = list_uid; this.beforeListUid = this.nowListUid; }, showDirectPlay: function(media_uid,post_uid) { $('cover').fill(); $('cover').show(); //$('pop_directplay').className = 'pop_directplay'; Event.observe('cover', 'dblclick', postlist.hideDirectPlay, false); if(media_uid=='2685') //FreeEgg { $('pop_directplay').setStyle({ //width: '750px', //margin: '0px 0px 0px -375px' }); } else { $('pop_directplay').setStyle({ //width: '628px', //margin: '0px 0px 0px -314px' }); } //ID확인 param = 'media_uid='+media_uid+'&post_uid='+post_uid; this.xmlRequest = new Ajax.Request( '/inc/ajax/postlist/direct_play.html', { method: 'get', parameters: param, onComplete: (function() { $('pop_directplay_body').update(this.xmlRequest.transport.responseText); if(isIE()) { var st = document.body.scrollTop; if(!st) st = document.documentElement.scrollTop; var gap = document.viewport.getHeight()-$('pop_directplay').getHeight(); var l_top = 0; if(gap>0) l_top=gap/2; else l_top = 0; $('pop_directplay').setStyle({ top: l_top+st+'px', marginTop: '0px' }); //$('pop_directplay').style.top = l_top+st+'px'; } var ef = Effect.Appear($('pop_directplay'), {duration:0.5,beforeFinish:function(){}}); //var ef = Effect.SlideDown($('pop_directplay'), {duration:1,beforeFinish:function(){}}); //var ef = Effect.Grow($('pop_directplay'), {x:0, duration:1,beforeFinish:function(){}}); } ).bind(this) }); }, hideDirectPlay: function() { $('pop_directplay_body').update(''); Element.hide('pop_directplay'); Element.hide('cover'); }, chkPagePos: function() { var st = document.body.scrollTop; if(!st) st = document.documentElement.scrollTop; var pchk_vp = $('page_checker').viewportOffset(); if(pchk_vp['top']▼ "+String(this.page).number_format()+"Page
"+res_arr[3]); $('postlist_activepage').insert(res_arr[3]); this.pushPostUid(res_arr[2]); } this.isNowPushing = 0; } else { //마지막 리스트일 경우 //이벤트 제거 Event.stopObserving(window, 'scroll', this.listScroller); //마지막임을 표시 $('postlist_activepage').innerHTML += "마지막 목록입니다.
클립보드에 주소가 복사되었습니다. Ctrl+V 키로 붇여넣어 사용하세요.
http://mixsh.com/detail/#{post_uid}
아래의 주소를 친구에게 보내주시면, 이 정보를 함께볼 수 있습니다.
http://mixsh.com/detail/#{post_uid}
Loading...
연결된 글 목록을 로딩중입니다.
선택한 포스트가 스크랩 되었습니다.
스크랩 박스를 확인하시려면 이곳을 눌러주세요.
";
else tarEl.innerHTML = "
";
//cnt_vmymixup
but_info = boxEl.style.backgroundImage.split('_');
cnt_vmymixup = but_info[2];
if(cnt_vmymixup>3) cnt_vmymixup=3;
}
else //2008-07-10 오후 2:54:17 클래스 이름으로 대상을 찾는 새로운 방식 ( 추후 전체적으로 이런 방식으로 교체, 레이어 레이아웃은 /widget/mixupcast/index.html 참고 )
{
var boxEl = $('meter_'+type+list_uid);
var tarEl = boxEl.getElementsByClassName('cnt')[0];
before_innerhtml = tarEl.innerHTML;
before_classname = tarEl.className;
tarEl.className = 'wait';
if(boxEl.style.backgroundImage=='url(http://static.mixsh.net/img/but_mu2_0_.gif)') tarEl.update("
");
else tarEl.update("
");
//cnt_vmymixup
but_info = boxEl.style.backgroundImage.split('_');
cnt_vmymixup = but_info[2];
if(cnt_vmymixup>3) cnt_vmymixup=3;
}
var rowTemplate = new Template("type=#{type}&post_uid=#{post_uid}&cnt_mixup=#{cnt_mixup}&cnt_mymixup=#{cnt_mymixup}&cnt_vmymixup=#{cnt_vmymixup}");
param =
rowTemplate.evaluate({
type : type,
post_uid : post_uid,
cnt_mixup : cnt_mixup,
cnt_mymixup : cnt_mymixup,
cnt_vmymixup : cnt_vmymixup
});
this.xmlRequest = new Ajax.Request(
'/inc/ajax/postlist/proc_post_recommend.html',
{
method: 'get',
parameters: param,
onComplete: (function()
{
switch(this.xmlRequest.transport.responseText)
{
case "0":
alert('존재하지 않는 컨텐츠 입니다.');
break;
case "-1":
alert('로그인 후 이용 가능합니다');
tarEl.className = before_classname;
tarEl.innerHTML = before_innerhtml;
break;
case "-2":
alert('※ 토큰이 부족합니다.\n\n한번의 mixUP에는 1개의 토큰이 필요합니다.\n매일 50개의 토큰이 자동 충전되니 내일을 기다려 주세요.');
tarEl.className = before_classname;
tarEl.innerHTML = before_innerhtml;
break;
case "-3": //최대수치만큼 했음
alert('하나의 컨텐츠에 최대 3번까지만 mixUP이 가능합니다.');
tarEl.className = before_classname;
tarEl.innerHTML = before_innerhtml;
break;
default:
//버튼 및 클릭 이벤트 교체
if(type=='normal')
{
//alert('1');
//$('meter_recomm_but'+list_uid).hide();
//$('meter_cnt'+list_uid).onclick=function(){postlist.showAddon('recomm_idlist',post_uid,list_uid,0);};
}
else
{
//$('meter_cnt'+list_uid).onclick=function(){location.href='/detail/'+post_uid+'?addon=recomm_idlist';};
}
//숫자 증가
this._addRecommend(type,post_uid,list_uid,this.xmlRequest.transport.responseText,feedback_type);
break;
}
this.MixUping=0;
}
).bind(this)
});
},
_addRecommend: function(type,post_uid,list_uid,res,feedback_type)
{
if(type=='normal')
{
var boxEl = $('meter_box_'+list_uid);
var tarEl = $('meter_cnt'+list_uid);
//결과정보 파싱
res_arr = res.split(mixsh_explode_dot);
//정보 파싱
boxEl.style.backgroundImage='url(http://static.mixsh.net/img/but_mu_'+res_arr[1]+'_.gif)';
tarEl.innerHTML = res_arr[0];
tarEl.className = 'cnt';
switch(feedback_type)
{
case 'detail':
if(postdetail.now_tab=="all" || postdetail.now_tab=="mixup") postdetail.reloadMixupList();
break;
case 'mylib':
mylib.reloadMixupList(post_uid,list_uid);
break;
default:
postlist.showAddon('recomm_idlist',post_uid,list_uid,1);
break;
}
}
else //mini
{
var boxEl = $('meter_'+type+list_uid);
var tarEl = boxEl.getElementsByClassName('wait')[0];
//결과정보 파싱
res_arr = res.split(mixsh_explode_dot);
//버튼 변경
boxEl.style.backgroundImage='url(http://static.mixsh.net/img/but_mu2_'+res_arr[1]+'_.gif)';
tarEl.className = 'cnt';
tarEl.update(res_arr[0]);
}
},
addMediaRecommend: function(t)
{
if(this.member_uid=='0')
{
member.showPop();
return false;
}
return true;
},
reloadRecentRecommBox: function()
{
if(!this.reloadRecentEff) this.reloadRecentEff = new Effect.BlindUp($('recent_recomm_post_box'),{duration:0.5, afterFinish:function(){postlist._reloadRecentRecommBox();}});
},
_reloadRecentRecommBox: function()
{
this.xmlRequest = new Ajax.Request(
'/inc/ajax/postlist/get_recent_recomm_post.html',
{
method: 'get',
parameters: '',
onComplete: (function()
{
if(this.xmlRequest.transport.responseText==-1)
{
}
else
{
$('recent_recomm_post_box').update(this.xmlRequest.transport.responseText);
}
new Effect.BlindDown($('recent_recomm_post_box'),{duration:1, afterFinish:(function(){this.reloadRecentEff=null;}).bind(this)});
}
).bind(this)
});
},
slidePopularBox: function(target,type)
{
if(this.slideAniHandle) return;
tarel = $(target);
nowPageEl = $(target).getElementsByClassName('num_now')[0];
nowPage = parseInt(nowPageEl.innerHTML);
allPage = parseInt($(target).getElementsByClassName('num_all')[0].innerHTML);
if(type=='+') //다음페이지
{
tarPage = nowPage+1;
if(tarPage>allPage) tarPage=1;
}
else //이전페이지
{
tarPage = nowPage-1;
if(tarPage<1) tarPage=3;
}
//페이지 숫자변경
nowPageEl.update(tarPage);
//레이어 변경
this.slideAniHandle = new Effect.Fade($(target).getElementsByClassName('page'+nowPage)[0],{duration:0.1, beforeFinish:(function(){
Effect.Appear($(target).getElementsByClassName('page'+tarPage)[0],{duration:0.1});
this.slideAniHandle = null;
}).bind(this)});
},
randshowPopularBox: function(target)
{
allPage = parseInt($(target).getElementsByClassName('num_all')[0].innerHTML);
tarPage = Math.floor(Math.random()*allPage)+1;
//레이어 보임및 숫자변경
$(target).getElementsByClassName('page'+tarPage)[0].show();
$(target).getElementsByClassName('num_now')[0].update(tarPage);
},
/*
addAreport: function(f)
{
//회원만
if(this.member_uid=='0')
{
member.showPop();
return false;
}
if(f.areport_type.value=='0')
{
alert('신고 종류를 선택해 주세요.');
f.areport_type.focus();
return false;
}
var tarel = $('post_addon_'+f.list_uid.value);
param ='action=proc&type='+f.areport_type.value+'&post_uid='+f.post_uid.value+'&list_uid='+f.list_uid.value;
this.xmlRequest = new Ajax.Request(
'/inc/ajax/postlist/post_addon_areport.html',
{
method: 'post',
parameters: param,
onComplete: (function()
{
if(this.xmlRequest.transport.responseText)
{
tarel.update(this.xmlRequest.transport.responseText);
}
}).bind(this)
});
return false;
},
*/
/*
showPreviewPop: function(post_uid,evel,tip_width,mt,ml,float_type,scroll_el)
{
//아직 툴팁 레이어가 로딩되지 않았으면
if(!$(this.preview_pop_el)) return;
//별도의 스크롤 영역에 있을경우
if(scroll_el) add_scroll_top = scroll_el.scrollTop;
else add_scroll_top = 0;
if(this.preview_pop_timer)
{
clearTimeout(this.preview_pop_timer);
this.preview_pop_timer = null;
}
if(!tip_width) tip_width = 415;
if(mt==undefined) mt = 3; //이벤트 발생 엘리멘트와 툴팁 간 여백
if(ml==undefined) ml = 0; //이벤트 발생 엘리멘트와 툴팁 간 여백
if(float_type==undefined) float_type = 'left';
//이벤트가 발생한 엘리멘트
var evel = $(evel);
var evel_pos = evel.viewportOffset();
//스크롤 위치 얻기
var st = document.body.scrollTop;
if(!st) st = document.documentElement.scrollTop;
//툴팁 레이어
var tarel = $(this.preview_pop_el);
tarel.style.width = tip_width+'px';
tarel.getElementsByClassName('bg')[0].setStyle({
width: tip_width+'px',
background: 'url(http://static.mixsh.net/img/bg_postpreview_'+tip_width+'.gif) right bottom no-repeat'
});
//컨텐츠가 들어갈 에이어
var innerel = tarel.getElementsByClassName('inner')[0]
//표시한 이벤트 엘리멘트 기억
this.preview_pop_evel = evel;
this.preview_pop_timer = setTimeout((function(){
//가로 역역을 넘어갈 것 같으면 우측 정렬
//if(document.viewport.getWidth()