PageSourceSearch

https://www.independentsciencenews.org/wp-content/themes/massive-news/assets/js/theme.js?ver=1.0.0

js independentsciencenews.org collected 2026-10-01 11:30:02 UTC 2,636 bytes, 154 lines download raw bytes

1/**
2 *  Custom JS Scripts
3 *
4 * @package Massive News
5 * @since 4.0
6 */
7
8( function( $ ) {
9
10	/**
11	 * Isotope
12	 */
13	function portfolioFilter() {
14		var container = document.querySelector('.row.isotope');
15		var iso;
16		imagesLoaded( container, function() {
17			iso = new Isotope( container );
18		});
19
20		var filterBtn = document.querySelectorAll('.filter-list a');
21		[].forEach.call(filterBtn, function(el) {
22			el.addEventListener('click', function() {
23				var filterValue = (this).getAttribute('data-filter');
24				iso.arrange({
25					filter: filterValue
26				});
27			});
28		});
29
30	}
31
32	/**
33	 * Owl Carousel
34	 */
35	function owlCarousel() {
36		var autoPlay = (typeof slideSpeed !== 'undefined') ? slideSpeed : false;
37		var owl = $("#owl-slider");
38		owl.owlCarousel({
39			navigation : true,
40			singleItem : true,
41			slideSpeed : 600,
42			autoHeight : true,
43			autoPlay : autoPlay
44		});
45	}
46
47	/**
48	 *  Share Selection
49	 */
50	function shareSelection() {
51		$('p').selectionSharer();
52	}
53
54	/**
55	 *  Headroom
56	 */
57	function headRoom() {
58		// grab an element
59		var myElement = document.querySelector(".header-top");
60		// construct an instance of Headroom, passing the element
61		var headroom  = new Headroom(myElement, {
62			"offset": 150
63		});
64		// initialise
65		headroom.init();
66	}
67
68	/**
69	 *  Menu Toggle
70	 */
71
72	function menuToggle() {
73
74		var menuIcon = document.querySelector('.icon-menu');
75		var mainNav = document.querySelector('.main-navigation');
76
77		menuIcon.addEventListener('click', function() {
78
79			mainNav.classList.toggle('main-nav-active');
80
81		});
82
83	}
84
85	/**
86	 * Search Toggle
87	 */
88	function searchToggle() {
89
90		$('.header-search').hide();
91		$('.js-search-icon').click(function () {
92			$('.header-search').show();
93			$('body').addClass('modal-open');
94			$('.header-search #searchform input#s').focus();
95		});
96
97		$('.search-close').click(function () {
98			$('.header-search').hide();
99			$('body').removeClass('modal-open');
100		});
101
102		$(document).keyup(function (e) {
103			if (e.keyCode === 27) {
104				$('.header-search').hide();
105				$('body').removeClass('modal-open');
106			}
107		});
108
109	}
110
111	$( window ).ready(function() {
112
113		owlCarousel();
114		shareSelection();
115		headRoom();
116		menuToggle();
117		searchToggle();
118
119		if( $('body').hasClass('page-template-templatestemplate-portfolio-php') ) {
120			portfolioFilter();
121		}
122
123	});
124
125})( jQuery );
126
127/**
128 *  Fluid Vids
129 */
130var fluidVids = (function () {
131
132	var pub = {}; // public facing functions
133
134	pub.init = function() {
135
136		fluidvids.init({
137			selector: ['iframe'],
138			players: ['www.youtube.com', 'player.vimeo.com']
139		});
140
141	};
142
143	return pub;
144
145}());
146
147 /**
148 *  Initialize Functions
149 */
150( function() {
151
152	fluidVids.init();
153
154})();

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.