Namespace.register("U.D.Blog.R"); //朋友圈评论 //#region 评论 //打印内容 U.D.Blog.R.PBPGBL = function (UDE, UDOD) { var i, _UDE = ["block", "none"], _UDCD = U.selectEl(UDOD).childg(0).Child(); if (!UDE && UDE["KZ"]) { _UDE.reverse(); } //取消 else {//打印 var i, _UTL, _UDTD, _UDFD = $$("frag"), _UDAD = U.selectEl("div", _UDCD[0]), _UDID = U.M.SetElement(UDE.ArticleContent, "img", "De"), UTH = _UDID[1].innerText; _UDCD[0].scrollTop = 0; _UDAD[16].innerText = _UDAD[2].innerText = _UDAD[8].innerText = ""; _UDAD[5].innerText = UDE.UserNickName || UDE.UserName; _UDAD[6].innerText = U.MT.getTDInterval(UDE.ArticleAddTime); _UDAD[7].innerText = UTH || "图片分享"; _UDAD.addAttrArray({ "innerText": (UDE.ArticleZFN === undefined ? UDE.AricitleReadNumber : UDE.ArticleZFN), "onclick": [[U.M.StopBubble], [U.D.Blog.A.PAZF, ([UDE])]] }, 11); $$("img", { "onerror": U.M.ImgError, "onclick": [[U.U.I.UIFZX, ([UDE.UserID])]], "src": U.M.GetImgU(UDE.UserThumbnailImageHead), "title": "点击查看" }, _UDAD[2]); //用户头像 //用户发表的图片展示 _UDID[0][i].onclick || if ((_UTL = _UDID[0].length)) { for (i = 0; i < _UTL; i++) { $$("img", { "src": _UDID[0][i].src, "onclick": [[U.M.StopBubble], [U.D.Img.Img, ([UDE, [{ "Thm": _UDID[0][i].src, "Img": _UDID[0][i].alt.indexOf(US.fs) > -1 ? _UDID[0][i].alt : _UDID[0][i].src}]])]] }, _UDFD); } _UDAD[8].appendChild(_UDFD); } (_UDTD = _UDAD["UD_SYBNO"]).onclick = U.M.apply(null, [[U.D.Blog.R.FBHFRGBL, ([UDE, _UDTD, null])]]); } for (i = 0; i < _UDE.length; i++) { _UDCD[i].style.display = _UDE[i]; } return _UDAD; } //滚动回复数据 U.D.Blog.R.GDHFRGBL = function (UDE, UDOD) { U.D.Blog.R.HFRGBL(UDE, UDOD, this.P + 2); } //用户回复数据 U.D.Blog.R.HFRGBL = function (UDE, UDOD, P) { var _UDAD, _UGD = [undefined], _UET = U.D.T.FYGBL(UDE.Reply, P), _UDTD = U.selectEl(".UD_SYBAOO", UDOD)[0]; //获取回复数据 if (_UET[0]) { _UDAD = U.selectEl("div", _UDTD); (P == 1) && (_UDAD["UD_SYBF"].innerText = "", _UDAD[14].innerText = UDE["ArticleReplayNumber"] || 0); if (_UET[0].length > 0) { (P == 1) && (U.D.Blog.R.PHFRGBLPL(_UET[0], _UDAD[16]), _UGD[0] = U.M.SSCH({ 'AF': U.M.apply(null, [[U.D.Blog.R.GDHFRGBL, ([UDE, UDOD])]]) }).SCH()); U.D.Blog.R.PHFRGBL(_UET[0], _UDAD["UD_SYBF"], null, UDE); } else { _UGD[0] = null; } (_UGD[0] !== undefined) && (_UDTD.onscroll = _UGD[0]); } //打印评论数据 else { U.A.Request(US.CD, ([US.DB, "UseStudio_Blog", "UB_P_S_SelectArticleAllReply", UDE.ArticleID, (_UET[1] - 1) * 100, _UET[1] * 100]), U.D.Blog.R.AsynHFRGBL, (["", UDE, UDOD, P, _UET[1]])); // U.A.Request("pb.ReplyList", ([UDE.ArticleID, (_UET[1] - 1) * 100, _UET[1] * 100]), U.D.Blog.R.AsynHFRGBL, (["", UDE, UDOD, P, _UET[1]])); } //获取评论数据 } //异步获取回复数据 U.D.Blog.R.AsynHFRGBL = function (request) { var i, context = request.context, _UDE = context[1], _UDOD = context[2], _UP = context[3], _UTP = context[4]; request = request.value; (_UDE.Reply == null) && (_UDE.Reply = []); _UDE.Reply[_UTP] = []; for (i = 0; i < request.length; i++) { if (!request[i].ReplyParentID) { _UDE.Reply[_UTP].push(request[i]); request[i]["RR"] = _$(request).Select({ "ReplyParentID": request[i].ReplyID }); } } U.D.Blog.R.HFRGBL(_UDE, _UDOD, _UP); } //打印评论好友 U.D.Blog.R.PHFRGBLPL = function (UDE, UDOD) { var i, _UET = {}, UDFD = $$("frag"); for (i = 0; i < UDE.length; i++) { if (!_UET[UDE[i].ReplyAddUserID]) { $$("img", { "onerror": U.M.ImgError, "src": U.M.GetImgU(UDE[i].UserThumbnailImageHead), "title": UDE[i].UserNickName, "onclick": [[U.M.StopBubble], [U.U.I.UIFZX, ([UDE[i].ReplyAddUserID])]] }, UDFD); _UET[UDE[i].ReplyAddUserID] = "Yes"; } } UDOD.appendChild(UDFD) } //打印回复数据 U.D.Blog.R.PHFRGBL = function (UDE, UDPD, TF, UAE, UPE) { var i, j, _UME, _UKE, _UDTD, _UDSD, _UDFD = $$("frag"); _UKE = UDE.length == 1 ? UAE["Reply"][1] : UDE for (i = 0; i < UDE.length; i++) { _UDTD = U.D.Blog.R.YSPHFRGBL(UDE[i], _UDFD, UAE, UPE || UDE[i], UPE ? UDPD : null, _UKE); _UME = UDE[i]["RR"]; //打印回复 for (j = 0; (_UME && j < _UME.length); j++) { U.D.Blog.R.YSPHFRGBL(_UME[j], _UDTD, UAE, UDE[i], _UDTD, _UME); } //打印回复的回复 } if (TF && UDPD.firstChild) { UDPD.insertBefore(_UDFD, UDPD.firstChild); } else { UDPD.appendChild(_UDFD); } } //样式使用 U.D.Blog.R.YSPHFRGBL = function (UDE, UDOD, UAE, UPE, UDMD, UME) { var _UDTD, _UDMD, _UDSD, _UDED, _UDGD, _UDJD, _UTF = UDE.ReplyAddUserID == US.userInfo.userid; _UDTD = $$("div", { "className": "UD_SYBFO" }, UDOD); _UDSD = $$("div", { "className": "UD_SYBFOI" }, _UDTD); $$("img", { "onerror": U.M.ImgError, "title": UDE.UserNickName, "src": U.M.GetImgU(UDE.UserThumbnailImageHead), "onclick": [[U.M.StopBubble], [U.U.I.UIFZX, ([UDE.ReplyAddUserID])]] }, _UDSD); _UDED = $$("div", { "className": "UD_SYBFOZ" }, _UDTD); _UDGD = $$("div", { "className": "UD_SYBFOZK" }, _UDED); $$("div", { "className": "UD_SYBFOZTN", "innerHTML": UDE.UserNickName, "onclick": [[U.M.StopBubble], [U.U.I.UIFZX, ([UDE.ReplyAddUserID])]] }, _UDGD); _UDJD = $$("div", { "className": "UD_SYBFOZTO" }, _UDGD); $$("div", { "className": "UD_SYBFOZT", "innerHTML": U.MT.getTDInterval(UDE.ReplyAddTime) }, _UDJD); _UDSD = $$("div", { "className": "UD_SYBFT" }, _UDTD); $$("div", { "className": "UD_SYBFOZTK" + (_UTF ? " UD_SYBFOZTKO" : ""), "title": _UTF ? "删除" : "回复", "innerHTML": _UTF ? "删除" : "回复", "onclick": _UTF ? [[U.UI.Confirm, (["是否撤销评论", [U.D.Blog.R.SCPHFRGBL, ([UME, UDE, UAE, _UDTD])]])]] : [[U.D.Blog.R.TCPHFRGBL, ([UAE, _UDSD, UPE, UDMD])]] }, _UDJD); (UDE.ParentUserNickName) && ($$("div", { "className": "UD_SYBFOZKT", "innerHTML": "回复" }, _UDGD), $$("div", { "className": "UD_SYBFOZKO", "innerHTML": "@" + UDE.ParentUserNickName, "onclick": [[U.M.StopBubble], [U.U.I.UIFZX, ([UDE.ParentUserId])]] }, _UDGD)); $$("div", { "className": "UD_SYBFOZC UC_TF", "innerHTML": UDE.ReplyContent, "onselectstart": [[U.M.StopBubble], [U.M.apply(this, "return true")]] }, _UDED); return _UDSD; } //评论查看 U.D.Blog.R.PLCKBL = function (UDOD) { if (!U.U.L.DLTC(3)) { U.MR.InputTip(UDOD, ["发表回复...", ""]); } //发表回复 else { UDOD = U.selectEl($(UDOD).Parent(6)); U.D.SY.ET.DLHD = [U.M.apply(UDOD, [[UDOD.addAttrArray, ([{ "style": { "display": "block"}}])]])]; } //评论查看 } //删除评论 U.D.Blog.R.SCPHFRGBL = function (UPE, UDE, UAE, UDOD) { if (!U.U.L.DLTC(3)) { var _URID, _UAID, _UCB; if (U.Ut.isString(UPE)) { _URID = UPE; _UAID = UDE || US.NU; _UCB = UAE; } else { UPE.splice(UPE.inArray(UDE), 1); U.selectEl("#UD_SYBK&div")[4].innerText -= 1 + (UDE["RR"] ? UDE["RR"].length : 0); U.selectEl(UDOD).remove(); _URID = UDE.ReplyID; _UAID = UAE.ArticleID; } //移除评论 //移除元素 //评论数-1 U.A.Request(US.CD, ([US.DB, "UseStudio_Blog", "UB_P_D_DeleteOneReplyAndAllChildReply", US.userInfo.userid, _URID, _UAID || US.NU]), _UCB || U.M.apply, ([""])); //服务器同步 // U.A.Request("pb.DeleteOneReplyAndChildReply", ([US.userInfo.userid, _URID, UAID || US.NU]), _UCB || U.M.apply, ([""])); //服务器同步 } } //弹出回复的回复框 U.D.Blog.R.TCPHFRGBL = function (UAE, UDOD, UPE, UDMD) { if (!U.U.L.DLTC(3)) { var _UDAD, _UDTD = U.selectEl("#UD_SYBNK")[0]; if (!_UDTD) { _UDTD = U.selectEl("#UD_SYBN")[0].parentNode.cloneNode(true); _UDTD.id = "UD_SYBNK"; U.selectEl(_UDTD).Child()[0].onblur = U.D.Blog.R.YCTCPHFRGBL; }; U.selectEl($(_UDTD).Child()[0]).addAttrArray({ "id": "", "innerHTML": "" }); _UDTD.style.display = "block"; _UDAD = U.selectEl(_UDTD).Child(); _UDAD[1].onclick = U.M.apply(this, [[U.D.Blog.R.FBHFRGBL, ([UAE, _UDAD[1], UPE, _UDTD, UDMD])]]); UDOD.insertBefore(_UDTD, UDOD.firstChild); _UDAD[0].focus(); } } //移除评论框 U.D.Blog.R.YCTCPHFRGBL = function () { var _UDTD = U.selectEl(this.parentNode); setTimeout(U.M.apply(_UDTD, [[_UDTD.addAttrArray, ([{ "style": { "display": "none"}}])]]), 500); //延迟执行 } //发表评论 U.D.Blog.R.FBHFRGBL = function (UAE, UDOD, UPE, UDTD, UDMD) { var _UDED = U.M.GTCN(UDOD.parentNode.childNodes)[0], _UHT = _UDED.innerHTML; if (_UHT != "发表回复..." && _UHT != "") { U.A.Request("pb.ReportReply", ([UAE.ArticleID, _UDED.innerHTML, UPE ? (UPE.ReplyParentID || UPE.ReplyID) : "", UPE ? UPE.ReplyAddUserID : ""]), U.D.Blog.R.AsynFBHFRGBL, (["", UAE, _UDED.innerHTML, UPE, UDTD, UDMD])); (UDTD) && (UDTD.style.display = "none"); _UDED.innerText = "发表回复..."; U.Alert("正在发送中..."); } } //添加回复 U.D.Blog.R.TJFBHFRG = function (UAID, UTH) { if (!U.U.L.DLTC(3)) { var _UCB, _UPID = "", _UUID = "", _UDE = arguments; if (_UDE.length < 4) { _UCB = _UDE[2]; } else { _UPID = _UDE[3]; _UUID = _UDE[4]; _UCB = _UDE[5]; } U.A.Request("pb.ReportReply", ([US.userInfo.userid, UAID, UTH, _UPID, _UUID]), U.D.Blog.R.AsynTJFBHFRG, (["", _UCB])); //添加回复到后台 } } //添加回复异步 U.D.Blog.R.AsynTJFBHFRG = function (request) { var context = request.context, _UCB = context[1]; request = request.value; (_UCB) && (_UCB(request)); } //发表评论成功异步 U.D.Blog.R.AsynFBHFRGBL = function (reuqest) { var _UKE, _UME, UPE, _UTH, _UAE, _UDOD, _UDMD, _UDP; context = reuqest.context; reuqest = reuqest.value; _UAE = context[1]; _UTH = context[2]; UPE = context[3]; _UDOD = context[4]; _UDMD = context[5]; _UDPD = U.selectEl("#UD_SYB" + _UAE.ArticleID).find("div")["UD_SYBF"]; (_UKE = (UPE ? UPE["RR"] : _UAE["Reply"][1])).unshift((_UME = new U.D.Blog.R.FRGBLET([_UKE[0] ? (_UKE[0].AllCount + 1) : 1, UPE ? UPE.UserNickName : "", U.MT.SetDT(new Date()), US.userInfo.userid, _UTH, reuqest, UPE ? UPE.ReplyID : "", UPE ? UPE.ReplyAddUserID : "", US.userInfo.UserNickName, US.userInfo.UserThumbnailImageHead]))); //添加新的类 (!UPE) && (_UME["RR"] = []); U.D.Blog.R.PHFRGBL([_UME], (UPE ? (_UDMD || _UDOD.parentNode) : _UDPD), true, _UAE, UPE); U.selectEl("div", _UDPD.parentNode)[14].innerText = _UME.AllCount; //添加回复 } //回复的实体 U.D.Blog.R.FRGBLET = function (UDE) { var i = UDE.length, _UET = ["AllCount", "ParentUserNickName", "ReplyAddTime", "ReplyAddUserID", "ReplyContent", "ReplyID", "ReplyParentID", "ReplyVerifyUserID", "UserNickName", "UserThumbnailImageHead"] while (i--) { this[_UET[i]] = UDE[i] } } //展开缩小消息发送 U.D.Blog.R.SGBL = function (UDOD, TF) { var _UDPD = UDOD.parentNode, _UDE = ["block", { "width": "310px", "height": "25px" }, "none", "UD_SYSXZLRSSV UD_SYI"], _UDAD = U.selectEl(_UDPD).Child(), _UDCD = U.selectEl("div", _UDAD[1]); UDOD = U.selectEl(UDOD); (TF) && (_UDE[0] = "none", _UDE[1] = { "width": "100%", "height": "100px" }, _UDE[2] = "block", _UDE[3] = "UD_SYSXZLRSSVA"); UDOD.addAttrArray({ "style": _UDE[1] }); _UDAD[1].className = _UDE[3]; _UDCD[0].style.display = _UDE[2]; //U.D.SY.DTGBL(_UDCD[1], true); } //#endregion