Notification.js

102 lines | 2.169 kB Blame History Raw Download

import toastr from 'toastr'


export default class Notification {

    static Sho(text, title) {

        //debugger;

        let Data = new Date();
        let Timestring = "" + Data.getHours() + ":"
            + Data.getMinutes() + ":"
            + Data.getSeconds() + " | "
            + text;


        toastr.success(Timestring, title,
            {
                "timeOut": 3000,
                "progressBar": true,
                "closeButton": true
            });
    }


    static MesOk(text, title) {
        let Data = new Date();
        let Timestring = "" + Data.getHours() + ":"
            + Data.getMinutes() + ":"
            + Data.getSeconds() + " | "
            + text;

        toastr.success(Timestring, title,
            {
                "closeButton": true,
                "progressBar": true
            });
    }
    static MesOk_NoHide(text, title) {
        let Data = new Date();
        let Timestring = "" + Data.getHours() + ":"
            + Data.getMinutes() + ":"
            + Data.getSeconds() + " | "
            + text;

        toastr.success(Timestring, title,
            {
                "timeOut": -1,
                "closeButton": true,
                "progressBar": true
            });
    }

    static MesEr(text, title) {
        let Data = new Date();
        let Timestring = "" + Data.getHours() + ":"
            + Data.getMinutes() + ":"
            + Data.getSeconds() + " | "
            + text;


        debugger;

        toastr
            .error(
                Timestring,
                title,

                {
                    "timeOut": -1,
                    "closeButton": true
                }
            );
    }

    static MesEr_Hide(text, title) {
        let Data = new Date();
        let Timestring = "" + Data.getHours() + ":"
            + Data.getMinutes() + ":"
            + Data.getSeconds() + " | "
            + text;


        debugger;

        toastr
            .error(
                Timestring,
                title,

                {
                    "timeOut": 10000,
                    "progressBar": true,
                    "closeButton": true
                }
            );
    }

}