PageSourceSearch

https://volgograd-avia.ru/wp-content/plugins/travelpayouts/app/public/js/site/TPPlugin.js?ver=0.5.6

js volgograd-avia.ru collected 2026-10-05 00:04:53 UTC 20,478 bytes, 545 lines download raw bytes

1jQuery(function($) {
2    $(document).ready(function () {
3        var size_list = $(".TPReadMoreList  > div").size();
4        var x=1;
5        console.log(size_list)
6        /*$('.TPReadMoreList div:lt('+x+')').show();
7         $('.TPReadMoreButton').click(function () {
8         x= (x+5 <= size_li) ? x+5 : size_li;
9         $('.TPReadMoreList div:lt('+x+')').show();
10         });*/
11
12        $('.TPReadMoreList > div:lt('+x+')').show();
13        $('.TPReadMoreButton').click(function () {
14            console.log("click");
15            x= (x+1 <= size_list) ? x+1 : size_list;
16            console.log(x)
17            $('.TPReadMoreList > div:lt('+x+')').show();
18        });
19        if ( x == size_list)  $('.TPReadMoreButton').hide()
20
21        $( ".TPTabs" ).tabs({
22            beforeActivate: function( event, ui ) {
23                console.log('beforeActivate');
24                /* setTimeout(function() {
25                 checkSize();
26                 }, 2000)*/
27
28            }
29        });
30
31        $('.TPButtonTableDates').bind( "click", handlerRailwayDatepickerTest );
32
33    });
34
35    var handlerRailwayDatepickerTest = function (e) {
36        e.preventDefault()
37        var link, picker, linkUrl, target, dateUrl, linkOpen;
38        link = $(this);
39        //link.unbind('click');
40        target = parseInt(link.data('target'));
41        linkUrl = link.data('href');
42        picker = link.pikaday({
43            firstDay: 1,
44            i18n: {
45                previousMonth : 'Предыдущий месяц',
46                nextMonth     : 'Следующий месяц',
47                months        : ['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Aвгуст','Сентябрь','Октябрь','Ноябрь','Декабрь'],
48                weekdays      : ['Понедельник','Вторник','Среда','Четверг','Пятницу','Суббота','Воскресенье'],
49                weekdaysShort : ['Вс','Пн','Вт','Ср','Чт','Пт','Сб']
50            },
51            minDate: new Date(),
52            maxDate: new Date(new Date().setDate(new Date().getDate() + 90)),
53            linkURL: linkUrl,
54            linkTarget: target,
55            onDraw: function () {
56                $(document).find('.tp-pika-link').click(function (e) {
57                    picker.pikaday('hide');
58                    picker.pikaday('destroy');
59                });
60            },
61            onOpen: function () {
62                console.log('onOpen')
63                $(document).find('.tp-pika-link').click(function (e) {
64                    picker.pikaday('hide');
65                    picker.pikaday('destroy');
66                });
67            },
68            onSelect: function(date) {
69                console.log('onSelect')
70                var dateFormat;
71                dateFormat = new Date(date);
72                dateUrl = dateFormat.format('yyyy-mm-d');
73                linkUrl += dateFormat.format('yyyy-mm-d');
74                console.log(linkUrl)
75                console.log(dateUrl)
76            },
77            onClose: function() {
78                console.log('onClose')
79                console.log(linkUrl);
80                console.log(dateUrl);
81            },
82
83        });
84        picker.pikaday('show');
85    }
86
87    /*var handlerRailwayDatepicker = function () {
88        var link, picker, linkUrl, target, dateUrl, linkOpen;
89        link = $(this);
90        link.unbind('click');
91        target = parseInt(link.data('target'));
92        linkUrl = link.data('href');
93        picker = link.pikaday({
94            firstDay: 1,
95            i18n: {
96                previousMonth : 'Предыдущий месяц',
97                nextMonth     : 'Следующий месяц',
98                months        : ['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Aвгуст','Сентябрь','Октябрь','Ноябрь','Декабрь'],
99                weekdays      : ['Понедельник','Вторник','Среда','Четверг','Пятницу','Суббота','Воскресенье'],
100                weekdaysShort : ['Вс','Пн','Вт','Ср','Чт','Пт','Сб']
101            },
102            minDate: new Date(),
103            maxDate: new Date(new Date().setDate(new Date().getDate() + 90)),
104            //yearRange: [2000,2020],
105            onOpen: function () {
106                console.log('onOpen')
107            },
108            onDraw: function () {
109                console.log('onDraw')
110                //console.log($(document).find('.pika-button'))
111            },
112            onSelect: function(date) {
113                console.log('onSelect')
114                var dateFormat;
115                dateFormat = new Date(date);
116                dateUrl = dateFormat.format('yyyy-mm-d');
117                linkUrl += dateFormat.format('yyyy-mm-d');
118                //link.attr('href', linkUrl);
119                //link.bind('click');
120                openInNewTab(link, picker, linkUrl, target);
121            },
122            onClose: function() {
123                console.log('onClose')
124                console.log(linkUrl);
125                console.log(dateUrl);
126            },
127
128        });
129        console.log(linkUrl);
130        console.log(dateUrl);
131        //picker.eq(0).pikaday('show');
132        picker.pikaday('show');
133    };
134    var handlerRailwayClickLink = function (url) {
135        window.open(url);
136        //window.open(url, '_blank');
137    }
138
139    function openLink(strUrl, picker) {
140        console.log( $(document).find( ":focus" ))
141        $(document).find( "body" ).focus();
142        picker.pikaday('destroy');
143        $(document).find('.pika-single').detach();
144        var evLink = document.createElement('a');
145        evLink.href = strUrl;
146        evLink.target = '_blank';
147        document.body.appendChild(evLink);
148        evLink.click();
149// Now delete it
150        evLink.parentNode.removeChild(evLink);
151    }
152
153    function openInNewTab(link, picker, url, target) {
154        picker.pikaday('destroy');
155        $(document).find('.pika-single').detach();
156        if (target == 1){
157            //openLink(url)
158            gBrowser.selectedTab = gBrowser.addTab("http://example.com");
159            /*var frm = $('<form   method="get" action="' + url + '" target="_blank"></form>')
160            $(document).find("body").append(frm);
161            frm.submit().remove();
162            var data = {url: url};
163            console.log(ajaxurl)
164            console.log(ajaxurl+'?action=railway_open_link')
165            $.ajax({
166                url: ajaxurl + '?action=railway_open_link',
167                type: "POST", // Делаем POST запрос
168                data: data,
169                success: function (data) {
170                    console.log(data.substring(0, data.length - 1));
171                    console.log('success');
172                    //document.location.href = '';
173                }
174            });
175
176            /*
177
178             */
179            //link.bind( "click", handlerRailwayDatepicker );
180            /*link.removeAttr("href");
181            link.attr("href", url);
182            link.attr("target", "_blank");
183            fakeClick(link);
184            //$('body').append('<a id="openLinkNewTab" href="' + url + '" target="_blank"><span></span></a>').find('#openLinkNewTab span').click().remove();
185          /*  link.unbind( "click" );
186            link.removeAttr("href");
187            link.attr("href", url);
188            link.attr("target", "_blank");
189
190            link[0].click();
191            //link.attr("onclick", "openLink('"+url+"'); return false;");
192            //link[0].onclick;
193            //link
194            //link.bind( "click", handlerRailwayClickLink(url) );
195            //link.click();
196            link.unbind("click");
197            link.bind( "click", handlerRailwayDatepicker );
198            return false;*
199        } else {
200            document.location.href = url;
201        }
202        return false;
203    }*/
204
205    var conteiner = '.TP-Plugin-Tables_wrapper';
206    var table = ' .TP-Plugin-Tables_box';
207
208    function checkSize() {
209        console.log('checkSize');
210        var widthWrapper, widthBox, hidden, small;
211        $(table).each(function () {
212            $(this).removeClass('TP-autoWidth-plugin');
213            widthWrapper = $(this).parents(conteiner).width();
214            widthBox = $(this).width();
215            if (widthBox > widthWrapper) {
216                while (widthBox > widthWrapper) {
217                    if (!$(this).find('tr td.TP-unessential:not(.TP-hidden)').length)
218                        return false;
219                    $('td.TP-unessential:not(.TP-hidden):last', $(this).find('tr')).addClass('TP-hidden');
220                    widthWrapper = $(this).parents(conteiner).width();
221                    widthBox = $(this).width();
222                }
223                $(this).addClass('TP-autoWidth-plugin');
224            } else {
225                small = true;
226                while (small) {
227                    small = false;
228                    if ($(this).find('tr td.TP-unessential.TP-hidden').length) {
229                        hidden = $('td.TP-unessential.TP-hidden:first', $(this).find('tr'));
230                        hidden.removeClass('TP-hidden');
231                        widthWrapper = $(this).parents(conteiner).width();
232                        widthBox = $(this).width();
233                        if (widthBox > widthWrapper) {
234                            hidden.addClass('TP-hidden');
235                            $(this).addClass('TP-autoWidth-plugin');
236                        } else {
237                            small = true;
238                        }
239                    }
240                }
241            }
242        });
243    }
244    checkSize();
245    $(window).resize(checkSize);
246});
247
248
249jQuery(function($) {
250    var doc, win;
251    doc = $(document);
252    win = $(window);
253    /*tpCityAutocomplete = new TPCityAutocomplete();
254     tpCityAutocomplete.TPCityStandTable("[data-city-iata]", "city-iata");
255     tpCityAutocomplete.TPCityStandTitle("[data-title-case-origin-iata]", "title-case-origin-iata", title_case_origin);
256     tpCityAutocomplete.TPCityStandTitle("[data-title-case-destination-iata]", "title-case-destination-iata", title_case_destination);
257     tpCityAutocomplete.TPAirlineStandTable("[data-airline-iata]", "airline-iata");*/
258
259    /*console.log(jQuery.fn);
260    console.log($.fn.dataTableExt );
261    console.log($.fn.dataTableExt.oSort );
262    console.log(jQuery.fn.dataTableExt);
263    console.log(jQuery.fn.dataTableExt.oSort);*/
264
265    /** **/
266    $.fn.dataTableExt.oSort['tp-date-asc']  = function(a,b) {
267        var x = $(a).data("tptime");
268        var y = $(b).data("tptime");
269        //console.log(y);
270        return ((x < y) ? -1 : ((x > y) ?  1 : 0));
271    };
272    $.fn.dataTableExt.oSort['tp-date-desc'] = function(a,b) {
273        var x = $(a).data("tptime");
274        var y = $(b).data("tptime");
275        return ((x < y) ? 1 : ((x > y) ?  -1 : 0));
276    };
277
278    /** **/
279    $.fn.dataTableExt.oSort['tp-found-asc']  = function(a,b) {
280        var x = ($(a).data("tpctime") - $(a).data("tptime"));
281        var y = ($(b).data("tpctime") - $(b).data("tptime"));
282        return ((x < y) ? -1 : ((x > y) ?  1 : 0));
283    };
284    $.fn.dataTableExt.oSort['tp-found-desc'] = function(a,b) {
285        var x = ($(a).data("tpctime") - $(a).data("tptime"));
286        var y = ($(b).data("tpctime") - $(b).data("tptime"));
287        return ((x < y) ? 1 : ((x > y) ?  -1 : 0));
288    };
289
290    /** **/
291    $.fn.rowCount = function() {
292        return $('tr', $(this).find('tbody')).length;
293    };
294
295    /** **/
296    $.fn.getPaginateTP = function() {
297        if($(this).data("paginate") == true){
298            if($(this).rowCount() > $(this).data("paginate_limit") ){
299                return true;
300            }
301        }
302        return false;
303
304    };
305
306    /** **/
307    $.fn.dataTableExt.oSort['tp-price-asc']  = function(a,b) {
308        var x = $(a).data("price");
309        var y = $(b).data("price");
310        return ((x < y) ? -1 : ((x > y) ?  1 : 0));
311    };
312    $.fn.dataTableExt.oSort['tp-price-desc'] = function(a,b) {
313        var x = $(a).data("price");
314        var y = $(b).data("price");
315        return ((x < y) ? 1 : ((x > y) ?  -1 : 0));
316    };
317
318    $.fn.dataTableExt.oSort['tp-airline_logo-asc']  = function(a,b) {
319
320        var x = ($(a).data("tpairline"));
321        var y = ($(b).data("tpairline"));
322        return ((x < y) ? -1 : ((x > y) ?  1 : 0));
323    };
324    $.fn.dataTableExt.oSort['tp-airline_logo-desc'] = function(a,b) {
325        var x = ($(a).data("tpairline"));
326        var y = ($(b).data("tpairline"));
327        return ((x < y) ? 1 : ((x > y) ?  -1 : 0));
328    };
329    /** **/
330    function tpTableCod(selector){
331        var tpTable, tableSortColumn;
332        tableSortColumn = getSortColumn(selector);
333
334        tpTable = selector.dataTable( {
335            ordering: true,
336            "order": [[ tableSortColumn, "asc" ]],//[[ $(this).data('sort_column'), "asc" ]],
337            paging: selector.getPaginateTP(),
338            iDisplayLength:  selector.data("paginate_limit"),
339            "bLengthChange": false,
340            searching: false,
341            bFilter: false,
342            bInfo: false,
343            columnDefs: [
344                {
345                    targets: tableSortColumn,//$(this).data('sort_column'),
346                    className: 'TP-active'
347                },
348                { "aTargets" : ["tp-nosort-column"] , "orderable" : false},
349                { "aTargets" : ["tp-date-column"] , "sType" : "tp-date"},
350                { "aTargets" : ["tp-found-column"] , "sType" : "tp-found"},
351                { "aTargets" : ["tp-price-column"] , "sType" : "tp-price"},
352                { "aTargets" : ["tp-airline_logo-column"] , "sType" : "tp-airline_logo"}
353            ],
354            "oLanguage":{
355                "oPaginate": {
356                    "sNext": null,
357                    "sLast": null,
358                    "sFirst": null,
359                    "sPrevious": null
360                }
361            }
362        } );
363        //console.log(tpTable.getPaginateTP())
364        //console.log(tpTable.rowCount())
365        return tpTable;
366    }
367
368    /** **/
369    function tpTableInit(){
370        doc.find('.TP-Plugin-Tables_box').each(function () {
371            var tpTable;
372            tpTable = tpTableCod($(this));
373            //console.log(tableSortColumn);
374            //console.log(tpTable)
375        });
376    }
377
378    /** **/
379    function tpTableResize(){
380
381        doc.find('.TP-Plugin-Tables_box').each(function () {
382            var tpTable;
383            $(this).children('thead').children('tr').find("td.TP-active").each(function(){
384                $(this).removeClass("TP-active");
385            });
386            $(this).dataTable().fnDestroy();
387            tpTable = tpTableCod($(this));
388
389        });
390    }
391
392    /** **/
393    doc.ready(function(){
394        $.fn.dataTableExt.sErrMode = 'throw';
395        //doc.find('.btn-table').parent('p').addClass('parrentBtn');
396        win.resize(tpTableResize);
397        tpTableInit();
398
399    });
400
401    /**
402     *
403     * @param selector
404     * @returns {number}
405     */
406    function getSortColumn(selector){
407        var column = selector.data('sort_column');
408        console.log('getSortColumn = '+column);
409        if(selector.children('thead').children('tr').children('td:eq('+column+')').hasClass("TP-hidden") === false){
410            return column;
411        } else  {
412            selector.children('thead').children('tr').children('td').each(function(index, value){
413                if(!$(this).hasClass("TP-hidden")){
414                    column = index;
415                    return false;
416                }
417            });
418            return column;
419        }
420
421    }
422
423    doc.find('td.TPTableHead').click(function () {
424        if ($(this).hasClass( "tp-nosort-column" ) == false){
425            $(this).parent('tr').find("td.TP-active").each(function(){
426                $(this).removeClass("TP-active");
427            });
428            $(this).addClass("TP-active");
429        }
430
431    });
432    var PopularRoutesWidgets = $('.TP-PopularRoutesWidgets');
433    PopularRoutesWidgets.each(function(){
434        var $items = $(this).find('.TP-PopularRoutesWidget');
435        //var width = Math.round(100/$items.length - 3);
436        var width = 100/$items.length - 1;
437
438        //console.log(100/$items.length);
439        //console.log(width_new);
440
441        //console.log($items.length)
442        var count = $items.length - 1;
443        $items.each(function(i,e){
444            //console.log(i)
445
446            if (i != count){
447                var width_new = width;
448                $(e).css('margin-right', "1%");
449                $(e).css('width', (width_new - 1)+"%");
450            } else {
451                $(e).css('width', width+"%");
452            }
453
454        });
455    });
456
457    /*doc.find('td.TPTableTbodyTd').hover(function() {
458     $(this).children("p").each(function(){
459     if(textWidth($(this).text(), $(this).html(), $(this)) > $(this).width()){
460     var textIndentLeft = ((textWidth($(this).text(), $(this)) - $(this).width()+16));
461     $(this).animate({"textIndent":"-"+textIndentLeft}, 1500);
462     }
463     });
464     }, function(){
465     $(this).children("p").each(function(){
466     if(textWidth($(this).text(),$(this).html(), $(this)) > $(this).width()){
467     $(this).animate({"textIndent":"0"}, 1500);
468     }
469     });
470     });
471     /**
472     *
473     * @param text
474     * @param selector
475     * @returns {*}
476     *
477     function textWidth(text, html_data, selector){
478     /*console.log(text);
479     console.log(html_data);
480     console.log(selector);
481     /*selector.html('<span>'+text+'</span>');
482     var width = selector.find('span:first').width();
483     selector.html(html_data);
484     return width;  *
485     }
486     var PopularRoutesWidgets = $('.TP-PopularRoutesWidgets');
487     PopularRoutesWidgets.each(function(){
488     var $items = $(this).find('.TP-PopularRoutesWidget');
489     var width = 100/$items.length - 3;
490     $items.each(function(i,e){
491     $(e).css('width', width+"%");
492     });
493     });**/
494
495
496    //Расчет ширины столбца и добавления стилей в зависимости от ширины
497    $(document).ready(function () {
498        $(".TP-Plugin-Tables_box_thead .TPdepartureTd.TPTableHead").css("width", "auto !important");
499        var width_departure = $(".TPTrainTable .TPTHdepartureTd").width();
500        if(width_departure<="85"){
501            $(".TP-Plugin-Tables_box_thead .TPdepartureTd.TPTableHead").css("max-width", "20px");
502        }else {
503            $(".TP-Plugin-Tables_box_thead .TPdepartureTd.TPTableHead").css("max-width", "100px");
504        }
505        
506        var width_departure_description = $(".TPTrainTable .TPdepartureTd").width();
507        if(width_departure_description<="85"){
508            $(".TPdepartureTd .span-timeComming").removeClass("TPactive");
509        }else {
510            $(".TPdepartureTd .span-timeComming").addClass("TPactive");
511        }
512        
513        var width_departure_description = $(".TPTrainTable .TParrivalTd").width();
514        if(width_departure_description<="85"){
515            $(".TParrivalTd .span-timeComming").removeClass("TPactive");
516        }else {
517            $(".TParrivalTd .span-timeComming").addClass("TPactive");
518        }
519    });
520
521    //Расчет ширины столбца и добавления стилей в зависимости от ширины (по ресайзу окна)
522    $(document).resize(function () {
523        $(".TP-Plugin-Tables_box_thead .TPdepartureTd.TPTableHead").css("width", "auto !important");
524        var width_departure = $(".TPTrainTable .TPTHdepartureTd").width();
525        if(width_departure<="85"){
526            $(".TP-Plugin-Tables_box_thead .TPdepartureTd.TPTableHead").css("max-width", "20px");
527        }else {
528            $(".TP-Plugin-Tables_box_thead .TPdepartureTd.TPTableHead").css("max-width", "100px");
529        }
530        
531        var width_departure_description = $(".TPTrainTable .TPdepartureTd").width();
532        if(width_departure_description<="85"){
533            $(".TPdepartureTd .span-timeComming").removeClass("TPactive");
534        }else {
535            $(".TPdepartureTd .span-timeComming").addClass("TPactive");
536        }
537        
538        var width_departure_description = $(".TPTrainTable .TParrivalTd").width();
539        if(width_departure_description<="85"){
540            $(".TParrivalTd .span-timeComming").removeClass("TPactive");
541        }else {
542            $(".TParrivalTd .span-timeComming").addClass("TPactive");
543        }
544    });
545});

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.