검색 본문
/* 고급검색 */
var detailSearchResult = { A : [], O : [], N : [] };
function makePopup(url, width, height) {
window.open(url, '', "width=" + width + "px, height=" + height + "px");
}
(function(){
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
})();
function _jsUrlParameter() {
for (var f = {}, e = [], c = location.search.substr(1).split("&"), d = 0, b = c.length; d < b; d += 1) {
e = c[d].split("=");
f[e[0]] = e[1]
}
return f;
}
var _jsVclipLayerBlockId = "";
var tabParams = {
SortType : "",
GroupType : "",
sd : "",
ed : "",
CPVal : "",
play_time_le : "",
play_time_ge : "",
period : "",
display : "",
lpp : "24",
page : "1",
spemore : ""
};
jQuery.extend(tabParams, _jsUrlParameter());
if (!tabParams.display) {
tabParams.display = 'thumb';
}
function _jsA(d) {
if (!d) {
return []
}
var ua = navigator.userAgent.toLowerCase();
var op = ua.indexOf("opera") != -1;
var ie = ua.indexOf("msie") != -1 || ua.indexOf("trident") != -1;
if (d instanceof Array && !(op)) {
return d
}
var f = (typeof d == "string" && (ie || op)) ? d.split("") : d,
b;
try {
b = Array.prototype.slice.call(f)
} catch (h) {
for (var g = 0, b = [], c = d.length; g < c; g += 1) {
b.push(d[g])
}
}
return b
}
var _jsBind = function(e) {
var g = e,
c = _jsA(arguments),
b, d;
c.shift();
b = c.shift();
d = function() {
return g.apply(b, c.concat(_jsA(arguments)))
};
d.__Binded = true;
return d
}
var __jsViewScrolling = function(jsonParam) {
try{
var scrollTop = document.body.scrollTop;
scrollTop = Math.round( scrollTop + ( jsonParam.height - scrollTop ) * jsonParam.speed );
if ( jsonParam.prevScrollTop != scrollTop ) {
jsonParam.prevScrollTop = scrollTop;
window.scrollTo(0, scrollTop);
window.setTimeout(_jsBind(__jsViewScrolling, this, jsonParam), jsonParam.interval);
}
}catch(e) {}
}
var __jsViewScrollSet = function(type) {
var e = document.getElementById("playVclipLi");
var valueT = 0;
while (e.nodeName != "BODY" && e.nodeName != "HTML") {
valueT += e.offsetTop || 0;
e = e.offsetParent;
}
var m_speed = 0.5;
var m_interval = 30;
var max_y = document.body.scrollHeight;
var type_balance = 190;
if(type == "list") { type_balance = 150; }
var m_height = valueT - type_balance;
var balance = max_y - m_height - document.body.clientHeight;
if( balance < 0 ){
m_height = m_height + balance;
}
__jsViewScrolling({speed : m_speed, interval : m_interval, height : m_height});
}
var _jsVclipPlay = function(oIndex, oData, type) {
this.oList = jQuery("#vclipList")[0] || undefined;
this.oLayer = jQuery("#vclipLayer")[0];
this.index = oIndex;
this.data = oData;
this.layerClose = null;
this.type = type;
this.playIdx = -1;
this.init();
this.resizeDaumWrap();
this.resizePlayer();
};
_jsVclipPlay.prototype = {
createElement: function(h, g) {
var m, a = "",
k = document.createElement("div"),
f, b, j, l, c;
if (!g) {
if(h.indexOf("<") == 0) {
m = h
} else {
m = ("<" + h + ">" + h + ">")
}
} else {
for (c in g) {
a += c + '="' + g[c] + '" '
}
m = "<" + h + " " + a + ">" + h + ">"
}
try {
k.innerHTML = m;
f = k.removeChild(k.firstChild);
if (f.nodeType !== 1) {
throw ({
message: "shit browser!"
})
} else {
return f
}
} catch (d) {
b = m.match(/\w+/).toString().toLowerCase();
j = {
tbody: ["", "
"],
tr: ["", "
"],
td: ["
"],
option: [""]
};
if (j[b]) {
k.innerHTML = j[b][0] + m + j[b][1];
l = k.removeChild(k.firstChild);
return l.getElementsByTagName(b)[0]
} else {
return document.createElement(b)
}
}
},
scrollTo: function(e, k) {
var d = jQuery(e),
a = k || {},
ie = navigator.userAgent.toLowerCase().indexOf("msie") != -1 || navigator.userAgent.toLowerCase().indexOf("trident") != -1,
f = (ie) ? document.documentElement.scrollTop : window.pageYOffset,
c = +new Date,
h = _jsGetCoordsTarget(e)["top"] + ((a.offset) ? a.offset : 0),
b = a.duration || 700,
i = c + b,
g = a.easing || function(m, l, o, n) {
return -o * (m /= n) * (m - 2) + l
},
j = setInterval(function() {
var l = +new Date;
window.scrollTo(0, g(l - c, f, h - f, b));
if (l > i) {
window.scrollTo(0, h);
clearInterval(j)
}
}, 13)
},
reload : function(oIndex, oData) {
this.index = oIndex;
this.data = oData;
this.init();
},
init : function() {
if( this.index.length > 0 ) {
for (var i=0,cnt=this.index.length; i0) {
this.stop(true, freeLog);
var targetLi = jQuery("#vclip_Li_" + index)[0];
var isSpecial = this.isSpecial(targetLi);
this.deletePlay(isSpecial);
var clipid = this.data[data_index].clipid || "";
var indexTarget = this.findPlayPos(targetLi);
var oLi = document.createElement("li");
jQuery(oLi).addClass("li_vod");
jQuery(oLi).attr('style', 'display:none;');
var html = ' -1) {
playerIdx = i;
}
}
return {'playIdx':playIdx, 'playerIdx':playerIdx};
},
resizeDaumWrap: function() {
var daumWarp = jQuery('#daumWrap');
var vclipWidth = jQuery(window).width();
daumWarp.removeClass('tab_vclip_2grid');
daumWarp.addClass('tab_vclip_3grid');
daumWarp.removeClass('tab_vclip_4grid');
},
resizePlayer: function() {
var player = jQuery(jQuery('#vclipList li.li_vod iframe')[0]);
var vclipWidth = jQuery(window).width();
var vclipPlayer = jQuery(jQuery('#vclipColl .vclip_player')[0]);
vclipPlayer.removeClass('vclip_2grid');
vclipPlayer.addClass('vclip_3grid');
vclipPlayer.removeClass('vclip_4grid');
player.width(620);
player.height(348);
},
stop : function(skipLogging, freeLog) {
if(this.playIdx < 0) return; _jsVclipLayerBlockId = ""; jQuery(jQuery.find("#vclip_Li_"+this.playIdx)[0]).removeClass("on"); if(jQuery('#speVclip')[0] != null){ jQuery('#speVclip').removeClass('cp_player'); } this.deletePlay(); var clipid = this.data[this.playIdx].clipid || ""; var id = this.data[this.playIdx].id || ""; if(!skipLogging) smartLog(null, "s=DA&a=DATO&dc=VO2&pg=1&r="+(this.playIdx+1)+"&d="+id+"&p=12&rc=1&at=func", event, freeLog); this.playIdx = -1; }, findPlayPos : function(oLi) { if (oLi == null) { return null; } var vclipHeight = oLi.offsetTop; var isSpecial = this.isSpecial(oLi); if (this.isSpecial(oLi)) { return jQuery('#speVclip').next()[0] || null; } else { if (this.type == 'list') { return jQuery(oLi).next()[0] || null; } else if (this.type == 'grid') { var liList = jQuery(oLi).parent().children(); var idx = liList.index(oLi) return liList.eq(Math.floor(idx/3)*3 + 2).next()[0] || null; } } }, deletePlay : function(isSpecial) { var iframe = jQuery("#vclipColl .li_vod iframe"); iframe.attr('src',''); iframe.remove(); var oLi = jQuery("#vclipColl .li_vod"); oLi.remove(); }, get_addtional_vclip: function (player_target, i_id, data_index, cp_type, cp_code, p, freeLog) { var tvpot_type = ''; if (cp_type == this.cpEnum.TVPOT) { tvpot_type = this.get_tvpot_type(data_index); } var id = this.get_addtional_vclip_id(data_index, cp_type, tvpot_type); if (id == undefined || id == '') return; var uuid = "nqiCCBe5bd4B_170816161830684"; var dsid = _jsVclipPlayExec.data[i_id].dsid; var log_url = _jsVclipPlayExec.data[i_id].log_url; var url = './qsearch?w=vclip&m=proxy&uk=' + uk + '&mk=' + mk + '&type=' + cp_type + '&tvpot_type=' + tvpot_type + '&id=' + id + '&clip_id=' + _jsVclipPlayExec.data[data_index].clipid + '&uuid=' + uuid; jq.ajax({ contentType : "application/xml", url : url // 호출할 api url을 셋팅해주세요. }) .done(function( data ) { var xmlDoc = typeof data == 'string'?jq.parseXML(data):data; var xml = jq(xmlDoc); var dataStr = xml.find('ROOT'); var da = JSON.parse(dataStr.text()); var d = da.documents; var s2Id = da.s2Id; if (da.size < 3) return; var html = ''; var size_txt = da.size; if (da.size > 1000) size_txt = '1000+'; var r = i_id + 1; if(p > 0) {
if (cp_type == _jsVclipPlayExec.cpEnum.TVPOT && tvpot_type == _jsVclipPlayExec.tvpotEnum.PLAYLIST && 'tvpotPopular' != da.type) {
html = html + '' + _jsVclipPlayExec.data[i_id].playlist_name + '\
' + d.length + '개 영상 더보기\
\
더보기\
';
} else {
jq(player_target).addClass("recomm_foot");
html = html + '추천영상';
}
html = html + '\
';
}
jq(player_target).html(html);
var page = 0;
if(cp_type == _jsVclipPlayExec.cpEnum.TVPOT && tvpot_type == _jsVclipPlayExec.tvpotEnum.PLAYLIST) {
var pannel = jQuery('#vclip_additional_vclip_pannel');
page = Number(pannel.attr('page')) - 1;
}
_jsVclipPlayExec.change_addtional_vclip_page(page);
})
.fail(function() {
})
.always(function() {
});
},
remove_addtional_vclip_dummy: function() {
jQuery('.vclip_player .list_vclip .addtional_vclip_dummy').remove();
},
reset_addtional_vclip_order: function() {
_jsVclipPlayExec.remove_addtional_vclip_dummy();
var i;
for(i=0; i<20; i++) { var li = jQuery('#addtional_vclip_vclip_li_' + i); if(li[0] === undefined) break; li.parent().append(li); } }, reorder_addtional_vclip: function(page) { _jsVclipPlayExec.remove_addtional_vclip_dummy(); var st = (page-1) * 5 - 1; var ed = page*5 - 1; var parent = jQuery('.vclip_player .list_vclip'); var i; for(i=ed; i>st; i--) {
var li = jQuery('#addtional_vclip_vclip_li_' + i);
if(li[0] === undefined) {
dummy = '';
parent.prepend(dummy);
continue;
}
li.parent().prepend(li);
}
},
change_addtional_vclip_pannel : function(page, minPage, maxPage) {
var prev = '';
var next = '';
if(page == minPage) {
prev = '이전';
} else {
prev = '이전';
}
if(page == maxPage) {
next = '다음';
} else {
next = '다음';
}
var pannel = jQuery('#vclip_additional_vclip_pannel');
pannel.html(prev + next);
},
change_addtional_vclip_page: function(d) {
var pannel = jQuery('#vclip_additional_vclip_pannel');
var page = Number(pannel.attr('page'));
var maxPage = Number(pannel.attr('maxPage'));
var minPage = 1;
page += d;
if(d == 0) page = 0;
if(page >= maxPage) page = maxPage;
if(page <= minPage) page = minPage;
_jsVclipPlayExec.change_addtional_vclip_pannel(page, minPage, maxPage);
_jsVclipPlayExec.reorder_addtional_vclip(page);
pannel.attr('page', page);
},
get_addtional_vclip_li: function(doc, i_id, s2Id, uuid, source, logPThumb, logPTitle, cp_type, i, isSmrPlaylist) {
var title = doc.title.replace(/'/gi, "\\'").replace(/'/gi, "\\'").replace(/"/gi, '"');
var id = '';
if(doc.dsid === undefined || doc.dsid == 'undefined') {
id = doc.vid;
} else {
id = doc.dsid;
}
var logId = ''
if(doc.dsid === undefined || doc.dsid == 'undefined') {
logId = doc.clipId;
} else {
logId = doc.dsid;
}
var r = i_id + 1;
var dateTime = translateTime(doc.date);
if(dateTime.indexOf('전') < 0) {
dateTime = dateTime.substr(2);
}
var bif_cp_id = '';
if(cp_type == this.cpEnum.TVPOT) {
bif_cp_id = '0kakaotv';
} else if (cp_type == this.cpEnum.YOUTUBE) {
bif_cp_id = '7b479cb3';
}
var freeLog = { 'vclip_ext' : {
'bif_cp_id' : bif_cp_id,
'bif_channel_id' : '',
'is_smr' : '',
'is_live' : ''
} };
if(isSmrPlaylist == true) {
freeLog['vclip_ext']['is_smr'] = '1';
}
if(cp_type == this.cpEnum.YOUTUBE) {
freeLog['vclip_ext']['is_smr'] = '-1';
}
var xxonclick = '_jsVclipPlayExec.play(' + i_id + ',' + (i+50) + ', -1,' + JSON.stringify(freeLog).replace(/"/g, '"') +');';
var html = '\
\
';
return html;
},
click_log: function(p, i ,id, at, url, freeLog) {
if(id === undefined || id == 'undefined') {
id = '';
}
var params = "s=DA&a=DATO&dc=VO2&pg=1&r="+i+"&p=" + p + "&rc=1&d=" + id + "&at=" + at;
if(at == 'link' && url !== undefined && url != '') {
params += "&u=" + url;
}
smartLog(null, params, event, freeLog);
},
pushData: function(data, i_id, cp_code) {
for(var i=0; i0?60>a?Math.floor(a)+"초전":3600>a?Math.floor(a/60)+"분전":86400>a?Math.floor(a/3600)+"시간전":new String(c.getFullYear()).concat(".").concat(fillZero(c.getMonth()+1,2)).concat(".").concat(fillZero(c.getDate(),2)):""}
function getDiffSec(a,b){var c=b||rCalendar,d=a&&14===a.length?a:ServerTime;setRegDate(d,cCalendar);var e=(cCalendar.getTime()-c.getTime())/1e3;return e}
function getDiffDay(){return(new Date(cCalendar.getFullYear(),cCalendar.getMonth(),cCalendar.getDate()).getTime()-new Date(rCalendar.getFullYear(),rCalendar.getMonth(),rCalendar.getDate()).getTime())/1e3}
function removeBold(a){if(a == null)return a;return a.replace("", "").replace("", "");}
var fillZero = function(e, a) {
var d = a || 0,
b = e.toString();
if (d < b.length) {
return b
}
while (b.length < d) {
b = "0" + b
}
return b;
}
/* 정확도, 최신 클릭 영역 */
(function(){
var searchOption = new SF.searchOption({
btn : jQuery(jQuery('#vclipColl .coll_tit .btn_flex').get(0)),
container : jQuery('#vclipColl .coll_tabopt'),
btnReset : jQuery('#vclipColl .btn_reset'),
btnClose : jQuery('#vclipColl .btn_close'),
baseParams : {
sd: '',
ed: '',
period: '',
play_time_ge : '',
play_time_le: '',
display: '',
CPVal: '',
page: '',
spemore: ''
}
});
})();
\
';
jQuery(oLi).append(html);
if (indexTarget) {
// indexTarget.parentNode.insertBefore(oLi, indexTarget);
jQuery(oLi).insertBefore(indexTarget);
} else {
this.oList.appendChild(oLi, '');
}
}
var oldPlayer =jQuery('#vclipColl iframe');
oldPlayer.attr('src','');
oldPlayer.remove();
var playVclipLi = document.createElement("div");
playVclipLi.id = "playVclipLi";
jQuery(playVclipLi).addClass("warp_player");
jQuery('#vclipColl .player_main').append(playVclipLi, '');
var playerHead = jQuery('#vclipColl .player_head');
var id = '';
if(this.data[data_index].id !== undefined) id = this.data[data_index].id;
else id = this.data[data_index].vid;
var play_count = this.data[data_index].play_count;
var pc = this.funkyStringSplit(String(play_count)).join();
html = '\
' + this.data[data_index].l_tit + '\
\
\
' + this.data[data_index].cp + '\
재생수' + pc;
html += '';
jQuery(jQuery(playerHead)[0]).html(html);
var player;
switch(cp_type) {
case this.cpEnum.YOUTUBE:
player = new YT.Player('playVclipLi', {
videoId: this.data[data_index].vid,
height: '100%',
width: '100%',
playerVars:{playsinline:1, autoplay:1, wmode:'opaque'},
wmode: 'opaque',
events: {
'onReady': this.ytOnPlayerReady,
}
});
_jsVclipPlayExec.moveToScroll(p);
break;
case this.cpEnum.TVPOT:
player = this.createElement("");
playVclipLi.appendChild(player);
};
var ifr = player;
var offsetFx = isSpecial ? -210 : (this.type == 'grid') ? -170 : -110;
//_jsVclipPlayExec.scrollTo(ifr, {duration:300, offset:offsetFx})
jQuery('#playVclipLi').className = 'tvpot_player';
jQuery("#vclip_Li_"+index).addClass("on");
oLi = null;
this.oLayer.innerHTML = "";
this.oLayer.style.display = "none";
_jsVclipLayerBlockId = index;
if( this.playIdx >= 0 && p > 0) {
jQuery(jQuery.find("#vclip_Li_"+this.playIdx)[0]).removeClass("on");
var prev = jQuery(jQuery.find("#vclip_Li_"+this.playIdx)[0]);
prev.html(this.prevHtml);
}
if(p > 0) smartLog(null, "s=DA&a=DATO&dc=VO2&pg=1&r="+(Number(index)+1)+"&p=" + p + "&rc=1&d=" + this.data[data_index].id + "&at=func", event, freeLog);
this.playIdx = index;
this.prevHtml = jQuery(jQuery.find("#vclip_Li_"+index)[0]).html();
this.resizePlayer();
var playerFoot = '';
if(p>0) {
playerFoot = jQuery('#vclipColl .player_foot');
} else {
playerFoot = jQuery('#vclipColl .player_foot .list_vclip');
}
this.get_addtional_vclip(playerFoot, index, data_index, cp_type, cp_code, p, freeLog);
},
moveToScroll: function(p) {
jQuery('#vclipColl .li_vod').attr('style', '');
if(p>0 || ua_result.ua.indexOf('msie 8.') > -1) {
var point = jQuery('.li_vod').offset()['top'];
var delta = jQuery('#vclipColl .list_item li').eq(0).height() + 30;
var scrollSize = point - delta;
jQuery("html, body").animate({scrollTop: scrollSize}, 300);
}
},
funkyStringSplit : function ( s )
{
var i = s.length % 3;
var parts = i ? [ s.substr( 0, i ) ] : [];
for( ; i < s.length ; i += 3 ) { parts.push( s.substr( i, 3 ) ); } return parts; }, ytOnPlayerReady: function(event) { jQuery('#vclipColl .li_vod').attr('style',''); event.target.playVideo(); }, elementCntPerRow: function() { var maxCnt = 0; var top = 0; var cnt = 0; jQuery.each(jQuery('#vclipList li'), function(idx, elem) { var t = jQuery(elem).position()['top']; if (top == t) { cnt ++; } else { if(cnt > maxCnt) maxCnt = cnt;
top = t;
cnt = 1;
}
});
return maxCnt;
},
elementCntSameRow: function(top) {
var cnt = 0;
jQuery.each(jQuery('#vclipList li'), function(idx, elem) {
var t = jQuery(elem).position()['top'];
if (top == t) {
cnt ++;
}
});
return cnt;
},
isParAWay: function() {
var onElem = jQuery(jQuery('#vclipList li.on')[0]);
if (onElem.length < 1) return true; var onElemTop = onElem.position()['top']; var onElemHeight = onElem.height(); var player = jQuery(jQuery('#vclipList li.li_vod')[0]); var playerTop = player.position()['top']; if (onElemTop + onElemHeight < playerTop) return true; return false; }, beforeWindowWidth: 0, getPlayIdx: function() { var play = jQuery('#vclipList>li.on'); var playId = play.attr('id'); liList = jQuery('#vclipList>li');
var playIdx = 0;
var playerIdx = 0;
for(var i=0; i ' + this.data[data_index].date;
if(play_count !== undefined) html +='\
\
\
\
\
\
- ';
}
var logPThumb = 25;
var logPTitle = 25;
if(cp_type == _jsVclipPlayExec.cpEnum.TVPOT && da.type == 'tvpotPlaylist') {
logPThumb = 26;
logPTitle = 26;
}
_jsVclipPlayExec.pushData(d, i_id, cp_code);
var isSmrPlaylist = false;
if(freeLog && 'vclip_ext' in freeLog) {
if(freeLog['vclip_ext']['is_smr'] == '1') {
if (cp_type == _jsVclipPlayExec.cpEnum.TVPOT && da.type == 'tvpotPlaylist') {
isSmrPlaylist = true;
}
}
}
for(var i=0; i
\
\
\
\
' + doc.playTime + '\
\
\
\
' + doc.title + '\
\
' + doc.cp + '\
\
' + dateTime + '\
\
\
';
html = html + '동영상
정확도 최신