1$(document).ready(function () { 2 3 jsSocials.shares.x = { 4 label: "X", 5 logo: "/css/tc/assets/icon-x.svg", 6 shareUrl: 7 "https://twitter.com/share?url={url}&text={text}&via={via}&hashtags={hashtags}", 8 countUrl: "", 9 getCount: function (data) { 10 return data.count; 11 } 12 } 13 14 $(".share-items").jsSocials({ 15 showLabel: false, 16 showCount: false, 17 shareIn: "popup", 18 shares: ["facebook", "x", "linkedin"], 19 on: { 20 click: function() { 21 if (window.GTM && window.GTM.push && window.GTM.createSocialShareHandler) { 22 window.GTM.push(window.GTM.createSocialShareHandler(this.share)); 23 } else if (window.dataLayer) { 24 window.dataLayer.push({ 25 event: 'select_content', 26 content_type: 'social_share', 27 content_id: this.share, 28 share_method: this.share, 29 link_url: window.location.href, 30 page_section: 'content', 31 page_type: document.body.getAttribute('data-page-type') || '', 32 page_title: document.title || '' 33 }); 34 } 35 } 36 } 37 }); 38}); 39 40// Location autocomplete widget 41$.widget("custom.loccomplete", $.ui.autocomplete, { 42 _create: function () { 43 this._super(); 44 this.widget().menu('option', 'items', '> :not(.ui-autocomplete-category):not(.ui-autocomplete-title)'); 45 }, 46 _renderMenu: function (ul, items) { 47 let that = this; 48 const searchedValue = $(this.element[0]).val(); 49 ul.append('<li class="ui-autocomplete-title">Search for "' + searchedValue + '"</li>'); 50 51 if (!items.filter(i => i && !jQuery.isEmptyObject(i)).length) { 52 ul.append('<li class="ui-autocomplete-no-records">No location found.</li>'); 53 54 return; 55 } 56 57 $.each(items, function (index, item) { 58 that._renderItemData(ul, item); 59 }); 60 }, 61 _renderItem: function (ul, item) { 62 const icon = '/assets/search_location.png'; 63 64 ul.append('<br>'); 65 ul.append('<li class="ui-autocomplete-category">City</li>'); 66 67 let dataValue = item.postCode ? item.postCode + ' ' + item.basicOverview : item.basicOverview; 68 let list_item = $('<li class="aria-label tc" data-value="' + dataValue + '" data-category="City">'); 69 70 return list_item 71 .append('<img src="' + icon + '" width="30" height="30">' + dataValue + ', <span class="location">' + item.countryCode + '</span>') 72 .appendTo(ul); 73 }, 74 _resizeMenu: function () { 75 const ul = this.menu.element; 76 ul.outerWidth(this.element.outerWidth()); 77 } 78});
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.