1window.JSApplicationData = function (arParams) { 2 if (typeof arParams === 'object') { 3 this.path_ajax = arParams.PATH_AJAX; 4 this.search_but = document.querySelector('.search_buttons'); 5 this.search_input = document.querySelector('#search'); 6 this.clue_but = document.querySelector('.clue-btn'); 7 this.clue_div = document.querySelector('.clue'); 8 9 this.arCal = []; 10 BX.ready(BX.delegate(this.init, this)); 11 } 12 13} 14window.JSApplicationData.prototype = { 15 init: function(){ 16 17 18 BX.bind(this.search_but, 'click', BX.delegate(this.searchApplication, this)); 19 BX.bind(this.search_input, 'bxchange', BX.delegate(this.editQuery, this)); 20 BX.bind(this.clue_but, 'click', BX.delegate(this.showClue, this)); 21 22 this.initForm(); 23 }, 24 initForm: function(){ 25 let searchBtn = this.search_but, 26 prop = this.search_input 27 /*result = new BX.MaskedInput({ 28 mask: '9999 9999 9999 9999', 29 input: prop, 30 placeholder: '_' 31 });*/ 32 33 if(prop.value.length == 16){ 34 searchBtn.removeAttribute('disabled'); 35 searchBtn.classList.remove("disabled"); 36 }else{ 37 searchBtn.setAttribute('disabled','disabled'); 38 searchBtn.classList.add("disabled"); 39 } 40 }, 41 editQuery: function(e){ 42 let el = e.target, 43 prop=el.value.replace(/[\s_]/g,""), 44 searchBtn = this.search_but; 45 46 if(prop.length == 16){ 47 searchBtn.removeAttribute('disabled'); 48 searchBtn.classList.remove("disabled"); 49 }else{ 50 searchBtn.setAttribute('disabled','disabled'); 51 searchBtn.classList.add("disabled"); 52 } 53 }, 54 showClue: function(e){ 55 let clueBtn = this.clue_but, 56 clueDiv = this.clue_div; 57 58 if(clueDiv.classList.contains('hidden')) clueDiv.classList.remove('hidden'); 59 else clueDiv.classList.add('hidden'); 60 }, 61 searchApplication: function(e){ 62 if(e.keyCode != 13 && e.target.classList.contains('disabled')){ 63 return; 64 } 65 66 let value = BX('search').value; 67 let language = BX('language').value; 68 console.log(value); 69 /*BX.ajax.runComponentAction("vosko:application", "send", { 70 mode: 'class', 71 data: { 72 number: '%'+value.replace(/[\s]/g,"")+'%' 73 }, 74 }).then(function(response){ 75 76 const result = JSON.parse(JSON.stringify(response)), 77 propText = this.text_success; 78 console.log(propText); 79 console.log(result); 80 console.log(result.data); 81 });*/ 82 83 BX.ajax({ 84 url: this.path_ajax, 85 method: 'POST', 86 data: {FILTER: {UF_NUMBER: '%'+value.replace(/[\s_]/g,"")+'%'}, language: language}, 87 onsuccess: function(data) { 88 89 document.querySelector('.main-container').innerHTML = data; 90 BX('search').value = value; 91 } 92 }); 93 } 94}
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.