PageSourceSearch

https://mangawow.org/wp-content/themes/madara/js/template.js?ver=2.2.3

js mangawow.org collected 2026-10-09 21:28:28 UTC 24,794 bytes, 858 lines download raw bytes

1(function ($) {
2
3	"use strict";
4
5	jQuery(window).on('load', function (e) {
6		/*
7		 * Pre-Loading
8		 * */
9		jQuery("#pageloader").fadeOut(500);
10
11		if (jQuery('body').hasClass('adult-content')) {
12			var cookie_adult = window.wpmanga.getCookie('wpmanga-adault');
13			if (cookie_adult != 1) {
14				jQuery('#adult_modal').modal({ backdrop: 'static', keyboard: false });
15			} else {
16				jQuery('body').removeClass('censored');
17			}
18		}
19
20		if (typeof lightbox !== 'undefined') {
21			lightbox.option({
22				'resizeDuration': 200,
23				'fitImagesInViewport': true
24			})
25		}
26
27		if (!$('body').hasClass('reading-manga')) {
28			var $schema_cookie = window.wpmanga.getCookie('wpmanga-body-contrast');
29			if ($schema_cookie != '') {
30				if ($schema_cookie == 'light') {
31					$('body').addClass('text-ui-light');
32					$('body').removeClass('text-ui-dark');
33				} else {
34					$('body').removeClass('text-ui-light');
35					$('body').addClass('text-ui-dark');
36				}
37			}
38		} else {
39			// Reading Chapter
40			// Lazyload image
41			var firstImage = $('.lazyload-ordered').first();
42			if (firstImage) {
43				firstImage.prop('src', firstImage.attr('data-src'));
44				firstImage.removeAttr('data-src');
45				firstImage.removeClass('lazyload-ordered').addClass('lazyloaded');
46
47				var loadNextChapterImage = function () {
48					var next_guy = $('.reading-content .lazyload-ordered').first();
49					next_guy.prop('src', next_guy.attr('data-src'));
50					next_guy.removeAttr('data-src');
51					next_guy.removeClass('lazyload-ordered').addClass('lazyloaded');
52				};
53
54				$('.reading-content .wp-manga-chapter-img').on('load', loadNextChapterImage);
55			}
56		}
57	});
58
59	jQuery("body").removeClass("preload");
60
61	jQuery(document).ready(function () {
62
63		jQuery('ul.c-user_menu > li').each(function (i, e) {
64			jQuery(this).clone().appendTo('.mobile-menu ul.navbar-nav');
65		});
66
67		$('#darklight_toggle input').on('change', function () {
68			$('body').toggleClass('text-ui-dark').toggleClass('text-ui-light');
69			// save cookie
70			window.wpmanga.setCookie('wpmanga-body-contrast', $('body').hasClass('text-ui-light') ? 'light' : 'dark', 30);
71		});
72
73		if (jQuery('body').hasClass('manga-reading-paged-style')) {
74
75			$(document).on("click", ".page-prev-link", function () {
76				var prev_page_button = $('.main-col-inner .c-blog-post .wp-manga-nav .nav-links a.prev_page');
77				if (typeof prev_page_button !== 'undefined' && prev_page_button.length > 0 && prev_page_button.is(":visible")) {
78					$(prev_page_button[0]).trigger('click');
79				}
80			});
81
82			$(document).on("click", ".page-next-link", function () {
83				var next_page_button = $('.main-col-inner .c-blog-post .wp-manga-nav .nav-links a.next_page');
84				if (typeof next_page_button !== 'undefined' && next_page_button.length > 0 && next_page_button.is(":visible")) {
85					$(next_page_button[0]).trigger('click');
86				}
87			});
88
89			jQuery(window).on('mousemove', function (e) {
90
91				var prev_page_button = $('.main-col-inner .c-blog-post .wp-manga-nav .nav-links a.prev_page');
92				var next_page_button = $('.main-col-inner .c-blog-post .wp-manga-nav .nav-links a.next_page');
93
94				var halfScreen = $(this).width() / 2;
95
96				var originURL = jQuery('.reading-content-wrap').attr('data-site-url');
97
98				var cursorImage = e.pageX < halfScreen ? madara.cursorPrev : madara.cursorNext;
99
100				//Left Screen & Previous Page
101				if (e.pageX < halfScreen) {
102					if (typeof prev_page_button !== 'undefined' && prev_page_button.length > 0 && prev_page_button.is(":visible")) {
103						$('body.reading-manga .reading-content .page-prev-link').css({ "cursor": "url(" + cursorImage + "), auto" });
104					} else {
105						$('body.reading-manga .reading-content .page-prev-link').css({ "cursor": "initial !important;" });
106					}
107
108				} else {
109
110					if (typeof next_page_button !== 'undefined' && next_page_button.length > 0 && next_page_button.is(":visible")) {
111						$('body.reading-manga .reading-content .page-next-link').css({ "cursor": "url(" + cursorImage + "), auto" });
112					} else {
113						$('body.reading-manga .reading-content .page-next-link').css({ "cursor": "initial" });
114					}
115				}
116
117			});
118		}
119
120		$('.section_adult a').on('click', function (e) {
121			e.preventDefault();
122
123			if (!$(this).hasClass('refreshing')) {
124				$(this).addClass('refreshing');
125
126				if ($('.section_adult').hasClass('on')) {
127					$('.section_adult').removeClass('on').addClass('off');
128					window.wpmanga.removeCookie('wpmanga-adult');
129				} else {
130					$('.section_adult').removeClass('off').addClass('on');
131					window.wpmanga.setCookie('wpmanga-adult', 1, 7);
132				}
133
134				location.reload();
135
136				$(this).removeClass('refreshing');
137			}
138			return false;
139		});
140
141		var siteUrl = jQuery('#adult_modal').attr('data-site-url');
142		$('.btn-not-adult').on('click', function (e) {
143			if (siteUrl !== '') {
144				window.location = siteUrl;
145			}
146
147		});
148
149		if (jQuery('body').hasClass('censored')) {
150			jQuery('.btn-adult-confirm').on('click', function (e) {
151				window.wpmanga.setCookie('wpmanga-adault', 1, 7);
152				jQuery('body').removeClass('censored');
153			});
154		}
155
156		/*sub-header*/
157		$('li.menu-item-has-children a[href^="#"]').on('touchend click', function (e) {
158			var $this = $(this);
159			if ($this.parents('.c-sub-header-nav').length) {
160				e.preventDefault();
161				$this.parent().toggleClass('active');
162			} else {
163				e.preventDefault();
164			}
165		});
166
167		/*menu off-canvas*/
168
169		jQuery(".off-canvas ul > li.menu-item-has-children").addClass("hiden-sub-canvas");
170		jQuery(".off-canvas ul >li.menu-item-has-children").append('<i class="fa fa-caret-right" aria-hidden="true"></i>');
171		var menu_open = $('.menu_icon__open');
172		var menu_close = $('.menu_icon__close');
173		var menu_slide = $('.off-canvas');
174		var menu_sign_in = $('.mobile-menu .btn-active-modal');
175
176		menu_open.on('click', function () {
177			menu_open.addClass('active');
178			menu_slide.addClass('active');
179			$('body').addClass('open_canvas');
180		});
181
182		menu_close.on('click', function (e) {
183			e.preventDefault();
184			menu_open.removeClass('active');
185			menu_slide.removeClass('active');
186			$('body').removeClass('open_canvas');
187		});
188
189		menu_sign_in.on('click', function (e) {
190			e.preventDefault();
191			menu_open.removeClass('active');
192			menu_slide.removeClass('active');
193			$('body').removeClass('open_canvas');
194		});
195
196		$(".off-canvas ul >li.menu-item-has-children > i").on('click', function () {
197			var $this = $(this).parent("li");
198			$this.toggleClass("active").children("ul").slideToggle();
199			return false;
200		});
201		$(document).on(" touchend click", function (e) {
202			if (!$(e.target).hasClass('menu_icon__open') && !$(e.target).closest('.off-canvas').hasClass('active')) {
203				menu_slide.removeClass('active');
204				menu_open.removeClass("active");
205				$('body').removeClass('open_canvas');
206			}
207		});
208		/**
209		 * Sticky Menu
210		 * @type {Window}
211		 */
212
213		var stickyNavigation = $('.c-sub-header-nav').length > 0 ? $('.c-sub-header-nav').offset().top : 0;
214		var cloneHeader = $("<div>", {
215			class: "clone-header"
216		})
217		$(cloneHeader).insertBefore(".c-sub-header-nav");
218		var navigationHeight = $('.c-sub-header-nav').outerHeight(true);
219
220		/**
221		 * Compare scrollTop position to add .sticky class
222		 */
223		var madara_need_add_sticky = function () {
224			var scrollTop = $(window).scrollTop();
225
226			if (scrollTop - stickyNavigation > 750 && $("body").hasClass("sticky-enabled")) {
227				$(cloneHeader).css('height', navigationHeight);
228				$('.c-sub-header-nav').addClass('sticky');
229				$('body').addClass('sticky__active');
230				$('.c-sub-header-nav').fadeIn(300, 'linear');
231			}
232			else if (scrollTop - stickyNavigation <= 200 && $("body").hasClass("sticky-enabled")) {
233				// $(cloneHeader).remove();
234				$(cloneHeader).css('height', 0);
235				$('.c-sub-header-nav').removeClass('sticky');
236				$('body').removeClass('sticky__active');
237			}
238
239		}
240
241		/**
242		 * Detect scrolling up or down, to add .sticky class
243		 */
244		var stickyNav = function () {
245			if (typeof stickyNav.x == 'undefined') {
246				stickyNav.x = window.pageXOffset;
247				stickyNav.y = window.pageYOffset;
248			}
249			;
250
251			var diffX = stickyNav.x - window.pageXOffset;
252			var diffY = stickyNav.y - window.pageYOffset;
253
254
255			if (diffX < 0) {
256				// Scroll right
257			} else if (diffX > 0) {
258				// Scroll left
259			} else if (diffY < 0) {
260				// Scroll down
261				if ($('body').hasClass('sticky-style-2')) {
262					$('.c-sub-header-nav').removeClass('sticky');
263					$('body').removeClass('sticky__active');
264					$('.clone-header').css('height', 0);
265
266
267				} else {
268					madara_need_add_sticky();
269				}
270			} else if (diffY > 0) {
271				// Scroll up
272				madara_need_add_sticky();
273			} else {
274				// First scroll event
275			}
276
277			stickyNav.x = window.pageXOffset;
278			stickyNav.y = window.pageYOffset;
279		};
280
281		if ($('body').hasClass('sticky-enabled')) {
282			$(window).on('scroll', function () {
283				if ($(window).width() >= 768 || $('body').hasClass('sticky-for-mobile')) {
284					stickyNav();
285				}
286			});
287		}
288
289		// event on wide screens
290		if ($(window).width() >= 768) {
291			$('body').delegate('.page-item-detail .item-thumb.hover-details', 'mousemove', (function (e) {
292				var postID = $(this).attr('data-post-id');
293				var currentPostID;
294				var hoverPostID;
295				currentPostID = 'manga-item-' + postID;
296				hoverPostID = 'manga-hover-' + postID;
297				var check_bar = $('body').hasClass('admin-bar');
298				var parentOffset = $(this).offset();
299				var relativeXPosition = (e.pageX); //offset -> method allows you to retrieve the current position of an element 'relative' to the document
300				var relativeYPosition = (e.pageY);
301				var _width_infor = $("#hover-infor").width();
302				var infor_left = (relativeXPosition - 15) - _width_infor;
303				var infor_right = relativeXPosition + 15;
304				var infor_top = check_bar ? (relativeYPosition - 32) : (relativeYPosition);
305				var body_outerW = ($(window).outerWidth() / 2);
306
307				$("#hover-infor").addClass('active');
308				$("#hover-infor").show();
309				$(".icon-load-info").css({
310					"position": "absolute",
311					"top": infor_top - 20,
312					"left": relativeXPosition - 20,
313					"display": "inline-block",
314					"z-index": "99999",
315					"width": "40px",
316					"height": "40px",
317				});
318				$("#hover-infor").css({
319					"position": "absolute",
320					"top": infor_top,
321					"display": "inline-block",
322					"z-index": "99999",
323				});
324				if (relativeXPosition >= body_outerW) {
325					$("#hover-infor").css({
326						"left": infor_left,
327					});
328				}
329				else {
330					$("#hover-infor").css({
331						"left": infor_right,
332					});
333				}
334			})).mouseout(function () {
335				$("#hover-infor").removeClass('active');
336				$("#hover-infor").hide();
337			});
338		} else {
339			// event on small/mobile screens
340			$('.off-menu ul.navbar-nav > .dropdown > a[href]').click(function () {
341				var dropdown = $(this).next('.dropdown-menu');
342				if (this.href && this.href != '#' && this.href != 'javascript:void(0)') {
343					location.href = this.href;
344				}
345			});
346		}
347
348
349		//Go To Top
350		jQuery('.go-to-top').on('click', function () {
351			jQuery('html, body').animate({ scrollTop: 0 }, 500);
352		});
353
354		jQuery(window).on('scroll', function () {
355			if (jQuery(window).scrollTop() >= (window.innerHeight * 0.5)) {
356				if (!jQuery('.go-to-top').hasClass('active')) {
357					jQuery('.go-to-top').addClass('active');
358				}
359				;
360			} else {
361				jQuery('.go-to-top').removeClass('active');
362			}
363
364			if (jQuery('.wall-ads-control').length) {
365				if (window.wallAdsScrollTimeout) {
366					clearTimeout(window.wallAdsScrollTimeout);
367				}
368				window.wallAdsScrollTimeout = setTimeout(function () {
369					var normal_top = jQuery('.wall-ads-control').data('scrolltop') ? jQuery('.wall-ads-control').data('scrolltop') : 210;
370					var ignore_top = jQuery('.wall-ads-control').data('maxtop') ? jQuery('.wall-ads-control').data('maxtop') : 510;
371
372					if (jQuery(window).scrollTop() < normal_top) {
373						jQuery('.wall-ads-control').animate({ top: ignore_top + 'px' });
374					} else {
375						jQuery('.wall-ads-control').animate({ top: normal_top + 'px' });
376					}
377				}, 100);
378			}
379		});
380
381		// search
382		$('.main-menu-search .open-search-main-menu').on('click', function () {
383			var $this = $(this);
384
385			if ($this.hasClass('search-open')) {
386				$this.parents('.c-header__top').find('.search-main-menu').removeClass('active');
387				setTimeout(function () {
388					$this.parents('.c-header__top').find('.search-main-menu').find('input[type="text"]').blur();
389				}, 200);
390				$this.removeClass('search-open');
391
392				if ($('body').hasClass('mobile')) {
393					var $adv_search_link = $('.link-adv-search', $('#blog-post-search'));
394					if ($adv_search_link.length > 0) {
395						$adv_search_link.remove();
396					}
397				}
398			} else {
399				$this.parents('.c-header__top').find('.search-main-menu').addClass('active');
400				setTimeout(function () {
401					$this.parents('.c-header__top').find('.search-main-menu').find('input[type="text"]').focus();
402				}, 200);
403				$this.addClass('search-open');
404
405				if ($('body').hasClass('mobile')) {
406					var $adv_search_link = $('.link-adv-search', $this.closest('.widget-manga-search'));
407					if ($adv_search_link.length > 0) {
408						$('#blog-post-search').append($adv_search_link.clone());
409					}
410				}
411			}
412			;
413		});
414
415		$(".genres_wrap .btn-genres").click(function () {
416			var $this = $(this);
417			var $this_parent;
418			$this.toggleClass("active");
419			$this_parent = $this.parents(".genres_wrap");
420			$this_parent.find(".genres__collapse").slideToggle(300);
421			$this_parent.find(".c-blog__heading.style-3").toggleClass("active");
422		});
423
424
425		// accordion view chap
426		$(".listing-chapters_wrap ul.main > li.has-child").on('click', function (e) {
427			var $this = $(this);
428			$(e.target).toggleClass("active").children("ul").slideToggle(300);
429		});
430
431		$(".listing-chapters_wrap ul.main > li a.has-child").on('click', function (e) {
432			var $this = $(this);
433			$(e.target).next("ul").slideToggle(300);
434			$(e.target).parent().toggleClass("active");
435		});
436
437		$("#checkall").click(function () {
438			$('table.list-bookmark input:checkbox').not(this).prop('checked', this.checked);
439		});
440
441		// header slider
442		$(".manga-slider .slider__container").each(function () {
443
444			var $this = $(this);
445			var $parent = $(this).parents(".manga-slider");
446			var style = $parent.attr('data-style');
447			var autoplay = $parent.attr('data-autoplay');
448			autoplay = autoplay == "1" ? true : false;
449			var manga_slidesToShow = parseInt($parent.attr('data-count'));
450			var check_style = $this.parents(".style-3").length;
451			var check_rtl = (jQuery("body").css('direction') === "rtl");
452			var manga_style_1 = {
453				dots: $parent.hasClass('dots-off') ? false : true,
454				infinite: true,
455				speed: 500,
456				centerMode: (((manga_slidesToShow % 2 !== 0) && (!check_style)) ? true : false),
457				slidesToShow: manga_slidesToShow,
458				slidesToScroll: 1,
459				arrows: false,
460				rtl: check_rtl,
461				autoplay: autoplay,
462				responsive: [{
463					breakpoint: 992,
464					settings: {
465						slidesToShow: (manga_slidesToShow == 1) ? 1 : 2,
466						slidesToScroll: 1,
467						infinite: true,
468						centerMode: false,
469						dots: $parent.hasClass('dots-off') ? false : true
470					}
471				}, {
472					breakpoint: 660,
473					settings: {
474						slidesToShow: 1,
475						slidesToScroll: 1,
476						infinite: true,
477						variableWidth: false,
478						dots: $parent.hasClass('dots-off') ? false : true
479					}
480				}, {
481					breakpoint: 480,
482					settings: {
483						slidesToShow: 1,
484						variableWidth: false,
485					}
486				}]
487			}
488			var manga_style_2 = {
489				dots: $parent.hasClass('dots-off') ? false : true,
490				infinite: true,
491				speed: 500,
492				slidesToShow: manga_slidesToShow,
493				slidesToScroll: 1,
494				arrows: false,
495				rtl: check_rtl,
496				autoplay: autoplay,
497				responsive: [{
498					breakpoint: 992,
499					settings: {
500						slidesToShow: (manga_slidesToShow == 1) ? 1 : 2,
501						slidesToScroll: 1,
502						infinite: true,
503						dots: $parent.hasClass('dots-off') ? false : true
504					}
505				}, {
506					breakpoint: 768,
507					settings: {
508						slidesToShow: 1,
509						slidesToScroll: 1,
510						infinite: true,
511						dots: $parent.hasClass('dots-off') ? false : true
512					}
513				}]
514			}
515			var manga_style_3 = {
516				dots: $parent.hasClass('dots-off') ? false : true,
517				infinite: true,
518				speed: 500,
519				slidesToShow: manga_slidesToShow,
520				slidesToScroll: 1,
521				arrows: false,
522				rtl: check_rtl,
523				autoplay: autoplay,
524				responsive: [{
525					breakpoint: 992,
526					settings: {
527						slidesToShow: (manga_slidesToShow == 1) ? 1 : 2,
528						slidesToScroll: 1,
529						infinite: true,
530						dots: $parent.hasClass('dots-off') ? false : true
531					}
532				}, {
533					breakpoint: 768,
534					settings: {
535						slidesToShow: 1,
536						slidesToScroll: 1,
537						infinite: true,
538						dots: $parent.hasClass('dots-off') ? false : true
539					}
540				}]
541			}
542
543			switch (style) {
544				case 'style-1':
545					$this.slick(manga_style_1);
546					break;
547				case 'style-2':
548					$this.slick(manga_style_2);
549					break;
550				case 'style-3':
551				case 'style-4':
552					$this.slick(manga_style_3);
553					break;
554			}
555
556		});
557
558		// popular slider
559		$(".popular-slider .slider__container").each(function () {
560			var manga_slidesToShow = parseInt($(this).parents(".popular-slider").attr('data-count'));
561			var check_rtl = (jQuery("body").css('direction') === "rtl");
562			var autoplay = $(this).parents(".popular-slider").attr('data-autoplay');
563			autoplay = autoplay == "1" ? true : false;
564			var popular_style_2 = {
565				dots: false,
566				infinite: true,
567				speed: 500,
568				slidesToShow: manga_slidesToShow,
569				arrows: true,
570				rtl: check_rtl,
571				autoplay: autoplay,
572				slidesToScroll: 1,
573				responsive: [
574					{
575						breakpoint: 1700,
576						settings: {
577							slidesToShow: (manga_slidesToShow == 1) ? 1 : 4,
578							slidesToScroll: 1,
579						}
580					},
581					{
582						breakpoint: 1400,
583						settings: {
584							slidesToShow: (manga_slidesToShow == 1) ? 1 : 3,
585							slidesToScroll: 1,
586						}
587					},
588					{
589						breakpoint: 992,
590						settings: {
591							slidesToShow: (manga_slidesToShow == 1) ? 1 : 2,
592							slidesToScroll: 1,
593						}
594					},
595					{
596						breakpoint: 600,
597						settings: {
598							slidesToShow: 1,
599							slidesToScroll: 1,
600						}
601					},
602				]
603			}
604			var popular_style_1 = {
605				dots: false,
606				infinite: true,
607				speed: 500,
608				slidesToShow: manga_slidesToShow,
609				arrows: true,
610				rtl: check_rtl,
611				autoplay: autoplay,
612				slidesToScroll: 1,
613				responsive: [
614					{
615						breakpoint: 1700,
616						settings: {
617							slidesToShow: manga_slidesToShow,
618							slidesToScroll: 1,
619						}
620					},
621					{
622						breakpoint: 1200,
623						settings: {
624							slidesToShow: manga_slidesToShow > 3 ? 3 : manga_slidesToShow,
625							slidesToScroll: 1,
626						}
627					},
628					{
629						breakpoint: 992,
630						settings: {
631							slidesToShow: manga_slidesToShow > 3 ? 3 : manga_slidesToShow,
632							slidesToScroll: 1,
633						}
634					},
635					{
636						breakpoint: 600,
637						settings: {
638							slidesToShow: 1,
639							slidesToScroll: 1,
640						}
641					},
642				]
643			}
644
645			var popular_style_3 = popular_style_1;
646
647			var $this = $(this);
648			var style = $(this).parents(".popular-slider").attr('data-style');
649			switch (style) {
650				case 'style-1':
651					$this.slick(popular_style_1);
652					break;
653				case 'style-2':
654					$this.slick(popular_style_2);
655					break;
656				case 'style-3':
657					$this.slick(popular_style_3);
658					break;
659			}
660
661		});
662
663		if ($('body').has('.summary__content.show-more').length) {
664			var text = $('.summary__content.show-more'),
665				btn = $('.content-readmore'),
666				h = text[0].scrollHeight;
667			if (h > 120) {
668				btn.addClass('less');
669				btn.css('display', 'inline-block');
670			} else {
671				btn.css('display', 'none');
672				$('.description-summary').addClass('hide_show-more');
673			}
674
675			btn.click(function (e) {
676				e.stopPropagation();
677
678				if (btn.hasClass('less')) {
679					btn.removeClass('less');
680					btn.addClass('more');
681
682					if (typeof single_manga_show_more !== 'undefined') {
683						btn.text(single_manga_show_more.show_less);
684					} else {
685						btn.text('Show less  ');
686					}
687
688					text.addClass('active');
689					text.animate({ 'height': h });
690				} else {
691					btn.addClass('less');
692					btn.removeClass('more');
693					text.removeClass('active');
694
695					if (typeof single_manga_show_more !== 'undefined') {
696						btn.text(single_manga_show_more.show_more);
697					} else {
698						btn.text('Show more  ');
699					}
700
701					text.animate({ 'height': '120px' });
702				}
703			});
704		}
705
706		$(document).on('wp_manga_after_load_chapters_list', function () {
707			if ($('body').has('.listing-chapters_wrap.show-more .version-chap').length) {
708				var text_chap = $('.listing-chapters_wrap.show-more .version-chap');
709				var btn_chap = $('.listing-chapters_wrap.show-more .chapter-readmore');
710				var height_parent = text_chap.height();
711				var check_show_btn = function () {
712					if (height_parent >= 550) {
713						btn_chap.addClass('less-chap');
714						btn_chap.fadeIn(300);
715						$('.listing-chapters_wrap.show-more').addClass('show');
716						text_chap.addClass('active');
717					} else {
718						btn_chap.fadeOut(300);
719						$('.listing-chapters_wrap.show-more').removeClass('show');
720						text_chap.removeClass('active')
721					}
722				}
723				$(".listing-chapters_wrap.show-more ul.main > li.has-child").on('click', function (e) {
724					var $this = $(this);
725					setTimeout(function () {
726						height_parent = $this.parents('.version-chap').height();
727						check_show_btn();
728					}, 300);
729				});
730				check_show_btn();
731				btn_chap.click(function (e) {
732					e.stopPropagation();
733					if (btn_chap.hasClass('less-chap')) {
734						btn_chap.removeClass('less-chap');
735						btn_chap.fadeOut(300);
736						text_chap.addClass('loading');
737						$('.listing-chapters_wrap.show-more').removeClass('show');
738						setTimeout(function () {
739							btn_chap.remove();
740							text_chap.animate({ 'max-height': '100%' });
741							text_chap.removeClass('loading');
742							text_chap.addClass('loaded');
743						}, 1000);
744					}
745				});
746			}
747
748			$('.btn-reverse-order').on('click', function (e) {
749				var main_lists = $('.main.version-chap');
750				main_lists.each(function (idx) {
751					var listItems = $(this).children('li');
752					$(this).append(listItems.get().reverse());
753				});
754
755				var sub_lists = $('.sub-chap.list-chap .sub-chap-list');
756				sub_lists.each(function (idx) {
757					var listItems = $(this).children('li');
758					$(this).append(listItems.get().reverse());
759				});
760
761				return false;
762			});
763
764			$('.reward_ads').unbind('click');
765			$('.reward_ads').on('click', function(e){
766				reward_ads_click(this);
767			});
768		});
769
770		$(document).on('madara_load_more_completed', function(e){
771			$('.reward_ads').unbind('click');
772			$('.reward_ads').on('click', function(e){
773				reward_ads_click(this);
774			});
775		})
776
777		//Mobile Collapse Genres
778		$(document).on('click', '.c-sub-header-nav .mobile-icon', function (e) {
779			var $this = $(this);
780
781			if ($this.parent().hasClass('active')) {
782				$this.parent().removeClass('active');
783			} else {
784				$this.parent().addClass('active');
785			}
786		});
787
788		var mobile_pagination_btn_attach_click = function () {
789			var pagination_btn = $(".mobile-nav-btn");
790			var select_pagination = $(".select-pagination");
791
792			// unbind event first
793			pagination_btn.unbind('click');
794			pagination_btn.on('click', function (e) {
795
796				e.preventDefault();
797				if (select_pagination.parent().hasClass('active')) {
798					select_pagination.parent().removeClass('active');
799				} else {
800					select_pagination.parent().addClass('active');
801				}
802
803			});
804		};
805		mobile_pagination_btn_attach_click();
806
807		// re-attach click event after ajax loading chapter
808		$(document).on('wp_manga_on_chapter_navlinks_click', function () {
809			mobile_pagination_btn_attach_click();
810		});
811
812		$('#btn_view_full_image').on('click', function (e) {
813			$('.container').css({ 'width': 'auto', 'max-width': 'initial' });
814
815			$(this).hide();
816
817			e.preventDefault();
818			e.stopPropagation();
819		});
820
821		var reward_ads_click = function(obj){
822			$(window).trigger('rewards_ads_click', $(obj).data('manga'), $(obj).data('chapter'));
823			
824			var d = new Date();
825			d.setTime(d.getTime() + (parseInt($(obj).data('expired')) * 60 * 1000));
826			var expires = "expires=" + d.toUTCString();
827			document.cookie = $(obj).data('manga') + "-" + $(obj).data('chapter') + "-ads-clicked=1;" + expires + ";path=/";
828
829			var source_url = $(obj).data('url');
830			openInNewTab(source_url);
831		}
832
833		$('.reward_ads').on('click', function(e){
834			reward_ads_click(this);
835		});
836	});
837
838	function shortString() {
839		var shorts = document.querySelectorAll('.short');
840		if (shorts) {
841			Array.prototype.forEach.call(shorts, function (ele) {
842				var str = ele.innerText,
843					indt = '...';
844
845				if (ele.hasAttribute('data-limit')) {
846					if (str.length > ele.dataset.limit) {
847						var result = str.substring(0, ele.dataset.limit - indt.length).trim() + indt;
848						ele.innerText = result;
849						str = null;
850						result = null;
851					}
852				} else {
853					throw Error('Cannot find attribute \'data-limit\'');
854				}
855			});
856		}
857	}
858})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.