//console.log("%cEmail Signup Form Detection Script", "color:#888; font-weight:normal;");
var email_detect_is_live = true;
// cookie functions
function setTestCookie(c_name, value, expiredays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + expiredays);
document.cookie = c_name + "=" + escape(value) +
((expiredays == null) ? "" : ";expires=" + exdate.toUTCString()) + "; path=/";
}
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 (location.search.indexOf("?test")>-1){ setTestCookie("test_view", 1, 1); }
// if (getTestCookie("test_view") != ""){
// console.clear();
// if (location.search.indexOf("?notest")>-1){
// setTestCookie("test_view", 1, -1);
// console.log("%cPRODUCTION", "font-family: Arial Black; font-weight: normal; font-size: 32px; color: red; -webkit-text-fill-color: red; -webkit-text-stroke-width: 1px; -webkit-text-stroke-color: black;");
// //console.log("%cUse: ?test to return to test mode", "color:#888; font-size: 21px; font-weight:normal;");
// console.log("%cYou will not see this message again while in Production!", "color:#333; font-size: 16px; font-weight:normal;");
// } else{
// console.log("%cTEST MODE", "font-family: Arial Black; font-weight: normal; font-size: 32px; color: #09ad52; -webkit-text-fill-color: #09ad52; -webkit-text-stroke-width: 1px; -webkit-text-stroke-color: black;");
// console.log("%cUse: ?notest to leave test mode", "color:#000; font-size: 18px; font-weight:normal;");
// }
// }
//console.log("Language: "+navigator.language);
//window.onerror = function (msg) {
//Raven.captureException(""+msg);
//Raven.showReportDialog();
//return false;
//};
if (getTestCookie("test_view") != "" || email_detect_is_live){
// if (email_detect_is_live){
// console.log("%cEmail Signup Form Detection is Live", "color:#333; font-weight:normal;");
// }
if(!jQuery("script[src*='nmx.filter']").length){
// jQuery("form input[type='email'], form input.email, form input[id*='email'], form input[name*='email'], form input[class*='email'], form #Email").each(function(){
// console.log("potential email field");
// if (jQuery(this).closest("form").filter("[id*='opt'], [name*='opt'], [class*='opt'], [id*='subsc'], [name*='subsc'], [class*='subsc'], [id*='mail'], [name*='mail'], [class*='mail']").length){
// if (!jQuery(this).closest("form").filter("[id*='reg'], [name*='reg'], [class*='reg'], [id*='ogin'], [name*='ogin'], [class*='ogin'], [id*='roll'], [name*='roll'], [class*='roll']").length){
// jQuery(this).closest("form").addClass("detected-signup-form");
// jQuery(this).addClass("detected-signup-form-field");
// } else{
// jQuery(this).addClass("detected-NON-signup-form-field").addClass("signup-form-excluded");
// }
// } else{
// jQuery(this).addClass("detected-NON-signup-form-field");
// }
// });
// if(jQuery("form.detected-signup-form").length){
// } else {
// console.log("%cNo mailinglist forms detected", "color:#888; font-weight:normal;");
// }
if (getTestCookie("test_view")){
console.log("%cEmail Signup Form Detection Test Mode", "color:#333; font-weight:normal;");
//console.log("%cDetected mailinglist form", "color:#333; font-weight:normal;");
jQuery("head").append('');
} else{
console.log("%cEmail Signup Form Detection is Live", "color:#333; font-weight:normal;");
//console.log("%cDetected mailinglist form", "color:#333; font-weight:normal;");
jQuery("head").append('');
}
}
} else {
//console.log("%cEmail Signup Form Filter Integration (NOT IN PRODUCTION)", "color:#000; font-weight:normal;");
}