Original source (on modern site) | Article images: [1]
');
win.document.close();
var objAgent = navigator.userAgent;
if (objAgent.indexOf('Edge') > -1) {
// 엣지임.
// 엣지에서는 엣지 버그로 인해 인쇄창 닫아도 win.close()가 실행되지 않음.
// 엣지에서 익스 버전을 바꿔도 마찬가지.
// 익스플로러 들어가서 하면 거긴 됨.
win.onafterprint = function () {
// win.close();
// setTimeout(function () { win.close() }, 500);
return true;
}
} else if (objAgent.indexOf('Trident') > -1) {
// 익스
win.onafterprint = function () {
// win.close();
setTimeout(function () { win.close() }, 500);
return true;
}
} else {
// 익스 엣지 빼고 다
win.onafterprint = function () {
win.close();
return true;
}
}
});
$('#btnOpenFontSizePopup').on('click', function (){
if ($('#popupFontSize').css('display') == 'none'){
sharePopupClose();
$('#popupFontSize').show();
} else {
$('#popupFontSize').hide();
}
});
$(".btnChangeFontSize").on('click', function() {
var fontSize = $(this).data().size;
$('.view_text').css("fontSize", '');
$('.article_content').css("fontSize", '');
var articleTxt = $(".article_content > p");
if (!(fontSize == 14 || fontSize == 16 || fontSize == 18 || fontSize == 20 )) return false;
$('.font_btn').removeClass('font_size_on');
$(this).find('.font_btn').addClass('font_size_on');
articleTxt.css("fontSize", fontSize);
switch(fontSize){
case 14:
break;
case 16:
break;
case 18:
break;
case 20:
break;
default:
return false;
}
return true;
});
$('.btnGetReword').click(function () {
if(clientId == 0){
$.loginPopupOpen('referral');
}/* else if (clientCertificated == 'N') {
$('#certificationModalWrap').show();
}*/
});
$.articleVoting = function () {
var articleId = "176309";
if(clientId == 0){
$.loginPopupOpen('');
return false;
}
$.ajax({
url: '/article/ajax/addArticleVoting',
type: 'post',
data: {
clientId: clientId,
articleId: articleId
},
dataType: 'json',
success: function (response) {
if (response.error != 0) {
if (response.error == 99) {
alert(response.message);
return;
} else {
alert(response.message);
return;
}
}
$('.newsLike').addClass('greyBanner');
if(response.voteCancel == 'Y'){
var voteCount = parseInt($('.articleLikeCountTitle:first').text()) - 1;
// $('.articleLikeCount').text(voteCount);
$('.articleLikeCountTitle').text( voteCount);
$('.basicHeart').show();
$('.redHeart').hide();
$('.remoteControlLike').hide();
$('.remoteControlNoLike').show();
$('.stamp_like').removeClass('stamp_on');
$('.btnVoteArticle').find('.stamp_num').html(voteCount);
} else if(response.vote == 'Y'){
var voteCount = parseInt($('.articleLikeCountTitle:first').text()) + 1;
// $('.articleLikeCount').text(voteCount);
$('.articleLikeCountTitle').text( voteCount);
$('.basicHeart').hide();
$('.redHeart').show();
$('.remoteControlLike').show();
$('.remoteControlNoLike').hide();
$('.stamp_like').addClass('stamp_on');
$('.btnVoteArticle').find('.stamp_num').html(voteCount);
}
if(response.rewardPopupDisplay == 'Y') {
showPointModal();
}
//location.reload();
},
error: function (xhr, ajaxOptions, thrownError) {
if (xhr.status > 0) {
alert('server error');
}
}
});
return false;
};
$('#btnScrapArticle').on('click', function (){
var articleId = "176309";
if(clientId == 0){
$.loginPopupOpen('');
return false;
} else {
$.articleScrap(clientId, articleId);
}
});
$.articleScrap = function(clientId, articleId){
if (clientId == 0 || articleId == 0) return false;
$.ajax({
url: '/article/ajax/scrapArticle',
type: 'post',
data: {
clientId: clientId,
articleId: articleId
},
dataType: 'json',
success: function (response) {
if (response.error == 0) {
if (response.scrap == 'Y') {
$('#btnScrapArticle').find('.remoteControlScrapOn').show();
$('#btnScrapArticle').find('.remoteControlScrapOff').hide();
} else {
$('#btnScrapArticle').find('.remoteControlScrapOn').hide();
$('#btnScrapArticle').find('.remoteControlScrapOff').show();
}
} else {
alert(response.message);
}
return false;
},
error: function (xhr, ajaxOptions, thrownError) {
if (xhr.status > 0) {
alert('server error');
return false;
}
}
});
};
$('.btnStampArticle').on('click', function (){
if ($(this).hasClass('stamp_on') == true) return false;
var articleId = "176309";
if(clientId == 0){
$.loginPopupOpen('');
return false;
} else {
$.articleStamp(clientId, articleId);
}
});
$.articleStamp = function(clientId, articleId){
if (clientId == 0 || articleId == 0) return false;
$.ajax({
url: '/article/ajax/stampArticle',
type: 'post',
data: {
clientId: clientId,
articleId: articleId
},
dataType: 'json',
success: function (response) {
if (response.error == 0) {
if (response.stamp == 'Y') {
$('.stamp_daily').addClass('stamp_on');
$('.stampCount').html(response.count);
var wrap = $('.article_stamp_contents');
if (response.count > 0) {
wrap.find('.stamp_none_txt').remove();
}
wrap.html('');
var html = '';
if(response.size >= 1) {
for (var i = 0; i < response.size; i++) {
html = '';
html += ' ';
html += '';
if (response['items'][i]['clientId'] == clientId) {
html += ' ' + response['items'][i]['nickname'] + ' ';
} else {
html += ' ' + response['items'][i]['nickname'] + ' ';
}
html += ' ' + response['items'][i]['regTimestampHi'] + ' ';
html += ' ';
wrap.append(html);
}
}
/*html += ' ';
html += '';
html += ' ' + response['item']['nickname'] + ' ';
html += ' ' + response['item']['timestamp'] + ' ';
html += ' ';
wrap.prepend(html);*/
}
} else {
}
return false;
},
error: function (xhr, ajaxOptions, thrownError) {
if (xhr.status > 0) {
alert('server error');
return false;
}
}
});
};
// $('.viewLike').on("click",function (){
// if(clientId == 0){
// $.loginPopupOpen('');
// } else {
// $.articleVoting();
// }
// });
$('.likeBg').on("click",function (){
if(clientId == 0){
$.loginPopupOpen('');
} else {
$.articleVoting();
}
});
//$('body').append('