1var API_URI = "/modules/home-module"; 2$(document).ready(function () { 3 new Vue({ 4 el: '#landing-page', 5 data: { 6 location: window.location, 7 searchQuery: null, 8 searchQueryToLower: null, 9 filteredData: [], 10 showSearchResults: false, 11 resources: [], 12 apiCounter: 0 13 }, 14 beforeMount: function () { 15 $('#loader').show(); 16 $('#piecesLoader').show(); 17 //document.getElementById('bebd7580-30a2-4ba6-9c36-1687d292d5da').style.pointerEvents = 'none'; 18 19 }, 20 21 mounted: function () { 22 var _self = this; 23 setTimeout(function () { 24 if(_self.apiCounter<4) 25 { 26 $('#loader').hide(); 27 $('#piecesLoader').hide(); 28 _self.loadPiecesData(); 29 _self.apiCounter++ 30 } 31 32 }, 1000); 33 }, 34 35 methods: { 36 37 loadPiecesData: function () { 38 var _self = this; 39 $('#piecesLoader').show(); 40 $.ajax({ 41 url: API_URI + "/getPiecesData", 42 type: 'get', 43 async: true, 44 success: function (response) { 45 $('#piecesLoader').hide(); 46 _self.resources = response.data.searchData; 47 // document.getElementById('bebd7580-30a2-4ba6-9c36-1687d292d5da').style.pointerEvents = 'apply'; 48 }, 49 error: function (err) { 50 $('#piecesLoader').hide(); 51 // document.getElementById('bebd7580-30a2-4ba6-9c36-1687d292d5da').style.pointerEvents = 'apply'; 52 //console.log(err) 53 }, 54 }) 55 }, 56 57 navigatePage: function (route) { 58 if(route === '/users/login' || route === '/make-referral'|| route === '/resources'){ 59 var iFrameDetection = (window === window.parent) ? false : true; 60 if(iFrameDetection){ 61 window.open(this.location.origin + route, '_blank'); 62 return false; 63 } 64 } 65 this.location.href = this.location.origin + route; 66 }, 67 68 themeChangerInit: function (e) { 69 var $node = e.target; 70 theme = $node.getAttribute('data-theme'); 71 $('.theme-wrapper').removeClass('net default small large').addClass('net ' + theme).addClass('body-bg'); 72 }, 73 filterPieces: function () { 74 this.searchQueryToLower = this.searchQuery.toLowerCase(); 75 if (this.searchQueryToLower) { 76 this.filteredData = []; 77 this.showSearchResults = true; 78 let self = this; 79 return self.resources.filter(function (item) { 80 // TODO: add description and other content after CMS 81 if (!!~item.title.toLowerCase().indexOf(self.searchQueryToLower)) { 82 self.filteredData.push(item); 83 } 84 return self.filteredData 85 }) 86 } else { 87 this.showSearchResults = false; 88 return this.filteredData = []; 89 } 90 }, 91 } 92 93 }) 94 95})
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.