1//ENVIRONMENT VARIABLES 2//var evo_endpoint = document.location.hostname.endsWith("yourmoney.com") === true ? "ev.yourmoney.com" : "aem.uat.evolok.net"; 3//var brand_var = "YourMoney"; 4 5if (document.location.hostname.endsWith("yourmoney.com") === true) { 6 // Your Money 7 var evo_endpoint = "ev.yourmoney.com"; 8 var brand_var = "YourMoney"; 9} else if (document.location.hostname.endsWith("yourmortgage.co.uk") === true) { 10 // Your Mortgage 11 var evo_endpoint = "ev.yourmortgage.co.uk"; 12 var brand_var = "YourMortgage"; 13} else if (document.location.hostname == "mortgagesolutions.co.uk" || document.location.hostname == "www.mortgagesolutions.co.uk") { 14 // Mortgage Solutions 15 var evo_endpoint = "ev.mortgagesolutions.co.uk"; 16 var brand_var = "MortgageSolutions"; 17} else { 18 var evo_endpoint = "aem.uat.evolok.net"; 19 var brand_var = "YourMoney"; 20} 21 22//METERING INITIALISATION 23EV.Em.init({ 24 url: "https://" + evo_endpoint + "/acd/api/3.0", 25 sidCookieDomain: document.location.hostname.replace("www.", ""), 26 brand: brand_var, 27 icDomain: evo_endpoint + '/ic/api', 28 serviceName: 'myaccount', 29 getUserData: true 30}); 31 32//METERING CALL 33let evResponse; 34if ( typeof evParams !== 'undefined' ) { 35 EV.Em.authorize(evParams, handleMeteringSuccess, handleMeteringError) 36 function handleMeteringSuccess(response) { 37 console.log(response); 38 evResponse = response; 39 let articleParagraphs = document.querySelectorAll('.intro_content > p'); 40 41 let isLoggedIn = response.segments && response.segments.includes('Logged-In'); 42 window.dataLayer = window.dataLayer || []; 43 window.dataLayer.push({event: 'metering_response', login_status: isLoggedIn ? 'logged_in' : 'logged_out'}); 44 45 if (response.result == "ALLOW_ACCESS") { 46 let notifierParagraphs = 3; 47 if ( articleParagraphs.length > notifierParagraphs ) { 48 let evNotifier = document.createElement('div'); 49 evNotifier.setAttribute("id", "evNotifier"); 50 articleParagraphs[(notifierParagraphs - 1)].parentNode.insertBefore(evNotifier, articleParagraphs[(notifierParagraphs - 1)].nextSibling); 51 } 52 console.log("ALLOW_ACCESS"); 53 } else { 54 // Cleaned up: Removed the pageID checks and the 'hard-block' logic completely. 55 // All blocked users will now get the standard 3-paragraph preview. 56 let wallParagraphs = 3; 57 if ( articleParagraphs.length > wallParagraphs ) { 58 for (let i = articleParagraphs.length - 1; i > (wallParagraphs - 1); i--) { 59 articleParagraphs[i].remove(); 60 } 61 let evWall = document.createElement('div'); 62 evWall.setAttribute("id", "evWall"); 63 articleParagraphs[(wallParagraphs - 1)].parentNode.insertBefore(evWall, articleParagraphs[(wallParagraphs - 1)].nextSibling); 64 } 65 66 if (response.requireEntitlement) { 67 console.log("REQUIRE_LOGIN_WITH_ENTITLEMENT"); 68 } else { 69 if (response.result == "REQUIRE_LOGIN") { 70 console.log("REQUIRE_LOGIN"); 71 } else { 72 console.log("REQUIRE_ENTITLEMENT"); 73 } 74 } 75 } 76 } 77} 78 79function handleMeteringError(error) { 80 console.log(error); 81} 82 83EV.Em.on(EV.Em.Event.PAYWALL_RENDER_READY, function (event) { 84 if ( event.detail !== undefined && event.detail.modal !== true && document.getElementById('evWall') !== null ) { 85 document.getElementById('evWall').innerHTML = event.detail.content; 86 if ( document.querySelector('ev-engagement:not([group-name])') !== null ) { 87 document.querySelector('ev-engagement:not([group-name])').style.display='none'; 88 for (var t = document.querySelectorAll("#evWall script[data-ev-engagement]"), n = 0; n < t.length; n++) { 89 var o = t[n], r = document.createElement("script"); 90 r.innerHTML = o.text, 91 document.body.appendChild(r) 92 } 93 } 94 } 95}); 96 97EV.Em.on(EV.Em.Event.NOTIFIER_RENDER_READY, function (event) { 98 if ( event.detail !== undefined && event.detail.modal !== true && document.getElementById('evNotifier') !== null ) { 99 document.getElementById('evNotifier').style.marginBottom="20px"; 100 document.getElementById('evNotifier').innerHTML = event.detail.content; 101 } 102});
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.