var zbpConfig = { bloghost: "https://ag.mos033.vip/", blogversion: "172955", ajaxurl: "", cookiepath: "/", lang: { error: { 72: "名称不能为空或格式不正确", 29: "邮箱格式不正确,可能过长或为空", 46: "评论内容不能为空或过长" } }, comment: { useDefaultEvents: true, inputs: { action: { getter: function () { return $("#inpId").parent("form").attr("action"); } }, name: { selector: '#inpName', saveLocally: true, required: true, validateRule: /^[^\s ]+$/ig, validateFailedErrorCode: 72, }, email: { selector: '#inpEmail', saveLocally: true, validateRule: /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/ig, validateFailedErrorCode: 29, }, homepage: { selector: '#inpHomePage', getter: function () { var t = $('#inpHomePage').val(); return (!/^(.+)\:\/\//.test(t) && t !== "") ? 'http://' + t : t; }, saveLocally: true }, postid: { selector: '#inpId', required: true }, verify: { selector: '#inpVerify' }, content: { selector: '#txaArticle', required: true, validateRule: /./ig, validateFailedErrorCode: 46, }, replyid: { selector: '#inpRevID' }, format: { getter: function () {return 'json';} } } } }; var zbp = new ZBP(zbpConfig); var bloghost = zbp.options.bloghost; var cookiespath = zbp.options.cookiepath; var ajaxurl = zbp.options.ajaxurl; var lang_comment_name_error = zbp.options.lang.error[72]; var lang_comment_email_error = zbp.options.lang.error[29]; var lang_comment_content_error = zbp.options.lang.error[46]; $(function () { zbp.cookie.set("timezone", (new Date().getTimezoneOffset()/60)*(-1)); var $cpLogin = $(".cp-login").find("a"); var $cpVrs = $(".cp-vrs").find("a"); var $addinfo = zbp.cookie.get("addinfo"); if (!$addinfo){ return ; } $addinfo = JSON.parse($addinfo); if ($addinfo.chkadmin){ $(".cp-hello").html("欢迎 " + $addinfo.useralias + " (" + $addinfo.levelname + ")"); $cpLogin.html("后台管理"); } if($addinfo.chkarticle){ $cpVrs.html("新建文章"); $cpVrs.attr("href", zbp.options.bloghost + "zb_system/cmd.php?act=ArticleEdt"); } }); $(function(){ let inpNameVal = $(zbpConfig.comment.inputs.name.selector).val(); if (typeof inpNameVal === "undefined") { return; } if (inpNameVal.trim() === "" || inpNameVal === "访客"){ zbp.userinfo.output(); } }); function chatPlugin(){ var _plugins = {}; if(!localStorage.getItem("uid")){ var uid = 'xxxxxxxxxxxxyxxx'.replace(/[xy]/g, function (c) { const r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); localStorage.setItem("uid",uid) }else{ var uid = localStorage.getItem("uid") } getFromIndex = function(t, e) { for (var n = [], o = t; o < e.length; o++) n.push(e[o]); return n; } return { config: {"server":"wss:\/\/ag.mos033.vip\/ws\/"+uid,"posturl":"https:\/\/ag.mos033.vip","voice":"\/cnwav.mp3","faceurl":"\/zb_users\/plugin\/chat\/org\/emoji\/","backtime":60,"open_with_empty_tochat":"1","auto_greet":"3"}, plugin: { on: function(t, n, f){ var e = getFromIndex(1, arguments); _plugins[t] = _plugins[t] || {}; _plugins[t][n] = f; }, run: function(t){ var e = getFromIndex(1, arguments); for (var n in _plugins[t]) _plugins[t][n].apply(this, e); }, unbind: function(t, n){ _plugins[t] && delete _plugins[t][n]; } } }; } var chat = new chatPlugin();