1(function($) { 2 $(document).ready(function() { 3 $('.wp-open-weather.wpw-shortcode .wp-open-weather-refresh-now').bind('click', function (event) { 4 var id = $(this).data('id'); 5 var tag = $(this).data('tag'); 6 var template = $(this).data('template'); 7 weatherRefresh(id, tag, template, 'weatherRefresh'); 8 }); 9 10 $('.wp-open-weather.wpw-widget .wp-open-weather-refresh-now').bind('click', function (event) { 11 var id = $(this).data('id'); 12 var tag = $(this).data('tag'); 13 var template = $(this).data('template'); 14 weatherRefresh(id, tag, template, 'weatherWidgetRefresh'); 15 }); 16 17 function weatherRefresh (id, tag, template, action) { 18 var container = $('[data-id="'+id+'"]').closest('.wp-open-weather').find('.wp-open-weather-data'); 19 showSpinner(id); 20 21 var data = {}; 22 23 data.action = action; 24 data.nonce = ajax_rpw.ajax_nonce; 25 data.id = id; 26 data.tag = tag; 27 data.template = template; 28 29 $.ajax({ 30 url: ajax_rpw.ajax_url, 31 type: 'POST' , 32 data: data, 33 dataType: 'html', 34 cache: false, 35 success: function(data) { 36 $(container).html($(data).find('.wp-open-weather-data').html()); 37 hideSpinner(id); 38 }, 39 error: function (request, status, error) { 40 hideSpinner(id); 41 } 42 }); 43 } 44 45 function showSpinner(id) { 46 //var spinner = $('[data-id="'+id+'"]').closest('.wp-open-weather').find('.wp-open-weather-refresh-spinner'); 47 //$(spinner).show(); 48 var spinner = $('[data-id="'+id+'"]').closest('.wp-open-weather').find('.wcp-ow-icon-refresh'); 49 $(spinner).addClass('fa-spin'); 50 51 } 52 53 function hideSpinner(id) { 54 //var spinner = $('[data-id="'+id+'"]').closest('.wp-open-weather').find('.wp-open-weather-refresh-spinner'); 55 //$(spinner).hide(); 56 var spinner = $('[data-id="'+id+'"]').closest('.wp-open-weather').find('.wcp-ow-icon-refresh'); 57 $(spinner).removeClass('fa-spin'); 58 } 59 }); 60})(jQuery); 61 62
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.