(function($, window, document) { document.domain = 'joins.com'; var noImage = utils.config('imagePath') + '/mw/article/v_noimg_comment.png'; var reporterDataUrl = utils.config('staticPath') + '/scripts/data/reporter.info.js'; var loginPageUrl = 'https://my.joins.com/login/login_mobile_web_type2.asp'; $.fn.comment = function(options) { var WEB_PATHS = { pc: utils.config('webPcPath'), mobile: utils.config('webMobilePath') }; var REFER_URL = { article: 'joongang.joins.com/article', reporter: 'joongang.joins.com/reporter', jtbc: 'joongang.joins.com/jtbc', jpod: 'joongang.joins.com/jpod' }; var isLogin = false, // 로그인 상태 여부 isWrite = true; // 글을 등록할 수 있는지 여부 var apiPath = utils.config('apiPath'); var per_page = 3; var defaults = { id: '', language: 'ko', page: 'article', //article,repoter,jtbc,jpod currentPage: 1, perPage: per_page, enabledPaste: false, enabledCopy: false, enabledDrag: false, enabledSort: true, sortType: 'new', //new, good, bad referUrl: '' }, config = $.extend(true, defaults, options), userInfo = null, reporterInfo = {}, commentLanguage = window.commentLanguage[config.language], commentHtml = window.commentHtml(config.lang), commentDatas = {displayCount : 0, List : [], Count : 0}, reporterCookieName = 'reporterInfo'; (function() { var reporterCookieInfo = utils.getCookie(reporterCookieName); userInfo = commentUserInfo.getInfo(); isLogin = commentUserInfo.isLogin(); if(reporterCookieInfo !== null) { reporterCookieInfo = reporterCookieInfo.split('&'); for(var i = 0, len = reporterCookieInfo.length; i < len; i++) { var minfo = reporterCookieInfo[i].split('='), key = minfo[0], value = minfo[1]; if(key === 'REP_NAME') { value = decodeURIComponent(value); } if(key === 'REP_VIEW_IMG') { value = decodeURIComponent(value); } reporterInfo[key] = value; } if(reporterInfo.JOINS_ID === userInfo.id) { //기자이다! userInfo.profileImage = reporterInfo.REP_VIEW_IMG; userInfo.reporterSEQ = reporterInfo.REP_SEQ; } else { //remove cookie utils.removeCookie(reporterCookieName, COOKIE_CONDITION.path, COOKIE_CONDITION.domain); } } else { if(isLogin === true) { getReporterList(function() { //기자정보 서치 reporterInfo = fnGetRepoterInfoByJoinsId(userInfo.id); //rInfos = fnGetRepoterInfoByJoinsId('choyg94');//test if(rInfos !== null) { userInfo.profileImage = reporterInfo.REP_VIEW_IMG; userInfo.reporterSEQ = reporterInfo.REP_SEQ; utils.setCookie('reporterInfo', $.param(reporterInfo), 1, COOKIE_CONDITION.path, COOKIE_CONDITION.domain); } }); } } init('new'); })(); function ajaxPost(obj) { utils.ajaxPost({ url: obj.url, data: obj.params, success: function(res) { obj.callback && obj.callback(res); } }); } function submitComment(obj) { var params = { ParentId: obj.seqId, Content: obj.content.replace(/<[^>]*>/g, ' '), UserId: userInfo.id, UserName: userInfo.name, UserImage: userInfo.profileImage, UserLoginType: userInfo.type, GroupId: 0, UsedCache: false, ReferUrl: config.referUrl }; if(config.page === 'article') { params.TotalId = config.id; } if(config.page === 'reporter') { params.ReporterId = config.id; } if (config.page === 'jpod') { params.TotalId = config.id; } ajaxPost({ url: apiPath + '/comment', params: params, callback: function (resData) { var errorText = ''; if(resData.IsSuccess) { obj.callback && obj.callback(resData); isWrite = false; setTimeout(function() { isWrite = true; }, 60000); } else { switch (resData.Code) { case 'BadIp': errorText = commentLanguage.errorBadIp; break; case 'BadWord': errorText = resData.Target + commentLanguage.errorBadWord; break; case 'BadUserId': errorText = resData.Target + commentLanguage.errorBadUser; break; default: errorText = commentLanguage.fail; } alert(errorText); } } }); } function getReporterList(callback) { $.getScript(reporterDataUrl, function() { try { callback && callback(); } catch(e) { } }); } function getCommentList(obj) { var url = '';// config.page !== 'jtbc' ? apiPath + '/' + config.page + '/' + config.id + '/comment' : apiPath + '/' + config.page + '/comment'; if (config.page === 'jtbc' || config.page === 'event') { url = apiPath + '/event/comment'; } else { url = apiPath + '/' + config.page + '/' + config.id + '/comment'; } var params = { page: obj.currentPage || config.currentPage, pagesize: obj.perPage || config.perPage, sort: config.sortType, referurl: config.referUrl }; if(config.page !== 'jtbc') { params.UserId = userInfo.id; } $.ajax({ url: url, contentType: 'text/plain', data: params, dataType: 'jsonp', success: function (res) { obj.callback && obj.callback(res); }, error: function (request, status, error) { if (request.status === 200 && request.responseText === undefined) {} } }); } function commentVotePost(obj) { ajaxPost({ url: apiPath + '/comment/' + obj.id + '/' + obj.type + '/' + utils.getCookie('PCID'), callback: function(res) { obj.callback && obj.callback(res); } }); } function commentReportPost(obj) { ajaxPost({ url: apiPath + '/comment/' + obj.id + '/report', callback: function(res) { if(res.IsSuccess) { alert(commentLanguage.reportTrue); obj.callback && obj.callback(); } else { alert(commentLanguage.reportFail); } } }); } function commentDeletePost(obj) { var params = {}; if(config.page === 'article') { params.TotalId = obj.totalid; } if(config.page === 'reporter') { params.ReporterId = obj.reporterid; } params.Id = obj.id; utils.ajaxPost({ url: apiPath + '/comment/' + obj.id + '/delete', data: params, success: function() { obj.callback && obj.callback(); } }); } function emptyComment($t) { $t.focus(); alert(commentLanguage.errorEmptyContent); } function reSetPageValue() { config.currentPage = 1; config.perPage = per_page; } function fnResetCmtInput() { var txtId = "txtcmt"; var divId = "div_cmt_write"; $("#" + txtId).val(''); $("#" + txtId).css("height", "1px").css("height", (4 + $("#" + txtId).prop("scrollHeight")) + "px"); $("#" + divId).removeClass(); $("#" + divId).addClass('cmt_write cmt_focus'); } function updateCommentDatas(data, isReplace) { commentDatas.Count = data.Count; if (isReplace) { commentDatas.displayCount = data.displayCount; commentDatas.List = []; for (var i = 0, len = data.List.length; i < len; i++) { if (IsActiveComment(data.List[i], data.List)) { commentDatas.List.push(data.List[i]); } } if ((commentDatas.List.length == 0) && data.List.length > 0) { getCommentList({ currentPage: config.currentPage, perPage: per_page + 1, callback: function (datas) { commentDatas.Count = datas.Count; commentDatas.displayCount = datas.displayCount; commentDatas.List = []; for (var i = 0, len = datas.List.length; i < len; i++) { if (IsActiveComment(datas.List[i], datas.List)) { commentDatas.List.push(datas.List[i]); } } } }); } } else { for (var i = 0, len = data.List.length; i < len; i++) { commentDatas.List.push(data.List[i]); } } } function IsActiveComment(comment, commentList) { if (comment.IsDelete != 'D') { return true; } else { for (var i = 0; i < commentList.length; i++) { if (commentList[i].Id == comment.Id) continue; if ((comment.Id == commentList[i].ParentId) && (commentList[i].IsDelete == 'A')) { return true; } } return false; } } function fnCommentItem(commentDatas) { var html = ''; $.each(commentDatas.List, function () { var userID = ''; if (this.UserLoginType.toLowerCase() === 'joins' && this.IsReporter === true) { userID = this.UserName + ' ' + commentLanguage.isReporter; } else if (this.UserLoginType.toLowerCase() === 'joins' && this.IsJplusJouralist === true) { userID = this.UserName; } else if (this.UserLoginType.toLowerCase() !== 'joins') { userID = this.UserName; } else { userID = this.UserId; } if (this.IsReporter !== true) { if (userID.length > 4) { userID = userID.substring(0, 4) + "****"; } else { var len = userID.length / 2; userID = userID.substring(0, len) + "****"; } } var isReply = this.Id !== this.ParentId ? true : false; var isReplyClass = ''; var isRelpyID = ''; if (isReply) { isReplyClass = 'cmt_replay'; if ($("#isReplyUserId").val() !== undefined) { isRelpyID = '@' + $("#isReplyUserId").val() + ' '; } } else { $("#isReplyUserId").val(userID); } var isMyWriting = false; var isMyWritingHtml = ''; if (isLogin === false || userInfo.id !== this.UserId) { isMyWriting = false; } else { isMyWriting = true; isMyWritingHtml = 'cmt_my'; } var content = ''; var delFlag = false; switch (this.IsDelete) { case "D": delFlag = true; content = commentLanguage.removeMessageUser; break; case "N": delFlag = true; content = commentLanguage.removeMessageAdmin; break; default: content = this.Content; break; } html += '
  • '; html += ''; html += '
    '; switch (this.UserLoginType.toLowerCase()) { case "joins": html += '중앙일보로 로그인'; break; case "facebook": html += '페이스북으로 로그인'; break; case "twitter": html += '트위터로 로그인'; break; case "kakao": html += '카카오톡으로 로그인'; break; default: html += '중앙일보로 로그인'; break; } html += '
    '; html += '
    '; html += '
    '; if (this.IsReporter === true) { html += '' + userID + ''; } else { html += '' + userID + ''; } html += '' + this.RegistedDateTime.toDateISO8061().format('yyyy.MM.dd HH:mm') + ''; html += ''; html += '
    '; //html += '작성자의 댓글 모아보기'; if (isMyWriting) { //if (!delFlag) { html += '삭제'; //} } else { html += '신고하기'; } html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += isRelpyID; html += content; html += '

    '; html += '
    '; html += '
    '; html += '
    '; if (!isReply) { html += '답글달기'; } html += '공감' + this.GoodCount + ''; html += '
    '; html += '
    '; html += '
    '; html += ''; html += '
  • '; }); $(".cmt_lst").append(html); } function fnCommentList(commentDatas, type) { var html = ''; html += '
    '; html += '댓글 ' + commentDatas.displayCount + ''; html += '
    '; html += '
    '; html += '
    간편로그인
    '; html += '
    중앙일보
    '; html += '
    페이스북
    '; html += '
    트위터
    '; html += '
    카카오톡
    '; html += '
    '; html += '
    '; html += '
    '; html += '
    '; html += '댓글 쓰기'; html += ''; html += ''; html += '
    '; html += '
    '; html += '
    '; html += ''; html += '
    '; html += '
    '; html += '간편 로그인'; html += '원하시는 계정을 선택해 로그인해 주세요.'; html += ''; html += ''; html += '
    '; html += '
    '; //html += '
    '; //html += '
    '; //html += '댓글을 삭제하시겠습니까?'; //html += ''; //html += '
    '; //html += ''; //html += ''; //html += '
    '; //html += '
    '; //html += '
    '; $("#comment").removeClass(); $("#comment").addClass('cmt_wrap'); $("#comment").html(html); if (type !== 'none') { fnCommentItem(commentDatas); $("#bd_comment").show(); } if (config.sortType === "like") { $("#li_sort_like").addClass("on"); } else { $("#li_sort_new").addClass("on"); } $('#head').find('.btn_cmt').html('댓글' + commentDatas.displayCount + ''); $("#cmt_total_count").text('댓글 ' + commentDatas.displayCount + '개'); // 아티클 하단 총 댓글 수 표시 if (commentDatas.displayCount > 0) { $("#btn_comment").html('' + commentDatas.displayCount + ''); } //article_cmt_cnt // 로그인 처리 if (isLogin) { switch (userInfo.type.toLowerCase()) { case "joins": $("#my_cmt").show(); $("#login_i_jb").addClass("on"); break; case "facebook": $("#login_i_fb").addClass("on"); break; case "twitter": $("#login_i_tw").addClass("on"); break; case "kakao": $("#login_i_kk").addClass("on"); break; } $(".cmt_write").removeClass("cmt_login"); $(".cmt_write").addClass("cmt_focus"); } //간편로그인 열기 $(".cmt_login, .sns a").on('click', function () { $("#layer_snslogin").toggleClass("layeron"); return false; }); //레이어 닫기 $("#btn_close_comment").on('click touchstart', function () { $(".fulllayer, .tooltip_box").removeClass("layeron"); return false; }); //툴팁 레이어 오픈 $(".btn_tooltip").each(function () { $(this).on('click', function () { $(this).next().toggleClass("layeron"); return false; }); }); ////삭제 레이어 오픈 //$(".tooltip_box a[data-action='del']").each(function () { // $(this).on('click touchstart', function () { // $("#layer_cmtdel").toggleClass("layeron"); // return false; // }); //}); //새로고침 $(".btn_refresh").on('click', function () { location.reload(); }); ////레이어 외 누르면 레이어 닫힘 //$(document).on('click touchstart', function (e) { // if (e.target === undefined) return; // var $target = $(e.target); // if ($target.closest(".layer_login, .tooltip_box").length === 0) { // $(this).find(".fulllayer, .tooltip_box").removeClass("layeron"); // } //}); //textarea 입력 시 $("#txtcmt").keyup(function () { //textarea 에 글을 입력하면 자동 리사이징 $(this).css("height", "1px").css("height", (4 + $(this).prop("scrollHeight")) + "px"); //textarea 에 글을 입력하면 스크롤 제거 $("body").find(".full_cmt .bd").removeClass("bd_scroll"); //textarea 글자 제한 if ($(this).val().length > 500) { $(this).val($(this).val().substring(0, 500)); alert("500자를 초과 입력 할 수 없습니다."); } if ($(this).val().length !== 0 || $("#txtReplyId").val().length !== 0) { $("#div_check_area").show(); } if ($(this).val().length === 0 && $("#txtReplyId").val().length === 0) { $("#div_check_area").hide(); $("body").removeAttr("style"); $(".bd").addClass("bd_scroll"); } }); $("#txtcmt").change(function () { //textarea 글자 제한 if ($(this).val().length > 500) { $(this).val($(this).val().substring(0, 500)); alert("500자를 초과 입력 할 수 없습니다."); } if ($(this).val().length !== 0 || $("#txtReplyId").val().length !== 0) { $("#div_check_area").show(); } if ($(this).val().length === 0 && $("#txtReplyId").val().length === 0) { $("#div_check_area").hide(); $("body").removeAttr("style"); $(".bd").addClass("bd_scroll"); } }); } function init(sort) { if ($("#comment").length === 0) { var html = '
    '; $("body").prepend(html); } if ($("#isReplyUserId").length === 0) { var html = ''; $("#comment").before(html); } try { config.referUrl = config.referUrl !== '' ? config.referUrl : REFER_URL[config.page]; config.perPage = 5; config.sortType = sort; } catch (e) { alert('잘못된 호출입니다.'); } fnCommentList(commentDatas, 'none'); getCommentList({ callback: function (datas) { updateCommentDatas(datas, true); fnCommentList(datas, ''); } }); //button events $("#comment").unbind(); if (config.enabledCopy === false) { $("#comment").on('copy', 'textarea', function () { alert(commentLanguage.errorCopy); return false; }); } if (config.enabledPaste === false) { $("#comment").on('paste', 'textarea', function () { alert(commentLanguage.errorPast); return false; }); } $("#comment").on('click', '.btn_reply', function () { var $reply = $(this); $("#txtReplyId").val($reply.data('replyid')); $("#emReplyId").html($reply.data('replyname')); $("#div_check_area").show(); $("#txtcmt").focus(); return false; }).on('click', '.btn_recomm', function () { var $up = $(this); commentVotePost({ type: 'like', id: $up.data('voiteid'), callback: function (res) { var code = res.Code; if (res.IsSuccess) { var goodCount = parseInt($up.find('.good').text(), 10); $up.find('.good').text(goodCount + 1); } else { switch (code) { case 'Duplicated': msg = '중복된 참여입니다.'; break; case 'NotPeriod': msg = '기간이 아닙니다.'; break; default: msg = '데이타 처리에 문제가 발생하였습니다.'; break; } alert(msg); } } }); return false; }).on('click', '.report', function () { var $report = $(this); var result = confirm(commentLanguage.reportMessage); if (result === true) { commentReportPost({ id: $report.data('reportid') }); } return false; }).on('click', '.delete', function () { var $delete = $(this), deleteId = $delete.data('deleteid'); var opts = { id: deleteId, callback: function () { alert(commentLanguage.deleteComment); commentDatas.displayCount = commentDatas.displayCount - 1; var count = parseInt($("#sp_displayCount").text(), 10); if (count > 0) { $(".displayCount").text(count - 1); $('#head').find('.btn_cmt').html('댓글' + (count - 1) + ''); } if (commentDatas.displayCount == 0) { $('#head').find('.btn_cmt').html('댓글0'); fnCommentList(commentDatas, 'none'); } else { $("#li_" + deleteId).remove(); } } }; if (config.page === 'article') { opts.totalid = $delete.data('targetid'); } if (config.page === 'reporter') { opts.reporterid = $delete.data('targetid'); } commentDeletePost(opts); return false; }).on('click', '.btn_del', function () { $("#txtReplyId").val(''); $("#emReplyId").html(''); $("#txtcmt").val(''); $("#txtcmt").css("height", "1px").css("height", (4 + $("#txtcmt").prop("scrollHeight")) + "px"); $("#txtcmt").focus(); $("#div_check_area").hide(); $("body").removeAttr("style"); $(".bd").addClass("bd_scroll"); return false; }).on('focus', '#div_cmt_write', function () { var $write = $(this); $write.removeClass("cmt_focus"); $write.addClass("cmt_open cmt_writing"); //$("#div_check_area").show(); return false; }).on('click', '.sns_login', function () { commentUserInfo.logout(); //cookie remove commentUserInfo.init(); // get cookie }).on('click', '#sort_like', function () { config.currentPage = 1; init('like'); }).on('click', '#sort_new', function () { config.currentPage = 1; init('new'); }).on('submit', 'form', function () { var value = $("#txtcmt").val(); var seq = $("#txtReplyId").val(); if (isWrite === false) { alert(commentLanguage.errorWrite); return false; } if (value.length === 0 || value.replace(/(^\s*)|(\s*$)/g, "").length === 0) { emptyComment($("#txtcmt")); return false; } if (seq === "") { seq = 0; } submitComment({ seqId: seq, content: value, callback: function (resData) { if (resData.IsSuccess == true) { if (seq === 0) { var html = ''; var userID = ''; if (resData.Item.UserLoginType.toLowerCase() === 'joins' && resData.Item.IsReporter === true) { userID = resData.Item.UserName + ' ' + commentLanguage.isReporter; } else if (resData.Item.UserLoginType.toLowerCase() === 'joins' && resData.Item.IsJplusJouralist === true) { userID = resData.Item.UserName; } else if (resData.Item.UserLoginType.toLowerCase() !== 'joins') { userID = resData.Item.UserName; } else { userID = resData.Item.UserId; } if (resData.Item.IsReporter !== true) { if (userID.length > 4) { userID = userID.substring(0, 4) + "****"; } else { var len = userID.length / 2; userID = userID.substring(0, len) + "****"; } } html += '
  • '; html += ''; html += '
    '; switch (resData.Item.UserLoginType.toLowerCase()) { case "joins": html += '중앙일보로 로그인'; break; case "facebook": html += '페이스북으로 로그인'; break; case "twitter": html += '트위터로 로그인'; break; case "kakao": html += '카카오톡으로 로그인'; break; default: html += '중앙일보로 로그인'; break; } html += '
    '; html += '
    '; html += '
    '; html += '' + userID + ''; html += '' + resData.Item.RegistedDateTime.toDateISO8061().format('yyyy.MM.dd HH:mm') + ''; html += ''; html += '
    '; html += '삭제'; html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += resData.Item.Content; html += '

    '; html += '
    '; html += '
    '; html += '
    '; html += '답글달기'; html += '공감' + resData.Item.GoodCount + ''; html += '
    '; html += '
    '; html += '
    '; html += ''; html += '
  • '; $(".cmt_lst").prepend(html); //툴팁 레이어 오픈 $("#btn_tooltip_" + resData.Item.Id).on('click', function () { $("#btn_tooltip_" + resData.Item.Id).next().toggleClass("layeron"); return false; }); $("#li_" + resData.Item.Id).on('click', '.delete', function () { var $delete = $(this), deleteId = $delete.data('deleteid'); var opts = { id: deleteId, callback: function () { alert(commentLanguage.deleteComment); commentDatas.displayCount = commentDatas.displayCount - 1; var count = parseInt($("#sp_displayCount").text(), 10); if (count > 0) { $(".displayCount").text(count - 1); $('#head').find('.btn_cmt').html('댓글' + (count - 1) + ''); } if (commentDatas.displayCount == 0) { $('#head').find('.btn_cmt').html('댓글0'); fnCommentList(commentDatas, 'none'); } else { $("#li_" + deleteId).remove(); } } }; if (config.page === 'article') { opts.totalid = $delete.data('targetid'); } if (config.page === 'reporter') { opts.reporterid = $delete.data('targetid'); } commentDeletePost(opts); return false; }).on('click', '.btn_reply', function () { var $reply = $(this); $("#txtReplyId").val($reply.data('replyid')); $("#emReplyId").html($reply.data('replyname')); $("#txtcmt").focus(); return false; }); } else { var html = ''; var userID = ''; if (resData.Item.UserLoginType.toLowerCase() === 'joins' && resData.Item.IsReporter === true) { userID = resData.Item.UserName + ' ' + commentLanguage.isReporter; } else if (resData.Item.UserLoginType.toLowerCase() === 'joins' && resData.Item.IsJplusJouralist === true) { userID = resData.Item.UserName; } else if (resData.Item.UserLoginType.toLowerCase() !== 'joins') { userID = resData.Item.UserName; } else { userID = resData.Item.UserId; } if (resData.Item.IsReporter !== true) { if (userID.length > 4) { userID = userID.substring(0, 4) + "****"; } else { var len = userID.length / 2; userID = userID.substring(0, len) + "****"; } } var isRelpyID = $("#emReplyId").html(); html += '
  • '; html += ''; html += '
    '; switch (resData.Item.UserLoginType.toLowerCase()) { case "joins": html += '중앙일보로 로그인'; break; case "facebook": html += '페이스북으로 로그인'; break; case "twitter": html += '트위터로 로그인'; break; case "kakao": html += '카카오톡으로 로그인'; break; default: html += '중앙일보로 로그인'; break; } html += '
    '; html += '
    '; html += '
    '; html += '' + userID + ''; html += '' + resData.Item.RegistedDateTime.toDateISO8061().format('yyyy.MM.dd HH:mm') + ''; html += ''; html += '
    '; //html += '작성자의 댓글 모아보기'; html += '삭제'; html += '
    '; html += '
    '; html += '
    '; html += '

    '; html += '' + isRelpyID + ''; html += resData.Item.Content; html += '

    '; html += '
    '; html += '
    '; html += '
    '; html += '공감' + resData.Item.GoodCount + ''; html += '
    '; html += '
    '; html += '
    '; html += ''; html += '
  • '; $("#li_" + seq).after(html); //툴팁 레이어 오픈 $("#btn_tooltip_" + resData.Item.Id).on('click', function () { $("#btn_tooltip_" + resData.Item.Id).next().toggleClass("layeron"); return false; }); $("#li_" + resData.Item.Id).on('click', '.delete', function () { var $delete = $(this), deleteId = $delete.data('deleteid'); var opts = { id: deleteId, callback: function () { alert(commentLanguage.deleteComment); commentDatas.displayCount = commentDatas.displayCount - 1; var count = parseInt($("#sp_displayCount").text(), 10); if (count > 0) { $(".displayCount").text(count - 1); } if (commentDatas.displayCount == 0) { fnCommentList(commentDatas, 'none'); } else { $("#li_" + deleteId).remove(); } } }; if (config.page === 'article') { opts.totalid = $delete.data('targetid'); } if (config.page === 'reporter') { opts.reporterid = $delete.data('targetid'); } commentDeletePost(opts); return false; }); } } $("#txtReplyId").val(''); $("#emReplyId").html(''); $("#txtcmt").val(''); $("#div_check_area").hide(); var count = parseInt($("#sp_displayCount").text(), 10); $(".displayCount").text(count + 1); $('#head').find('.btn_cmt').html('댓글' + (count + 1) + ''); $("body").removeAttr("style"); $("#bd_comment").show(); $("#btn_submit").blur(); fnResetCmtInput(); commentDatas.displayCount = commentDatas.displayCount + 1; alert(commentLanguage.success); } }); //GA코드 통합의 댓글 등록 이벤트 추가 try { ga('total.send', 'event', 'Engaging', 'Comment', document.title, 1); } catch (e) { } return false; }); } return this; }; })(jQuery, window, document);