PageSourceSearch

https://gisresources.com/wp-content/themes/novomag-theme/js/theme-scripts.js?ver=1.5.19

js gisresources.com collected 2026-09-24 19:52:32 UTC 11,387 bytes, 351 lines download raw bytes

1var breakingStart = true; // autostart breaking news
2var breakingSpeed = 40; // breaking msg speed
3
4var breakingScroll = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
5var breakingOffset = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
6var elementsToClone = [true, true, true, true, true, true, true, true, true, true];
7var elementsActive = [];
8var theCount = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
9
10
11
12(function( $ ) {
13	"use strict";
14	
15	jQuery(window).resize(function() {
16		refreshSidebar();
17	});
18
19	jQuery(window).ready(function() {
20		
21		jQuery('img').each( function(i){
22			var bottom_of_object = jQuery(this).offset().top + jQuery(this).outerHeight();
23			var bottom_of_window = jQuery(window).scrollTop() + jQuery(window).height() + 200;
24
25			if( bottom_of_window <= bottom_of_object && !jQuery(this).parent('a').hasClass('gal-thumbs')){
26				jQuery(this).css("opacity", "0");
27			}
28		});
29
30		jQuery(window).scroll( function(){
31			jQuery('img').each( function(i){
32				var bottom_of_object = jQuery(this).offset().top + jQuery(this).outerHeight();
33				var bottom_of_window = jQuery(window).scrollTop() + jQuery(window).height() + 200;
34
35				if( bottom_of_window > bottom_of_object ){
36					jQuery(this).animate( {'opacity':'1'}, 500 );
37				}
38			});
39		});
40
41		jQuery(".tab-a").each(function(){
42			jQuery(this).find("h3").eq(0).addClass("active");
43		});
44
45		jQuery(".tab-d").each(function(){
46			jQuery(this).children("div").eq(0).addClass("active");
47		});
48
49		jQuery(".tab-a h3").click(function(){
50			var thisel = jQuery(this);
51			var thisindex = thisel.index();
52			thisel.addClass("active").siblings("h3.active").removeClass("active");
53			thisel.parent().siblings(".tab-d").children("div").eq(thisindex).addClass("active").siblings("div.active").removeClass("active");
54			refreshSidebar();
55		});
56
57		jQuery(".w-photos .photo-images").each(function(){
58			jQuery(this).children("a").eq(0).addClass("active");
59		});
60
61		jQuery(".gallery-link-left").click(function(){
62			slideGalleryWidget(jQuery(this).siblings(".photo-images").children("a.active").prev());
63			return false;
64		});
65
66		jQuery(".gallery-link-right").click(function(){
67			slideGalleryWidget(jQuery(this).siblings(".photo-images").children("a.active").next());
68			return false;
69		});
70
71		jQuery(".carousel-right").click(function(){
72			var thisel = jQuery(this);
73			var maxcount = Math.ceil((thisel.siblings(".inner-carousel").children(".item").size())/3);
74			if(thisel.parent().attr("rel")){
75				if(thisel.parent().attr("rel") < maxcount-1){
76					var nuum = parseInt(thisel.parent().attr("rel"))+1;
77				}else{
78					var nuum = parseInt(thisel.parent().attr("rel"));
79				}
80			}else{
81				if(maxcount-1 >= 1){
82					var nuum = 1;
83				}else{
84					var nuum = 0;
85				}
86			}
87			thisel.parent().attr("rel", nuum);
88			thisel.siblings(".inner-carousel").animate({
89				"left" : "-"+(nuum*103.5)+"%"
90			}, 200);
91			return false;
92		});
93
94		jQuery(".carousel-left").click(function(){
95			var thisel = jQuery(this);
96			if(thisel.parent().attr("rel")){
97				if(thisel.parent().attr("rel") > 0){
98					var nuum = parseInt(thisel.parent().attr("rel"))-1;
99				}else{
100					var nuum = parseInt(thisel.parent().attr("rel"));
101				}
102			}else{
103				var nuum = 0;
104			}
105			thisel.parent().attr("rel", nuum);
106			thisel.siblings(".inner-carousel").animate({
107				"left" : "-"+(nuum*103.5)+"%"
108			}, 200);
109			return false;
110		});
111
112		jQuery(".slider .slider-navigation li > a").click(function() {
113			var thisel = jQuery(this);
114			var thisindex = thisel.parent().index();
115			thisel.parent().addClass("active").siblings("li.active").removeClass("active");
116			thisel.parent().parent().siblings(".slider-image").children("a").eq(thisindex).addClass("active").siblings("a.active").each(function() {
117				var curel = jQuery(this);
118				setTimeout(function () {
119					curel.removeClass("active");
120				}, 100);
121			});
122			return false;
123		});
124
125
126		// Alert box close
127		jQuery('a[href="#close-alert"]').click(function() {
128			jQuery(this).parent().animate({
129				opacity: 0,
130				padding: "0px 13px",
131				margin: "0px",
132				height: "0px"
133			}, 300, function() {
134				refreshSidebar();
135			});
136			return false;
137		});
138
139		// Accordion blocks
140		jQuery(".accordion > div > a").click(function() {
141			var thisel = jQuery(this).parent();
142			if(thisel.hasClass("active")){
143				thisel.removeClass("active").children("div").animate({
144					"height": "toggle",
145					"opacity": "toggle",
146					"padding-top": "toggle"
147				}, 300);
148				return false;
149			}
150			// thisel.siblings("div").removeClass("active");
151			thisel.siblings("div").each(function() {
152				var tz = jQuery(this);
153				if(tz.hasClass("active")){
154					tz.removeClass("active").children("div").animate({
155						"height": "toggle",
156						"opacity": "toggle",
157						"padding-top": "toggle"
158					}, 300, function() {
159						refreshSidebar();
160					});
161				}
162			});
163			// thisel.addClass("active");
164			thisel.addClass("active").children("div").animate({
165				"height": "toggle",
166				"opacity": "toggle",
167				"padding-top": "toggle"
168			}, 300, function() {
169				refreshSidebar();
170			});
171			return false;
172		});
173	  
174
175		// Tabbed blocks
176		jQuery(".short-tabs").each(function() {
177			var thisel = jQuery(this);
178			thisel.children("div").eq(0).addClass("active");
179			thisel.children("ul").children("li").eq(0).addClass("active");
180		});
181
182		jQuery(".short-tabs > ul > li a").click(function() {
183			var thisel = jQuery(this).parent();
184			thisel.siblings(".active").removeClass("active");
185			thisel.addClass("active");
186			thisel.parent().siblings("div.active").removeClass("active");
187			thisel.parent().siblings("div").eq(thisel.index()).addClass("active");
188			refreshSidebar();
189			return false;
190		});
191
192		jQuery(".lightbox").click(function () {
193			jQuery(".lightbox").css('overflow', 'hidden');
194			jQuery("body").css('overflow', 'auto');
195			jQuery(".lightbox .lightcontent").fadeOut('fast');
196			jQuery(".lightbox").fadeOut('slow');
197		}).children().click(function(e) {
198			return false;
199		});
200
201
202		// Responsive menu
203		jQuery(".main-menu > div").append('<a href="#" class="toggle-menu"><i class="fa fa-bars"></i> Toggle Menu</a>');
204		jQuery(".header-topmenu > div").append('<a href="#" class="toggle-menu"><i class="fa fa-bars"></i> Toggle Menu</a>');
205		
206		jQuery(".toggle-menu").click(function() {
207			var thisel = jQuery(this).siblings("ul");
208			thisel.fadeToggle();
209			return false;
210		});
211
212
213		// Refresh sidebars look
214		setTimeout(function () {
215			refreshSidebar();
216		}, 220);
217		refreshSidebar();
218
219
220        // Breaking News Scroller
221        jQuery(".breaking-news .breaking-block").each(function () {
222            var thisitem = jQuery(this);
223        	thisitem.find("ul").html(thisitem.find("ul").html()+thisitem.find("ul").html());
224            // thisitem.find("ul li").css("width", thisitem.width() + "px");
225        });
226
227        jQuery(".breaking-controls a").click(function () {
228            var thisitem = jQuery(this), itemul = thisitem.parent().parent().find(".breaking-block ul"), items = itemul.find("li"), sega = (items.size() - 1) * (items.width() + parseInt(items.css("margin-right")));
229            if (thisitem.hasClass("breaking-arrow-left")) {
230                if (0 >= Math.abs(parseInt(itemul.css("margin-left")))) {
231                    itemul.css("margin-left", (sega * (-1)) + "px");
232                } else {
233                    itemul.css("margin-left", (parseInt(itemul.css("margin-left")) + (items.width() + parseInt(items.css("margin-right")))) + "px");
234                }
235            } else {
236                if (sega <= Math.abs(parseInt(itemul.css("margin-left")))) {
237                    itemul.css("margin-left", "0px");
238                } else {
239                    itemul.css("margin-left", (parseInt(itemul.css("margin-left")) + (items.width() + parseInt(items.css("margin-right"))) * (-1)) + "px");
240                }
241            }
242            return false;
243        });
244
245        jQuery(".breaking-news").mouseenter(function () {
246            var thisindex = jQuery(this).attr("rel");
247            clearTimeout(elementsActive[thisindex]);
248        }).mouseleave(function () {
249            var thisindex = jQuery(this).attr("rel");
250            elementsActive[thisindex] = false;
251        });
252
253        start();
254
255		if(_otSliderAuto){
256			themesAutoLoad();
257		}
258
259		jQuery(".slider a.ot-slider-right").click(function() {
260			var thenextpage = (jQuery(".slider > .slider-navigation > li.active").next().index() == "-1")?0:jQuery(".slider > .slider-navigation > li.active").next().index();
261			themesLoadPage(thenextpage);
262			themesCancelLoad();
263			return false;
264		});
265
266		jQuery(".slider a.ot-slider-left").click(function() {
267			var thenextpage = (jQuery(".slider > .slider-navigation > li.active").prev().index() == "-1")?jQuery(".slider > .slider-navigation > li").size()-1:jQuery(".slider > .slider-navigation > li.active").prev().index();
268			themesLoadPage(thenextpage);
269			themesCancelLoad();
270			return false;
271		});
272
273	});
274
275})(jQuery);
276
277function start() {
278    var z = 0;
279    jQuery('.breaking-block ul').each(function () {
280        var thisitem = jQuery(this), thisindex = z;
281
282        z = z + 1;
283        if (thisitem.find("li").size() > 0) {
284
285            if (!breakingStart) { return false; }
286            var theBreakingMargin = parseInt(thisitem.find("li").css("margin-right")), theBreakingWidth = parseInt(thisitem.parent().css("width"));
287            theCount[thisindex] = (Math.ceil(thisitem.find("li").size() / 2) * (parseInt(thisitem.find("li").width()) + parseInt(thisitem.find("li").css("margin-right"))));
288
289            if (elementsToClone[thisindex]) {
290                jQuery(this).parent().parent().addClass("isscrolling");
291                jQuery('.breaking-block').eq(thisindex).parent().attr("rel", thisindex);
292                thisitem.find("li").clone().appendTo(this);
293
294                elementsToClone[thisindex] = false;
295            }
296            var theNumber = theCount[thisindex] + breakingOffset[thisindex];
297            if (Math.abs(theNumber) <= (Math.abs(breakingScroll[thisindex]))) {
298                cloneBreakingLine(thisindex);
299            }
300
301            if (!elementsActive[thisindex]) {
302                elementsActive[thisindex] = setInterval(function () {
303                    beginScrolling(thisitem, thisindex);
304                }, breakingSpeed);
305            }
306        }
307    });
308
309    setTimeout("start()", breakingSpeed);
310}
311
312function beginScrolling(thisitem, thisindex) {
313    breakingScroll[thisindex] = breakingScroll[thisindex] - 1;
314    thisitem.css("left", breakingScroll[thisindex] + 'px');
315}
316
317function cloneBreakingLine(thisindex) {
318    breakingScroll[thisindex] = 0;
319    jQuery('.breaking-block').eq(thisindex).find('ul').css("left", "0px");
320}
321
322function lightboxclose(){
323	jQuery(".lightbox").css('overflow', 'hidden');
324	jQuery(".lightbox .lightcontent").fadeOut('fast');
325	jQuery(".lightbox").fadeOut('slow');
326	jQuery("body").css('overflow', 'auto');
327}
328
329
330function refreshSidebar() {
331	jQuery("#sidebar").each(function() {
332		jQuery(this).css("height", "auto");
333		var maxheight = jQuery(this).height();
334		var secondheight = jQuery(".main-content").height();
335		maxheight = (parseInt(secondheight) > parseInt(maxheight))?secondheight:maxheight;
336		jQuery("#sidebar").css("min-height", maxheight);
337	});
338}
339
340function slideGalleryWidget(theitem) {
341	theitem.css("opacity", "0").css("display", "block").animate({
342		"opacity" : "1"
343	}, 200, function(){
344		jQuery(this).addClass("active").siblings("a.active").removeClass("active").css("display", "none");
345		refreshSidebar();
346	});
347}
348
349
350
351

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.