PageSourceSearch

https://cinepremiere.com.mx/wp-content/themes/cp2020/js/assets.js?ver=3.0.2.1.227

js cinepremiere.com.mx collected 2026-09-24 17:08:51 UTC 33,818 bytes, 1,182 lines download raw bytes

1$ = jQuery.noConflict();
2// $.fn.extend({
3//     animateCss: function (animationName) {
4// 		"use strict";
5//         var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
6//         this.addClass('animated ' + animationName).one(animationEnd, function() {
7//             $(this).removeClass('animated ' + animationName);
8// 			$(this).trigger("animationEnd");
9//         });
10//     }
11// });
12
13var calcHeight = function() {
14	var ventana_ancho = $(window).width();
15
16	if(ventana_ancho > 799){
17		$('#sites-frame').height($(window).height() / 4 + 55);
18	}
19	else if(ventana_ancho > 600){
20		$('#sites-frame').height($(window).height() / 3 + 40);
21	}
22	else{
23		$('#sites-frame').height($(window).height() / 3 + 70 );
24	}
25	
26  }
27
28  $(document).ready(function() {
29	calcHeight();
30  });
31
32  $(window).resize(function() {
33	calcHeight();
34  }).load(function() {
35	calcHeight();
36  });
37
38
39
40
41$(document).ready(function() {
42	
43	"use strict";
44
45	//$('main').append('<div class="envelope"></div>');
46
47	//delay imgs
48	$('img[data-src]').each(function(index,elem) {
49		$(this).one('inview', function(){
50			$(this).attr("src", $(this).attr("data-src"));
51			$(this).on('load',function(){
52				$(this).addClass('ready');
53			});
54		});
55	});
56
57	
58
59
60	
61	 
62
63	
64
65//****************** FUNCION PARA FIJAR EL BANNER BILLBOARD PARA CAMPAÑAS ***************** */
66	$('#stickytypeheader').on('click', function() {
67		$('#publicidadclose').css({ "display": "none"});
68		$('#stickytypeheader').css({ "position": "initial"});
69	});
70
71	$('#stickytypeheader').on('click touchstart', function() {
72		$('#publicidadclose').css({ "display": "none"});
73		$('#stickytypeheader').css({ "position": "initial"});
74	});
75
76	
77
78
79	var theme = '/wp-content/themes/cp2020';
80	var imgtexure = '/img/cp_texture_'+(Math.floor(Math.random() * 6) + 1)+'.jpg';
81	var rndimg = theme+imgtexure;
82	//cover backs
83	$('figure.cover').each(function(index,elem) {
84		if( $(this).hasClass('random') ){
85			$(this).css('background-image','url('+rndimg+')').addClass('ready');	
86		}
87		else{
88			$(this).one('inview', function(event, isInView) {
89				if (isInView) {
90					var cover = $(this).attr('data-src');
91					$(this).css('background-image','url('+cover+')').addClass('ready');	
92
93				}
94			});		
95		}
96	});
97
98	var mobile = false;
99	if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) === true) {
100		$('html').addClass('mobile');
101		mobile = true;
102	}else{
103	}//eventos desktop
104	
105
106	
107	//para explorer
108	/*if (/MSIE 10/i.test(navigator.userAgent)) {
109		// This is internet explorer 10
110		console.log('isIE10');
111	}*/
112	/*if (/MSIE 9/i.test(navigator.userAgent)) {
113	// This is internet explorer 9 or 11
114		console.log = 'pages/core/ie.htm';
115	}
116	if (/Edge\/\d./i.test(navigator.userAgent)){
117	// This is Microsoft Edge
118		console.log('Microsoft Edge');
119	}*/
120	if (/Trident\/|MSIE/.test(window.navigator.userAgent) || /MSIE 9/i.test(navigator.userAgent) || /Edge\/\d./i.test(navigator.userAgent)) {
121		// This is internet explorer 11
122	};
123	
124
125	$('.open_nav').click(function(e){
126		e.preventDefault();	
127		$('html').css('overflow','hidden');
128		$('nav').removeClass('nav_close').addClass('nav_open');
129		if( $('.open_search').hasClass('active') ){
130			$('.open_search').trigger('click');
131		}
132		ga('send', 'event', 'Interaction', 'Open Nav', window.location);
133	});
134	$('nav .close').click(function(e){
135		e.preventDefault();
136		$('html').removeAttr('style');
137		$('nav').removeClass('nav_open').addClass('nav_close');
138		ga('send', 'event', 'Interaction', 'Open Search', window.location);
139	});
140
141
142	$('.open_search').click(function(e){
143		e.preventDefault();	
144		$(this).toggleClass('active');
145		if( $(this).hasClass('active') ){
146			$('.search_module').removeClass('nav_close').addClass('nav_open');
147			$('html').css('overflow','hidden');	
148		}
149		else{
150			$('.search_module').removeClass('nav_open').addClass('nav_close');
151			$('html').removeAttr('style');
152		}
153	});
154
155
156	$('header .session').click(function(e){
157		e.preventDefault();	
158		$('.lightbox.session').addClass('active');
159	});
160
161	$('.lightbox .close,.lightbox .close_veil').click(function(e){
162		e.preventDefault();
163		$('.lightbox').removeClass('active');
164	});
165
166	$('select').parent('label').addClass('select');
167	$('input[type="checkbox"]').parent('label').addClass('checkbox');
168
169	if( mobile ){
170		if( $('.slideshow').length ){
171
172			//home slideshow
173			var slideshow = $('.slideshow');
174			slideshow.owlCarousel({
175				animateOut: 'fadeOut',
176				animateIn: 'fadeIn',
177				items:1,
178				margin:0,
179				stagePadding:0,
180				autoplay:true,
181				autoplayTimeout:7000,
182				autoplayHoverPause:false,
183				smartSpeed:450,
184				loop:true,
185				nav:true,
186				responsive:{
187					800:{
188						nav:false,
189					}
190				}
191			});
192			$('.slideshow .owl-dots div').each(function(index) {    
193		        var text = $('.slideshow .owl-item:eq('+(index+2)+') strong').clone();
194		        var img = $('.slideshow .owl-item:eq('+(index+2)+') img').attr('data-src');
195				$(this).append('<i>'+(index+1)+'</i>');
196				$(this).append('<img src="'+img+'">');
197				$(this).append(text);
198		    });
199			slideshow.on('translated.owl.carousel', function(event) {
200				$('.slideshow .owl-item img').each(function(){
201					if( !$(this).attr('src') ){
202						$(this).attr('src', $(this).attr('data-src'));	
203						$(this).on('load',function(){
204							$(this).addClass('ready');
205						});
206					}
207				});
208			});
209			ga('send', 'event', 'Home', 'Home Visualization', window.location);
210		}
211	}
212
213	if( $('.destaination_carousel').length ){
214		//home destinos
215		var destinationsHome = $('.destaination_carousel');
216		destinationsHome.owlCarousel({
217			items:1,
218			margin:10,
219			stagePadding:0,
220			autoplay:false,
221			autoplayHoverPause:false,
222			smartSpeed:450,
223			loop:true,
224			mouseDrag:false,
225			nav:true,
226			responsive:{
227				800:{
228					items:2,
229					margin:20,
230				}
231			}
232		});
233		destinationsHome.on('translated.owl.carousel', function(event) {
234			$('.destaination_carousel .owl-item img').each(function(){
235				if( !$(this).attr('src') ){
236					$(this).attr('src', $(this).attr('data-src'));	
237					$(this).on('load',function(){
238						$(this).addClass('ready');
239					});
240				}
241			});
242		});
243	}
244
245
246
247	if( $('.masvistos_carousel').length ){
248		//destinos mas vistos
249		var masvistos = $('.masvistos_carousel');
250		masvistos.owlCarousel({
251			items:1,
252			margin:0,
253			stagePadding:0,
254			autoplay:false,
255			autoplayHoverPause:false,
256			smartSpeed:450,
257			loop:true,
258			mouseDrag:false,
259			nav:true,
260			responsive:{
261				800:{
262					items:3,
263					margin:30,
264				}
265			}
266		});
267		masvistos.on('translated.owl.carousel', function(event) {
268			$('.masvistos_carousel .owl-item img').each(function(){
269				if( !$(this).attr('src') ){
270					$(this).attr('src', $(this).attr('data-src'));	
271					$(this).on('load',function(){
272						$(this).addClass('ready');
273					});
274				}
275			});
276		});
277	}
278
279
280	$('.videos_home .player a').click(function(e){
281		e.preventDefault();
282		var stringVideo = $(this).parent().attr('data-video');
283		var video = $($.parseHTML(stringVideo));
284		var autoplay = video.attr('src');
285		autoplay = autoplay+'&autoplay=1';
286
287		// if( autoplay != ""){
288		// 	autoplay = autoplay+'&autoplay=1';
289		// 	video.attr('src',autoplay);
290		// 	$(this).parent().append(video);	
291		// }
292		// else{
293		// 	video = video.replace('watch?v=','embed/');
294		// 	video = video+'?feature=oembed&quot&autoplay=1';
295		// 	var iframe = '<iframe src="'+video+'" width="640" height="360" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>';
296		// 	$(this).parent().append(iframe);
297		// }
298		$(this).parent().append(video);
299
300		
301	});
302
303
304	var is_disqus_loaded = false;
305	function show_disqus( id_disqus,url_disqus ) {
306	      if (!is_disqus_loaded){
307	      	var script_disqus = $('<script type="text/javascript">');
308			script_disqus.text("var disqus_shortname = 'cinepremiere12';"+
309					"var disqus_identifier = '"+id_disqus+"';"+
310					"var disqus_url = '"+url_disqus+"';"+
311					"(function() {"+
312					"var dsq = document.createElement('script');"+
313					"dsq.type = 'text/javascript';"+
314					"dsq.async = true;"+
315					"dsq.src = 'https://cinepremiere12.disqus.com/embed.js';"+
316				"(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);})();");
317			var pub = '<div class="publicidad for_comm">'+
318		  		'<div id="div-gpt-ad-Leader_02_Desktop_970x90">'+
319		            '<script>'+
320		            'googletag.cmd.push(function() { googletag.display("div-gpt-ad-Leader_02_Desktop_970x90"); });'+
321		            '</script>'+
322        		'</div>'+
323			'</div>';
324			console.log(script_disqus);
325			$(script_disqus).insertAfter('#disqus_thread');
326			//$('.comments_wrapper .inner').append(scriptdis);
327			$('.comments_wrapper').append(pub);
328
329	      }
330	};
331
332
333
334	
335
336
337	if( $('.comments_wrapper').length ){
338		//comentarios nota
339		var commentsLoaded = false;
340		var disqus_shortname = 'cinepremiere12';
341		var disqus_identifier = $('.comments_wrapper').attr('data-commentsID');
342		var disqus_url = $('.share').attr('data-link');
343		disqus_url = disqus_url.replace('https://devcinepre.wpengine.com/','https://www.cinepremiere.com.mx/');
344		var script_disqus = $('<script type="text/javascript">');
345
346		$('.show_comments').click(function(e){
347			e.preventDefault();
348
349			$('.comments_wrapper,.overlay_comments').addClass('active');
350
351			if( commentsLoaded == false ){
352
353				commentsLoaded = true;
354				
355
356				script_disqus.text("var disqus_shortname = '"+disqus_shortname+"';"+
357						"var disqus_identifier = '"+disqus_identifier+"';"+
358						"var disqus_url = '"+disqus_url+"';"+
359						"(function() {"+
360						"var dsq = document.createElement('script');"+
361						"dsq.type = 'text/javascript';"+
362						"dsq.async = true;"+
363						"dsq.src = 'https://cinepremiere12.disqus.com/embed.js';"+
364					"(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);})();");
365			    $(script_disqus).insertAfter('#disqus_thread');
366
367	    		/* * * Disqus Reset Function * * */
368			    
369		        // DISQUS.reset({
370		        //     reload: true,
371		        //     config: function () {
372		        //         this.page.identifier = disqus_identifier;
373		        //         this.page.url = disqus_url;
374		        //         this.language = 'es';
375		        //     }
376		        // });						
377
378
379			}else{
380				//do nothing
381			}
382		});
383		$('.comments_wrapper .close').click(function(e){
384			e.preventDefault();
385			$('.comments_wrapper,.overlay_comments').removeClass('active');
386			$('html').removeAttr('style');
387		});
388		$('.overlay_comments').click(function(e){
389			e.preventDefault();
390			$('.comments_wrapper .close').trigger('click');
391		});
392	}
393
394	//comentarios nota
395	$('.show_share').click(function(e){
396		e.preventDefault();
397		$(this).parent().toggleClass('active');
398		if( $(this).parent().hasClass('active') ){
399			$(this).children('span').text('Cerrar');
400			$(this).children('i').addClass('fa-times').removeClass('fa-share-alt');
401		}
402		else{$(this).children('span').text('Compartir');
403			$(this).children('i').addClass('fa-share-alt').removeClass('fa-times');
404		}
405 	});
406
407
408	//share nota
409	$('.share a,.share_alt a').click(function(){
410		var platform = $(this).attr('title');
411		ga('send', 'event',{
412		    eventCategory: 'share',
413		    eventAction: platform,
414		    eventLabel: window.location,
415		    transport: 'beacon'
416		});
417
418 	});
419
420
421	//taboola
422	// $('.text p:last').one('inview', function(event, isInView) {
423	// 	if (isInView) {
424	// 		var headerSc = $('<script type="text/javascript">');
425	// 		headerSc.text("window._taboola = window._taboola || [];_taboola.push({article:'auto'});!function (e, f, u, i) {if (!document.getElementById(i)){e.async = 1;e.src = u;e.id = i;f.parentNode.insertBefore(e, f);}}(document.createElement('script'),document.getElementsByTagName('script')[0],'//cdn.taboola.com/libtrc/g21-mexicodesconocido/loader.js','tb_loader_script');if(window.performance && typeof window.performance.mark == 'function'){window.performance.mark('tbl_ic');}");
426	// 		$(headerSc).prependTo("body");
427	// 		var footerSc = $('<script type="text/javascript">');
428	// 		footerSc.text("window._taboola = window._taboola || [];_taboola.push({flush: true});");
429	// 		$(footerSc).appendTo("body");
430	// 		var script = $('<script type="text/javascript">');
431	// 		if( $('html').hasClass('mobile')){
432	// 			script.text("window._taboola = window._taboola || [];_taboola.push({mode: 'thumbnails-d',container: 'taboola-mobile-below-article',placement: 'Mobile below article',target_type: 'mix'});")
433	// 		 	$(script).insertAfter( "#taboola-mobile-below-article");
434	// 		}
435	// 		else{
436	// 			script.text("window._taboola = window._taboola || [];_taboola.push({mode: 'thumbnails-d',container: 'taboola-desktop-below-article',placement: 'Desktop below article',target_type: 'mix'});")
437	// 			$(script).insertAfter( "#taboola-desktop-below-article");
438	// 		}
439	//  	}
440	// });
441
442
443	//si es old gallery
444	if($('.gallery_old').length){
445		var total = $('.gallery_old figure').length;
446		$('.gallery_old figure').each(function(i,e){
447        	var index = i+1;
448        	$(this).children('figcaption').append('<div class="counter"><strong>'+index+'</strong><span>'+total+'</span></div>')
449      	});
450      	// $('.gallery_old h3').each(function(i,e){
451      	// 	var checkText = $(this).text();
452      	// 	if( checkText.indexOf('_') > -1 || checkText.indexOf('-') > -1 ){
453      	// 		$(this).hide();
454      	// 	}
455      	// });
456	}
457
458
459	if($('.wp-block-embed__wrapper').length){
460		$('.wp-block-embed__wrapper').each(function(e,i){
461			var link = $(this).text();
462			if( link.indexOf('https://devmexico') > -1 || link.indexOf('https://www.mexicodesconocido') > -1 ){
463				$(this).empty();
464			}
465		});
466	}
467	
468
469	
470
471	//tabs
472	$('.tabs').each(function(){
473		var tabs = $(this).children('.content_choose').children('section');
474		$(this).children('.choose').children('a').click(function(e){
475			var top = $(this).parent().parent().offset().top - 80;
476
477			$(this).siblings('a').removeClass('active');
478			e.preventDefault();
479			$(this).addClass('active');
480			tabs.removeClass('active');
481			tabs.filter(this.hash).addClass('active');
482
483			$(document).scrollTop(top);
484
485		});
486	});
487
488
489
490
491	if($('article.article').length){
492
493		
494
495 		if( $('.widgetg21').length ){
496			
497			$('.widgetg21').one('inview', function(){
498				$.getJSON( '/postsWidgetG21.json', function( data ) {
499					$.each( data, function( key, val ) {
500						// console.log(data);
501						// console.log(val);
502						var constructor = '<a href="'+val.link+'" class="especial" rel="noopener" target="_blank">'+
503											'<figure>'+
504											 '<img load="lazy" src="'+val.thumbnail+'" alt="'+val.title+'">'+
505											'</figure>'+
506											'<figcaption>'+
507												'<strong>'+val.title+'</strong>'+
508												'<em>'+val.site+'</em>'+
509											'</figcaption>'+
510										'</a>';
511						$('.widgetg21 .scroller').append(constructor);
512					});
513				});
514
515			});
516			
517		}
518
519
520
521		var openImg = 0;
522		var gallery_imgs = [];
523		$('.principal img').each(function(){
524			var src = $(this).attr('data-src');
525			var credit = $(this).siblings().find('.rights').text();
526			credit = credit.replace('©','');
527    		credit = credit.replace('\u00A9','');
528			gallery_imgs.push({img:src,credit:credit,description:''});
529			$(this).click(function(){
530				$('.gallery_full').addClass('active');
531				$('.gallery_full figure').eq(0).css('display','flex');
532				$('.gallery_full img[data-src]').each(function(index,elem) {
533						$(this).one('inview', function(){
534							$(this).attr("src", $(this).attr("data-src"));
535							$(this).on('load',function(){
536								$(this).addClass('ready');
537							});
538						});
539					});
540					var actual = window.location.href;
541					if( window.location.hash != '#galeria') {
542					    window.history.pushState(null, null, actual+'#galeria');
543					    ga('create', 'UA-170116-38');
544						ga('require', 'linker');
545						ga('send', 'pageview', { 'page': location.pathname + location.hash});
546						ga('send', 'event', 'Interaction', 'Open Gal', window.location);
547					}
548			});
549		});
550		$('.content_note *:not(.writter) img').each(function(index){
551			if(!$(this).parents('.scroller').length && !$(this).parents('.next_article').length){
552				var src = $(this).attr('data-src');
553				var src2 = $(this).attr('src');
554				var credit = $(this).siblings().find('.media-credit').text();
555				var desc = $(this).siblings().clone().children().remove().end().text();
556				if(src != '' && src != undefined || src2 != '' && src2 != undefined){
557					gallery_imgs.push({img:src,img_alt:src2,credit:credit,description:desc});
558				}
559				$(this).click(function(){
560					var ind = index+1;
561					openImg = ind;
562					$('.gallery_full').addClass('active');
563					$('.gallery_full figure').eq(ind).css('display','flex');
564					$('.gallery_full img[data-src]').each(function(index,elem) {
565						$(this).one('inview', function(){
566							$(this).attr("src", $(this).attr("data-src"));
567							$(this).on('load',function(){
568								$(this).addClass('ready');
569							});
570						});
571					});
572					var actual = window.location.href;
573					if( window.location.hash != '#galeria') {
574					    window.history.pushState(null, null, actual+'#galeria');
575					    ga('create', 'UA-170116-38');
576						ga('require', 'linker');
577						ga('send', 'pageview', { 'page': location.pathname + location.hash});
578						ga('send', 'event', 'Interaction', 'Open Gal', window.location);
579					}
580				});
581			}
582		});
583
584		$(window).on('hashchange', function() {
585			var hash = window.location.hash;
586	        if( hash != '#galeria') {
587	        	$('.gallery_full .close').trigger('click');
588	        }
589	    });
590
591		var total = gallery_imgs.length;
592		$.each(gallery_imgs, function(index) {
593    		var img = this.img;
594    		var credit = this.credit;
595    		var desc = this.description;
596    		var ind = index+1;
597
598    		if(img == '' || img == undefined){
599    			var img = this.img_alt;	
600    		}
601    		if(credit){
602    			credit = '\u00A9 '+credit;
603    		}
604    		var constructor = '<figure>'+
605    							'<img data-src="'+img+'">'+
606    							'<figcaption>'+
607    								'<span>'+desc+'</span>'+
608    								'<em>'+credit+'</em>'+
609    								'<div class="counter"><span>'+ind+'</span><span>'+total+'</span></div>'+
610    							'</figcaption>'+
611    						   '</figure>';
612			$('.gallery_full .slider').append(constructor);
613		});
614		$('.gallery_full .close').click(function(e){
615			e.preventDefault();
616			$('.gallery_full').removeClass('active');
617			$('.gallery_full figure').removeAttr('style');
618			if( window.location.hash === '#galeria'){
619				window.history.back()
620			}
621		});
622		$('.gallery_full button').click(function(e){
623			e.preventDefault();
624			if( $(this).hasClass('next') ){
625				if(openImg == (total-1)){}
626				else{
627					openImg++;
628					$('.gallery_full figure').removeAttr('style');
629					$('.gallery_full figure').eq(openImg).css('display','flex');
630				}
631				
632			}else{
633				if(openImg == 0){}
634				else{
635					openImg--;
636					$('.gallery_full figure').removeAttr('style');
637					$('.gallery_full figure').eq(openImg).css('display','flex');
638				}
639			}
640		});
641		
642
643		
644		if($('.related_destination').length){
645			var related = $('.related_destination');
646			$('.content_note > p').eq(2).after(related);
647		};
648
649		if($('.popular_posts').length){
650			var popular = $('.popular_posts');
651			$('.content_note > p').eq(5).after(popular);
652		};
653
654		if($('.next_article').length){
655			var next = $('.next_article');
656			var len = ($('.content_note > p').length)/2;
657			len = Math.round(len);
658			$('.content_note > p').eq(len).before(next);
659
660		};
661
662		$('.scroller a').click(function(){
663			var parent = $(this).parent().parent().parent();
664			var goingto = $(this).attr('href');
665			var labelName = '';
666			if(parent.hasClass('related_destination')){
667				labelName = 'Relación destino';
668			}
669			else if(parent.hasClass('popular_posts')){
670				labelName = 'Relación popular';
671			}
672			else if(parent.hasClass('widgetg21')){
673				labelName = 'Relación widgetg21';
674			}
675			ga('send', 'event',{
676			    eventCategory: 'View Article',
677			    eventAction: labelName,
678			    eventLabel: window.location+ ' | ' +goingto,
679			    transport: 'beacon'
680			});
681		});
682
683		$('.next_article a').click(function(){
684			var goingto = $(this).attr('href');
685			var labelName = 'Siguiente artículo';
686			ga('send', 'event',{
687			    eventCategory: 'View Article',
688			    eventAction: labelName,
689			    eventLabel: window.location+ ' | ' +goingto,
690			    transport: 'beacon'
691			});
692		});
693
694		// if($('#videovidoomy').length){
695		// 	var script = $('<script type="text/javascript" src="//ads.vidoomy.com/cinepremiere_1206.js" ></script>');
696		// 	$('.content_note p').eq(3).one('inview', function(){
697		// 		$(this).one('inview', function(){
698		// 				// $(script).insertAfter($('#videovidoomy'));
699		// 		});	
700		// 	})
701		// };
702
703						
704
705	}
706
707	if($('html').hasClass('mobile')){
708		var list_items = $('.list_items');
709		list_items.each(function(){
710			$(this).wrap('<section class="wrap_items"></section>');
711			var items = ($(this).children('.item').length) * 310;
712			$(this).css('width',items);
713		});
714		
715	}
716
717
718	//info de estado
719	$('.show_info').click(function(e){
720		e.preventDefault();
721		$('.info_estado').slideDown();
722		setTimeout(function(){
723			var top = $('.info_estado').offset().top - 100;
724			$('html,body').animate({scrollTop: top}, 500);	
725		},100);
726	});
727
728
729
730	//scroll destinos
731	$('.items_menu a').click(function(e){
732		e.preventDefault();
733		var go_to = $(this).attr('href');
734		var top = $(go_to).offset().top - 120;
735		$('html,body').animate({scrollTop: top}, 500);
736	});
737
738
739	//video destinos
740	var videoIn = false;
741	$('.show_video').click(function(e){
742		e.preventDefault();
743		var video = $('.modal.video').attr('data-video');
744		$('.modal.video').addClass('active');
745		if( !videoIn ){
746			videoIn = true;
747			$('.modal.video').append(video);
748		}
749	});
750	$('.modal .close').click(function(e){
751		e.preventDefault();
752		$(this).parent().removeClass('active');
753	});
754
755
756
757	//resize evt
758	var resizeTimer;
759	$(window).on('resize', function() {
760	
761		clearTimeout(resizeTimer);
762		resizeTimer = setTimeout(function() {	
763			// Run code here, resizing has "stopped"
764			
765		}, 250);
766	});
767				
768
769
770	/*--- ADS --*/
771	// $('.fixed_ad .close').click(function(e){
772	// 	e.preventDefault();
773	// 	$('.fixed_ad').removeClass('active');
774	// });
775	// var adsPlacements = [];
776	// var refreshing;
777	// function appendAd(where,id,slot){
778	// 	if (window.googletag && googletag.apiReady) {
779	// 		var placement = "<div id='"+id+"'>"+
780	// 					    "<script>"+
781	// 					    "googletag.cmd.push(function() { googletag.display('"+id+"'); });"+
782	// 					    "</script>"+
783	// 				    	"</div>";
784	// 		where.append(placement);
785	// 		setTimeout(function(){
786	// 			googletag.pubads().refresh([gptAdSlots[slot]]);
787	// 		},10);
788	// 	}
789	// };
790	// function adsReady(){
791	// 	$('.fixed_ad').addClass('active');
792	// 	setTimeout(function(){
793	// 		$('.adPlacement').each(function(){
794	// 			var ad_id = $(this).attr('data-ad');
795	// 			var slot = $(this).attr('data-slot');
796	// 			var where = $(this);
797	// 			adsPlacements.push({id:ad_id,slot:slot});
798	// 			$(this).one('inview', function(){
799	// 				appendAd(where,ad_id,slot);
800	// 			});
801	// 		});
802	// 	},300);
803	// };
804	// function refreshAds(bool){
805	//   if(bool){
806    //     refreshing = setInterval(function(){
807    //     	$('.fixed_ad').addClass('active');
808    //     	$('.fixed_ad .close').click(function(){
809    //     		$(this).parent().remove();
810    //     	});
811    //     	setTimeout(function(){
812	//         	$.each( adsPlacements, function() {
813	//         		var ad_id = this.id;
814	//         		var slot = this.slot;
815	// 				if ($('.adPlacement[data-ad="'+ad_id+'"]').visible(true) ) {
816	// 				    //visible
817	// 				    googletag.pubads().refresh([gptAdSlots[slot]]);
818	// 				    //console.log('refresh ID '+ ad_id+ ' slot ' + slot);
819	// 				} else {
820	// 				    //novisible
821	// 				    //console.log('no se ve '+ value);
822	// 				}
823	// 		 	});
824    //     	},100);
825    // 	},30000);
826	//   }else{
827	//     clearInterval(refreshing); 
828	//   }
829	// };
830	// function refreshAdsFocus(){
831    //     $('.fixed_ad').addClass('active');
832    //     $('.fixed_ad .close').click(function(){
833    //     		$(this).parent().remove();
834    //     });
835    //     setTimeout(function(){
836	// 		$.each( adsPlacements, function() {
837	//     		var ad_id = this.id;
838	//     		var slot = this.slot;
839
840	//     		if(ad_id != 'div-gpt-ad-1564686662412-0'){
841	//     			if ($('.adPlacement[data-ad="'+ad_id+'"]').visible(true) ) {
842	//     				googletag.pubads().refresh([gptAdSlots[slot]]);
843	//     			}
844	//     		}
845
846				
847	// 	 	});
848	// 	},300);
849	// };
850	// function addPublicity(){
851	// 	var ids_not_pub = ['67714'];
852	// 	var theID = $('#single').attr('data-id');
853	// 	if( ids_not_pub.includes(theID) == false ){
854	// 		var parragraphs; 
855	// 		var article = '<div class="publicidad ad_in_text"></div>';
856	// 		var pLength;
857	// 		var id_ad;
858	// 		var slot;
859	// 		if($('html').hasClass('mobile')){
860	// 			parragraphs = $('.content_note > *');
861	// 			pLength = 6;
862	// 			id_ad = 'div-gpt-ad-Box_Banner_01_Mobile_300x250';
863	// 			slot = 2;
864	// 		}
865	// 		else{
866	// 			parragraphs = $('.content_note > *');
867	// 			pLength = 10;
868	// 			id_ad = 'div-gpt-ad-Box_Banner_01_Desktop_300x250';
869	// 			slot = 6;
870	// 			$('.first').on('inview', function(event, isInView) {
871	// 			  if (isInView) {
872	// 			    appendAd($(this),id_ad,slot);
873	// 			  } else {
874	// 			    var newHeight = $(this).height();
875	// 				var newHeight2 = newHeight - 35;
876	// 			    $(this).css('min-height',newHeight2 );
877					
878	// 			    $(this).empty();
879	// 			  }
880	// 			});
881	// 		}
882	// 		parragraphs.each(function(index){
883	// 			index = index+1;
884	// 			if(index % pLength == 0) {
885	// 				$(this).after(article);
886	// 			}
887	// 		});	
888				
889	// 		$('.ad_in_text').each(function(index){
890	// 			var adVar = $(this);
891	// 			$(this).on('inview', function(event, isInView) {
892	// 			  if (isInView) {
893	// 			    appendAd($(this),id_ad,slot);
894	// 			  } else {
895	// 			    var newHeight = adVar.height();
896	// 				var newHeight2 = newHeight - 35;
897	// 			    adVar.css('min-height',newHeight2);
898					
899	// 			    $(this).empty();
900	// 			  }
901	// 			});
902	// 		});
903	// 	}
904	// };
905	// function enableGPTservice(){
906	// 	var counter = 0;
907	// 	var checking = setInterval(function() {
908	// 		counter = counter + 1;
909	// 		if (window.googletag && googletag.apiReady) {
910	// 			//console.log(adsPlacements);
911	// 			clearInterval(checking);
912	// 			adsReady();
913	// 			//refreshAds(true);
914	// 			addPublicity();
915
916	// 		}
917	// 		else{
918	// 			// console.log('waiting');
919	// 			if( counter == 20 ){
920	// 				clearInterval(checking);
921	// 			}
922	// 		}
923	// 	}, 1000);
924	// };
925
926	// var adblock = false;
927	// adblockDetect(function(adblockDetected){
928    // 	if(adblockDetected){
929	// 		adblock = true;
930	//     }
931	//     else{
932	//         adblock = false;
933	//     }
934	// },{
935	// 	testInterval: 40,
936	// 	testRuns: 5
937	// });
938
939	
940	// if(/bot|googlebot|crawler|spider|robot|crawling/i.test(navigator.userAgent === true ) ){
941	// 	adblock = true;
942	// };
943	// function printAds(){
944	// 	$('.fixed_ad').addClass('active');
945	// 	$('.adPlacement').each(function(){
946	// 		$(this).removeClass('adPlacement');
947	// 		var ad_id = $(this).attr('data-ad');
948	// 		var constructor = $('<a class="our_link" target="_blank">');
949	// 		var link = 'https://mag21.mx/cinepremiere/';
950	// 		var imgbanner = '<img src="'+theme+'/ads/block/mag21-cp-box.gif">';
951			
952	// 		if( ad_id == 'div-gpt-ad-Billboard_01_Desktop_970x250'){
953	// 			if( $('html').hasClass('mobile') ){
954	// 				imgbanner = '<img src="'+theme+'/ads/block/mag21-cp-leader-movil.gif">';	
955	// 			}
956	// 			else{
957	// 				imgbanner = '<img src="'+theme+'/ads/block/mag21-cp-leader.gif">';		
958	// 			}
959	// 		}
960	// 		else if( ad_id == 'div-gpt-ad-Leader_01_Desktop_970x90' || ad_id == 'div-gpt-ad-Leader_02_Desktop_970x90' || ad_id == 'div-gpt-ad-1862720-2' || ad_id == 'div-gpt-ad-1581462169725-0'){
961	// 			if( $('html').hasClass('mobile') ){
962	// 				imgbanner = '<img src="'+theme+'/ads/block/mag21-cp-leader-movil.gif">';	
963	// 			}
964	// 			else{
965	// 				imgbanner = '<img src="'+theme+'/ads/block/mag21-cp-leader.gif">';		
966	// 			}
967	// 		}
968	// 		else if( ad_id == 'div-gpt-ad-Box_Banner_01_Mobile_300x250' || ad_id == 'div-gpt-ad-Box_Banner_01_Desktop_300x250'){
969	// 			imgbanner = '<img src="'+theme+'/ads/block/mag21-cp-box.gif">';
970	// 		}
971	// 		else if( ad_id == 'div-gpt-ad-Half_Page_01_300x600'){
972	// 			imgbanner = '<img src="'+theme+'/ads/block/mag21-cp-half.gif">';
973	// 		}
974			
975	// 		if(  ad_id != 'div-gpt-ad-1564686662412-0' ){
976	// 			constructor.attr('href',link);
977	// 			constructor.append(imgbanner);	
978	// 			$(this).append(constructor);
979	// 			constructor.click(function(){
980	// 				ga('send', 'event',{
981	// 				    eventCategory: 'Mag21',
982	// 				    eventAction: 'Open',
983	// 				    eventLabel: window.location,
984	// 				    transport: 'beacon'
985	// 				});
986	// 			});
987	// 		}
988			
989			
990	// 	});
991	// };
992	// function moreAds(){
993	// 	if( $('article.article').length ){
994	// 		var smart = $('<script type="application/javascript" src="//ced.sascdn.com/tag/1177/smart.js" async></script>');
995	// 		$(smart).appendTo('body');
996
997	// 		var generic = $('<script type="application/javascript"></script>');
998	// 		generic.text('var sas = sas || {};sas.cmd = sas.cmd || [];sas.cmd.push(function() {sas.setup({ networkid: 1177, domain: "//www5.smartadserver.com", async: true });});');
999	// 		$(generic).appendTo('body');
1000
1001	// 		var smart_layer = $('<script async type="application/javascript"></script>');
1002	// 		smart_layer.text('sas.cmd.push(function() {sas.call("std", {siteId: 63423,pageId: 497437,formatId: 28567,target:""});});');
1003	// 		$(smart_layer).appendTo('body');
1004
1005	// 		var navegg = $('<script id="navegg" type="text/javascript" src="//tag.navdmp.com/tm41771.js" async></script>');
1006	// 		$(navegg).appendTo('body');
1007			
1008	// 	}
1009	// }
1010
1011	
1012	
1013	// //enable services
1014	// $(window).on('load',function(){
1015
1016	// 	//si no es advertorial
1017	// 	if( $('.inner[data-author="advertorial"]').length || $('article.simple').length || $('.inner[data-
1017patreon="1"]').length){
1018	// 		$('.publicidad,.mag21_fixed_ad,.fixed_ad,#videovidoomy,#outbrain_container').remove();
1019	// 	}
1020	// 	else{
1021	// 		if(!adblock){
1022	// 			enableGPTservice();
1023	// 			//moreAds();
1024	// 		}else{
1025	// 			printAds();
1026	// 		}
1027	// 	}
1028	// });
1029	$(window).on('blur',function(){
1030	   //clearInterval(refreshing); 
1031	   //refreshAds(false);
1032	});
1033	$(window).on('focus',function(){
1034	  //refreshAds(true);
1035	  //SECOMENTA EL REFRESH POR SOLICITUD DE ARACELI refreshAdsFocus();
1036	});
1037
1038	setTimeout(function(){
1039		$('#preloader').fadeOut();	
1040	},300);
1041	
1042
1043	$('.califica').change( function(e){
1044		e.preventDefault();
1045		
1046
1047		var docId = parseInt($('#idDoc').val());
1048		var userStar = parseInt($('input:radio[name=rating]:checked').val());
1049
1050
1051		//Envio de datos para el ajax
1052		var ajax_datos = {
1053			action : 'stars_users_function',
1054			idPost : docId,
1055			stars : userStar
1056		};
1057
1058		$.ajax({
1059			url  : '/wp-admin/admin-ajax.php', //PARA SERVIDOR LINUX O PRODUCCION
1060			//url  : '/cinepremiere2017/wp-admin/admin-ajax.php', //para localhost
1061			type : 'post',
1062			data : ajax_datos,
1063			beforeSend : function(){
1064				$('body').append('<i class="fa fa-spinner fa-spin loader"></i>');
1065			},
1066			success : function(data){
1067
1068				var data = JSON.parse(data);
1069				console.log(data);
1070				$(".users").find("strong").first().html("Usuarios: " + data.user_star);
1071				$(".users").find("span").first().replaceWith('<span data-stars="num'+data.user_star+'"></span>');
1072
1073				//$('.note .data_note .califica').hide();
1074				$('.loader').remove();
1075			}
1076		});
1077	
1078	});
1079
1080
1081
1082	// $('#mas_autores').click(function(e) {
1083	// 	e.preventDefault();
1084
1085	// 	var doc_id = $('#doc_id').val();
1086	// 	var autors_printed = $('#autors_printed').val();
1087
1088	// 	$.ajax({
1089	// 		url  : '/wp-admin/admin-ajax.php', //ajax WP
1090	// 		type : 'POST',
1091	// 		data : {
1092	// 				action : 'ajax_autores',
1093	// 				autors_printed : autors_printed
1094	//    		},
1095	// 		beforeSend : function(){
1096	// 			$('body').append('<i class="fas fa-spin fa-spinner loader"></i>');
1097	// 		},
1098	// 		success : function(data){
1099	// 			var data = JSON.parse(data);
1100				 
1101	// 			$('i.loader').remove();
1102	// 			$('.listed').append(data.a);
1103	// 			if( data.a == "" ){
1104	// 				$('#mas_autores').remove();
1105	// 			}
1106	// 			$('#autors_printed').val(data.b);
1107	// 		}
1108	// 	});
1109	// });
1110
1111
1112	
1113	// $('.mag21_newfix .close').click(function(e){
1114	// 	e.preventDefault();
1115	// 	$('.mag21_newfix').remove();
1116	// });
1117	
1118	// if( $('.lightbox.gopatreon').length ){
1119		// if(localStorage.visits) {
1120		// 	localStorage.visits = Number(localStorage.visits) + 1;
1121		// }
1122		// else{
1123		// 	localStorage.visits = 1;
1124		// 	setTimeout(function(){
1125		// 		$('.lightbox.gopatreon').addClass('active');
1126		// 	},1000);
1127		// }
1128		// if( localStorage.visits == 3 ){
1129		// 	setTimeout(function(){
1130//DESCOMENTAR PARA ACTIVAR      $('.lightbox.gopatreon').addClass('active');
1131		// 	},1000);
1132		// 	localStorage.visits = 1;
1133		// }
1134	// }
1135
1136	// $('.shareButton').click(function(e){
1137	// 	e.preventDefault();	
1138		
1139	// 		$('.shareButton').toggleClass("open");
1140
1141
1142	// });
1143
1144
1145
1146	// const shareButton = document.querySelectorAll("a.shareButton");
1147
1148	// 	shareButton[0].addEventListener("click", (e) => {
1149	// 		for( let i=0; i < shareButton.length; i++ ) {
1150	// 		shareButton[i].classList.toggle("open")
1151	// 		shareButton[0].classList.remove("sent")
1152	// 		}
1153	// 	});
1154
1155	// 	for( let i=1; i < shareButton.length; i++ ) {
1156		
1157	// 		shareButton[i].addEventListener("click", (e) => {
1158				
1159	// 		for( let i=0; i < shareButton.length; i++ ) {
1160	// 			shareButton[i].classList.toggle("open")
1161	// 		}
1162
1163	// 		shareButton[0].classList.toggle("sent")
1164	// 		});
1165	// 	}
1166
1167	
1168	
1169		 // ID del banner que quieres detectar
1170	  const bannerIdMundoMaya = 'g21_skin_MundoMaya_01Diciembre2025';
1171	
1172	  // Buscar si existe un banner con ese data-id
1173	  const $bannerMundoMaya = $(`.banner_central_impression[data-id="${bannerIdMundoMaya}"]`);
1174	
1175	  // Si el banner existe → ocultar el div publicidadclose
1176	  if ($bannerMundoMaya.length > 0) {
1177		$('#publicidadclose').hide();
1178	  }
1179	  
1180});
1181
1182

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.