(function ($) { $.fn.visible = function (partial) { var $t = $(this), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top, _bottom = _top + $t.height(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom; return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); }; })(jQuery); function setHomepage() { if (document.all) { document.body.style.behavior = 'url(#default#homepage)'; document.body.setHomePage('http://thitruongtaichinhtiente.vn'); } else if (window.sidebar) { if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true"); } } var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage', 'http://thitruongtaichinhtiente.vn'); } } function isMobile() { var check = false; (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true })(navigator.userAgent || navigator.vendor || window.opera); return check; } function convertJsonDate(param) { var KKK = param.substr(6, 13); var currentTime = new Date(parseInt(KKK)); var month = currentTime.getMonth() + 1; var day = currentTime.getDate(); var year = currentTime.getFullYear(); var hour = currentTime.getHours(); var minute = currentTime.getMinutes(); var date = day + "/" + month + "/" + year + " " + hour + ":" + minute; return (date); } var frienly_title = function frienly_title(str) { str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/gui, "a"); str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/gui, "e"); str = str.replace(/ì|í|ị|ỉ|ĩ/gui, "i"); str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/gui, "o"); str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/gui, "u"); str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/gui, "y"); str = str.replace(/đ/g, "d"); str = str.replace(/À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ/g, "A"); str = str.replace(/È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ/gui, "E"); str = str.replace(/Ì|Í|Ị|Ỉ|Ĩ/g, "I"); str = str.replace(/Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ/gui, "O"); str = str.replace(/Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ/gui, "U"); str = str.replace(/Ỳ|Ý|Ỵ|Ỷ|Ỹ/gui, "Y"); str = str.replace(/Đ/gui, "D"); str = str.replace(/\u0300|\u0301|\u0303|\u0309|\u0323/g, ""); // huyền, sắc, hỏi, ngã, nặng str = str.replace(/\u02C6|\u0306|\u031B/g, ""); // mũ â (ê), mũ ă, mũ ơ (ư) str = str.replace(/\(|\)/gui, ""); str = str.replace(/\./gui, "-"); str = str.replace(/ /gui, "-"); str = str.replace(/--/gui, "-"); return str.replace("--", "-"); }; function change_title(str1) { str1 = str1.replace("(", "\\("); str1 = str1.replace(")", "\\)"); str1 = str1.replace(".", "\\."); return str1; }; var qt_start = new Date('2020-08-10 00:00:01'); var qt_end = new Date('2020-08-11 23:59:59'); var qt_now = new Date(); if (qt_now > qt_start && qt_now < qt_end) { $('head').append(''); } $(document).ready(function () { //common $("#main").on("click", ".btnSearch", function () { var keyword = $('#txt-keyword').val(); if ($.trim(keyword) != '') { $.pjax({ url: '/search?q=' + keyword.replace(/\s/gi, "+"), fragment: '#main', container: '#main' }); //window.location = '/search?q=' + keyword.replace(/\s/gi, "+"); } return true; }); $("#main").on("keyup", "#txt-keyword", function (evt) { if (evt.keyCode == 13 || evt.which == 13) { $('.btnSearch').trigger('click'); return false; } return true; }); function playAudio(audioUrl) { var url = audioUrl; var http = new XMLHttpRequest(); http.open('HEAD', url, false); try { http.send(); if (http.status != 200) { $(".mediatec-cleanaudioplayer").remove(); } } catch (e) { $(".mediatec-cleanaudioplayer").remove(); } } $(".mediatec-cleanaudioplayer").each(function () { let url = $(this).find("li").attr("data-url"); playAudio(url); }); $("#main").on("click", ".fb", function () { share_click($(this).attr('href')); return false; }); var tagg = []; if ($(".descriptionx").length > 0) { var h2des = $(".desc").html(); var contentxx = $(".descriptionx").html(); $(".c-tags a").each(function () { var tag = $(this).text().trim(); tagg.push(tag); }); if (tagg.length > 0) { $(".desc").remove(); var noidung = $(".descriptionx").html(); try { for (i = 0; i < tagg.length; i++) { //console.log(change_title(tagg[i].trim())); var regexExpression = "(?!(?:[^<]+>|[^>]+<\\/a>))\\b(" + change_title(tagg[i].trim()) + ")(?:\s)?\\b"; var regex = new RegExp(regexExpression, "imu"); noidung = noidung.replace(regex, "$1" + ""); } $(".descriptionx").html('

' + h2des + '

' + noidung); } catch (e) { $(".descriptionx").html(contentxx); console.log(e.message); } } }; }) var share_click = function (url) { var width = 575, height = 400, left = (document.documentElement.clientWidth / 2 - width / 2), top = (document.documentElement.clientHeight - height) / 2, opts = 'status=1,resizable=yes' + ',width=' + width + ',height=' + height + ',top=' + top + ',left=' + left; win = window.open(url, '', opts); win.focus(); return win; } $("#main").on("click", ".comment", function () { $('html,body').animate({ scrollTop: $('.c-comments').offset().top - 20 }, 700); $('.txt-content').focus(); }); var numberWithCommas = function (convertx) { return convertx.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); }; //web control var WebControl = WebControl || {}; WebControl.loadmore_params = function () { return { type: '24h', keyword: '', publisherId: 0, channelId: 0, eventId: 0 }; } WebControl.loadmore2_params = function () { return { type: '24h', keyword: '', publisherId: 0, channelId: 0, eventId: 0 }; } WebControl.isLoading = false; WebControl.initDetailPage = function () { if (WebControl.isLoading) return false; var $load_more_count = 0; var loadMore = function () { var _data = WebControl.loadmore_params(); $('.loading_img').show(); $('#load_more').hide(); $.ajax({ url: "/api/getMoreArticle", type: "post", data: _data, success: function (data) { $.each(data, function (idx, art) { $('.loadAjax:first').append('
  • ' + '
    ' + '
    ' + art.Title + '
    ' + '
    ' + '' + '
    ' + '' + art.NameChannel + '- ' + art.AuthorAlias + ' - ' + art.TimeX1 + '' + '
    ' + '
    ' + art.HeadlinesCutOff3 + '
    ' + '
    ' + '
    ' + '
  • '); }); $('.loading_img').hide(); if (data.length > 0) { $('#load_more').show(); } WebControl.isLoading = false; } }) } $('#load_more').click(function () { loadMore(); return false; }); // scroll for loadmore //$(window).scroll(function () { // var nearToBottom = 285; // if (WebControl.isLoading === false && $load_more_count < 3 && $(window).scrollTop() === $(document).height() - $(window).height()) { // loadMore(); // $load_more_count++; // } // //var vs = $('#load_more').visible(); // //if (vs == true && WebControl.isLoading == false) { // // if ($load_more_count < 3) { // // loadMore(); // // $load_more_count++; // // } // //} //}); } WebControl.initChannelPage = function () { if (WebControl.isLoading) return false; //var $load_more_count = 0; var loadMore = function () { var _data = WebControl.loadmore_params(); $('.loading_img').show(); $('#load_more').hide(); $.ajax({ url: "/api/getMoreArticle", type: "post", data: _data, success: function (data) { $.each(data, function (idx, art) { var headlines = art.Headlines; if (WebControl.VOVChannel == 1) { headlines = ""; } else { headlines = art.Headlines; } var isBig = art.ArticleMediaTypeCheck == true ? " is-big" : ""; if (WebControl.ApplicationPath == '') { $('.loadAjax:first').append('
  • ' + '
    ' + '
    ' + art.Title + '
    ' + '
    ' + '' + '
    ' + headlines + '
    ' + '
    ' + (art.AudioVov == '' ? '' : 'Nghe') + '
    ' + '
    ' + '
    ' + '
  • '); } else { var linkApp = WebControl.ApplicationPath + "/app/" + art.FriendlyTitle + "-" + art.PublisherId + ".html"; $('.loadAjax:first').append('
  • ' + '
    ' + '
    ' + art.Title + '
    ' + '
    ' + '' + '
    ' + headlines + '
    ' + '
    ' + '
    ' + '
  • '); } }); $('.loading_img').hide(); if (data.length > 0) { $('#load_more').show(); } WebControl.isLoading = false; } }) } $(document).on("click", "#load_more", function () { loadMore(); return false; }); // scroll for loadmore if (!isMobile()) { $(window).scroll(function () { if ($(window).scrollTop() === $(document).height() - $(window).height()) { if (WebControl.CountIndex < 3) { loadMore(); WebControl.CountIndex++; } } }); } } WebControl.CommentDetailPage = function () { var $publisherId = WebControl.PublisherId; var $parentId = 0; var $sort_by = 'like'; var $row_num = 0; var $load_comment_first = true; var $cmt_name = ''; var $cmt_email = ''; var $cmt_content = ''; var $cmt_parentId = ''; var $FriendlyName = WebControl.FriendlyName; var $f_share = WebControl.f_share; var $g_share = WebControl.g_share; var loadComments = function () { $.ajax({ url: "/api/getcomment", type: "post", data: { publisherid: $publisherId, parentid: $parentId, sort_by: $sort_by, row_num: $row_num }, success: function (data) { ////console.log(data); //$('.box-comment .bc-content').html(''); $.each(data, function (idx, cmt) { //console.log('load parent'); //console.log(cmt); if ($sort_by == 'like') { $sort_like = cmt.Liked; } else { $sort_date = cmt.CreatedAt; } $('.contentCC:last').append('
    ' + '
    ' + cmt.Name + ' - ' + convertJsonDate(cmt.CreatedAt) + '
    ' + '
    ' + cmt.Content + '
    ' + '
    ' + 'Trả lời' + '
    ' + '' + '
    ' + '
    ' + '
    ' + '
    ' + ''); if (cmt.ChildComment.length > 0) { //$('.itemboxC:last').after('
    '); //console.log('load child'); } $.each(cmt.ChildComment, function (idx2, cmt2) { //console.log(cmt2); $('.itemboxC:last').append('
    ' + '
    ' + cmt2.Name + ' - ' + convertJsonDate(cmt2.CreatedAt) + '
    ' + '
    ' + cmt2.Content + '
    ' + '
    ' + 'Trả lời' + '' + '' + '
    ' + '' + '
    ' + '
    ' + ''); }) // $('.box-comment .bc-content').append($comt) if (cmt.ChildComment.length == 3) { $('.box-comment .bc-content').find('.ci-sub:last').append('
    Xem thêm...
    ') } }); //first run if ($load_comment_first) { if (data.length > 0) { $('.box-comment .no-comment').addClass('hidden'); $('.box-comment .parent-load-more').removeClass('hidden'); } else { $('.box-comment .no-comment').removeClass('hidden'); $('.box-comment .parent-load-more').addClass('hidden'); } var $target = $(window.location.hash); if ($target != null && $target != undefined && $target.offset() != undefined) { $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 500, 'swing', function () { }); } $load_comment_first = false; } //waitingDialog.hide(); }, }); } var sendComment = function () { var name = $.trim($cmt_name); var email = $.trim($cmt_email); var content = $.trim($cmt_content).replace(/\r\n|\r|\n/g, "
    "); $.ajax({ url: "/api/addcomment", type: "post", data: { p: $cmt_parentId, a: $publisherId, n: name, e: email, c: content }, success: function (data) { //console.log(data); data = JSON.parse(data); if (data.errorCode == 2) { alert('Bạn phải chờ sau 1 phút sau mới được tiếp tục gửi ý kiến !'); } else { $('.txt-content').val(''); $('#txtName').val(''); $('#txtEmail').val(''); $('.form').removeClass('has-error'); $('.comment-item').find('.bc-input').addClass('hidden'); $('.popUp.binhLuan').removeClass('active'); $('.comment-reply').addClass('hidden'); var $target_message = $('.commentForms'); $('.message').removeClass('hidden'); $('html, body').stop().animate({ 'scrollTop': $target_message.offset().top - 10 }, 300, 'swing', function () { }); } }, }); } var share_click = function (url) { var width = 575, height = 400, left = (document.documentElement.clientWidth / 2 - width / 2), top = (document.documentElement.clientHeight - height) / 2, opts = 'status=1,resizable=yes' + ',width=' + width + ',height=' + height + ',top=' + top + ',left=' + left; win = window.open(url, '', opts); win.focus(); return win; } //load first top comment loadComments(); $('li.comment-sort-by-like').click(function () { if ($(this).hasClass('active')) return false; $('li.comment-sort-by-newest').removeClass('active'); $(this).addClass('active'); $sort_by = 'like'; $row_num = 0; //waitingDialog.show(); $('.contentCC').html(''); loadComments(); return false; }); $('li.comment-sort-by-newest').click(function () { if ($(this).hasClass('active')) return false; $('li.comment-sort-by-like').removeClass('active') $(this).addClass('active'); $sort_by = 'date'; $row_num = 0; //waitingDialog.show(); $('.contentCC').html(''); loadComments(); return false; }); $('.c-comments').on('click', '.like', function () { var _commentId = $(this).attr('id'); var aaa = $(this); var like_val = aaa.find('.likeCount').text(); $.ajax({ url: "/api/addlikecomment", type: "post", data: { cmt: _commentId }, success: function (data) { data = JSON.parse(data); if (data.errorCode == 0) { $(this).addClass('active'); aaa.find('.likeCount').html((parseInt(like_val) + 1).toString()); alert('Like thành công, sau vài phút ý kiến sẽ được cập nhật số lượng like !'); aaa.removeClass('like'); return false; } else if (data.errorCode == 2) { alert('Bạn phải chờ sau 1 phút sau mới được tiếp tục like ý kiến !'); return false; } }, }) }); $('.c-comments').on('click', '.tl-reply', function () { var _commentId = $(this).closest('.b-grid__content').attr('parentid'); $parentId = _commentId; //show commentbox $(this).closest('.b-grid__content').find('.comment-reply:first').removeClass('hidden'); return false; }); $('.c-comments').on('click', '.btn-close-comment', function () { $(this).closest('.comment-reply').addClass('hidden'); return false; }); //send click $('.c-comments').on('click', '.btnSend', function () { var $txtContent = $(this).closest('.c-comment-input').find('.txt-content:first'); $cmt_content = $txtContent.val(); $cmt_parentId = $(this).attr('parentid'); $txtContent.closest('.c-comment-input').removeClass('has-error'); $txtContent.closest('.c-comment-input').find('em').html(''); if ($cmt_content.length == 0) { $txtContent.closest('.c-comment-input').addClass('has-error').find('em').html('Bạn chưa nhập nội dung ý kiến !'); $('.txt-content').focus(); return false; } else if ($cmt_content.length < 10) { $txtContent.closest('.c-comment-input').addClass('has-error').find('em').html('Nội dung ý kiến quá ngắn !'); return false; } else if ($cmt_content.length > 1000) { $txtContent.closest('.c-comment-input ').addClass('has-error').find('em').html('Nội dung ý kiến quá dài !'); return false; } //show input author $('.popUp.binhluancomment').addClass('active'); return false; }); $('.btnSendComment').on('click', (function () { var $txtName = $('#txtName'); var $txtEmail = $('#txtEmail'); $cmt_name = $.trim($txtName.val()); $cmt_email = $.trim($txtEmail.val()); $('#binhluanmodal').find('.form').removeClass('has-error'); $('#binhluanmodal').find('em').html(''); if ($cmt_name.length == 0) { $txtName.closest('.box').addClass('has-error').find('em').html('Bạn chưa nhập họ và tên !'); return false; } else if ($cmt_email.length == 0) { $txtEmail.closest('.box').addClass('has-error').find('em').html('Bạn chưa nhập địa chỉ email !'); return false; } //send comment sendComment(); return false; })); //load more comment $('.box-comment').on('click', '.comment-load-more', function () { $parentId = 0; var $x = $('.bc-content').clone(); $x.find('.ci-sub').remove(); $row_num = $x.find('.comment-item:last').attr('row_num'); //waitingDialog.show(); loadComments(); return false; }); // ++++++ load comment con // $('.box-comment').on('click', '.comment-load-more-child', function () { var that = this; $parentId = $(this).closest('.ci-sub').attr('parentid'); $row_num = $(this).closest('.ci-sub').find('.comment-item:last').attr('row_num'); //waitingDialog.show(); $.ajax({ url: "/api/getcomment", type: "post", data: { publisherid: $publisherId, parentid: $parentId, sort_by: $sort_by, row_num: $row_num }, success: function (data) { //console.log(data); $.each(data, function (idx2, cmt2) { //console.log(cmt2); $(that).before('' + '
    ' + '
    ' + cmt2.Name + '
    ' + '
    ' + '
    ' + cmt2.Name + ' - ' + formatJSONDate(cmt2.CreatedAt) + '
    ' + '
    ' + ' ' + cmt2.Content + '' + '
    ' ///// //+ '
    ' //+ '
    ' + cmt2.Name + ' - ' + formatJSONDate(cmt2.CreatedAt) + '
    ' //+ '
    ' //+ ' ' + cmt2.Content + '' //+ '
    ' + '
    ' + '
    ' + ' ' + cmt2.Liked + ' Thích' + ' Trả lời' + '
    ' + '
    ' + '
    '); ////////////////////// //+ '
    ' //+ ' Thích ' + cmt2.Liked + '' //+ ' ' //+ ' ' //+ '
    ' //+ ''); }) //waitingDialog.hide(); } }) return false; }); $('.box-news').on('click', 'a.social-share', function () { var url = $(this).attr('href'); share_click(url); return false; }); } WebControl.Answer = function () { var $publisherId = WebControl.PublisherId; var LABEL_CORRECT = ["Bạn là thần đồng", "Bạn rất xuất sắc", "Kiến thức của bạn không tồi", "Bạn có thể làm tốt hơn thế"]; var t = $("

    ", { id: "quiz_result" }).html("Hãy trả lời các câu hỏi để biết kết quả của bạn"); if ($('.quiz-caption').length > 0) { $(".b-maincontent").append(t); } var a = $(".quiz ul").length; $("#quiz_total").html(a); var s = 0, e = 0; var sendTraloicauhoi = function () { var name = $.trim($cmt_name); var email = $.trim($cmt_email); var Traloi = $('.correct.selected').length + "/" + $('.b-maincontent .quiz').length; $.ajax({ url: "/api/sendAnswer", type: "post", data: { p: $publisherId, n: name, e: email, t: Traloi }, success: function (data) { //console.log(data); data = JSON.parse(data); if (data.errorCode == 2) { alert('Bạn phải chờ sau 1 phút sau mới được tiếp tục gửi ý kiến !'); } else { alert("Cám ơn bạn đã gửi kết quả trả lời."); //var $target_message = $('.messagetl'); //$target_message.removeClass('hidden'); //$('html, body').stop().animate({ // 'scrollTop': $('.formComment').offset().top //}, 300, 'swing', function () { }); } $('.ketquatraloi #txtName').val(''); $('.ketquatraloi #txtEmail').val(''); $('.ketquatraloi .form').removeClass('has-error'); $('.popUp.ketquatraloi').removeClass('active'); $('#traloiketqua').css({ "display": "none" }); } }); }; $(".quiz li strong").each(function (t, a) { $(a).parents(" li").addClass("correct"); }) $(".quiz li").on("click", function (n) { n.preventDefault(); var i = $(this).parents(".quiz"); if (!i.hasClass("answered")) { if (e++, $(this).hasClass("correct") && s++, e == a) { t.append('' + s + '' + a + ""); var c = 100 * s / a; 100 == c ? t.find(".message").html(LABEL_CORRECT[0]) : c >= 80 ? t.find(".message").html(LABEL_CORRECT[1]) : c >= 50 ? t.find(".message").html(LABEL_CORRECT[2]) : t.find(".message").html(LABEL_CORRECT[3]) //$('#quiz_result').append('Gửi kết quả trả lời'); } i.addClass("answered"), $(this).addClass("selected"); $("#traloiketqua").on("click", function (n) { n.preventDefault(); $('.popUp.ketquatraloi').addClass('active'); $(".ketquatraloi").find('.kqtl').html('' + $('.correct.selected').length + '' + $('.b-maincontent .quiz').length + ""); return false; }); $(".btnTraloicauhoi").off('click').on("click", function () { var $txtName = $('.ketquatraloi #txtName'); var $txtEmail = $('.ketquatraloi #txtEmail'); $cmt_name = $.trim($txtName.val()); $cmt_email = $.trim($txtEmail.val()); $('#binhluanmodal').find('.form').removeClass('has-error'); $('#binhluanmodal').find('em').html(''); if ($cmt_name.length == 0) { $txtName.closest('.box').addClass('has-error').find('em').html('Bạn chưa nhập họ và tên !'); return false; } else if ($cmt_email.length == 0) { $txtEmail.closest('.box').addClass('has-error').find('em').html('Bạn chưa nhập địa chỉ email !'); return false; } //send comment sendTraloicauhoi(); return false; }); } }); }; WebControl.CountIndex = 0; WebControl.ApplicationPath = ""; WebControl.VOVChannel = 0;