PageSourceSearch

https://www.clearancejobsblog.com/wp-content/themes/cjwordpress-blogtheme/js/main.js?ver=1.6.3

js clearancejobsblog.com collected 2026-10-03 20:34:40 UTC 15,378 bytes, 511 lines download raw bytes

1/* -----------------------------------------------------------------------------
2 * Document ready
3 * -------------------------------------------------------------------------- */
4// Set jQuery to NoConflict Mode
5jQuery.noConflict();
6
7;(function( $, window, document, undefined ){
8	"use strict";
9
10	$.fn.vwPaginationAjax = function() {
11		function progressiveAnimate(items, reverse) {
12			var i = 0;
13
14			if (reverse) {
15				items = $(items.get().reverse());
16			}
17
18			items.each(function(){
19				var $this = $(this);
20
21				if (reverse) {
22					$this.stop().delay( i + '').fadeTo(150, 0);
23				} else {
24					$this.stop().delay( i + '').fadeTo(150, 1);
25				}
26
27				i = i + 100;
28			});
29		}
30
31		function bind_click_event( $placeholder ) {
32			var $link = $placeholder.find( '.vw-page-navigation-pagination a' );
33			$link.click( _on_click );
34
35			// Auto loading for infinite scrolling
36			$placeholder.find( '.vw-pagination-load-more.vw-pagination-infinite-auto' ).waypoint({
37				handler: function( direction ) {
38					$link.click();
39				},
40				offset: '90%',
41			});
42		}
43
44		var _on_click = function( e ) {
45			e.preventDefault(); // prevent default linking
46			var $this = $( this );
47			var link = $this.attr( 'href' );
48			var $container = $this.closest( '.vwspc-section, .vw-post-shortcode, .vw-page-content' );
49			var container_id = $container.attr( 'id' );
50			var is_infinite_scrolling = $this.hasClass( 'vw-pagination-infinite' );
51
52			if( ! container_id ) {
53				console.log( 'AJAX Pagination Error: No container' );
54			}
55
56			if ( $container.hasClass( 'vwspc-section' ) ) {
57				var placeholder = '#'+container_id+' .vwspc-section-content';
58				var $post_container = $container.find( '.vwspc-section-content .vw-post-loop' );
59				var $controls = $container.find( '.vwspc-section-content .vw-post-loop > *, .vwspc-section-content .vw-page-navigation' );
60
61			} else { // hasClass( 'vw-post-shortcode' )
62				var placeholder = '#'+container_id;
63				var $post_container = $container.find( '.vw-post-loop' );
64				var $controls = $container.find( '.vw-post-loop > *, .vw-page-navigation' );
65
66			}
67
68			var $placeholder = $( placeholder );
69
70			if ( is_infinite_scrolling ) { // For infinite scrolling
71				$placeholder.find( '.vw-page-navigation' ).append( '<div class="vw-infinite-loading-icon vw-loading-icon vw-preloader-bg"></div>' );
72				$placeholder.find( '.vw-pagination-load-more' ).css( 'opacity', 0 );
73
74				$( '<div>' ).load( link + ' ' + placeholder, function( response, status, xhr ) {
75					if( status == 'success' ) {
76						var new_items = $( this ).find( '.vw-post-loop-inner > *' );
77
78						// Insert items
79						$placeholder.find( '.vw-post-loop-inner' ).append( new_items );
80						$placeholder.find( '.vw-isotope' ).isotope( 'appended', new_items );
81						$( '.vw-isotope' ).vwIsotope();
82
83						// Update pagination
84						var $new_pagination = $( this ).find( '.vw-page-navigation' );
85
86						$placeholder.find( '.vw-page-navigation' ).remove();
87
88						$placeholder.append( $new_pagination );
89						bind_click_event( $placeholder );
90					}
91
92					if( status == 'error' ) {
93						console.log( 'AJAX Pagination Error: '+xhr.status+': '+xhr.statusText );
94					}
95				} )
96				
97
98			} else { // For numeric pagination
99				var $viewport = $('html, body');
100				$viewport
101					.animate( { scrollTop: $container.offset().top - 60 }, 1700, "easeOutQuint")
102					.bind("scroll mousedown DOMMouseScroll mousewheel keyup", function (e) {
103						if (e.which > 0 || e.type === "mousedown" || e.type === "mousewheel") {
104							$viewport.stop().unbind('scroll mousedown DOMMouseScroll mousewheel keyup');
105						}
106					});
107
108				$controls.fadeTo( 500, 0, function() {
109					$( this ).css('visibility', 'hidden');
110				} );
111				$post_container.addClass( 'vw-preloader-bg' );
112				$placeholder.load( link + ' ' + placeholder + '>*', function( response, status, xhr ) {
113					if( status == 'success' ) {
114						$( '.vw-isotope' ).vwIsotope();
115						$container.removeClass( 'vw-preloader-bg' );
116						bind_click_event( $placeholder );
117					}
118
119					if( status == 'error' ) {
120						console.log( 'Error: '+xhr.status+': '+xhr.statusText );
121					}
122				} );
123				
124			}
125		}
126
127		bind_click_event( $( this ) );
128	}
129
130	$.fn.vwIsotope = function() {
131		if ( $.fn.isotope ) {
132			var $isotope_list = $( this );
133			$isotope_list.imagesLoaded( function () {
134				$isotope_list.isotope();
135
136				$( window ).resize( function() {
137					$isotope_list.isotope( 'layout' );
138				} );
139			});
140		}
141	};
142
143	$.fn.vwSticky = function() {
144		if ( $.fn.sticky ) {
145			var $sticky_bar = $( this );
146			var $sticky_wrapper = false;
147			var offset = 0;
148
149			if ( $( '#wpadminbar' ).length ) {
150				offset = $( '#wpadminbar' ).height();
151			}
152			
153			$sticky_bar.addClass( 'vw-sticky' ).removeClass( 'is-not-sticky' ).sticky( {
154				wrapperClassName: 'vw-sticky-wrapper is-not-sticky',
155				topSpacing: offset,
156
157			} ).on( 'sticky-start', function() {
158				$( this ).parents( '.vw-sticky-wrapper' ).removeClass( 'is-not-sticky' );
159
160			} ).on( 'sticky-end', function() {
161				$( this ).parents( '.vw-sticky-wrapper' ).addClass( 'is-not-sticky' );
162
163			} );
164
165			$( window ).resize( function() {
166				if ( ! $sticky_wrapper ) $sticky_wrapper = $( '.vw-sticky-wrapper' );
167				$sticky_wrapper.css('height', $sticky_bar.outerHeight());
168				$sticky_bar.sticky( 'update' );
169			} );
170		}
171	}
172
173	$.fn.vwBxSlider = function( options ) {
174		var default_options = {
175			mode: 'horizontal',
176			speed: parseInt( vw_main_js.bxslider_transition_speed ),
177			adaptiveHeight: true,
178			auto: parseInt( vw_main_js.bxslider_auto_start ),
179			autoControls: false,
180			autoHover: parseInt( vw_main_js.bxslider_pause_on_hover ),
181			captions: false,
182			controls: true,
183			infiniteLoop: true,
184			minSlides: 1,
185			moveSlides: 0,
186			pager: false,
187			pause: parseInt( vw_main_js.bxslider_slide_duration ),
188			preloadImages: "visible",
189			nextText: '<i class="icon-iconic-right"></i>',
190			prevText: '<i class="icon-iconic-left"></i>',
191			slideMargin: 0,
192			touchEnabled: true,
193			preventDefaultSwipeX: true,
194			preventDefaultSwipeY: false,
195			oneToOneTouch: true,
196			responsive: true,
197			useCSS: false,
198		}
199
200		this.each( function () {
201			var $this = $( this );
202			
203			$this.find( '.vw-bxslider-slides' ).bxSlider( $.extend( {
204				onSliderLoad: function() {
205					$this.animate( {
206						'opacity': 1,
207						'height': $this.find( '.vw-bxslider-slides > li:first-child' ).height(),
208					}, 500, function() {
209						$this.removeClass( 'vw-bxslider-loading' );
210						$this.css( {
211							'opacity': '',
212							'height': '',
213						} );
214					} );
215					
216				}
217			}, default_options, options ) );
218
219		} );
220	}
221
222	// Initial all scripts
223	$( window ).load( function () {
224		if ( $.fn.bxSlider ) {
225			// Lazy load to avoid invalid size issue
226			$('.vw-post-loop-slider-carousel').each( function () {
227				var $this = $( this );
228				if ( $this.parents( '.widget_vw_widget_posts' ).length ) {
229					$this.vwBxSlider( {
230						slideWidth: 360,
231						minSlides: 1,
232						maxSlides: 1,
233						moveSlides: 1,
234						slideMargin: 10,
235					} );
236				}  else {
237					$this.vwBxSlider( {
238						slideWidth: 360,
239						minSlides: 1,
240						maxSlides: 4,
241						moveSlides: 1,
242						slideMargin: 10,
243					} );
244				}
245			} );
246		}
247	});
248
249	$( document ).ready( function () {
250		var loc = window.location.href; // returns the full URL
251		  if(/about/.test(loc)) {
252		    $('.vw-menu').addClass('about');
253		  } else {
254		  	$('.vw-menu').addClass('notabout');
255		  }
256		// Slider
257		if ( $.fn.bxSlider ) {
258			$('.vw-post-loop-slider-large, .vw-post-loop-slider-large-single, .vw-embeded-gallery.vw-bxslider').vwBxSlider( {
259				slideWidth: 0,
260				mode: 'fade',
261				minSlides: 1,
262				maxSlides: 1,
263				moveSlides: 1,
264			} );
265		}
266
267		// ImgLiquid
268		if ( $.fn.imgLiquid ) {
269			$( '.vw-post-loop-slider-large .vw-post-style-slide, .vw-post-loop-slider-large-single .vw-post-style-slide' ).imgLiquid();
270		}
271
272		// Breaking News
273		if ( $.fn.newsTicker ) {
274			$('.vw-breaking-news-list').newsTicker( {
275				row_height: 29,
276				max_rows: 1,
277				speed: 600,
278				direction: 'up',
279				duration: 4000,
280				autostart: 1,
281				pauseOnHover: 1
282			} ).addClass( 'loaded' );
283		}
284
285		if ( $.fn.mmenu ) {
286			$(".vw-menu-mobile-wrapper").mmenu({
287				classes: "mm-slide",
288				offCanvas: {
289					position: "right",
290				},
291			}, {
292				offCanvas: {
293					pageSelector: ".vw-site-wrapper"
294				}
295			});
296
297			$(".vw-mobile-nav-button").click(function() {
298				$(".vw-menu-mobile-wrapper").trigger("open.mm");
299			});
300		}
301
302		if ( $.fn.backstretch ) {
303			$( '.vwspc-section-full-page-link' ).each( function () {
304				var $this = $( this );
305				var background_url = $this.find( 'img.vw-full-page-link-background' ).attr( 'src' );
306
307				if ( background_url ) {
308					$this.backstretch( background_url, {
309						fade: vw_main_js.VW_CONST_BACKSTRETCH_OPT_FADE,
310						centeredY: vw_main_js.VW_CONST_BACKSTRETCH_OPT_CENTEREDY,
311						centeredX: vw_main_js.VW_CONST_BACKSTRETCH_OPT_CENTEREDX,
312						duration: vw_main_js.VW_CONST_BACKSTRETCH_OPT_DURATION,
313					} );
314				}
315			} );
316		}
317
318		// Sticky Bar
319		$( '.vw-menu-main-wrapper' ).vwSticky();
320
321		// FitVids
322		if ( $.fn.fitVids ) {
323			$( '.vw-embeded-media, .vw-featured-image-wrapper, .flxmap-container, .comment-body, .vw-post-content, #footer, .bbp-reply-content' ).fitVids( { customSelector: "iframe[src*='maps.google.'],iframe[src*='soundcloud.com']" } );
324		}
325
326		// -----------------------------------------------------------------------------
327		// Isotope - Mansonry grid
328		// 
329		$( '.vw-isotope' ).vwIsotope();
330
331		// MagnificPopup
332		if ( $.fn.magnificPopup ) {
333			$( '.vw-post-meta-icon.vw-post-share-count' ).magnificPopup({
334				type: 'inline',
335
336				fixedContentPos: false,
337				fixedBgPos: true,
338
339				overflowY: 'auto',
340
341				closeBtnInside: true,
342				preloader: false,
343				
344				midClick: true,
345				removalDelay: 300,
346				mainClass: 'my-mfp-zoom-in'
347			}).click( function( e ) {
348				e.preventDefault();
349			} );
350
351
352			// Add light box to featured image
353			$( "body.page .vw-page-content a[href*='.png'], body.page .vw-page-content a[href*='.jpg'], body.page .vw-page-content a[href*='.jpeg'], body.single .vw-page-content a[href*='.png'], body.single .vw-page-content a[href*='.jpg'], body.single .vw-page-content a[href*='.jpeg'], .vw-custom-tiled-gallery a, .vw-embeded-gallery.vw-bxslider .vw-bxslider-slides a" ).magnificPopup({
354				type: 'image',
355				closeOnContentClick: true,
356				gallery: {
357					enabled: true,
358					navigateByImgClick: true,
359					preload: [0,1] // Will preload 0 - before current, and 1 after the current image
360				},
361				image: {
362					verticalFit: true,
363					titleSrc: function( item ) {
364						var title = item.el.attr('title');
365						if ( ! title ) {
366							title = $( 'img', item.el ).attr('alt');
367						}
368
369						return title;
370					}
371				}
372			});
373		}
374
375		if ( $.fn.superfish ) {
376			$('.vw-menu-location-top').superfish({
377				delay:       800,                            // one second delay on mouseout
378				animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation
379				speed:       'fast',                          // faster animation speed
380				autoArrows:  false                            // disable generation of arrow mark-up
381			});
382
383			$('.vw-menu-location-main').superfish({
384				popUpSelector: '.sub-menu-wrapper',
385				delay:       800,                            // one second delay on mouseout
386				animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation
387				speed:       'fast',                          // faster animation speed
388				autoArrows:  false                            // disable generation of arrow mark-up
389			});
390		}
391
392		//  Instant search
393		if ( $.fn.instant_search ) {
394			$( '.vw-instant-search-buton' ).instant_search();
395		}
396
397		// Ajax pagination
398		if ( $.fn.vwPaginationAjax ) {
399			$( '.vwspc-section, body.archive #vw-page-content, .vw-page-content' ).vwPaginationAjax();
400		}
401
402		// Widget Tabs
403		if ( $.fn.tabs ) {
404			$( ".vw-post-tabed" ).tabs( {
405				show: { effect: "fade", duration: 300 }
406			} );
407		}
408
409		// Wordpress gallery grid
410		$( '.vw-custom-tiled-gallery' ).each( function ( i, el ) {
411			var $gallery =  $( el );
412			var layout = $gallery.attr( 'data-gallery-layout' );
413			if ( ! ( parseInt( layout, 10 ) > 0 ) ) {
414				layout = '213'; // Default layout
415			}
416
417			layout = layout.split('');
418			var columnLayout = [];
419			for (var i in layout ) {
420				var columnCount = parseInt( layout[i], 10 );
421				var columnWidth = 100.0 / columnCount;
422				for ( var j = 1; j <= columnCount; j++ ) {
423					columnLayout.push( columnWidth );
424				}
425			}
426
427			$gallery.find( '> figure' ).each( function( i, el ) {
428				var $el = $( el );
429				var layoutIndex = i % columnLayout.length;
430				$el.css( 'width', columnLayout[ layoutIndex ] - 1 + '%' );
431			} );
432		} );
433
434		// Full page link section
435		$( '.vwspc-section-full-page-link' ).click( function() {
436			window.location = $( this ).find( 'a' ).eq(0).attr( 'href' );
437		} );
438
439		// -----------------------------------------------------------------------------
440		// Tipsy
441		// 
442		if ( $.fn.tipsy ) {
443			$('.widget_vw_widget_author_list a, .vw-author-socials a, .vw-category-link, .vw-author-avatar, .author-name, .vw-post-date, .vw-post-shares-social, .bbp-author-avatar, .vw-post-comment-count, .vw-post-likes-count, .vw-post-view-count, .vw-post-share-count').tipsy( {
444				fade: true,
445				gravity: 's',
446			} );
447		}
448
449		// -----------------------------------------------------------------------------
450		// Sticky Sidebar
451		// 
452		if ( $.fn.hcSticky ) {
453			var offset = 15;
454
455			if ( $( '#wpadminbar' ) ) {
456				offset += $( '#wpadminbar' ).height();
457			}
458
459			if ( $( 'body.vw-site-enable-sticky-menu' ) ) {
460				offset += $( '#vw-menu-main-sticky-wrapper' ).height();
461			}
462
463			$(".vwspc-section-sidebar .vw-sticky-sidebar, .vw-page-wrapper .vw-sticky-sidebar").hcSticky( {
464				stickTo: '.container',
465				wrapperClassName: 'vw-sticky-sidebar-wrapper',
466				offResolutions: [-992],
467				top: offset,
468			} );
469		}
470
471		/**
472		 * Background Ads
473		 */
474		if ( parseInt( vw_main_js.bg_ads_enable ) ) {
475			var ads_element = 'body';
476			var ads_left_url = vw_main_js.bg_ads_left_url || vw_main_js.bg_ads_right_url;
477			var ads_right_url = vw_main_js.bg_ads_right_url || vw_main_js.bg_ads_left_url;
478
479			$( ads_element ).click(function(event){
480
481				var target = $( event.target );
482
483				// If use hover users the clickable zones
484				if ( target.is( ads_element ) ) {
485
486					// Add links to left an right side
487					var width = $( document ).width();
488
489					if ( event.pageX <= ( width / 2 ) ) { // Left side
490						var win = window.open( ads_left_url, '_blank' );
491					} else { // Right side
492						var win = window.open( ads_right_url, '_blank' );
493					}
494					
495					win.focus();
496				}
497			} );
498
499			$( document ).mousemove( function( event ) {
500				var target = $( event.target );
501				if ( target.is( ads_element ) ) {
502					target.css( 'cursor', 'pointer' );
503				} else {
504					target.css( 'cursor','auto' );
505				}
506			} );
507		}
508
509	} );
510
511})( jQuery, window , document );

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.