PageSourceSearch

https://desarrollosindustriales.com/wp-content/themes/enginir/js/core.js?ver=514dc6c68ed013b35a14b588b19e99bf

js desarrollosindustriales.com collected 2026-10-09 21:19:02 UTC 9,790 bytes, 278 lines download raw bytes

1"use strict";
2
3/*----  Functions  ----*/
4
5var creativesplanet_sticky_header = function() {
6	if( jQuery('.cspt-header-sticky-yes').length > 0 ){
7		var offset_px = 0;
8		if( jQuery('#wpadminbar').length>0 && (self===top) ){
9			offset_px = jQuery('#wpadminbar').height();
10		}
11		jQuery('.cspt-header-menu-area.cspt-header-sticky-yes').parent().css('height', jQuery('.cspt-header-menu-area.cspt-header-sticky-yes').height() );
12		if( jQuery(document).width()>cspt_js_variables.responsive ){
13			jQuery( '.cspt-header-sticky-yes' ).stick_in_parent({ 'parent':'body', 'spacer':false, 'offset_top':offset_px, 'sticky_class':'cspt-sticky-on'}).addClass('cspt-sticky-applied');
14		} else {
15			if( jQuery( '.cspt-header-sticky-yes' ).hasClass('cspt-sticky-applied') ){
16				jQuery( '.cspt-header-sticky-yes' ).trigger("sticky_kit:detach").removeClass('cspt-sticky-applied');
17			}
18		}
19	}
20}
21
22var creativesplanet_sticky_header = function() {
23	if( jQuery('.cspt-header-sticky-yes').length > 0 ){
24		var offset_px = 0;
25		if( jQuery('#wpadminbar').length>0 ){
26			offset_px = jQuery('#wpadminbar').height();
27		}
28		if( jQuery(document).width()>cspt_js_variables.responsive ){
29			jQuery( '.cspt-header-sticky-yes' ).stick_in_parent({ 'parent':'body', 'spacer':false, 'offset_top':offset_px, 'sticky_class':'cspt-sticky-on'}).addClass('cspt-sticky-applied').on("sticky_kit:stick", function(e) { 
30				if( jQuery('.cspt-sep-sticky-logo-container').length>0 ){
31					var logo_width = jQuery('.cspt-sep-sticky-logo-container').width();
32					jQuery('.cspt-sticky-on .navigation-top').css({ paddingLeft: logo_width + 30 }, function(){
33						jQuery('.cspt-sep-sticky-logo-container').css({ opacity: "1" })
34					});
35				}
36			}).on("sticky_kit:unstick", function(e) {
37				if( jQuery('.cspt-sep-sticky-logo-container').length>0 ){
38					jQuery('.navigation-top').css({paddingLeft: 0 });
39					jQuery('.cspt-sep-sticky-logo-container').css({opacity: "0"},function(){
40						jQuery('.navigation-top').css({paddingLeft: 0 })
41					});
42				}
43			});
44		} else {
45			if( jQuery( '.cspt-header-sticky-yes' ).hasClass('cspt-sticky-applied') ){
46				jQuery( '.cspt-header-sticky-yes' ).trigger("sticky_kit:detach").removeClass('cspt-sticky-applied');
47			}
48		}
49	}
50}
51
52var cspt_toggleSidebar = function() {
53	jQuery(".cspt-navbar > div").toggleClass("active");
54	if( jQuery('.cspt-navbar > div > .closepanel').length==0 ){
55		jQuery('.cspt-navbar > div').append("<span class='closepanel'><i class='cspt-base-icon-cancel'></i></span>");
56		jQuery('.cspt-navbar > div > .closepanel').on('click', function(){	    		
57			jQuery('.nav-menu-toggle').trigger('click');	    		
58		});
59	}
60}
61
62
63var creativesplanet_stretched_col_calc = function() {
64
65	if( jQuery('.wpb_column.cspt-col-stretched-yes').length>0 ){
66
67		// Returns width of browser viewport
68		var window_width = jQuery( window ).width();
69	 
70		// Returns width of HTML document
71		var document_width = jQuery( document ).width();
72		
73		jQuery('.wpb_column.cspt-col-stretched-yes').each(function(){
74			var this_ele    = jQuery(this);
75			var main_width  = jQuery('#main').width();
76			var extra_width = ((window_width - main_width)/2);
77			var curr_width  = jQuery('.wpb_wrapper', this_ele).width();
78			var wrapper_div   = '';
79			var minimum_width = 0;
80			var both_margin   = false;
81
82			if( this_ele.parent().hasClass('cspt-break-col-1200') ){
83				minimum_width = 1200;
84			} else if( this_ele.parent().hasClass('cspt-break-col-991') ){
85				minimum_width = 991;
86			} else if( this_ele.parent().hasClass('cspt-break-col-767') ){
87				minimum_width = 767;
88			}
89			if( minimum_width > 0 && document_width < minimum_width ){
90				both_margin = true;
91			}
92			
93			if( this_ele.hasClass('cspt-col-stretched-right') ){
94				if( this_ele.hasClass('cspt-col-stretched-content-yes') ){
95					wrapper_div = ', .vc_column-inner > .wpb_wrapper';
96				}
97				jQuery('.vc_column-inner > .cspt-stretched-div'+wrapper_div, this_ele).css( 'margin-right','-'+extra_width+'px' );
98				if( both_margin == true ){
99					jQuery('.vc_column-inner > .cspt-stretched-div'+wrapper_div, this_ele).css( 'margin-left','-'+extra_width+'px' );
100				} else {
101					jQuery('.vc_column-inner > .cspt-stretched-div'+wrapper_div, this_ele).css( 'margin-left','' );
102				}
103
104			} else {
105				if( this_ele.hasClass('cspt-col-stretched-content-yes') ){
106					wrapper_div = ', .vc_column-inner > .wpb_wrapper';
107				}
108				jQuery('.vc_column-inner > .cspt-stretched-div'+wrapper_div, this_ele).css( 'margin-left','-'+extra_width+'px' );
109				if( both_margin == true ){
110					jQuery('.vc_column-inner > .cspt-stretched-div'+wrapper_div, this_ele).css( 'margin-right','-'+extra_width+'px' );
111				} else {
112					jQuery('.vc_column-inner > .cspt-stretched-div'+wrapper_div, this_ele).css( 'margin-right','' );
113				}
114
115			}
116				
117		});
118	
119	}
120}
121
122
123var cspt_sorting = function() {
124	jQuery('.cspt-sortable-yes').each(function(){
125		var boxes	= jQuery('.cspt-element-posts-wrapper', this );
126		var links	= jQuery('.cspt-sortable-list a', this );			
127		boxes.isotope({
128			animationEngine : 'best-available'
129		});
130		links.on('click', function(e){
131			var selector = jQuery(this).data('sortby');
132			if( selector != '*' ){
133				var selector = '.' + selector;
134			}
135			boxes.isotope({
136				filter			: selector,
137				itemSelector	: '.cspt-ele',
138				layoutMode		: 'fitRows'
139			});
140			links.removeClass('cspt-selected');
141			jQuery(this).addClass('cspt-selected');
142			e.preventDefault();
143		});
144	});
145}
146
147var cspt_back_to_top = function() {
148	// scroll-to-top
149	var btn = jQuery('.scroll-to-top');
150
151	jQuery(window).scroll(function() {
152	if (jQuery(window).scrollTop() > 300) {
153		btn.addClass('show');
154	} else {
155		btn.removeClass('show');
156	}
157	});
158
159	btn.on('click', function(e) {
160	e.preventDefault();
161	jQuery('html, body').animate({scrollTop:0}, '300');
162	});
163}
164
165var cspt_navbar = function() {
166
167	jQuery('.cspt-navbar > div > ul li:has(ul)').append("<span class='sub-menu-toggle'><i class='cspt-base-icon-down-open-big'></i></span>");
168	jQuery('.cspt-navbar li').on('hover', function() {
169		if(jQuery(this).children("ul").length == 1) {
170			var parent		= jQuery(this);
171			var child_menu	= jQuery(this).children("ul");
172			if( jQuery(parent).offset().left + jQuery(parent).width() + jQuery(child_menu).width() > jQuery(window).width() ){
173				jQuery(child_menu).addClass('cspt-nav-left');
174			} else {
175				jQuery(child_menu).removeClass('cspt-nav-left');
176			}
177		}
178	});
179
180	jQuery(".nav-menu-toggle").on("click tap", function() {
181		cspt_toggleSidebar();
182	});
183	
184	jQuery('.cspt-navbar > div > ul > li:has(ul) > a[href="#"], .sub-menu-toggle').on( 'click', function() {
185		if(jQuery(this).siblings('.sub-menu, .children').hasClass('show')){
186			jQuery(this).siblings('.sub-menu, .children').removeClass('show');
187			jQuery( 'i', jQuery(this) ).removeClass('cspt-base-icon-up-open-big').addClass('cspt-base-icon-down-open-big');
188		} else {
189			jQuery(this).siblings('.sub-menu, .children').addClass('show');
190			jQuery( 'i', jQuery(this) ).removeClass('cspt-base-icon-down-open-big').addClass('cspt-base-icon-up-open-big');
191		}
192		return false;
193	});
194
195}
196
197var cspt_lightbox = function() {
198	var i_type = 'image';
199	jQuery('a.cspt-lightbox, a.cspt-lightbox-video, .cspt-lightbox-video a, .cspt-lightbox a').each(function(){
200		if( jQuery(this).hasClass('cspt-lightbox-video') || jQuery(this).closest('.wpb_single_image').hasClass('cspt-lightbox-video') || jQuery(this).closest('.vc_icon_element').hasClass('cspt-lightbox-video') ){
201			i_type = 'iframe';
202		} else {
203			i_type = 'image';
204		}
205		jQuery(this).magnificPopup({type:i_type});
206	});
207}
208
209var cspt_video_popup = function() {
210	jQuery('.cspt-popup').on('click', function(event) {
211		event.preventDefault();
212		var href  = jQuery(this).attr('href');
213		var title = jQuery(this).attr('title');
214		window.open( href , title, "width=600,height=500");
215	});
216}
217
218var cspt_testimonial = function() {
219	jQuery('.cspt-testimonial-active').each(function(){
220		var ele_parent = jQuery(this).closest('.cspt-element-posts-wrapper');
221		jQuery('.creativesplanet-ele.creativesplanet-ele-testimonial', ele_parent ).on('mouseover', function() {
222			jQuery('.creativesplanet-ele.creativesplanet-ele-testimonial', ele_parent ).removeClass('cspt-testimonial-active');
223			jQuery(this).addClass('cspt-testimonial-active');
224		});
225	});
226}
227
228var cspt_search_btn = function(){
229	jQuery(function() {
230		jQuery('.cspt-header-search-btn').on("click", function(event) {
231			event.preventDefault();
232			jQuery(".cspt-header-search-form-wrapper").addClass("open");
233			jQuery('.cspt-header-search-form-wrapper input[type="search"]').focus();
234		});
235		jQuery(".cspt-search-close").on("click keyup", function(event) {
236			jQuery(".cspt-header-search-form-wrapper").removeClass("open");
237		});
238	});
239}
240
241var cspt_gallery = function(){
242	jQuery("div.cspt-gallery").each(function(){
243		jQuery( this ).lightSlider({ item: 1, auto: true, loop: true, controls: false, speed: 1500, pause: 5500 }); 
244	});
245}
246
247/*----  Events  ----*/
248
249// On resize
250jQuery(window).resize(function(){
251	setTimeout(function() {
252		creativesplanet_sticky_header();
253		creativesplanet_stretched_col_calc();
254	  }, 100);
255});
256
257// on ready
258jQuery(document).ready(function(){
259	cspt_sorting();
260	creativesplanet_stretched_col_calc();
261	cspt_back_to_top();
262	creativesplanet_sticky_header();
263	cspt_navbar();
264	cspt_lightbox();
265	cspt_video_popup();
266	cspt_testimonial();
267	cspt_search_btn();
268});	
269var cspt_preloader = function() {
270	jQuery(".cspt-preloader").fadeOut('600');
271}
272// on load
273jQuery(window).on( 'load', function(){
274	cspt_preloader();
275	cspt_sorting();
276	cspt_gallery();
277	creativesplanet_sticky_header();
278});

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.