PageSourceSearch

https://www.westfalentarif.de/_assets/1ccffff547a755a3a508d4c13ec61e43/JavaScript/widget.js?1755175683

js westfalentarif.de collected 2026-10-01 15:13:13 UTC 5,082 bytes, 168 lines download raw bytes

1
2
3var WstWidget = function () {
4
5
6    var mode = 'departure';
7    var time = '';
8    var date = '';
9    var currentDate = null;
10
11    function initDatepicker() {
12
13
14        var dateToday = new Date();
15
16        $("#wst-widget--timetable-wrapper").datepicker({
17            minDate: dateToday,
18            dateFormat: "yy-mm-dd",
19            prevText: 'Zurück', prevStatus: '',
20            prevJumpText: '<<',
21            prevJumpStatus: '',
22            nextText: 'Vor',
23            nextStatus: '',
24            nextJumpText: '>>',
25            nextJumpStatus: '',
26            currentText: 'heute', currentStatus: '',
27            todayText: 'heute', todayStatus: '',
28            clearText: '-', clearStatus: '',
29            closeText: 'schließen', closeStatus: '',
30            monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
31                'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
32            monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun',
33                'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
34            dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
35            dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
36            dayNamesMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
37            onSelect: function (dateText) {
38                WstWidget.setDate(dateText);
39                WstWidget.update();
40                return false;
41            }
42        });
43
44        $('.ui-datepicker-calendar').on('click',function(e) {
45            e.preventDefault();
46        });
47
48
49    }
50    function initDropdowns() {
51
52        $('#wst-widget--timetable .dropdown-menu a,#wst-widget--timetable .dropdown-menu input, #wst-widget--timetable .dropdown-menu button, #wst-widget--timetable .dropdown-menu label, #wst-widget--timetable-wrapper').on('click', function(event){
53            event.stopPropagation();
54
55        });
56
57    }
58
59
60    function start() {
61
62        currentDate = new Date();
63		var minutes = currentDate.getMinutes();
64		minutes = Math.ceil(minutes/10)*10;
65		currentDate.setMinutes(minutes);
66
67        $('#wst-widget--mode-departure').on('change',function() {
68            mode = 'departure';
69            WstWidget.update();
70        });
71        $('#wst-widget--mode-arrival').on('change',function() {
72            mode = 'arrival';
73            WstWidget.update();
74        });
75
76        $('.js-time-button-later').on('click',function() {
77            WstWidget.riseTime();
78            WstWidget.update();
79        });
80        $('.js-time-button-earlier').on('click',function() {
81            WstWidget.lowerTime();
82            WstWidget.update();
83        });
84
85
86        $('#wst-widget--destination-input').on('focus',function() {
87            $('#wst-widget--destination-suggest').show();
88        }).on('focusout',function() {
89            $('#wst-widget--destination-suggest').hide();
90        });
91
92
93
94        WstWidget.update();
95
96    }
97
98    $(document).ready(function() {
99         initDatepicker();
100     });
101
102    return {
103
104        init: function () {
105
106            initDropdowns();
107            //initDatepicker();
108            start();
109
110        },
111
112        setDate: function (date) {
113
114            var newDate = new Date(date);
115            newDate.setMinutes(currentDate.getMinutes());
116            newDate.setHours(currentDate.getHours());
117            currentDate = newDate;
118
119            $('.widget--date').dropdown('toggle');
120
121
122        },
123
124        riseTime: function () {
125
126            //currentDate.setHours(currentDate.getHours());
127            currentDate.setMinutes(currentDate.getMinutes()+10);
128
129        },
130
131        lowerTime: function () {
132
133            //currentDate.setHours(currentDate.getHours()-1);
134            currentDate.setMinutes(currentDate.getMinutes()-10);
135
136        },
137
138        update: function() {
139
140            if (mode === 'departure') {
141                $('#wst-widget--mode-departure').prop('checked', true);
142                $('#wst-widget--mode-arrival').prop('checked', false);
143                $('.wst-widget--txt-mode').html('Abfahrt');
144            } else {
145                $('#wst-widget--mode-arrival').prop('checked', true);
146                $('#wst-widget--mode-departure').prop('checked', false);
147                $('.wst-widget--txt-mode').html('Ankunft');
148            }
149
150            $('.wst-widget--txt-time').html(('00'+currentDate.getHours()).slice(-2)+':'+ ('00'+currentDate.getMinutes()).slice(-2));
151            $('#wst-widget--time').val(('00'+currentDate.getHours()).slice(-2)+':'+ ('00'+currentDate.getMinutes()).slice(-2));
152
153            $('.widget--date--line2').html(currentDate.getDate()+'.'+(currentDate.getMonth()+1) + ".");
154            var weekday = new Array(7);
155            weekday[0] =  "Sonntag";
156            weekday[1] = "Montag";
157            weekday[2] = "Dienstag";
158            weekday[3] = "Mittwoch";
159            weekday[4] = "Donnerstag";
160            weekday[5] = "Freitag";
161            weekday[6] = "Samstag";
162            $('.widget--date--line1').html(weekday[currentDate.getDay()]);
163
164        }
165
166    }
167
168}();

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.