123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- Namespace.register("U.MD.D.Blog.A");
- //Blog帖子处理
- //#region 朋友圈发表
- //blog首页点击我要发布
- U.MD.D.Blog.A.FBCKME = function () {
- U.MD.U.L.SYDLHD(U.UF.M.apply(null, [[U.UF.UI.EditorLoad, ([{
- imgt: 9,
- style: {
- width: "600px",
- height: "500px"
- },
- title: false,
- name: "朋友圈",
- car: {
- onpaste: "U.MD.D.H.CPTATGBL(this);"
- },
- fcb: U.MD.D.Blog.A.FBGBL,
- upload: true
- }])]]));
- }
- //发帖子变化
- U.MD.D.Blog.A.BHFBGBL = function (UDOD, UTF) {
- if (!UTF || !U.MD.U.L.isLogin()) {
- var i, j, _UDTD, _UDAD, _UMT = UTF ? "removeClass" : "addClass", _UDE = ["UD_SYSXZLRSAAO", "UD_SYSXZLRSAOO", "UD_SYSXZLRSATO"];
- UDOD = UDOD.length ? UDOD : [UDOD];
- for (i = 0; i < UDOD.length; i++) {
- _UDAD = (_UDTD = $(UDOD[i])).Child();
- _UDTD[_UMT](_UDE[0], 0);
- for (j = 1; j < _UDAD.length; j++) {
- $(_UDAD[j])[_UMT](_UDE[j]);
- }
- ; (UTF) && (_UDAD[1].focus());
- }
- }
- }
- //发表文章字限制
- U.MD.D.Blog.A.OKFBGBL = function (UDOD) {
- var _UHT = UDOD.innerText;
- if (!_UHT.count() > 300) {
- U.UF.M.StopDefault();
- U.Alert("文字输入无法大于150");
- }
- //阻止输出
- }
- //发表文章
- U.MD.D.Blog.A.FBGBL = function (UCT, UTI, UIMG) {
- var i;
- UCT = UCT.substrU(300);
- if (UIMG) {
- for (i = 0; i < UIMG.length; i++) {
- UCT += UIMG[i].outerHTML;
- }
- }
- //添加图片
- U.Alert("发表中...");
- U.UF.A.Request(US.AUTH, ["addArticle", US.FORUMROOTID, "", UCT, "blog"], U.MD.D.Blog.A.AsynFBGBL, ["", UCT]);
- //发送文章
- }
- //发表文章异步
- U.MD.D.Blog.A.AsynFBGBL = function (r) {
- var _UDE, _UKE, _UDTD, _UDOD = $("#UD_SYSXZBR")[0], _userid = US.userInfo.userid, context = r.context;
- r = r.value;
- if (r) {
- _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];
- //添加实体
- _UKE = U.MD.D.H.ET["UL"]["HY"][_userid];
- (_UKE && (_UKE = _UKE[1])) && ((!_UKE.length) && (_UDOD.innerText = ""),
- _UKE.push(_UDE));
- U.MD.D.Blog.PGBL(_UDOD, [_UDE], null, 0, true);
- U.Alert("成功发表");
- }
- }
- //朋友圈的实体
- U.MD.D.Blog.A.BLEI = function (UTE) {
- var i, _UDE = ["ArticleID", "AricitleReadNumber", "ArticleReplayNumber", "ArticleAddTime", "ArticleContent", "ArticleContentBrief", "UserID", "UserName", "UserThumbnailImageHead", "ArticleZFN"];
- return _$().NL(_UDE, UTE);
- }
- //#endregion
- //#region 转发朋友圈
- //转发朋友圈
- U.MD.D.Blog.A.PAZF = function (UDE, UDMD) {
- if (U.MD.U.L.isLogin(3)) {
- var _UDTD, _UDSD, _UDOD = $("#UD_SYR"), _UDAD = _UDOD.Child()
- _UDOD.css("display", "block");
- U.UF.UI.Form({
- draw: false,
- max: false,
- id: "UD_SYRA",
- title: "<div class='UD_SYF_STI'>转发使用</div>",
- content: _UDOD[0],
- style: {
- width: "500px",
- height: "360px"
- },
- hst: {
- style: {
- padding: "0"
- }
- }
- }).be;
- (_UDSD = $("div", _UDAD[1])[0]).innerHTML = "可添加内容...";
- U.MD.D.Blog.A.PAZFP(UDE, _UDAD[2]);
- (_UDTD = $(_UDAD[3]).Child())[1].onclick = U.UF.M.apply(_UDTD, [[U.MD.D.Blog.A.SPAZFF, [UDE, _UDSD, UDMD]], [_UDTD[0].onclick]]);
- _UDSD.focus();
- }
- }
- //打印
- U.MD.D.Blog.A.PAZFP = function (UDE, UDOD) {
- UDOD.innerHTML = "";
- var _UTC, _UDSD, _UDMD, _UDTD = $$("div", {
- "className": "UD_SYRML"
- }, UDOD);
- $$("img", {
- "onerror": U.UF.M.ImgError,
- "title": "点击查看",
- "onclick": [[U.UF.M.StopBubble], [U.MD.U.I.ViewOtherUserInfo, [UDE.UserID]]],
- "src": U.UF.M.GetImgU(UDE.UserThumbnailImageHead)
- }, _UDTD);
- _UDTD = $$("div", {
- "className": "UD_SYRMR"
- }, UDOD);
- _UDSD = $$("div", {
- "className": "UD_SYRMRS"
- }, _UDTD);
- $$("div", {
- "className": "UD_SYRMRSL",
- "innerHTML": UDE.UserNickName || UDE.UserName
- }, _UDSD);
- $$("div", {
- "className": "UD_SYRMRSR",
- "innerHTML": U.UF.D.getDateInterval(UDE.ArticleAddTime)
- }, _UDSD);
- _UDSD = $$("div", {
- "className": "UD_SYRMRX",
- "innerHTML": (_UTC = UDE["ArticleContentBrief"])
- }, _UDTD);
- _UDSD.innerText = (_UTC = _UDSD.innerText).length > 30 ? _UTC.substr(0, 50) + "..." : _UTC
- }
- //点击转发朋友圈
- U.MD.D.Blog.A.SPAZFF = function (UDE, UDOD) {
- if (UDE.ArticleContent && !UDE["JZ"]) {
- U.MD.D.Blog.A.PAZFF(UDE, UDOD);
- }
- else {
- U.UF.A.Request(US.CROSSDOMAIN, [US.DB, "UseStudio_Blog", "UB_P_S_SelectArticleInformation", UDE.ArticleID], U.MD.D.Blog.A.AsynSPAZFF, ["", UDE, UDOD]);
- // U.UF.A.Request(US.AUTH,"pb.ArticleContent", [UDE.ArticleID, "Blog"], U.MD.D.Blog.A.AsynSPAZFF, ["", UDE, UDOD]);
- }
- //获取内容和回复内容
- }
- //异步获取消息内容
- U.MD.D.Blog.A.AsynSPAZFF = function (r) {
- var context = r.context;
- var _UDE = context[1];
- var _UDOD = context[2];
- //_$(_UDE).Add(r.value[0]);
- U.UF.Ut.AddObj(_UDE, r.value[0]);
- delete _UDE["JZ"];
- U.MD.D.Blog.A.SPAZFF(_UDE, _UDOD);
- }
- //发送转发
- U.MD.D.Blog.A.PAZFF = function (UDE, UDOD) {
- var _UTF, _UKE = [], _UTH = UDOD.innerHTML;
- (_UTH == "可添加内容...") && (_UTH = "");
- U.Alert("转发中...");
- U.UF.A.Request(US.CROSSDOMAIN, ([US.DB, "UseStudio_Blog", "UB_P_A_AddZFLR", US.userInfo.userid, Guid.newGuid(), UDE.ArticleID, US.FORUMROOTID,
- _UTH, UDOD.innerText.substr(200) + (UDOD.innerText.length > 200 ? "..." : "") + $("img", UDOD)[0].outerHTML]), U.MD.D.Blog.A.AsynSPAZFF, ["", UDE, UDOD]);
- // U.UF.A.Request(US.AUTH,"pb.ZFArticle", [US.userInfo.userid, US.FORUMROOTID, UDE.ArticleID, _UTH], U.MD.D.Blog.A.AsynPAZFF, ["", _UTH, UDE]);
- //服务器同步中
- }
- //发送转发异步
- U.MD.D.Blog.A.AsynPAZFF = function (r) {
- var _UKE, _UDTD = $("#UD_SYSXZLLRTA").Child()[2];
- _userid = US.userInfo.userid,
- _UGE = U.MD.D.H.ET["UL"]["HY"],
- context = r.context,
- _UTH = context[1],
- _UDE = context[2],
- _UDOD = $$("div", {
- "innerHTML": _UTH
- });
- r = r.value;
- _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];
- //添加实体
- U.UF.Ut.AddObj(_UKE, {
- "Forward": _UDE["ArticleID"],
- "ZF": _UDE
- });
- (_UGE = _UGE[_userid]) && (_UGE[1] = _UGE[1] || [],
- _UGE[1].unshift(_UKE));
- //添加转发的数据
- if (_UDTD.className == "UD_SYSXZLLRTO") {
- U.MD.D.Blog.PGBL($("#UD_SYSXZLRSRD")[0], [_UKE], null, 0, true);
- } else {
- U.MD.D.H.HDSY["none", "block"];
- _UDTD.onclick();
- }
- //显示转发
- }
- //#endregion
|