PageSourceSearch

https://www.yoswit.com/catalog/view/assets/js/app.js

js yoswit.com collected 2026-10-02 00:35:28 UTC 9,485 bytes, 323 lines download raw bytes

1/*
2* Template Name: Unify - Responsive Bootstrap Template
3* Author: @htmlstream
4* Website: http://htmlstream.com
5*/
6
7var App = function () {
8	// We extend jQuery by method hasAttr
9	jQuery.fn.hasAttr = function(name) {
10	  return this.attr(name) !== undefined;
11	};
12
13	// Fixed Header
14	function handleHeader() {
15		if (jQuery(window).scrollTop() > 100) {
16			jQuery('.header-fixed .header-sticky').addClass('header-fixed-shrink');
17		}
18		jQuery(window).scroll(function() {
19		  if (jQuery(window).scrollTop() > 100) {
20			jQuery('.header-fixed .header-sticky').addClass('header-fixed-shrink');
21		  } else {
22			jQuery('.header-fixed .header-sticky').removeClass('header-fixed-shrink');
23		  }
24		});
25	}
26
27	// Header Mega Menu
28	function handleMegaMenu() {
29		jQuery(document).on('click', '.mega-menu .dropdown-menu', function(e) {
30			e.stopPropagation();
31		})
32	}
33
34	// Search Box (Header)
35	function handleSearch() {
36		jQuery('.search').on("click", function () {
37			if(jQuery('.search-btn').hasClass('fa-search')){
38				jQuery('.search-open').fadeIn(500);
39				jQuery('.search-btn').removeClass('fa-search');
40				jQuery('.search-btn').addClass('fa-times');
41			} else {
42				jQuery('.search-open').fadeOut(500);
43				jQuery('.search-btn').addClass('fa-search');
44				jQuery('.search-btn').removeClass('fa-times');
45			}
46		});
47	}
48
49	// Search Box v1 (Header v5)
50	function handleSearchV1() {
51		jQuery('.header-v5 .search-button').click(function () {
52			jQuery('.header-v5 .search-open').slideDown();
53		});
54
55		jQuery('.header-v5 .search-close').click(function () {
56			jQuery('.header-v5 .search-open').slideUp();
57		});
58
59		jQuery(window).scroll(function(){
60		  if(jQuery(this).scrollTop() > 1) jQuery('.header-v5 .search-open').fadeOut('fast');
61		});
62	}
63
64	// Search Box v2 (Header v8)
65	function handleSearchV2() {
66		jQuery(".blog-topbar .search-btn").on("click", function() {
67		  if (jQuery(".topbar-search-block").hasClass("topbar-search-visible")) {
68			jQuery(".topbar-search-block").slideUp();
69			jQuery(".topbar-search-block").removeClass("topbar-search-visible");
70		  } else {
71			jQuery(".topbar-search-block").slideDown();
72			jQuery(".topbar-search-block").addClass("topbar-search-visible");
73		  }
74		});
75		jQuery(".blog-topbar .search-close").on("click", function() {
76		  jQuery(".topbar-search-block").slideUp();
77		  jQuery(".topbar-search-block").removeClass("topbar-search-visible");
78		});
79		jQuery(window).scroll(function() {
80			var isiPhone = /iphone/i.test(navigator.userAgent.toLowerCase());
81			if (!isiPhone) {
82			  jQuery(".topbar-search-block").slideUp();
83			  jQuery(".topbar-search-block").removeClass("topbar-search-visible");
84			}
85		});
86	}
87
88	// TopBar (Header v8)
89	function handleTopBar() {
90		jQuery(".topbar-toggler").on("click", function() {
91		  if (jQuery(".topbar-toggler").hasClass("topbar-list-visible")) {
92			jQuery(".topbar-menu").slideUp();
93			jQuery(this).removeClass("topbar-list-visible");
94		  } else {
95			jQuery(".topbar-menu").slideDown();
96			jQuery(this).addClass("topbar-list-visible");
97		  }
98		});
99	}
100
101	// TopBar SubMenu (Header v8)
102	function handleTopBarSubMenu() {
103		jQuery(".topbar-list > li").on("click", function(e) {
104		  if (jQuery(this).children("ul").hasClass("topbar-dropdown")) {
105			if (jQuery(this).children("ul").hasClass("topbar-dropdown-visible")) {
106			  jQuery(this).children(".topbar-dropdown").slideUp();
107			  jQuery(this).children(".topbar-dropdown").removeClass("topbar-dropdown-visible");
108			} else {
109			  jQuery(this).children(".topbar-dropdown").slideDown();
110			  jQuery(this).children(".topbar-dropdown").addClass("topbar-dropdown-visible");
111			}
112		  }
113		  //e.preventDefault();
114		});
115	}
116
117	// Sidebar Navigation Toggle
118	function handleToggle() {
119		jQuery('.list-toggle').on('click', function() {
120			jQuery(this).toggleClass('active');
121		});
122	}
123
124	// Equal Height Columns
125	function handleEqualHeightColumns() {
126		var EqualHeightColumns = function () {
127			jQuery(".equal-height-columns").each(function() {
128				heights = [];
129				jQuery(".equal-height-column", this).each(function() {
130					jQuery(this).removeAttr("style");
131					heights.push(jQuery(this).height()); // write column's heights to the array
132				});
133				jQuery(".equal-height-column", this).height(Math.max.apply(Math, heights)); //find and set max
134			});
135		}
136
137		EqualHeightColumns();
138		jQuery(window).resize(function() {
139			EqualHeightColumns();
140		});
141		jQuery(window).load(function() {
142			EqualHeightColumns();
143		});
144	}
145	
146	// Equal Height Image-Columns
147	function handleEqualHeightColumns__Images() {
148		var EqualHeightColumns__Images = function () {
149			jQuery('.equal-height-columns-v2').each(function() {
150				var heights = [];
151				jQuery('.equal-height-column-v2', this).each(function() {
152					jQuery(this).removeAttr('style');
153					heights.push(jQuery(this).height()); // Write column's heights to the array
154				});
155				jQuery('.equal-height-column-v2', this).height(Math.max.apply(Math, heights)); // Find and set max
156
157				jQuery('.equal-height-column-v2', this).each(function() {
158					if (jQuery(this).hasAttr('data-image-src')) {
159						jQuery(this).css('background', 'url('+jQuery(this).attr('data-image-src')+') no-repeat scroll 50% 0 / cover');
160					}
161				});
162			});
163		}
164    jQuery('.equal-height-columns-v2').ready(function() {
165      EqualHeightColumns__Images();
166    });
167		jQuery(window).resize(function() {
168			EqualHeightColumns__Images();
169		});
170	}
171
172	// Full Screen
173	var handleFullscreen = function() {
174		var WindowHeight = jQuery(window).height();
175		var HeaderHeight = 0;
176
177		if (jQuery(document.body).hasClass("promo-padding-top")) {
178		  HeaderHeight = jQuery(".header").height();
179		} else {
180		  HeaderHeight = 0;
181		}
182
183		jQuery(".fullheight").css("height", WindowHeight - HeaderHeight);
184
185		jQuery(window).resize(function() {
186		  var WindowHeight = jQuery(window).height();
187		  jQuery(".fullheight").css("height", WindowHeight - HeaderHeight);
188		});
189	}
190
191	// Align Middle
192	var handleValignMiddle = function() {
193		jQuery(".valign__middle").each(function() {
194		  jQuery(this).css("padding-top", jQuery(this).parent().height() / 2 - jQuery(this).height() / 2);
195		});
196		jQuery(window).resize(function() {
197		  jQuery(".valign__middle").each(function() {
198			jQuery(this).css("padding-top", jQuery(this).parent().height() / 2 - jQuery(this).height() / 2);
199		  });
200		});
201	}
202
203	// Hover Selector
204	function handleHoverSelector() {
205	    jQuery('.hoverSelector').on('click', function(e) {
206	      if (jQuery(this).children('ul').hasClass('languages')) {
207	        if (jQuery(this).children('ul').hasClass('languages-visible')) {
208	          jQuery(this).children('.languages').slideUp();
209	          jQuery(this).children('.languages').removeClass('languages-visible');
210	        } else {
211	          jQuery(this).children('.languages').slideDown();
212	          jQuery(this).children('.languages').addClass('languages-visible');
213	        }
214	      }
215	    });
216	}
217
218	
219	// Bootstrap Tooltips and Popovers
220	function handleBootstrap() {
221		/* Bootstrap Carousel */
222		jQuery('.carousel').carousel({
223			interval: 15000,
224			pause: 'hover'
225		});
226
227		/* Tooltips */
228		jQuery('.tooltips').tooltip();
229		jQuery('.tooltips-show').tooltip('show');
230		jQuery('.tooltips-hide').tooltip('hide');
231		jQuery('.tooltips-toggle').tooltip('toggle');
232		jQuery('.tooltips-destroy').tooltip('destroy');
233
234		/* Popovers */
235		jQuery('.popovers').popover();
236		jQuery('.popovers-show').popover('show');
237		jQuery('.popovers-hide').popover('hide');
238		jQuery('.popovers-toggle').popover('toggle');
239		jQuery('.popovers-destroy').popover('destroy');
240	}
241
242	return {
243		init: function () {
244			handleBootstrap();
245			handleSearch();
246			handleSearchV1();
247			handleSearchV2();
248			handleTopBar();
249			handleTopBarSubMenu();
250			handleToggle();
251			handleHeader();
252			handleMegaMenu();
253			handleHoverSelector();
254			handleFullscreen();
255			handleValignMiddle();
256			handleEqualHeightColumns();
257			handleEqualHeightColumns__Images();
258		},
259
260		// Counters
261		initCounter: function () {
262			jQuery('.counter').counterUp({
263				delay: 10,
264				time: 1000
265			});
266		},
267
268		// Parallax Backgrounds
269		initParallaxBg: function () {
270			jQuery(window).load(function() {
271				jQuery('.parallaxBg').parallax("50%", 0.2);
272				jQuery('.parallaxBg1').parallax("50%", 0.4);
273			});
274		},
275
276		// Scroll Bar
277		initScrollBar: function () {
278			jQuery('.mCustomScrollbar').mCustomScrollbar({
279				theme:"minimal",
280				scrollInertia: 200,
281				scrollEasing: "linear"
282			});
283		},
284
285		// Sidebar Menu Dropdown
286		initSidebarMenuDropdown: function() {
287		  function SidebarMenuDropdown() {
288			jQuery('.header-v7 .dropdown-toggle').on('click', function() {
289			  jQuery('.header-v7 .dropdown-menu').stop(true, false).slideUp();
290			  jQuery('.header-v7 .dropdown').removeClass('open');
291
292			  if (jQuery(this).siblings('.dropdown-menu').is(":hidden") == true) {
293				jQuery(this).siblings('.dropdown-menu').stop(true, false).slideDown();
294				jQuery(this).parents('.dropdown').addClass('open');
295			  }
296			});
297		  }
298		  SidebarMenuDropdown();
299		},
300
301		// Animate Dropdown
302		initAnimateDropdown: function() {
303		  function MenuMode() {
304			jQuery('.dropdown').on('show.bs.dropdown', function() {
305			  jQuery(this).find('.dropdown-menu').first().stop(true, true).slideDown();
306			});
307			jQuery('.dropdown').on('hide.bs.dropdown', function() {
308			  jQuery(this).find('.dropdown-menu').first().stop(true, true).slideUp();
309			});
310		  }
311
312		  jQuery(window).resize(function() {
313			if (jQuery(window).width() > 768) {
314			  MenuMode();
315			}
316		  });
317
318		  if (jQuery(window).width() > 768) {
319			MenuMode();
320		  }
321		},
322	};
323}();

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.