// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.

// Write your JavaScript code.

// unblock when ajax activity stops 
$.blockUI.defaults.message = '<span class="loaderSpan">Please wait...</span>'//'<img class="loaderImg" src="loaderV3.gif" runat="server" />';
$.blockUI.defaults.overlayCSS.backgroundColor = "#000";
$.blockUI.defaults.overlayCSS.opacity = 0.5;
$(document).ajaxStop($.unblockUI);

alertify.set('notifier', 'position', 'top-right');

//Custom Alerts
function AlertSuccess(shouldReload) {
    $.confirm({
        title: 'Alert',
        content: 'Action completed successfully.',
        type: 'green',
        buttons: {
            Ok: {
                action: function () {
                    if (shouldReload) {
                        location.reload();
                    }

                }
            }
        }
    });
}

function AlertError() {
    $.confirm({
        title: 'Alert',
        content: 'There was an unexpected error. Please try again.',
        type: 'red',
        typeAnimated: true,
        buttons: {
            Ok: {
                action: function () {
                }
            }
        }
    });
}

function AlertInfo(message) {
    $.confirm({
        title: 'Alert',
        content: message,
        type: 'blue',
        buttons: {
            Ok: {
                action: function () {

                }
            }
        }
    });
}