',
directives = {
list: {
item: {
}
}
};
utils.opinionCast.init();
utils.opinionCast.onAir = function (onAirInfo) {
utils.log('## utils.opinionCast.onAir');
// Wide Banner 설정 (s)
//var html = $.renderTemplate({ data: data, template: template, directives: directives });
var model = {};
try {
model = utils.convertList(index_onair_schedule);
} catch (e) { utils.log(e); };
var link = 'http://news.joins.com/opinion/opinioncast';
var title = model[0].title;
var content = model[0].content;
utils.log(model);
var html = '' +
'
';
//}
$("#divRelateTag").html(html);
// 관련 태그 뉴스 Cloc
$w.find('a').each(function () {
$(this).attr('href', utils.getClocUrl($(this).attr('href'), 'joongang|article|tagnews'));
});
},
error: function () {
$("#divRelateTag").hide();
}
})
).then(function () {
var slideFtArticle = {
init: function () {
this.slideInit();
},
slideInit: function () {
var related_slide = $('#related_slide_wrap').slick({
arrows: true,
dots: true,
infinite: true,
speed: 300,
slidesToShow: 1,
slidesToScroll: 1
});
}
};
slideFtArticle.init();
});
};
$.fn.widgetRealtimeArticle = function () {
$this = this;
var apiUri = utils.config('apiPath') + "/pagecall/?u=" + utils.config('staticPath') + "/scripts/data/sonagi/json/rcmkwd.json";
$.when(
$.ajax({
type: "GET",
dataType: 'json',
url: apiUri,
success: function (data) {
var html = '';
var kwdCnt = data.length;
html += '
포털 실시간 검색어
';
if (kwdCnt > 4) {
$.each(data, function (i, v) {
var articleLink = utils.getUrlFormat(URL_NAMES.article, this.total_id);
var thumbnail = utils.getIrPath(utils.getPdsFullPath(this.art_thumb), 84, 57);
var rank = i < 3 ? '' + (i + 1) + '' : '' + (i + 1) + '';
if (kwdCnt < 8 && i > 4) { }
else {
if (i == 0 || i == 5) { html += '
';
});
$(".sub_innov_lab .slide_wrap").html(itemHtml);
if ($("div.slide[data-src='focus-item']", $(".sub_innov_lab .slide_wrap")).length > 0) {
$("div.slide[data-src='']", $(".sub_innov_lab .slide_wrap")).remove();
}
$(".sub_innov_lab .slide_wrap").show();
$("#widget_innovation_lab").show();
widgetSponsoredContents();
},
error: function () {
}
})
).then(function () {
var nSlideCounter = $("div.slide", $(".sub_innov_lab .slide_wrap")).length;
var nFirstSlideIdx = Math.floor(Math.random() * nSlideCounter);
var slideInnovationLab = {
init: function () {
this.slideInit();
},
slideInit: function () {
var slide = $('.sub_innov_lab .slide_wrap').slick({
arrows: true,
dots: false,
infinite: false,
speed: 300,
slidesToShow: 1,
slidesToScroll: 1,
initialSlide: nFirstSlideIdx
});
}
};
slideInnovationLab.init();
});
function widgetSponsoredContents() {
$.when(
$.ajax({
type: "GET",
url: utils.config('apiPath') + "/pagecall/?u=" + utils.config('staticPath') + "/scripts/data/home/xml/right_digital_ad.xml",
dataType: "XML",
success: function (xml) {
var itemHtml = '
';
var i = 0;
$(xml).find("article").each(function () {
if (i < 3) {
var title = $(this).find("title").text();
var link = $(this).find("link").text();
itemHtml += '
';
$this.html(html);
$this.show();
} catch (e) {
$this.hide();
}
},
error: function () {
$this.hide();
}
})
)
};
$.fn.widgetArticleMicBanner = function () {
var html = "";
$.ajax({
type: "GET",
dataType: 'json',
url: utils.config('apiPath') + '/static/breakingnews',
success: function (data) {
$.each(data, function () {
var title = this.Title;
var link = this.Link;
var target = this.Target;
if (title !== undefined && title !== "" && title !== "undefined") {
if (link !== undefined && link !== "" && link !== "undefined") {
if (link.indexOf("?") !== -1) {
html = '' + title + '';
} else {
html = '' + title + '';
}
}
}
else {
html = '[시민마이크] 내가 바꾸는 대한민국, 당신의 목소리를 들려주세요';
}
$("#widget_mic_banner").html(html);
$("#widget_mic_banner").show();
});
},
error: function () {
$("#widget_mic_banner").hide();
}
});
};
//추천 테마
$.fn.widgetRecommendedTheme = function () {
var $this = this;
try {
var html = '' +
'