Namespace.register("U.D.Blog.F"); //朋友圈功能区
//#region 查看文章
//获取数据
U.D.Blog.F.GSHGBL = function (UDE, UTF, UDOD) {
if (typeof UDE == "string") { UDE = { "ArticleID": UDE, "JZ": true} }
var _UDOD = U.D.Blog.F.ZKSHGBL(UDE, UTF, UDOD); //获取内容数据
U.D.Blog.R.HFRGBL(UDE, _UDOD, 1); //获取回复内容
}
//获取展开的数据
U.D.Blog.F.ZKSHGBL = function (UDE, TF, UDOD) {
var _UCE,
_UDCD, //元素不存在创建一个 存在则不创建
_UAID = UDE.ArticleID,
_UDTD = U.selectEl("#UD_SYB" + _UAID); //查看文章详情的最大元素
// _UDCD = _UDTD[0] ? null : U.selectEl("#UD_SYB").childg(0, 0).clone(true)[0]; //(!TF && !UDOD) && (U.D.SY.JBXS(_UDTD), U.D.PopupWindow(_UDCD)); //U.D.PopupWindow(_UDTD[0]),
//如果元素不存在创建一个 存在则不创建
if (_UDTD[0]) {
_UDCD = null;
}
else {
_UDCD = U.selectEl("#UD_SYB").childg()[0];
_UDCD = U.selectEl(_UDCD).clone(true)[0]
}
(_UDCD) && (_UDCD.id = "");
_UDCD = U.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;
if (UDE.ArticleContent != null && !UDE["JZ"]) { //打印数据
if (UDOD) {
U.D.Blog.F.KZPGBL(UDE, UDOD);
}
else {
U.D.Blog.R.PBPGBL(UDE, _UDCD);
}
if ((_UCE = US.PB.News) && (_$((_UCE = _UCE[0])).Select({ "ArticleID": UDE["ArticleID"] }))[0]) { //移除回复
U.D.Blog.N.SNXX(UDE.ArticleID, _UCE);
}
}
else {//获取内容和回复内容
U.A.Request("pb.ArticleContent", ([UDE.ArticleID, "Blog"]), U.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.D.Blog.F.AsynZKSHGBL, ([[_UDCD, true], UDE, UDOD]));
}
return _UDCD;
}
//获取展开的内容异步
U.D.Blog.F.AsynZKSHGBL = function (request) {
var context = request.context;
request = request.value;
delete context[1]["JZ"];
if (request.length) {
U.Ut.AddObj(context[1], request[0]);
}
else {//获取展开数据
context[1]["KZ"] = true;
}
U.D.Blog.F.ZKSHGBL(context[1], true, context[2]);
}
//展开缩小内容
U.D.Blog.F.KZPGBL = function (UDE, UDOD) {
var _UDTD = U.selectEl("div.UD_SYSXZLRSRDTRDZD", UDOD.parentNode)[0],
_TF = ["查看更多", true], _UDHD;
if (_UDTD.innerHTML == _TF[0]) {
_TF[0] = "收起";
_TF[1] = false;
}
if (UDE["KZ"]) { U.D.SY.SCTPGBL(); }
else { U.D.Blog.TPGBL(UDOD, UDE, _TF[1]); _UDTD.innerHTML = _TF[0]; } //文章是否存在
}
//#endregion
//#region 删除朋友圈
//删除朋友圈
U.D.Blog.F.SCPGBL = function (UDE, UDOD, UTF) {
if (!U.U.L.DLTC(3)) {
U.Alert("正在删除...");
U.A.Request(US.CD, ([US.DB, "UseStudio_Blog", "UB_P_D_DeleteArticleAllReply", US.userInfo.userid, UDE.ArticleID || UDE]), U.D.Blog.F.AsynSCPGBL, (["", UDOD, UDE, U.D.SY.ET["UL"]["HY"]["UID"], UTF]));
// U.A.Request("pb.DeleteArticleAndAllReply", ([US.userInfo.userid, UDE.ArticleID || UDE]), U.D.Blog.F.AsynSCPGBL, (["", UDOD, UDE, U.D.SY.ET["UL"]["HY"]["UID"], UTF]));
}
}
//移除朋友圈
U.D.Blog.F.AsynSCPGBL = function (request) {
var context = request.context,
_UDOD = context[1],
_UDE = context[2],
_UID = context[3],
_UBE = context[4],
_UCB = context[5];
if (U.Ut.isFunction(_UDOD)) { //移除异步
_UDOD(request.value);
}
else if (!U.Ut.isNull(_UDOD)) {
_UDPD = _UDOD.parentNode; U.Alert("移除消息成功...");
if (_UBE) { //论坛删除消息
if (_UBE["IF"]) { _$([_UBE["IF"][0], _UBE["IF"][3], _UBE["IF"][4], _UBE["IF"][5]]).Delete({ "ArticleID": _UDE["ArticleID"] }); } //制定版块删除 非本人
else if (_UBE.length) { _$(_UBE).Delete({ "ArticleID": _UDE["ArticleID"] }); } //本人所有里删除
else { _$(US.userInfo.PB[1][_UBE.UserDirectoryID]).Delete({ "ArticleID": _UDE["ArticleID"] }); } //本人制定版块删除
}
else if (!_UDE.PublishedDirectoryID) { _$(U.D.SY.ET["UL"]["HY"][_UID]).Delete({ "ArticleID": _UDE["ArticleID"] }); U.D.Blog.F.YCPYQ(_UDOD); } //朋友圈删除消息
U.selectEl(_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.D.PB.NSYPBL(_UDPD, null, null, true); } else { U.D.PB.PMHBKK(_UDPD); } } //else if (_UDPD.id == "UD_SYSXZLRSRD") { U.D.Blog.ZXWZ(_UDPD, 0); };
}
}
//删除朋友圈后 位置变化
U.D.Blog.F.YCPYQ = function (UDOD) {
var i, j, _UTL, _ULE, _UDCD, _UDAD = U.selectEl(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.D.Blog.F.WZPGBL([i + 1, _UDAD.length, -1, _UTL], _UDAD); //打印朋友圈消息
break;
}
}
}
//位置变化
U.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; U.selectEl(UDAD[i]).addAttrArray({ "style": { "top": _UKE[k] + "px", "left": (361 * k) + "px"} });
_UKE[k] += UDAD[i].offsetHeight + 20;
}
}
//#endregion