U.D.Blog.F.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. Namespace.register("U.MD.D.Blog.F"); //朋友圈功能区
  2. //#region 查看文章
  3. //获取数据
  4. U.MD.D.Blog.F.GSHGBL = function (UDE, UTF, UDOD) {
  5. if (typeof UDE == "string") { UDE = { "ArticleID": UDE, "JZ": true} }
  6. var _UDOD = U.MD.D.Blog.F.ZKSHGBL(UDE, UTF, UDOD); //获取内容数据
  7. U.MD.D.Blog.R.HFRGBL(UDE, _UDOD, 1); //获取回复内容
  8. }
  9. //获取展开的数据
  10. U.MD.D.Blog.F.ZKSHGBL = function (UDE, TF, UDOD) {
  11. var _UCE,
  12. _UDCD, //元素不存在创建一个 存在则不创建
  13. _UAID = UDE.ArticleID,
  14. _UDTD = $("#UD_SYB" + _UAID); //查看文章详情的最大元素
  15. // _UDCD = _UDTD[0] ? null : $("#UD_SYB").childg(0, 0).clone(true)[0]; //(!TF && !UDOD) && (U.MD.D.H.JBXS(_UDTD), U.UF.SI.PopupWindow(_UDCD)); //U.UF.SI.PopupWindow(_UDTD[0]),
  16. //如果元素不存在创建一个 存在则不创建
  17. if (_UDTD[0]) {
  18. _UDCD = null;
  19. }
  20. else {
  21. _UDCD = $("#UD_SYB").childg()[0];
  22. _UDCD = $(_UDCD).clone(true)[0]
  23. }
  24. (_UDCD) && (_UDCD.id = "");
  25. _UDCD = U.UF.UI.Form({ min: false, max: false, id: "UD_SYB" + _UAID, style: { width: "570px", height: "80%", "maxHeight": "700px" }, content: _UDCD, title: "<div class='UD_SYF_STI'>文章查看</div>", hst: { style: { "padding": "0"}} }).content;
  26. if (UDE.ArticleContent != null && !UDE["JZ"]) { //打印数据
  27. if (UDOD) {
  28. U.MD.D.Blog.F.KZPGBL(UDE, UDOD);
  29. }
  30. else {
  31. U.MD.D.Blog.R.PBPGBL(UDE, _UDCD);
  32. }
  33. if ((_UCE = US.forum.news) && (_$((_UCE = _UCE[0])).Select({ "ArticleID": UDE["ArticleID"] }))[0]) { //移除回复
  34. U.MD.D.Blog.N.SNXX(UDE.ArticleID, _UCE);
  35. }
  36. }
  37. else {//获取内容和回复内容
  38. U.UF.A.Request(US.AUTH, ["ArticleContent", UDE.ArticleID, "Blog"], U.MD.D.Blog.F.AsynZKSHGBL, [[_UDCD, true], UDE, UDOD]);
  39. // U.UF.A.Request(US.CROSSDOMAIN, [US.DB, "UseStudio_Blog", "UB_P_S_SelectArticleInformation", UDE.ArticleID, "Blog"], U.MD.D.Blog.F.AsynZKSHGBL, [[_UDCD, true], UDE, UDOD]);
  40. }
  41. return _UDCD;
  42. }
  43. //获取展开的内容异步
  44. U.MD.D.Blog.F.AsynZKSHGBL = function (r) {
  45. var context = r.context;
  46. r = r.value;
  47. delete context[1]["JZ"];
  48. if (r.length) {
  49. U.UF.Ut.AddObj(context[1], r[0]);
  50. }
  51. else {//获取展开数据
  52. context[1]["KZ"] = true;
  53. }
  54. U.MD.D.Blog.F.ZKSHGBL(context[1], true, context[2]);
  55. }
  56. //展开缩小内容
  57. U.MD.D.Blog.F.KZPGBL = function (UDE, UDOD) {
  58. var _UDTD = $("div.UD_SYSXZLRSRDTRDZD", UDOD.parentNode)[0],
  59. _TF = ["查看更多", true], _UDHD;
  60. if (_UDTD.innerHTML == _TF[0]) {
  61. _TF[0] = "收起";
  62. _TF[1] = false;
  63. }
  64. if (UDE["KZ"]) { U.MD.D.H.SCTPGBL(); }
  65. else { U.MD.D.Blog.TPGBL(UDOD, UDE, _TF[1]); _UDTD.innerHTML = _TF[0]; } //文章是否存在
  66. }
  67. //#endregion
  68. //#region 删除朋友圈
  69. //删除朋友圈
  70. U.MD.D.Blog.F.SCPGBL = function (UDE, UDOD, UTF) {
  71. if (!U.MD.U.L.isLogin(3)) {
  72. U.Alert("正在删除...");
  73. U.UF.A.Request(US.CROSSDOMAIN, [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];
  74. // U.UF.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];
  75. }
  76. }
  77. //移除朋友圈
  78. U.MD.D.Blog.F.AsynSCPGBL = function (r) {
  79. var context = r.context,
  80. _UDOD = context[1],
  81. _UDE = context[2],
  82. _userid = context[3],
  83. _UBE = context[4],
  84. _UCB = context[5];
  85. if (U.UF.Ut.isFunction(_UDOD)) { //移除异步
  86. _UDOD(r.value);
  87. }
  88. else if (!U.UF.Ut.isNull(_UDOD)) {
  89. _UDPD = _UDOD.parentNode; U.Alert("移除消息成功...");
  90. if (_UBE) { //论坛删除消息
  91. if (_UBE["IF"]) { _$[_UBE["IF"][0], _UBE["IF"][3], _UBE["IF"][4], _UBE["IF"][5]].Delete({ "ArticleID": _UDE["ArticleID"] }); } //制定版块删除 非本人
  92. else if (_UBE.length) { _$(_UBE).Delete({ "ArticleID": _UDE["ArticleID"] }); } //本人所有里删除
  93. else { _$(US.userInfo.PB[1][_UBE.UserDirectoryID]).Delete({ "ArticleID": _UDE["ArticleID"] }); } //本人制定版块删除
  94. }
  95. else if (!_UDE.PublishedDirectoryID) { _$(U.MD.D.H.ET["UL"]["HY"][_userid]).Delete({ "ArticleID": _UDE["ArticleID"] }); U.MD.D.Blog.F.YCPYQ(_UDOD); } //朋友圈删除消息
  96. $(_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); };
  97. }
  98. }
  99. //删除朋友圈后 位置变化
  100. U.MD.D.Blog.F.YCPYQ = function (UDOD) {
  101. var i, j, _UTL, _ULE, _UDCD, _UDAD = $(UDOD.parentNode).Child();
  102. for (i = 0; i < _UDAD.length; i++) {
  103. if (_UDAD[i] == UDOD) {
  104. _UTL = [27, 27, 27]; _ULE = [Math.ceil((i + 1) / 3) - 1, i % 3];
  105. 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; } };
  106. U.MD.D.Blog.F.WZPGBL([i + 1, _UDAD.length, -1, _UTL], _UDAD); //打印朋友圈消息
  107. break;
  108. }
  109. }
  110. }
  111. //位置变化
  112. U.MD.D.Blog.F.WZPGBL = function (ITF, UDAD) {
  113. var i, k, _UKE = ITF[3];
  114. for (i = ITF[0]; i < ITF[1]; i++) {
  115. k = (ITF[2] + i) % 3; $(UDAD[i]).addAttrArray({ "style": { "top": _UKE[k] + "px", "left": (361 * k) + "px"} });
  116. _UKE[k] += UDAD[i].offsetHeight + 20;
  117. }
  118. }
  119. //#endregion