1/* 2 * This script is for Analytics event tracking. 3 * The below function is used for triggering on click event for Global Title Component. 4 */ 5 6$(document) 7 .ready( 8 function() { 9 $('.title-comp a') 10 .off('click.titleDTMClick') 11 .on( 12 'click.titleDTMClick', 13 function() { 14 var value = $.trim($(this).text()), id = $( 15 this).attr('id') ? $(this) 16 .attr('id') : '', linkUrl = $( 17 this).attr('href'), $sectionElement = $( 18 this).closest('section'), pageSection = '', pageTitle = ''; 19 20 if ($(this).closest( 21 '.productcomp-single-shelf').length) { 22 $sectionElement = $(this) 23 .closest( 24 '.productcomp-single-shelf'); 25 } else if ($(this).closest( 26 '.productcomp-multiple-shelf').length) { 27 $sectionElement = $(this) 28 .closest( 29 '.productcomp-multiple-shelf'); 30 } 31 32 pageTitle = $.trim($sectionElement.find( 33 '.title-comp, .text-comp') 34 .eq(0).text()); 35 pageTitle = pageTitle !== '' ? ' - ' 36 + pageTitle : pageTitle; 37 pageSection = $(this).closest( 38 '[data-shelf-name]').attr( 39 'data-shelf-name') 40 + pageTitle; 41 try { 42 globalUtil.triggerDtmScript('link', 43 'Title Link', value, 44 pageSection, id, linkUrl); 45 } catch (e) { 46 47 } 48 }); 49 }); 50$(document).ready(function () { 51 $(".hero_colors").each(function (index) { 52 $(this).attr('data-content', $(this).text()); 53 }) 54 55 document.fonts.ready.then(function() { 56 var titleLineHeight = '', height = '', updatedDom = '', isNoWrap = false; 57 $(".hero_colors").each(function (index) { 58 if ((($(this).attr('data-content').includes("-")) === true) && ($(window).width() < 400)) { 59 isNoWrap = true; 60 $(this).css("white-space", "nowrap"); 61 } 62 titleLineHeight = $(this).css("line-height"); 63 height = $(this).height(); 64 updatedDom = ''; 65 wordBreakText = " "; 66 lineBreakArray = []; 67 lineHeight = parseInt(titleLineHeight); 68 69 if ((height-4) > lineHeight) { 70 $(this).html("");// empty 71 var initialArray = $(this).attr('data-content').trim().split(/[" "]/); 72 lineBreakArray = initialArray.reduce((acc, i) => i ? [...acc, i] : acc, []); 73 var selectedWordClass = this.className; 74 if (lineBreakArray.length > 1) { 75 updatedDom = ' <span class = "' + selectedWordClass + '"> <em>'+lineBreakArray[0] + wordBreakText+' </em> </span><span class = "' + selectedWordClass +'"> <em>'+lineBreakArray[1]+ ' </em></span>'; 76 $(this).html(updatedDom); 77 } 78 } else { 79 $(this).html("");// empty 80 lineBreakArray = $(this).attr('data-content'); 81 var selectedWordClass = this.className; 82 updatedDom = ' <span class = "' + selectedWordClass + '"> <em>'+lineBreakArray +' </em> </span>'; 83 $(this).html(updatedDom); 84 } 85 $('.herobanner .title-wrapper .hero_colors em').each(function() { 86 var value =''; 87 value = $(this).text().trim(); 88 $(this).html(value); 89 }) 90 if (isNoWrap) { 91 isNoWrap = false; 92 $(this).css("white-space", ""); 93 } 94 }); 95 }).catch(function(error) { 96 console.log('font loading failed', error); 97 }); 98}); 99 100$(document).ready(function () { 101 $(".highlight_colors").each(function (index) { 102 $(this).attr('data-content', $(this).text()); 103 }) 104 105 document.fonts.ready.then(function() { 106 var titleLineHeight = '', height = '', updatedDom = '', isNoWrap = false; 107 $(".highlight_colors").each(function (index) { 108 if ((($(this).attr('data-content').includes("-")) === true) && ($(window).width() < 400)) { 109 isNoWrap = true; 110 $(this).css("white-space", "nowrap"); 111 } 112 titleLineHeight = $(this).css("line-height"); 113 height = $(this).height(); 114 updatedDom = ''; 115 wordBreakText = " "; 116 lineBreakArray = []; 117 lineHeight = parseInt(titleLineHeight); 118 119 if ((height-4) > lineHeight) { 120 $(this).html("");// empty 121 var initialArray = $(this).attr('data-content').trim().split(/[" "]/); 122 lineBreakArray = initialArray.reduce((acc, i) => i ? [...acc, i] : acc, []); 123 var selectedWordClass = this.className; 124 if (lineBreakArray.length > 1) { 125 updatedDom = ' <span class = "' + selectedWordClass + '"> <em>'+lineBreakArray[0] + wordBreakText+' </em> </span><span class = "' + selectedWordClass +'"> <em>'+lineBreakArray[1]+ ' </em></span>'; 126 $(this).html(updatedDom); 127 } 128 } else { 129 $(this).html("");// empty 130 lineBreakArray = $(this).attr('data-content'); 131 var selectedWordClass = this.className; 132 updatedDom = ' <span class = "' + selectedWordClass + '"> <em>'+lineBreakArray +' </em> </span>'; 133 $(this).html(updatedDom); 134 } 135 $('.herobanner .title-wrapper .highlight_colors em').each(function(){ 136 var value =''; 137 value = $(this).text().trim(); 138 $(this).html(value); 139 }) 140 if (isNoWrap) { 141 isNoWrap = false;
142 $(this).css("white-space", ""); 143 } 144 }); 145 }).catch(function(error) { 146 console.log('font loading failed', error); 147 }); 148 149 150 //to override the functionlity 151 $(".title-comp.title_highlight").each(function (index) { 152 $(this).find(".hero_colors").removeAttr('data-content'); 153 $(this).find(".hero_colors").contents().unwrap(); 154 $(this).find(".hero_colors").removeClass(); 155 }); 156 157 $(".title-comp.title_underline").each(function (index) { 158 $(this).find(".highlight_colors").removeAttr('data-content'); 159 $(this).find(".highlight_colors").contents().unwrap(); 160 $(this).find(".highlight_colors").removeClass(); 161 }); 162})
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.