PageSourceSearch

https://bezdroza.pl/assets/bezdroza/js/user_info.js

js bezdroza.pl collected 2026-09-25 23:50:35 UTC 4,459 bytes, 117 lines download raw bytes

1$.ajax({
2    url:'/api/users/info',
3    method: 'get',
4    success: function(api){
5        data = api;
6        window._users = data;
7        if (data.ile > 0) {
8            $('#koszykbox').html('<p id="koszykbox_suma" style="display:inline;">' + data.suma +'</p> <p id="koszykbox_ile" style="display:inline;">('+data.ile+')</p>');
9        }
10
11        $("#ile-n-archiwum-ebook").html(" (" + data.biblioteka.ebooks + ")");
12        $("#ile-n-archiwum-audiobook").html(" (" + data.biblioteka.audiobooks + ")");
13        $("#ile-n-archiwum-kurs").html(" (" + data.biblioteka.courses + ")");
14        $("#ile-kurs-dodatki").html(" (" + data.biblioteka.addition + ")");
15        $(".ile-archiwum-ebook").html(" (" + data.archiwum.ebooks + ")");
16        $(".ile-archiwum-audiobook").html(" (" + data.archiwum.audiobooks + ")");
17        $(".ile-archiwum-kursy").html(" (" + data.archiwum.courses + ")");
18        $("#ile-prezenty").html(" (" + data.prezenty + ")");
19        $("#ile-kurs-materialy").html(" (" + data.materialy + ")");
20        $("#ile-sample").html(" (" + data.sample + ")");
21        if (data.login) {
22            if (data.sample > 0 && data.last_sample != "" && !$.cookie("hidesampleinfo")) {
23                $(".sample-info .sample-info-title").html(data.last_sample);
24                $(".sample-info").show();
25            }
26            if( typeof ga !== 'undefined') {
27              ga("set", "&uid", data.uid);
28              ga("set", "dimension1", data.uid);
29            }
30
31            $('#helloUser').html("Witaj <br/><strong>"+data.name+"</strong>");
32            $('.openUserMenu').addClass('logged-in');
33            $('.switchOnLogged').toggle();
34
35            if (data.biblioteka) {
36                if (data.biblioteka.ebooks == 0) {
37                    $("#ile-n-archiwum-ebook2").closest("li").addClass("disable");
38                }
39                $("#ile-n-archiwum-ebook2").html("(" + data.biblioteka.ebooks + ")");
40
41                if (data.biblioteka.audiobooks == 0) {
42                    $("#ile-n-archiwum-audiobook2").closest("li").addClass("disable");
43                }
44                $("#ile-n-archiwum-audiobook2").html("(" + data.biblioteka.audiobooks + ")");
45
46                if (data.biblioteka.courses == 0) {
47                    $("#ile-n-archiwum-kurs2").closest("li").addClass("disable");
48                }
49                $("#ile-n-archiwum-kurs2").html("(" + data.biblioteka.courses + ")");
50            }
51
52            if (data.prezenty == 0) {
53                $("#ile-prezenty2").closest("li").addClass("disable");
54            }
55            $("#ile-prezenty2").html("(" + data.prezenty + ")");
56
57            if (data.sample) {
58                $("#ile-sample2").html("(" + data.sample + ")");
59            } else {
60                $("#ile-sample2").closest("li").addClass("disable");
61            }
62        }else{
63            $('#helloUser').html("ZALOGUJ SIĘ");
64        }
65    }
66});
67$(document).ready(function(){
68    if (readCookie('nomobile') === 'true'){
69        $(".change-device-not-mobily").show();
70        $(".modalbuttonscontainer").css("height", "100%");
71    } else{
72        $(".change-device-not-mobily").hide();
73    }
74});
75
76// full email hiding
77const bookstore = window._bookstore;
78
79$("p:contains('@" + bookstore + "')").each(function(){
80    if($(this).html().indexOf("href")==-1){
81        const re = /\w+@\w+\.\w{2}/;
82        $(this).html($(this).html().replace(re,"<a href='mailto:\$&'>\$&</a>"));
83    }
84});
85
86let hideEmail = function(email) {
87    return email.replace(/(.{0})(.*)(?=@)/,
88    function(gp1, gp2, gp3) {
89        for(let i = 0; i < gp3.length; i++) {
90            gp2+= "* ";
91        }
92        return "[wyświetl email]";
93     });
94};
95
96$('a[href^="mailto:"]').each(function() {
97    $(this).text(hideEmail($(this).text()))
98});
99
100$('a[href^="mailto:"]').each(function() {
101    $(this).on("click", function(e){
102        if($(this).attr('href').indexOf('?')>-1){
103            if($(this).text()!=$(this).attr('href').substring(7,$(this).attr('href').indexOf('?'))){
104                $(this).text($(this).attr('href').substring(7,$(this).attr('href').indexOf('?')));
105                e.preventDefault();
106                e.stopPropagation();
107            }
108        }
109        else{
110            if($(this).text()!=$(this).attr('href').substring(7)){
111                $(this).text($(this).attr('href').substring(7));
112                e.preventDefault();
113                e.stopPropagation();
114            }
115        }
116    });
117});

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.