U.F.A.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Namespace.register("U.F.A"); //好友辅助函数命名空间
  2. //------------------------------------------------------------------------好友面板上独立的一下通用函数
  3. //群 好友 最近联系人的切换
  4. U.F.A.MAGC = function (UDXD) {
  5. var i, _TF, _UTF = ["UF_UP_FriendBoard", "UF_UP_GroupBoard", "UF_UP_ChatRecord"];
  6. for (i = 0; i < _UTF.length; i++) { if (_UTF[i] == UDXD) { _TF = "block"; } else { _TF = "none"; } $("#" + _UTF[i])[0].style.display = _TF; }
  7. }
  8. //好友聊天框
  9. U.F.A.ISFriend = function () {
  10. if (!U.U.L.LARG()) {
  11. var _UDOD = $("#UF_UP_UserBoard")[0], _TF = ["150px", "block"];
  12. (_UDOD.style.display == "block") && (_TF[0] = "-2000px", _TF[1] = "none");
  13. $(_UDOD).animate({ "top": _TF[0], "display": _TF[1] }, 100);
  14. }
  15. return _UDOD;
  16. }
  17. //调整好友框
  18. U.F.A.IframeAutoHight = function (UDOD) {
  19. var i, _UDTD, _UDSD, _UDFD, _UDGD, _UE = U.M.GetElementInfo(UDOD), _UDAD = U.M.GTCN(UDOD.childNodes);
  20. if (_UE["CW"] > 0) {
  21. //中间编辑区域和查看区域
  22. for (i = 0; i < _UDAD.length; i++) {
  23. if (_UDAD[i].id.indexOf("UF_FW_Content") > -1 && _UDAD[i].id.length > 14 && _UDAD[i].style.display != "none") {
  24. _UDTD = $("div#UF_FW_Context", _UDAD[i])[0]; _UDSD = $("div#UF_FW_C", _UDTD)[0];
  25. if (_UDSD.offsetWidth > 0) { UDOD.style.minWidth = "730px"; } else { UDOD.style.minWidth = "430px"; };
  26. if (_UE["CH"] > 0) {
  27. _UDFD = $("div", _UDTD); _UDSD.style.height = (_UE["CH"] - 119) + "px"; _UE = U.M.GetElementInfo(UDOD); //大小变化
  28. _UDFD[2].style.height = (_UE["CH"] - 231) + "px"; _UDFD[0].style.width = _UE["CW"] - _UDSD.offsetWidth + "px";
  29. }
  30. //发送框和头部
  31. _UDGD = $("div#SendMessageImg", UDOD)[0]; _UDGD.parentNode.style.width = _UE["CW"] - 22 + "px"; _UDGD.style.marginLeft = _UE["CW"] - 60 + "px";
  32. $("div#UF_FW_user", UDOD)[0].style.width = _UE["CW"] - 92 + "px";
  33. }
  34. }
  35. }
  36. }
  37. //群窗口拖动后iframe调整
  38. U.F.A.GIframeAutoHight = function (UDOD) {
  39. var _UE = U.M.GetElementInfo(UDOD), _UDTD = $("div#UF_GW_CE", UDOD)[0], _UDSD = $("div#UF_GW_C", UDOD)[0], _UDGD = $("div#GainFormation", UDOD)[0], _UDHD = $("div#UF_GW_user", UDOD)[0], _UDID = $("div#UF_GW_Context", UDOD)[0], _UDJD = $("div#SendMessageImg", UDOD)[0];
  40. //头部内容
  41. _UDHD.style.width = _UE["CW"] - 92 + "px";
  42. //中间
  43. _UDID.style.width = _UE["CW"] - _UDSD.offsetWidth + "px";
  44. _UDGD.style.height = _UDSD.style.height = _UE["CH"] - 122 + "px";
  45. _UDTD.style.width = _UE["CW"] - _UDSD.offsetWidth - _UDGD.offsetWidth + "px";
  46. $("div", _UDTD)[0].style.height = _UE["CH"] - 240 + "px";
  47. //发送框
  48. _UDJD.parentNode.style.width = _UE["CW"] - 22 + "px";
  49. _UDJD.style.marginLeft = _UE["CW"] - 60 + "px";
  50. }