1var PC = PC || {}; 2 3 4PC.SearchPage = function () { 5 var self = this; 6 self.searchErrorID = "#searchError"; 7 self.SearchTitle = ""; 8 self.NoResultsID = "#noResults"; 9 self.FlexiableSearchID = "#flexibleSearch"; 10 self.MapShown = false; 11 12 13 self.showError = function () { 14 $(self.SearchErrorID).show() 15 } 16 17 /** 18 * @description update the number of cottages count 19 */ 20 self.UpdateCount = function (cottagesArray) { 21 var count = `${cottagesArray.length} ${self.SearchTitle}`; 22 23 if (PC.Search.SearchCriteria.GetSearchCriteria().dateFrom !== '') { 24 count = count + " are available"; 25 } else { 26 count = count + " match your search"; 27 }; 28 29 if (count == 0) { 30 $(self.NoResultsID).show(); 31 } else { 32 $(self.NoResultsID).hide(); 33 } 34 35 $('.left.result-count').html(count); 36 }; 37 38 /** 39 * @description Search Text 40 */ 41 self.ShowSearch = function (cottagesArray) { 42 43 var loading = ''; 44 45 $('.left.result-count').html(loading); 46 $(self.FlexiableSearchID).hide(); 47 }; 48 49 50 /** 51 * @description catch the map toggle event 52 */ 53 self.MapToggle = function (isShown) { 54 self.MapShown = isShown; 55 }; 56 57 58 self.Initialise = function (searchTitle, 59 searchErrorID, 60 noResultsID, 61 flexiableSearchID, 62 mapShown 63 ) { 64 self.searchErrorID = searchErrorID; 65 self.SearchTitle = searchTitle; 66 self.NoResultsID = noResultsID; 67 self.FlexiableSearchID = flexiableSearchID; 68 self.MapShown = mapShown; 69 70 71 if (PC.Events !== 'undefined') { 72 self.ShowSearch(); 73 74 PC.Events.Subscribe('mapToggle', self.MapToggle); 75 PC.Events.Subscribe('searchClick', self.ShowSearch); 76 PC.Events.Subscribe('searchError', self.ShowError); 77 PC.Events.Subscribe('cottagesFiltered', self.UpdateCount); 78 PC.Events.Subscribe('cgCarousel', self.cg_carousel); //2021 Q1 Subscribe new multicottage carousel on map 79 80 81 }; 82 }; 83 84 return { 85 Initialise: self.Initialise 86 } 87};
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.