123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393 |
-
- Namespace.register("U.MD.F");
- U.MD.F.initFriend = U.MD.F.CSHFG = function () {
-
- if ($("#U_MD_F_H_Z")[0]) {
- var i,
- _friendinfo,
- _selectbottomel,
- _childsel,
- _chatform = $("#U_MD_F_H_Z")[0],
- _userinfoel = $("#U_MD_F_H_ZLTI", _chatform)[0];
-
- U.MD.F.W.friendDisplayAndNone([{
- "display": "none",
- "left": "auto"
- },
- {
- "display": "block",
- "top": (US.height - 530) / 2,
- "right": "0px"
- }],
- true);
-
- $($("img", _userinfoel)[0] || $$("img")).addAttrArray({
- "onerror": U.MD.C.imgError,
- "src": U.MD.C.getHeadImage(US.userInfo.UserThumbnailImageHead),
- "onclick": U.MD.U.P.userDataSet
- }).appendTo(_userinfoel);
- if (US.friend.recentcontacts.length) {
- _friendinfo = US.friend.recentcontacts;
- }
- else {
- _friendinfo = US.friend.friends;
- }
-
- U.MD.F.printRightFormFriend(_friendinfo, $("#U_MD_F_H_RC")[0]);
-
- _selectbottomel = $("#U_MD_F_H_ZLTA").Child()[0];
- $(_selectbottomel).Child()[0].onclick();
- }
- }
- U.MD.F.printRightFormFriend = function (friendinfo, el) {
- var i,
- _tempel,
- _temponeel,
- _frag = $$("frag"),
- _childs = $(el).Child();
-
- for (i = 1; i < _childs.length; i++) {
- el.removeChild(_childs[i]);
- }
-
- if (friendinfo.length) {
-
- for (i = 0; (i < friendinfo.length && i < 11); i++) {
- if (friendinfo[i].tf == 1) {
- friendinfo[i] = U.Json.select(US.friend.group, { "GroupManageID": friendinfo[i].UserId })[0];
- _friendoneel = $$("div", { "className": "U_MD_F_H_ZLZOCOI", "style": { "margin": "9px 0 0 10px" }, "title": friendinfo[i].GroupManageName, "onclick": U.UF.C.closure(function (friendinfo) {
- U.UF.EV.stopBubble();
- U.MD.F.N.CanelMarkMessage(friendinfo.GroupManageID);
- U.MD.F.W.popupFriendsForm(friendinfo);
- }, [friendinfo[i]])
- }, _frag);
- U.MD.F.printGroupHeadImage(friendinfo[i], _friendoneel, 4, [35, 35]);
- } else {
- $$("img",
- {
- "onerror": U.MD.C.imgError,
- "title": friendinfo[i]["FriendsDescript"],
- "className": "U_MD_F_H_RCI",
- "src": U.MD.C.getHeadImage(friendinfo[i].UserThumbnailImageHead),
- "alt": friendinfo[i].FriendsDescript || friendinfo[i].UserNickName,
- "onclick": U.UF.C.closure(function (friendinfo) {
- U.UF.EV.stopBubble();
- U.MD.F.W.popupFriendsForm(friendinfo);
- U.MD.F.N.CanelMarkMessage(friendinfo.UserID);
- }, [friendinfo[i]])
- }, _frag);
- }
- }
- }
-
- else {
- _tempel = $$("div", { "className": "U_MD_F_H_RCT" }, _frag);
- _temponeel = $$("div", { "className": "U_MD_F_H_RCTS" }, _tempel);
- $$("img", { "onerror": U.MD.C.imgError, "src": "/img/YSUN.png" }, _temponeel);
- $$("div", { "className": "U_MD_F_H_RCTZ U_Img" }, _tempel);
- $$("div", { "className": "U_MD_F_H_RCTX", "innerHTML": "暂时无追随" }, _tempel);
- }
- var _tipsicon = $$("div", { className: "U_MD_D_NewsTipsIcon" }, _frag);
- el.appendChild(_frag);
- }
- U.MD.F.printFriendOrGroup = function (el, friendorgroupinfo, isinsert) {
- var i,
- _isfront,
- _friendel,
- _friendoneel,
- _friendtwoel,
- _onlinefrag = $$("frag"),
- _offlinefrag = $$("frag");
-
- if (friendorgroupinfo.length == 0) {
- $$("div", { "class": "U_MD_F_H_ZLZOCO_under", "style": { "margin": "9px 0 0 10px" }, "innerHTML": "最近暂无任何聊天" }, el);
- } else {
- for (i = 0; i < friendorgroupinfo.length; i++) {
- if (friendorgroupinfo[i].tf == 1) {
- friendorgroupinfo[i] = U.Json.select(US.friend.group, { "GroupManageID": friendorgroupinfo[i].UserId })[0]
- }
- _friendel = $$("div",
- {
- "className": "U_MD_F_H_ZLZOCO",
- "onclick": U.UF.C.closure(function (friendorgroupinfo) {
- U.MD.F.N.CanelMarkMessage(friendorgroupinfo);
- U.MD.F.W.popupFriendsForm(friendorgroupinfo, this);
- }, [friendorgroupinfo[i]]),
- "TID": friendorgroupinfo[i].GroupManageID || friendorgroupinfo[i].UserId,
- "oncontextmenu": U.UF.C.closure(function (friendorgroupinfo) {
- alert();
- if (friendorgroupinfo.UserId) {
- U.MD.F.R.friendsRightClickMenu(this, friendorgroupinfo);
- } else if (friendorgroupinfo.GroupManageID) {
- U.MD.F.R.GroupRightClickMenu(this, friendorgroupinfo);
- }
- }, [friendorgroupinfo[i]])
- });
- _friendoneel = $$("div", { "className": "U_MD_F_H_ZLZOCOI" }, _friendel);
-
- if (friendorgroupinfo[i].GroupManageID) {
- U.MD.F.printGroupHeadImage(U.Json.select(US.friend.group, { "GroupManageID": friendorgroupinfo[i].GroupManageID || friendorgroupinfo[i].UserId })[0], _friendoneel, 4, [35, 35]);
- }
-
- else {
- $$("img",
- {
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- "src": U.MD.C.getHeadImage(friendorgroupinfo[i].UserThumbnailImageHead)
- },
- _friendoneel);
- }
- _friendtwoel = $$("div", { "className": "U_MD_F_H_ZLZOCOR U_MD_D_Text_Abbreviation" }, _friendel);
- $$("div", { "className": "U_MD_F_H_ZLZOCORN U_MD_D_Text_Abbreviation", "innerHTML": friendorgroupinfo[i].FriendsDescript || friendorgroupinfo[i].UserNickName || friendorgroupinfo[i].GroupManageName }, _friendtwoel);
- $$("div", { "className": "U_MD_F_H_ZLZOCORT U_MD_D_Text_Abbreviation", "innerHTML": friendorgroupinfo[i].UserIndividualitysignature || (friendorgroupinfo[i].GroupManageDescript == friendorgroupinfo[i].GroupManageName ? "" : friendorgroupinfo[i].GroupManageDescript) || "" }, _friendtwoel);
-
- if (friendorgroupinfo[i].IsLogin == 1) {
- _onlinefrag.appendChild(_friendel);
- }
-
- else {
- _offlinefrag.appendChild(_friendel);
- }
- }
- el.insertBefore(_onlinefrag, el.firstChild);
-
- if (isinsert) {
- el.insertBefore(_offlinefrag, el.firstChild);
- }
- else {
- el.appendChild(_offlinefrag);
- }
- }
- }
- U.MD.F.openOrCloseFriendClass = function (el) {
- var _firendel = $($(el).Parent()).Child()[1];
-
- if (_firendel.style.display == "none") {
- _firendel.style.display = "block";
- }
-
- else {
- _firendel.style.display = "none";
- }
- }
- U.MD.F.printHasNoFriend = function (el) {
- var _tempel,
- _temponeel
- ;
- _tempel = $$("div", { "className": "U_MD_F_H_ZLZT" }, el);
- _temponeel = $$("div", { "className": "U_MD_F_H_ZLZTS" }, _tempel);
- $$("img", { "onerror": U.MD.C.imgError, "src": "/img/YSUN.png" }, _temponeel);
- $$("div", { "className": "U_MD_F_H_ZLZTZ U_Img" }, _tempel);
- $$("div", { "className": "U_MD_F_H_ZLZTX", "innerHTML": "暂时没有添加追随!!" }, _tempel);
- }
- U.MD.F.switchFriendOrGroup = function (typename, el, classname) {
- var i,
- _chatform = $("#U_MD_F_H_ZLZ")[0],
- _childsel = $(el).parentElement(2).Child(),
- _classarray = ["U_MD_F_H_ZLTO", "U_MD_F_H_ZLTT", "U_MD_F_H_ZLTS", "U_MD_F_H_ZLTF"];
-
- for (i = 0; i < _childsel.length; i++) {
- $(_childsel[i]).Child()[0].className = _classarray[i] + " U_Img U_MD_F_H_ZLTOK";
- }
-
- el.className = classname + " U_Img U_MD_F_H_ZLTOK";
-
- if (typename == "A") {
- U.MD.F.M.createFriendGroupPopup();
- }
- else {
-
- if (typename == "H") {
- var _grouparr = US.friend.group;
- _chatform.innerText = "";
- U.MD.F.printFriendOrGroup(_chatform, _grouparr);
- }
-
- else if (typename == "G") {
- var _recentcontacts = US.friend.recentcontacts;
- _chatform.innerText = "";
- U.MD.F.printFriendOrGroup(_chatform, _recentcontacts);
- }
-
- else {
- U.MD.F.printFriendGroupOrFriend(_chatform);
- }
- }
- }
- U.MD.F.printGroupHeadImage = function (groupinfo, el, num, size) {
- var i, j,
- _groupnameel,
- _horizontal,
- _vertical,
- _imageel,
- _groupuserinfo = U.Json.select(US.friend.groupusers, { "GroupManageID": groupinfo.GroupManageID }, (num || 9));
- if (_groupuserinfo.length < 3) {
- _horizontal = _groupuserinfo.length;
- } else {
- if (_groupuserinfo.length > 6) {
- _horizontal = 3;
- } else {
- _horizontal = 2;
- }
- }
- if (_groupuserinfo.length > 4) {
- _vertical = 3
- } else {
- if (_groupuserinfo.length > 1) {
- _vertical = 2
- } else {
- _vertical = 1
- }
- }
- size = size || [el.offsetHeight || 40, el.offsetWidth || 40];
- _groupnameel = $$("div", { "className": "U_MD_HomeSSZFZAIO", "title": groupinfo.GroupManageName });
-
- for (i = 0; i < _horizontal; i++) {
- _imageel = $$("div", { "style": { "width": "100%", "height": Math.floor(size[0] / _horizontal) + "px"} }, _groupnameel);
-
- for (j = i * _vertical; j < i * _vertical + _vertical && j < _groupuserinfo.length; j++) {
- $$("img",
- {
- "onerror": U.MD.C.imgError,
- "src": U.MD.C.getHeadImage(_groupuserinfo[j].UserThumbnailImageHead),
- "style":
- {
- "width": Math.floor(size[1] / _vertical) + "px",
- "height": Math.floor(size[0] / _vertical) + "px"
- }
- }, _imageel);
- }
- };
-
- el.appendChild(_groupnameel);
- }
|