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