HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/PHerau/ha.health-science.be/wwwroot/admin/Skins/Toast.ascx
<%@ Control Language="C#" AutoEventWireup="false" Inherits="DotNetNuke.UI.Skins.Controls.Toast" Codebehind="Toast.ascx.cs" %>
<script type="text/javascript">
    $(document).ready(function () {

        if (typeof dnn == 'undefined') dnn = {};
        if (typeof dnn.toast == 'undefined') dnn.toast = {};
        var sf = $.ServicesFramework();

        dnn.toast.refreshUser = function () {
            $.ajax({
                type: "GET",
                url: sf.getServiceRoot('InternalServices') + 'NotificationsService/' + 'GetToasts',
                contentType: "application/json",
                dataType: "json",
                cache: false,
                success: function (data) {
                    if (typeof dnn.toast.toastTimer !== 'undefined') {
                        // Cancel the periodic update.
                        clearTimeout(dnn.toast.toastTimer);
                        delete dnn.toast.toastTimer;
                    }

                    if (!data || !data.Success) {
                        return;
                    }

                    var toastMessages = [];

                    for (var i = 0; i < data.Toasts.length; i++) {
                        var toast = {
                            subject: data.Toasts[i].Subject,
                            body: data.Toasts[i].Body
                        };

                        toastMessages.push(toast);
                    }

                    var message = {
                        messages: toastMessages,
                        seeMoreLink: '<%= GetNotificationLink() %>', seeMoreText: '<%= Localization.GetSafeJSString(GetNotificationLabel()) %>'
                    };

                    $().dnnToastMessage('showAllToasts', message);

                    dnn.toast.toastTimer = setTimeout(dnn.toast.refreshUser, 30000);
                },
                error: function (xhr, status, error) {
                    if (typeof dnn.toast.toastTimer !== 'undefined') {
                        // Cancel the periodic update.
                        clearTimeout(dnn.toast.toastTimer);
                        delete dnn.toast.toastTimer;
                    }
                }
            });
        };

        function checkLogin() {
            return '<%= IsOnline() %>' === 'True';
        };

        // initial setup for toast
        var pageUnloaded = window.dnnModal && window.dnnModal.pageUnloaded;
        if (checkLogin() && !pageUnloaded) {
            dnn.toast.toastTimer = setTimeout(dnn.toast.refreshUser, 4000);
        }
    });

</script>