1/* global */ 2var bannerCode; 3/*check test*/ 4 var grpHead = document.getElementsByTagName("head"); 5 var grpScript = document.createElement("script"); 6 grpScript.type = "text/javascript"; 7 8 if(typeof grpRemoteDomain=='undefined') { //if we're not on an remote domain, consume JS relative to root. 9 var settings_url = "/grp_settings.js2"; 10 } else { 11 var settings_url = grpRemoteDomain+'/grp_settings.js2'; 12 } 13 grpScript.src = settings_url; 14 grpHead[0].appendChild(grpScript); 15 16 17function grp_inject(data){ 18 var grpData = data; 19 20 var grpEnabled = grpData.enabledMay2019; 21 var grpCampaign = grpData.campaignMay2019; 22 var grpBannerSize = grpData.banner_size; 23 var grpPopUp = grpData.popup; 24 var grpAltText = grpData.alttext; 25 var grpAltUrl = grpData.alturl; 26 var grpAltCode = grpData.altcode; 27 var grpFiNumber = grpData.di_number; 28 //use grpTPW with webcenter sites, since they have bootstrap. Make sure there is no conflicting JS in site content. 29 var grpTPW = grpData.tpw; 30 31 //no sweetstakes from May 13 32 grpCampaign = 0; 33 34/* 35 * This is a flag to change campaign types. Possible values: "hp", "ttob". This is used in a control flow statement that appends the url to the banner farther down. 36 */ 37 38 var grpCampaignType = "hp"; 39 //var grpCampaignType = "ttob"; 40 41 // flag to enable/disable all current campaigns 42 //set to false post tax marketing takedown on 04/16/2019 43 grpCampaignActive = false; 44 45/* 46 * Using lpURL to denote split domain URLs (separate web and IB domains). This means a landing page is off of /mstinc. 47 */ 48 if (typeof(grpData.ibDomain) !== undefined) { 49 var grpIBDomain = grpData.ibDomain; 50 } 51 52 /* ************************************************************************************************************************************************************************************* 53 * Begin default settings for the campaigns 54 /* *************************************************************************************************************************************************************************************/ 55 56 57 if (grpBannerSize != "square" && grpBannerSize != "rectangle" && grpBannerSize != "text") { 58 return; 59 } 60 61 // blacklist Standard signon pages 62// if (top.document.location.href.indexOf('Signon.cgi') != -1) { 63// return; 64// } 65 66 if (!$ || !$.fn.jquery ) { 67 //if ( typeof console != 'undefined' && typeof console.log != 'undefined') console.log("Global JS: Mobile Alert - Aborting because jQuery does not exist"); 68 return; 69 } 70 var jQuery_version = $.fn.jquery.split("."); 71 if ( jQuery_version.length < 2 ) { 72 /*if ( typeof console != 'undefined' && typeof console.log != 'undefined') console.log("Global JS: Mobile Alert - Aborting because jQuery version number "+ 73 "does not contain minor and major version numbers");*/ 74 return; 75 } 76 var jQuery_majorVersion = parseInt( jQuery_version[0]); 77 var jQuery_minorVersion = parseInt( jQuery_version[1]); 78 if ( jQuery_majorVersion < 1 || ( jQuery_majorVersion === 1 && jQuery_minorVersion <7 )) { 79 //if ( typeof console != 'undefined' && typeof console.log != 'undefined') console.log("Global JS: Mobile Alert - Aborting because jQuery version is not at least 1.7"); 80 return; 81 } 82 83 var grpDefaultAlt = ''; 84 switch(grpCampaign) 85 { 86 case 0: 87// campaign 0 featured campaign 88//trailing slash required for microsites due to weird server rule 89 //grpDefaultUrl = '/mstinc/grp/ulp/'; 90 grpDefaultUrl = '/mstinc/grp/ulpOB/'; 91 grpDefaultAlt = 'Make the smart choice and enroll in online banking'; 92 grpDefaultTitle = ''; 93 grpDefaultText = 'Make the smart choice and enroll in online banking'; 94 break; 95 case 1: 96// campaign 1 featured campaign 97 grpDefaultUrl = 'javascript:void(0)'; 98 grpDefaultAlt = ''; 99 grpDefaultTitle = ''; 100 grpDefaultText = ''; 101 break; 102 case 2: 103 // campaign 2 featured (LFR) 104 grpDefaultUrl = 'javascript:void(0)'; 105 grpDefaultAlt = ''; 106 grpDefaultTitle = ''; 107 grpDefaultText = ''; 108 break; 109 case 3: 110// used for grp 111 grpDefaultUrl = 'javascript:void(0)'; 112 grpDefaultAlt = ''; 113 grpDefaultTitle = ''; 114 grpDefaultText = ''; 115 break; 116 case 4: 117// month 2 sweeps ttob 118 grpDefaultUrl = 'javascript:void(0)'; 119 grpDefaultAlt = ' '; 120 grpDefaultTitle = ''; 121 grpDefaultText = ''; 122 break; 123 default: 124 grpDefaultUrl = 'javascript:void(0)'; 125 grpDefaultAlt = ''; 126 grpDefaultTitle = ''; 127 grpDefaultText = ''; 128 } 129 /* ************************************************************************************************************************************************************************************* 130 * End default settings for the campaigns
131 /* *************************************************************************************************************************************************************************************/ 132 133 if(grpAltUrl != "" && grpAltUrl != null) { grpDefaultUrl = grpAltUrl } 134 if(grpPopUp != "y") { grpPopUp = '_self' } else { grpPopUp = '_blank' } 135 136 if(typeof grpRemoteDomain != 'undefined') { // also testing if we're on a remote domain. 137 grpImagePath = grpRemoteDomain+'/mstinc/grp/images/' 138 } else { 139 grpImagePath = '/mstinc/grp/images/'; 140 } 141 142 if(typeof grpBannerSizeOverride != 'undefined') { // possible values are 'square' and 'rectangle' 143 grpBannerSize = grpBannerSizeOverride; 144 } 145 146 147/* 148 * Check for ttob/hp. Hp campaigns need the correct domain. (could be tied to a split domain) 149 * grpDefaultUrl is usually equal to /mstinc/grp/blah/ and must have trailing slash due to a bad rule config somewhere that we don't have control over 150 * grpTPW is a string digit where the digit is the message to show 151 */ 152 if(grpCampaignType == 'hp' && grpIBDomain !== undefined) { 153 grpDefaultUrl = grpIBDomain + grpDefaultUrl; 154 } 155 156 if(grpBannerSize == "square" || grpBannerSize == "rectangle") { 157 if(typeof grpTPW !== "undefined") 158 { 159 bannerCode = '<a href="'+ grpDefaultUrl +'" target="'+grpPopUp+'" onclick=\'return displayThirdPartyAlert(' + grpTPW + ',this);\'><img src="'+grpImagePath+'campaign_'+grpCampaign+'_'+grpBannerSize+'.gif" alt="'+grpDefaultAlt+'" /></a>'; 160 } 161 else 162 { 163 bannerCode = '<a href="'+ grpDefaultUrl +'" target="'+grpPopUp+'"><img src="'+grpImagePath+'campaign_'+grpCampaign+'_'+grpBannerSize+'.gif" alt="'+grpDefaultAlt+'" /></a>'; 164 } 165 } 166 else if (grpBannerSize=="text") { 167 if(typeof grpTPW !== "undefined") 168 { 169 bannerCode = '<h2>' + grpDefaultTitle + '</h2><li><a target="'+grpPopUp+'" onclick=\'return displayThirdPartyAlert(' + grpTPW + ',this);\' href="' + grpDefaultUrl + '">' + grpDefaultText + '</a></li>'; 170 } 171 else 172 { 173 bannerCode = '<h2>' + grpDefaultTitle + '</h2><li><a target="'+grpPopUp+'" href="' + grpDefaultUrl + '">' + grpDefaultText + '</a></li>'; 174 } 175 } 176 else { 177 return; 178 } 179 180 181 grpBannerSelector = '#grpBanner, .grpSquare, .grpRectangle'; 182 // FIX THIS LINE IN IE8 grpBannerSelector = '#grpBanner,.grp'+grpBannerSize.replace(grpBannerSize[0], grpBannerSize[0].toUpperCase()); 183 if(grpEnabled == 'custom' && grpAltCode != '' && grpCampaignActive) { 184 bannerCode = grpAltCode; 185 grpEnabled = 'yes'; 186 } 187 188 console.log("Banner check"); 189 console.log("Banner Code is: " + bannerCode); 190 191 var grpDiv = $('#grpBanner, .grpSquare, .grpRectangle, .grpText').length; 192 if(grpEnabled == 'yes' && grpCampaignActive) { 193 $(grpBannerSelector).html(bannerCode).show(); 194 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 195 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 196 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 197 })(window,document,'script','//www.google-analytics.com/analytics.js','_gaGRP'); 198 199 var gaCat = 'grp.' + grpCampaign; 200 201 _gaGRP('create', 'UA-43381625-2', {'cookieName':'_gaGRP'}); 202 _gaGRP('send', 'pageview'); 203 if (grpDiv != 0) { 204 _gaGRP('send', {'hitType': 'event', 'eventCategory': gaCat, 'eventAction': 'bannerShow', 'eventLabel':grpFiNumber}); 205 $('#grpBanner a, .grpSquare a, .grpRectangle a, .grpText a').on('click', function(){ 206 _gaGRP('send', {'hitType': 'event', 'eventCategory': gaCat, 'eventAction': 'bannerClick', 'eventLabel':grpFiNumber}); 207 }) 208 } 209 else { 210 _gaGRP('send', {'hitType': 'event', 'eventCategory': gaCat, 'eventAction': 'bannerFail', 'eventLabel':grpFiNumber}); 211 $('#grpBanner a, .grpSquare a, .grpRectangle a, .grpText a').on('click', function(){ 212 _gaGRP('send', {'hitType': 'event', 'eventCategory': gaCat, 'eventAction': 'bannerClickFail', 'eventLabel':grpFiNumber}); 213 }) 214 } 215 } 216 217 /* Pre-deployment (but post-scripting) check, disable after checking functionality */ 218 /*if(grpEnabled == 'yes' && !grpCampaignActive) { 219 testGRP(); 220 }*/ 221 222}//getGrgdata 223 224 225 226/* testing functions */ 227function testGRP() { 228 console.log("Testing GRP"); 229 console.log("Setting grpEnabled to 'yes'"); 230 console.log("Showing '#grpBanner'"); 231 grpEnabled = 'yes'; 232 $('#grpBanner').html(bannerCode); 233 $('#grpBanner').show(); 234 console.log("Test successful."); 235} 236 237//legacy function to avoid page errors. Does not do anything 238var grp = {show : function(site){} }
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.