PageSourceSearch

https://www.lenamccoder.com/wp-content/themes/lmcba/js/theme.js

js lenamccoder.com collected 2026-09-29 08:59:04 UTC 13,199 bytes, 357 lines download raw bytes

1"use strict";
2// Custom select
3function enableSelectBoxes(){
4	"use strict";
5	jQuery('div.selectBox').each(function(){
6		jQuery(this).children('span.selected').html(jQuery(this).children('div.selectOptions').children('span.selectOption:first').html());
7		jQuery(this).attr('value',jQuery(this).children('div.selectOptions').children('span.selectOption:first').attr('value'));
8		
9		jQuery(this).children('span.selected, span.selectArrow').on("click", function(){
10			if(jQuery(this).parent().children('div.selectOptions').css('display') == 'none'){
11				jQuery(this).parent().children('div.selectOptions').css('display','block');
12				jQuery(this).parents('.selectBox').addClass('act');
13			}
14			else
15			{
16				jQuery(this).parent().children('div.selectOptions').css('display','none');
17				jQuery(this).parents('.selectBox').removeClass('act');
18			}
19		});
20		
21		jQuery(this).find('span.selectOption').on("click", function(){
22			jQuery(this).parent().css('display','none');
23			jQuery(this).closest('div.selectBox').attr('value',jQuery(this).attr('value'));
24			jQuery(this).parent().siblings('span.selected').html(jQuery(this).html());
25			jQuery(this).parents('.selectBox').removeClass('act');
26		});
27		
28		jQuery("div.selectOptions").mouseleave(function() {
29			jQuery('div.selectOptions').css('display','none');
30			jQuery('.selectBox').removeClass('act');
31		});
32		
33	});				
34}
35
36// Fullwidth module
37function fw_block() {
38	"use strict";
39	if (jQuery('div').hasClass('right-sidebar') || jQuery('div').hasClass('left-sidebar')) {} else {
40		var fw_block = jQuery('.fw_block');
41		var fw_block_parent = fw_block.parent().width();
42		var fw_site_width = fw_block.parents('.wrapper').width();
43		var fw_contentarea_site_width_diff = fw_site_width - fw_block_parent - 70;
44
45		fw_block.css('margin-left', '-'+fw_contentarea_site_width_diff/2+'px').css('width', fw_site_width - 70 +'px').children().css('padding-left', fw_contentarea_site_width_diff/2+'px').css('padding-right', fw_contentarea_site_width_diff/2+'px');
46	jQuery('.module_google_map .fw_wrapinner, .module_wall .fw_wrapinner, .nfwrap .fw_wrapinner').css('padding-left', '0px').css('padding-right', '0px');
47	}
48}
49
50// Google Map Module
51function google_map_mobile() {
52	"use strict";
53	if (jQuery(window).width() < 768) {
54		jQuery('.module_google_map').each(function(){
55			jQuery(this).find('iframe').css({'height': jQuery(window).width()*0.4 + 130 + 'px'});
56		});
57	}
58}
59
60// Wrapper Height
61function wrapper_height() {
62	"use strict";
63	if (jQuery('.site_wrapper').size() > 0 && jQuery('footer').size() > 0) {
64		jQuery('.site_wrapper').css({'min-height': (jQuery(window).height() - jQuery('footer').height()) + 'px'});
65	}
66}
67
68jQuery(document).ready(function () {
69	"use strict";
70    var window_w = jQuery(window).width(),
71        window_h = jQuery(window).height(),
72        wrapper_h = jQuery('.wrapper').height(),
73        header_h = jQuery('header').height(),
74        footer_h = jQuery('footer').height(),
75        cont_fw_h = jQuery('.container.fw').height();
76
77    var bodytimer = setTimeout(function(){
78		jQuery('body').css('opacity', '1');
79		clearTimeout(bodytimer);
80	}, 1500);
81	
82	if (jQuery('.menu_scroll').size() > 0) {
83		jQuery('.menu_scroll .menu-main-container').append('<ul class="menu">'+jQuery('header').find('ul.menu').html()+'</ul>');
84	}
85
86    jQuery('.gt3_menu .menu .sub-menu .current-menu-item').parent().css('display', 'block').parent().addClass("gt3_menu_active_menu_item").find("span > i").removeClass("icon-chevron-down").addClass("icon-chevron-up");
87
88    jQuery('.current-menu-ancestor .current-menu-parent').addClass("current-menu-parent_open").parent().css('display', 'block').parent().addClass("gt3_menu_active_menu_item").find("span > i").removeClass("icon-chevron-down").addClass("icon-chevron-up");
89
90    jQuery('.horizontal_menu ul li > .sub-menu li.menu-item-has-children a span i').removeClass('icon-chevron-down').addClass('icon-angle-right');
91
92    var active_menu = jQuery('.gt3_menu .menu-item-has-children .sub-menu .menu-item-has-children').hasClass('current-menu-parent');
93    if (active_menu == false) {
94        jQuery('.gt3_menu .menu-item-has-children .sub-menu .menu-item-has-children').find("span > i").removeClass("icon-chevron-up").addClass("icon-chevron-down");
95    }	
96
97    if (window_w < 767) {
98        jQuery('.gt3_menu').wrap("<div class='menu_mobile'></div>");
99        jQuery('.menu_scroll').removeClass('menu_scroll');
100        jQuery('.menu_toggler').on("click", function(){
101            jQuery('.menu_mobile').slideToggle(300);
102        });
103    }
104
105    jQuery('.menu_scroll').jScrollPane({
106        autoReinitialise: true
107    });
108
109    jQuery('.share_text').on("click", function () {
110        jQuery(this).parent().find('.sh_fo_detail').toggle('fast');
111    });
112
113    jQuery('.menu_toggler').on("click", function () {
114        jQuery(this).toggleClass('active');
115        jQuery('body').toggleClass('gt3_menu_active');
116    });
117
118    jQuery(document).on("click", "footer, .wrapper", function () {
119        jQuery('.menu_toggler').removeClass('active');
120        jQuery('body').removeClass('gt3_menu_active');
121    });
122
123    jQuery(".search_form i").on("click", function () {
124        jQuery(this).parents(".search_form").find(".s_btn_search").on("click", function () {			
125		});
126    });
127
128    jQuery(".gt3_menu .menu-item-has-children > a").on("click", function () {
129        jQuery(this).next().slideToggle("fast").parent().toggleClass("gt3_menu_active_menu_item");
130        jQuery(this).find("span > i").toggleClass("icon-chevron-down");
131        jQuery(this).find("span > i").toggleClass("icon-chevron-up");
132    });
133
134    jQuery('.layer_block').mouseenter(function() {
135        var block_width = jQuery(this).attr('data-width'),
136            content_number = jQuery(this).find('.layer_block_content').size(),
137            content_height = jQuery('.layer_block_content').height(),
138            content_margin = (block_width - (content_height * content_number)) / 2;
139        jQuery(this).css({
140            'width': block_width,
141            'height': block_width,
142            'margin-left': -(block_width / 2 + 18),
143            'margin-top': -(block_width / 2 + 18),
144            'padding': (block_width / 3)
145        }).addClass('hovered').find('.layer_block_content:first-child').css({'margin-top': content_margin});
146        var hoveredtimer = setTimeout(function(){
147			jQuery('.hovered>.layer_block_content').css('display', 'block').css('transform', 'scale(1)');
148			clearTimeout(hoveredtimer);
149		}, 300);		
150    }).mouseleave(function() {
151        jQuery('.layer_block_content').css('display', 'none');
152        jQuery(this).css({
153            'width': 8,
154            'height': 8,
155            'margin-left': 0,
156            'margin-top': 0,
157            'padding': 0
158        }).removeClass('hovered');
159    });
160	
161	if (jQuery('.shop_ordering').size() > 0) {
162		// Custom select
163		enableSelectBoxes();
164	}
165	
166	/* NivoSlider */
167	if (jQuery('.nivoSlider').size() > 0) {
168		jQuery('.nivoSlider').each(function(){
169			jQuery(this).nivoSlider({
170				directionNav: true,
171				controlNav: false,
172				effect:'fade',
173				animSpeed: 200,
174				manualAdvance: true,
175				pauseTime:3000
176			});
177		});
178	}
179	
180	// Accordion & Toggle
181	if (jQuery('.module_accordion').size() > 0 || jQuery('.module_toggle').size() > 0) {
182		jQuery('.shortcode_accordion_item_title').on("click", function(){
183			if (!jQuery(this).hasClass('state-active')) {
184				jQuery(this).parents('.shortcode_accordion').find('.shortcode_accordion_item_body').slideUp('fast');
185				jQuery(this).next().slideToggle('fast');
186				jQuery(this).parents('.shortcode_accordion').find('.state-active').removeClass('state-active');
187				jQuery(this).addClass('state-active');
188			}
189		});
190		jQuery('.shortcode_toggles_item_title').on("click", function(){
191			jQuery(this).next().slideToggle('fast');
192			jQuery(this).toggleClass('state-active');
193		});
194	
195		jQuery('.shortcode_accordion_item_title.expanded_yes, .shortcode_toggles_item_title.expanded_yes').each(function( index ) {
196			jQuery(this).next().slideDown('fast');
197			jQuery(this).addClass('state-active');
198		});
199	}
200	
201	// Counter
202	if (jQuery('.shortcode_counter').size() > 0) {
203		if (jQuery(window).width() > 760) {
204			jQuery('.shortcode_counter').waypoint(function(){							
205				var set_count = jQuery(this).find('.stat_count').attr('data-count');
206				jQuery(this).find('.stat_temp').stop().animate({width: set_count}, {duration: 3000, step: function(now) {
207						var data = Math.floor(now);
208						jQuery(this).parents('.counter_wrapper').find('.stat_count').html(data);
209					}
210				});
211				jQuery(this).find('.stat_count');
212			},{offset: 'bottom-in-view', triggerOnce: true});
213		} else {
214			jQuery('.shortcode_counter').each(function(){
215				var set_count = jQuery(this).find('.stat_count').attr('data-count');
216				jQuery(this).find('.stat_temp').animate({width: set_count}, {duration: 3000, step: function(now) {
217						var data = Math.floor(now);
218						jQuery(this).parents('.counter_wrapper').find('.stat_count').html(data);
219					}
220				});
221				jQuery(this).find('.stat_count');
222			});
223		}
224	}
225	
226	// Tabs
227	if (jQuery('.module_tabs').size() > 0) {
228		jQuery('.shortcode_tabs').each(function(index) {
229			/* GET ALL HEADERS */
230			var i = 1;
231			jQuery(this).find('.shortcode_tab_item_title').each(function(index) {
232				jQuery(this).addClass('it'+i); jQuery(this).attr('whatopen', 'body'+i);
233				jQuery(this).addClass('head'+i);
234				jQuery(this).parents('.shortcode_tabs').find('.all_heads_cont').append(this);
235				i++;
236			});
237	
238			/* GET ALL BODY */
239			var i = 1;
240			jQuery(this).find('.shortcode_tab_item_body').each(function(index) {
241				jQuery(this).addClass('body'+i);
242				jQuery(this).addClass('it'+i);
243				jQuery(this).parents('.shortcode_tabs').find('.all_body_cont').append(this);
244				i++;
245			});
246	
247			/* OPEN ON START */
248			jQuery(this).find('.expand_yes').addClass('active');
249			var whatopenOnStart = jQuery(this).find('.expand_yes').attr('whatopen');
250			jQuery(this).find('.'+whatopenOnStart).addClass('active').fadeIn();
251		});
252	
253		jQuery(document).on('click', '.shortcode_tab_item_title', function(){
254			jQuery(this).parents('.shortcode_tabs').find('.shortcode_tab_item_body').removeClass('active').hide();
255			jQuery(this).parents('.shortcode_tabs').find('.shortcode_tab_item_title').removeClass('active');
256			var whatopen = jQuery(this).attr('whatopen');
257			jQuery(this).parents('.shortcode_tabs').find('.'+whatopen).addClass('active').fadeIn();
258			jQuery(this).addClass('active');
259		});
260	}
261	
262	// Message Box
263	if (jQuery('.module_messageboxes').size() > 0) {
264		jQuery('.module_messageboxes .box_close').on("click", function(){
265			jQuery(this).parents('.module_messageboxes').fadeOut();
266		});
267	}
268	
269	// Skills
270	if (jQuery('.skills_list').size() > 0) {
271		jQuery('.skills_list').waypoint(function(){
272			jQuery(this).find('.skill_li').each(function(){
273				var this_chart_width = parseInt(jQuery(this).find('.chart').width(), 10);
274				var this_data_percent = parseInt(jQuery(this).find('.chart').attr('data-percent'), 10) * this_chart_width / 100;
275				jQuery(this).find('.chart').find('.innerline').css('width', this_data_percent+'px');
276			});
277		},{offset: 'bottom-in-view'});
278	}
279	
280	// Contact form
281	if (jQuery('.contact_form').size() > 0) {
282		jQuery("#ajax-contact-form").on("submit", function() {
283			var str = $(this).serialize();		
284			$.ajax({
285				type: "POST",
286				url: "contact_form/contact_process.php",
287				data: str,
288				success: function(msg) {
289					// Message Sent - Show the 'Thank You' message and hide the form
290					if(msg == 'OK') {
291						var result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
292						jQuery("#fields").hide();
293					} else {
294						var result = msg;
295					}
296					jQuery('#note').html(result);
297				}
298			});
299			return false;
300		});
301	}
302	
303	jQuery('.fw_block').wrapInner('<div class="fw_wrapinner"></div>');
304	fw_block();
305	
306	google_map_mobile();
307	
308	// Magnific Popup
309	if (jQuery('.photozoom').size() > 0) {
310		if (jQuery('.photozoom').parents('.photo_gallery').hasClass('photo_gallery')) {
311			jQuery('.photo_gallery').each(function() {
312				jQuery(this).magnificPopup({
313					delegate: 'a',
314					type: 'image',
315					gallery: {
316						enabled: true
317					},
318					iframe: {
319						markup: '<div class="mfp-iframe-scaler">'+'<div class="mfp-close"></div>'+'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+'<div class="mfp-counter"></div>'+'</div>'
320					}
321				});
322			});
323		} else {
324			jQuery('.photozoom').magnificPopup({type:'image'});
325		}
326	}
327	
328	wrapper_height();
329	
330});
331
332jQuery(window).load(function () {
333    var bodytimer = setTimeout(function(){
334		jQuery('body').css('opacity', '1');
335		clearTimeout(bodytimer);
336	}, 500);
337	wrapper_height();
338});
339
340jQuery(window).resize(function () {
341	"use strict";
342    jQuery('.menu_scroll').jScrollPane({
343        autoReinitialise: true
344    });	
345	fw_block();	
346	google_map_mobile();
347	
348	if (jQuery('.skills_list').size() > 0) {
349		jQuery('.skill_li').each(function(){
350			var this_chart_width = parseInt(jQuery(this).find('.chart').width(), 10);
351			var this_data_percent = parseInt(jQuery(this).find('.chart').attr('data-percent'), 10) * this_chart_width / 100;
352			jQuery(this).find('.chart').find('.innerline').css('width', this_data_percent+'px');
353		});
354	}
355	
356	wrapper_height();
357});

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.