1var Coria = Coria || {}; 2 3if (!Coria.WaitForjQuery) { 4 Coria.WaitForjQueryCounter = 0; 5 Coria.WaitForjQuery = function (callback) { 6 if (window.jQuery) { 7 callback(); 8 } else if (Coria.WaitForjQueryCounter++ > 50) { 9 console.error("Coria.WaitForjQuery: jQuery not present."); 10 } else { 11 setTimeout(Coria.WaitForjQuery, 250, callback); 12 } 13 }; 14} 15 16Coria.ContentTile = { 17 18 openCTALink: function (isNewWindow, linkUrl) { 19 if (isNewWindow) 20 window.open(linkUrl); 21 else 22 location.href = linkUrl; 23 }, 24 25 /* 26 initClickHandlers: function () { 27 Coria.WaitForjQuery(function () { 28 jQuery(document).ready(function () { 29 // clicking on tile 30 jQuery('.content-tile').off('click').on('click', Coria.ContentTile.clickHandler); 31 }); 32 }); 33 }, 34 35 clickHandler: function (event) { 36 event.preventDefault(); 37 if (event.target.tagName == 'BUTTON') return; // don't process button clicks here 38 39 var wasActive = jQuery(this).hasClass('active'); 40 41 // deactivate all "sibling" tiles 42 jQuery(this).closest('div.row').find('div.content-tile.clickable').removeClass('active'); 43 // set the active state for the current tile if it wasn't set before 44 if (!wasActive) jQuery(this).addClass('active'); 45 46 var linkElement = jQuery(this).find('.content-tile-link'); 47 if (linkElement) { 48 var clickActionName = jQuery(linkElement).data('clickActionName'); 49 if (clickActionName) { 50 if (clickActionName == 'Navigate to CTA link') { 51 var linkUrl = jQuery(linkElement).data('clickActionValue'); 52 var isClickable = jQuery(linkElement).data('clickableContentTile'); 53 if (linkUrl && isClickable) { 54 Coria.ContentTile.triggerGoals(jQuery(linkElement).data('goalsIdsToTrigger')) 55 var isNewWindow = jQuery(linkElement).data('openInNewWindow'); 56 Coria.ContentTile.openCTALink(isNewWindow, linkUrl); 57 } 58 } 59 } 60 } 61 }, 62 */ 63 64 triggerGoals: function (goalsArr) { 65 if (goalsArr && goalsArr.length) { 66 return jQuery.ajax({ 67 type: 'POST', 68 url: "/customapi/Analytics/TriggerGoals", 69 data: { goalIds: goalsArr }, 70 error: function (responseData, textStatus, errorThrown) { 71 console.log(errorThrown); 72 } 73 }); 74 } 75 } 76}; 77 78//Coria.ContentTile.initClickHandlers();
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.