1(function (window) { 2 3 if (!!window.JCReaspektGeobase) { 4 return; 5 } 6 7 window.JCReaspektGeobase = function (arParams) { 8 this.letters = ''; 9 this.timer = '0'; 10 11 if (typeof arParams === 'object') { 12 this.params = arParams; 13 } 14 } 15 16 window.JCReaspektGeobase.prototype.onClickReaspektGeobase = function(city_id) { 17 var obClass = this; 18 19 this.showPreloaderReaspektGeobase(); 20 21 $.ajax({ 22 url: this.params.AJAX_URL.SELECT, 23 dataType: 'html', 24 data: { 25 'CITY_ID': city_id, 26 }, 27 type: 'POST', 28 success: function (data) { 29 var dataJSON = JSON.parse(data); 30 if (dataJSON.STATUS == "Y") { 31 console.log('close'); 32 obClass.onClickReaspektSaveCity("Y"); 33 34 } else { 35 console.log('Error, change city!'); 36 } 37 38 } 39 }); 40 } 41 42 window.JCReaspektGeobase.prototype.onClickReaspektSaveCity = function(reload) { 43 var obClass = this; 44 45 $('.' + obClass.params.CLASS.WRAP_QUESTION_REASAPEKT).fadeOut("700"); 46 47 $.ajax({
48 url: this.params.AJAX_URL.SAVE, 49 dataType: 'html', 50 data: {}, 51 type: 'GET', 52 success: function (data) { 53 var dataJSON = JSON.parse(data); 54 if (dataJSON.STATUS == "Y") { 55 console.log('save'); 56 $('.' + obClass.params.CLASS.WRAP_QUESTION_REASAPEKT).remove(); 57 58 if (reload == "Y") { 59 // document.location.reload(); 60 } 61 } else { 62 console.log('Error, no save change!'); 63 } 64 65 } 66 }); 67 } 68 69 window.JCReaspektGeobase.prototype.inpKeyReaspektGeobase = function(e) { 70 e = e||window.event; 71 72 var obClass = this; 73 var t = (window.event) ? window.event.srcElement : e.currentTarget; 74 var list = $('.reaspektGeobaseCities'); 75 var sFind = BX.util.trim(t.value); 76 77 if(this.letters == sFind) 78 return; // if nothing has changed, do not do heavy load server 79 80 this.letters = sFind; 81 82 if(this.timer){ 83 clearTimeout(this.timer); 84 this.timer = 0; 85 } 86 87 if(this.letters.length < 2){ 88 //list.html("������ �� �������"); 89 //list.animate({ height: 'hide' }, "fast"); 90 return; 91 } 92 93 this.timer = window.setTimeout(this.loadReaspektGeobase.bind(this), 190); 94 } 95 96 window.JCReaspektGeobase.prototype.loadReaspektGeobase = function() { 97 var obClass = this; 98 99 this.showPreloaderReaspektGeobase(); 100 101 this.timer = 0; 102 var list = $('.reaspektGeobaseFind'); 103 104 105 $.ajax({
106 type: "POST", 107 url: this.params.AJAX_URL.GET, 108 dataType: 'html', 109 data: { 110 'city_name': this.letters 111 }, 112 timeout: 10000, 113 success: function(data){ 114 if ($('.reaspektResultCityAjax').length) { 115 $('.reaspektResultCityAjax').remove(); 116 } 117 list.append('<div class="reaspektResultCityAjax">' + data + '</div>'); 118 $.fn.ReaspektModalBox('rePosition'); 119 120 obClass.hidePreloaderReaspektGeobase(); 121 } 122 }); 123 } 124 125 window.JCReaspektGeobase.prototype.showPreloaderReaspektGeobase = function(el) { 126 $('.reaspektGeobaseWrapperPopup').append('<span id="reaspekt_preloader"></span>'); 127 $("#reaspekt_preloader").animate({opacity: 1,}, 500 ); 128 } 129 130 window.JCReaspektGeobase.prototype.hidePreloaderReaspektGeobase = function(el) { 131 if ($('#reaspekt_preloader').length) { 132 $('#reaspekt_preloader').remove(); 133 } 134 } 135 136})(window);
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.