<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/* ============================================================
 * Copyright chaojiliepin.
 * ============================================================ */

//替换string format 
String.format = function () {
    if (arguments.length == 0)
        return null;
    var str = arguments[0];
    for (var i = 1; i &lt; arguments.length; i++) {
        var re = new RegExp('\\{' + (i - 1) + '\\}', 'gm');
        str = str.replace(re, arguments[i]);
    }
    return str;
};


//跳转到新url
function redirect(url) {
    window.location.href = url;
}

//提示对话框
function f_msg(content, title) {
    content = content || "";
    if (title == undefined)
        title = "提示信息";
    dialog({
        title: title,
        content: content,
        okValue: "",
        okDisplay: false
    }).show();
}

//提示对话框
function f_alert(content, title, callback, skin) {
    content = content || "";
    if (typeof (title) == "function") {
        callback = title;
        title = "提示信息";
    }
    else if (title == undefined)
        title = "提示信息";
    skin = skin || "";
    dialog({
        title: title,
        content: content,
        okValue: "确定",
        skin: skin,
        ok: function () {
            this.close().remove();
            if (typeof (callback) == "function") {
                callback();
            }
            return false;
        }
    }).show();
}

//确认对话框
function f_confirm(content, title, callbackok, callbackcancel) {
    content = content || "";
    if (typeof (title) == "function") {
        if (typeof (callbackok) == "function") {
            callbackcancel = callbackok;
        }
        callbackok = title;
        title = "提示信息";
    }
    else if (title == undefined)
        title = "提示信息";
    dialog({
        title: title,
        content: content,
        okValue: "确定",
        ok: function () {
            this.close().remove();
            if (typeof (callbackok) == "function") {
                callbackok();
            }
            return false;
        },
        cancelValue: "取消",
        cancel: function () {
            this.close().remove();
            if (typeof (callbackcancel) == "function") {
                callbackcancel();
            }
            return false;
        }
    }).show();

}

//自动显示消息然后消失
function f_showmsg(content, time, callback, skin) {
    content = content || "";
    if (typeof (time) == "function") {
        callback = time;
        time = 1500;
    }
    else if (time == undefined)
        time = 1500;
    skin = skin || "tips";
    var autoMsg = dialog({
        content: content,
        skin: skin,
        onremove: function () {
            if (typeof (callback) == "function") {
                callback();
            }
        }
    });
    autoMsg.show();
    setTimeout(function () { autoMsg.close().remove(); }, time);
}

//显示警告信息
function f_warning(content, time, callback) {
    f_showmsg(content, time, callback, "tips_warning");
}

//显示错误信息
function f_error(content, title, callback, skin) {
    f_alert(content, title, callback, "tips_error");
}

//显示成功信息
function f_success(content, time, callback) {
    f_showmsg(content, time, callback, "tips_success");
}

//扩展方法
(function ($) {

    //回车按钮
    $.fn.enterKey = function (opt) {
        $(this).on('keydown', function (e) {
            var key = e.which;
            if (key == 13) {
                e.preventDefault();
                if (opt.ishref == true)
                    eval($("#" + opt.id).attr("href"));
                else
                    $("#" + opt.id).click();
            }
        });
        return $(this);
    };


    $.fn.placeholder = function () {
        var i = document.createElement('input'),
            placeholdersupport = 'placeholder' in i;
        if (!placeholdersupport) {
            var inputs = $(this);
            inputs.each(function () {
                var input = $(this),
                    text = input.attr('placeholder'),
                    pdl = 0,
                    height = input.outerHeight(),
                    width = input.outerWidth(),
                    placeholder = $('&lt;span class="phTips"&gt;' + text + '&lt;/span&gt;');
                try {
                    pdl = input.css('padding-left').match(/\d*/i)[0] * 1;
                } catch (e) {
                    pdl = 5;
                }
                placeholder.css({ 'margin-left': -(width - pdl), 'height': height, 'line-height': height + "px", 'position': 'absolute', 'color': "#cecfc9", 'font-size': "12px" });
                placeholder.click(function () {
                    input.focus();
                });
                if (input.val() != "") {
                    placeholder.css({ display: 'none' });
                } else {
                    placeholder.css({ display: 'inline' });
                }
                placeholder.insertAfter(input);
                input.keyup(function (e) {
                    if ($(this).val() != "") {
                        placeholder.css({ display: 'none' });
                    } else {
                        placeholder.css({ display: 'inline' });
                    }
                });
            });
        }
        return $(this);
    };

})(jQuery);


//完成加载时执行
$(function () {

    //判断是否支持placeholder



});
</pre></body></html>