PageSourceSearch

https://dotkeeper.com/app/themes/dotkeeper/resources/scripts/contact-form-sv.js?ver=1.0.0

js dotkeeper.com collected 2026-10-04 08:46:12 UTC 4,498 bytes, 84 lines download raw bytes

1    (function() {
2        var phoneFields = document.querySelectorAll('input[name*=phone], input[name*=Phone]');
3        [].forEach.call(phoneFields, function(element) {
4            window.hasPhoneFields = true;
5            element.iti = window.intlTelInput(element, {
6                preferredCountries: [],
7                initialCountry: 'auto',
8                utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.1/js/utils.js',
9                geoIpLookup: function(success) {
10                    var xhr = new XMLHttpRequest();
11                    xhr.open('GET', 'https://power.upsales.com/api/external/whereAmI');
12                    xhr.onload = function() {
13                        success(xhr.status === 200 && !xhr.responseText?.includes("no-js") ?
14                            (JSON.parse(xhr.responseText).data || "") : "");
15                    };
16                    xhr.send();
17                }
18            });
19        });
20    })();
21
22    (function() {
23        var form = document.getElementById("up-form");
24        if (form) {
25            form.addEventListener("submit", function(ev) {
26                var button = ev.target.querySelector("button[type=submit]");
27                if (button) {
28                    button.disabled = true;
29                }
30            });
31        }
32    })();
33
34    function onSubmit(t) {
35        //var o, n, a = !0,
36          //  e = !0;
37        //void 0 !== window.__validEmail && (e = window.__validEmail, a = !1), "boolean" == typeof e && e && !a ?
38            validateForm(t, "https://dotkeeper.com/mottagen-forfragan/");/* : (t.preventDefault(), o = !0, n = setInterval(
39                function() {
40                    var e = window._bEmValid;
41                    void 0 === window.__validEmail && e || (o = window.__validEmail, a = !1), ("boolean" ==
42                        typeof o && o || !a) && (clearInterval(n), validateForm(t,
43                        "https://dotkeeper.com/mottagen-forfragan/"))
44                }, 300))*/
45    }
46
47    function validateForm(e, o) {
48        e.preventDefault();
49        for (var e = document.getElementsByName("formId")[0].value, e = document.forms["form_" + e], t = e
50                .querySelectorAll("input, textarea, select"), n = 0; n < t.length; n++) "text" === t[n].type && (t[n]
51            .value = t[n].value.trim());
52        var a = e.querySelectorAll("input[name*=phone], input[name*=Phone]");
53        if ([].forEach.call(a, function(e) {
54                e.iti && (e.value = e.iti.getNumber())
55            }), void 0 === window.grecaptcha || "" !== window.grecaptcha.getResponse()) {
56            for (var l = [], n = 0; n < t.length; n++) "checkbox" === t[n].type ? l.push(t[n].name + "=" +
57                encodeURIComponent(t[n].checked ? t[n].value : "off")) : l.push(t[n].name + "=" +
58                encodeURIComponent(t[n].value));
59            var a = l.join("&"),
60                i = (a += "&isAjax=true", window._paq || null),
61                r = new XMLHttpRequest;
62            r.open("POST", e.action), r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), r.send(
63                a), r.onload = function() {
64                var e, t;
65                200 === r.status ? o ? (i && i.push && i.push(["trackLink", "https://post.upsales.com/" + r
66                    .responseText, "link"
67                ]), "undefined" != typeof _uaq && _uaq("form=" + r.responseText), setTimeout(function() {
68                    console.log("datalayer push contact_submit")
69                    dataLayer.push({'event': 'contact_submit'})
70                    setTimeout(function() {
71                        window.top.location.href = o
72                    }, 333)
73                }, 333)) : (dataLayer.push({'event': 'contact_submit'}), e = document.getElementById("up-form"), t = document.getElementById(
74                        "up-form-thanks"), e.style.display = "none", t.style.display = "block", i && i.push && i
75                    .push(["trackLink", "https://post.upsales.com/" + r.responseText, "link"]), _uaq && _uaq(
76                        "form=" + r.responseText)) : console.log("AJAX ERROR", r.status)
77            }
78        } else {
79            e = document.getElementById("recaptcha-error"), a = document.getElementsByClassName("g-recaptcha");
80            e.style.display = "none", a && a.length && console.log("handle this later")
81        }
82    }
83    var form = document.getElementById("up-form");
84    form.addEventListener("submit", onSubmit);

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.