zoukankan      html  css  js  c++  java
  • 结合Pnotify插件--app-jquery-notify.js

    $.NOTIFY =
    {
        showSuccess : function (title, text, context)
        {
            var opt =
            {
                title : title,
                text : text,
                type : 'success',
                hide : true,
                delay : 1500
            };
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            new PNotify (opt);
        },
        showNotice : function (title, text, context)
        {
            var opt =
            {
                title : title,
                text : text,
                type : 'notice',
                hide : true,
                delay : 1500
            };
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            new PNotify (opt);
        },
        showError : function (title, text, context)
        {
            var opt =
            {
                title : title,
                text : text,
                type : 'error',
                hide : true,
                delay : 1500
            };
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            new PNotify (opt);
        },
        showLogin : function (context)
        {
            var opt =
            {
                title : "信息",
                text : "您可能已经离线,请重新刷新网页后再试!",
                type : "info",
                confirm :
                {
                    confirm : true,
                    buttons : [
                        {
                            text : '刷新网页',
                            click : function (notice)
                            {
                                top.location.reload ();
                            }
                        }
                    ]
                },
                buttons :
                {
                    closer : false,
                    sticker : false
                }
            };
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            new PNotify (opt)
        },
        showConfirm : function (title, text, buttons, context)
        {
            var opt =
            {
                title : title,
                text : text,
                type : "notice",
                confirm :
                {
                    confirm : true,
                    buttons : buttons
                },
                buttons :
                {
                    closer : false,
                    sticker : false
                }
            };
            
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            
            new PNotify (opt);
            
        },
        show_context : function (context, modal, opt)
        {
            var opts = $.extend (
            {
                "push" : "top",
                "dir1" : "down",
                "dir2" : "left",
                "context" : context,
                "modal" : modal,
                "overlay_close" : true,
                "addclass" : "stack-modal"
            }, opt)
            new PNotify (opts);
        }
    }
  • 相关阅读:
    spark之手机基站定位数据的商圈分析
    spark之客户流失预测
    spark之AHP层次分析顾客价值得分
    Web-Attak系列教程第二季0x13讲——信息收集
    Web-Attak系列教程第二季0x12讲——HTTP的请求与响应格式
    Python编程系列教程第14讲——继承
    独孤九剑与黑客编程
    Python编程系列教程第15讲——多态
    Python编程系列教程第16讲——拷贝自身到系统目录
    再谈独孤九剑与黑客编程
  • 原文地址:https://www.cnblogs.com/cryst/p/6029150.html
Copyright © 2011-2022 走看看