Hormold

VK Change (#1386008103)

Dec 2nd, 2013
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 101.30 KB | None | 0 0
  1. Файл - friends.js (Старый размер - 62358 | Новый - 0):
  2. 0.  - var Friends = {
  3. 1.  -   init: function(obj, friendsTpl, commonTpl) {
  4. 2.  -     extend(cur, {
  5. 3.  -       fSearch: ge('s_search'),
  6. 4.  -       module: 'friends',
  7. 5.  -       fListEl: ge('friends_list'),
  8. 6.  -       showMore: ge('show_more'),
  9. 7.  -       pageEnd: ge('page_end'),
  10. 8.  -       fContent: ge('list_content'),
  11. 9.  -       friendsTpl: friendsTpl,
  12. 10.  -       commonTpl: commonTpl,
  13. 11.  -       savedMasks: {},
  14. 12.  -       bigphCache: {},
  15. 13.  -       bigphShown: {}
  16. 14.  -     });
  17. 15.  -     extend(cur, obj);
  18. 16.  -
  19. 17.  -     if (!cur.secData) {
  20. 18.  -       cur.secData = {};
  21. 19.  -     }
  22. 20.  -
  23. 21.  -     cur.curList = cur.section;
  24. 22.  -
  25. 23.  -     placeholderSetup(cur.fSearch, {back: true})
  26. 24.  -     elfocus(cur.fSearch);
  27. 25.  -
  28. 26.  -     Friends.scrollNode = browser.msie6 ? pageNode : window;
  29. 27.  -
  30. 28.  -     addEvent(Friends.scrollNode, 'scroll', Friends.scrollResize);
  31. 29.  -
  32. 30.  -     setTimeout(function() {
  33. 31.  -       cur.destroy.push(function() {
  34. 32.  -         clearTimeout(cur.resizeTimeout);
  35. 33.  -         removeEvent(Friends.scrollNode, 'scroll', Friends.scrollResize);
  36. 34.  -       });
  37. 35.  -     }, 0);
  38. 36.  -
  39. 37.  -     cur.friends = {};
  40. 38.  -
  41. 39.  -     if (!cur.silent) {
  42. 40.  -       this.indexAll(function() {
  43. 41.  -         if (cur.section.substr(0, 4) == 'list') {
  44. 42.  -           cur.friendsList[cur.section] = Friends.filter(cur.friendsList['all'], cur.section);
  45. 43.  -         }
  46. 44.  -         if (!cur.friendsList[cur.section] || !cur.friendsList[cur.section].length) {
  47. 45.  -           if (cur.section != 'requests' || !cur.suggCount) {
  48. 46.  -             show('not_found');
  49. 47.  -           }
  50. 48.  -         }
  51. 49.  -       });
  52. 50.  -     }
  53. 51.  -
  54. 52.  -     cur.timeouts = {};
  55. 53.  -
  56. 54.  -     cur.nav.push((function(changed, old, n) {
  57. 55.  -       debugLog('here', changed, old, n);
  58. 56.  -       if ('id' in changed || 'sort' in changed || 'act' in changed || isEmpty(changed)) {
  59. 57.  -         return true;
  60. 58.  -       }
  61. 59.  -       if (n[0] == 'friends' || n[0] == 'al_friends.php' && (changed.section)) {
  62. 60.  -         var s = changed.section;
  63. 61.  -
  64. 62.  -         if ((s == 'requests' || s == 'all_requests' || s == 'out_requests') && !cur.requestsCount && !cur.suggCount && !cur.allRequestsCount && !cur.outRequestsCount) {
  65. 63.  -           return nav.change({section: 'all'});
  66. 64.  -         } else if (s == 'requests' && !cur.requestsCount && !cur.suggCount) {
  67. 65.  -           return nav.change({section: cur.allRequestsCount ? 'all_requests' : 'out_requests'});
  68. 66.  -         } else if (s == 'all_requests' && !cur.allRequestsCount) {
  69. 67.  -           return nav.change({section: cur.requestsCount || cur.suggCount ? 'requests' : 'out_requests'});
  70. 68.  -         } else if (s == 'out_requests' && !cur.outRequestsCount) {
  71. 69.  -           return nav.change({section: 'all'});
  72. 70.  -         }
  73. 71.  -
  74. 72.  -         if (s == 'all' || s == 'online' || s == 'requests' || s == 'all_requests' || s == 'out_requests') {
  75. 73.  -           __adsUpdate('force');
  76. 74.  -         }
  77. 75.  -         if (s == 'all_requests' && !('sort' in changed) && !cur.sortByDate) {
  78. 76.  -           delete n.sort;
  79. 77.  -           setTimeout(Friends.changeSummary, 0);
  80. 78.  -         }
  81. 79.  -         this.section(n.section, (function() {
  82. 80.  -           this.changeSummary();
  83. 81.  -           nav.setLoc(n);
  84. 82.  -         }).bind(this));
  85. 83.  -         return false;
  86. 84.  -       } else if (n[0] == 'al_friends.php' || n[0] == 'friends') {
  87. 85.  -         return false;
  88. 86.  -       }
  89. 87.  -     }).bind(this));
  90. 88.  -
  91. 89.  -     if (cur.silent) {
  92. 90.  -       addClass(cur.showMore, 'load_more');
  93. 91.  -       ajax.post('al_friends.php', {act: 'load_friends_silent', id: cur.oid, gid: cur.gid, sort: nav.objLoc.sort}, {
  94. 92.  -         onDone: (function(data, universities, filters) {
  95. 93.  -           removeClass(cur.showMore, 'load_more');
  96. 94.  -           cur.silent = false;
  97. 95.  -           var obj = eval('('+data+')');
  98. 96.  -           // load friends json
  99. 97.  -           if (!obj) {
  100. 98.  -             return;
  101. 99.  -           }
  102. 100.  -           cur.universities = universities;
  103. 101.  -           for (var i in obj) {
  104. 102.  -             cur.friendsList[i] = obj[i];
  105. 103.  -           }
  106. 104.  -           this.indexAll(function() {
  107. 105.  -             //Friends.selectTabAndSection(cur.section);
  108. 106.  -             if (cur.section.substr(0, 4) == 'list') {
  109. 107.  -               cur.friendsList[cur.section] = Friends.filter(cur.friendsList['all'], cur.section);
  110. 108.  -             }
  111. 109.  -             (cur.onSilentLoad || Friends.showMore)();
  112. 110.  -           });
  113. 111.  -           if (filters.cities) {
  114. 112.  -             stManager.add(['ui_controls.js', 'ui_controls.css'], function() {
  115. 113.  -               cur.cityFilter.setData(filters.cities);
  116. 114.  -               if (cur.cityFilterOpened) {
  117. 115.  -                 hide('friends_fltr_progress');
  118. 116.  -                 cur.cityFilter.showDefaultList()
  119. 117.  -               }
  120. 118.  -             });
  121. 119.  -           }
  122. 120.  -         }).bind(this), local: 1
  123. 121.  -       });
  124. 122.  -     }
  125. 123.  -
  126. 124.  -   },
  127. 125.  -   indexAll: function(callback) {
  128. 126.  -     var all = cur.friendsList['all'];
  129. 127.  -
  130. 128.  -     cur.friendsIndex = new vkIndexer(all, function(obj) {
  131. 129.  -       var mid = parseInt(obj[0]);
  132. 130.  -       if (cur.friends && mid) {
  133. 131.  -         cur.friends[mid] = obj;
  134. 132.  -       }
  135. 133.  -       return obj[5] || '';
  136. 134.  -     }, function() {
  137. 135.  -       if (!cur.silent) {
  138. 136.  -         cur.friendsList['online'] = Friends.filter(all, 'online');
  139. 137.  -         if (cur.section == 'common') {
  140. 138.  -           cur.friendsList['common'] = Friends.filter(all, 'common');
  141. 139.  -         }
  142. 140.  -         if (callback) {
  143. 141.  -           callback();
  144. 142.  -         }
  145. 143.  -       }
  146. 144.  -       Friends.initBackFunc();
  147. 145.  -     });
  148. 146.  -
  149. 147.  -     if (cur.section == 'phonebook') {
  150. 148.  -       Friends.indexPhone();
  151. 149.  -     }
  152. 150.  -   },
  153. 151.  -   indexPhone: function() {
  154. 152.  -     cur.phoneIndex = new vkIndexer(cur.friendsList['phonebook'], function(obj) {
  155. 153.  -       var mobile = obj[10][0] || '';
  156. 154.  -       var home = obj[10][1] || '';
  157. 155.  -       return [obj[5], mobile, mobile.replace(/[^0-9\+]/g, ''), home, home.replace(/[^0-9\+]/g, '')].join(' ');
  158. 156.  -     });
  159. 157.  -   },
  160. 158.  -   initBackFunc: function() {
  161. 159.  -     cur._back = {show: [function() {
  162. 160.  -       addEvent(Friends.scrollNode, 'scroll', Friends.scrollResize);
  163. 161.  -     }], hide: [function() {
  164. 162.  -       if (Friends.searchTimout) {
  165. 163.  -         clearTimeout(Friends.searchTimout);
  166. 164.  -       }
  167. 165.  -       if (cur.timeouts) {
  168. 166.  -         for (var i in cur.timeouts) {
  169. 167.  -           clearTimeout(cur.timeouts);
  170. 168.  -         }
  171. 169.  -       }
  172. 170.  -       for (var i in cur.bigphShown) {
  173. 171.  -         animate(cur.bigphShown[i], {marginTop: 100}, 0);
  174. 172.  -       }
  175. 173.  -       cur.bigphShown = {};
  176. 174.  -       removeEvent(Friends.scrollNode, 'scroll', Friends.scrollResize);
  177. 175.  -     }], text: cur.backLang};
  178. 176.  -   },
  179. 177.  -   switchTab: function(section, ev) {
  180. 178.  -     var param = {'0':'friends', section: section};
  181. 179.  -     return checkEvent(ev) || nav.change(param);
  182. 180.  -   },
  183. 181.  -   filter: function(arr, type) {
  184. 182.  -     var len = (arr) ? arr.length : 0;
  185. 183.  -     var res = [];
  186. 184.  -     if (type.substr(0, 4) == 'list') {
  187. 185.  -       var listNum = parseInt(type.substr(4));
  188. 186.  -       type = 'list';
  189. 187.  -     }
  190. 188.  -     for (var i = 0; i < len; i++) {
  191. 189.  -       var obj = arr[i];
  192. 190.  -       if (cur.filterIds && !cur.filterIds[parseInt(obj[0])]) {
  193. 191.  -         continue;
  194. 192.  -       }
  195. 193.  -       switch (type) {
  196. 194.  -         case 'online':
  197. 195.  -           if (intval(obj[4])) {
  198. 196.  -             res.push(obj);
  199. 197.  -           }
  200. 198.  -           break;
  201. 199.  -         case 'common':
  202. 200.  -           if (cur.commonCount && obj[10]) {
  203. 201.  -             res.push(obj);
  204. 202.  -           }
  205. 203.  -           break;
  206. 204.  -         case 'list':
  207. 205.  -           if (parseInt(obj[6]) & (1 << listNum)) {
  208. 206.  -             res.push(obj);
  209. 207.  -           }
  210. 208.  -           break;
  211. 209.  -         default:
  212. 210.  -           res.push(obj);
  213. 211.  -           break;
  214. 212.  -       }
  215. 213.  -     }
  216. 214.  -     return res;
  217. 215.  -   },
  218. 216.  -   loadMore: function(start, end) {
  219. 217.  -     var section = cur.section;
  220. 218.  -     var list = cur.curList;
  221. 219.  -     var curData = cur.secData[section];
  222. 220.  -     if (curData.loading) {
  223. 221.  -       return;
  224. 222.  -     }
  225. 223.  -     curData.loading = true;
  226. 224.  -     addClass(cur.showMore, 'load_more');
  227. 225.  -     show(cur.showMore);
  228. 226.  -     ajax.post('/friends', extend({
  229. 227.  -       act: 'get_section_friends',
  230. 228.  -       section: section,
  231. 229.  -       offset: start,
  232. 230.  -       gid: cur.gid,
  233. 231.  -       sort: nav.objLoc.sort,
  234. 232.  -       sugg_rev: cur.suggRev
  235. 233.  -     }, cur.filter), {
  236. 234.  -       onDone: (function(data, preload) {
  237. 235.  -         removeClass(cur.showMore, 'load_more');
  238. 236.  -         var response = eval('('+data+')')
  239. 237.  -         if (!cur.friendsList) {
  240. 238.  -           return;
  241. 239.  -         }
  242. 240.  -         if (!cur.friendsList[list]) {
  243. 241.  -           cur.friendsList[list] = [];
  244. 242.  -         }
  245. 243.  -         Array.prototype.push.apply(cur.friendsList[list], response[section]);
  246. 244.  -         if (list == 'requests' && response['sugg_requests']) {
  247. 245.  -           Array.prototype.push.apply(cur.friendsList['sugg_requests'], response['sugg_requests']);
  248. 246.  -         }
  249. 247.  -         this.showMore(false, start, end);
  250. 248.  -         curData.loading = false;
  251. 249.  -         curData.preload = preload;
  252. 250.  -       }).bind(this)
  253. 251.  -     });
  254. 252.  -   },
  255. 253.  -   canSugSwitch: function(list) {
  256. 254.  -     if (!list) {
  257. 255.  -       return cur.suggCount ? true : true;
  258. 256.  -     }
  259. 257.  -     if (cur.suggRev) {
  260. 258.  -       return list.length >= cur.suggCount || !cur.secData.requests.preload;
  261. 259.  -     } else {
  262. 260.  -       return list.length >= cur.requestsCount || !cur.secData.requests.preload;
  263. 261.  -     }
  264. 262.  -   },
  265. 263.  -   showMore: function(clear, start, end, plain) {
  266. 264.  -     if (!cur.friendsList) {
  267. 265.  -       return false;
  268. 266.  -     }
  269. 267.  -     var clist = cur.curList;
  270. 268.  -     var list = cur.friendsList[clist];
  271. 269.  -     if (start == undefined) {
  272. 270.  -       start = cur.shownFriends;
  273. 271.  -     }
  274. 272.  -     if (end == undefined) {
  275. 273.  -       end = cur.shownFriends + cur.friendsPerPage;
  276. 274.  -     }
  277. 275.  -     if (cur.section == 'requests') {
  278. 276.  -       if (cur.suggRev) {
  279. 277.  -         list = (cur.friendsList['sugg_requests'] || []).slice();
  280. 278.  -         if (Friends.canSugSwitch(list)) {
  281. 279.  -           var suggSwitch = parseInt(cur.suggCount);
  282. 280.  -           list.push.apply(list, cur.friendsList[cur.curList] || []);
  283. 281.  -         }
  284. 282.  -       } else if (!cur.suggRev && cur.requestsCount < end && Friends.canSugSwitch(list)) {
  285. 283.  -         list = (list || []).slice();
  286. 284.  -         var suggSwitch = parseInt(cur.requestsCount);
  287. 285.  -         list.push.apply(list, cur.friendsList['sugg_requests']);
  288. 286.  -       }
  289. 287.  -     }
  290. 288.  -     if (!list || !list.length) {
  291. 289.  -       if (cur.shownFriends == 0 && !cur.searchCount) {
  292. 290.  -         if (cur.isLoading) {
  293. 291.  -           return false; // Dont show empty msg while search
  294. 292.  -         }
  295. 293.  -         if (cur.searchStr) {
  296. 294.  -           addClass(ge('not_found'), 'f_search');
  297. 295.  -           ge('search_ph').innerHTML = cur.searchStr.replace(/([<>&#]*)/g, '');
  298. 296.  -         } else {
  299. 297.  -           removeClass(ge('not_found'), 'f_search');
  300. 298.  -         }
  301. 299.  -         var text = '';
  302. 300.  -         if (cur.curList.substr(0, 4) == 'list') {
  303. 301.  -           if (cur.filterIds) {
  304. 302.  -             text = cur.summaryLang['list_not_found_filter'];
  305. 303.  -             text = text.replace('{link}', '<a onclick="Friends.clearFilter(true);">').replace('{/link}', '</a>');
  306. 304.  -           } else {
  307. 305.  -             text = cur.summaryLang['list_not_found'];
  308. 306.  -             text = text.replace('{link}', '<a onclick="Friends.editList(-1);">').replace('{/link}', '</a>');
  309. 307.  -           }
  310. 308.  -         } else if (cur.filter) {
  311. 309.  -           text = cur.summaryLang['not_found_filter'];
  312. 310.  -           text = text.replace('{link}', '<a onclick="Friends.clearFilter(true);">').replace('{/link}', '</a>');
  313. 311.  -         } else {
  314. 312.  -           text = cur.summaryLang['not_found'];
  315. 313.  -         }
  316. 314.  -         ge('not_found_text').innerHTML = text;
  317. 315.  -         show('not_found');
  318. 316.  -       }
  319. 317.  -       if (clear) {
  320. 318.  -         cur.fContent.innerHTML = '';
  321. 319.  -       }
  322. 320.  -       if (cur.searchCount) {
  323. 321.  -         Friends.serverSearchMore();
  324. 322.  -       }
  325. 323.  -       hide('show_more');
  326. 324.  -       return;
  327. 325.  -     } else if (isVisible('not_found')) {
  328. 326.  -       hide('not_found');
  329. 327.  -     }
  330. 328.  -
  331. 329.  -     var friends = list.slice(start, end);
  332. 330.  -     if (!friends.length) {
  333. 331.  -       // can upload
  334. 332.  -       var secData = cur.secData[cur.section];
  335. 333.  -       if (secData && secData.preload) {
  336. 334.  -         Friends.loadMore(start, end);
  337. 335.  -       }
  338. 336.  -       if (cur.searchCount) {
  339. 337.  -         Friends.serverSearchMore();
  340. 338.  -       }
  341. 339.  -       if (cur.shownFriends >= cur.sectionCount) {
  342. 340.  -         hide('show_more');
  343. 341.  -       }
  344. 342.  -       return;
  345. 343.  -     }
  346. 344.  -     var html = [];
  347. 345.  -     var first = (cur.shownFriends == 0) ? ' user_block_first' : '';
  348. 346.  -     if (clear) {
  349. 347.  -       cur.fContent.innerHTML = '';
  350. 348.  -     }
  351. 349.  -     for (i in friends) {
  352. 350.  -       var iSt = parseInt(i) + start;
  353. 351.  -       if (suggSwitch && suggSwitch == iSt) {
  354. 352.  -         if (cur.suggRev) {
  355. 353.  -           var summaryText = langNumeric(cur.requestsCount, cur.summaryLang['requests']);
  356. 354.  -           if (nav.objLoc.sort != 'date') {
  357. 355.  -             summaryText += '<span class="divide">|</span><span><a href="/friends?section=' + cur.section + '&sort=date">' + cur.summaryLang['friends_sort_by_date'] + '</a></span>';
  358. 356.  -           } else {
  359. 357.  -             summaryText += '<span class="divide">|</span><span><a href="/friends?section=' + cur.section + '">' + cur.summaryLang['friends_sort_by_common'] + '</a></span>';
  360. 358.  -           }
  361. 359.  -         } else {
  362. 360.  -           var summaryText = langNumeric(cur.suggCount, cur.summaryLang['friends_sugg_summary']);
  363. 361.  -         }
  364. 362.  -         html.push('<div id="friends_sub_summary" class="summary_wrap"><div class="summary">',summaryText,'</div></div>');
  365. 363.  -         first = ' user_block_first';
  366. 364.  -       }
  367. 365.  -       if (cur.selection) {
  368. 366.  -         var friend = friends[i].slice();
  369. 367.  -         friend[5] = friend[5].replace(cur.selection.re, cur.selection.val);
  370. 368.  -       } else {
  371. 369.  -         var friend = friends[i];
  372. 370.  -       }
  373. 371.  -       if (cur.importCount && cur.importCount == cur.shownFriends) {
  374. 372.  -         html.push('<div id="friends_sub_summary" class="summary_wrap"><div class="summary">',cur.summaryLang['suggestions'],'</div></div>');
  375. 373.  -         first = ' user_block_first';
  376. 374.  -       }
  377. 375.  -       /*if (friend[0] && ge('user_block' + friend[0])) { // bad with search
  378. 376.  -         debugLog('here');
  379. 377.  -         continue;
  380. 378.  -       }*/
  381. 379.  -       ++cur.shownFriends;
  382. 380.  -       if (!friend) {
  383. 381.  -         continue;
  384. 382.  -       }
  385. 383.  -       var tplType = '';
  386. 384.  -       if (cur.section == 'requests') {
  387. 385.  -         if (suggSwitch <= iSt) {
  388. 386.  -           tplType = (!cur.suggRev ? 'sugg_requests' : '');
  389. 387.  -         } else {
  390. 388.  -           tplType = (!cur.suggRev ? '' : 'sugg_requests');
  391. 389.  -         }
  392. 390.  -       }
  393. 391.  -       Array.prototype.push.apply(html, Friends.drawFriend(friend, first, tplType));
  394. 392.  -       first = '';
  395. 393.  -     }
  396. 394.  -     if (plain) {
  397. 395.  -       return '<div>'+html.join('')+'</div>';
  398. 396.  -     }
  399. 397.  -     cur.fContent.appendChild(ce('div', {innerHTML: html.join('')}));
  400. 398.  -     if (cur.shownFriends >= cur.sectionCount) {
  401. 399.  -       hide('show_more');
  402. 400.  -     } else {
  403. 401.  -       show('show_more');
  404. 402.  -     }
  405. 403.  -   },
  406. 404.  -
  407. 405.  -   updateList: function(e, obj, force) {
  408. 406.  -     if (!obj || e.keyCode == KEY.ESC) {
  409. 407.  -       obj = cur.fSearch;
  410. 408.  -       val(obj, '');
  411. 409.  -       cur.searchStr = '';
  412. 410.  -     }
  413. 411.  -     if (cur.silent) {
  414. 412.  -       cur.onSilentLoad = function() {
  415. 413.  -         Friends.updateList(e, obj, true);
  416. 414.  -       };
  417. 415.  -       if (trim(obj.value)) {
  418. 416.  -         hide(cur.showMore);
  419. 417.  -         cur.fContent.innerHTML = '<div class="wide_loading"></div>';
  420. 418.  -       }
  421. 419.  -       return;
  422. 420.  -     }
  423. 421.  -     clearTimeout(this.searchTimout);
  424. 422.  -     this.searchTimout = setTimeout((function() {
  425. 423.  -       var str = trim(obj.value);
  426. 424.  -       if (str && cur.searchStr == str) return;
  427. 425.  -       cur.searchStr = str;
  428. 426.  -       if (str) {
  429. 427.  -         if (cur.section != 'all' && cur.section != 'phonebook') {
  430. 428.  -           this.selectTab('all');
  431. 429.  -           this.selectSection('all');
  432. 430.  -           cur.curList = cur.section = 'all';
  433. 431.  -
  434. 432.  -           nav.setLoc(extend(nav.objLoc, {'section': 'all'}));
  435. 433.  -         }
  436. 434.  -         this.search(str, cur.section);
  437. 435.  -         this.changeSummary();
  438. 436.  -       } else if (cur.section != cur.curList || force) {
  439. 437.  -         this.showSection();
  440. 438.  -         this.changeSummary();
  441. 439.  -         this.showMore();
  442. 440.  -       } else {
  443. 441.  -         this.hideLoading();
  444. 442.  -         cur.searchCount = 0;
  445. 443.  -         this.showMore();
  446. 444.  -       }
  447. 445.  -     }).bind(this), 10);
  448. 446.  -   },
  449. 447.  -   showSection: function(section) {
  450. 448.  -     cur.shownFriends = 0;
  451. 449.  -     cur.curList = cur.section = section || cur.section;
  452. 450.  -     if (vk.id == cur.oid) {
  453. 451.  -       if (cur.section == 'requests' || cur.section == 'all_requests' || cur.section == 'out_requests') {
  454. 452.  -         hide('friends_search');
  455. 453.  -         var tabsCount = ((cur.requestsCount || cur.suggCount) ? 1 : 0) + (cur.allRequestsCount ? 1 : 0) + (cur.outRequestsCount ? 1 : 0);
  456. 454.  -         toggle('friends_req_tabs', tabsCount > 1);
  457. 455.  -         toggle('friends_hide_all', (cur.section == 'requests') && (cur.requestsCount > 1 || cur.suggCount));
  458. 456.  -         toggle(ge('sum_tab_requests').parentNode, cur.requestsCount > 0 || cur.suggCount > 0);
  459. 457.  -         toggle(ge('sum_tab_all_requests').parentNode, cur.allRequestsCount > 0);
  460. 458.  -         toggle(ge('sum_tab_out_requests').parentNode, cur.outRequestsCount > 0);
  461. 459.  -         show('tab_requests');
  462. 460.  -         addClass(ge('main_class'), 'wide');
  463. 461.  -       } else {
  464. 462.  -         show('friends_search');
  465. 463.  -         hide('friends_req_tabs');
  466. 464.  -         (cur.allFriendsCount && (cur.section != 'members') ? removeClass : addClass)(ge('main_class'), 'wide');
  467. 465.  -       }
  468. 466.  -       toggle('tab_requests', nav.objLoc.act != 'invite' && (cur.requestsCount || cur.allRequestsCount || cur.outRequestsCount || cur.suggCount));
  469. 467.  -     }
  470. 468.  -     if (cur.filterIds) {
  471. 469.  -       cur.curList += '_filter';
  472. 470.  -     }
  473. 471.  -     var list = cur.friendsList[cur.curList];
  474. 472.  -     if (!list) {
  475. 473.  -       if (section == 'recent' || section == 'phonebook' || section == 'requests') {
  476. 474.  -         var friendsList = section;
  477. 475.  -       } else {
  478. 476.  -         var friendsList = 'all';
  479. 477.  -       }
  480. 478.  -       list = cur.friendsList[cur.curList] = this.filter(cur.friendsList[friendsList], cur.section);
  481. 479.  -     }
  482. 480.  -     cur.sectionCount = (list) ? list.length : 0;
  483. 481.  -     cur.selection = false;
  484. 482.  -     if (cur.filter && !cur.filterIds) {
  485. 483.  -       Friends.changeFilter();
  486. 484.  -       if (!cur.searchStr) {
  487. 485.  -         hide('friends_reset_search');
  488. 486.  -         this.clearServerSearch();
  489. 487.  -       }
  490. 488.  -       return false;
  491. 489.  -     }
  492. 490.  -     this.showMore(true);
  493. 491.  -     if (!cur.searchStr) {
  494. 492.  -       hide('friends_reset_search');
  495. 493.  -       this.clearServerSearch();
  496. 494.  -     }
  497. 495.  -   },
  498. 496.  -
  499. 497.  -   updateView: function() {
  500. 498.  -     cur.fContent.innerHTML = this.showMore(false, 0, cur.shownFriends, true);
  501. 499.  -   },
  502. 500.  -
  503. 501.  -   showLoading: function() {
  504. 502.  -     cur.isLoading = 1;
  505. 503.  -     show('friends_loading');
  506. 504.  -     hide('friends_reset_search');
  507. 505.  -   },
  508. 506.  -
  509. 507.  -   hideLoading: function() {
  510. 508.  -     cur.isLoading = 0;
  511. 509.  -     hide('friends_loading');
  512. 510.  -     if (cur.searchStr) {
  513. 511.  -       show('friends_reset_search');
  514. 512.  -     }
  515. 513.  -   },
  516. 514.  -
  517. 515.  -   serverSearchMore: function() {
  518. 516.  -     if (cur.serverLoadingMore) {
  519. 517.  -       return;
  520. 518.  -     }
  521. 519.  -     if (cur.searchFinished) {
  522. 520.  -       return;
  523. 521.  -     }
  524. 522.  -     cur.serverLoadingMore = true;
  525. 523.  -     ajax.post('friends', {
  526. 524.  -       act: 'server_search',
  527. 525.  -       q: cur.searchStr,
  528. 526.  -       offset: cur.searchOffset
  529. 527.  -     }, {
  530. 528.  -       onDone: function(html, found, summary, newOffset) {
  531. 529.  -         cur.searchFinished = !found;
  532. 530.  -         if (cur.searchFinished) {
  533. 531.  -           hide('friends_search_more');
  534. 532.  -         }
  535. 533.  -         cur.searchOffset = newOffset;
  536. 534.  -         cur.serverLoadingMore = false;
  537. 535.  -         ge('friends_search_cont').appendChild(ce('div', {innerHTML: html}));
  538. 536.  -       },
  539. 537.  -       showProgress: function() {
  540. 538.  -         addClass(ge('friends_search_more'), 'load_more');
  541. 539.  -       },
  542. 540.  -       hideProgress: function() {
  543. 541.  -         removeClass(ge('friends_search_more'), 'load_more');
  544. 542.  -       }
  545. 543.  -     });
  546. 544.  -   },
  547. 545.  -
  548. 546.  -   serverSearch: function(str, count, exclude) {
  549. 547.  -     cur.searchCount = 0;
  550. 548.  -     Friends.showLoading();
  551. 549.  -     cur.serverSearchStr = str;
  552. 550.  -     clearTimeout(cur.serverSearchTimeout);
  553. 551.  -     var excludeList = [];
  554. 552.  -     for (var i in exclude) {
  555. 553.  -       excludeList.push(exclude[i][0]);
  556. 554.  -     }
  557. 555.  -     cur.serverSearchTimeout = setTimeout((function() {
  558. 556.  -       ajax.post('friends', {
  559. 557.  -         act: 'server_search',
  560. 558.  -         q: str,
  561. 559.  -         exclude: excludeList.join(',')
  562. 560.  -       }, {
  563. 561.  -         onDone: function(html, found, summary, newOffset) {
  564. 562.  -           cur.searchOffset = newOffset;
  565. 563.  -           cur.searchFinished = !found;
  566. 564.  -           Friends.hideLoading();
  567. 565.  -           if (cur.searchStr != str) return;
  568. 566.  -           var cont = ge('friends_search_cont');
  569. 567.  -           cur.searchCount = found;
  570. 568.  -           if (cur.shownFriends == 0) {
  571. 569.  -             hide(cont);
  572. 570.  -             cur.fContent.innerHTML = '';
  573. 571.  -             Friends.showMore();
  574. 572.  -           }
  575. 573.  -           if (!found) {
  576. 574.  -             Friends.changeSummary();
  577. 575.  -             return;
  578. 576.  -           }
  579. 577.  -           if (cur.searchFinished) {
  580. 578.  -             hide('friends_search_more');
  581. 579.  -           } else {
  582. 580.  -             show('friends_search_more');
  583. 581.  -           }
  584. 582.  -           cur.searchSummary = summary;
  585. 583.  -           if (count) {
  586. 584.  -             html = '<div class="summary_wrap"><div class="summary">'+summary+'</div></div>'+html;
  587. 585.  -           }
  588. 586.  -           cont.innerHTML = html;
  589. 587.  -           show(cont);
  590. 588.  -           Friends.changeSummary();
  591. 589.  -           hide('not_found');
  592. 590.  -         },
  593. 591.  -         onFail: Friends.hideLoading
  594. 592.  -       });
  595. 593.  -     }).bind(this), 300);
  596. 594.  -   },
  597. 595.  -
  598. 596.  -   clearServerSearch: function() {
  599. 597.  -     hide('friends_search_cont');
  600. 598.  -     hide('friends_search_more');
  601. 599.  -     cur.searchCount = 0;
  602. 600.  -   },
  603. 601.  -
  604. 602.  -   goToSearch: function(obj) {
  605. 603.  -     nav.go('search?c%5Bname%5D=1&c%5Bq%5D='+encodeURIComponent(cur.searchStr)+'&c%5Bsection%5D=people');
  606. 604.  -   },
  607. 605.  -
  608. 606.  -   search: function(str, type, callback, filter) {
  609. 607.  -     cur.shownFriends = 0;
  610. 608.  -     cur.section = type;
  611. 609.  -     if (str) {
  612. 610.  -       var index = (type == 'phonebook') ? cur.phoneIndex : cur.friendsIndex;
  613. 611.  -       var checkTime = new Date().getTime();
  614. 612.  -       if (str == -1) {
  615. 613.  -         if (type == 'recent' || type == 'phonebook') {
  616. 614.  -           var friendsList = type;
  617. 615.  -         } else {
  618. 616.  -           var friendsList = 'all';
  619. 617.  -         }
  620. 618.  -         var res = this.filter(cur.friendsList[friendsList], type);
  621. 619.  -         str = '';
  622. 620.  -         if (str != cur.searchStr) {
  623. 621.  -           this.clearServerSearch();
  624. 622.  -         }
  625. 623.  -       } else {
  626. 624.  -         var res = index.search(str);
  627. 625.  -         if (cur.filterIds) {
  628. 626.  -           res = this.filter(res, type);
  629. 627.  -         }
  630. 628.  -         var count = res.length;
  631. 629.  -         if (count) {
  632. 630.  -           if (str != cur.serverSearchStr && !cur.sectionCount) {
  633. 631.  -             this.clearServerSearch();
  634. 632.  -           }
  635. 633.  -         }
  636. 634.  -         if (count < 5 && cur.oid == vk.id) { // try to find some on the server side
  637. 635.  -           this.serverSearch(str, count, res);
  638. 636.  -         }
  639. 637.  -       }
  640. 638.  -       var newList = cur.section;
  641. 639.  -       if (cur.filterIds) {
  642. 640.  -         newList += '_filter';
  643. 641.  -       }
  644. 642.  -       if (str) {
  645. 643.  -         newList += '_search_'+str;
  646. 644.  -       }
  647. 645.  -       if (cur.curList == newList && !filter) {
  648. 646.  -         return; // now at this section
  649. 647.  -       }
  650. 648.  -       cur.curList = newList;
  651. 649.  -       cur.friendsList[cur.curList] = res;
  652. 650.  -
  653. 651.  -       if (str) {
  654. 652.  -         str += ' '+(parseLatin(str) || '');
  655. 653.  -         str = trim(escapeRE(str.replace(/[,]/g, '')));
  656. 654.  -         cur.selection = {
  657. 655.  -           re: new RegExp('('+str.replace(index.delimiter, '|').replace(/(^\||\|$|\?)/g, '')+')', 'gi'),
  658. 656.  -           val: '<em>$1</em>'
  659. 657.  -         };
  660. 658.  -       }
  661. 659.  -       if (!cur.isLoading) {
  662. 660.  -         show('friends_reset_search');
  663. 661.  -       }
  664. 662.  -     } else {
  665. 663.  -       cur.curList = cur.section;
  666. 664.  -       cur.selection = false;
  667. 665.  -       hide('friends_reset_search');
  668. 666.  -       if (cur.searchStr) {
  669. 667.  -         this.clearServerSearch();
  670. 668.  -       }
  671. 669.  -     }
  672. 670.  -
  673. 671.  -     cur.sectionCount = cur.friendsList[cur.curList].length;
  674. 672.  -     this.searchTimout = setTimeout((function() {
  675. 673.  -       this.showMore(true);
  676. 674.  -       if (callback) {
  677. 675.  -         Friends.onSectionChange();
  678. 676.  -         callback();
  679. 677.  -       }
  680. 678.  -     }).bind(this), 10);
  681. 679.  -   },
  682. 680.  -
  683. 681.  -   changeSummary: function() {
  684. 682.  -     var sum = ge('friends_summary');
  685. 683.  -     var html = '';
  686. 684.  -     if (cur.curList.indexOf('_search_') != -1 || cur.filterIds) {
  687. 685.  -       if (!cur.sectionCount) {
  688. 686.  -         if (cur.searchCount) {
  689. 687.  -           html = cur.searchSummary;
  690. 688.  -         } else {
  691. 689.  -           if (cur.isLoading) {
  692. 690.  -             return; // no update while loading
  693. 691.  -           }
  694. 692.  -           html = cur.summaryLang['search_no'];
  695. 693.  -         }
  696. 694.  -       } else {
  697. 695.  -         html = langNumeric(cur.sectionCount, cur.summaryLang['search'], true);
  698. 696.  -       }
  699. 697.  -     } else if (cur.curList.slice(0, 4) == 'list') {
  700. 698.  -       var langKey = (parseInt(cur.curList.slice(4)) < 25) ? 'list' : 'pub_list';
  701. 699.  -       if (cur.sectionCount) {
  702. 700.  -         html = langNumeric(cur.sectionCount, cur.summaryLang[langKey], true);
  703. 701.  -       } else {
  704. 702.  -         html = cur.summaryLang[langKey+'_no'];
  705. 703.  -       }
  706. 704.  -     } else if (cur.section == 'recent') {
  707. 705.  -       html = cur.summaryLang['recent'];
  708. 706.  -     } else if (cur.section == 'requests' && cur.requestsCount > 0) {
  709. 707.  -       if (cur.suggRev && cur.suggCount > 0) {
  710. 708.  -         html = langNumeric(cur.suggCount, cur.summaryLang['friends_sugg_summary'], true);
  711. 709.  -       } else {
  712. 710.  -         html = langNumeric(cur.requestsCount, cur.summaryLang[cur.section], true);
  713. 711.  -       }
  714. 712.  -     } else if (cur.section == 'requests' && cur.suggCount > 0) {
  715. 713.  -       html = langNumeric(cur.suggCount, cur.summaryLang['friends_sugg_summary'], true);
  716. 714.  -     } else if (cur.section == 'all_requests' && cur.sectionCount > 0) {
  717. 715.  -       html = langNumeric(cur.allRequestsCount, cur.summaryLang[cur.section], true);
  718. 716.  -     } else if (cur.section == 'out_requests' && cur.sectionCount > 0) {
  719. 717.  -       html = langNumeric(cur.outRequestsCount, cur.summaryLang[cur.section], true);
  720. 718.  -     } else if (cur.sectionCount > 0) {
  721. 719.  -       html = langNumeric(cur.sectionCount, cur.summaryLang[cur.section], true);
  722. 720.  -     } else {
  723. 721.  -       html = cur.summaryLang['all_no'];
  724. 722.  -     }
  725. 723.  -     if (cur.section.indexOf('list') == 0 && cur.oid == vk.id) {
  726. 724.  -       listNum = parseInt(cur.curList.substr(4));
  727. 725.  -       var list_edit_text = cur.summaryLang[(cur.sectionCount ? 'list_edit': 'list_start_edit')];
  728. 726.  -       html += '<span class="divider">|</span><span><a onclick="Friends.editList('+listNum+');">'+list_edit_text+'</a></span>';
  729. 727.  -       if (listNum < 25) {
  730. 728.  -         html += '<span class="divider">|</span><span><a onclick="Friends.deleteList('+listNum+');">'+cur.summaryLang['list_delete']+'</a></span>';
  731. 729.  -       }
  732. 730.  -     }
  733. 731.  -     if (vk.id != cur.oid) {
  734. 732.  -       html += '<span class="divider">|</span><span>' + cur.summaryLang['to_users_page'] + '</span>';
  735. 733.  -     }
  736. 734.  -     if ((cur.section == 'requests' && cur.requestsCount > 50) || cur.section == 'all_requests') {
  737. 735.  -       if (!cur.suggRev || !cur.suggCount) {
  738. 736.  -         if (nav.objLoc.sort != 'date') {
  739. 737.  -           html += '<span class="divide">|</span><span><a href="/friends?section=' + cur.section + '&sort=date">' + cur.summaryLang['friends_sort_by_date'] + '</a></span>';
  740. 738.  -         } else {
  741. 739.  -           html += '<span class="divide">|</span><span><a href="/friends?section=' + cur.section + '">' + cur.summaryLang['friends_sort_by_common'] + '</a></span>';
  742. 740.  -         }
  743. 741.  -       }
  744. 742.  -
  745. 743.  -     }
  746. 744.  -     sum.innerHTML = html;
  747. 745.  -
  748. 746.  -     document.title = replaceEntities(stripHTML(cur.htitles[cur.section] || cur.htitles.all));
  749. 747.  -   },
  750. 748.  -   selectTab: function(tab) {
  751. 749.  -     var section = geByClass1('active_link', ge('friends_tabs'));
  752. 750.  -     removeClass(section, 'active_link');
  753. 751.  -     addClass(ge('tab_' + tab), 'active_link');
  754. 752.  -     if (cur.oid != vk.id) {
  755. 753.  -       toggleClass(ge('main_class'), 'wide', tab != 'all' || !cur.allFriendsCount);
  756. 754.  -     }
  757. 755.  -   },
  758. 756.  -   selectSection: function(tab) {
  759. 757.  -     var section = geByClass1('cur_section', ge('sections_block'));
  760. 758.  -     removeClass(section, 'cur_section');
  761. 759.  -     addClass(ge('section_' + tab), 'cur_section');
  762. 760.  -   },
  763. 761.  -   selectSumTab: function(tab) {
  764. 762.  -     var section = geByClass1('summary_tab_sel', ge('friends_req_tabs'));
  765. 763.  -     removeClass(section, 'summary_tab_sel');
  766. 764.  -     addClass(section, 'summary_tab');
  767. 765.  -     var el = ge('sum_tab_' + tab).parentNode;
  768. 766.  -     removeClass(el, 'summary_tab');
  769. 767.  -     addClass(el, 'summary_tab_sel');
  770. 768.  -   },
  771. 769.  -   selectTabAndSection: function(type) {
  772. 770.  -     if (type == 'all' || type == 'online' || type == 'common' || type == 'members') {
  773. 771.  -       this.selectTab(type);
  774. 772.  -       this.selectSection('all');
  775. 773.  -     } else if (type == 'all_requests' || type == 'requests' || type == 'out_requests') {
  776. 774.  -       this.selectTab('requests');
  777. 775.  -       this.selectSumTab(type);
  778. 776.  -     } else {
  779. 777.  -       this.selectTab('all');
  780. 778.  -       this.selectSection(type);
  781. 779.  -     }
  782. 780.  -   },
  783. 781.  -   onSectionChange: function() {
  784. 782.  -     if (window.tooltips) {
  785. 783.  -       tooltips.hideAll();
  786. 784.  -     }
  787. 785.  -   },
  788. 786.  -   section: function(type, callback, updateData) {
  789. 787.  -     Friends.clearServerSearch();
  790. 788.  -     if (!type) {
  791. 789.  -       type = 'all';
  792. 790.  -     }
  793. 791.  -     //if (!updateData && (type != 'all' || cur.section != type) && type.substr(0, 4) != 'list') {
  794. 792.  -     if (!updateData && ((type == 'online' && cur.oid != vk.id) || type.indexOf('requests') != -1) && type.substr(0, 4) != 'list') {
  795. 793.  -       Friends.clearFilter();
  796. 794.  -     }
  797. 795.  -     if (!type) {
  798. 796.  -       if ((cur.requestsCount && cur.requestsCount > 0 && cur.requestsCount < 100) || cur.suggCount) {
  799. 797.  -         type = 'requests';
  800. 798.  -       } else {
  801. 799.  -         type = 'all';
  802. 800.  -       }
  803. 801.  -     }
  804. 802.  -     if (!cur.requestsCount && !cur.suggCount && !cur.allRequestsCount && !cur.outRequestsCount) {
  805. 803.  -       hide('tab_requests');
  806. 804.  -     }
  807. 805.  -     if (type != cur.section) {
  808. 806.  -       cur.fSearch.setValue('');
  809. 807.  -       cur.searchStr = '';
  810. 808.  -     }
  811. 809.  -     // Select section filter
  812. 810.  -     this.selectTabAndSection(type);
  813. 811.  -
  814. 812.  -     if (cur.silent && type != 'out_requests') {
  815. 813.  -       cur.onSilentLoad = function() {
  816. 814.  -         Friends.section(type, callback);
  817. 815.  -       };
  818. 816.  -       if (type != cur.section) {
  819. 817.  -         hide(cur.showMore);
  820. 818.  -         cur.fContent.innerHTML = '<div class="wide_loading"></div>';
  821. 819.  -       }
  822. 820.  -       return;
  823. 821.  -     }
  824. 822.  -
  825. 823.  -
  826. 824.  -     if (!cur.secData[type]) {
  827. 825.  -       cur.secData[type] = {};
  828. 826.  -     }
  829. 827.  -     // from cache
  830. 828.  -     if (!updateData && cur.friendsList[type] || type == 'all' || (type == 'requests' && cur.friendsList['sugg_requests'])) {
  831. 829.  -       if (!cur.filter) {
  832. 830.  -         this.showSection(type);
  833. 831.  -         callback();
  834. 832.  -         Friends.onSectionChange();
  835. 833.  -         return;
  836. 834.  -       }
  837. 835.  -     }
  838. 836.  -     // generate
  839. 837.  -     switch (type) {
  840. 838.  -       case 'online':
  841. 839.  -       case 'common':
  842. 840.  -         this.search(-1, type, callback);
  843. 841.  -         break;
  844. 842.  -       case 'phonebook':
  845. 843.  -         this.loadingState('phonebook');
  846. 844.  -         ajax.post('/al_friends.php', {act: 'phonebook', id: nav.objLoc.id}, {onDone: (function(data) {
  847. 845.  -           if (!data) {
  848. 846.  -             return;
  849. 847.  -           }
  850. 848.  -           cur.shownFriends = 0;
  851. 849.  -           cur.curList = cur.section = type;
  852. 850.  -           var list = cur.friendsList['all'];
  853. 851.  -           var phoneList = [];
  854. 852.  -           if (list) {
  855. 853.  -             for (var i = 0, len = list.length; i < len; i++) {
  856. 854.  -               var friend = list[i];
  857. 855.  -               var phone = data[friend[0]];
  858. 856.  -               if (phone) {
  859. 857.  -                 friend.push(phone);
  860. 858.  -                 phoneList.push(friend);
  861. 859.  -               }
  862. 860.  -             }
  863. 861.  -           }
  864. 862.  -           cur.friendsList[cur.section] = phoneList;
  865. 863.  -           cur.sectionCount = phoneList.length;
  866. 864.  -           cur.fContent.innerHTML = '';
  867. 865.  -           this.loadingState('phonebook', true);
  868. 866.  -           Friends.onSectionChange();
  869. 867.  -           callback();
  870. 868.  -           Friends.indexPhone();
  871. 869.  -           if (cur.filterIds) {
  872. 870.  -             cur.curList += '_filter';
  873. 871.  -             Friends.search(cur.searchStr || -1, cur.section, false, true);
  874. 872.  -             Friends.changeSummary();
  875. 873.  -             return;
  876. 874.  -           }
  877. 875.  -           this.showMore();
  878. 876.  -         }).bind(this)});
  879. 877.  -         break;
  880. 878.  -       case 'recent':
  881. 879.  -         this.loadingState('recent');
  882. 880.  -         ajax.post('/al_friends.php', {act: 'recent'}, {onDone: (function(data) {
  883. 881.  -           if (!data) {
  884. 882.  -             return;
  885. 883.  -           }
  886. 884.  -           cur.shownFriends = 0;
  887. 885.  -           cur.curList = cur.section = type;
  888. 886.  -           var list = [];
  889. 887.  -           len = data.length;
  890. 888.  -           for (var i = 0; i < len; i++) {
  891. 889.  -             var f = cur.friends[data[i]];
  892. 890.  -             if (f) {
  893. 891.  -               list.push(f);
  894. 892.  -             }
  895. 893.  -           }
  896. 894.  -           cur.friendsList[cur.section] = list;
  897. 895.  -           cur.sectionCount = list.length;
  898. 896.  -           cur.fContent.innerHTML = '';
  899. 897.  -           this.loadingState('recent', true);
  900. 898.  -           Friends.onSectionChange();
  901. 899.  -           callback();
  902. 900.  -           if (cur.filterIds) {
  903. 901.  -             cur.curList += '_filter';
  904. 902.  -             Friends.search(cur.searchStr || -1, cur.section, false, true);
  905. 903.  -             Friends.changeSummary();
  906. 904.  -             return;
  907. 905.  -           }
  908. 906.  -           this.showMore();
  909. 907.  -         }).bind(this)});
  910. 908.  -         break;
  911. 909.  -       case 'out_requests':
  912. 910.  -         hide(cur.showMore, 'friends_hide_all');
  913. 911.  -         cur.fContent.innerHTML = '<div class="wide_loading"></div>';
  914. 912.  -         ajax.post('/friends', {act: 'out_requests'}, {onDone: (function(data, universities) {
  915. 913.  -           var obj = eval('('+data+')');
  916. 914.  -
  917. 915.  -           // load friends json
  918. 916.  -           if (!obj) {
  919. 917.  -             return;
  920. 918.  -           }
  921. 919.  -           extend(cur.universities, universities);
  922. 920.  -           extend(cur.friendsList, obj);
  923. 921.  -
  924. 922.  -           this.indexAll(function() {
  925. 923.  -             Friends.section(type, callback);
  926. 924.  -           });
  927. 925.  -         }).bind(this)});
  928. 926.  -         break;
  929. 927.  -       default:
  930. 928.  -         if (type.substr(0, 4) == 'list') {
  931. 929.  -           this.search(-1, type, callback);
  932. 930.  -         }
  933. 931.  -
  934. 932.  -     }
  935. 933.  -   },
  936. 934.  -   loadingState: function(section, state) {
  937. 935.  -     if (state) {
  938. 936.  -       if (cur.oldSection) {
  939. 937.  -         removeClass(cur.oldSection, 'loading');
  940. 938.  -       }
  941. 939.  -     } else {
  942. 940.  -       cur.oldSection = ge('section_' + section);
  943. 941.  -       addClass(cur.oldSection, 'loading');
  944. 942.  -     }
  945. 943.  -   },
  946. 944.  -   scrollResize: function() {
  947. 945.  -     if (browser.mobile) return;
  948. 946.  -     var docEl = document.documentElement;
  949. 947.  -     var ch = window.innerHeight || docEl.clientHeight || bodyNode.clientHeight;
  950. 948.  -     var st = scrollGetY();
  951. 949.  -     if (!cur.pageEnd) {
  952. 950.  -       return;
  953. 951.  -     }
  954. 952.  -     if (st + ch * 3 > cur.pageEnd.offsetTop) {
  955. 953.  -       setTimeout(function() {
  956. 954.  -         Friends.showMore();
  957. 955.  -       }, 0);
  958. 956.  -     }
  959. 957.  -   },
  960. 958.  -   drawFriend: function(friend, first, type) {
  961. 959.  -     if (cur.section == 'requests' || cur.section == 'all_requests' || cur.section == 'out_requests') {
  962. 960.  -       return cur.commonTpl(friend, type || cur.section, first);
  963. 961.  -     } else {
  964. 962.  -       return cur.friendsTpl(friend, cur.section, first);
  965. 963.  -     }
  966. 964.  -   },
  967. 965.  -
  968. 966.  -   inviteToGroup: function(ev, gid, mid, invited, hash) {
  969. 967.  -     var setInvited = function(invited) {
  970. 968.  -       for(var i in cur.friendsList[cur.curList]) {
  971. 969.  -         var row = cur.friendsList[cur.curList][i];
  972. 970.  -         if (row[0] == mid) {
  973. 971.  -           row[10] = invited;
  974. 972.  -           //Friends.updateView();
  975. 973.  -           var block = ge('user_block'+mid), link = '';
  976. 974.  -           if (invited) {
  977. 975.  -             link = '<a href="" onclick="return Friends.inviteToGroup(event, '+gid+', '+mid+', 1, \''+row[11]+'\')">'+getLang('friends_cancel_invite')+'</a>';
  978. 976.  -           } else {
  979. 977.  -             link = '<a href="" onclick="return Friends.inviteToGroup(event, '+gid+', '+mid+', 0, \''+row[11]+'\')">'+getLang('friends_send_invite')+'</a>';
  980. 978.  -           }
  981. 979.  -           geByClass('actions', block)[0].innerHTML = link;
  982. 980.  -           break;
  983. 981.  -         }
  984. 982.  -       }
  985. 983.  -     }
  986. 984.  -     if (invited) {
  987. 985.  -       ajax.post('/al_page.php', {act:'a_cancel_invite', mid:mid, gid:gid, hash:hash}, {onDone:function(res){ }});
  988. 986.  -       setInvited(0);
  989. 987.  -     } else {
  990. 988.  -       ajax.post('/al_page.php', {act:'a_invite', mid:mid, gid:gid, hash:hash}, {onDone:function(res, message) {
  991. 989.  -         if (!res) {
  992. 990.  -           setInvited(0);
  993. 991.  -           ge('res'+mid).innerHTML = '<div class="res">'+message+'</div>';
  994. 992.  -           hide('lists'+mid);
  995. 993.  -           var block = ge('user_block'+mid);
  996. 994.  -           hide(geByClass('actions', block)[0]);
  997. 995.  -         }
  998. 996.  -       }});
  999. 997.  -       setInvited(1);
  1000. 998.  -     }
  1001. 999.  -     return false;
  1002. 1000.  -   },
  1003. 1001.  -
  1004. 1002.  -   acceptRequest: function(mid, hash, el) {
  1005. 1003.  -     var controls = ge('request_controls_'+mid);
  1006. 1004.  -     var controlsCont = controls.parentNode;
  1007. 1005.  -     if (!el) {
  1008. 1006.  -       controls.innerHTML = '<div align="center"><img src="/images/upload.gif"></div>';
  1009. 1007.  -     }
  1010. 1008.  -     ajax.post('al_friends.php', {act: 'add', mid: mid, hash: hash, request: 1, 'select_list': 1}, {onDone: function(text) {
  1011. 1009.  -       controls.innerHTML = text;
  1012. 1010.  -       if (cur.friendsList) {
  1013. 1011.  -         delete cur.friendsList['recent'];
  1014. 1012.  -       }
  1015. 1013.  -     }, onFail: function(text) {
  1016. 1014.  -       if (!text) return;
  1017. 1015.  -
  1018. 1016.  -       showFastBox(getLang('global_error'), text);
  1019. 1017.  -       return true;
  1020. 1018.  -     }, showProgress: lockButton.pbind(el), hideProgress: unlockButton.pbind(el)});
  1021. 1019.  -     Friends.processRequest(mid, true);
  1022. 1020.  -     if (cur.friendsList) {
  1023. 1021.  -       delete cur.friendsList['online'];
  1024. 1022.  -       Friends.indexAll();
  1025. 1023.  -     }
  1026. 1024.  -   },
  1027. 1025.  -
  1028. 1026.  -   declineRequest: function(mid, hash, el) {
  1029. 1027.  -     var controls = ge('request_controls_'+mid);
  1030. 1028.  -     var controlsCont = controls.parentNode;
  1031. 1029.  -     if (!el) {
  1032. 1030.  -       controls.innerHTML = '<div align="center"><img src="/images/upload.gif"></div>';
  1033. 1031.  -     }
  1034. 1032.  -     ajax.post('al_friends.php', {act: 'remove', mid: mid, hash: hash, report_spam: 1, from_section: cur.section}, {onDone: function(text) {
  1035. 1033.  -       controls.innerHTML = text;
  1036. 1034.  -     }, onFail: function(text) {
  1037. 1035.  -       if (!text) return;
  1038. 1036.  -
  1039. 1037.  -       showFastBox(getLang('global_error'), text);
  1040. 1038.  -       return true;
  1041. 1039.  -     }, showProgress: lockButton.pbind(el), hideProgress: unlockButton.pbind(el)});
  1042. 1040.  -
  1043. 1041.  -     Friends.processRequest(mid, false);
  1044. 1042.  -   },
  1045. 1043.  -
  1046. 1044.  -   processRequest: function(mid, add, sugg) {
  1047. 1045.  -     if (!cur.friendsList) {
  1048. 1046.  -       return;
  1049. 1047.  -     }
  1050. 1048.  -     var reqs = cur.friendsList[sugg ? 'sugg_requests' : 'requests'] || [];
  1051. 1049.  -     var len = reqs.length, found = false;
  1052. 1050.  -     while (len--) {
  1053. 1051.  -       if (reqs[len][0] == mid) {
  1054. 1052.  -         var friend = reqs.splice(len, 1)[0];
  1055. 1053.  -         if (sugg) {
  1056. 1054.  -           --cur.suggCount;
  1057. 1055.  -         } else {
  1058. 1056.  -           --cur.requestsCount;
  1059. 1057.  -         }
  1060. 1058.  -         val(geByClass1('tab_word', ge('tab_requests')), cur.summaryLang['requests_title'] + (cur.requestsCount ? ('<span class="count">+' + cur.requestsCount + '</span>') : ''));
  1061. 1059.  -         toggleClass(ge('tab_requests'), 'count', !!cur.requestsCount);
  1062. 1060.  -         if (add) {
  1063. 1061.  -           found = true;
  1064. 1062.  -           friend.pop();
  1065. 1063.  -           if (cur.friendsList['all']) {
  1066. 1064.  -             cur.friendsList['all'].push(friend);
  1067. 1065.  -           } else {
  1068. 1066.  -             cur.friendsList['all'] = [friend];
  1069. 1067.  -           }
  1070. 1068.  -           cur.friends[friend[0]] = friend;
  1071. 1069.  -         }
  1072. 1070.  -       }
  1073. 1071.  -     }
  1074. 1072.  -     if (add) {
  1075. 1073.  -       var reqs = cur.friendsList['all_requests'] || [];
  1076. 1074.  -       var len = reqs.length;
  1077. 1075.  -       while (len--) {
  1078. 1076.  -         if (reqs[len][0] == mid) {
  1079. 1077.  -           var friend = reqs.splice(len, 1)[0];
  1080. 1078.  -           --cur.allRequestsCount;
  1081. 1079.  -           if (!found) {
  1082. 1080.  -             friend.pop();
  1083. 1081.  -             if (cur.friendsList['all']) {
  1084. 1082.  -               cur.friendsList['all'].push(friend);
  1085. 1083.  -             } else {
  1086. 1084.  -               cur.friendsList['all'] = [friend];
  1087. 1085.  -             }
  1088. 1086.  -             cur.friends[friend[0]] = friend;
  1089. 1087.  -           }
  1090. 1088.  -         }
  1091. 1089.  -       }
  1092. 1090.  -     } else {
  1093. 1091.  -       var reqs = cur.friendsList['out_requests'] || [];
  1094. 1092.  -       var len = reqs.length;
  1095. 1093.  -       while (len--) {
  1096. 1094.  -         if (reqs[len][0] == mid) {
  1097. 1095.  -           var friend = reqs.splice(len, 1)[0];
  1098. 1096.  -           --cur.outRequestsCount;
  1099. 1097.  -         }
  1100. 1098.  -       }
  1101. 1099.  -     }
  1102. 1100.  -   },
  1103. 1101.  -
  1104. 1102.  -   reportSpam: function(mid, hash) {
  1105. 1103.  -     var controls = ge('request_controls_' + mid);
  1106. 1104.  -     if (!controls) {
  1107. 1105.  -       controls = ge('result_msg');
  1108. 1106.  -       removeClass(controls, 'msg');
  1109. 1107.  -     }
  1110. 1108.  -     controls.innerHTML = '<div align="center"><img src="/images/upload.gif"></div>';
  1111. 1109.  -     ajax.post('al_friends.php', {act: 'report_spam', mid: mid, hash: hash}, {onDone: function(text) {
  1112. 1110.  -       controls.innerHTML = text;
  1113. 1111.  -     }});
  1114. 1112.  -   },
  1115. 1113.  -
  1116. 1114.  -   restoreFriend: function(el, id) {
  1117. 1115.  -     var back = el.innerHTML;
  1118. 1116.  -     ajax.post('al_friends.php', {act: 'add', mid: id, hash: cur.userHash, cats: cur.savedMasks[id]}, {
  1119. 1117.  -       onDone: Friends.onRemoveFriend.pbind(id, true),
  1120. 1118.  -       showProgress: function() {
  1121. 1119.  -         el.innerHTML = '<center><img src="/images/upload.gif" /></center>';
  1122. 1120.  -       },
  1123. 1121.  -       hideProgress: function() {
  1124. 1122.  -         el.innerHTML = back;
  1125. 1123.  -       }
  1126. 1124.  -     });
  1127. 1125.  -   },
  1128. 1126.  -
  1129. 1127.  -   deleteFriend: function(e, id, el) {
  1130. 1128.  -     var back = el.innerHTML;
  1131. 1129.  -     ajax.post('al_friends.php', {act: 'remove', mid: id, hash: cur.userHash}, {
  1132. 1130.  -       onDone: Friends.onRemoveFriend.pbind(id, false),
  1133. 1131.  -       showProgress: function() {
  1134. 1132.  -         el.innerHTML = '<center><img src="/images/upload.gif" /></center>';
  1135. 1133.  -       },
  1136. 1134.  -       hideProgress: function() {
  1137. 1135.  -         el.innerHTML = back;
  1138. 1136.  -       }
  1139. 1137.  -     });
  1140. 1138.  -     return false;
  1141. 1139.  -   },
  1142. 1140.  -
  1143. 1141.  -   onRemoveFriend: function(mid, res) {
  1144. 1142.  -     var needUpdateView = (cur.friendsList[cur.curList] || []).length < 10;
  1145. 1143.  -
  1146. 1144.  -     for (var i in cur.friendsList) {
  1147. 1145.  -       if (i != 'all' && i != 'requests' && i != 'all_requests' && i != 'out_requests') {
  1148. 1146.  -         delete cur.friendsList[i];
  1149. 1147.  -       }
  1150. 1148.  -     }
  1151. 1149.  -     var list = cur.friendsList['all'];
  1152. 1150.  -     var len = list.length;
  1153. 1151.  -     mid = positive(mid);
  1154. 1152.  -
  1155. 1153.  -     var block = ge('user_block' + mid);
  1156. 1154.  -     var fr = cur.friends[mid];
  1157. 1155.  -     if (fr && block) {
  1158. 1156.  -       if (res) {
  1159. 1157.  -         fr[6] = cur.savedMasks[mid];
  1160. 1158.  -         delete(cur.savedMasks[mid]);
  1161. 1159.  -       } else {
  1162. 1160.  -         cur.savedMasks[mid] = fr[6];
  1163. 1161.  -         fr[6] = 0; // zero mask - removed friend
  1164. 1162.  -       }
  1165. 1163.  -       block.parentNode.replaceChild(ce('div', {innerHTML: cur.friendsTpl(fr, cur.section, hasClass(block, 'user_block_first') ? ' user_block_first' : '').join('')}).firstChild, block);
  1166. 1164.  -     } else {
  1167. 1165.  -       re(block);
  1168. 1166.  -     }
  1169. 1167.  -
  1170. 1168.  -     Friends.indexAll(function() {
  1171. 1169.  -     });
  1172. 1170.  -   },
  1173. 1171.  -   showCommonBox: function(e, id, hash) {
  1174. 1172.  -     if (checkEvent(e)) return true;
  1175. 1173.  -     showBox('al_friends.php', {act: 'common_friends', mid: id, hash: hash}, {params: {bodyStyle: "padding: 0px;"}});
  1176. 1174.  -     return false;
  1177. 1175.  -   },
  1178. 1176.  -   toList: function(num) {
  1179. 1177.  -     nav.change({'0':'al_friends.php', section:'list' + num});
  1180. 1178.  -     scrollToTop(0);
  1181. 1179.  -     return false;
  1182. 1180.  -   },
  1183. 1181.  -
  1184. 1182.  -   /*ddShowSearchActs: function(obj, ev, uid) {
  1185. 1183.  -     var elems = [];
  1186. 1184.  -     elems.push('<a class="friends_dd_item" onclick="Friends.ddHide(ge(\'friends_dd_menu_'+uid+'\'), '+uid+');return showWriteMessageBox(event, '+uid+')">'+cur.summaryLang['global_write_msg']+'</a>');
  1187. 1185.  -     Friends.ddShowCustom(obj, ev, elems, uid);
  1188. 1186.  -   },*/
  1189. 1187.  -
  1190. 1188.  -   ttActToggle: function(obj, uid, hash, add) {
  1191. 1189.  -     var back = obj.innerHTML;
  1192. 1190.  -     ajax.post('al_friends.php', {act: add ? 'add' : 'remove', mid: uid, hash: hash, from: 'friends'}, {
  1193. 1191.  -       onDone: function(text) {
  1194. 1192.  -         //re(obj);
  1195. 1193.  -         cur['friends_info'+uid] = add;
  1196. 1194.  -         showDoneBox('<div class="friends_done">'+text+'</div>')
  1197. 1195.  -         tooltips.destroyAll();
  1198. 1196.  -         //ge('friends_tt_cont_'+uid).tt.close();
  1199. 1197.  -       },
  1200. 1198.  -       showProgress: function() {
  1201. 1199.  -         obj.innerHTML = '<center><img src="/images/upload.gif" /></center>';
  1202. 1200.  -       },
  1203. 1201.  -       hideProgress: function() {
  1204. 1202.  -         obj.innerHTML = back;
  1205. 1203.  -       }
  1206. 1204.  -     })
  1207. 1205.  -   },
  1208. 1206.  -
  1209. 1207.  -   ttActGift: function(uid) {
  1210. 1208.  -     return !showBox('al_gifts.php', {act: 'get_gift_box', mid: uid, fr: (uid == vk.id ? 1 : 0)}, {stat: ['gifts.css', 'ui_controls.js', 'ui_controls.css'], cache: 1}, false);
  1211. 1209.  -   },
  1212. 1210.  -
  1213. 1211.  -   ttActsMenu: function(obj, ev, uid, hash) {
  1214. 1212.  -     if (obj.tt) {
  1215. 1213.  -       if (!obj.tt.show) return;
  1216. 1214.  -       return obj.tt.show();
  1217. 1215.  -     }
  1218. 1216.  -     if (window.tooltips) {
  1219. 1217.  -       tooltips.hideAll();
  1220. 1218.  -     }
  1221. 1219.  -     var info = cur['friends_info'+uid] || '';
  1222. 1220.  -     var html = ['<div class="friends_tt_menu">'];
  1223. 1221.  -     html.push('<a class="friends_tt_item" onclick="return showWriteMessageBox(event, '+uid+')"><div class="friends_tt_icon friends_tt_msg"></div>'+cur.summaryLang['global_write_msg']+'</a>');
  1224. 1222.  -     if (info) {
  1225. 1223.  -       html.push('<a class="friends_tt_item" onclick="return Friends.ttActToggle(this, '+uid+', \''+hash+'\', 0);"><div class="friends_tt_icon friends_tt_cancel"></div>'+cur.summaryLang['friends_add_cancel']+'</a>');
  1226. 1224.  -     } else if (!cur.friends[uid]) {
  1227. 1225.  -       html.push('<a class="friends_tt_item" onclick="return Friends.ttActToggle(this, '+uid+', \''+hash+'\', 1);"><div class="friends_tt_icon friends_tt_add"></div>'+cur.summaryLang['friends_add_act']+'</a>');
  1228. 1226.  -     }
  1229. 1227.  -     html.push('<a class="friends_tt_item" onclick="return Friends.ttActGift('+uid+');"><div class="friends_tt_icon friends_tt_gift"></div>'+cur.summaryLang['friends_gift_act']+'</a>');
  1230. 1228.  -     html.push('</div>');
  1231. 1229.  -     showTooltip(obj, {
  1232. 1230.  -       text: html.join(''),
  1233. 1231.  -       className: 'friends_tt wall_tt',
  1234. 1232.  -       shift: [0, 0, -2],
  1235. 1233.  -       forcetodown: 1,
  1236. 1234.  -       hasover: 1,
  1237. 1235.  -       center: 1
  1238. 1236.  -     });
  1239. 1237.  -   },
  1240. 1238.  -
  1241. 1239.  -   ddShow: function(uid, obj, ev) {
  1242. 1240.  -     if (cur.silent) {
  1243. 1241.  -       cur.onSilentLoad = function() {
  1244. 1242.  -         Friends.ddShow(uid, obj, ev);
  1245. 1243.  -       };
  1246. 1244.  -       return;
  1247. 1245.  -     }
  1248. 1246.  -
  1249. 1247.  -     var friend = cur.friends[parseInt(uid)];
  1250. 1248.  -     var cats = parseInt(friend[6]);
  1251. 1249.  -
  1252. 1250.  -     var elems = [];
  1253. 1251.  -
  1254. 1252.  -     var publicLists = [28, 29, 27, 25, 26];
  1255. 1253.  -     for (var j = 0, i; j < 5; ++j) {
  1256. 1254.  -       i = publicLists[j];
  1257. 1255.  -       if (cur.publicLists[i]) {
  1258. 1256.  -         elems.push('<a class="friends_dd_item'+((cats & (1 << parseInt(i))) ? ' checked' : '')+'" onclick="Friends.checkCat(this, '+uid+', '+i+');">'+cur.publicLists[i]+'</a>');
  1259. 1257.  -       }
  1260. 1258.  -     }
  1261. 1259.  -     for (var i in cur.userLists) {
  1262. 1260.  -       if (i < 25) {
  1263. 1261.  -         var lname = cur.userLists[i];
  1264. 1262.  -         if (lname.length > 20) {
  1265. 1263.  -           lname = trim(lname.substr(0, 18))+'...';
  1266. 1264.  -         }
  1267. 1265.  -         elems.push('<a class="friends_dd_item'+((cats & (1 << parseInt(i))) ? ' checked' : '')+'" onclick="Friends.checkCat(this, '+uid+', '+i+');">'+lname+'</a>');
  1268. 1266.  -       }
  1269. 1267.  -     }
  1270. 1268.  -     Friends.ddShowCustom(obj, ev, elems, uid);
  1271. 1269.  -   },
  1272. 1270.  -
  1273. 1271.  -   ddShowCustom: function(obj, event, elems, ddId) {
  1274. 1272.  -     var text = obj.innerHTML;
  1275. 1273.  -     var pos = getXY(obj);
  1276. 1274.  -     var height = window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight);
  1277. 1275.  -     var posY = pos[1] - scrollGetY();
  1278. 1276.  -     var ddHeight = elems.length * 22;
  1279. 1277.  -
  1280. 1278.  -     var params = {
  1281. 1279.  -       className: 'lists_menu'
  1282. 1280.  -     }
  1283. 1281.  -
  1284. 1282.  -     var styleAdd = '';
  1285. 1283.  -     var headerAdd = '';
  1286. 1284.  -
  1287. 1285.  -     if (posY > (height / 2) && (height - posY) < ddHeight) {
  1288. 1286.  -       headerAdd = ' friends_header_up';
  1289. 1287.  -       elems = elems.reverse();
  1290. 1288.  -       styleAdd = ' style="margin-top: -'+(ddHeight + 1)+'px;"';
  1291. 1289.  -     }
  1292. 1290.  -
  1293. 1291.  -     var htmlH = ['<div id="friends_dd_menu_',ddId,'" onmouseout="Friends.ddHide(this, ',ddId,');" onmouseover="Friends.ddActive(this, ',ddId,');"><div class="lists_header', headerAdd,'"><div>', text, '</div></div><div class="lists_body" ', styleAdd,'><table cellspacing="0" cellpadding="0"><tbody><tr><td class="lists_shad_l"><div></div></td><td><div class="lists_shad_t2"></div><div class="lists_shad_t"></div><div class="lists_rows"><div id="rows3">'];
  1294. 1292.  -
  1295. 1293.  -     var htmlF = '</div></div><div class="lists_shad_b"></div><div class="lists_shad_b2"></div></td><td class="lists_shad_r"><div> </div></td></tr></tbody></table></div></div>';
  1296. 1294.  -
  1297. 1295.  -     params.innerHTML = htmlH.join('') + elems.join('') + htmlF;
  1298. 1296.  -
  1299. 1297.  -     var dd = ce('div', params);
  1300. 1298.  -
  1301. 1299.  -     obj.parentNode.insertBefore(dd, obj);
  1302. 1300.  -     cur.onMouseClick = function(ev) {
  1303. 1301.  -       var menuId = 'friends_dd_menu_'+ddId;
  1304. 1302.  -       var obj = ev.target;
  1305. 1303.  -       while (obj) {
  1306. 1304.  -         if (hasClass(obj, 'lists_select') || obj.id == menuId) {
  1307. 1305.  -           return false;
  1308. 1306.  -         }
  1309. 1307.  -         obj = obj.parentNode;
  1310. 1308.  -       }
  1311. 1309.  -       if (ev.target)
  1312. 1310.  -       Friends.ddHide(ge(menuId), ddId, 1);
  1313. 1311.  -     }
  1314. 1312.  -   },
  1315. 1313.  -
  1316. 1314.  -   ddHide: function(obj, ddId, fast) {
  1317. 1315.  -     cur.timeouts['dd_fade'+ddId] = setTimeout(function() {
  1318. 1316.  -       fadeOut(obj, fast ? 0 : 100, function() {
  1319. 1317.  -         var parentEl = obj.parentNode.parentNode;
  1320. 1318.  -         if (parentEl) {
  1321. 1319.  -           parentEl.removeChild(obj.parentNode);
  1322. 1320.  -         }
  1323. 1321.  -       });
  1324. 1322.  -     }, fast ? 0 : 600);
  1325. 1323.  -   },
  1326. 1324.  -   ddActive: function(obj, ddId) {
  1327. 1325.  -     if (cur.timeouts['dd_fade'+ddId]) {
  1328. 1326.  -       clearTimeout(cur.timeouts['dd_fade'+ddId]);
  1329. 1327.  -     }
  1330. 1328.  -   },
  1331. 1329.  -   checkCat: function(obj, uid, listId, from) {
  1332. 1330.  -     if (from == 1) {
  1333. 1331.  -       var checked = isChecked(obj);
  1334. 1332.  -     } else {
  1335. 1333.  -       var checked = hasClass(obj, 'checked');
  1336. 1334.  -       var lists = ge('lists' + uid);
  1337. 1335.  -     }
  1338. 1336.  -     var friend = cur.friends[uid];
  1339. 1337.  -     if (!friend) {
  1340. 1338.  -       return false;
  1341. 1339.  -     }
  1342. 1340.  -     friend[6] = parseInt(friend[6]);
  1343. 1341.  -     if (checked) {
  1344. 1342.  -       if (friend[6] & (1 << listId)) {
  1345. 1343.  -         friend[6] -= (1 << listId);
  1346. 1344.  -       }
  1347. 1345.  -       if (lists) {
  1348. 1346.  -         lists.innerHTML = Friends.getLists(friend[6]);
  1349. 1347.  -       }
  1350. 1348.  -     } else {
  1351. 1349.  -       if (!(friend[6] & (1 << listId))) {
  1352. 1350.  -         friend[6] += (1 << listId);
  1353. 1351.  -       }
  1354. 1352.  -       if (lists) {
  1355. 1353.  -         lists.innerHTML = Friends.getLists(friend[6]);
  1356. 1354.  -       }
  1357. 1355.  -     }
  1358. 1356.  -
  1359. 1357.  -     if (from == 1) {
  1360. 1358.  -       checkbox(obj);
  1361. 1359.  -     } else {
  1362. 1360.  -       (checked ? removeClass : addClass)(obj, 'checked');
  1363. 1361.  -     }
  1364. 1362.  -     if (cur.timeouts['list'+uid]) {
  1365. 1363.  -       clearTimeout(cur.timeouts['list'+uid]);
  1366. 1364.  -     }
  1367. 1365.  -     delete cur.friendsList['list'+listId];
  1368. 1366.  -     delete cur.friendsList['list'+friend[6]]
  1369. 1367.  -     cur.timeouts['list'+uid] = setTimeout(function() {
  1370. 1368.  -       ajax.post('al_friends.php', {act: 'save_cats', uid: uid, cats: friend[6], hash: cur.userHash}, {
  1371. 1369.  -         onDone: function(text) {
  1372. 1370.  -           if (from) {
  1373. 1371.  -             var info = ge('friends_added_'+uid);
  1374. 1372.  -             if (!cur['fr_add_text_'+uid] && info) {
  1375. 1373.  -               cur['fr_add_text_'+uid] = info.innerHTML;
  1376. 1374.  -             }
  1377. 1375.  -             fadeTo(info, 100, 0, function() {
  1378. 1376.  -               info.innerHTML = text;
  1379. 1377.  -               fadeTo(info, 100, 1);
  1380. 1378.  -             });
  1381. 1379.  -             clearTimeout(cur['fr_add_timeout_'+uid]);
  1382. 1380.  -             cur['fr_add_timeout_'+uid] = setTimeout(function() {
  1383. 1381.  -               fadeTo(info, 100, 0, function() {
  1384. 1382.  -                 info.innerHTML = cur['fr_add_text_'+uid];
  1385. 1383.  -                 fadeTo(info, 100, 1);
  1386. 1384.  -               });
  1387. 1385.  -             }, 2000);
  1388. 1386.  -           }
  1389. 1387.  -         }
  1390. 1388.  -       });
  1391. 1389.  -     });
  1392. 1390.  -   },
  1393. 1391.  -   getLists: function(cats) {
  1394. 1392.  -     var info = [];
  1395. 1393.  -     for (var i = 29; i >= 25; i--) {
  1396. 1394.  -       if ((1 << i) & cats && cur.publicLists[i]) {
  1397. 1395.  -         info.push('<span class="group', (i - 1) % 8 + 1, ' fl_l" onmousedown="Friends.toList(', i, ');">', cur.publicLists[i], '</span>');
  1398. 1396.  -       }
  1399. 1397.  -     }
  1400. 1398.  -     if (vk.id == cur.oid) {
  1401. 1399.  -       for (var i in cur.userLists) {
  1402. 1400.  -         if ((1 << i) & cats && !cur.publicLists[i] && cur.userLists[i]) {
  1403. 1401.  -           info.push('<span class="group', (i - 1) % 8 + 1, ' fl_l" onmousedown="Friends.toList(', i, ');">', cur.userLists[i], '</span>');
  1404. 1402.  -         }
  1405. 1403.  -       }
  1406. 1404.  -     }
  1407. 1405.  -     return info.join('');
  1408. 1406.  -   },
  1409. 1407.  -   subscribeAllRequests: function(obj, hash) {
  1410. 1408.  -     ajax.post('al_friends.php', {act: 'subscribe_all_requests', hash: hash, once: 1}, {
  1411. 1409.  -       showProgress: lockButton.pbind(obj),
  1412. 1410.  -       hideProgress: unlockButton.pbind(obj)
  1413. 1411.  -     });
  1414. 1412.  -   },
  1415. 1413.  -   onAllRequestsRemove: function() {
  1416. 1414.  -     return nav.go('/friends?section=all_requests', false, {nocur: true});
  1417. 1415.  -   },
  1418. 1416.  -   editList: function(listId) {
  1419. 1417.  -     var checked = [];
  1420. 1418.  -     if (listId == -1) {
  1421. 1419.  -       listId = intval(cur.curList.substr(4));
  1422. 1420.  -     }
  1423. 1421.  -     if (listId) {
  1424. 1422.  -       var list = Friends.filter(cur.friendsList['all'], cur.curList);
  1425. 1423.  -       var len = list.length;
  1426. 1424.  -       while (len--) {
  1427. 1425.  -         checked.push(list[len][0]);
  1428. 1426.  -       }
  1429. 1427.  -     } else {
  1430. 1428.  -       listId = 0;
  1431. 1429.  -     }
  1432. 1430.  -     showTabbedBox('al_friends.php', {
  1433. 1431.  -       act: 'select_friends_box',
  1434. 1432.  -       Checked: checked.join(','),
  1435. 1433.  -       from: 'list',
  1436. 1434.  -       list_name: (listId ? cur.userLists[listId] : ''),
  1437. 1435.  -       list_id: listId
  1438. 1436.  -     }, {
  1439. 1437.  -       stat: ['privacy.js', 'ui_controls.js', 'ui_controls.css'],
  1440. 1438.  -       cache: 1,
  1441. 1439.  -       onFail: function(text) {
  1442. 1440.  -         setTimeout(showFastBox(getLang('global_error'), text).hide, 3000);
  1443. 1441.  -         return true;
  1444. 1442.  -       }
  1445. 1443.  -     });
  1446. 1444.  -     cur.onFlistSave = function (ids, list, hash, title) {
  1447. 1445.  -       var friendsList = [];
  1448. 1446.  -       for (var i in list) {
  1449. 1447.  -         friendsList.push(parseInt(i));
  1450. 1448.  -       }
  1451. 1449.  -
  1452. 1450.  -       ajax.post('al_friends.php', {act: 'save_list', title: title, cat_id: listId, Friends: friendsList.join(','), hash: hash}, {
  1453. 1451.  -         onDone: function(id, title) {
  1454. 1452.  -           Friends.editListClient(listId, id, title, friendsList);
  1455. 1453.  -         },
  1456. 1454.  -         onFail: function(text) {
  1457. 1455.  -           setTimeout(showFastBox({title: getLang('global_error')}, text, getLang('global_close')).hide, 4000);
  1458. 1456.  -           return true;
  1459. 1457.  -         }
  1460. 1458.  -       });
  1461. 1459.  -
  1462. 1460.  -       Friends.clearFilter();
  1463. 1461.  -
  1464. 1462.  -       return false;
  1465. 1463.  -     };
  1466. 1464.  -
  1467. 1465.  -   },
  1468. 1466.  -   editListClient: function(listId, id, title, friendsList) {
  1469. 1467.  -     var listName = 'list' + id;
  1470. 1468.  -     if (listId == 0) {
  1471. 1469.  -       var html = '<a onmousedown="return nav.change({\'0\':\'al_friends.php\', section:\'list'+id+'\'});" id="section_list'+id+'" class="side_filter">'+title+'</a>';
  1472. 1470.  -       ge('sections_block').insertBefore(ce('div', {
  1473. 1471.  -         innerHTML: html
  1474. 1472.  -       }), ge('friends_create_list'));
  1475. 1473.  -       var len = friendsList.length;
  1476. 1474.  -       var mask = 1 << parseInt(id);
  1477. 1475.  -       cur.friendsList[listName] = [];
  1478. 1476.  -       while (len--) {
  1479. 1477.  -         var friend = cur.friends[friendsList[len]];
  1480. 1478.  -         friend[6] = parseInt(friend[6]);
  1481. 1479.  -
  1482. 1480.  -         if (!(friend[6] & mask)) {
  1483. 1481.  -           friend[6] += mask;
  1484. 1482.  -           cur.friendsList[listName].push(friend)
  1485. 1483.  -         }
  1486. 1484.  -       }
  1487. 1485.  -       cur.userLists[id] = title;
  1488. 1486.  -       //Friends.indexAll();
  1489. 1487.  -       Friends.indexAll();
  1490. 1488.  -       removeClass(ge('main_class'), 'no_lists');
  1491. 1489.  -       return nav.change({'0':'friends', section: listName});
  1492. 1490.  -     } else {
  1493. 1491.  -       if (id < 25) {
  1494. 1492.  -         ge('section_list'+id).innerHTML = title;
  1495. 1493.  -         cur.userLists[id] = title;
  1496. 1494.  -       }
  1497. 1495.  -       var mask = (1 << id);
  1498. 1496.  -       cur.friendsList[listName] = [];
  1499. 1497.  -       for (var i in cur.friends) {
  1500. 1498.  -         var friend = cur.friends[i];
  1501. 1499.  -         var inList = (friendsList.indexOf(parseInt(friend[0])) != -1);
  1502. 1500.  -         if (inList) {
  1503. 1501.  -           cur.friendsList[listName].push(friend);
  1504. 1502.  -         }
  1505. 1503.  -         friend[6] = parseInt(friend[6]);
  1506. 1504.  -         if (friend[6] & mask) {
  1507. 1505.  -           if (!inList) {
  1508. 1506.  -             friend[6] -= mask;
  1509. 1507.  -           }
  1510. 1508.  -         } else {
  1511. 1509.  -           if (inList) {
  1512. 1510.  -             friend[6] += mask;
  1513. 1511.  -           }
  1514. 1512.  -         }
  1515. 1513.  -       }
  1516. 1514.  -       Friends.indexAll();
  1517. 1515.  -       return Friends.section(listName, function() {
  1518. 1516.  -         Friends.changeSummary();
  1519. 1517.  -         nav.setLoc({'0':'friends', section: listName});
  1520. 1518.  -       });
  1521. 1519.  -     }
  1522. 1520.  -   },
  1523. 1521.  -   createList: function(event) {
  1524. 1522.  -     Friends.editList(0);
  1525. 1523.  -   },
  1526. 1524.  -   deleteList: function(listId) {
  1527. 1525.  -     showBox('al_friends.php', {act: 'delete_list_box', list_id: listId});
  1528. 1526.  -   },
  1529. 1527.  -   deleteListClient: function(listId) {
  1530. 1528.  -     var listSection = ge('section_list'+listId);
  1531. 1529.  -     listSection.parentNode.removeChild(listSection);
  1532. 1530.  -     var mask = (1 << listId);
  1533. 1531.  -     for (var i in cur.friends) {
  1534. 1532.  -       if (cur.friends[i][6] & mask) {
  1535. 1533.  -         cur.friends[i][6] -= mask;
  1536. 1534.  -       }
  1537. 1535.  -     }
  1538. 1536.  -     delete cur.userLists[listId];
  1539. 1537.  -     var listsCount = 0;
  1540. 1538.  -     for (var i in cur.userLists) listsCount++;
  1541. 1539.  -     if (!listsCount) {
  1542. 1540.  -       addClass(ge('main_class'), 'no_lists');
  1543. 1541.  -     }
  1544. 1542.  -     //Friends.indexAll();
  1545. 1543.  -     return nav.change({'0':'friends', section:'all'});
  1546. 1544.  -   },
  1547. 1545.  -   searchForFriends: function() {
  1548. 1546.  -     showBox('al_friends.php', {act: 'search'}, {stat: ['friends_search.js', 'friends_search.css'], dark: 1});
  1549. 1547.  -   },
  1550. 1548.  -   selectList: function(obj, id, event) {
  1551. 1549.  -     Friends.ddShow(id, obj, event);
  1552. 1550.  -   },
  1553. 1551.  -   _animDelX: function(color, new_active, post) {
  1554. 1552.  -     if (post === undefined) {
  1555. 1553.  -       post = new_active;
  1556. 1554.  -       new_active = undefined;
  1557. 1555.  -     }
  1558. 1556.  -     var el = ge('delete_row' + post);
  1559. 1557.  -     if (!el) return;
  1560. 1558.  -     if (new_active !== undefined) {
  1561. 1559.  -       el.active = new_active;
  1562. 1560.  -     } else if (el.active) {
  1563. 1561.  -       return;
  1564. 1562.  -     }
  1565. 1563.  -     animate(el, {backgroundColor: color}, 200);
  1566. 1564.  -   },
  1567. 1565.  -   hideSuggestion: function(mid, hash, el) {
  1568. 1566.  -     var controls = ge('request_controls_'+mid);
  1569. 1567.  -     var controlsCont = controls.parentNode;
  1570. 1568.  -     (el || controls).innerHTML = '<div align="center"><img src="/images/upload.gif"></div>';
  1571. 1569.  -     ajax.post('al_friends.php', {act: 'hide_suggestion', mid: mid, hash: hash, report_spam: 1}, {onDone: function(text) {
  1572. 1570.  -       controls.innerHTML = text;
  1573. 1571.  -       cur.suggCount -= 1;
  1574. 1572.  -     }, onFail: function(text) {
  1575. 1573.  -       if (!text) return;
  1576. 1574.  -
  1577. 1575.  -       showFastBox(getLang('global_error'), text);
  1578. 1576.  -       return true;
  1579. 1577.  -     }});
  1580. 1578.  -     Friends.processRequest(mid, false, true);
  1581. 1579.  -
  1582. 1580.  -   },
  1583. 1581.  -   addRecommend: function(mid, uid, hash, obj) {
  1584. 1582.  -     obj = obj.parentNode;
  1585. 1583.  -     obj.innerHTML = '<img src="/images/upload.gif" />';
  1586. 1584.  -     ajax.post('al_friends.php', {
  1587. 1585.  -       act: 'a_suggest_friends',
  1588. 1586.  -       mid: mid,
  1589. 1587.  -       uids: uid,
  1590. 1588.  -       hash: hash,
  1591. 1589.  -       from: 'add'
  1592. 1590.  -     }, {
  1593. 1591.  -       onDone: function(text) {
  1594. 1592.  -         obj.innerHTML = text;
  1595. 1593.  -       },
  1596. 1594.  -       onFail: function(text) {
  1597. 1595.  -         obj.innerHTML = text;
  1598. 1596.  -       }
  1599. 1597.  -     })
  1600. 1598.  -
  1601. 1599.  -   },
  1602. 1600.  -   suggestBox: function(mid) {
  1603. 1601.  -     var box = showBox('al_friends.php', {
  1604. 1602.  -       act: 'select_friends_box',
  1605. 1603.  -       from: 'suggest_friends',
  1606. 1604.  -       friend_id: mid
  1607. 1605.  -     }, {stat: ['privacy.js', 'privacy.css', 'indexer.js', 'profile.css']});
  1608. 1606.  -     box.leaveOnSave = true;
  1609. 1607.  -     cur.onFlistSave = function(ids, list, hash) {
  1610. 1608.  -       //if (!ids || !ids.length) return;
  1611. 1609.  -       ajax.post('al_friends.php', {
  1612. 1610.  -         act: 'a_suggest_friends',
  1613. 1611.  -         mid: mid,
  1614. 1612.  -         ids: ids.join(','),
  1615. 1613.  -         hash: hash
  1616. 1614.  -       }, {
  1617. 1615.  -         onDone: function(text) {
  1618. 1616.  -           box.hide();
  1619. 1617.  -           showDoneBox(text);
  1620. 1618.  -         },
  1621. 1619.  -         showProgress: box.showProgress,
  1622. 1620.  -         hideProgress: box.hideProgress
  1623. 1621.  -       });
  1624. 1622.  -     }
  1625. 1623.  -   },
  1626. 1624.  -   getAgeFromData: function(max, opts) {
  1627. 1625.  -     max = parseInt(max);
  1628. 1626.  -     if (!max > 0) max = opts.ageTo;
  1629. 1627.  -     return Friends.getRangeData(opts.ageFrom, max, 1, opts.langAgeFrom+' ', opts.langAgeFromEmpty);
  1630. 1628.  -   },
  1631. 1629.  -   getAgeToData: function(min, opts) {
  1632. 1630.  -     min = parseInt(min);
  1633. 1631.  -     if (!min > 0) min = opts.ageFrom;
  1634. 1632.  -     return Friends.getRangeData(min, opts.ageTo, 1, opts.langAgeTo+' ', opts.langAgeToEmpty);
  1635. 1633.  -   },
  1636. 1634.  -   getRangeData: function(min, max, step, prefix, label) {
  1637. 1635.  -     if (min > max) return false;
  1638. 1636.  -     var ret = [[0, label]];
  1639. 1637.  -     if (step < 0) {
  1640. 1638.  -       for (var i = max; i >= min; i += step)
  1641. 1639.  -         ret.push([i, prefix + i]);
  1642. 1640.  -     } else if (step > 0) {
  1643. 1641.  -       for (var i = min; i <= max; i += step)
  1644. 1642.  -         ret.push([i, prefix + i]);
  1645. 1643.  -     }
  1646. 1644.  -     return ret;
  1647. 1645.  -   },
  1648. 1646.  -   radioFilter: function(el, value, fireEvent) {
  1649. 1647.  -     radiobtn(el, value, 'friends_radio_sex');
  1650. 1648.  -     if (fireEvent || fireEvent == undefined) {
  1651. 1649.  -       Friends.changeFilter();
  1652. 1650.  -     }
  1653. 1651.  -   },
  1654. 1652.  -   initFilters: function(opts) {
  1655. 1653.  -     stManager.add(['ui_controls.js', 'ui_controls.css'], function() {
  1656. 1654.  -       cur.cityFilter = new Dropdown(ge('friends_fltr_city'), opts.cities, {
  1657. 1655.  -         width: 150,
  1658. 1656.  -         zeroPlaceholder: true,
  1659. 1657.  -         placeholder: opts.citiesPl,
  1660. 1658.  -         placeholderColor: '#777',
  1661. 1659.  -         //selectedItems: '{$school_year}',
  1662. 1660.  -         onChange: Friends.changeFilter,
  1663. 1661.  -         onShow: function() {
  1664. 1662.  -           if (cur.silent) {
  1665. 1663.  -             cur.cityFilterOpened = true;
  1666. 1664.  -             show('friends_fltr_progress');
  1667. 1665.  -           }
  1668. 1666.  -         }
  1669. 1667.  -       });
  1670. 1668.  -
  1671. 1669.  -       cur.ageFromFilter = new Dropdown(ge('friends_age_from'), Friends.getAgeFromData(opts.ageTo, opts), {
  1672. 1670.  -         zeroPlaceholder: true,
  1673. 1671.  -         placeholderColor: '#777',
  1674. 1672.  -         width: 70,
  1675. 1673.  -         onChange: function(value){
  1676. 1674.  -          cur.ageToFilter.setData(Friends.getAgeToData(value, opts));
  1677. 1675.  -          Friends.changeFilter();
  1678. 1676.  -         }
  1679. 1677.  -       });
  1680. 1678.  -
  1681. 1679.  -       cur.ageToFilter = new Dropdown(ge('friends_age_to'), Friends.getAgeToData(opts.ageFrom, opts), {
  1682. 1680.  -         zeroPlaceholder: true,
  1683. 1681.  -         placeholderColor: '#777',
  1684. 1682.  -         width: 70,
  1685. 1683.  -         onChange: function(value){
  1686. 1684.  -           cur.ageFromFilter.setData(Friends.getAgeFromData(value, opts));
  1687. 1685.  -           Friends.changeFilter();
  1688. 1686.  -         }
  1689. 1687.  -       });
  1690. 1688.  -
  1691. 1689.  -       window.radioBtns['friends_radio_sex'] = {
  1692. 1690.  -         els: Array.prototype.slice.apply(geByClass('radiobtn', ge('friends_radio_sex'))),
  1693. 1691.  -         val: 0
  1694. 1692.  -       }
  1695. 1693.  -     });
  1696. 1694.  -   },
  1697. 1695.  -   clearFilter: function(fireEvent) {
  1698. 1696.  -     if (!cur.cityFilter) return;
  1699. 1697.  -     cur.cityFilter.selectItem(0, false);
  1700. 1698.  -     cur.ageFromFilter.selectItem(0, false);
  1701. 1699.  -     cur.ageToFilter.selectItem(0, false);
  1702. 1700.  -     Friends.radioFilter(ge('friends_radio_any'), 0, false);
  1703. 1701.  -     cur.filterIds = false;
  1704. 1702.  -     cur.filter = false;
  1705. 1703.  -     if (fireEvent) {
  1706. 1704.  -       Friends.changeFilter();
  1707. 1705.  -     }
  1708. 1706.  -   },
  1709. 1707.  -   filterParams: function() {
  1710. 1708.  -     var p = {
  1711. 1709.  -       city: parseInt(cur.cityFilter.val()),
  1712. 1710.  -       sex: parseInt(radioBtns['friends_radio_sex'].val),
  1713. 1711.  -       age_from: parseInt(cur.ageFromFilter.val()),
  1714. 1712.  -       age_to: parseInt(cur.ageToFilter.val())
  1715. 1713.  -     }
  1716. 1714.  -     if (p.city || p.sex || p.age_from || p.age_to) {
  1717. 1715.  -       return p;
  1718. 1716.  -     } else {
  1719. 1717.  -       return false;
  1720. 1718.  -     }
  1721. 1719.  -   },
  1722. 1720.  -   changeFilter: function() {
  1723. 1721.  -     if (cur.silent) {
  1724. 1722.  -       cur.onSilentLoad = function() {
  1725. 1723.  -         Friends.changeFilter();
  1726. 1724.  -       };
  1727. 1725.  -       hide(cur.showMore);
  1728. 1726.  -       cur.fContent.innerHTML = '<div class="wide_loading"></div>';
  1729. 1727.  -       return;
  1730. 1728.  -     }
  1731. 1729.  -     cur.filter = Friends.filterParams();
  1732. 1730.  -     if (cur.filter) {
  1733. 1731.  -       ajax.post('friends', extend({act: 'filter_friends', uid: cur.oid}, cur.filter), {
  1734. 1732.  -         onDone: function(ids) {
  1735. 1733.  -           cur.filterIds = {};
  1736. 1734.  -           for (var i in ids) {
  1737. 1735.  -             cur.filterIds[ids[i]] = 1;
  1738. 1736.  -           }
  1739. 1737.  -           for (var i in cur.friendsList) {
  1740. 1738.  -             if (i.split('_').pop() == 'filter') {
  1741. 1739.  -               delete cur.friendsList[i];
  1742. 1740.  -             }
  1743. 1741.  -           }
  1744. 1742.  -           Friends.search(cur.searchStr || -1, cur.section, false, true);
  1745. 1743.  -           Friends.changeSummary();
  1746. 1744.  -         },
  1747. 1745.  -         progress: 'friends_fltr_progress',
  1748. 1746.  -         cache: 1
  1749. 1747.  -       })
  1750. 1748.  -     } else {
  1751. 1749.  -       if (cur.filterIds) {
  1752. 1750.  -         cur.filterIds = false;
  1753. 1751.  -       }
  1754. 1752.  -       Friends.updateList();
  1755. 1753.  -     }
  1756. 1754.  -   },
  1757. 1755.  -
  1758. 1756.  -   bigphOver: function(obj, uid) {
  1759. 1757.  -     if (!window.lang || !lang.global_photo_full_size || browser.mobile) return;
  1760. 1758.  -     var o = obj.firstChild, ch = cur.bigphCache[uid];
  1761. 1759.  -     if (o.tagName != 'A' || o.className != 'friends_bigph') {
  1762. 1760.  -       (o = obj.insertBefore(ce('a', {className: 'friends_bigph', href: ch && ch._id ? ('/photo' + ch._id + '?all=1') : ('/albums' + uid), innerHTML: '<span class="friends_bigph_label">' + getLang('global_photo_full_size') + '</span>'}), obj.firstChild)).onclick = Friends.bigphClick.pbind(uid);
  1763. 1761.  -       o._uid = uid;
  1764. 1762.  -     }
  1765. 1763.  -
  1766. 1764.  -     clearTimeout(o.hideTO);
  1767. 1765.  -     animate(o, {marginTop: 75}, {duration: 200, transition: Fx.Transitions.easeOutCirc});
  1768. 1766.  -     cur.bigphShown[uid] = o;
  1769. 1767.  -
  1770. 1768.  -     if (ch === undefined) {
  1771. 1769.  -       cur.bigphCache[uid] = 'load';
  1772. 1770.  -       ajax.post('al_photos.php', {act: 'fast_get_photo', oid: uid}, {onDone: function(res) {
  1773. 1771.  -         if (!res) {
  1774. 1772.  -           obj.onmouseover = function() {};
  1775. 1773.  -           re(obj.firstChild);
  1776. 1774.  -           return;
  1777. 1775.  -         }
  1778. 1776.  -         var sh = (cur.bigphCache[uid] == 'show');
  1779. 1777.  -         cur.bigphCache[uid] = res;
  1780. 1778.  -         o.href = '/photo' + res._id + '?all=1';
  1781. 1779.  -         if (sh) Friends.bigphClick(uid);
  1782. 1780.  -       }, onFail: function() {
  1783. 1781.  -         obj.onmouseover = function() {};
  1784. 1782.  -         re(obj.firstChild);
  1785. 1783.  -         return true;
  1786. 1784.  -       }});
  1787. 1785.  -     }
  1788. 1786.  -
  1789. 1787.  -     if (!obj.onmouseout) obj.onmouseout = Friends.bigphOut.pbind(obj);
  1790. 1788.  -   },
  1791. 1789.  -   bigphOut: function(obj) {
  1792. 1790.  -     var o = obj.firstChild;
  1793. 1791.  -     if (!o || o.tagName != 'A' || o.className != 'friends_bigph') return;
  1794. 1792.  -
  1795. 1793.  -     clearTimeout(o.hideTO);
  1796. 1794.  -     o.hideTO = setTimeout(function() {
  1797. 1795.  -       animate(o, {marginTop: 100}, 200);
  1798. 1796.  -       delete(cur.bigphShown[o._uid]);
  1799. 1797.  -     }, 150);
  1800. 1798.  -   },
  1801. 1799.  -   bigphClick: function(uid, ev) {
  1802. 1800.  -     if (checkEvent(ev) !== false) return;
  1803. 1801.  -
  1804. 1802.  -     var ch = cur.bigphCache[uid];
  1805. 1803.  -     if (ch == 'load' || ch == 'show') {
  1806. 1804.  -       cur.bigphCache[uid] = 'show';
  1807. 1805.  -       return cancelEvent(ev);
  1808. 1806.  -     }
  1809. 1807.  -     if (!ch) return;
  1810. 1808.  -     return showPhoto(ch._id, 'album' + uid + '_0/rev', extend({jumpTo: {z: 'albums' + uid}}, ch), ev);
  1811. 1809.  -   },
  1812. 1810.  -   inviteClick: function(obj, ev) {
  1813. 1811.  -     if (checkEvent(ev)) {
  1814. 1812.  -       return true;
  1815. 1813.  -     }
  1816. 1814.  -     nav.go('/invite', false, {
  1817. 1815.  -       showProgress: function() {
  1818. 1816.  -         cur.invBack = obj.innerHTML;
  1819. 1817.  -         obj.innerHTML = '<div class=progress_inline></div>'},
  1820. 1818.  -       hideProgress: function() {
  1821. 1819.  -         obj.innerHTML = cur.invBack;
  1822. 1820.  -       }
  1823. 1821.  -     });
  1824. 1822.  -     return cancelEvent(ev);
  1825. 1823.  -   },
  1826. 1824.  -   findAdd: function(mid, hash, el) {
  1827. 1825.  -     ajax.post('al_friends.php', {act: 'add', mid: mid, hash: hash, request: 1, 'short_resp' : 1}, {onDone: function(text) {
  1828. 1826.  -       var cont = el.parentNode.parentNode;
  1829. 1827.  -       cont.innerHTML = '<div class="friends_imp_status" style="display: none;">'+text+'</div>';
  1830. 1828.  -       fadeIn(cont.firstChild, 200);
  1831. 1829.  -     }, onFail: function(text) {
  1832. 1830.  -       if (!text) return;
  1833. 1831.  -       showFastBox(getLang('global_error'), text);
  1834. 1832.  -       return true;
  1835. 1833.  -     }, showProgress: lockButton.pbind(el), hideProgress: unlockButton.pbind(el)});
  1836. 1834.  -   }
  1837. 1835.  - }
  1838. 1836.  -
  1839. 1837.  - extend(Friends, {
  1840. 1838.  -   rowOver: Friends._animDelX.pbind('#C4D2E1'),
  1841. 1839.  -   rowOut: Friends._animDelX.pbind('#FFF'),
  1842. 1840.  -   activeDeleteRow: function(post, tt) {
  1843. 1841.  -     Friends._animDelX('#6B8DB1', 1, post);
  1844. 1842.  -     if (tt) showTooltip(ge('delete_row' + post), {text: tt, showdt: 500, black: 1});
  1845. 1843.  -   },
  1846. 1844.  -   deactiveDeleteRow: Friends._animDelX.pbind('#C4D2E1', 0),
  1847. 1845.  -   deleteRow: function(row, hash) {
  1848. 1846.  -     rowInfo = row.split('_');
  1849. 1847.  -     var obj = ge('suggestion'+row);
  1850. 1848.  -     if (hasClass(obj, 'user_block_first')) {
  1851. 1849.  -       nobj = obj.nextSibling;
  1852. 1850.  -       while (nobj && !isVisible(nobj)) {
  1853. 1851.  -         nobj = nobj.nextSibling;
  1854. 1852.  -       }
  1855. 1853.  -       if (nobj) {
  1856. 1854.  -         if (nobj.id == 'friends_sub_summary') {
  1857. 1855.  -           var summ = nobj.childNodes[0].innerHTML;
  1858. 1856.  -           ge('friends_summary').innerHTML = summ;
  1859. 1857.  -           re(nobj);
  1860. 1858.  -         } else if (nobj.className) {
  1861. 1859.  -           addClass(nobj, 'user_block_first')
  1862. 1860.  -         }
  1863. 1861.  -       }
  1864. 1862.  -     }
  1865. 1863.  -     slideUp('suggestion' + row, 100);
  1866. 1864.  -     if (tooltips) {
  1867. 1865.  -       tooltips.hide(ge('delete_row' + row))
  1868. 1866.  -     }
  1869. 1867.  -     ajax.post('al_friends.php', {act: 'hide_possible', mid: rowInfo[1], hash: hash}, {onDone: function() {
  1870. 1868.  -     }});
  1871. 1869.  -     cur.importCount -= 1;
  1872. 1870.  -   }
  1873. 1871.  - });
  1874. 1872.  -
  1875. 1873.  - try{stManager.done('friends.js');}catch(e){}
  1876. ------
  1877. Файл - friends.css (Старый размер - 18164 | Новый - 0):
  1878. 0.  - #friends_css {
  1879. 1.  -   display: none;
  1880. 2.  - }
  1881. 3.  - .friends_add_block {
  1882. 4.  -   padding: 0px 0px 8px 14px;
  1883. 5.  -   width: 260px;
  1884. 6.  - }
  1885. 7.  - .friends_add_block .checkbox {
  1886. 8.  -   margin-top: 3px;
  1887. 9.  -   margin-bottom: 6px;
  1888. 10.  - }
  1889. 11.  - .friends_add_image {
  1890. 12.  -   padding-top: 3px;
  1891. 13.  - }
  1892. 14.  - #friends .search {
  1893. 15.  -   background: #f7f7f7;
  1894. 16.  -   padding: 10px;
  1895. 17.  -   border-bottom: 1px solid #dae1e8;
  1896. 18.  - }
  1897. 19.  - #friends_req_tabs {
  1898. 20.  -   background: #F7F7F7;
  1899. 21.  -   border-bottom: 1px solid #dae1e8;
  1900. 22.  -   display: none;
  1901. 23.  - }
  1902. 24.  - #friends #s_search {
  1903. 25.  -   width: 545px;
  1904. 26.  -   background: #FFF url(/images/magglass.png) no-repeat 5px 6px;
  1905. 27.  -   outline: none;
  1906. 28.  -   padding: 5px 40px 6px 20px;
  1907. 29.  - }
  1908. 30.  - .is_rtl1 #friends #s_search {
  1909. 31.  -   padding: 5px 20px 6px 40px;
  1910. 32.  -   background: #FFF url(/images/magglass.png) no-repeat 328px 6px;
  1911. 33.  - }
  1912. 34.  - #friends #s_search.s_search_inv {
  1913. 35.  -   width: 284px;
  1914. 36.  - }
  1915. 37.  - #friends #s_search::-ms-clear {
  1916. 38.  -   display: none;
  1917. 39.  - }
  1918. 40.  - #friends #invite_button {
  1919. 41.  -   width: 134px;
  1920. 42.  - }
  1921. 43.  - #friends td {
  1922. 44.  -   vertical-align: top;
  1923. 45.  - }
  1924. 46.  - #friends .main_panel {
  1925. 47.  -   border-right: 1px solid #D9E1E7;
  1926. 48.  -   width: 447px;
  1927. 49.  -   padding: 5px 15px 6px 15px;
  1928. 50.  - }
  1929. 51.  - #friends .wide .main_panel {
  1930. 52.  -   border-right: none;
  1931. 53.  -   width: 608px;
  1932. 54.  - }
  1933. 55.  - #friends .wide a.more {
  1934. 56.  -   width: 598px;
  1935. 57.  - }
  1936. 58.  - #friends a.more {
  1937. 59.  -   display: block;
  1938. 60.  -   padding: 8px 0px;
  1939. 61.  -   text-align: center;
  1940. 62.  -   margin: 8px 0px 10px 0px;
  1941. 63.  - }
  1942. 64.  - #friends a.more:hover {
  1943. 65.  -   text-decoration: none;
  1944. 66.  -   background: #E9EDF1;
  1945. 67.  - }
  1946. 68.  - #friends .load_more {
  1947. 69.  -   display: block;
  1948. 70.  -   width: 426px;
  1949. 71.  -   height: 31px;
  1950. 72.  -   background: url('/images/upload.gif') center center no-repeat;
  1951. 73.  - }
  1952. 74.  - #friends .load_more a.more {
  1953. 75.  -   display: none;
  1954. 76.  - }
  1955. 77.  - #friends .info_msg {
  1956. 78.  -   font-size: 1.2em;
  1957. 79.  -   background: #FFFFFF;
  1958. 80.  -   border: none;
  1959. 81.  -   padding: 130px 10px;
  1960. 82.  -   margin: 15px 5px;
  1961. 83.  -   text-align: center;
  1962. 84.  -   color: #777777;
  1963. 85.  -   max-width: 395px;
  1964. 86.  -   word-wrap: break-word;
  1965. 87.  -   overflow: hidden;
  1966. 88.  -   text-overflow: ellipsis;
  1967. 89.  - }
  1968. 90.  - #friends .info_msg .by_search {
  1969. 91.  -   display: none;
  1970. 92.  - }
  1971. 93.  - #friends .f_search .by_search {
  1972. 94.  -   display: block;
  1973. 95.  - }
  1974. 96.  - #friends .f_search .empty {
  1975. 97.  -   display: none;
  1976. 98.  - }
  1977. 99.  -
  1978. 100.  - /* User block */
  1979. 101.  - #friends .user_block {
  1980. 102.  -   border-top: 1px solid #ededed;
  1981. 103.  -   padding: 10px 0px;
  1982. 104.  -   clear: both;
  1983. 105.  - }
  1984. 106.  - #friends .user_block_first {
  1985. 107.  -   border-top: none;
  1986. 108.  - }
  1987. 109.  - #friends .user_block .img {
  1988. 110.  -   width: 100px;
  1989. 111.  -   height: 100px;
  1990. 112.  -   display: block;
  1991. 113.  -   overflow: hidden;
  1992. 114.  - }
  1993. 115.  - #friends .user_block .info, #friends .user_block .info_no_actions {
  1994. 116.  -   width: 182px;
  1995. 117.  -   padding-top: 4px;
  1996. 118.  -   padding-left: 14px;
  1997. 119.  -   overflow: hidden;
  1998. 120.  - }
  1999. 121.  - .font_medium #friends .user_block .info {
  2000. 122.  -   width: 172px;
  2001. 123.  - }
  2002. 124.  - #friends .wide .user_block .info {
  2003. 125.  -   width: 352px;
  2004. 126.  - }
  2005. 127.  - #friends .wide .user_block .info_no_actions {
  2006. 128.  -   width: 475px;
  2007. 129.  - }
  2008. 130.  - #friends .user_block .online {
  2009. 131.  -   color: #BBBBBB;
  2010. 132.  -   padding: 0px 0px 5px 0px;
  2011. 133.  - }
  2012. 134.  - .is_rtl1 #friends .user_block .online {
  2013. 135.  -   color: #BBBBBB;
  2014. 136.  -   padding: 0px 0px 5px 0px;
  2015. 137.  - }
  2016. 138.  - #friends .user_block .phones {
  2017. 139.  -   color: #000000;
  2018. 140.  -   padding-top: 1px;
  2019. 141.  - }
  2020. 142.  - #friends .user_block .actions {
  2021. 143.  -   width: 126px;
  2022. 144.  -   height: 100px;
  2023. 145.  -   display: block;
  2024. 146.  -   background: #FFFFFF;
  2025. 147.  - }
  2026. 148.  - .font_medium #friends .user_block .actions {
  2027. 149.  -   width: 140px;
  2028. 150.  - }
  2029. 151.  - #friends .wide .user_block .actions {
  2030. 152.  -   width: 130px;
  2031. 153.  - }
  2032. 154.  - .friends_act {
  2033. 155.  -   display: block;
  2034. 156.  -   padding: 4px 6px 4px 6px;
  2035. 157.  - }
  2036. 158.  - .friends_act:hover {
  2037. 159.  -   background: #E1E7ED;
  2038. 160.  -   text-decoration: none;
  2039. 161.  - }
  2040. 162.  - .friends_field {
  2041. 163.  -   padding-bottom: 5px;
  2042. 164.  - }
  2043. 165.  - #friends .user_block .lists {
  2044. 166.  -   padding-top: 0px;
  2045. 167.  - }
  2046. 168.  - #friends .user_block .common_friends a {
  2047. 169.  -   margin-right: 4px;
  2048. 170.  - }
  2049. 171.  - #friends .user_block .info em, #friends .user_block .info_no_actions em {
  2050. 172.  -   font-style: normal;
  2051. 173.  -   background: #E1E7ED;
  2052. 174.  -   border-bottom: 1px solid #DAE1E8;
  2053. 175.  -   padding: 0px 1px 0px;
  2054. 176.  -   margin: 0px -1px;
  2055. 177.  -   *padding: 0px;
  2056. 178.  -   *margin: 0px;
  2057. 179.  - }
  2058. 180.  - #friends .wide_loading {
  2059. 181.  -   background: url('/images/progress7.gif') center center no-repeat;
  2060. 182.  -   height: 300px;
  2061. 183.  - }
  2062. 184.  -
  2063. 185.  -
  2064. 186.  - /* Requests */
  2065. 187.  - #friends .common .img {
  2066. 188.  -   width: 100px;
  2067. 189.  -   height: 100px;
  2068. 190.  -   display: block;
  2069. 191.  - }
  2070. 192.  - #friends .common .info, #friends .common .info_no_actions {
  2071. 193.  -   width: 290px;
  2072. 194.  - }
  2073. 195.  - #friends.friends_find_list .info_no_actions {
  2074. 196.  -   width: 400px;
  2075. 197.  - }
  2076. 198.  - #friends .request .info, #friends .request .info_no_actions {
  2077. 199.  -   width: 290px;
  2078. 200.  - }
  2079. 201.  - #friends .common .controls {
  2080. 202.  -   padding: 7px 0px 4px 0px;
  2081. 203.  -   width: 295px;
  2082. 204.  -   margin-left: 0px;
  2083. 205.  - }
  2084. 206.  - #friends .wide .common .controls {
  2085. 207.  -   width: 425px;
  2086. 208.  - }
  2087. 209.  - #friends .common .info a.deny_request, #friends .common .info_no_actions a.deny_request {
  2088. 210.  -   display: block;
  2089. 211.  -   padding: 6px 10px 0px;
  2090. 212.  -   margin: 0px 0px 0px 5px;
  2091. 213.  -   font-weight: normal;
  2092. 214.  -   height: 20px;
  2093. 215.  -   text-align: center;
  2094. 216.  -   display: none;
  2095. 217.  - }
  2096. 218.  - #friends .common .info a.deny_request:hover, #friends .common .info_no_actions a.deny_request:hover {
  2097. 219.  -   background: #E1E7ED;
  2098. 220.  -   text-decoration: none;
  2099. 221.  - }
  2100. 222.  - #friends .common .box_msg {
  2101. 223.  -   background-color: #F7F7F7;
  2102. 224.  -   border: 1px solid #CCC;
  2103. 225.  -   font-weight: normal;
  2104. 226.  -   margin: 0px;
  2105. 227.  -   padding: 5px 11px;
  2106. 228.  -   width: 225px;
  2107. 229.  - }
  2108. 230.  - #friends .common .box_msg .passive {
  2109. 231.  -   color: #777777;
  2110. 232.  - }
  2111. 233.  - #friends .common .common_friends_label {
  2112. 234.  -   margin-left: 0px;
  2113. 235.  -   color: #777;
  2114. 236.  - }
  2115. 237.  - #friends .common .common_friends {
  2116. 238.  -   padding-top: 6px;
  2117. 239.  -   margin-left: 0px;
  2118. 240.  -   color: #777;
  2119. 241.  - }
  2120. 242.  - #friends .common .labeled {
  2121. 243.  -   width: 250px;
  2122. 244.  - }
  2123. 245.  - #friends .request .info a.deny_request, #friends .request .info_no_actions a.deny_request {
  2124. 246.  -   display: block;
  2125. 247.  - }
  2126. 248.  -
  2127. 249.  - /* Filters block */
  2128. 250.  - #friends .side_panel {
  2129. 251.  -   width: 150px;
  2130. 252.  -   background-color: #F7F7F7;
  2131. 253.  -   padding: 10px;
  2132. 254.  - }
  2133. 255.  - #friends .wide .side_panel {
  2134. 256.  -   display: none;
  2135. 257.  - }
  2136. 258.  - #friends .sections_block {
  2137. 259.  -   width: 150px;
  2138. 260.  -   overflow: hidden;
  2139. 261.  - }
  2140. 262.  - #friends .sections_block .side_filter {
  2141. 263.  -   border: none;
  2142. 264.  -   color: #2B587A;
  2143. 265.  -   cursor: pointer;
  2144. 266.  -   display: block;
  2145. 267.  -   padding: 6px 6px 7px 10px;
  2146. 268.  -   background-color: #F7F7F7;
  2147. 269.  -   background-repeat: no-repeat;
  2148. 270.  -   background-position: 127px center;
  2149. 271.  -   width: 134px;
  2150. 272.  - }
  2151. 273.  - #friends .sections_block .side_filter:hover {
  2152. 274.  -   background-color: #E1E7ED;
  2153. 275.  -   text-decoration: none;
  2154. 276.  - }
  2155. 277.  - #friends .sections_block .cur_section {
  2156. 278.  -   color: white;
  2157. 279.  -   background-color: #5e82a8;
  2158. 280.  - }
  2159. 281.  - #friends .sections_block .loading {
  2160. 282.  -   background-image: url('/images/upload_inv_mini.gif');
  2161. 283.  - }
  2162. 284.  - #friends .sections_block .cur_section:hover {
  2163. 285.  -   background-color: #5e82a8;
  2164. 286.  - }
  2165. 287.  - #friends .sections_block .sep {
  2166. 288.  -   border-top: 1px solid #DAE1E8;
  2167. 289.  -   margin-top: 6px;
  2168. 290.  -   margin-bottom: 6px;
  2169. 291.  - }
  2170. 292.  - #friends .create_list {
  2171. 293.  -   display: block;
  2172. 294.  -   text-align: right;
  2173. 295.  -   width: 200px;
  2174. 296.  -   padding-top: 5px;
  2175. 297.  - }
  2176. 298.  - #friends .page_end {
  2177. 299.  -   display: block;
  2178. 300.  -   position: relative;
  2179. 301.  - }
  2180. 302.  -
  2181. 303.  - /* Lists */
  2182. 304.  - #friends .lists span {
  2183. 305.  -   margin: 3px 4px 4px 0px;
  2184. 306.  -   cursor: pointer;
  2185. 307.  -   display: block;
  2186. 308.  -   font-size: 1em;
  2187. 309.  -   padding: 1px 5px;
  2188. 310.  -   border-radius: 3px;
  2189. 311.  -   -moz-border-radius: 3px;
  2190. 312.  -   -webkit-border-radius: 3px;
  2191. 313.  - }
  2192. 314.  -
  2193. 315.  - /* Tabs */
  2194. 316.  -
  2195. 317.  - #friends .tabs {
  2196. 318.  -   background: #FFFFFF;
  2197. 319.  - }
  2198. 320.  -
  2199. 321.  - /* for input focus at start */
  2200. 322.  - #friends .search .input_back {
  2201. 323.  -   color: #C0C8D0;
  2202. 324.  - }
  2203. 325.  - .common_friends_box {
  2204. 326.  -   overflow: auto;
  2205. 327.  -   max-height: 380px;
  2206. 328.  -   padding: 10px;
  2207. 329.  -   padding-bottom: 0px;
  2208. 330.  -   width: 388px;
  2209. 331.  - }
  2210. 332.  - .common_friends_box .common_row {
  2211. 333.  -   border-bottom: 1px solid #dee4e8;
  2212. 334.  -   margin-bottom: 5px;
  2213. 335.  -   padding-bottom: 2px;
  2214. 336.  -   height: 53px;
  2215. 337.  - }
  2216. 338.  - .common_friends_box .common_row:last-child {
  2217. 339.  -   border-bottom: none;
  2218. 340.  - }
  2219. 341.  - .common_friends_box .common_row .common_info {
  2220. 342.  -   display: block;
  2221. 343.  -   float: left;
  2222. 344.  -   width: 300px;
  2223. 345.  - }
  2224. 346.  - .common_friends_box .common_row .photo {
  2225. 347.  -   display: block;
  2226. 348.  -   width: 60px;
  2227. 349.  -   float:left;
  2228. 350.  - }
  2229. 351.  - .common_friends_box .common_row b {
  2230. 352.  -   color: #888888;
  2231. 353.  -   font-weight: normal;
  2232. 354.  - }
  2233. 355.  -
  2234. 356.  - /*lists*/
  2235. 357.  - #friends .lists_menu {
  2236. 358.  -   position: absolute;
  2237. 359.  -   margin-left: -1px;
  2238. 360.  -   margin-top: 0px;
  2239. 361.  - }
  2240. 362.  - #friends .lists_header {
  2241. 363.  -   border: 1px solid #517295;
  2242. 364.  -   cursor: pointer;
  2243. 365.  -   width: 130px;
  2244. 366.  -   z-index: 1500;
  2245. 367.  -   position: absolute;
  2246. 368.  - }
  2247. 369.  - #friends .lists_header div {
  2248. 370.  -   border-color:#7E9CBC #5C82AB #5e82a8;
  2249. 371.  -   border-style:solid;
  2250. 372.  -   border-width:1px;
  2251. 373.  -   color:#FFFFFF;
  2252. 374.  -   padding:2px 5px;
  2253. 375.  -   white-space: nowrap;
  2254. 376.  -   padding-right: 17px;
  2255. 377.  -   line-height: 1.27em;
  2256. 378.  -   *line-height: 1.18em;
  2257. 379.  -   *padding-right: 16px;
  2258. 380.  -   background:#5e82a8 url('/images/flydead.gif') no-repeat right -15px;
  2259. 381.  -   *background-position: -14px right;
  2260. 382.  - }
  2261. 383.  - #friends .friends_header_up div {
  2262. 384.  -   background: #5e82a8 url('/images/flydead.gif') no-repeat right -57px;
  2263. 385.  - }
  2264. 386.  - #friends .lists_body {
  2265. 387.  -   margin-left: -32px;
  2266. 388.  -   margin-top: 20px;
  2267. 389.  -   z-index: 1499;
  2268. 390.  -   position: absolute;
  2269. 391.  - }
  2270. 392.  - #friends .summary_wrap #result_msg {
  2271. 393.  -   margin-bottom: 10px;
  2272. 394.  -   color: #000;
  2273. 395.  - }
  2274. 396.  -
  2275. 397.  -
  2276. 398.  - /* dropdown */
  2277. 399.  - #friends .lists_shad_l div, #friends .lists_shad_r div {width: 1px}
  2278. 400.  - #friends .lists_shad_l {background:#000000;filter: alpha(opacity=6);opacity:0.06;overflow:hidden;width:1px;}
  2279. 401.  - #friends .lists_shad_b, #friends .lists_shad_b2 {background:#000000;height:2px;margin-top:-1px;filter: alpha(opacity=7);opacity:0.07;overflow:hidden;position:relative;z-index:148;}
  2280. 402.  - #friends .lists_shad_b2 {filter: alpha(opacity=5);opacity:0.05;}
  2281. 403.  - #friends .lists_shad_r {background:#000000;filter: alpha(opacity=6);opacity:0.06;overflow:hidden;width:1px;}
  2282. 404.  -
  2283. 405.  - #friends .lists_rows {
  2284. 406.  -   background: #FFFFFF;
  2285. 407.  -   border: 1px solid #96AABE;
  2286. 408.  -   margin: 0px;
  2287. 409.  -   position: relative;
  2288. 410.  -   z-index: 1499;
  2289. 411.  -   width: 161px;
  2290. 412.  -   overflow: hidden;
  2291. 413.  - }
  2292. 414.  -
  2293. 415.  - .friends_dd_item {
  2294. 416.  -   display: block;
  2295. 417.  -   padding: 4px 3px 0px 24px;
  2296. 418.  -   height: 18px;
  2297. 419.  - }
  2298. 420.  - .friends_dd_item:hover {
  2299. 421.  -   background: #EEF2F6;
  2300. 422.  -   text-decoration: none;
  2301. 423.  - }
  2302. 424.  -
  2303. 425.  - .friends_dd_item.checked {
  2304. 426.  -   background: url('/images/dropdead_check.gif') no-repeat 4px 3px;
  2305. 427.  - }
  2306. 428.  - .friends_dd_item.checked:hover {
  2307. 429.  -   background: #EEF2F6 url('/images/dropdead_check.gif') no-repeat 4px 3px;
  2308. 430.  - }
  2309. 431.  -
  2310. 432.  - .friends_tt .tt_text,
  2311. 433.  - .tt.friends_tt .tt_text {
  2312. 434.  -   padding: 4px;
  2313. 435.  - }
  2314. 436.  - .friends_tt_item {
  2315. 437.  -   display: block;
  2316. 438.  -   padding: 4px 12px 0px 22px;
  2317. 439.  -   height: 18px;
  2318. 440.  - }
  2319. 441.  - .friends_tt_item:hover {
  2320. 442.  -   background: #E1E7ED;
  2321. 443.  -   text-decoration: none;
  2322. 444.  - }
  2323. 445.  - .friends_tt_menu {
  2324. 446.  -   padding: 0px 0px;
  2325. 447.  - }
  2326. 448.  - .friends_online {
  2327. 449.  -   color: #AAA;
  2328. 450.  -   margin-left: 8px;
  2329. 451.  - }
  2330. 452.  - .friends_tt_icon {
  2331. 453.  -   margin: 1px 0 0 -16px;
  2332. 454.  -   width: 11px;
  2333. 455.  -   height: 11px;
  2334. 456.  -   background-image: url(/images/icons/mono_iconset.gif?8);
  2335. 457.  -   position: absolute;
  2336. 458.  - }
  2337. 459.  - .friends_tt_msg {
  2338. 460.  -   background-position: 0 -192px;
  2339. 461.  - }
  2340. 462.  - .friends_tt_add {
  2341. 463.  -   background-position: 0 -15px;
  2342. 464.  - }
  2343. 465.  - .friends_tt_cancel {
  2344. 466.  -   background-position: 0 -236px;
  2345. 467.  - }
  2346. 468.  - .friends_tt_gift {
  2347. 469.  -   background-position: 0 -104px;
  2348. 470.  - }
  2349. 471.  -
  2350. 472.  - /*#friends .no_lists .user_block .actions a.lists_select {
  2351. 473.  -   display: none;
  2352. 474.  - }
  2353. 475.  - #friends .no_lists .select_lists {
  2354. 476.  -   display: none;
  2355. 477.  - }*/
  2356. 478.  - #friends .box_msg .lists_select {
  2357. 479.  -   margin: 0px 5px;
  2358. 480.  - }
  2359. 481.  - #friends .no_lists .box_msg .lists_select {
  2360. 482.  -   display: none;
  2361. 483.  - }
  2362. 484.  - #friends .box_msg .lists_menu {
  2363. 485.  -   margin-top: -4px;
  2364. 486.  -   margin-left: -1px;
  2365. 487.  - }
  2366. 488.  -
  2367. 489.  - .box_labels .label {
  2368. 490.  -   color: #777;
  2369. 491.  -   padding-top: 3px;
  2370. 492.  -   position: absolute;
  2371. 493.  -   text-align: right;
  2372. 494.  -   width: 100px;
  2373. 495.  - }
  2374. 496.  - .box_labels .labeled {
  2375. 497.  -   padding-left: 110px;
  2376. 498.  -   width: 200px;
  2377. 499.  - }
  2378. 500.  - .box_labels .labeled input {
  2379. 501.  -   width: 200px;
  2380. 502.  - }
  2381. 503.  -
  2382. 504.  - /* hide suggestions */
  2383. 505.  - #friends .delete_row {
  2384. 506.  -   height: 13px;
  2385. 507.  -   width: 17px;
  2386. 508.  -   margin-top: -2px;
  2387. 509.  - }
  2388. 510.  - #friends .delete_row div {
  2389. 511.  -   background: #FFFFFF url(/images/pics/statusx.gif) no-repeat;
  2390. 512.  -   cursor: pointer;
  2391. 513.  -   height: 17px;
  2392. 514.  -   width: 17px;
  2393. 515.  - }
  2394. 516.  -
  2395. 517.  - .user_block .res {
  2396. 518.  -   background-color: #F7F7F7;
  2397. 519.  -   border: 1px solid #CCC;
  2398. 520.  -   padding: 5px 11px;
  2399. 521.  -   margin: 10px 0 0 10px;
  2400. 522.  -   width: 315px;
  2401. 523.  - }
  2402. 524.  -
  2403. 525.  - /* Convert requests to subscribers */
  2404. 526.  - #friend_convert_sure {
  2405. 527.  -   line-height: 160%;
  2406. 528.  -   width: 300px;
  2407. 529.  - }
  2408. 530.  - #friend_convert_progress {
  2409. 531.  -   display: none;
  2410. 532.  -   padding: 15px 40px;
  2411. 533.  -   line-height: 160%;
  2412. 534.  - }
  2413. 535.  - #friend_convert_bar {
  2414. 536.  -   background: #FFF;
  2415. 537.  -   border: 1px solid #CCC;
  2416. 538.  -   margin-top: 20px;
  2417. 539.  -   width: 298px;
  2418. 540.  -   height: 18px;
  2419. 541.  - }
  2420. 542.  - #friend_convert_bar div {
  2421. 543.  -   background: #597DA3 url(/images/progress_grad.gif) repeat;
  2422. 544.  -   border: 1px solid #45688E;
  2423. 545.  -   margin: -1px;
  2424. 546.  -   width: 1%;
  2425. 547.  -   height: 18px;
  2426. 548.  - }
  2427. 549.  - #friend_add_warn {
  2428. 550.  -   padding-top: 10px;
  2429. 551.  -   color: #777;
  2430. 552.  - }
  2431. 553.  - #friends_list .summary_wrap {
  2432. 554.  -   padding: 6px 0px 0px;
  2433. 555.  - }
  2434. 556.  - .friends_added {
  2435. 557.  -   padding-bottom: 5px;
  2436. 558.  - }
  2437. 559.  - .friends_added .checkbox{
  2438. 560.  -   margin-top: 6px;
  2439. 561.  - }
  2440. 562.  - .friends_added_text {
  2441. 563.  -   color: #777777;
  2442. 564.  -   padding-bottom: 3px;
  2443. 565.  -   line-height: 150%;
  2444. 566.  - }
  2445. 567.  - .friends_done .friends_added_text {
  2446. 568.  -   color: #FFFFFF;
  2447. 569.  -   padding: 0px;
  2448. 570.  - }
  2449. 571.  - .friends_go_to_search {
  2450. 572.  -   text-align: center;
  2451. 573.  -   padding: 10px;
  2452. 574.  -   display: block;
  2453. 575.  -   margin-bottom: 10px;
  2454. 576.  -   border-top: 1px solid #EDEDED;
  2455. 577.  - }
  2456. 578.  - .friends_go_to_search:hover {
  2457. 579.  -   text-decoration: none;
  2458. 580.  -   border-top: 1px solid #DAE1E8;
  2459. 581.  -   background: #E9EDF1;
  2460. 582.  - }
  2461. 583.  -
  2462. 584.  - #friends_hide_all {
  2463. 585.  -   margin: 5px;
  2464. 586.  - }
  2465. 587.  - .friends_req_sended {
  2466. 588.  -   line-height: 160%;
  2467. 589.  - }
  2468. 590.  - .friends_req_header {
  2469. 591.  -   padding-bottom: 3px;
  2470. 592.  - }
  2471. 593.  - .friends_added_help_h {
  2472. 594.  -   color: #2B587A;
  2473. 595.  -   font-weight: bold;
  2474. 596.  -   padding: 12px 0px 4px 0px;
  2475. 597.  - }
  2476. 598.  - .friends_added_help_rows {
  2477. 599.  -   padding: 8px 0px 10px 0px;
  2478. 600.  - }
  2479. 601.  - .friends_add_help_row {
  2480. 602.  -   width: 200px;
  2481. 603.  -   height: 50px;
  2482. 604.  -   padding: 0px 0px 0px 0px;
  2483. 605.  -   margin: 5px 0px;
  2484. 606.  - }
  2485. 607.  - .friends_add_help_img {
  2486. 608.  -   position: absolute;
  2487. 609.  - }
  2488. 610.  - .friends_add_help_c {
  2489. 611.  -   padding: 2px 8px 2px 60px;
  2490. 612.  - }
  2491. 613.  - .friends_add_help_name {
  2492. 614.  -   font-weight: bold;
  2493. 615.  -   display: block;
  2494. 616.  -   margin-bottom: 2px;
  2495. 617.  - }
  2496. 618.  - .friends_add_recomm_sended {
  2497. 619.  -   color: #888888;
  2498. 620.  - }
  2499. 621.  -
  2500. 622.  - b.friends_mob_onl {
  2501. 623.  -   background-position: -1px 0px;
  2502. 624.  -   *background-position: -1px -1px;
  2503. 625.  - }
  2504. 626.  - #friends_search_cont {
  2505. 627.  -   display: none;
  2506. 628.  - }
  2507. 629.  - #friends_loading {
  2508. 630.  -   background: url('/images/upload.gif') center center no-repeat;
  2509. 631.  -   width: 32px;
  2510. 632.  -   height: 9px;
  2511. 633.  -   margin: 7px 0px 0px 308px;
  2512. 634.  -   z-index: 95;
  2513. 635.  -   position: absolute;
  2514. 636.  -   display: none;
  2515. 637.  - }
  2516. 638.  - .is_rtl1 #friends_loading {
  2517. 639.  -   margin: 7px 308px 0px 0px;
  2518. 640.  - }
  2519. 641.  - #friends_reset_search {
  2520. 642.  -   margin: 1px 0px 0px 320px;
  2521. 643.  -   display: none;
  2522. 644.  -   cursor: pointer;
  2523. 645.  -   background: transparent url(/images/icons/input_clear.gif) 6px 6px no-repeat;
  2524. 646.  -   padding: 2px;
  2525. 647.  -   width: 19px;
  2526. 648.  -   height: 19px;
  2527. 649.  -   opacity: 0.6;
  2528. 650.  -   filter: alpha(opacity=60);
  2529. 651.  -   position: absolute;
  2530. 652.  -   z-index: 95;
  2531. 653.  - }
  2532. 654.  - .is_rtl1 #friends_reset_search {
  2533. 655.  -   margin: 1px 322px 0px 0px;
  2534. 656.  - }
  2535. 657.  - .friends_photos {
  2536. 658.  -   width: 310px;
  2537. 659.  -   padding: 12px 0px 0px;
  2538. 660.  -   overflow: hidden;
  2539. 661.  - }
  2540. 662.  - .friends_user_photo {
  2541. 663.  -   display: inline-block;
  2542. 664.  -   *display: block;
  2543. 665.  -   *zoom: 1;
  2544. 666.  -   margin: 0px 5px 0px 0px;
  2545. 667.  -   overflow: hidden;
  2546. 668.  -   vertical-align: top;
  2547. 669.  -   max-width: 70px;
  2548. 670.  - }
  2549. 671.  - .friends_search_info {
  2550. 672.  -   padding-top: 2px;
  2551. 673.  -   padding-left: 10px;
  2552. 674.  -   width: 314px;
  2553. 675.  - }
  2554. 676.  - .friends_searchrow_info {
  2555. 677.  -   height: 14px;
  2556. 678.  -   color: #777;
  2557. 679.  -   margin-left: 8px;
  2558. 680.  - }
  2559. 681.  - .is_rtl1 .friends_searchrow_info {
  2560. 682.  -   margin: 0px 8px 0px 8px;
  2561. 683.  - }
  2562. 684.  - #friends_search_more {
  2563. 685.  -   display: none;
  2564. 686.  - }
  2565. 687.  - .friends_fltr {
  2566. 688.  -   padding: 0px 0px 0px 0px;
  2567. 689.  - }
  2568. 690.  - .friends_fltr_label {
  2569. 691.  -   font-weight: bold;
  2570. 692.  -   cursor: default;
  2571. 693.  -   color: #555;
  2572. 694.  -   padding-bottom: 1px;
  2573. 695.  - }
  2574. 696.  - .friends_fltr_sel {
  2575. 697.  -   padding: 5px 0px 16px 0px;
  2576. 698.  - }
  2577. 699.  - .friends_fltr_field {
  2578. 700.  -   width: 142px;
  2579. 701.  -   height: 14px;
  2580. 702.  - }
  2581. 703.  - #friends_fltr_progress {
  2582. 704.  -   width: 30px;
  2583. 705.  -   height: 8px;
  2584. 706.  -   background: url('/images/upload.gif') no-repeat;
  2585. 707.  -   display: none;
  2586. 708.  -   margin-top: 2px;
  2587. 709.  - }
  2588. 710.  - .friends_age_sep {
  2589. 711.  -   line-height: 2em;
  2590. 712.  -   text-align: center;
  2591. 713.  -   width: 10px;
  2592. 714.  - }
  2593. 715.  - #friends_age_from,
  2594. 716.  - #friends_age_to {
  2595. 717.  -   width: 62px;
  2596. 718.  -   height: 14px;
  2597. 719.  - }
  2598. 720.  - .friends_fltr_sel .radiobtn {
  2599. 721.  -   display: block;
  2600. 722.  -   height: 22px;
  2601. 723.  - }
  2602. 724.  - .friends_fltr_last {
  2603. 725.  -   padding-bottom: 0px;
  2604. 726.  - }
  2605. 727.  -
  2606. 728.  - .friends_bigph_wrap {
  2607. 729.  -   position: relative;
  2608. 730.  -   height: 100px;
  2609. 731.  -   overflow: hidden;
  2610. 732.  - }
  2611. 733.  - .friends_bigph {
  2612. 734.  -   position: absolute;
  2613. 735.  -   color: #FFF;
  2614. 736.  -   margin-top: 100px;
  2615. 737.  -   background: #333;
  2616. 738.  -   background: rgba(0, 0, 0, 0.5);
  2617. 739.  -   width: 100px;
  2618. 740.  -   height: 15px;
  2619. 741.  -   line-height: 15px;
  2620. 742.  -   padding: 4px 0px 6px 0px;
  2621. 743.  -   text-align: center;
  2622. 744.  -   filter: alpha(opacity=75);
  2623. 745.  - }
  2624. 746.  - @media all and (min-width:0) { /* IE9-10 */
  2625. 747.  -   .friends_bigph { filter: none; }
  2626. 748.  - }
  2627. 749.  - .friends_bigph:hover {
  2628. 750.  -   text-decoration: none;
  2629. 751.  - }
  2630. 752.  - .friends_bigph_label {
  2631. 753.  -   opacity: 0.75;
  2632. 754.  -   -webkit-transition: opacity 100ms linear;
  2633. 755.  -   -moz-transition: opacity 100ms linear;
  2634. 756.  -   -o-transition: opacity 100ms linear;
  2635. 757.  -   transition: opacity 100ms linear;
  2636. 758.  -   padding: 0px 0px 1px 20px;
  2637. 759.  -   background: url(/images/icons/photo_icons.png?2) no-repeat left -62px;
  2638. 760.  - }
  2639. 761.  - .is_rtl1 .friends_bigph_label {
  2640. 762.  -   padding: 0px 20px 1px 0px;
  2641. 763.  -   background-position: right -62px;
  2642. 764.  - }
  2643. 765.  - .friends_bigph:hover .friends_bigph_label {
  2644. 766.  -   opacity: 1;
  2645. 767.  - }
  2646. 768.  - .friends_photo_img {
  2647. 769.  -   width: 100px;
  2648. 770.  - }
  2649. 771.  - .friends_find_cont {
  2650. 772.  -   background: #F7F7F7;
  2651. 773.  -   padding: 10px 10px;
  2652. 774.  - }
  2653. 775.  - .friends_import_row {
  2654. 776.  -   width: 277px;
  2655. 777.  -   padding: 10px 13px;
  2656. 778.  -   display: block;
  2657. 779.  -   color: #777;
  2658. 780.  - }
  2659. 781.  - .friends_import_icon {
  2660. 782.  -   position: absolute;
  2661. 783.  -   width: 40px;
  2662. 784.  -   height: 40px;
  2663. 785.  -   background: url(/images/icons/import_contacts.png?3) no-repeat;
  2664. 786.  - }
  2665. 787.  - .friends_import_facebook {
  2666. 788.  -   background-position: 0px -40px;
  2667. 789.  - }
  2668. 790.  - .friends_import_ok {
  2669. 791.  -   background-position: 0px -80px;
  2670. 792.  - }
  2671. 793.  - .friends_import_twitter {
  2672. 794.  -   background-position: 0px -120px;
  2673. 795.  - }
  2674. 796.  - .friends_import_icon_big {
  2675. 797.  -   position: absolute;
  2676. 798.  -   width: 50px;
  2677. 799.  -   height: 50px;
  2678. 800.  -   background: url(/images/icons/import_contacts_big.png?3) no-repeat;
  2679. 801.  - }
  2680. 802.  - .friends_import_icon_big.friends_import_facebook {
  2681. 803.  -   background-position: 0px -50px;
  2682. 804.  - }
  2683. 805.  - .friends_import_icon_big.friends_import_ok {
  2684. 806.  -   background-position: 0px -100px;
  2685. 807.  - }
  2686. 808.  - .friends_import_icon_big.friends_import_twitter {
  2687. 809.  -   background-position: 0px -150px;
  2688. 810.  - }
  2689. 811.  - .friends_import_cont {
  2690. 812.  -   padding-left: 51px;
  2691. 813.  -   padding-top: 3px;
  2692. 814.  -   height: 37px;
  2693. 815.  -   color: #777;
  2694. 816.  - }
  2695. 817.  - .friends_import_row:hover {
  2696. 818.  -   text-decoration: none;
  2697. 819.  -   background-color: #EDF0F2;
  2698. 820.  -   color: #6A7989;
  2699. 821.  - }
  2700. 822.  - .friends_import_header {
  2701. 823.  -   margin: 0px 0px 2px;
  2702. 824.  -   padding: 0;
  2703. 825.  -   color: #36638E;
  2704. 826.  -   font-size: 1.18em;
  2705. 827.  -   font-weight: bold;
  2706. 828.  -   border: none;
  2707. 829.  - }
  2708. 830.  - .friends_import_services {
  2709. 831.  -   padding: 10px 0px 0px;
  2710. 832.  - }
  2711. 833.  - .friends_import_error {
  2712. 834.  -   border: 1px solid #E89B88;
  2713. 835.  -   background-color: #FFEFE8;
  2714. 836.  -   padding: 8px 11px;
  2715. 837.  -   line-height: 160%;
  2716. 838.  -   margin-bottom: 10px;
  2717. 839.  -   display: none;
  2718. 840.  - }
  2719. 841.  - .friends_import_success {
  2720. 842.  -   margin-top: 10px;
  2721. 843.  -   background-color: #F9F6E7;
  2722. 844.  -   border: 1px solid #D4BC4C;
  2723. 845.  -   font-size: 1em;
  2724. 846.  -   line-height: 160%;
  2725. 847.  -   padding: 8px 11px;
  2726. 848.  - }
  2727. 849.  - .friends_import_fail {
  2728. 850.  -   margin-top: 10px;
  2729. 851.  -   border: 1px solid #E89B88;
  2730. 852.  -   background-color: #FFEFE8;
  2731. 853.  -   font-size: 1em;
  2732. 854.  -   line-height: 160%;
  2733. 855.  -   padding: 8px 11px;
  2734. 856.  - }
  2735. 857.  - .wide #not_found {
  2736. 858.  -   max-width: inherit;
  2737. 859.  - }
  2738. 860.  - .friends_sugg_service {
  2739. 861.  -   color: #777777;
  2740. 862.  -   padding-bottom: 4px;
  2741. 863.  - }
  2742. 864.  - .friends_find_list {
  2743. 865.  -   padding: 5px 15px;
  2744. 866.  - }
  2745. 867.  - .friends_find_summary {
  2746. 868.  -   padding: 13px 13px 3px;
  2747. 869.  - }
  2748. 870.  - .friends_find_summary .summary {
  2749. 871.  -   font-size: 12px;
  2750. 872.  - }
  2751. 873.  - .friends_find_search {
  2752. 874.  -   padding-top: 4px;
  2753. 875.  -   display: block;
  2754. 876.  - }
  2755. 877.  - .friends_find_header {
  2756. 878.  -   background: #F7F7F7;
  2757. 879.  -   padding: 12px 14px;
  2758. 880.  - }
  2759. 881.  - .friends_import_empty {
  2760. 882.  -   padding: 20px;
  2761. 883.  -   font-size: 12px;
  2762. 884.  -   text-align: center;
  2763. 885.  -   color: #777777;
  2764. 886.  - }
  2765. 887.  - .friends_find_controls {
  2766. 888.  -   width: 200px;
  2767. 889.  -   position: absolute;
  2768. 890.  -   margin: 32px 0px 0px 283px;
  2769. 891.  - }
  2770. 892.  - .friends_import_list {
  2771. 893.  -   padding: 2px 14px;
  2772. 894.  - }
  2773. 895.  - .friends_imp_cont {
  2774. 896.  -   padding-left: 61px;
  2775. 897.  -   padding-top: 7px;
  2776. 898.  -   height: 43px;
  2777. 899.  -   color: #777;
  2778. 900.  - }
  2779. 901.  - .friends_imp_r {
  2780. 902.  -   padding: 10px 0px;
  2781. 903.  -   border-top: 1px solid #ededed;
  2782. 904.  - }
  2783. 905.  - .friends_imp_r_first {
  2784. 906.  -   border-top: none;
  2785. 907.  - }
  2786. 908.  - .friends_imp_r_info {
  2787. 909.  -   padding-left: 10px;
  2788. 910.  -   color: #999;
  2789. 911.  - }
  2790. 912.  - .friends_imp_r_name {
  2791. 913.  -   display: block;
  2792. 914.  -   padding: 6px 0px 4px;
  2793. 915.  -   color: #45688E;
  2794. 916.  -   font-weight: bold;
  2795. 917.  - }
  2796. 918.  - .friends_imp_r_controls {
  2797. 919.  -   padding-top: 11px;
  2798. 920.  - }
  2799. 921.  - .friends_imp_status {
  2800. 922.  -   color: #999;
  2801. 923.  -   padding-top: 7px;
  2802. 924.  - }
  2803. ------
Advertisement
Add Comment
Please, Sign In to add comment