PageSourceSearch

https://ptc-vector.ru/local/js/reaspekt/reaspekt.geobase/script.js?16055858175218

js ptc-vector.ru collected 2026-10-09 03:31:47 UTC 5,218 bytes, 128 lines download raw bytes

1(function(window, document, $, undefined){
2    "use strict";
3   
4    var paramsDefault = {
5        height : "250",
6        width : "500",
7        ajax  : {
8            dataType : 'html',
9            headers  : { 'X-reaspektPopupBox': true }
10        },
11        content : null,
12        fixedPosition : false
13    };
14    var params = {
15        htmlPopup : '<div class="modal fade" id="city-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"><div id="ReaspektPopupBody" class="modal-dialog"><section class="modal-container"><button type="button" class="close" id="ReaspektCloseBtn" data-dismiss="modal" aria-label="Close"></button><div class="inner" id="ReaspektPopupContainer">Загрузка...</div></section></div></div>',
16        //htmlPopup : '<div class="ReaspektPopupOverlay"></div><div id="ReaspektPopupBody"><div class="ReaspektClosePosition"><div id="ReaspektCloseBtn"></div></div><div id="ReaspektPopupContainer">Загрузка...</div></div>',
17        objPopupIdBody : '#ReaspektPopupBody',
18        objPopupIdOverlay : '.ReaspektPopupOverlay',
19        objPopupIdCloseBtn : '#ReaspektCloseBtn',
20        objPopupIdContainer : '#ReaspektPopupContainer',
21		activeClassBodyReaspekt : 'activeClassBodyReaspekt'
22    };
23    var methods = {
24        init : function( options ) {
25            
26            
27            return this.click(function(element){
28                var obClass = $(this);
29				paramsDefault['href'] = obClass.data('reaspektmodalbox-href') || obClass.attr('href');
30				
31				var settings = $.extend($.ReaspektModalBox, paramsDefault, options);
32                
33                methods.addHtmlTemplate(settings);
34                $('#city-modal').modal();
35                
36                /*if (!settings.fixedPosition) {
37                    $(window).bind('resize.ReaspektPopupOverlay', $.proxy( methods.rePosition, this) );
38                    methods.rePosition();
39                }*/
40            });
41        },
42        
43        //Добавляем Div`s
44        addHtmlTemplate : function(settings) {
45            methods.closeReaspektPopup();
46            $('body').append(params.htmlPopup);
47            $('body').addClass(params.activeClassBodyReaspekt);
48            methods.addContainerData(settings);
49        },
50        
51        //Add data in popup html
52        addContainerData : function(settings) {
53            //Add event click close button
54            $(params.objPopupIdCloseBtn).bind("click", function(e){
55                e.preventDefault();
56                
57                methods.closeReaspektPopup();
58            });
59            
60            //Add event click overlay
61            $(params.objPopupIdOverlay).bind("click", function(e){
62                e.preventDefault();
63                
64                methods.closeReaspektPopup();
65            });
66            
67            methods._loadAjax(settings);
68        },
69        
70        //Close popup
71        closeReaspektPopup : function() {
72            $(window).unbind('resize.ReaspektPopupOverlay');
73            $('body').removeClass(params.activeClassBodyReaspekt);
74            $(params.objPopupIdBody).remove();
75            $(params.objPopupIdOverlay).remove();
76            //$('#city-modal').modal('hide');
77            $('#city-modal').remove();
78            $(".modal-backdrop").remove();
79        },
80        
81        rePosition : function() {
82            
83            //$(params.objPopupIdBody).css("top", Math.max(0, (($(window).height() - $(params.objPopupIdBody).outerHeight()) / 2) + $(window).scrollTop()) + "px");
84            
85            //$(params.objPopupIdBody).css("left", Math.max(0, (($(window).width() - $(params.objPopupIdBody).outerWidth()) / 2) + $(window).scrollLeft()) + "px");
86        },
87        
88        _loadAjax: function (settings) {
89           if (settings.href) {
90                $.ajax($.extend({}, settings.ajax, {
91                    url: settings.href,
92                    error: function (jqXHR, textStatus) {
93                        console.log(jqXHR);
94                        console.log(textStatus);
95                    },
96                    success: function (data, textStatus) {
97                        if (textStatus === 'success') {
98                            settings.content = data;
99
100                            methods._afterLoad(settings);
101                        }
102                    }
103                }));
104           } else {
105               console.log('Error, not atribute href or data-reaspektmodalbox-href');
106           }
107		},
108        
109        _afterLoad: function (settings) {
110            $(params.objPopupIdContainer).html(settings.content);
111            
112            methods.rePosition();
113        }
114    };
115
116    $.fn.ReaspektModalBox = function( method ) {
117
118        // логика вызова метода
119        if ( methods[method] ) {
120          return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
121        } else if ( typeof method === 'object' || ! method ) {
122          return methods.init.apply( this, arguments );
123        } else {
124          $.error( 'Метод с именем ' +  method + ' не существует для jQuery.ReaspektModalBox' );
125        } 
126    };
127    
128})(window, document, 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.