Z-Blog主页
Z-Wiki
应用中心
菠萝阁
ZBlogger
Z5加密
跳至内容
Z-Blog Wiki
Z-Blog官方文库
用户工具
登录
站点工具
搜索
工具
显示页面
修订记录
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您在这里:
Z-Blog & Z-BlogPHP
»
Z-BlogPHP
»
应用开发指南
»
各版本增加功能列表
»
1.5增加功能列表
»
Z-BlogPHP JavaScript Framework
»
systemevents
zblogphp:development:features:1.5:zbpjf:systemevents
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
====== Register system events ====== <code javascript> this.plugin.on("userinfo.output", "system", function() { this.$("#inpName").val(this.userinfo.username); this.$("#inpEmail").val(this.userinfo.mail); this.$("#inpHomePage").val(this.userinfo.homepage); }); this.plugin.on("userinfo.savefromhtml", "system", function() { this.userinfo.username = this.$("#inpName").val(); this.userinfo.mail = this.$("#inpEmail").val(); this.userinfo.homepage = this.$("#inpHomePage").val(); this.userinfo.save(); }); this.plugin.on("userinfo.save", "system", function() { this.cookie.set("name", this.userinfo.username); this.cookie.set("email", this.userinfo.mail); this.cookie.set("homepage", this.userinfo.homepage); }); this.plugin.on("comment.verifydata", "system", function(error, formData) { var regExList = { // [canBeEmpty, errorCode, RegExp] "name": [false, 72, /^[\.\_A-Za-z0-9\u4e00-\u9fa5]+$/ig], "email": [true, 29, /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/ig], "content": [false, 46, /./] }; for (var item in regExList) { var object = regExList[item]; if (((!object[0] && formData[item] === "")) || (!(object[2].test(formData[item])) && formData[item] !== '')) { error.code = object[1]; error.msg = this.options.lang.error[error.code]; return error; } } var objSubmit = $("#inpId").parent("form").find(":submit"); objSubmit.data("orig", objSubmit.val()).val("Waiting...").attr("disabled", "disabled").addClass("loading"); }); this.plugin.on("comment.posterror", "system", function(error, formData) { var objSubmit = $("#inpId").parent("form").find(":submit"); objSubmit.removeClass("loading").removeAttr("disabled"); if (objSubmit.data("orig")) { objSubmit.val(objSubmit.data("orig")); } }); this.plugin.on("comment.postsuccess", "system", function(formData, retString, textStatus, jqXhr) { var objSubmit = $("#inpId").parent("form").find(":submit"); objSubmit.removeClass("loading").removeAttr("disabled").val(objSubmit.data("orig")); var data = $.parseJSON(retString); if (data.err.code !== 0) { alert(data.err.msg); throw "ERROR - " + data.err.msg; } if (formData.replyid == "0") { this.$(data.data.html).insertAfter("#AjaxCommentBegin"); } else { this.$(data.data.html).insertAfter("#AjaxComment" + formData.replyid); } location.hash = "#" + data.data.ID; this.$("#txaArticle").val(""); this.userinfo.saveFromHtml(); }); this.plugin.on("comment.get", "system", function(postid, page) { var self = this; this.$.get(this.options.bloghost + "zb_system/cmd.php?act=getcmt&postid=" + postid + "&page=" + page, function(data, textStatus, jqXhr) { self.plugin.emit("comment.got", [postid, page], data, textStatus, jqXhr); }); }); this.plugin.on("comment.got", "system", function(formData, data, textStatus, jqXhr) { this.$('#AjaxCommentBegin').nextUntil('#AjaxCommentEnd').remove(); this.$('#AjaxCommentBegin').after(data); }); this.plugin.on("comment.reply", "system", function(id) { var me = this; this.$("#inpRevID").val(id); this.$("#cancel-reply").show().bind("click", function() { me.$("#inpRevID").val(0); me.$(this).hide(); window.location.hash = "#comment"; return false; }); window.location.hash = "#comment"; }); </code>
zblogphp/development/features/1.5/zbpjf/systemevents.1480382028.txt
· 最后更改: 2016/11/29 09:13 由
yszm
页面工具
显示页面
修订记录
页面重命名
回到顶部