PageSourceSearch

https://www.jewishmuseum.cz/javascripts/2dcf4f840f7b612d18517dad76633e0f-1758713538/

js jewishmuseum.cz collected 2026-10-02 03:06:06 UTC 17,279 bytes, 376 lines download raw bytes

1
2/* -- FILE: [javascripts/eshopVstupenkyDetail.js]*/
3$(document).ready(function () {
4    /*global fb, Floatbox, eshopLang, circuitId*/
5    var nazvyOhruhu = {'1': 'Pražské židovské město', '2': 'Židovské muzeum v Praze', '3': 'Staronová synagoga'},
6        zavrenoText = 'Zavřeno',
7        originalFloatboxEndFunction = Floatbox.prototype.end;
8
9    $('.javascriptRequired').show();
10
11    if (eshopLang === 'en') {
12        nazvyOhruhu = {'1': 'Prague Jewish Town', '2': 'Jewish museum in Prague', '3': 'Old-new synagogue'};
13        zavrenoText = 'Closed';
14    }
15
16    function checkDateFunction() {
17        var checkDateAjaxUrl = $('#checkDateAjaxUrl').val(),
18            checkDate = $('#checkDateInput').val(),
19            checkDateLimit = 5,
20            checkDateType = $('#checkDateType').val();
21
22        if (!checkDate) {
23            $('#checkDateInput').css({'background': 'Red', 'color': '#fff'});
24            $('.orderTickets').hide();
25            return false;
26        }
27
28        $.ajax({
29            url: checkDateAjaxUrl,
30            type: 'post',
31            data: {'checkDate': checkDate, 'checkDateLimit': checkDateLimit, 'checkDateType': checkDateType},
32            dataType: 'xml'
33        }).done(function (xml) {
34            var result = $(xml),
35                tmp = checkDate.replace(/\./g, '').replace(/-/g, ''),
36                checkDateFormat =  tmp.substr(4, 4) + '-' + tmp.substr(2, 2) + '-' + tmp.substr(0, 2),
37                today = new Date(checkDateFormat), // Brat jako vybrane datum, aby se zvyraznilo pred a po
38                dd = today.getDate(),
39                mm = today.getMonth() + 1,
40                yyyy = today.getFullYear(),
41                todayText = yyyy + ((mm < 10 ? "0" : "") + mm) + ((dd < 10 ? "0" : "") + dd),
42                todayNow = new Date(), // Musime znat take dnesni datum
43                ddNow = todayNow.getDate(),
44                mmNow = todayNow.getMonth() + 1,
45                yyyyNow = todayNow.getFullYear(),
46                todayNowText = yyyyNow + ((mmNow < 10 ? "0" : "") + mmNow) + ((ddNow < 10 ? "0" : "") + ddNow),
47                i = 1,
48                tmp2,
49                okruhNalezen = false;
50
51            $('#checkDateResults').html('');
52
53            // Otestovani, zda jsme ve vysledcich dostali
54            // nami zadane datum, tudiz je mozne objednavat,
55            // nebo se tento den neotvira a musime vybrat den jiny
56            tmp2 = result.find('datum_prohl:contains("' + todayText + '")');
57            console.log('Kontroluji datum ' + todayText + ' v oteviracich dobach');
58            if (tmp2.length) {
59                // Jelikoz muzeme dostat az 3 vysledky, musime zkontrolovat,
60                // aby jeden z nich obsahoval id okruhu
61                tmp2.each(function () {
62                    if ($(this).parent().find('circuit_id:contains("' + checkDateType + '")').length) {
63                        console.log('Typ okruhu ' + checkDateType + ' ma dne ' + todayText + ' otevreno');
64                        console.log('1. PLATNE DATUM ' + todayText);
65                        $('#nakup-vstupenky-datum').attr('value', (((dd < 10 ? "0" : "") + dd + '.' + ((mm < 10 ? "0" : "") + mm)) + '.' + yyyy));
66                        okruhNalezen = true;
67                    }
68                });
69            }
70            if (okruhNalezen === true) {
71                $('#variation_6_Datum input, #variation_6_Date input').addClass('ok').css({'background': '#72c267', 'color': '#fff'});
72                $('.orderTickets').show();
73            } else {
74                console.log('Typ okruhu ' + checkDateType + ' ma dne ' + todayText + ' ZAVRENO');
75                $('#variation_6_Datum input, #variation_6_Date input').removeClass('ok').css({'background': 'red', 'color': '#fff'});
76                $('.orderTickets').hide();
77            }
78
79            // Projdeme jednotlive casove udaje
80            result.find('curdata').each(function () {
81                var row = '',
82                    date = $(this).children('datum_prohl').text(),
83                    dateText = date.substr(6, 2) + '.' + date.substr(4, 2) + '.' + date.substr(0, 4),
84                    hoursFrom = $(this).children('hours_from').text(),
85                    hoursTo = $(this).children('hours_to').text(),
86                    circuit_id = $(this).children('circuit_id').text();
87
88                // Pokud jeste na tento den neexistuje div, tak ho vytvorime
89                if (!$('#checkDateResults').find('#date' + date).length) {
90                    // Pokud je datum mensi jak dnesek, nezobrazujeme ho
91                    if (todayNowText <= date) {
92                        row += '<div class="' + (date == todayText ? 'now ' : '') + 'popup-time-div div-number-' + i++ + ' not" ';
93                        row += 'id="date' + date + '" style="float:left;';
94                        row += (todayText == date ? ' ' : '')  + '">';
95                        row += '<table><thead><th colspan=3><h3>' + dateText + '</h3></th></thead><tbody></tbody></table></div>';
96                    } else {
97                        row += '<div class="popup-time-div display-none div-number-' + i++ + '" id="date' + date + '" style="float:left;">';
98                        row += '</div>';
99                    }
100                    $('#checkDateResults').append(row);
101                }
102
103                // Pokud je datum mensi jak dnesek, nezobrazujeme ho
104                if (todayNowText <= date) {
105                    row  = '';
106                    row += '<tr class="blockCircuit' + $(this).children('circuit_id').text()
107                        + '"><td class="normal' + (circuitId == $(this).children('circuit_id').text() ? ' actual' : '')
108                        + '" colspan=4>' + nazvyOhruhu[$(this).children('circuit_id').text()] + ':</td>';
109                    row += ' <td>' + hoursFrom.substr(0, 2) + ':' + hoursFrom.substr(2, 2);
110                    row += ' - ' + hoursTo.substr(0, 2) + ':' + hoursTo.substr(2, 2) + '</td></tr> ';
111                    row += '<tr><td>';
112                    row += '<form class="colloseum-form"  method="post" action="https://tickets.jewishmuseum.cz/tourscombinationdetail">';
113                    row += '<input type="hidden" name="mrsid" value="214" />';
114                    row += '<input type="hidden" name="tourscombinationid" value="13420" />';
115                    row += '<input type="hidden" name="date" value="' + date.substr(6, 2) + '.' + date.substr(4, 2) + '.' + date.substr(0, 4) + '" id="nakup-vstupenky-datum"/>';
116                    row += '<input type="hidden" name="successredirect" value="https://www.jewishmuseum.cz/pamatky-a-expozice/pamatky/" />';
117                    row += '<input type="hidden" name="failedredirect" value="https://www.jewishmuseum.cz/pamatky-a-expozice/pamatky/" />';
118                    if (eshopLang === 'en') {
119                        row += '<input type="hidden" name="language" value="en-GB" />';
120//                        row += '<button class="colloseum-eshop-btn" type="submit">Buy</button>';
121                    } else {
122                        row += '<input type="hidden" name="language" value="cs-CZ" />';
123//                        row += '<button class="colloseum-eshop-btn" type="submit">Koupit</button>';
124                    }
125                    row += '</form>';
126
127                    row += '</td><td></td></tr>';
128
129                    row += ' ';
130
131                    $('#checkDateResults #date' + date + ' tbody').append(row);
132
133                    // Tento den obsahuje nami hledany okruh (je u nej uvedena oteviraci doba)
134                    if (circuit_id == checkDateType) {
135                        $('#checkDateResults #date' + date).removeClass('not');
136                        $('#checkDateResults #date' + date).addClass('ok');
137                    }
138                }
139            });
140
141            // Projdeme bloky a doplnime chybejici okruhy, ktere maji zavreno
142            $('#checkDateResultsBlock table').each(function () {
143                var row;
144                if (!$(this).find('.blockCircuit1').length) {
145                    row  = '';
146                    row += '<tr><td class="normal' + (circuitId === 1 ? ' actual' : '') + '" colspan=4>' + nazvyOhruhu[1] + ':</td>';
147                    row += ' <td>' + zavrenoText + '</td><td>.</td></tr>';
148                    $(this).find('tbody').append(row);
149                }
150                if (!$(this).find('.blockCircuit2').length) {
151                    row  = '';
152                    row += '<tr><td class="normal' + (circuitId === 2 ? ' actual' : '') + '" colspan=4>' + nazvyOhruhu[2] + ':</td>';
153                    row += ' <td>' + zavrenoText + '</td><td>.</td></tr>';
154                    // Druhy okruh jiz nepodporujeme
155                    //$(this).find('tbody').append(row);
156                }
157                if (!$(this).find('.blockCircuit3').length) {
158                    row  = '';
159                    row += '<tr><td class="normal' + (circuitId === 3 ? ' actual' : '') + '" colspan=4>' + nazvyOhruhu[3] + ':</td>';
160                    row += ' <td>' + zavrenoText + '</td><td>.</td></tr>';
161                    // Treti okruh jiz nepodporujeme
162                    //$(this).find('tbody').append(row);
163                }
164            });
165
166            // Musime pregenerovat thickbox
167            fb.defaultOptions.theme = 'custom';
168            fb.width = '650';
169            fb.theme = 'custom';
170            fb.lclTheme = 'custom';
171            fb.anchors = [];
172            fb.outsideClickCloses = false;
173            if ($('#addToCartForm').get(0) !== undefined) {
174                fb.tagAnchors($('#addToCartForm').get(0));
175            }
176
177            $('#dateAjaxIcon').hide();
178
179            if (okruhNalezen === true) {
180                if ($('body').find('.colloseum-form-main').length) {
181                    $('body').find('.colloseum-form-main').submit();
182                }
183            } else {
184                //202513006
185                $('#checkDate').hide();
186            }            
187        });
188    }
189
190    $('body').on('click', '.popup-time-div.ok', function () {
191        if ($(this).find('.colloseum-form').length) {
192            $(this).find('.colloseum-form').submit();
193        }
194
195        var date = $(this).attr('id').replace('date', '');
196        // Vratime floatboxu originalni funkci pro zavreni okna
197        Floatbox.prototype.end = originalFloatboxEndFunction;
198        // Do inputu vlozime datum, na ketere jsme klikli
199        $('#checkDateInput').val(date.substr(6, 2) + '-' + date.substr(4, 2) + '-' + date.substr(0, 4));
200        console.log('2. PLATNE DATUM ' + date.substr(6, 2) + '-' + date.substr(4, 2) + '-' + date.substr(0, 4));
201        $('#nakup-vstupenky-datum').attr('value', date.substr(6, 2) + '.' + date.substr(4, 2) + '.' + date.substr(0, 4));
202        // Vybrali jsme aktivni datum
203        $('#variation_6_Datum input, #variation_6_Date input').addClass('ok').css({'background': '#72c267', 'color': '#fff'});
204        $('.orderTickets').show();
205        // Klikneme jiz na funkci floatboxu, ktera nam zavre okno
206        $(this).click();
207        return true;
208    });
209
210    $('body').on('click', '#fbClose', function () {
211        // Vratime floatboxu originalni funkci pro zavreni okna
212        Floatbox.prototype.end = originalFloatboxEndFunction;
213        // Klikneme jiz na funkci floatboxu, ktera nam zavre okno
214        $(this).click();
215        return true;
216    });
217
218    /**
219     * -------------------------
220     * Validace rodinne vstupne
221     * -----------------------
222     */
223    //var idOkruhuVstupenky = parseInt($('#variation_4_2 input[name^="countVariations"]').attr('name').substr(16, 19));
224
225    /**
226     * Skryjeme rodinne vstupne
227     */
228    //$('#variation_4_2').hide();
229    /**
230     * Pri zmene poctu dospelich testujeme, zda mame povolen
231     * nakup rodinneho vstupneho
232     */
233    // $('#variation_4_1 input').change(function () {
234    //     var value = parseInt($(this).val(), 10),
235    //         maxValueRodinne,
236    //         valueRodinne = parseInt($('#variation_4_2 input').val(), 10);
237
238    //     if (idOkruhuVstupenky !== 186) {
239    //         if (isNaN(value) || value < 1) {
240    //             $('#variation_4_2').slideUp('250');
241    //             $('#variation_4_2 input').val('');
242    //         } else {
243    //             maxValueRodinne = value * 4;
244    //             //$('#variation_4_2').slideDown('500');
245    //             if (!isNaN(valueRodinne) && valueRodinne && maxValueRodinne < valueRodinne) {
246    //                 $('#variation_4_2 input').val(maxValueRodinne);
247    //             }
248    //         }
249    //     } else {
250    //         if (isNaN(value) || value < 2) {
251    //             $('#variation_4_2').slideUp('250');
252    //             $('#variation_4_2 input').val('');
253    //         } else {
254    //             maxValueRodinne = Math.floor(value / 2) * 4;
255    //             //$('#variation_4_2').slideDown('500');
256    //             if (!isNaN(valueRodinne) && valueRodinne && maxValueRodinne < valueRodinne) {
257    //                 $('#variation_4_2 input').val(maxValueRodinne);
258    //             }
259    //         }
260    //     }
261    // });
262    /**
263     * Pokud zmenime pocet vstupenek s rodinnym vstupnym,
264     * musime zkontrolovat pocet dospelych
265     */
266    // $('#variation_4_2 input').change(function () {
267    //     var value = parseInt($(this).val(), 10),
268    //         valueDospeli = parseInt($('#variation_4_1 input').val(), 10),
269    //         maxValue;
270    //     if (isNaN(value)) {
271    //         $(this).val('');
272    //     } else {
273    //         if (idOkruhuVstupenky !== 186) {
274    //             maxValue = valueDospeli * 4;
275    //             if (value > maxValue) {
276    //                 $(this).val(maxValue);
277    //             }
278    //         } else {
279    //             maxValue = Math.floor(valueDospeli / 2) * 4;
280    //             if (value > maxValue) {
281    //                 $(this).val(maxValue);
282    //             }
283    //         }
284    //     }
285    // });
286    /**
287     * Pred odeslanim do kosiku validujeme,
288     * zda je vyplnen datum a zvolen typ vstupenek
289     */
290    // $("#addToCartForm").submit(function (e) {
291    //     e.preventDefault();
292    //     var date = $('#variation_6_Datum input, #variation_6_Date input'),
293    //         variations = $('input[name^="countVariations[183][4]"]'),
294    //         ok = false,
295    //         tmp;
296
297    //     if (date.length) {
298    //         if (!date.hasClass('ok') || !(/^[0-3][0-9]\-[0-1][0-9]-[0-9]{4}$/.test(date.val()))) {
299    //             $('#variation_6_Datum input, #variation_6_Date input').css({'background': 'red', 'color': '#fff'});
300    //             return false;
301    //         }
302    //     }
303
304    //     if (variations.length) {
305    //         variations.each(function () {
306    //             tmp = parseInt($(this).val(), 10);
307    //             if (!isNaN(tmp) && tmp != 0) {
308    //                 ok = true;
309    //                 return;
310    //             }
311    //         });
312    //     } else {
313    //         ok = true;
314    //     }
315
316    //     if (ok === true) {
317    //         this.submit();
318    //     }
319    // });
320    /**
321     * Vyber data platnosti vstupenky
322     */
323    console.log($.datepicker.regional.en, 'AAA');
324    if (eshopLang === 'en' && typeof $.datepicker.regional.en) {
325        $.datepicker.regional.en.dateFormat = 'dd-mm-yy';
326        $.datepicker.setDefaults($.datepicker.regional.en);
327    }
328    $('.productVariations #variation_6_Datum input, .productVariations #variation_6_Date input').datepicker({
329        onSelect: function (selectedDate) {
330            $('#dateAjaxIcon').show();
331            $('#checkDate').hide();
332            checkDateFunction();
333        }
334    });
335    /**
336     * Vraceni oteviraci doby okruhu
337     */
338    $('#variation_6_Datum input, #variation_6_Date input').change(function () {
339        if (!$(this).val()) {
340            $(this).css({'background': 'Red'});
341        }
342    });
343
344    $('#checkDate').click(function () {
345        Floatbox.prototype.end = function () {
346            return false;
347        };
348
349        $('#checkDateThickBox').click();
350        return false;
351    });
352/*
353    $('.colloseum-form button').click(function(){
354        console.log('AAAA');
355    });
356*/
357    /**
358     * Spocitani celkove ceny vstupenek v detailu
359     */
360    // function countTotalPrice() {
361    //     var totalValue = 0;
362    //     $('input[class^="variationPrice"]').each(function () {
363    //         var price = parseInt($(this).attr('class').replace('variationPrice', ''), 10),
364    //             count = parseInt($(this).val(), 10);
365    //         if (!isNaN(price) && !isNaN(count)) {
366    //             totalValue += (price * count);
367    //         }
368    //     });
369
370    //     $('.totalDetailPrice').text(totalValue);
371    // }
372    // $('input[class^="variationPrice"]').change(countTotalPrice);
373    // countTotalPrice();
374
375    $('.orderTickets').hide();
376});

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.