https://livry.fr/wp-content/plugins/giweather/extras/lib_giweather/js/giweather-starter.js?ver=1.6.5
1/** 2 * @author Garda Informatica <[email protected]> 3 * @copyright Copyright (C) 2015 Garda Informatica. All rights reserved. 4 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 5 * @package giWeather Wordpress Widget 6 * @link https://www.gardainformatica.it 7 */ 8 9/* 10 11This file is part of "giWeather Wordpress Widget". 12 13"giWeather Wordpress Widget" is free software: you can redistribute it and/or modify 14it under the terms of the GNU General Public License as published by 15the Free Software Foundation, either version 3 of the License, or 16(at your option) any later version. 17 18"giWeather Wordpress Widget" is distributed in the hope that it will be useful, 19but WITHOUT ANY WARRANTY; without even the implied warranty of 20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21GNU General Public License for more details. 22 23You should have received a copy of the GNU General Public License 24along with "giWeather Wordpress Widget". If not, see <https://www.gnu.org/licenses/>. 25 26*/ 27 28function giweather_starter_ajax(giweather_ajax_object){ 29 var giw_data = { 30 'action': 'giweather_load_forecast_json', 31 }; 32 33 if (giweather_ajax_object.hasOwnProperty( 'number' ) && giweather_ajax_object.number != -1 && giweather_ajax_object.number !== null) { 34 giw_data.number = giweather_ajax_object.number; 35 } else { 36 giw_data.options = giweather_ajax_object.params; 37 } 38 39 jQuery.ajax( 40 { 41 type: "POST", 42 url: giweather_ajax_object.ajax_url, 43 data: giw_data, 44 dataType: "json"} 45 ) 46 .done( 47 function(rdata) { 48 if (rdata.messages) { 49 var l = rdata.messages.length; 50 for (var i = 0;i < l;i++) { 51 var msg_map = rdata.messages[i]; 52 var div_alert = jQuery( '<div class="error giweather-error"></div>' ).text( msg_map['msg'] ); 53 jQuery( giweather_ajax_object.widgetid ).before( div_alert ); 54 } 55 } 56 57 if ( ! rdata.html.length) { 58 return; 59 } 60 61 jQuery( giweather_ajax_object.widgetid + ' > .giweather-widget' ).removeClass( 'giw-loading' ); 62 jQuery( giweather_ajax_object.widgetid + ' > .giweather-widget' ).append( rdata.html ); 63 var giww = new GIWeatherWidget( giweather_ajax_object.widgetid,giweather_ajax_object.options ); 64 } 65 ) 66 .fail( 67 function() { 68 var div_alert = jQuery( '<div class="error giweather-error"></div>' ).text( giweather_ajax_object.ajax_fail_msg ); 69 jQuery( giweather_ajax_object.widgetid ).before( div_alert ); 70 } 71 ); 72 73}
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.