PageSourceSearch

https://www.datefest.org/events/JS/widgets/WeatherBugWidget.js?sv=8.6.3

js datefest.org collected 2026-09-24 11:17:43 UTC 2,794 bytes, 88 lines download raw bytes

1/*Weather Bug Widget*/
2
3
4(function ($) {
5
6    //Data service for the widget
7    function widgetDataService() {
8
9        this.getWidgetData = function (servicePath, widgetModuleItemID, successCallback, errorCallback) {
10            $.ajax({
11                type: "POST",
12                url: servicePath,
13                data: "{'widgetModuleItemID':" + widgetModuleItemID + "}",
14                contentType: "application/json; charset=utf-8",
15                dataType: "json",
16                success: successCallback,
17                error: errorCallback
18            });
19        };
20    };
21
22    //Global variable for the widget function
23    var widgetModuleItemID = 0;
24    var widgetData = null;
25    var widgetContainer = null;
26    var weatherBugImage = null;
27    var weatherBugContentContainer = null;
28    var weatherBugWidgetLoaded = function() {};
29
30    //Constructor for the wiget
31    $.fn.WeatherBugWidget = function (options) {
32
33        var opts = $.extend({}, $.fn.WeatherBugWidget.defaultOptions, options);
34
35        widgetContainer = this;
36        widgetModuleItemID = opts.currentWidgetModuleItemID;
37        weatherBugWidgetLoaded = opts.weatherBugWidgetLoaded;
38
39        weatherBugImage = widgetContainer.find('#weatherBugImage');
40        weatherBugContentContainer = widgetContainer.find('#weatherBugDescription');
41
42        var widgetDataAdapter = new widgetDataService();
43
44        widgetDataAdapter.getWidgetData(opts.scriptPath, opts.currentWidgetModuleItemID, getWidgetDataSuccess, getWidgetDataError);
45
46    };
47
48    //Default options for the constructor to be merged with send constructor data
49    $.fn.WeatherBugWidget.defaultOptions = {
50        scriptPath: "services/eventsservice.asmx"
51        , currentWidgetModuleItemID: 0
52    };
53
54    //service call worked
55    var getWidgetDataSuccess = function (data) {
56
57        widgetData = data.d;
58        initialize();
59        weatherBugWidgetLoaded(data.d);
60    };
61
62    //service call has failed
63    var getWidgetDataError = function (data) {
64
65        console.log('WeatherBug failed to load'
66            , '\n' + 'Status: ' + data.status + ' ' + data.statusText
67            , '\n' + data.responseText);
68
69    };
70
71    //set up the ui
72    function initialize() {
73
74        if (widgetData.Enabled) {
75
76            if(PAGESSL && widgetData.ImageWithPath.indexOf('https') == -1){
77                widgetData.ImageWithPath = widgetData.ImageWithPath.replace('http://','https://')
78            }
79
80            weatherBugImage.attr('src', widgetData.ImageWithPath);
81            weatherBugImage.attr('alt', widgetData.Description);
82            weatherBugContentContainer.text(widgetData.Description);
83
84            widgetContainer.show();
85        }
86    }
87
88})(jQuery);

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.