PageSourceSearch

https://satkurier.pl/frontend/js/sk_login.js?18

js satkurier.pl collected 2026-10-02 05:05:25 UTC 5,709 bytes, 155 lines download raw bytes

1$(document).keyup(function (event) {
2    if (event.which === 27) HidePopup();
3});
4jQuery(document).ready(function () {
5    var cookieUsername = getCookie("sk_username");
6    if (cookieUsername === null || cookieUsername === "") $("#btnShowLoginPopup").text("Zaloguj");
7    else $("#btnShowLoginPopup").text("Wyloguj");
8    $("#btnShowLoginPopup").click(function () {
9        var cookieUsername = getCookie("sk_username");
10        if (cookieUsername === null || cookieUsername === "") ShowPopup();
11        else {
12            eraseCookie("sk_username");
13            $("#btnShowLoginPopup").text("Zaloguj");
14            jQuery("#name").css("display", "block");
15            jQuery("#email").css("display", "block");
16        }
17    });
18    $("#btnCloseLoginPopup").click(function () {
19        HidePopup();
20    });
21    $("#password").keyup(function (event) {
22        if (event.which === 13) Login();
23    });
24    $("#btnLogin").click(Login);
25    $("#username").focus(function () {
26        jQuery("#username").css("background-color", "#ffffff");
27    });
28    $("#password").focus(function () {
29        jQuery("#password").css("background-color", "#ffffff");
30    });
31    $("#username").on("keypress", function () {
32        var $that = $(this),
33            maxlength = 40;
34        selecttxt = window.getSelection();
35        if (selecttxt != "") {
36            return;
37        }
38        if ($that.val().length == maxlength) {
39            e.preventDefault();
40            return;
41        }
42        $that.val($that.val().substr(0, maxlength));
43    });
44    $("#password").on("keypress", function () {
45        var $that = $(this),
46            maxlength = 40;
47        selecttxt = window.getSelection();
48        if (selecttxt != "") {
49            return;
50        }
51        if ($that.val().length == maxlength) {
52            e.preventDefault();
53            return;
54        }
55        $that.val($that.val().substr(0, maxlength));
56    });
57    $("#token").on("keypress", function () {
58        var $that = $(this),
59            maxlength = 100;
60        if ($that.val().length == maxlength) {
61            e.preventDefault();
62            return;
63        }
64        $that.val($that.val().substr(0, maxlength));
65    });
66});
67function ShowPopup() {
68    jQuery("#loginBox").fadeIn();
69    jQuery("#fadeBackground").fadeIn();
70    jQuery("#loaderCircle").fadeIn();
71}
72function HidePopup() {
73    jQuery("#messageContent").fadeOut();
74    jQuery("#loginBox").fadeOut();
75    jQuery("#fadeBackground").fadeOut();
76    jQuery("#messageBox").fadeOut();
77    jQuery("#password").val("");
78}
79function Login() {
80    var color = "#ffe3e3";
81    var _token = jQuery("#_token").val();
82    var username = jQuery("#username").val();
83    var password = jQuery("#password").val();
84    var cookieUsername = getCookie("sk_username");
85    var state = 0;
86    if (username === "" && password === "") {
87        state = 1;
88    } else if (username === "") {
89        state = 2;
90    } else if (password === "") {
91        state = 3;
92    }
93    if (state === 1) {
94        jQuery("#messageBox").html("Pola <b>LOGIN</b> i <b>HASŁO</b> są obowiązkowe!");
95        jQuery("#messageBox").css("display", "block");
96        jQuery("#messageBox").attr("class", "col-xs-20 alert alert-danger");
97        jQuery("#username").css("background-color", color);
98        jQuery("#password").css("background-color", color);
99        return;
100    } else if (state === 2) {
101        jQuery("#messageBox").html("Pole <b>LOGIN</b> jest obowiązkowe!");
102        jQuery("#messageBox").css("display", "block");
103        jQuery("#messageBox").attr("class", "col-xs-20 alert alert-danger");
104        jQuery("#username").css("background-color", color);
105        return;
106    } else if (state === 3) {
107        jQuery("#messageBox").html("Pole <b>HASŁO</b> jest obowiązkowe!");
108        jQuery("#messageBox").css("display", "block");
109        jQuery("#messageBox").attr("class", "col-xs-20 alert alert-danger");
110        jQuery("#password").css("background-color", color);
111        return;
112    }
113    jQuery("#progressCircle").css("display", "inline-block");
114    if (cookieUsername === null || cookieUsername === "") {
115        jQuery.ajax({
116            type: "POST",
117            url: "http://beta.satkurier.pl/loginToSkForum",
118            data: "&username=" + username + "&password=" + password + "&_token=" + _token,
119            dataType: "html",
120            success: function (response) {
121                jQuery("#messageBox").css("display", "block");
122                jQuery("#messageBox").attr("class", "alert alert-warning");
123                jQuery("#progressCircle").css("display", "none");
124                if (response === "Success") {
125                    $("#loginForm").trigger("reset");
126                    HidePopup();
127                    setCookie("sk_username", username, 1);
128                    $("#btnShowLoginPopup").text("WYLOGUJ");
129                    jQuery("#name").css("display", "none");
130                    jQuery("#email").css("display", "none");
131                } else jQuery("#messageBox").html(response);
132            },
133        });
134    }
135}
136function setCookie(cname, cvalue, exdays) {
137    var d = new Date();
138    d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
139    var expiresTime = "expires=" + d.toUTCString();
140    document.cookie = cname + "=" + cvalue + "; " + expiresTime + ";domain=satkurier.pl;path=/";
141}
142function getCookie(cname) {
143    var name = cname + "=";
144    var ca = document.cookie.split(";");
145    for (var i = 0; i < ca.length; i++) {
146        var c = ca[i];
147        while (c.charAt(0) == " ") c = c.substring(1);
148        if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
149    }
150    return "";
151}
152function eraseCookie(name) {
153    setCookie(name, "", -1);
154}
155

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.