PageSourceSearch

https://www.defaar.be/js/website/views/activiteit/activiteiten.js

js defaar.be collected 2026-10-08 04:30:29 UTC 3,365 bytes, 83 lines download raw bytes

1var Activiteiten = {
2    timer: null,
3    init: function () {
4        var that = this;
5        $(document).on('input', 'input[type="range"]', function () {
6            if (that.timer != null) {
7                clearTimeout(that.timer);
8            }
9            var r = $(this);
10            var val = r.val();
11            $('span[range="info"]').html(val);
12            that.setRangePosition(r);
13            that.timer = setTimeout(function () {
14                Ajaxify.doRequest($(this))
15            }, 350);
16
17        }).on('input', 'input.form-control-date', function () {
18
19            var input = $(this);
20            if (input.val() !== $('#' + input.attr('id') + '_sumbit').val())
21                Ajaxify.doRequest($(this));
22
23        }).on('click', '#btn-range-toggle', function () {
24            var btn = $(this);
25            if (!btn.hasClass('location')) {
26                btn.addClass('location');
27                if ("geolocation" in navigator) {
28                    navigator.geolocation.getCurrentPosition((position) => {
29                        $('#geo-location-allow').addClass('hidden');
30                        if (position.coords.longitude !== null && position.coords.latitude !== null) {
31                            $('input[name="Range.Lng"]').val(position.coords.longitude);
32                            $('input[name="Range.Lat"]').val(position.coords.latitude);
33                            var locationInfo = $('span[range="location"]');
34                            if (locationInfo.length > 0) {
35                                Activiteiten.addressByCoordinates(position.coords, 'Activiteiten.addressResult');
36                            }
37                        }
38                    },
39                        (error) => {
40
41                            $('#geo-location-allow').addClass('hidden');
42                            $('#geo-location-error').removeClass('hidden');
43                        }
44                    );
45                }
46            }
47        }).on('click', '.calendar button[data-day]', function (e) {
48            e.preventDefault();
49            var d = $(this).attr('data-day');
50            document.querySelector('dialog[data-day="'+ d+ '"]').showModal();
51        }).on('click', 'dialog[data-day] button', function (e) {
52            e.preventDefault();
53            var d = $(this).attr('data-day');
54            document.querySelector('dialog[data-day="' + d + '"]').close();
55        });
56        that.setRangePosition($('input[type="range"]'));
57
58    },
59    setRangePosition: function (r) {
60        if (r === null) { r = $('#range-text'); }
61        if (r.length > 0) {
62            var input = r[0];
63            var percent = Math.round(input.value / (input.max - input.min) * 100);
64
65            $('#range-text').css("left", percent + "%");
66        }
67    },
68    addressByCoordinates: function (coordinates, callback) {
69
70        $.ajax({
71            type: 'POST', crossDomain: true, jsonpCallback: callback, url: 'https://geo.api.vlaanderen.be/geolocation/v4/Location?latlon=' + coordinates.latitude + ',' + coordinates.longitude,
72            dataType: 'jsonp'
73        });
74    },
75    addressResult: function (json) {
76        // console.log(json);
77        if (json.LocationResult.length > 0) {
78            $('span[range="location"]').html(json.LocationResult[0].FormattedAddress);
79        }
80    }
81};
82
83Activiteiten.init();

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.