Namespace.register("U.MD.D.Blog.F"); //朋友圈功能区 //#region 查看文章 //获取数据 U.MD.D.Blog.F.GSHGBL = function (UDE, UTF, UDOD) { if (typeof UDE == "string") { UDE = { "ArticleID": UDE, "JZ": true } } var _UDOD = U.MD.D.Blog.F.ZKSHGBL(UDE, UTF, UDOD); //获取内容数据 U.MD.D.Blog.R.HFRGBL(UDE, _UDOD, 1); //获取回复内容 } //获取展开的数据 U.MD.D.Blog.F.ZKSHGBL = function (UDE, TF, UDOD) { var _UCE, _UDCD, //元素不存在创建一个 存在则不创建 _UAID = UDE.ArticleID, _UDTD = $("#UD_SYB" + _UAID); //查看文章详情的最大元素 // _UDCD = _UDTD[0] ? null : $("#UD_SYB").childs(0, 0).clone(true)[0]; //(!TF && !UDOD) && (U.MD.D.H.JBXS(_UDTD), U.UF.F.windowTopCenter(_UDCD)); //U.UF.F.windowTopCenter(_UDTD[0]), //如果元素不存在创建一个 存在则不创建 if (_UDTD[0]) { _UDCD = null; } else { _UDCD = $("#UD_SYB").childs()[0]; _UDCD = $(_UDCD).clone(true)[0] } if (_UDCD) { _UDCD.id = "" } //_UDCD = new U.UF.UI.form({ min: false, max: false, id: "UD_SYB" + _UAID, style: { width: "570px", height: "80%", "maxHeight": "700px" }, content: _UDCD, title: "
文章查看
", hst: { style: { "padding": "0"}} }).content; //title, content, formattr, formfun, parentel, contentattr, headattr, headbottomattr _UDCD = new U.UF.UI.form("
文章查看
", _UDCD, { id: "UD_SYB" + _UAID, style: { width: "570px", height: "80%", "maxHeight": "700px" } }, { isnarrow: false, isenlarge: false }).middle; if (UDE.ArticleContent != null && !UDE["JZ"]) { //打印数据 if (UDOD) { U.MD.D.Blog.F.KZPGBL(UDE, UDOD); } else { U.MD.D.Blog.R.PBPGBL(UDE, _UDCD); } if ((_UCE = US.forum.news) && (_$.select((_UCE = _UCE[0]), { "ArticleID": UDE["ArticleID"] }))[0]) { //移除回复 U.MD.D.Blog.N.SNXX(UDE.ArticleID, _UCE); } } else {//获取内容和回复内容 U.A.Request(US.AUTH, ["ArticleContent", UDE.ArticleID, "Blog"], U.MD.D.Blog.F.AsynZKSHGBL, [[_UDCD, true], UDE, UDOD]); // U.A.Request(US.CD, [US.DB, "UseStudio_Blog", "UB_P_S_SelectArticleInformation", UDE.ArticleID, "Blog"], U.MD.D.Blog.F.AsynZKSHGBL, [[_UDCD, true], UDE, UDOD]); } return _UDCD; } //获取展开的内容异步 U.MD.D.Blog.F.AsynZKSHGBL = function (r) { var _context = r.context; r = r.value; delete _context[1]["JZ"]; if (r.length) { for (var i in r[0]) { if (r[0].hasOwnProperty(i)) { _context[1][i] = r[0][i]; } } } else {//获取展开数据 _context[1]["KZ"] = true; } U.MD.D.Blog.F.ZKSHGBL(_context[1], true, _context[2]); } //展开缩小内容 U.MD.D.Blog.F.KZPGBL = function (UDE, UDOD) { var _UDTD = $("div.UD_SYSXZLRSRDTRDZD", UDOD.parentNode)[0], _TF = ["查看更多", true], _UDHD; if (_UDTD.innerHTML == _TF[0]) { _TF[0] = "收起"; _TF[1] = false; } if (UDE["KZ"]) { U.MD.D.H.SCTPGBL(); } else { U.MD.D.Blog.TPGBL(UDOD, UDE, _TF[1]); _UDTD.innerHTML = _TF[0]; } //文章是否存在 } //#endregion //#region 删除朋友圈 //删除朋友圈 U.MD.D.Blog.F.SCPGBL = function (UDE, UDOD, UTF) { if (!U.MD.U.L.isLogin()) { U.Alert("正在删除..."); U.A.Request(US.CD, [US.DB, "UseStudio_Blog", "UB_P_D_DeleteArticleAllReply", US.userInfo.userid, UDE.ArticleID || UDE]), U.MD.D.Blog.F.AsynSCPGBL, ["", UDOD, UDE, U.MD.D.H.ET["UL"]["HY"]["userid"], UTF]; // U.A.Request(US.AUTH,"pb.DeleteArticleAndAllReply", [US.userInfo.userid, UDE.ArticleID || UDE]), U.MD.D.Blog.F.AsynSCPGBL, ["", UDOD, UDE, U.MD.D.H.ET["UL"]["HY"]["userid"], UTF]; } } //移除朋友圈 U.MD.D.Blog.F.AsynSCPGBL = function (r) { var _context = r.context, _UDOD = _context[1], _UDE = _context[2], _userid = _context[3], _UBE = _context[4], _UCB = _context[5]; if (U.UF.C.isFunction(_UDOD)) { //移除异步 _UDOD(r.value); } else if (!U.UF.Ut.isNull(_UDOD)) { _UDPD = _UDOD.parentNode; U.Alert("移除消息成功..."); if (_UBE) { //论坛删除消息 if (_UBE["IF"]) { _$.del([[_UBE["IF"][0], _UBE["IF"][3], _UBE["IF"][4], _UBE["IF"][5]]], { "ArticleID": _UDE["ArticleID"] }); } //制定版块删除 非本人 else if (_UBE.length) { _$.del(_UBE, { "ArticleID": _UDE["ArticleID"] }); } //本人所有里删除 else { _$.del(US.userInfo.PB[1][_UBE.UserDirectoryID], { "ArticleID": _UDE["ArticleID"] }); } //本人制定版块删除 } else if (!_UDE.PublishedDirectoryID) { _$.del(U.MD.D.H.ET["UL"]["HY"][_userid], { "ArticleID": _UDE["ArticleID"] }); U.MD.D.Blog.F.YCPYQ(_UDOD); } //朋友圈删除消息 $(_UDOD).remove(); if (_UBE || _UDE.PublishedDirectoryID) { if (_UDE.PublishedDirectoryID || (_UBE.length || (_UBE["IF"] && _UBE["IF"][0][1].length) || (!_UBE["IF"] && US.userInfo.PB[1][_UBE.UserDirectoryID][1].length))) { U.MD.D.PB.NSYPBL(_UDPD, null, null, true); } else { U.MD.D.PB.PMHBKK(_UDPD); } } //else if (_UDPD.id == "UD_SYSXZLRSRD") { U.MD.D.Blog.ZXWZ(_UDPD, 0); }; } } //删除朋友圈后 位置变化 U.MD.D.Blog.F.YCPYQ = function (UDOD) { var i, j, _UTL, _ULE, _UDCD, _UDAD = $(UDOD.parentNode).Child(); for (i = 0; i < _UDAD.length; i++) { if (_UDAD[i] == UDOD) { _UTL = [27, 27, 27]; _ULE = [Math.ceil((i + 1) / 3) - 1, i % 3]; if (i > 0) { for (j = 0; j < 3; j++) { _UDCD = _UDAD[((_ULE[0] - (j < _ULE[1] ? 0 : 1)) * 3) + j]; _UTL[j] = _UDCD ? _UDCD["offsetHeight"] + _UDCD["offsetTop"] + 27 : 27; } }; U.MD.D.Blog.F.WZPGBL([i + 1, _UDAD.length, -1, _UTL], _UDAD); //打印朋友圈消息 break; } } } //位置变化 U.MD.D.Blog.F.WZPGBL = function (ITF, UDAD) { var i, k, _UKE = ITF[3]; for (i = ITF[0]; i < ITF[1]; i++) { k = (ITF[2] + i) % 3; $(UDAD[i]).addAttrArray({ "style": { "top": _UKE[k] + "px", "left": (361 * k) + "px" } }); _UKE[k] += UDAD[i].offsetHeight + 20; } } //#endregion