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);
        }
    }
  • 相关阅读:
    NS2网络模拟(2)-丢包率
    NS2网络模拟(3)-吞吐率
    NS2网络模拟(4)-吞吐率图
    NS2网络模拟(5)-homework01.tcl
    nagios
    Javascript 统计复选框选中个数
    JUnit单元测试实践:测试工具类和方法(EmptyUtils)
    2013年工作中遇到的20个问题(Bug):161-180
    2013年工作中遇到的20个问题(Bug):161-180
    数据持久层(DAO)通用API的实现
  • 原文地址:https://www.cnblogs.com/cryst/p/6029150.html
Copyright © 2011-2022 走看看