123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- Namespace.register("U.F.S");
- U.F.S.SearchPostion;
- U.F.S.SearchFriendsOrGroupForm = function (inputs, el, cb, typename) {
- var _searchfriendinfo = [],
- _searchvalue = inputs.value,
- _isserch = U.F.S.SearchFriendsKeyboardHandle(el, inputs)
- ;
-
- if (_isserch) {
- _searchfriendinfo;
-
- if (!typename || typename == "F") {
- _searchfriendinfo = _searchfriendinfo.concat(_$(US.Friend[1]).Like({ "FriendsDescript": _searchvalue, "UserNickName": _searchvalue, "UserName": _searchvalue }));
- }
-
- if (!typename || typename == "G") {
- _searchfriendinfo = _searchfriendinfo.concat(_$(US.Friend[2]).Like({ "GroupManageName": _searchvalue }));
- }
-
- el.style.display = "block";
- el.innerText = "";
-
- U.F.S.PrintSearchFriends(_searchfriendinfo, el, cb);
- };
- }
- U.F.S.SearchFriendsKeyboardHandle = function (el, inputs) {
- var _keycode = event ? event.keyCode : 0,
- _childs = $(el).Child(),
- _searchvalue = inputs.value,
- _position = U.F.S.SearchPostion,
- _searchel = _childs[_position]
- ;
-
- if (_searchvalue == "" || _searchvalue == inputs.defaultValue) {
- el.style.display = "none";
- }
-
- else if (_position > -1 && _keycode == 13 || _keycode == 10 && _childs[_position].onmousedown) {
- _childs[_position].onmousedown();
- }
-
- else if (_keycode != 38 && _keycode != 40) {
- U.F.S.SearchPostion = -1;
- return true;
- }
- return false;
- }
- U.F.S.PrintSearchFriends = function (friendinfo, el, cb) {
- var i,
- _name,
- _tempel,
- _temponeel,
- _temptwoel,
- _frag = $$("frag"),
- _childs = $(el).Child();
-
- if (!friendinfo[0]) {
- $$("div", { "className": "UD_SYSSZJDB", "innerText": "很抱歉,没有找到您搜索的好友" }, el);
- }
- else {
-
- for (i = 0; i < friendinfo.length; i++) {
-
- _name = (friendinfo[i].GroupManageName || friendinfo[i].FriendsDescript || friendinfo[i].UserNickName || friendinfo[i].UserName);
-
- _tempel = $$("div", { "title": "点击查看", "className": "UD_SYSSZJD UTDF", "onmousemove": [[U.F.S.SwitchSearchFriendsOrGroup, [el, i + _childs.length]]], "onmousedown": [[(cb || U.F.W.PopupFriendsForm), [friendinfo[i]]], [U.F.S.HideSearchFriendsOrGroupForm, [el]]] }, _frag);
- _temponeel = $$("div", { "className": "UD_SYSSZJDZ" }, _tempel);
- _temptwoel = $$("div", { "className": "UD_SYSSZJDA", "title": _name }, _temponeel);
- if (friendinfo[i].GroupManageID) {
- U.F.PrintGroupHeadImage(friendinfo[i], _temptwoel);
- }
- else {
- $$("img", { "onerror": U.M.ImgError, "className": "UD_SYSSZJDAO", "src": U.M.GetImgU(friendinfo[i].UserThumbnailImageHead) }, _temptwoel);
- }
- $$("div", { "className": "UD_SYSSZJDN", "innerHTML": _name }, _temponeel);
- }
- el.appendChild(_frag);
- }
- U.F.S.SearchPostion = -1;
- return _childs;
- }
- U.F.S.SwitchSearchFriendsOrGroup = function (el, switchposition) {
- var _switchel,
- _top,
- _scrolltop,
- _keycode = event.keyCode,
- _childs = $(el).Child(),
- _isswitch = _keycode == 38 ? -1 : _keycode == 40 ? 1 : null,
- _postion = U.F.S.SearchPostion,
- _nowswitchel = _childs[switchposition]
- ;
-
- if (_isswitch || (switchposition != null && switchposition != _postion)) {
-
- if (switchposition != null) {
- U.F.S.SearchPostion = switchposition;
- }
-
- else {
- U.F.S.SearchPostion += _isswitch;
- switchposition = U.F.S.SearchPostion;
- }
- _switchel = _childs[switchposition];
-
- if (_switchel) {
- _switchel.className = "UD_SYSSZJD UTDF UD_SYSSZJDO";
- _nowswitchel.className = "UD_SYSSZJD UTDF";
-
- _top = _switchel.offsetTop;
- _scrolltop = el.scrollTop;
- if (_top > el.offsetHeight + _scrolltop - 40) {
- el.scrollTop = _top + _UDTD.offsetHeight - el.offsetHeight;
- }
- if (_top < el.scrollTop) {
- el.scrollTop = _top;
- }
- }
- else {
-
- if (switchposition > _childs.length - 1) {
- U.F.S.SearchPostion = _childs.length - 1;
- }
- if (switchposition < 0) {
- U.F.S.SearchPostion = 0;
- }
- }
- }
- }
- U.F.S.HideSearchFriendsOrGroupForm = function (el) {
- $("body")[0].focus();
- el.style.display = "none";
- }
- U.F.S.TCSS = function () {
- var _UDTD, _UDOD,
- _UDE = U.UI.Form({ resize: U.F.S.SSCTSize, id: "UD_SYF_S",
- "style": { "width": "70%", "height": "70%" },
- "content": "<div class='UD_SYF_SCT'>群文档查看</div><div class='UD_SYF_SCX'></div><div class='UD_SYF_SCD'></div>",
- "title": '<div class="UD_SYF_STO UD_SYF_STR">群文档搜索查看区域</div><div class="UD_SYF_STD" onmousedown="U.M.StopBubble();"><div class="UD_SYF_STDL"><input value="群文档搜索" onblur="U.MR.InputTip(this,[\'\',\'群文档搜索\']);" onfocus="U.MR.InputTip(this,[\'群文档搜索\',\'\']);" placeholder="群文档搜索" onkeyup="U.M.returnkeylogin([{\'obj\': $(this).parentg(2).Child()[1],\'event\':\'onclick\'}])" /></div><div class="UD_SYF_STDR" onclick="U.F.S.SSCT(this, 1, 1)">搜索</div></div>'
- });
- _UDOD = _UDE.PSO;
- $(_UDOD).find("input")[0].focus();
- U.F.S.SSCTSize(_UDE.be);
- U.F.S.QHSSCT($(_UDE.body).Child()[1], 1);
- return _UDE.be;
- }
- U.F.S.FTCSS = function () {
- var _UDTD, _UDOD,
- _UDE = U.UI.Form({ resize: U.F.S.SSCTSize, id: "UD_SYF_F",
- "style": { "width": "70%", "height": "70%" },
- "content": "<div class='UD_SYF_SCT'>FTP查看</div><div class='UD_SYF_SCX'></div><div class='UD_SYF_SCD'></div>",
- "title": '<div class="UD_SYF_STO UD_SYF_STR">FTP共享区域查看</div><div class="UD_SYF_STD" onmousedown="U.M.StopBubble();"><div class="UD_SYF_STDL"><input value="FTP搜索" onblur="U.MR.InputTip(this,[\'\',\'FTP搜索\']);" onfocus="U.MR.InputTip(this,[\'FTP搜索\',\'\']);" placeholder="FTP搜索" onkeyup="U.M.returnkeylogin([{\'obj\': $(this).parentg(2).Child()[1],\'event\':\'onclick\'}])" /></div><div class="UD_SYF_STDR" onclick="U.F.S.SSCT(this, 1, 0)">搜索</div></div>'
- });
- _UDOD = _UDE.PSO;
- $(_UDOD).find("input")[0].focus();
- U.F.S.SSCTSize(_UDE.be);
- U.F.S.QHSSCT($(_UDE.body).Child()[1], 0);
- return _UDOD;
- }
- U.F.S.QHSSCT = function (UDOD, UIE) {
- var _UDID = $(UDOD).parentg(3).find("input")[0],
- _searchvalue = _UDID.value;
- if (_searchvalue != "" && _searchvalue != _UDID.defaultValue) {
- U.F.S.SSCT($("#UD_SYF_S").find(".UD_SYF_STDR")[0], 1);
- }
- else {
- U.F.S.RMQY(1, UIE, UDOD);
- }
- }
- U.F.S.RMQYGD = function (UTF, UDOD) {
- U.F.S.RMQY(this.P + 2, UTF, UDOD);
- }
- U.F.S.RMQY = function (UP, UTF, UDOD) {
- UP = UP || this.P + 2;
- var i, _UE = UP * 80,
- _US = _UE - 79;
- (UP == 1) && ($(UDOD).Parent().onscroll = U.M.SSCH({ "AF": U.M.apply(null, [[U.F.S.RMQYGD, [UTF, UDOD]]]) }).SCH());
- if (UTF) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "RecommendGroups", _US, _UE], U.F.S.AsynRMQY, [UP > 1 ? [$(UDOD).parentg().Child()[2], 1] : [UDOD, true], UDOD, UTF]);
- }
- else {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "GetFtpHotUser", _US, _UE], U.F.S.AsynRMQY, [UP > 1 ? [$(UDOD).parentg().Child()[2], 1] : [UDOD, true], UDOD, UTF]);
- }
- }
- U.F.S.AsynRMQY = function (r) {
- var context = r.context,
- _UDOD = context[1],
- _UTF = context[2];
- r = r.value;
- U.F.S.PSSCT(r, _UDOD, _UTF);
- if (r.length < 80) { $(_UDOD).Parent().onscroll = null; }
- }
- U.F.S.GDSSCT = function (UDOD) {
- var _UDE = UDOD.PT,
- _UIE = (_UDE[1]++) + 1;
- U.F.S.SSCT($(UDOD).parentg(2).find(".UD_SYF_STDR")[0], _UIE);
- }
- U.F.S.SSCT = function (UDOD, UP, UTF) {
- UDOD = $(UDOD);
- var _UE = UP * 80, _US = _UE - 79,
- _UDTD = UDOD.parentg(3).find(".UD_SYF_SCX")[0],
- _UDID = UDOD.parentg().find("input")[0], _searchvalue = UP > 1 ? _UDTD.PT[0] : _UDID.value,
- _UME = [_searchvalue, _US, _UE];
- _UDTD.PT = UP == 1 ? [_searchvalue, 1, UTF] : _UDTD.PT; (UP == 1) && (_UDTD.innerHTML = "");
- if (_searchvalue != "" && _searchvalue != _UDID.defaultValue) {
- (!UTF && _UME.unshift(US.userInfo.userid || US.NU));
- if (UTF) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "SearchGroupInfo", _searchvalue, _US, _UE], U.F.S.AsynSSCT, [UP > 1 ? [$("#UD_SYF_SCD")[0], 1] : [_UDTD, true], UP, _searchvalue, _UDTD, UTF]);
- }
- else {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "SearchFriendInfo", US.userInfo.userid || US.NU, _searchvalue, _US, _UE], U.F.S.AsynSSCT, [UP > 1 ? [$("#UD_SYF_SCD")[0], 1] : [_UDTD, true], UP, _searchvalue, _UDTD, UTF]);
- }
-
- $(_UDTD).Parent().onscroll = U.M.SSCH({ "AF": U.M.apply(null, [[U.F.S.GDSSCT, [_UDTD[0], UTF]]]) }).SCH();
- }
- else { U.F.S.RMQY(1, UTF, _UDTD); }
- }
- U.F.S.AsynSSCT = function (r) {
- var context = r.context,
- _UP = context[1],
- _searchvalue = context[2],
- _UDOD = context[3],
- _UTF = context[4]; r = r.value;
- (_UP == 1) && (_UDOD.innerHTML = "", (!r || !r.length) && (_UDOD.innerHTML = "", U.F.S.SSCTNull(_UDOD)));
- if (r && r.length) { U.F.S.PSSCT(r, _UDOD, _UTF) }
- else { _UDOD.PT[1]--; };
- }
- U.F.S.SSCTSize = function (UDOD) {
- var _UDTD = $(UDOD).find(".UD_SYF_SCX"),
- _UDPD = _UDTD.parentg();
- _UDTD.css({ "width": Math.floor(_UDPD.width() / 155) * 155 + "px" });
- }
- U.F.S.PSSCT = function (UDE, UDOD, UTF) {
- var i, UDSD, _UDKD, _UDXD,
- _userid = US.userInfo.userid || "",
- _UDTD = $$("frag"), _
- _UCE = UTF ? ["GroupManageName", "GroupManageRemark", "UD_SYF_SCXODT", "点击加入"] : ["UserNickName", "UserIndividualitysignature", "UD_SYF_SCXODO", "点击追随"];
- for (i = 0; i < UDE.length; i++) {
- _UDSD = $$("div", { "className": "UD_SYF_SCXO", "onclick": UTF ? [[U.M.StopBubble], [U.F.J.OAddGroup, [UDE[i], [[U.D.DT.YYDK, ["Disk", { "userid": _userid, "directoryid": UDE[i].GroupManageID}]]]]]] : [[U.M.StopBubble], [U.D.DT.YYDK, (["Disk", { "userid": UDE[i].UserId, "directoryid": US.FG}])]] }, _UDTD);
- _UDKD = $$("div", { "className": "UD_SYF_SCXOT" }, _UDSD);
- _UDXD = $$("div", { "className": "UD_SYF_SCXOTL" }, _UDKD);
- $$("img", { "onerror": U.M.ImgError, "src": U.M.GetImgU(UDE[i]["UserThumbnailImageHead"]), "title": UDE[i][_UCE[0]], "onclick": UTF ? null : [[U.M.StopBubble], [U.U.I.ViewOtherUserInfo, [UDE[i].UserId]]] }, _UDXD);
- $$("div", { "className": "UD_SYF_SCXOTR UTDF", "innerHTML": UDE[i][_UCE[0]] }, _UDKD);
- _UDKD = $$("div", { "className": "UD_SYF_SCXOZ" }, _UDSD);
- $$("div", { "className": "UD_SYF_SCXOZS", "innerHTML": UDE[i][_UCE[1]] || "暂无简介" }, _UDKD);
- $$("div", { "className": "UD_SYF_SCXOZZ", "innerHTML": "全部云分享:<span>" + (UDE[i]["DCount"] < 0 ? 0 : (UDE[i]["DCount"] || 0)) + "</span>" }, _UDKD);
- $$("div", { "className": "UD_SYF_SCXOZS", "innerHTML": "目前追随者:" + UDE[i]["FCount"] }, _UDKD);
- $$("div", { "className": "UD_SYF_SCXOD " + _UCE[2], "innerHTML": _UCE[3], "onclick": UTF ? [[U.M.StopBubble], [U.F.J.OAddGroup, [UDE[i], [[U.D.DT.YYDK, ["Disk", { "userid": _userid, "directoryid": UDE[i].GroupManageID}]]]]]] : [[U.M.StopBubble], [U.F.M.AddFriend, [UDE[i]]]] }, _UDSD);
- }
- UDOD.appendChild(_UDTD);
- }
- U.F.S.CXQDJ = function (UGID) {
- if (!U.U.L.isLogin(3)) {
- var _UFE = _$(US.Friend[2]).Select({ "GroupManageID": UGID })[0];
- if (_UFE) {
- U.D.DT.YYDK("Disk", { "userid": US.userInfo.userid, "directoryid": UGID });
- }
- else {
- U.Alert("请申请加入群查看群信息!");
- }
- }
- }
- U.F.S.SSCTNull = function (UDOD) {
- $$("div", { "className": "UD_SYF_SCXT", "innerHTML": "暂无搜索消息, 请稍候搜索。" }, UDOD);
- }
|