var nmxip = "", nmxproxy = "", nmxuser = ""; if(document.location.href.toLowerCase().indexOf("http") > -1 && document.location.href.toLowerCase().indexOf("nutranet") > -1 ){ /* if nutranet, then get user info from server */ jQuery("head").append(''); /* set in .biz cookie */ window.setTimeout(function(){ if (nmxip != undefined && nmxip != "undefined"){ /* set server side cookies */ jQuery("head").append(''); //console.log("set server cookie"); window.setTimeout(function(){ AddUserInfoToRaygun(); },1000); } },2000); } else { /* if NOT nutranet, then get user info from cookie */ /* read server side cookies only */ jQuery("head").append(''); console.log("read server cookie"); window.setTimeout(function(){ AddUserInfoToRaygun(); //Raygun.send("Awesome Error!", ""); //console.log("Awesome Error!"); },1000); } // if (document.cookie.indexOf("test_view") > -1 || jQuery("testmode").length || location.search.indexOf("test") >-1 || location.hostname.indexOf("stg") >-1){ // jQuery("head").append(''); // jQuery("head").append(''); // //(function(){var s = document.createElement('script'),e = ! document.body ? document.querySelector('head') : document.body;s.src = 'https://acsbap.com/apps/app/assets/js/acsb.js';s.async = s.defer = true;s.onload = function(){acsbJS.init({statementLink : '',feedbackLink : '',footerHtml : '',hideMobile : false,hideTrigger : false,language : 'en',position : 'right',leadColor : '#146FF8',triggerColor : '#146FF8',triggerRadius : '50%',triggerPositionX : 'right',triggerPositionY : 'bottom',triggerIcon : 'default',triggerSize : 'medium',triggerOffsetX : 20,triggerOffsetY : 20,mobile : {triggerSize : 'small',triggerPositionX : 'right',triggerPositionY : 'center',triggerOffsetX : 0,triggerOffsetY : 0,triggerRadius : '50%'}});};e.appendChild(s);}()); // } function AddUserInfoToRaygun(){ return; console.log("adding user info if available"); if (nmxip !== undefined && nmxip != "undefined" && nmxip != ""){ rg4js('withCustomData', {"nmxip": nmxip, "nmxproxy": nmxproxy, "nmxuser": nmxuser}); } if (nmxuser !== undefined && nmxuser != "undefined" && nmxuser != ""){ rg4js('withTags', ['nmxuser']); if (nmxuser.includes("backus") || nmxuser.includes("cadams") || nmxuser.includes("kgaulden") || nmxuser.includes("dchekol") || nmxuser.includes("afischer") || nmxuser.includes("twilliams") ){ rg4js('withTags', ['nmxuser','developer']); } if (nmxuser.includes("henderson") ){ rg4js('withTags', ['nmxuser','henderson']); } // rg4js('setUser', { // fullName: nmxuser.replace("nmxuser_","") // }); rg4js('setUser', { identifier: nmxuser.replace("nmxuser_",""), email: nmxuser.replace("nmxuser_","")+"@nutramaxlabs.com" }); // fullName, firstName, uuid //console.log(nmxuser.replace("nmxuser_","")+"@nutramaxlabs.com"); console.log("added user info to raygun"); } else { console.log("not available"); } // rg4js('setUser', { // identifier: 'user_email_address@localhost.local', // isAnonymous: false, // email: 'emailaddress@localhost.local', // fullName: 'Foo Bar', // firstName: 'Foo', // uuid: 'BAE62917-ACE8-ab3D-9287-B6A33B8E8C55' // }); } window.setTimeout(function(){ //console.log("Checking for mixed content"); CheckForMixedContent(); caEmail(); },2000); function CheckForMixedContent(){ return; if(document.location.href.toLowerCase().indexOf("https:") > -1){ jQuery("[action]").each(function(){ if(jQuery(this).attr("action").toLowerCase().indexOf("http:") > -1){ //console.log("Mixed content: "+jQuery(this).attr("action")); jQuery("body").attr("nmx_pg_has_mixed_content","true"); Raygun.send("Mixed content warning on "+location.hostname+". (action="+jQuery(this).attr("action")+")", ""); //jQuery(this).attr("src",jQuery(this).attr("action").replace("http://","https://")); } }); jQuery("[src]").each(function(){ if(jQuery(this).attr("src").toLowerCase().indexOf("http:") > -1 && jQuery(this).attr("rel") != "alternative"){ //console.log("Mixed content: "+jQuery(this).attr("src")); jQuery("body").attr("nmx_pg_has_mixed_content","true"); Raygun.send("Mixed content warning on "+location.hostname+". (src="+jQuery(this).attr("src")+") ", ""); //jQuery(this).attr("src",jQuery(this).attr("src").replace("http://","https://")); } }); jQuery("iframe[href],link[href]").each(function(){ if(jQuery(this).attr("href").toLowerCase().indexOf("http:") > -1 && jQuery(this).attr("href").toLowerCase().indexOf("schema.org") == -1 && jQuery(this).attr("href").toLowerCase().indexOf("gmpm.org") == -1 ){ //console.log("Mixed content: "+jQuery(this).attr("href")); jQuery("body").attr("nmx_pg_has_mixed_content","true"); Raygun.send("Mixed content warning on "+location.hostname+". (href="+jQuery(this).attr("href")+")", ""); //jQuery(this).attr("href",jQuery(this).attr("href").replace("http://","https://")); } }); if(jQuery("body[nmx_pg_has_mixed_content]").length){ //console.log("Mixed content warnings"); //Raygun.send("Mixed content warning", ""); } } } function caEmail (){ return; if ((document.documentElement.textContent || document.documentElement.innerText).indexOf('cadams@nutramaxlabs.com') > -1) { try { console.log("%c cadams_found_on_" + window.location.hostname, 'background: #222; color: #bada55'); throw new Error("cadams_found_on_" + window.location.hostname); } catch (e) { Raygun.send(e); } } } function getTestCookie(c_name) { var cookie = document.cookie.replace(/; /g, ";") + ";"; var cookie = document.cookie; if (cookie.length > 0) { c_start = cookie.indexOf(c_name + "="); if (c_start != -1) { c_start = c_start + c_name.length + 1; c_end = cookie.indexOf(";", c_start); if (c_end == -1) c_end = cookie.length; return unescape(cookie.substring(c_start, c_end)); } } return ""; } //if (getTestCookie("test_view") == "1"){ if (location.hostname.indexOf("xstg.") > -1){ jQuery("body").prepend('Tester Feedback'); var BugHerdConfig = {"feedback":{"hide":true}}; (function (d, t) { var bh = d.createElement(t), s = d.getElementsByTagName(t)[0]; bh.type = 'text/javascript'; bh.src = 'https://www.bugherd.com/sidebarv2.js?apikey=6nq3vohnmsd1m42avo969q'; s.parentNode.insertBefore(bh, s); })(document, 'script'); } //}