-
-
Save Shoora/3d38697b430278f584958d4417a9c76c to your computer and use it in GitHub Desktop.
Not null implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var onloadCallback = function() { | |
grecaptcha.render("g-recaptcha", { | |
sitekey: "6Le2hsIUAAAAAGb1mcRlZ-W1Tdc0atbw002G5UUL", | |
theme: "light", | |
callback: "checkReCapture", | |
"expired-callback": "expiredReCapture" | |
}) | |
}; | |
function checkReCapture() { | |
return "" != grecaptcha.getResponse() ? ($("#recaptchaError").text(""), | |
$('[name="recapture-response"]').attr("checked", "checked"), | |
!0) : ($("#shadow-popup").css("display", "none"), | |
$('[name="recapture-response"]').removeAttr("checked"), | |
$("#recaptchaError").text("Необходимо пройти проверку на то что Вы не являетесь роботом"), | |
!1) | |
} | |
function expiredReCapture() { | |
$('[name="recapture-response"]').removeAttr("checked") | |
} | |
!function() { | |
$(":input").inputmask(); | |
for (var e = document.getElementsByClassName("js-form"), t = 0; t < e.length; t++) | |
e[t].onsubmit = function(e) { | |
showNotice(e); | |
for (var t = this.elements, a = { | |
fields: [], | |
utm: { | |
campaign: "", | |
content: "", | |
medium: "", | |
sourse: "", | |
term: "", | |
keyword: "" | |
} | |
}, r = 0; r < t.length; r++) { | |
var n = t[r].type; | |
t[r].name; | |
"checkbox" !== n && "submit" !== n && "button" !== n && "file" !== n && a.fields.push({ | |
name: t[r].name, | |
value: t[r].value | |
}) | |
} | |
var c = document.location | |
, s = c.origin | |
, o = c.pathname | |
, i = c.search; | |
if (a.site = s, | |
a.url = o, | |
0 !== i.length) | |
for (var u = (i = i.substr(1, i.length)).split("&"), p = 0; p < u.length; p++) { | |
var h = u[p].split("=") | |
, l = h[0].split("_")[1]; | |
a.utm[l] = h[1] | |
} | |
var d = new XMLHttpRequest; | |
d.withCredentials = !0, | |
d.open("POST", "http://84.201.174.225:9696/save", !0), | |
d.setRequestHeader("Content-type", "application/json; charset=utf-8"), | |
d.send(JSON.stringify(a)), | |
d.onreadystatechange = function() { | |
4 === this.readyState && 200 === this.statusCode && yaCounter42716749.reachGoal(this.querySelector("[data-uid]").getAttribute("data-uid")) | |
} | |
} | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment