PageSourceSearch

https://sportfort.ru/Scripts/sportfort.notifications.js

js sportfort.ru collected 2026-09-29 09:17:17 UTC 2,897 bytes, 71 lines download raw bytes

1sf.notifications = {
2    ShowList: function () {
3        if (sf.notifications._loading === true)
4            return;
5
6        var unbindScrollFunctionOnClose = function () {
7            $("#notifications").unbind('scroll', sf.notifications.GetMore);
8        };
9
10        sf.notifications._loading = true;
11        ui_ShowPopUp("/api/Notifications/Notifications_tmpl", "/api/Notifications/GetBatch", unbindScrollFunctionOnClose).done(
12            function (markup, notifications) {
13                localStorage.setItem("NotificationsCount", notifications.UnreadNotificationsCount);
14                ui_setNotificationsCount(notifications.UnreadNotificationsCount);
15                sf.notifications._nextNotificationId = notifications.NextId;
16
17                $("#notifications").bind('scroll', sf.notifications.GetMore);
18                sf.notifications._loading = false;
19            });
20
21        return;
22    },
23
24    _loading: false,
25
26    _nextNotificationId: null,
27
28    _notificationsCount: 30,
29
30    GetMore: function () {
31        if (sf.notifications._loading === true)
32            return;
33
34        var $notificationsList = $('#notifications');
35        var panelHeight = $notificationsList.height();
36        var panelContentHeight = $notificationsList[0].scrollHeight;
37        var scrollPositionY = $notificationsList.scrollTop();
38
39        if (panelContentHeight - panelHeight < scrollPositionY + 150) {
40            sf.notifications._loading = true;
41            ui_GetData("/api/Notifications/GetBatch?startId=" + sf.notifications._nextNotificationId).done(
42                function (notifications) {
43                    localStorage.setItem("NotificationsCount", notifications.UnreadNotificationsCount);
44                    ui_setNotificationsCount(notifications.UnreadNotificationsCount);
45                    sf.notifications._nextNotificationId = notifications.NextId;
46
47                    var renderedContent = ui_RenderObjectSync(notifications, "/api/Notifications/List_tmpl");
48                    $("#notifications").append(renderedContent);
49                    sf.notifications._loading = false;
50                });
51        }
52    },
53
54    ShowDetails: function (id) {
55        ui_ShowPopUp("/api/Notifications/Details_tmpl", "/api/Notifications/Get/" + id);
56    }
57}
58
59function fadeInNotification(notification) {
60    var notificationAppendedAlready = $("#notification" + notification.Id).length > 0;
61    if (notificationAppendedAlready)
62        return;
63
64    var content = ui_RenderObjectSync(notification, "/api/Notifications/PopUpNotification_tmpl");
65    $(".sf_notifications_holder_center").append(content);
66    var $notification = $("#notification" + notification.Id);
67    $notification.fadeIn(10);
68    setTimeout(function () {
69        $notification.fadeOut(250, function () { $notification.remove(); });
70    }, 7000);
71}

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.