U.D.Blog.A.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. Namespace.register("U.MD.D.Blog.A");
  2. //Blog帖子处理
  3. //#region 朋友圈发表
  4. //blog首页点击我要发布
  5. U.MD.D.Blog.A.FBCKME = function () {
  6. U.MD.U.L.SYDLHD(U.UF.M.apply(null, [[U.UF.UI.EditorLoad, ([{
  7. imgt: 9,
  8. style: {
  9. width: "600px",
  10. height: "500px"
  11. },
  12. title: false,
  13. name: "朋友圈",
  14. car: {
  15. onpaste: "U.MD.D.H.CPTATGBL(this);"
  16. },
  17. fcb: U.MD.D.Blog.A.FBGBL,
  18. upload: true
  19. }])]]));
  20. }
  21. //发帖子变化
  22. U.MD.D.Blog.A.BHFBGBL = function (UDOD, UTF) {
  23. if (!UTF || !U.MD.U.L.isLogin()) {
  24. var i, j, _UDTD, _UDAD, _UMT = UTF ? "removeClass" : "addClass", _UDE = ["UD_SYSXZLRSAAO", "UD_SYSXZLRSAOO", "UD_SYSXZLRSATO"];
  25. UDOD = UDOD.length ? UDOD : [UDOD];
  26. for (i = 0; i < UDOD.length; i++) {
  27. _UDAD = (_UDTD = $(UDOD[i])).Child();
  28. _UDTD[_UMT](_UDE[0], 0);
  29. for (j = 1; j < _UDAD.length; j++) {
  30. $(_UDAD[j])[_UMT](_UDE[j]);
  31. }
  32. ; (UTF) && (_UDAD[1].focus());
  33. }
  34. }
  35. }
  36. //发表文章字限制
  37. U.MD.D.Blog.A.OKFBGBL = function (UDOD) {
  38. var _UHT = UDOD.innerText;
  39. if (!_UHT.count()>300) {
  40. U.UF.M.StopDefault();
  41. U.Alert("文字输入无法大于150");
  42. }
  43. //阻止输出
  44. }
  45. //发表文章
  46. U.MD.D.Blog.A.FBGBL = function (UCT, UTI, UIMG) {
  47. var i;
  48. UCT = UCT.substrU(300);
  49. if (UIMG) {
  50. for (i = 0; i < UIMG.length; i++) {
  51. UCT += UIMG[i].outerHTML;
  52. }
  53. }
  54. //添加图片
  55. U.Alert("发表中...");
  56. U.UF.A.Request(US.AUTH, ["addArticle", US.FORUMROOTID, "", UCT, "blog"], U.MD.D.Blog.A.AsynFBGBL, ["", UCT]);
  57. //发送文章
  58. }
  59. //发表文章异步
  60. U.MD.D.Blog.A.AsynFBGBL = function (r) {
  61. var _UDE, _UKE, _UDTD, _UDOD = $("#UD_SYSXZBR")[0], _userid = US.userInfo.userid, context = r.context;
  62. r = r.value;
  63. if (r) {
  64. _UDE = U.MD.D.Blog.A.BLEI[r, 0, 0, U.UF.D.toTimeStamp(new Date()), context[1], context[1].substr(0, 100), US.userInfo.userid, US.userInfo.UserName, US.userInfo.UserThumbnailImageHead, 0];
  65. //添加实体
  66. _UKE = U.MD.D.H.ET["UL"]["HY"][_userid];
  67. (_UKE && (_UKE = _UKE[1])) && ((!_UKE.length) && (_UDOD.innerText = ""),
  68. _UKE.push(_UDE));
  69. U.MD.D.Blog.PGBL(_UDOD, [_UDE], null, 0, true);
  70. U.Alert("成功发表");
  71. }
  72. }
  73. //朋友圈的实体
  74. U.MD.D.Blog.A.BLEI = function (UTE) {
  75. var i, _UDE = ["ArticleID", "AricitleReadNumber", "ArticleReplayNumber", "ArticleAddTime", "ArticleContent", "ArticleContentBrief", "UserID", "UserName", "UserThumbnailImageHead", "ArticleZFN"];
  76. return _$().NL(_UDE, UTE);
  77. }
  78. //#endregion
  79. //#region 转发朋友圈
  80. //转发朋友圈
  81. U.MD.D.Blog.A.PAZF = function (UDE, UDMD) {
  82. if (U.MD.U.L.isLogin(3)) {
  83. var _UDTD, _UDSD, _UDOD = $("#UD_SYR"), _UDAD = _UDOD.Child()
  84. _UDOD.css("display", "block");
  85. U.UF.UI.Form({
  86. draw: false,
  87. max: false,
  88. id: "UD_SYRA",
  89. title: "<div class='UD_SYF_STI'>转发使用</div>",
  90. content: _UDOD[0],
  91. style: {
  92. width: "500px",
  93. height: "360px"
  94. },
  95. hst: {
  96. style: {
  97. padding: "0"
  98. }
  99. }
  100. }).be;
  101. (_UDSD = $("div", _UDAD[1])[0]).innerHTML = "可添加内容...";
  102. U.MD.D.Blog.A.PAZFP(UDE, _UDAD[2]);
  103. (_UDTD = $(_UDAD[3]).Child())[1].onclick = U.UF.M.apply(_UDTD, [[U.MD.D.Blog.A.SPAZFF, [UDE, _UDSD, UDMD]], [_UDTD[0].onclick]]);
  104. _UDSD.focus();
  105. }
  106. }
  107. //打印
  108. U.MD.D.Blog.A.PAZFP = function (UDE, UDOD) {
  109. UDOD.innerHTML = "";
  110. var _UTC, _UDSD, _UDMD, _UDTD = $$("div", {
  111. "className": "UD_SYRML"
  112. }, UDOD);
  113. $$("img", {
  114. "onerror": U.UF.M.ImgError,
  115. "title": "点击查看",
  116. "onclick": [[U.UF.M.StopBubble], [U.MD.U.I.ViewOtherUserInfo, [UDE.UserID]]],
  117. "src": U.UF.M.GetImgU(UDE.UserThumbnailImageHead)
  118. }, _UDTD);
  119. _UDTD = $$("div", {
  120. "className": "UD_SYRMR"
  121. }, UDOD);
  122. _UDSD = $$("div", {
  123. "className": "UD_SYRMRS"
  124. }, _UDTD);
  125. $$("div", {
  126. "className": "UD_SYRMRSL",
  127. "innerHTML": UDE.UserNickName || UDE.UserName
  128. }, _UDSD);
  129. $$("div", {
  130. "className": "UD_SYRMRSR",
  131. "innerHTML": U.UF.D.getDateInterval(UDE.ArticleAddTime)
  132. }, _UDSD);
  133. _UDSD = $$("div", {
  134. "className": "UD_SYRMRX",
  135. "innerHTML": (_UTC = UDE["ArticleContentBrief"])
  136. }, _UDTD);
  137. _UDSD.innerText = (_UTC = _UDSD.innerText).length > 30 ? _UTC.substr(0, 50) + "..." : _UTC
  138. }
  139. //点击转发朋友圈
  140. U.MD.D.Blog.A.SPAZFF = function (UDE, UDOD) {
  141. if (UDE.ArticleContent && !UDE["JZ"]) {
  142. U.MD.D.Blog.A.PAZFF(UDE, UDOD);
  143. }
  144. else {
  145. U.UF.A.Request(US.CROSSDOMAIN, [US.DB, "UseStudio_Blog", "UB_P_S_SelectArticleInformation", UDE.ArticleID], U.MD.D.Blog.A.AsynSPAZFF, ["", UDE, UDOD]);
  146. // U.UF.A.Request(US.AUTH,"pb.ArticleContent", [UDE.ArticleID, "Blog"], U.MD.D.Blog.A.AsynSPAZFF, ["", UDE, UDOD]);
  147. }
  148. //获取内容和回复内容
  149. }
  150. //异步获取消息内容
  151. U.MD.D.Blog.A.AsynSPAZFF = function (r) {
  152. var context = r.context;
  153. var _UDE = context[1];
  154. var _UDOD = context[2];
  155. //_$(_UDE).Add(r.value[0]);
  156. U.UF.Ut.AddObj(_UDE, r.value[0]);
  157. delete _UDE["JZ"];
  158. U.MD.D.Blog.A.SPAZFF(_UDE, _UDOD);
  159. }
  160. //发送转发
  161. U.MD.D.Blog.A.PAZFF = function (UDE, UDOD) {
  162. var _UTF, _UKE = [], _UTH = UDOD.innerHTML;
  163. (_UTH == "可添加内容...") && (_UTH = "");
  164. U.Alert("转发中...");
  165. U.UF.A.Request(US.CROSSDOMAIN, ([US.DB, "UseStudio_Blog", "UB_P_A_AddZFLR", US.userInfo.userid, Guid.newGuid(), UDE.ArticleID, US.FORUMROOTID,
  166. _UTH, UDOD.innerText.substr(200) + (UDOD.innerText.length > 200 ? "..." : "") + $("img", UDOD)[0].outerHTML]), U.MD.D.Blog.A.AsynSPAZFF, ["", UDE, UDOD]);
  167. // U.UF.A.Request(US.AUTH,"pb.ZFArticle", [US.userInfo.userid, US.FORUMROOTID, UDE.ArticleID, _UTH], U.MD.D.Blog.A.AsynPAZFF, ["", _UTH, UDE]);
  168. //服务器同步中
  169. }
  170. //发送转发异步
  171. U.MD.D.Blog.A.AsynPAZFF = function (r) {
  172. var _UKE, _UDTD = $("#UD_SYSXZLLRTA").Child()[2];
  173. _userid = US.userInfo.userid,
  174. _UGE = U.MD.D.H.ET["UL"]["HY"],
  175. context = r.context,
  176. _UTH = context[1],
  177. _UDE = context[2],
  178. _UDOD = $$("div", {
  179. "innerHTML": _UTH
  180. });
  181. r = r.value;
  182. _UKE = U.MD.D.Blog.A.BLEI[r, 0, 0, U.UF.D.toTimeStamp(new Date()), _UTH, _UDOD.innerText.substr(0, 100), US.userInfo.userid, US.userInfo.UserNickName, US.userInfo.UserThumbnailImageHead, 0];
  183. //添加实体
  184. U.UF.Ut.AddObj(_UKE, {
  185. "Forward": _UDE["ArticleID"],
  186. "ZF": _UDE
  187. });
  188. (_UGE = _UGE[_userid]) && (_UGE[1] = _UGE[1] || [],
  189. _UGE[1].unshift(_UKE));
  190. //添加转发的数据
  191. if (_UDTD.className == "UD_SYSXZLLRTO") {
  192. U.MD.D.Blog.PGBL($("#UD_SYSXZLRSRD")[0], [_UKE], null, 0, true);
  193. } else {
  194. U.MD.D.H.HDSY["none", "block"];
  195. _UDTD.onclick();
  196. }
  197. //显示转发
  198. }
  199. //#endregion