PageSourceSearch

https://kfavfm.com/wp-content/plugins/awesome-weather-pro/js/awesome-weather-widget-frontend.js?ver=1.1

js kfavfm.com collected 2026-10-06 15:17:10 UTC 4,442 bytes, 153 lines download raw bytes

1
2
3// jQUERY READY
4jQuery(document).ready(function()
5{
6	jQuery(document).delegate('.awesome-weather-form', 'submit', function(e)
7	{
8		var this_form = jQuery(this);
9		var js_slug = this_form.data('js-slug');
10		var city_slug = this_form.data('slug');
11		var user_location = this_form.children('input').val();
12 
13		jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-blankout .awesome-weather-blankout-error').hide();
14 
15		if( user_location )
16		{
17			// SHOW LOADING
18			jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-blankout .awe-loading').show();
19			jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-form').hide();
20			
21			
22			var widget_obj = awe['awe_weather_widget_json_' + js_slug];
23			widget_obj.longlat_location = "0";
24			widget_obj.user_location = user_location;
25			
26			
27			// PASS WEATHER OBJECT BACK THROUGH THE SYSTEM
28			jQuery.post(awe['ajaxurl'], widget_obj, function(response) 
29			{
30				if( response == "false" )
31				{
32					awesome_weather_show_form( city_slug );
33					jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-blankout .awesome-weather-blankout-error').show();
34				}
35				else
36				{
37					// SPIT BACK THE RESULTS IN THE CONTAINER
38					jQuery("#awesome-weather-" + city_slug ).replaceWith( response );
39					jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-blankout .awesome-weather-blankout-error').hide();
40				}
41				
42				// SET COOKIE OF CITY ID
43				var new_city_id = jQuery(".awesome-weather-form[data-js-slug='" + js_slug + "']").data('city-id');
44				if( new_city_id )
45				{
46					Cookies.set('awe_city_id', new_city_id, { expires: 14 } );
47				}
48				
49				// STOP LOADING
50				awe_stop_loading();
51			});
52		}
53
54		e.preventDefault();
55	});
56	
57	
58	// WEATHER TRIGGER
59	jQuery(document).delegate('.awe-weather-trigger a', 'click', function(e) 
60	{
61		var this_btn = jQuery(this);
62		this_btn.addClass('loading');
63		
64		var js_slug = this_btn.data('js-slug');
65		var city_slug = this_btn.data('slug');
66		
67		jQuery('#awesome-weather-' + city_slug + ' .awe-weather-bubble').hide();
68		
69		var widget_obj = awe['awe_weather_widget_json_' + js_slug];
70		
71		// IF YAHOO SHOW FORM
72		if( widget_obj.provider == "yahoo" )
73		{
74			awesome_weather_show_form( city_slug );
75			e.preventDefault();
76			return false;
77		}
78		
79		// SHOW LOADING
80		jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-blankout').show();
81		
82		
83		// CHECK IF HTML5 GEOLOCATION IS AVAILABLE
84		if (navigator.geolocation) 
85		{
86			// GET POSITION
87        	navigator.geolocation.getCurrentPosition(awesome_weather_set_location, awesome_weather_show_form_to_user);
88    	} 
89    	else 
90    	{
91	    	// NO GEO LOCATION, SHOW FORM
92			awesome_weather_show_form( city_slug );
93		}
94		
95		function awesome_weather_show_form_to_user()
96		{
97			awesome_weather_show_form( city_slug );
98		}
99		
100		function awesome_weather_set_location(position) 
101		{
102
103			// SAVE LOCATION AND REFRESH
104			var widget_obj = awe['awe_weather_widget_json_' + js_slug];
105			
106
107			// ADD IP LOCATION TO NEW WEATHER OBJECT
108			widget_obj.longlat_location = position.coords.latitude + "," + position.coords.longitude;
109			widget_obj.longlat_triggered = "1";
110		
111			// PASS WEATHER OBJECT BACK THROUGH THE SYSTEM
112			jQuery.post(awe['ajaxurl'], widget_obj, function(response) 
113			{
114				// SPIT BACK THE RESULTS IN THE CONTAINER
115				jQuery("#awesome-weather-" + city_slug ).replaceWith( response );
116				
117				
118				// SET COOKIE OF CITY ID
119				var new_city_id = jQuery(".awesome-weather-form[data-js-slug='" + js_slug + "']").data('city-id');
120				Cookies.set('awe_city_id', new_city_id, { expires: 7 });
121				
122				
123				// STOP LOADING
124				awe_stop_loading();
125			});
126		}	
127
128		e.preventDefault();
129		return false;
130	});
131	
132	function awesome_weather_show_form( city_slug ) 
133	{
134		awe_stop_loading( city_slug );
135		
136		jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-form').show();
137		jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-form input').focus();
138		jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-blankout').show();
139		
140		jQuery(document).delegate('#awesome-weather-' + city_slug + ' .awesome-weather-blankout', 'click', function(e) 
141		{
142			jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-form').hide();
143			jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-blankout').hide();
144		});
145	}
146		
147	function awe_stop_loading( city_slug )
148	{
149		jQuery('#awesome-weather-' + city_slug + ' .awesome-weather-blankout .awe-loading').hide();
150	}
151	
152	
153});

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.