'; return _html; }, post_comment : function (mode) { var _t = this; mode = (mode == undefined) ? 'comment' : 'reply'; global_comment_src = (typeof(global_comment_src) == 'undefined') ? '' : global_comment_src; if (mode == 'comment') { txt_comment = $('#body_comment').val(); // check_facebook = ($('#check_facebook')[0].checked == true) ? 1 : 0; $.post( "/comment/process", { 'use_id':_t.use_id,'src':'CON',act:'post_comment',body_comment:txt_comment,content_headline:_t.content_headline,content_url:_t.content_url},function(data){ if (data.status == 'success') { _t.show_form_comment_thankyou(); return true; } },'JSON'); } else if (mode == 'reply') { txt_comment = $('#body_reply').val(); // check_facebook_reply = ($('#check_facebook_reply')[0].checked == true) ? 1 : 0; $.post( "/comment/process", { 'use_id':_t.use_id,'src':'CON',act:'post_comment',body_comment:txt_comment,content_headline:_t.content_headline,content_url:_t.content_url,parent_id:_t.reply_for_comment_id},function(data){ if (data.status == 'success') { _t.show_form_comment_thankyou('reply'); return true; } },'JSON'); } }, clear_form_comment : function() { $('#body_comment').val(''); }, validate_comment : function(mode) { var _t = this; mode = (mode == undefined) ? 'comment' : mode; if (mode == 'comment') { txt_comment = $('#body_comment').val(); txt_comment = txt_comment.replace(/^\s+|\s+$/gm,''); if (txt_comment == '') { return false; } // if ($('#check_comment_agree')[0].checked != true) { //alert('Please check agreement.'); // $('#check_comment_agree').parent().next().children().show(); // return false; // } // if ($('#check_facebook')[0].checked == true && !is_facebook_login) { // goProcessFacebook('post_comment_v2'); // return false; // } _t.post_comment(); } else if (mode == 'reply') { txt_comment = $('#body_reply').val(); txt_comment = txt_comment.replace(/^\s+|\s+$/gm,''); if (txt_comment == '') { return false; } // if ($('#check_reply_agree')[0].checked != true) { //alert('Please check agreement.'); // $('#check_reply_agree').parent().next().children().show(); // return false; // } // if ($('#check_facebook_reply')[0].checked == true && !is_facebook_login) { // goProcessFacebook('post_comment_reply'); // return false; // } _t.post_comment('reply'); } }, get_template_post_comment: function() { var _t = this; // เชค member login จาก g_member g_member.get_member_login(function(){ var _elm = $('.box-add-comment'); if (g_member.is_member_login) { _elm.html( '