Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Файл - friends.js (Старый размер - 62358 | Новый - 0):
- 0. - var Friends = {
- 1. - init: function(obj, friendsTpl, commonTpl) {
- 2. - extend(cur, {
- 3. - fSearch: ge('s_search'),
- 4. - module: 'friends',
- 5. - fListEl: ge('friends_list'),
- 6. - showMore: ge('show_more'),
- 7. - pageEnd: ge('page_end'),
- 8. - fContent: ge('list_content'),
- 9. - friendsTpl: friendsTpl,
- 10. - commonTpl: commonTpl,
- 11. - savedMasks: {},
- 12. - bigphCache: {},
- 13. - bigphShown: {}
- 14. - });
- 15. - extend(cur, obj);
- 16. -
- 17. - if (!cur.secData) {
- 18. - cur.secData = {};
- 19. - }
- 20. -
- 21. - cur.curList = cur.section;
- 22. -
- 23. - placeholderSetup(cur.fSearch, {back: true})
- 24. - elfocus(cur.fSearch);
- 25. -
- 26. - Friends.scrollNode = browser.msie6 ? pageNode : window;
- 27. -
- 28. - addEvent(Friends.scrollNode, 'scroll', Friends.scrollResize);
- 29. -
- 30. - setTimeout(function() {
- 31. - cur.destroy.push(function() {
- 32. - clearTimeout(cur.resizeTimeout);
- 33. - removeEvent(Friends.scrollNode, 'scroll', Friends.scrollResize);
- 34. - });
- 35. - }, 0);
- 36. -
- 37. - cur.friends = {};
- 38. -
- 39. - if (!cur.silent) {
- 40. - this.indexAll(function() {
- 41. - if (cur.section.substr(0, 4) == 'list') {
- 42. - cur.friendsList[cur.section] = Friends.filter(cur.friendsList['all'], cur.section);
- 43. - }
- 44. - if (!cur.friendsList[cur.section] || !cur.friendsList[cur.section].length) {
- 45. - if (cur.section != 'requests' || !cur.suggCount) {
- 46. - show('not_found');
- 47. - }
- 48. - }
- 49. - });
- 50. - }
- 51. -
- 52. - cur.timeouts = {};
- 53. -
- 54. - cur.nav.push((function(changed, old, n) {
- 55. - debugLog('here', changed, old, n);
- 56. - if ('id' in changed || 'sort' in changed || 'act' in changed || isEmpty(changed)) {
- 57. - return true;
- 58. - }
- 59. - if (n[0] == 'friends' || n[0] == 'al_friends.php' && (changed.section)) {
- 60. - var s = changed.section;
- 61. -
- 62. - if ((s == 'requests' || s == 'all_requests' || s == 'out_requests') && !cur.requestsCount && !cur.suggCount && !cur.allRequestsCount && !cur.outRequestsCount) {
- 63. - return nav.change({section: 'all'});
- 64. - } else if (s == 'requests' && !cur.requestsCount && !cur.suggCount) {
- 65. - return nav.change({section: cur.allRequestsCount ? 'all_requests' : 'out_requests'});
- 66. - } else if (s == 'all_requests' && !cur.allRequestsCount) {
- 67. - return nav.change({section: cur.requestsCount || cur.suggCount ? 'requests' : 'out_requests'});
- 68. - } else if (s == 'out_requests' && !cur.outRequestsCount) {
- 69. - return nav.change({section: 'all'});
- 70. - }
- 71. -
- 72. - if (s == 'all' || s == 'online' || s == 'requests' || s == 'all_requests' || s == 'out_requests') {
- 73. - __adsUpdate('force');
- 74. - }
- 75. - if (s == 'all_requests' && !('sort' in changed) && !cur.sortByDate) {
- 76. - delete n.sort;
- 77. - setTimeout(Friends.changeSummary, 0);
- 78. - }
- 79. - this.section(n.section, (function() {
- 80. - this.changeSummary();
- 81. - nav.setLoc(n);
- 82. - }).bind(this));
- 83. - return false;
- 84. - } else if (n[0] == 'al_friends.php' || n[0] == 'friends') {
- 85. - return false;
- 86. - }
- 87. - }).bind(this));
- 88. -
- 89. - if (cur.silent) {
- 90. - addClass(cur.showMore, 'load_more');
- 91. - ajax.post('al_friends.php', {act: 'load_friends_silent', id: cur.oid, gid: cur.gid, sort: nav.objLoc.sort}, {
- 92. - onDone: (function(data, universities, filters) {
- 93. - removeClass(cur.showMore, 'load_more');
- 94. - cur.silent = false;
- 95. - var obj = eval('('+data+')');
- 96. - // load friends json
- 97. - if (!obj) {
- 98. - return;
- 99. - }
- 100. - cur.universities = universities;
- 101. - for (var i in obj) {
- 102. - cur.friendsList[i] = obj[i];
- 103. - }
- 104. - this.indexAll(function() {
- 105. - //Friends.selectTabAndSection(cur.section);
- 106. - if (cur.section.substr(0, 4) == 'list') {
- 107. - cur.friendsList[cur.section] = Friends.filter(cur.friendsList['all'], cur.section);
- 108. - }
- 109. - (cur.onSilentLoad || Friends.showMore)();
- 110. - });
- 111. - if (filters.cities) {
- 112. - stManager.add(['ui_controls.js', 'ui_controls.css'], function() {
- 113. - cur.cityFilter.setData(filters.cities);
- 114. - if (cur.cityFilterOpened) {
- 115. - hide('friends_fltr_progress');
- 116. - cur.cityFilter.showDefaultList()
- 117. - }
- 118. - });
- 119. - }
- 120. - }).bind(this), local: 1
- 121. - });
- 122. - }
- 123. -
- 124. - },
- 125. - indexAll: function(callback) {
- 126. - var all = cur.friendsList['all'];
- 127. -
- 128. - cur.friendsIndex = new vkIndexer(all, function(obj) {
- 129. - var mid = parseInt(obj[0]);
- 130. - if (cur.friends && mid) {
- 131. - cur.friends[mid] = obj;
- 132. - }
- 133. - return obj[5] || '';
- 134. - }, function() {
- 135. - if (!cur.silent) {
- 136. - cur.friendsList['online'] = Friends.filter(all, 'online');
- 137. - if (cur.section == 'common') {
- 138. - cur.friendsList['common'] = Friends.filter(all, 'common');
- 139. - }
- 140. - if (callback) {
- 141. - callback();
- 142. - }
- 143. - }
- 144. - Friends.initBackFunc();
- 145. - });
- 146. -
- 147. - if (cur.section == 'phonebook') {
- 148. - Friends.indexPhone();
- 149. - }
- 150. - },
- 151. - indexPhone: function() {
- 152. - cur.phoneIndex = new vkIndexer(cur.friendsList['phonebook'], function(obj) {
- 153. - var mobile = obj[10][0] || '';
- 154. - var home = obj[10][1] || '';
- 155. - return [obj[5], mobile, mobile.replace(/[^0-9\+]/g, ''), home, home.replace(/[^0-9\+]/g, '')].join(' ');
- 156. - });
- 157. - },
- 158. - initBackFunc: function() {
- 159. - cur._back = {show: [function() {
- 160. - addEvent(Friends.scrollNode, 'scroll', Friends.scrollResize);
- 161. - }], hide: [function() {
- 162. - if (Friends.searchTimout) {
- 163. - clearTimeout(Friends.searchTimout);
- 164. - }
- 165. - if (cur.timeouts) {
- 166. - for (var i in cur.timeouts) {
- 167. - clearTimeout(cur.timeouts);
- 168. - }
- 169. - }
- 170. - for (var i in cur.bigphShown) {
- 171. - animate(cur.bigphShown[i], {marginTop: 100}, 0);
- 172. - }
- 173. - cur.bigphShown = {};
- 174. - removeEvent(Friends.scrollNode, 'scroll', Friends.scrollResize);
- 175. - }], text: cur.backLang};
- 176. - },
- 177. - switchTab: function(section, ev) {
- 178. - var param = {'0':'friends', section: section};
- 179. - return checkEvent(ev) || nav.change(param);
- 180. - },
- 181. - filter: function(arr, type) {
- 182. - var len = (arr) ? arr.length : 0;
- 183. - var res = [];
- 184. - if (type.substr(0, 4) == 'list') {
- 185. - var listNum = parseInt(type.substr(4));
- 186. - type = 'list';
- 187. - }
- 188. - for (var i = 0; i < len; i++) {
- 189. - var obj = arr[i];
- 190. - if (cur.filterIds && !cur.filterIds[parseInt(obj[0])]) {
- 191. - continue;
- 192. - }
- 193. - switch (type) {
- 194. - case 'online':
- 195. - if (intval(obj[4])) {
- 196. - res.push(obj);
- 197. - }
- 198. - break;
- 199. - case 'common':
- 200. - if (cur.commonCount && obj[10]) {
- 201. - res.push(obj);
- 202. - }
- 203. - break;
- 204. - case 'list':
- 205. - if (parseInt(obj[6]) & (1 << listNum)) {
- 206. - res.push(obj);
- 207. - }
- 208. - break;
- 209. - default:
- 210. - res.push(obj);
- 211. - break;
- 212. - }
- 213. - }
- 214. - return res;
- 215. - },
- 216. - loadMore: function(start, end) {
- 217. - var section = cur.section;
- 218. - var list = cur.curList;
- 219. - var curData = cur.secData[section];
- 220. - if (curData.loading) {
- 221. - return;
- 222. - }
- 223. - curData.loading = true;
- 224. - addClass(cur.showMore, 'load_more');
- 225. - show(cur.showMore);
- 226. - ajax.post('/friends', extend({
- 227. - act: 'get_section_friends',
- 228. - section: section,
- 229. - offset: start,
- 230. - gid: cur.gid,
- 231. - sort: nav.objLoc.sort,
- 232. - sugg_rev: cur.suggRev
- 233. - }, cur.filter), {
- 234. - onDone: (function(data, preload) {
- 235. - removeClass(cur.showMore, 'load_more');
- 236. - var response = eval('('+data+')')
- 237. - if (!cur.friendsList) {
- 238. - return;
- 239. - }
- 240. - if (!cur.friendsList[list]) {
- 241. - cur.friendsList[list] = [];
- 242. - }
- 243. - Array.prototype.push.apply(cur.friendsList[list], response[section]);
- 244. - if (list == 'requests' && response['sugg_requests']) {
- 245. - Array.prototype.push.apply(cur.friendsList['sugg_requests'], response['sugg_requests']);
- 246. - }
- 247. - this.showMore(false, start, end);
- 248. - curData.loading = false;
- 249. - curData.preload = preload;
- 250. - }).bind(this)
- 251. - });
- 252. - },
- 253. - canSugSwitch: function(list) {
- 254. - if (!list) {
- 255. - return cur.suggCount ? true : true;
- 256. - }
- 257. - if (cur.suggRev) {
- 258. - return list.length >= cur.suggCount || !cur.secData.requests.preload;
- 259. - } else {
- 260. - return list.length >= cur.requestsCount || !cur.secData.requests.preload;
- 261. - }
- 262. - },
- 263. - showMore: function(clear, start, end, plain) {
- 264. - if (!cur.friendsList) {
- 265. - return false;
- 266. - }
- 267. - var clist = cur.curList;
- 268. - var list = cur.friendsList[clist];
- 269. - if (start == undefined) {
- 270. - start = cur.shownFriends;
- 271. - }
- 272. - if (end == undefined) {
- 273. - end = cur.shownFriends + cur.friendsPerPage;
- 274. - }
- 275. - if (cur.section == 'requests') {
- 276. - if (cur.suggRev) {
- 277. - list = (cur.friendsList['sugg_requests'] || []).slice();
- 278. - if (Friends.canSugSwitch(list)) {
- 279. - var suggSwitch = parseInt(cur.suggCount);
- 280. - list.push.apply(list, cur.friendsList[cur.curList] || []);
- 281. - }
- 282. - } else if (!cur.suggRev && cur.requestsCount < end && Friends.canSugSwitch(list)) {
- 283. - list = (list || []).slice();
- 284. - var suggSwitch = parseInt(cur.requestsCount);
- 285. - list.push.apply(list, cur.friendsList['sugg_requests']);
- 286. - }
- 287. - }
- 288. - if (!list || !list.length) {
- 289. - if (cur.shownFriends == 0 && !cur.searchCount) {
- 290. - if (cur.isLoading) {
- 291. - return false; // Dont show empty msg while search
- 292. - }
- 293. - if (cur.searchStr) {
- 294. - addClass(ge('not_found'), 'f_search');
- 295. - ge('search_ph').innerHTML = cur.searchStr.replace(/([<>&#]*)/g, '');
- 296. - } else {
- 297. - removeClass(ge('not_found'), 'f_search');
- 298. - }
- 299. - var text = '';
- 300. - if (cur.curList.substr(0, 4) == 'list') {
- 301. - if (cur.filterIds) {
- 302. - text = cur.summaryLang['list_not_found_filter'];
- 303. - text = text.replace('{link}', '<a onclick="Friends.clearFilter(true);">').replace('{/link}', '</a>');
- 304. - } else {
- 305. - text = cur.summaryLang['list_not_found'];
- 306. - text = text.replace('{link}', '<a onclick="Friends.editList(-1);">').replace('{/link}', '</a>');
- 307. - }
- 308. - } else if (cur.filter) {
- 309. - text = cur.summaryLang['not_found_filter'];
- 310. - text = text.replace('{link}', '<a onclick="Friends.clearFilter(true);">').replace('{/link}', '</a>');
- 311. - } else {
- 312. - text = cur.summaryLang['not_found'];
- 313. - }
- 314. - ge('not_found_text').innerHTML = text;
- 315. - show('not_found');
- 316. - }
- 317. - if (clear) {
- 318. - cur.fContent.innerHTML = '';
- 319. - }
- 320. - if (cur.searchCount) {
- 321. - Friends.serverSearchMore();
- 322. - }
- 323. - hide('show_more');
- 324. - return;
- 325. - } else if (isVisible('not_found')) {
- 326. - hide('not_found');
- 327. - }
- 328. -
- 329. - var friends = list.slice(start, end);
- 330. - if (!friends.length) {
- 331. - // can upload
- 332. - var secData = cur.secData[cur.section];
- 333. - if (secData && secData.preload) {
- 334. - Friends.loadMore(start, end);
- 335. - }
- 336. - if (cur.searchCount) {
- 337. - Friends.serverSearchMore();
- 338. - }
- 339. - if (cur.shownFriends >= cur.sectionCount) {
- 340. - hide('show_more');
- 341. - }
- 342. - return;
- 343. - }
- 344. - var html = [];
- 345. - var first = (cur.shownFriends == 0) ? ' user_block_first' : '';
- 346. - if (clear) {
- 347. - cur.fContent.innerHTML = '';
- 348. - }
- 349. - for (i in friends) {
- 350. - var iSt = parseInt(i) + start;
- 351. - if (suggSwitch && suggSwitch == iSt) {
- 352. - if (cur.suggRev) {
- 353. - var summaryText = langNumeric(cur.requestsCount, cur.summaryLang['requests']);
- 354. - if (nav.objLoc.sort != 'date') {
- 355. - summaryText += '<span class="divide">|</span><span><a href="/friends?section=' + cur.section + '&sort=date">' + cur.summaryLang['friends_sort_by_date'] + '</a></span>';
- 356. - } else {
- 357. - summaryText += '<span class="divide">|</span><span><a href="/friends?section=' + cur.section + '">' + cur.summaryLang['friends_sort_by_common'] + '</a></span>';
- 358. - }
- 359. - } else {
- 360. - var summaryText = langNumeric(cur.suggCount, cur.summaryLang['friends_sugg_summary']);
- 361. - }
- 362. - html.push('<div id="friends_sub_summary" class="summary_wrap"><div class="summary">',summaryText,'</div></div>');
- 363. - first = ' user_block_first';
- 364. - }
- 365. - if (cur.selection) {
- 366. - var friend = friends[i].slice();
- 367. - friend[5] = friend[5].replace(cur.selection.re, cur.selection.val);
- 368. - } else {
- 369. - var friend = friends[i];
- 370. - }
- 371. - if (cur.importCount && cur.importCount == cur.shownFriends) {
- 372. - html.push('<div id="friends_sub_summary" class="summary_wrap"><div class="summary">',cur.summaryLang['suggestions'],'</div></div>');
- 373. - first = ' user_block_first';
- 374. - }
- 375. - /*if (friend[0] && ge('user_block' + friend[0])) { // bad with search
- 376. - debugLog('here');
- 377. - continue;
- 378. - }*/
- 379. - ++cur.shownFriends;
- 380. - if (!friend) {
- 381. - continue;
- 382. - }
- 383. - var tplType = '';
- 384. - if (cur.section == 'requests') {
- 385. - if (suggSwitch <= iSt) {
- 386. - tplType = (!cur.suggRev ? 'sugg_requests' : '');
- 387. - } else {
- 388. - tplType = (!cur.suggRev ? '' : 'sugg_requests');
- 389. - }
- 390. - }
- 391. - Array.prototype.push.apply(html, Friends.drawFriend(friend, first, tplType));
- 392. - first = '';
- 393. - }
- 394. - if (plain) {
- 395. - return '<div>'+html.join('')+'</div>';
- 396. - }
- 397. - cur.fContent.appendChild(ce('div', {innerHTML: html.join('')}));
- 398. - if (cur.shownFriends >= cur.sectionCount) {
- 399. - hide('show_more');
- 400. - } else {
- 401. - show('show_more');
- 402. - }
- 403. - },
- 404. -
- 405. - updateList: function(e, obj, force) {
- 406. - if (!obj || e.keyCode == KEY.ESC) {
- 407. - obj = cur.fSearch;
- 408. - val(obj, '');
- 409. - cur.searchStr = '';
- 410. - }
- 411. - if (cur.silent) {
- 412. - cur.onSilentLoad = function() {
- 413. - Friends.updateList(e, obj, true);
- 414. - };
- 415. - if (trim(obj.value)) {
- 416. - hide(cur.showMore);
- 417. - cur.fContent.innerHTML = '<div class="wide_loading"></div>';
- 418. - }
- 419. - return;
- 420. - }
- 421. - clearTimeout(this.searchTimout);
- 422. - this.searchTimout = setTimeout((function() {
- 423. - var str = trim(obj.value);
- 424. - if (str && cur.searchStr == str) return;
- 425. - cur.searchStr = str;
- 426. - if (str) {
- 427. - if (cur.section != 'all' && cur.section != 'phonebook') {
- 428. - this.selectTab('all');
- 429. - this.selectSection('all');
- 430. - cur.curList = cur.section = 'all';
- 431. -
- 432. - nav.setLoc(extend(nav.objLoc, {'section': 'all'}));
- 433. - }
- 434. - this.search(str, cur.section);
- 435. - this.changeSummary();
- 436. - } else if (cur.section != cur.curList || force) {
- 437. - this.showSection();
- 438. - this.changeSummary();
- 439. - this.showMore();
- 440. - } else {
- 441. - this.hideLoading();
- 442. - cur.searchCount = 0;
- 443. - this.showMore();
- 444. - }
- 445. - }).bind(this), 10);
- 446. - },
- 447. - showSection: function(section) {
- 448. - cur.shownFriends = 0;
- 449. - cur.curList = cur.section = section || cur.section;
- 450. - if (vk.id == cur.oid) {
- 451. - if (cur.section == 'requests' || cur.section == 'all_requests' || cur.section == 'out_requests') {
- 452. - hide('friends_search');
- 453. - var tabsCount = ((cur.requestsCount || cur.suggCount) ? 1 : 0) + (cur.allRequestsCount ? 1 : 0) + (cur.outRequestsCount ? 1 : 0);
- 454. - toggle('friends_req_tabs', tabsCount > 1);
- 455. - toggle('friends_hide_all', (cur.section == 'requests') && (cur.requestsCount > 1 || cur.suggCount));
- 456. - toggle(ge('sum_tab_requests').parentNode, cur.requestsCount > 0 || cur.suggCount > 0);
- 457. - toggle(ge('sum_tab_all_requests').parentNode, cur.allRequestsCount > 0);
- 458. - toggle(ge('sum_tab_out_requests').parentNode, cur.outRequestsCount > 0);
- 459. - show('tab_requests');
- 460. - addClass(ge('main_class'), 'wide');
- 461. - } else {
- 462. - show('friends_search');
- 463. - hide('friends_req_tabs');
- 464. - (cur.allFriendsCount && (cur.section != 'members') ? removeClass : addClass)(ge('main_class'), 'wide');
- 465. - }
- 466. - toggle('tab_requests', nav.objLoc.act != 'invite' && (cur.requestsCount || cur.allRequestsCount || cur.outRequestsCount || cur.suggCount));
- 467. - }
- 468. - if (cur.filterIds) {
- 469. - cur.curList += '_filter';
- 470. - }
- 471. - var list = cur.friendsList[cur.curList];
- 472. - if (!list) {
- 473. - if (section == 'recent' || section == 'phonebook' || section == 'requests') {
- 474. - var friendsList = section;
- 475. - } else {
- 476. - var friendsList = 'all';
- 477. - }
- 478. - list = cur.friendsList[cur.curList] = this.filter(cur.friendsList[friendsList], cur.section);
- 479. - }
- 480. - cur.sectionCount = (list) ? list.length : 0;
- 481. - cur.selection = false;
- 482. - if (cur.filter && !cur.filterIds) {
- 483. - Friends.changeFilter();
- 484. - if (!cur.searchStr) {
- 485. - hide('friends_reset_search');
- 486. - this.clearServerSearch();
- 487. - }
- 488. - return false;
- 489. - }
- 490. - this.showMore(true);
- 491. - if (!cur.searchStr) {
- 492. - hide('friends_reset_search');
- 493. - this.clearServerSearch();
- 494. - }
- 495. - },
- 496. -
- 497. - updateView: function() {
- 498. - cur.fContent.innerHTML = this.showMore(false, 0, cur.shownFriends, true);
- 499. - },
- 500. -
- 501. - showLoading: function() {
- 502. - cur.isLoading = 1;
- 503. - show('friends_loading');
- 504. - hide('friends_reset_search');
- 505. - },
- 506. -
- 507. - hideLoading: function() {
- 508. - cur.isLoading = 0;
- 509. - hide('friends_loading');
- 510. - if (cur.searchStr) {
- 511. - show('friends_reset_search');
- 512. - }
- 513. - },
- 514. -
- 515. - serverSearchMore: function() {
- 516. - if (cur.serverLoadingMore) {
- 517. - return;
- 518. - }
- 519. - if (cur.searchFinished) {
- 520. - return;
- 521. - }
- 522. - cur.serverLoadingMore = true;
- 523. - ajax.post('friends', {
- 524. - act: 'server_search',
- 525. - q: cur.searchStr,
- 526. - offset: cur.searchOffset
- 527. - }, {
- 528. - onDone: function(html, found, summary, newOffset) {
- 529. - cur.searchFinished = !found;
- 530. - if (cur.searchFinished) {
- 531. - hide('friends_search_more');
- 532. - }
- 533. - cur.searchOffset = newOffset;
- 534. - cur.serverLoadingMore = false;
- 535. - ge('friends_search_cont').appendChild(ce('div', {innerHTML: html}));
- 536. - },
- 537. - showProgress: function() {
- 538. - addClass(ge('friends_search_more'), 'load_more');
- 539. - },
- 540. - hideProgress: function() {
- 541. - removeClass(ge('friends_search_more'), 'load_more');
- 542. - }
- 543. - });
- 544. - },
- 545. -
- 546. - serverSearch: function(str, count, exclude) {
- 547. - cur.searchCount = 0;
- 548. - Friends.showLoading();
- 549. - cur.serverSearchStr = str;
- 550. - clearTimeout(cur.serverSearchTimeout);
- 551. - var excludeList = [];
- 552. - for (var i in exclude) {
- 553. - excludeList.push(exclude[i][0]);
- 554. - }
- 555. - cur.serverSearchTimeout = setTimeout((function() {
- 556. - ajax.post('friends', {
- 557. - act: 'server_search',
- 558. - q: str,
- 559. - exclude: excludeList.join(',')
- 560. - }, {
- 561. - onDone: function(html, found, summary, newOffset) {
- 562. - cur.searchOffset = newOffset;
- 563. - cur.searchFinished = !found;
- 564. - Friends.hideLoading();
- 565. - if (cur.searchStr != str) return;
- 566. - var cont = ge('friends_search_cont');
- 567. - cur.searchCount = found;
- 568. - if (cur.shownFriends == 0) {
- 569. - hide(cont);
- 570. - cur.fContent.innerHTML = '';
- 571. - Friends.showMore();
- 572. - }
- 573. - if (!found) {
- 574. - Friends.changeSummary();
- 575. - return;
- 576. - }
- 577. - if (cur.searchFinished) {
- 578. - hide('friends_search_more');
- 579. - } else {
- 580. - show('friends_search_more');
- 581. - }
- 582. - cur.searchSummary = summary;
- 583. - if (count) {
- 584. - html = '<div class="summary_wrap"><div class="summary">'+summary+'</div></div>'+html;
- 585. - }
- 586. - cont.innerHTML = html;
- 587. - show(cont);
- 588. - Friends.changeSummary();
- 589. - hide('not_found');
- 590. - },
- 591. - onFail: Friends.hideLoading
- 592. - });
- 593. - }).bind(this), 300);
- 594. - },
- 595. -
- 596. - clearServerSearch: function() {
- 597. - hide('friends_search_cont');
- 598. - hide('friends_search_more');
- 599. - cur.searchCount = 0;
- 600. - },
- 601. -
- 602. - goToSearch: function(obj) {
- 603. - nav.go('search?c%5Bname%5D=1&c%5Bq%5D='+encodeURIComponent(cur.searchStr)+'&c%5Bsection%5D=people');
- 604. - },
- 605. -
- 606. - search: function(str, type, callback, filter) {
- 607. - cur.shownFriends = 0;
- 608. - cur.section = type;
- 609. - if (str) {
- 610. - var index = (type == 'phonebook') ? cur.phoneIndex : cur.friendsIndex;
- 611. - var checkTime = new Date().getTime();
- 612. - if (str == -1) {
- 613. - if (type == 'recent' || type == 'phonebook') {
- 614. - var friendsList = type;
- 615. - } else {
- 616. - var friendsList = 'all';
- 617. - }
- 618. - var res = this.filter(cur.friendsList[friendsList], type);
- 619. - str = '';
- 620. - if (str != cur.searchStr) {
- 621. - this.clearServerSearch();
- 622. - }
- 623. - } else {
- 624. - var res = index.search(str);
- 625. - if (cur.filterIds) {
- 626. - res = this.filter(res, type);
- 627. - }
- 628. - var count = res.length;
- 629. - if (count) {
- 630. - if (str != cur.serverSearchStr && !cur.sectionCount) {
- 631. - this.clearServerSearch();
- 632. - }
- 633. - }
- 634. - if (count < 5 && cur.oid == vk.id) { // try to find some on the server side
- 635. - this.serverSearch(str, count, res);
- 636. - }
- 637. - }
- 638. - var newList = cur.section;
- 639. - if (cur.filterIds) {
- 640. - newList += '_filter';
- 641. - }
- 642. - if (str) {
- 643. - newList += '_search_'+str;
- 644. - }
- 645. - if (cur.curList == newList && !filter) {
- 646. - return; // now at this section
- 647. - }
- 648. - cur.curList = newList;
- 649. - cur.friendsList[cur.curList] = res;
- 650. -
- 651. - if (str) {
- 652. - str += ' '+(parseLatin(str) || '');
- 653. - str = trim(escapeRE(str.replace(/[,]/g, '')));
- 654. - cur.selection = {
- 655. - re: new RegExp('('+str.replace(index.delimiter, '|').replace(/(^\||\|$|\?)/g, '')+')', 'gi'),
- 656. - val: '<em>$1</em>'
- 657. - };
- 658. - }
- 659. - if (!cur.isLoading) {
- 660. - show('friends_reset_search');
- 661. - }
- 662. - } else {
- 663. - cur.curList = cur.section;
- 664. - cur.selection = false;
- 665. - hide('friends_reset_search');
- 666. - if (cur.searchStr) {
- 667. - this.clearServerSearch();
- 668. - }
- 669. - }
- 670. -
- 671. - cur.sectionCount = cur.friendsList[cur.curList].length;
- 672. - this.searchTimout = setTimeout((function() {
- 673. - this.showMore(true);
- 674. - if (callback) {
- 675. - Friends.onSectionChange();
- 676. - callback();
- 677. - }
- 678. - }).bind(this), 10);
- 679. - },
- 680. -
- 681. - changeSummary: function() {
- 682. - var sum = ge('friends_summary');
- 683. - var html = '';
- 684. - if (cur.curList.indexOf('_search_') != -1 || cur.filterIds) {
- 685. - if (!cur.sectionCount) {
- 686. - if (cur.searchCount) {
- 687. - html = cur.searchSummary;
- 688. - } else {
- 689. - if (cur.isLoading) {
- 690. - return; // no update while loading
- 691. - }
- 692. - html = cur.summaryLang['search_no'];
- 693. - }
- 694. - } else {
- 695. - html = langNumeric(cur.sectionCount, cur.summaryLang['search'], true);
- 696. - }
- 697. - } else if (cur.curList.slice(0, 4) == 'list') {
- 698. - var langKey = (parseInt(cur.curList.slice(4)) < 25) ? 'list' : 'pub_list';
- 699. - if (cur.sectionCount) {
- 700. - html = langNumeric(cur.sectionCount, cur.summaryLang[langKey], true);
- 701. - } else {
- 702. - html = cur.summaryLang[langKey+'_no'];
- 703. - }
- 704. - } else if (cur.section == 'recent') {
- 705. - html = cur.summaryLang['recent'];
- 706. - } else if (cur.section == 'requests' && cur.requestsCount > 0) {
- 707. - if (cur.suggRev && cur.suggCount > 0) {
- 708. - html = langNumeric(cur.suggCount, cur.summaryLang['friends_sugg_summary'], true);
- 709. - } else {
- 710. - html = langNumeric(cur.requestsCount, cur.summaryLang[cur.section], true);
- 711. - }
- 712. - } else if (cur.section == 'requests' && cur.suggCount > 0) {
- 713. - html = langNumeric(cur.suggCount, cur.summaryLang['friends_sugg_summary'], true);
- 714. - } else if (cur.section == 'all_requests' && cur.sectionCount > 0) {
- 715. - html = langNumeric(cur.allRequestsCount, cur.summaryLang[cur.section], true);
- 716. - } else if (cur.section == 'out_requests' && cur.sectionCount > 0) {
- 717. - html = langNumeric(cur.outRequestsCount, cur.summaryLang[cur.section], true);
- 718. - } else if (cur.sectionCount > 0) {
- 719. - html = langNumeric(cur.sectionCount, cur.summaryLang[cur.section], true);
- 720. - } else {
- 721. - html = cur.summaryLang['all_no'];
- 722. - }
- 723. - if (cur.section.indexOf('list') == 0 && cur.oid == vk.id) {
- 724. - listNum = parseInt(cur.curList.substr(4));
- 725. - var list_edit_text = cur.summaryLang[(cur.sectionCount ? 'list_edit': 'list_start_edit')];
- 726. - html += '<span class="divider">|</span><span><a onclick="Friends.editList('+listNum+');">'+list_edit_text+'</a></span>';
- 727. - if (listNum < 25) {
- 728. - html += '<span class="divider">|</span><span><a onclick="Friends.deleteList('+listNum+');">'+cur.summaryLang['list_delete']+'</a></span>';
- 729. - }
- 730. - }
- 731. - if (vk.id != cur.oid) {
- 732. - html += '<span class="divider">|</span><span>' + cur.summaryLang['to_users_page'] + '</span>';
- 733. - }
- 734. - if ((cur.section == 'requests' && cur.requestsCount > 50) || cur.section == 'all_requests') {
- 735. - if (!cur.suggRev || !cur.suggCount) {
- 736. - if (nav.objLoc.sort != 'date') {
- 737. - html += '<span class="divide">|</span><span><a href="/friends?section=' + cur.section + '&sort=date">' + cur.summaryLang['friends_sort_by_date'] + '</a></span>';
- 738. - } else {
- 739. - html += '<span class="divide">|</span><span><a href="/friends?section=' + cur.section + '">' + cur.summaryLang['friends_sort_by_common'] + '</a></span>';
- 740. - }
- 741. - }
- 742. -
- 743. - }
- 744. - sum.innerHTML = html;
- 745. -
- 746. - document.title = replaceEntities(stripHTML(cur.htitles[cur.section] || cur.htitles.all));
- 747. - },
- 748. - selectTab: function(tab) {
- 749. - var section = geByClass1('active_link', ge('friends_tabs'));
- 750. - removeClass(section, 'active_link');
- 751. - addClass(ge('tab_' + tab), 'active_link');
- 752. - if (cur.oid != vk.id) {
- 753. - toggleClass(ge('main_class'), 'wide', tab != 'all' || !cur.allFriendsCount);
- 754. - }
- 755. - },
- 756. - selectSection: function(tab) {
- 757. - var section = geByClass1('cur_section', ge('sections_block'));
- 758. - removeClass(section, 'cur_section');
- 759. - addClass(ge('section_' + tab), 'cur_section');
- 760. - },
- 761. - selectSumTab: function(tab) {
- 762. - var section = geByClass1('summary_tab_sel', ge('friends_req_tabs'));
- 763. - removeClass(section, 'summary_tab_sel');
- 764. - addClass(section, 'summary_tab');
- 765. - var el = ge('sum_tab_' + tab).parentNode;
- 766. - removeClass(el, 'summary_tab');
- 767. - addClass(el, 'summary_tab_sel');
- 768. - },
- 769. - selectTabAndSection: function(type) {
- 770. - if (type == 'all' || type == 'online' || type == 'common' || type == 'members') {
- 771. - this.selectTab(type);
- 772. - this.selectSection('all');
- 773. - } else if (type == 'all_requests' || type == 'requests' || type == 'out_requests') {
- 774. - this.selectTab('requests');
- 775. - this.selectSumTab(type);
- 776. - } else {
- 777. - this.selectTab('all');
- 778. - this.selectSection(type);
- 779. - }
- 780. - },
- 781. - onSectionChange: function() {
- 782. - if (window.tooltips) {
- 783. - tooltips.hideAll();
- 784. - }
- 785. - },
- 786. - section: function(type, callback, updateData) {
- 787. - Friends.clearServerSearch();
- 788. - if (!type) {
- 789. - type = 'all';
- 790. - }
- 791. - //if (!updateData && (type != 'all' || cur.section != type) && type.substr(0, 4) != 'list') {
- 792. - if (!updateData && ((type == 'online' && cur.oid != vk.id) || type.indexOf('requests') != -1) && type.substr(0, 4) != 'list') {
- 793. - Friends.clearFilter();
- 794. - }
- 795. - if (!type) {
- 796. - if ((cur.requestsCount && cur.requestsCount > 0 && cur.requestsCount < 100) || cur.suggCount) {
- 797. - type = 'requests';
- 798. - } else {
- 799. - type = 'all';
- 800. - }
- 801. - }
- 802. - if (!cur.requestsCount && !cur.suggCount && !cur.allRequestsCount && !cur.outRequestsCount) {
- 803. - hide('tab_requests');
- 804. - }
- 805. - if (type != cur.section) {
- 806. - cur.fSearch.setValue('');
- 807. - cur.searchStr = '';
- 808. - }
- 809. - // Select section filter
- 810. - this.selectTabAndSection(type);
- 811. -
- 812. - if (cur.silent && type != 'out_requests') {
- 813. - cur.onSilentLoad = function() {
- 814. - Friends.section(type, callback);
- 815. - };
- 816. - if (type != cur.section) {
- 817. - hide(cur.showMore);
- 818. - cur.fContent.innerHTML = '<div class="wide_loading"></div>';
- 819. - }
- 820. - return;
- 821. - }
- 822. -
- 823. -
- 824. - if (!cur.secData[type]) {
- 825. - cur.secData[type] = {};
- 826. - }
- 827. - // from cache
- 828. - if (!updateData && cur.friendsList[type] || type == 'all' || (type == 'requests' && cur.friendsList['sugg_requests'])) {
- 829. - if (!cur.filter) {
- 830. - this.showSection(type);
- 831. - callback();
- 832. - Friends.onSectionChange();
- 833. - return;
- 834. - }
- 835. - }
- 836. - // generate
- 837. - switch (type) {
- 838. - case 'online':
- 839. - case 'common':
- 840. - this.search(-1, type, callback);
- 841. - break;
- 842. - case 'phonebook':
- 843. - this.loadingState('phonebook');
- 844. - ajax.post('/al_friends.php', {act: 'phonebook', id: nav.objLoc.id}, {onDone: (function(data) {
- 845. - if (!data) {
- 846. - return;
- 847. - }
- 848. - cur.shownFriends = 0;
- 849. - cur.curList = cur.section = type;
- 850. - var list = cur.friendsList['all'];
- 851. - var phoneList = [];
- 852. - if (list) {
- 853. - for (var i = 0, len = list.length; i < len; i++) {
- 854. - var friend = list[i];
- 855. - var phone = data[friend[0]];
- 856. - if (phone) {
- 857. - friend.push(phone);
- 858. - phoneList.push(friend);
- 859. - }
- 860. - }
- 861. - }
- 862. - cur.friendsList[cur.section] = phoneList;
- 863. - cur.sectionCount = phoneList.length;
- 864. - cur.fContent.innerHTML = '';
- 865. - this.loadingState('phonebook', true);
- 866. - Friends.onSectionChange();
- 867. - callback();
- 868. - Friends.indexPhone();
- 869. - if (cur.filterIds) {
- 870. - cur.curList += '_filter';
- 871. - Friends.search(cur.searchStr || -1, cur.section, false, true);
- 872. - Friends.changeSummary();
- 873. - return;
- 874. - }
- 875. - this.showMore();
- 876. - }).bind(this)});
- 877. - break;
- 878. - case 'recent':
- 879. - this.loadingState('recent');
- 880. - ajax.post('/al_friends.php', {act: 'recent'}, {onDone: (function(data) {
- 881. - if (!data) {
- 882. - return;
- 883. - }
- 884. - cur.shownFriends = 0;
- 885. - cur.curList = cur.section = type;
- 886. - var list = [];
- 887. - len = data.length;
- 888. - for (var i = 0; i < len; i++) {
- 889. - var f = cur.friends[data[i]];
- 890. - if (f) {
- 891. - list.push(f);
- 892. - }
- 893. - }
- 894. - cur.friendsList[cur.section] = list;
- 895. - cur.sectionCount = list.length;
- 896. - cur.fContent.innerHTML = '';
- 897. - this.loadingState('recent', true);
- 898. - Friends.onSectionChange();
- 899. - callback();
- 900. - if (cur.filterIds) {
- 901. - cur.curList += '_filter';
- 902. - Friends.search(cur.searchStr || -1, cur.section, false, true);
- 903. - Friends.changeSummary();
- 904. - return;
- 905. - }
- 906. - this.showMore();
- 907. - }).bind(this)});
- 908. - break;
- 909. - case 'out_requests':
- 910. - hide(cur.showMore, 'friends_hide_all');
- 911. - cur.fContent.innerHTML = '<div class="wide_loading"></div>';
- 912. - ajax.post('/friends', {act: 'out_requests'}, {onDone: (function(data, universities) {
- 913. - var obj = eval('('+data+')');
- 914. -
- 915. - // load friends json
- 916. - if (!obj) {
- 917. - return;
- 918. - }
- 919. - extend(cur.universities, universities);
- 920. - extend(cur.friendsList, obj);
- 921. -
- 922. - this.indexAll(function() {
- 923. - Friends.section(type, callback);
- 924. - });
- 925. - }).bind(this)});
- 926. - break;
- 927. - default:
- 928. - if (type.substr(0, 4) == 'list') {
- 929. - this.search(-1, type, callback);
- 930. - }
- 931. -
- 932. - }
- 933. - },
- 934. - loadingState: function(section, state) {
- 935. - if (state) {
- 936. - if (cur.oldSection) {
- 937. - removeClass(cur.oldSection, 'loading');
- 938. - }
- 939. - } else {
- 940. - cur.oldSection = ge('section_' + section);
- 941. - addClass(cur.oldSection, 'loading');
- 942. - }
- 943. - },
- 944. - scrollResize: function() {
- 945. - if (browser.mobile) return;
- 946. - var docEl = document.documentElement;
- 947. - var ch = window.innerHeight || docEl.clientHeight || bodyNode.clientHeight;
- 948. - var st = scrollGetY();
- 949. - if (!cur.pageEnd) {
- 950. - return;
- 951. - }
- 952. - if (st + ch * 3 > cur.pageEnd.offsetTop) {
- 953. - setTimeout(function() {
- 954. - Friends.showMore();
- 955. - }, 0);
- 956. - }
- 957. - },
- 958. - drawFriend: function(friend, first, type) {
- 959. - if (cur.section == 'requests' || cur.section == 'all_requests' || cur.section == 'out_requests') {
- 960. - return cur.commonTpl(friend, type || cur.section, first);
- 961. - } else {
- 962. - return cur.friendsTpl(friend, cur.section, first);
- 963. - }
- 964. - },
- 965. -
- 966. - inviteToGroup: function(ev, gid, mid, invited, hash) {
- 967. - var setInvited = function(invited) {
- 968. - for(var i in cur.friendsList[cur.curList]) {
- 969. - var row = cur.friendsList[cur.curList][i];
- 970. - if (row[0] == mid) {
- 971. - row[10] = invited;
- 972. - //Friends.updateView();
- 973. - var block = ge('user_block'+mid), link = '';
- 974. - if (invited) {
- 975. - link = '<a href="" onclick="return Friends.inviteToGroup(event, '+gid+', '+mid+', 1, \''+row[11]+'\')">'+getLang('friends_cancel_invite')+'</a>';
- 976. - } else {
- 977. - link = '<a href="" onclick="return Friends.inviteToGroup(event, '+gid+', '+mid+', 0, \''+row[11]+'\')">'+getLang('friends_send_invite')+'</a>';
- 978. - }
- 979. - geByClass('actions', block)[0].innerHTML = link;
- 980. - break;
- 981. - }
- 982. - }
- 983. - }
- 984. - if (invited) {
- 985. - ajax.post('/al_page.php', {act:'a_cancel_invite', mid:mid, gid:gid, hash:hash}, {onDone:function(res){ }});
- 986. - setInvited(0);
- 987. - } else {
- 988. - ajax.post('/al_page.php', {act:'a_invite', mid:mid, gid:gid, hash:hash}, {onDone:function(res, message) {
- 989. - if (!res) {
- 990. - setInvited(0);
- 991. - ge('res'+mid).innerHTML = '<div class="res">'+message+'</div>';
- 992. - hide('lists'+mid);
- 993. - var block = ge('user_block'+mid);
- 994. - hide(geByClass('actions', block)[0]);
- 995. - }
- 996. - }});
- 997. - setInvited(1);
- 998. - }
- 999. - return false;
- 1000. - },
- 1001. -
- 1002. - acceptRequest: function(mid, hash, el) {
- 1003. - var controls = ge('request_controls_'+mid);
- 1004. - var controlsCont = controls.parentNode;
- 1005. - if (!el) {
- 1006. - controls.innerHTML = '<div align="center"><img src="/images/upload.gif"></div>';
- 1007. - }
- 1008. - ajax.post('al_friends.php', {act: 'add', mid: mid, hash: hash, request: 1, 'select_list': 1}, {onDone: function(text) {
- 1009. - controls.innerHTML = text;
- 1010. - if (cur.friendsList) {
- 1011. - delete cur.friendsList['recent'];
- 1012. - }
- 1013. - }, onFail: function(text) {
- 1014. - if (!text) return;
- 1015. -
- 1016. - showFastBox(getLang('global_error'), text);
- 1017. - return true;
- 1018. - }, showProgress: lockButton.pbind(el), hideProgress: unlockButton.pbind(el)});
- 1019. - Friends.processRequest(mid, true);
- 1020. - if (cur.friendsList) {
- 1021. - delete cur.friendsList['online'];
- 1022. - Friends.indexAll();
- 1023. - }
- 1024. - },
- 1025. -
- 1026. - declineRequest: function(mid, hash, el) {
- 1027. - var controls = ge('request_controls_'+mid);
- 1028. - var controlsCont = controls.parentNode;
- 1029. - if (!el) {
- 1030. - controls.innerHTML = '<div align="center"><img src="/images/upload.gif"></div>';
- 1031. - }
- 1032. - ajax.post('al_friends.php', {act: 'remove', mid: mid, hash: hash, report_spam: 1, from_section: cur.section}, {onDone: function(text) {
- 1033. - controls.innerHTML = text;
- 1034. - }, onFail: function(text) {
- 1035. - if (!text) return;
- 1036. -
- 1037. - showFastBox(getLang('global_error'), text);
- 1038. - return true;
- 1039. - }, showProgress: lockButton.pbind(el), hideProgress: unlockButton.pbind(el)});
- 1040. -
- 1041. - Friends.processRequest(mid, false);
- 1042. - },
- 1043. -
- 1044. - processRequest: function(mid, add, sugg) {
- 1045. - if (!cur.friendsList) {
- 1046. - return;
- 1047. - }
- 1048. - var reqs = cur.friendsList[sugg ? 'sugg_requests' : 'requests'] || [];
- 1049. - var len = reqs.length, found = false;
- 1050. - while (len--) {
- 1051. - if (reqs[len][0] == mid) {
- 1052. - var friend = reqs.splice(len, 1)[0];
- 1053. - if (sugg) {
- 1054. - --cur.suggCount;
- 1055. - } else {
- 1056. - --cur.requestsCount;
- 1057. - }
- 1058. - val(geByClass1('tab_word', ge('tab_requests')), cur.summaryLang['requests_title'] + (cur.requestsCount ? ('<span class="count">+' + cur.requestsCount + '</span>') : ''));
- 1059. - toggleClass(ge('tab_requests'), 'count', !!cur.requestsCount);
- 1060. - if (add) {
- 1061. - found = true;
- 1062. - friend.pop();
- 1063. - if (cur.friendsList['all']) {
- 1064. - cur.friendsList['all'].push(friend);
- 1065. - } else {
- 1066. - cur.friendsList['all'] = [friend];
- 1067. - }
- 1068. - cur.friends[friend[0]] = friend;
- 1069. - }
- 1070. - }
- 1071. - }
- 1072. - if (add) {
- 1073. - var reqs = cur.friendsList['all_requests'] || [];
- 1074. - var len = reqs.length;
- 1075. - while (len--) {
- 1076. - if (reqs[len][0] == mid) {
- 1077. - var friend = reqs.splice(len, 1)[0];
- 1078. - --cur.allRequestsCount;
- 1079. - if (!found) {
- 1080. - friend.pop();
- 1081. - if (cur.friendsList['all']) {
- 1082. - cur.friendsList['all'].push(friend);
- 1083. - } else {
- 1084. - cur.friendsList['all'] = [friend];
- 1085. - }
- 1086. - cur.friends[friend[0]] = friend;
- 1087. - }
- 1088. - }
- 1089. - }
- 1090. - } else {
- 1091. - var reqs = cur.friendsList['out_requests'] || [];
- 1092. - var len = reqs.length;
- 1093. - while (len--) {
- 1094. - if (reqs[len][0] == mid) {
- 1095. - var friend = reqs.splice(len, 1)[0];
- 1096. - --cur.outRequestsCount;
- 1097. - }
- 1098. - }
- 1099. - }
- 1100. - },
- 1101. -
- 1102. - reportSpam: function(mid, hash) {
- 1103. - var controls = ge('request_controls_' + mid);
- 1104. - if (!controls) {
- 1105. - controls = ge('result_msg');
- 1106. - removeClass(controls, 'msg');
- 1107. - }
- 1108. - controls.innerHTML = '<div align="center"><img src="/images/upload.gif"></div>';
- 1109. - ajax.post('al_friends.php', {act: 'report_spam', mid: mid, hash: hash}, {onDone: function(text) {
- 1110. - controls.innerHTML = text;
- 1111. - }});
- 1112. - },
- 1113. -
- 1114. - restoreFriend: function(el, id) {
- 1115. - var back = el.innerHTML;
- 1116. - ajax.post('al_friends.php', {act: 'add', mid: id, hash: cur.userHash, cats: cur.savedMasks[id]}, {
- 1117. - onDone: Friends.onRemoveFriend.pbind(id, true),
- 1118. - showProgress: function() {
- 1119. - el.innerHTML = '<center><img src="/images/upload.gif" /></center>';
- 1120. - },
- 1121. - hideProgress: function() {
- 1122. - el.innerHTML = back;
- 1123. - }
- 1124. - });
- 1125. - },
- 1126. -
- 1127. - deleteFriend: function(e, id, el) {
- 1128. - var back = el.innerHTML;
- 1129. - ajax.post('al_friends.php', {act: 'remove', mid: id, hash: cur.userHash}, {
- 1130. - onDone: Friends.onRemoveFriend.pbind(id, false),
- 1131. - showProgress: function() {
- 1132. - el.innerHTML = '<center><img src="/images/upload.gif" /></center>';
- 1133. - },
- 1134. - hideProgress: function() {
- 1135. - el.innerHTML = back;
- 1136. - }
- 1137. - });
- 1138. - return false;
- 1139. - },
- 1140. -
- 1141. - onRemoveFriend: function(mid, res) {
- 1142. - var needUpdateView = (cur.friendsList[cur.curList] || []).length < 10;
- 1143. -
- 1144. - for (var i in cur.friendsList) {
- 1145. - if (i != 'all' && i != 'requests' && i != 'all_requests' && i != 'out_requests') {
- 1146. - delete cur.friendsList[i];
- 1147. - }
- 1148. - }
- 1149. - var list = cur.friendsList['all'];
- 1150. - var len = list.length;
- 1151. - mid = positive(mid);
- 1152. -
- 1153. - var block = ge('user_block' + mid);
- 1154. - var fr = cur.friends[mid];
- 1155. - if (fr && block) {
- 1156. - if (res) {
- 1157. - fr[6] = cur.savedMasks[mid];
- 1158. - delete(cur.savedMasks[mid]);
- 1159. - } else {
- 1160. - cur.savedMasks[mid] = fr[6];
- 1161. - fr[6] = 0; // zero mask - removed friend
- 1162. - }
- 1163. - block.parentNode.replaceChild(ce('div', {innerHTML: cur.friendsTpl(fr, cur.section, hasClass(block, 'user_block_first') ? ' user_block_first' : '').join('')}).firstChild, block);
- 1164. - } else {
- 1165. - re(block);
- 1166. - }
- 1167. -
- 1168. - Friends.indexAll(function() {
- 1169. - });
- 1170. - },
- 1171. - showCommonBox: function(e, id, hash) {
- 1172. - if (checkEvent(e)) return true;
- 1173. - showBox('al_friends.php', {act: 'common_friends', mid: id, hash: hash}, {params: {bodyStyle: "padding: 0px;"}});
- 1174. - return false;
- 1175. - },
- 1176. - toList: function(num) {
- 1177. - nav.change({'0':'al_friends.php', section:'list' + num});
- 1178. - scrollToTop(0);
- 1179. - return false;
- 1180. - },
- 1181. -
- 1182. - /*ddShowSearchActs: function(obj, ev, uid) {
- 1183. - var elems = [];
- 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>');
- 1185. - Friends.ddShowCustom(obj, ev, elems, uid);
- 1186. - },*/
- 1187. -
- 1188. - ttActToggle: function(obj, uid, hash, add) {
- 1189. - var back = obj.innerHTML;
- 1190. - ajax.post('al_friends.php', {act: add ? 'add' : 'remove', mid: uid, hash: hash, from: 'friends'}, {
- 1191. - onDone: function(text) {
- 1192. - //re(obj);
- 1193. - cur['friends_info'+uid] = add;
- 1194. - showDoneBox('<div class="friends_done">'+text+'</div>')
- 1195. - tooltips.destroyAll();
- 1196. - //ge('friends_tt_cont_'+uid).tt.close();
- 1197. - },
- 1198. - showProgress: function() {
- 1199. - obj.innerHTML = '<center><img src="/images/upload.gif" /></center>';
- 1200. - },
- 1201. - hideProgress: function() {
- 1202. - obj.innerHTML = back;
- 1203. - }
- 1204. - })
- 1205. - },
- 1206. -
- 1207. - ttActGift: function(uid) {
- 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);
- 1209. - },
- 1210. -
- 1211. - ttActsMenu: function(obj, ev, uid, hash) {
- 1212. - if (obj.tt) {
- 1213. - if (!obj.tt.show) return;
- 1214. - return obj.tt.show();
- 1215. - }
- 1216. - if (window.tooltips) {
- 1217. - tooltips.hideAll();
- 1218. - }
- 1219. - var info = cur['friends_info'+uid] || '';
- 1220. - var html = ['<div class="friends_tt_menu">'];
- 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>');
- 1222. - if (info) {
- 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>');
- 1224. - } else if (!cur.friends[uid]) {
- 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>');
- 1226. - }
- 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>');
- 1228. - html.push('</div>');
- 1229. - showTooltip(obj, {
- 1230. - text: html.join(''),
- 1231. - className: 'friends_tt wall_tt',
- 1232. - shift: [0, 0, -2],
- 1233. - forcetodown: 1,
- 1234. - hasover: 1,
- 1235. - center: 1
- 1236. - });
- 1237. - },
- 1238. -
- 1239. - ddShow: function(uid, obj, ev) {
- 1240. - if (cur.silent) {
- 1241. - cur.onSilentLoad = function() {
- 1242. - Friends.ddShow(uid, obj, ev);
- 1243. - };
- 1244. - return;
- 1245. - }
- 1246. -
- 1247. - var friend = cur.friends[parseInt(uid)];
- 1248. - var cats = parseInt(friend[6]);
- 1249. -
- 1250. - var elems = [];
- 1251. -
- 1252. - var publicLists = [28, 29, 27, 25, 26];
- 1253. - for (var j = 0, i; j < 5; ++j) {
- 1254. - i = publicLists[j];
- 1255. - if (cur.publicLists[i]) {
- 1256. - elems.push('<a class="friends_dd_item'+((cats & (1 << parseInt(i))) ? ' checked' : '')+'" onclick="Friends.checkCat(this, '+uid+', '+i+');">'+cur.publicLists[i]+'</a>');
- 1257. - }
- 1258. - }
- 1259. - for (var i in cur.userLists) {
- 1260. - if (i < 25) {
- 1261. - var lname = cur.userLists[i];
- 1262. - if (lname.length > 20) {
- 1263. - lname = trim(lname.substr(0, 18))+'...';
- 1264. - }
- 1265. - elems.push('<a class="friends_dd_item'+((cats & (1 << parseInt(i))) ? ' checked' : '')+'" onclick="Friends.checkCat(this, '+uid+', '+i+');">'+lname+'</a>');
- 1266. - }
- 1267. - }
- 1268. - Friends.ddShowCustom(obj, ev, elems, uid);
- 1269. - },
- 1270. -
- 1271. - ddShowCustom: function(obj, event, elems, ddId) {
- 1272. - var text = obj.innerHTML;
- 1273. - var pos = getXY(obj);
- 1274. - var height = window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight);
- 1275. - var posY = pos[1] - scrollGetY();
- 1276. - var ddHeight = elems.length * 22;
- 1277. -
- 1278. - var params = {
- 1279. - className: 'lists_menu'
- 1280. - }
- 1281. -
- 1282. - var styleAdd = '';
- 1283. - var headerAdd = '';
- 1284. -
- 1285. - if (posY > (height / 2) && (height - posY) < ddHeight) {
- 1286. - headerAdd = ' friends_header_up';
- 1287. - elems = elems.reverse();
- 1288. - styleAdd = ' style="margin-top: -'+(ddHeight + 1)+'px;"';
- 1289. - }
- 1290. -
- 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">'];
- 1292. -
- 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>';
- 1294. -
- 1295. - params.innerHTML = htmlH.join('') + elems.join('') + htmlF;
- 1296. -
- 1297. - var dd = ce('div', params);
- 1298. -
- 1299. - obj.parentNode.insertBefore(dd, obj);
- 1300. - cur.onMouseClick = function(ev) {
- 1301. - var menuId = 'friends_dd_menu_'+ddId;
- 1302. - var obj = ev.target;
- 1303. - while (obj) {
- 1304. - if (hasClass(obj, 'lists_select') || obj.id == menuId) {
- 1305. - return false;
- 1306. - }
- 1307. - obj = obj.parentNode;
- 1308. - }
- 1309. - if (ev.target)
- 1310. - Friends.ddHide(ge(menuId), ddId, 1);
- 1311. - }
- 1312. - },
- 1313. -
- 1314. - ddHide: function(obj, ddId, fast) {
- 1315. - cur.timeouts['dd_fade'+ddId] = setTimeout(function() {
- 1316. - fadeOut(obj, fast ? 0 : 100, function() {
- 1317. - var parentEl = obj.parentNode.parentNode;
- 1318. - if (parentEl) {
- 1319. - parentEl.removeChild(obj.parentNode);
- 1320. - }
- 1321. - });
- 1322. - }, fast ? 0 : 600);
- 1323. - },
- 1324. - ddActive: function(obj, ddId) {
- 1325. - if (cur.timeouts['dd_fade'+ddId]) {
- 1326. - clearTimeout(cur.timeouts['dd_fade'+ddId]);
- 1327. - }
- 1328. - },
- 1329. - checkCat: function(obj, uid, listId, from) {
- 1330. - if (from == 1) {
- 1331. - var checked = isChecked(obj);
- 1332. - } else {
- 1333. - var checked = hasClass(obj, 'checked');
- 1334. - var lists = ge('lists' + uid);
- 1335. - }
- 1336. - var friend = cur.friends[uid];
- 1337. - if (!friend) {
- 1338. - return false;
- 1339. - }
- 1340. - friend[6] = parseInt(friend[6]);
- 1341. - if (checked) {
- 1342. - if (friend[6] & (1 << listId)) {
- 1343. - friend[6] -= (1 << listId);
- 1344. - }
- 1345. - if (lists) {
- 1346. - lists.innerHTML = Friends.getLists(friend[6]);
- 1347. - }
- 1348. - } else {
- 1349. - if (!(friend[6] & (1 << listId))) {
- 1350. - friend[6] += (1 << listId);
- 1351. - }
- 1352. - if (lists) {
- 1353. - lists.innerHTML = Friends.getLists(friend[6]);
- 1354. - }
- 1355. - }
- 1356. -
- 1357. - if (from == 1) {
- 1358. - checkbox(obj);
- 1359. - } else {
- 1360. - (checked ? removeClass : addClass)(obj, 'checked');
- 1361. - }
- 1362. - if (cur.timeouts['list'+uid]) {
- 1363. - clearTimeout(cur.timeouts['list'+uid]);
- 1364. - }
- 1365. - delete cur.friendsList['list'+listId];
- 1366. - delete cur.friendsList['list'+friend[6]]
- 1367. - cur.timeouts['list'+uid] = setTimeout(function() {
- 1368. - ajax.post('al_friends.php', {act: 'save_cats', uid: uid, cats: friend[6], hash: cur.userHash}, {
- 1369. - onDone: function(text) {
- 1370. - if (from) {
- 1371. - var info = ge('friends_added_'+uid);
- 1372. - if (!cur['fr_add_text_'+uid] && info) {
- 1373. - cur['fr_add_text_'+uid] = info.innerHTML;
- 1374. - }
- 1375. - fadeTo(info, 100, 0, function() {
- 1376. - info.innerHTML = text;
- 1377. - fadeTo(info, 100, 1);
- 1378. - });
- 1379. - clearTimeout(cur['fr_add_timeout_'+uid]);
- 1380. - cur['fr_add_timeout_'+uid] = setTimeout(function() {
- 1381. - fadeTo(info, 100, 0, function() {
- 1382. - info.innerHTML = cur['fr_add_text_'+uid];
- 1383. - fadeTo(info, 100, 1);
- 1384. - });
- 1385. - }, 2000);
- 1386. - }
- 1387. - }
- 1388. - });
- 1389. - });
- 1390. - },
- 1391. - getLists: function(cats) {
- 1392. - var info = [];
- 1393. - for (var i = 29; i >= 25; i--) {
- 1394. - if ((1 << i) & cats && cur.publicLists[i]) {
- 1395. - info.push('<span class="group', (i - 1) % 8 + 1, ' fl_l" onmousedown="Friends.toList(', i, ');">', cur.publicLists[i], '</span>');
- 1396. - }
- 1397. - }
- 1398. - if (vk.id == cur.oid) {
- 1399. - for (var i in cur.userLists) {
- 1400. - if ((1 << i) & cats && !cur.publicLists[i] && cur.userLists[i]) {
- 1401. - info.push('<span class="group', (i - 1) % 8 + 1, ' fl_l" onmousedown="Friends.toList(', i, ');">', cur.userLists[i], '</span>');
- 1402. - }
- 1403. - }
- 1404. - }
- 1405. - return info.join('');
- 1406. - },
- 1407. - subscribeAllRequests: function(obj, hash) {
- 1408. - ajax.post('al_friends.php', {act: 'subscribe_all_requests', hash: hash, once: 1}, {
- 1409. - showProgress: lockButton.pbind(obj),
- 1410. - hideProgress: unlockButton.pbind(obj)
- 1411. - });
- 1412. - },
- 1413. - onAllRequestsRemove: function() {
- 1414. - return nav.go('/friends?section=all_requests', false, {nocur: true});
- 1415. - },
- 1416. - editList: function(listId) {
- 1417. - var checked = [];
- 1418. - if (listId == -1) {
- 1419. - listId = intval(cur.curList.substr(4));
- 1420. - }
- 1421. - if (listId) {
- 1422. - var list = Friends.filter(cur.friendsList['all'], cur.curList);
- 1423. - var len = list.length;
- 1424. - while (len--) {
- 1425. - checked.push(list[len][0]);
- 1426. - }
- 1427. - } else {
- 1428. - listId = 0;
- 1429. - }
- 1430. - showTabbedBox('al_friends.php', {
- 1431. - act: 'select_friends_box',
- 1432. - Checked: checked.join(','),
- 1433. - from: 'list',
- 1434. - list_name: (listId ? cur.userLists[listId] : ''),
- 1435. - list_id: listId
- 1436. - }, {
- 1437. - stat: ['privacy.js', 'ui_controls.js', 'ui_controls.css'],
- 1438. - cache: 1,
- 1439. - onFail: function(text) {
- 1440. - setTimeout(showFastBox(getLang('global_error'), text).hide, 3000);
- 1441. - return true;
- 1442. - }
- 1443. - });
- 1444. - cur.onFlistSave = function (ids, list, hash, title) {
- 1445. - var friendsList = [];
- 1446. - for (var i in list) {
- 1447. - friendsList.push(parseInt(i));
- 1448. - }
- 1449. -
- 1450. - ajax.post('al_friends.php', {act: 'save_list', title: title, cat_id: listId, Friends: friendsList.join(','), hash: hash}, {
- 1451. - onDone: function(id, title) {
- 1452. - Friends.editListClient(listId, id, title, friendsList);
- 1453. - },
- 1454. - onFail: function(text) {
- 1455. - setTimeout(showFastBox({title: getLang('global_error')}, text, getLang('global_close')).hide, 4000);
- 1456. - return true;
- 1457. - }
- 1458. - });
- 1459. -
- 1460. - Friends.clearFilter();
- 1461. -
- 1462. - return false;
- 1463. - };
- 1464. -
- 1465. - },
- 1466. - editListClient: function(listId, id, title, friendsList) {
- 1467. - var listName = 'list' + id;
- 1468. - if (listId == 0) {
- 1469. - var html = '<a onmousedown="return nav.change({\'0\':\'al_friends.php\', section:\'list'+id+'\'});" id="section_list'+id+'" class="side_filter">'+title+'</a>';
- 1470. - ge('sections_block').insertBefore(ce('div', {
- 1471. - innerHTML: html
- 1472. - }), ge('friends_create_list'));
- 1473. - var len = friendsList.length;
- 1474. - var mask = 1 << parseInt(id);
- 1475. - cur.friendsList[listName] = [];
- 1476. - while (len--) {
- 1477. - var friend = cur.friends[friendsList[len]];
- 1478. - friend[6] = parseInt(friend[6]);
- 1479. -
- 1480. - if (!(friend[6] & mask)) {
- 1481. - friend[6] += mask;
- 1482. - cur.friendsList[listName].push(friend)
- 1483. - }
- 1484. - }
- 1485. - cur.userLists[id] = title;
- 1486. - //Friends.indexAll();
- 1487. - Friends.indexAll();
- 1488. - removeClass(ge('main_class'), 'no_lists');
- 1489. - return nav.change({'0':'friends', section: listName});
- 1490. - } else {
- 1491. - if (id < 25) {
- 1492. - ge('section_list'+id).innerHTML = title;
- 1493. - cur.userLists[id] = title;
- 1494. - }
- 1495. - var mask = (1 << id);
- 1496. - cur.friendsList[listName] = [];
- 1497. - for (var i in cur.friends) {
- 1498. - var friend = cur.friends[i];
- 1499. - var inList = (friendsList.indexOf(parseInt(friend[0])) != -1);
- 1500. - if (inList) {
- 1501. - cur.friendsList[listName].push(friend);
- 1502. - }
- 1503. - friend[6] = parseInt(friend[6]);
- 1504. - if (friend[6] & mask) {
- 1505. - if (!inList) {
- 1506. - friend[6] -= mask;
- 1507. - }
- 1508. - } else {
- 1509. - if (inList) {
- 1510. - friend[6] += mask;
- 1511. - }
- 1512. - }
- 1513. - }
- 1514. - Friends.indexAll();
- 1515. - return Friends.section(listName, function() {
- 1516. - Friends.changeSummary();
- 1517. - nav.setLoc({'0':'friends', section: listName});
- 1518. - });
- 1519. - }
- 1520. - },
- 1521. - createList: function(event) {
- 1522. - Friends.editList(0);
- 1523. - },
- 1524. - deleteList: function(listId) {
- 1525. - showBox('al_friends.php', {act: 'delete_list_box', list_id: listId});
- 1526. - },
- 1527. - deleteListClient: function(listId) {
- 1528. - var listSection = ge('section_list'+listId);
- 1529. - listSection.parentNode.removeChild(listSection);
- 1530. - var mask = (1 << listId);
- 1531. - for (var i in cur.friends) {
- 1532. - if (cur.friends[i][6] & mask) {
- 1533. - cur.friends[i][6] -= mask;
- 1534. - }
- 1535. - }
- 1536. - delete cur.userLists[listId];
- 1537. - var listsCount = 0;
- 1538. - for (var i in cur.userLists) listsCount++;
- 1539. - if (!listsCount) {
- 1540. - addClass(ge('main_class'), 'no_lists');
- 1541. - }
- 1542. - //Friends.indexAll();
- 1543. - return nav.change({'0':'friends', section:'all'});
- 1544. - },
- 1545. - searchForFriends: function() {
- 1546. - showBox('al_friends.php', {act: 'search'}, {stat: ['friends_search.js', 'friends_search.css'], dark: 1});
- 1547. - },
- 1548. - selectList: function(obj, id, event) {
- 1549. - Friends.ddShow(id, obj, event);
- 1550. - },
- 1551. - _animDelX: function(color, new_active, post) {
- 1552. - if (post === undefined) {
- 1553. - post = new_active;
- 1554. - new_active = undefined;
- 1555. - }
- 1556. - var el = ge('delete_row' + post);
- 1557. - if (!el) return;
- 1558. - if (new_active !== undefined) {
- 1559. - el.active = new_active;
- 1560. - } else if (el.active) {
- 1561. - return;
- 1562. - }
- 1563. - animate(el, {backgroundColor: color}, 200);
- 1564. - },
- 1565. - hideSuggestion: function(mid, hash, el) {
- 1566. - var controls = ge('request_controls_'+mid);
- 1567. - var controlsCont = controls.parentNode;
- 1568. - (el || controls).innerHTML = '<div align="center"><img src="/images/upload.gif"></div>';
- 1569. - ajax.post('al_friends.php', {act: 'hide_suggestion', mid: mid, hash: hash, report_spam: 1}, {onDone: function(text) {
- 1570. - controls.innerHTML = text;
- 1571. - cur.suggCount -= 1;
- 1572. - }, onFail: function(text) {
- 1573. - if (!text) return;
- 1574. -
- 1575. - showFastBox(getLang('global_error'), text);
- 1576. - return true;
- 1577. - }});
- 1578. - Friends.processRequest(mid, false, true);
- 1579. -
- 1580. - },
- 1581. - addRecommend: function(mid, uid, hash, obj) {
- 1582. - obj = obj.parentNode;
- 1583. - obj.innerHTML = '<img src="/images/upload.gif" />';
- 1584. - ajax.post('al_friends.php', {
- 1585. - act: 'a_suggest_friends',
- 1586. - mid: mid,
- 1587. - uids: uid,
- 1588. - hash: hash,
- 1589. - from: 'add'
- 1590. - }, {
- 1591. - onDone: function(text) {
- 1592. - obj.innerHTML = text;
- 1593. - },
- 1594. - onFail: function(text) {
- 1595. - obj.innerHTML = text;
- 1596. - }
- 1597. - })
- 1598. -
- 1599. - },
- 1600. - suggestBox: function(mid) {
- 1601. - var box = showBox('al_friends.php', {
- 1602. - act: 'select_friends_box',
- 1603. - from: 'suggest_friends',
- 1604. - friend_id: mid
- 1605. - }, {stat: ['privacy.js', 'privacy.css', 'indexer.js', 'profile.css']});
- 1606. - box.leaveOnSave = true;
- 1607. - cur.onFlistSave = function(ids, list, hash) {
- 1608. - //if (!ids || !ids.length) return;
- 1609. - ajax.post('al_friends.php', {
- 1610. - act: 'a_suggest_friends',
- 1611. - mid: mid,
- 1612. - ids: ids.join(','),
- 1613. - hash: hash
- 1614. - }, {
- 1615. - onDone: function(text) {
- 1616. - box.hide();
- 1617. - showDoneBox(text);
- 1618. - },
- 1619. - showProgress: box.showProgress,
- 1620. - hideProgress: box.hideProgress
- 1621. - });
- 1622. - }
- 1623. - },
- 1624. - getAgeFromData: function(max, opts) {
- 1625. - max = parseInt(max);
- 1626. - if (!max > 0) max = opts.ageTo;
- 1627. - return Friends.getRangeData(opts.ageFrom, max, 1, opts.langAgeFrom+' ', opts.langAgeFromEmpty);
- 1628. - },
- 1629. - getAgeToData: function(min, opts) {
- 1630. - min = parseInt(min);
- 1631. - if (!min > 0) min = opts.ageFrom;
- 1632. - return Friends.getRangeData(min, opts.ageTo, 1, opts.langAgeTo+' ', opts.langAgeToEmpty);
- 1633. - },
- 1634. - getRangeData: function(min, max, step, prefix, label) {
- 1635. - if (min > max) return false;
- 1636. - var ret = [[0, label]];
- 1637. - if (step < 0) {
- 1638. - for (var i = max; i >= min; i += step)
- 1639. - ret.push([i, prefix + i]);
- 1640. - } else if (step > 0) {
- 1641. - for (var i = min; i <= max; i += step)
- 1642. - ret.push([i, prefix + i]);
- 1643. - }
- 1644. - return ret;
- 1645. - },
- 1646. - radioFilter: function(el, value, fireEvent) {
- 1647. - radiobtn(el, value, 'friends_radio_sex');
- 1648. - if (fireEvent || fireEvent == undefined) {
- 1649. - Friends.changeFilter();
- 1650. - }
- 1651. - },
- 1652. - initFilters: function(opts) {
- 1653. - stManager.add(['ui_controls.js', 'ui_controls.css'], function() {
- 1654. - cur.cityFilter = new Dropdown(ge('friends_fltr_city'), opts.cities, {
- 1655. - width: 150,
- 1656. - zeroPlaceholder: true,
- 1657. - placeholder: opts.citiesPl,
- 1658. - placeholderColor: '#777',
- 1659. - //selectedItems: '{$school_year}',
- 1660. - onChange: Friends.changeFilter,
- 1661. - onShow: function() {
- 1662. - if (cur.silent) {
- 1663. - cur.cityFilterOpened = true;
- 1664. - show('friends_fltr_progress');
- 1665. - }
- 1666. - }
- 1667. - });
- 1668. -
- 1669. - cur.ageFromFilter = new Dropdown(ge('friends_age_from'), Friends.getAgeFromData(opts.ageTo, opts), {
- 1670. - zeroPlaceholder: true,
- 1671. - placeholderColor: '#777',
- 1672. - width: 70,
- 1673. - onChange: function(value){
- 1674. - cur.ageToFilter.setData(Friends.getAgeToData(value, opts));
- 1675. - Friends.changeFilter();
- 1676. - }
- 1677. - });
- 1678. -
- 1679. - cur.ageToFilter = new Dropdown(ge('friends_age_to'), Friends.getAgeToData(opts.ageFrom, opts), {
- 1680. - zeroPlaceholder: true,
- 1681. - placeholderColor: '#777',
- 1682. - width: 70,
- 1683. - onChange: function(value){
- 1684. - cur.ageFromFilter.setData(Friends.getAgeFromData(value, opts));
- 1685. - Friends.changeFilter();
- 1686. - }
- 1687. - });
- 1688. -
- 1689. - window.radioBtns['friends_radio_sex'] = {
- 1690. - els: Array.prototype.slice.apply(geByClass('radiobtn', ge('friends_radio_sex'))),
- 1691. - val: 0
- 1692. - }
- 1693. - });
- 1694. - },
- 1695. - clearFilter: function(fireEvent) {
- 1696. - if (!cur.cityFilter) return;
- 1697. - cur.cityFilter.selectItem(0, false);
- 1698. - cur.ageFromFilter.selectItem(0, false);
- 1699. - cur.ageToFilter.selectItem(0, false);
- 1700. - Friends.radioFilter(ge('friends_radio_any'), 0, false);
- 1701. - cur.filterIds = false;
- 1702. - cur.filter = false;
- 1703. - if (fireEvent) {
- 1704. - Friends.changeFilter();
- 1705. - }
- 1706. - },
- 1707. - filterParams: function() {
- 1708. - var p = {
- 1709. - city: parseInt(cur.cityFilter.val()),
- 1710. - sex: parseInt(radioBtns['friends_radio_sex'].val),
- 1711. - age_from: parseInt(cur.ageFromFilter.val()),
- 1712. - age_to: parseInt(cur.ageToFilter.val())
- 1713. - }
- 1714. - if (p.city || p.sex || p.age_from || p.age_to) {
- 1715. - return p;
- 1716. - } else {
- 1717. - return false;
- 1718. - }
- 1719. - },
- 1720. - changeFilter: function() {
- 1721. - if (cur.silent) {
- 1722. - cur.onSilentLoad = function() {
- 1723. - Friends.changeFilter();
- 1724. - };
- 1725. - hide(cur.showMore);
- 1726. - cur.fContent.innerHTML = '<div class="wide_loading"></div>';
- 1727. - return;
- 1728. - }
- 1729. - cur.filter = Friends.filterParams();
- 1730. - if (cur.filter) {
- 1731. - ajax.post('friends', extend({act: 'filter_friends', uid: cur.oid}, cur.filter), {
- 1732. - onDone: function(ids) {
- 1733. - cur.filterIds = {};
- 1734. - for (var i in ids) {
- 1735. - cur.filterIds[ids[i]] = 1;
- 1736. - }
- 1737. - for (var i in cur.friendsList) {
- 1738. - if (i.split('_').pop() == 'filter') {
- 1739. - delete cur.friendsList[i];
- 1740. - }
- 1741. - }
- 1742. - Friends.search(cur.searchStr || -1, cur.section, false, true);
- 1743. - Friends.changeSummary();
- 1744. - },
- 1745. - progress: 'friends_fltr_progress',
- 1746. - cache: 1
- 1747. - })
- 1748. - } else {
- 1749. - if (cur.filterIds) {
- 1750. - cur.filterIds = false;
- 1751. - }
- 1752. - Friends.updateList();
- 1753. - }
- 1754. - },
- 1755. -
- 1756. - bigphOver: function(obj, uid) {
- 1757. - if (!window.lang || !lang.global_photo_full_size || browser.mobile) return;
- 1758. - var o = obj.firstChild, ch = cur.bigphCache[uid];
- 1759. - if (o.tagName != 'A' || o.className != 'friends_bigph') {
- 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);
- 1761. - o._uid = uid;
- 1762. - }
- 1763. -
- 1764. - clearTimeout(o.hideTO);
- 1765. - animate(o, {marginTop: 75}, {duration: 200, transition: Fx.Transitions.easeOutCirc});
- 1766. - cur.bigphShown[uid] = o;
- 1767. -
- 1768. - if (ch === undefined) {
- 1769. - cur.bigphCache[uid] = 'load';
- 1770. - ajax.post('al_photos.php', {act: 'fast_get_photo', oid: uid}, {onDone: function(res) {
- 1771. - if (!res) {
- 1772. - obj.onmouseover = function() {};
- 1773. - re(obj.firstChild);
- 1774. - return;
- 1775. - }
- 1776. - var sh = (cur.bigphCache[uid] == 'show');
- 1777. - cur.bigphCache[uid] = res;
- 1778. - o.href = '/photo' + res._id + '?all=1';
- 1779. - if (sh) Friends.bigphClick(uid);
- 1780. - }, onFail: function() {
- 1781. - obj.onmouseover = function() {};
- 1782. - re(obj.firstChild);
- 1783. - return true;
- 1784. - }});
- 1785. - }
- 1786. -
- 1787. - if (!obj.onmouseout) obj.onmouseout = Friends.bigphOut.pbind(obj);
- 1788. - },
- 1789. - bigphOut: function(obj) {
- 1790. - var o = obj.firstChild;
- 1791. - if (!o || o.tagName != 'A' || o.className != 'friends_bigph') return;
- 1792. -
- 1793. - clearTimeout(o.hideTO);
- 1794. - o.hideTO = setTimeout(function() {
- 1795. - animate(o, {marginTop: 100}, 200);
- 1796. - delete(cur.bigphShown[o._uid]);
- 1797. - }, 150);
- 1798. - },
- 1799. - bigphClick: function(uid, ev) {
- 1800. - if (checkEvent(ev) !== false) return;
- 1801. -
- 1802. - var ch = cur.bigphCache[uid];
- 1803. - if (ch == 'load' || ch == 'show') {
- 1804. - cur.bigphCache[uid] = 'show';
- 1805. - return cancelEvent(ev);
- 1806. - }
- 1807. - if (!ch) return;
- 1808. - return showPhoto(ch._id, 'album' + uid + '_0/rev', extend({jumpTo: {z: 'albums' + uid}}, ch), ev);
- 1809. - },
- 1810. - inviteClick: function(obj, ev) {
- 1811. - if (checkEvent(ev)) {
- 1812. - return true;
- 1813. - }
- 1814. - nav.go('/invite', false, {
- 1815. - showProgress: function() {
- 1816. - cur.invBack = obj.innerHTML;
- 1817. - obj.innerHTML = '<div class=progress_inline></div>'},
- 1818. - hideProgress: function() {
- 1819. - obj.innerHTML = cur.invBack;
- 1820. - }
- 1821. - });
- 1822. - return cancelEvent(ev);
- 1823. - },
- 1824. - findAdd: function(mid, hash, el) {
- 1825. - ajax.post('al_friends.php', {act: 'add', mid: mid, hash: hash, request: 1, 'short_resp' : 1}, {onDone: function(text) {
- 1826. - var cont = el.parentNode.parentNode;
- 1827. - cont.innerHTML = '<div class="friends_imp_status" style="display: none;">'+text+'</div>';
- 1828. - fadeIn(cont.firstChild, 200);
- 1829. - }, onFail: function(text) {
- 1830. - if (!text) return;
- 1831. - showFastBox(getLang('global_error'), text);
- 1832. - return true;
- 1833. - }, showProgress: lockButton.pbind(el), hideProgress: unlockButton.pbind(el)});
- 1834. - }
- 1835. - }
- 1836. -
- 1837. - extend(Friends, {
- 1838. - rowOver: Friends._animDelX.pbind('#C4D2E1'),
- 1839. - rowOut: Friends._animDelX.pbind('#FFF'),
- 1840. - activeDeleteRow: function(post, tt) {
- 1841. - Friends._animDelX('#6B8DB1', 1, post);
- 1842. - if (tt) showTooltip(ge('delete_row' + post), {text: tt, showdt: 500, black: 1});
- 1843. - },
- 1844. - deactiveDeleteRow: Friends._animDelX.pbind('#C4D2E1', 0),
- 1845. - deleteRow: function(row, hash) {
- 1846. - rowInfo = row.split('_');
- 1847. - var obj = ge('suggestion'+row);
- 1848. - if (hasClass(obj, 'user_block_first')) {
- 1849. - nobj = obj.nextSibling;
- 1850. - while (nobj && !isVisible(nobj)) {
- 1851. - nobj = nobj.nextSibling;
- 1852. - }
- 1853. - if (nobj) {
- 1854. - if (nobj.id == 'friends_sub_summary') {
- 1855. - var summ = nobj.childNodes[0].innerHTML;
- 1856. - ge('friends_summary').innerHTML = summ;
- 1857. - re(nobj);
- 1858. - } else if (nobj.className) {
- 1859. - addClass(nobj, 'user_block_first')
- 1860. - }
- 1861. - }
- 1862. - }
- 1863. - slideUp('suggestion' + row, 100);
- 1864. - if (tooltips) {
- 1865. - tooltips.hide(ge('delete_row' + row))
- 1866. - }
- 1867. - ajax.post('al_friends.php', {act: 'hide_possible', mid: rowInfo[1], hash: hash}, {onDone: function() {
- 1868. - }});
- 1869. - cur.importCount -= 1;
- 1870. - }
- 1871. - });
- 1872. -
- 1873. - try{stManager.done('friends.js');}catch(e){}
- ------
- Файл - friends.css (Старый размер - 18264 | Новый - 0):
- 0. - #friends_css {
- 1. - display: none;
- 2. - }
- 3. - .friends_add_block {
- 4. - padding: 0px 0px 8px 14px;
- 5. - width: 260px;
- 6. - }
- 7. - .friends_add_block .checkbox {
- 8. - margin-top: 3px;
- 9. - margin-bottom: 6px;
- 10. - }
- 11. - .friends_add_image {
- 12. - padding-top: 3px;
- 13. - }
- 14. - #friends .search {
- 15. - background: #f7f7f7;
- 16. - padding: 10px;
- 17. - border-bottom: 1px solid #dae1e8;
- 18. - }
- 19. - #friends_req_tabs {
- 20. - background: #F7F7F7;
- 21. - border-bottom: 1px solid #dae1e8;
- 22. - display: none;
- 23. - }
- 24. - #friends #s_search {
- 25. - width: 545px;
- 26. - background: #FFF url(/images/magglass.png) no-repeat 5px 6px;
- 27. - outline: none;
- 28. - padding: 5px 40px 6px 20px;
- 29. - }
- 30. - .is_rtl1 #friends #s_search {
- 31. - padding: 5px 20px 6px 40px;
- 32. - background: #FFF url(/images/magglass.png) no-repeat 328px 6px;
- 33. - }
- 34. - #friends #s_search.s_search_inv {
- 35. - width: 284px;
- 36. - }
- 37. - #friends #s_search::-ms-clear {
- 38. - display: none;
- 39. - }
- 40. - #friends #invite_button {
- 41. - width: 134px;
- 42. - }
- 43. - #friends td {
- 44. - vertical-align: top;
- 45. - }
- 46. - #friends .main_panel {
- 47. - border-right: 1px solid #D9E1E7;
- 48. - width: 447px;
- 49. - padding: 5px 15px 6px 15px;
- 50. - }
- 51. - #friends .wide .main_panel {
- 52. - border-right: none;
- 53. - width: 608px;
- 54. - }
- 55. - #friends .wide a.more {
- 56. - width: 598px;
- 57. - }
- 58. - #friends a.more {
- 59. - display: block;
- 60. - padding: 8px 0px;
- 61. - text-align: center;
- 62. - margin: 8px 0px 10px 0px;
- 63. - }
- 64. - #friends a.more:hover {
- 65. - text-decoration: none;
- 66. - background: #E9EDF1;
- 67. - }
- 68. - #friends .load_more {
- 69. - display: block;
- 70. - width: 426px;
- 71. - height: 31px;
- 72. - background: url('/images/upload.gif') center center no-repeat;
- 73. - }
- 74. - #friends .load_more a.more {
- 75. - display: none;
- 76. - }
- 77. - #friends .info_msg {
- 78. - font-size: 1.2em;
- 79. - background: #FFFFFF;
- 80. - border: none;
- 81. - padding: 130px 10px;
- 82. - margin: 15px 5px;
- 83. - text-align: center;
- 84. - color: #777777;
- 85. - max-width: 395px;
- 86. - word-wrap: break-word;
- 87. - overflow: hidden;
- 88. - text-overflow: ellipsis;
- 89. - }
- 90. - #friends .info_msg .by_search {
- 91. - display: none;
- 92. - }
- 93. - #friends .f_search .by_search {
- 94. - display: block;
- 95. - }
- 96. - #friends .f_search .empty {
- 97. - display: none;
- 98. - }
- 99. -
- 100. - /* User block */
- 101. - #friends .user_block {
- 102. - border-top: 1px solid #ededed;
- 103. - padding: 10px 0px;
- 104. - clear: both;
- 105. - }
- 106. - #friends .user_block_first {
- 107. - border-top: none;
- 108. - }
- 109. - #friends .user_block .img {
- 110. - width: 100px;
- 111. - height: 100px;
- 112. - display: block;
- 113. - overflow: hidden;
- 114. - }
- 115. - #friends .user_block .info, #friends .user_block .info_no_actions {
- 116. - width: 182px;
- 117. - padding-top: 4px;
- 118. - padding-left: 14px;
- 119. - overflow: hidden;
- 120. - }
- 121. - .font_medium #friends .user_block .info {
- 122. - width: 172px;
- 123. - }
- 124. - #friends .wide .user_block .info {
- 125. - width: 352px;
- 126. - }
- 127. - #friends .wide .user_block .info_no_actions {
- 128. - width: 475px;
- 129. - }
- 130. - #friends .user_block .online {
- 131. - color: #BBBBBB;
- 132. - padding: 0px 0px 5px 0px;
- 133. - }
- 134. - .is_rtl1 #friends .user_block .online {
- 135. - color: #BBBBBB;
- 136. - padding: 0px 0px 5px 0px;
- 137. - }
- 138. - #friends .user_block .phones {
- 139. - color: #000000;
- 140. - padding-top: 1px;
- 141. - }
- 142. - #friends .user_block .actions {
- 143. - width: 126px;
- 144. - height: 100px;
- 145. - display: block;
- 146. - background: #FFFFFF;
- 147. - }
- 148. - .font_medium #friends .user_block .actions {
- 149. - width: 140px;
- 150. - }
- 151. - #friends .wide .user_block .actions {
- 152. - width: 130px;
- 153. - }
- 154. - .friends_act {
- 155. - display: block;
- 156. - padding: 4px 6px 4px 6px;
- 157. - }
- 158. - .friends_act:hover {
- 159. - background: #E1E7ED;
- 160. - text-decoration: none;
- 161. - }
- 162. - .friends_field {
- 163. - padding-bottom: 5px;
- 164. - }
- 165. - #friends .user_block .lists {
- 166. - padding-top: 0px;
- 167. - }
- 168. - #friends .user_block .common_friends a {
- 169. - margin-right: 4px;
- 170. - }
- 171. - #friends .user_block .info em, #friends .user_block .info_no_actions em {
- 172. - font-style: normal;
- 173. - background: #E1E7ED;
- 174. - border-bottom: 1px solid #DAE1E8;
- 175. - padding: 0px 1px 0px;
- 176. - margin: 0px -1px;
- 177. - *padding: 0px;
- 178. - *margin: 0px;
- 179. - }
- 180. - #friends .wide_loading {
- 181. - background: url('/images/progress7.gif') center center no-repeat;
- 182. - height: 300px;
- 183. - }
- 184. -
- 185. -
- 186. - /* Requests */
- 187. - #friends .common .img {
- 188. - width: 100px;
- 189. - height: 100px;
- 190. - display: block;
- 191. - }
- 192. - #friends .common .info, #friends .common .info_no_actions {
- 193. - width: 290px;
- 194. - }
- 195. - #friends.friends_find_list .info_no_actions {
- 196. - width: 400px;
- 197. - }
- 198. - #friends .request .info, #friends .request .info_no_actions {
- 199. - width: 290px;
- 200. - }
- 201. - #friends .common .controls {
- 202. - padding: 7px 0px 4px 0px;
- 203. - width: 295px;
- 204. - margin-left: 0px;
- 205. - }
- 206. - #friends .wide .common .controls {
- 207. - width: 425px;
- 208. - }
- 209. - #friends .common .info a.deny_request, #friends .common .info_no_actions a.deny_request {
- 210. - display: block;
- 211. - padding: 6px 10px 0px;
- 212. - margin: 0px 0px 0px 5px;
- 213. - font-weight: normal;
- 214. - height: 20px;
- 215. - text-align: center;
- 216. - display: none;
- 217. - }
- 218. - #friends .common .info a.deny_request:hover, #friends .common .info_no_actions a.deny_request:hover {
- 219. - background: #E1E7ED;
- 220. - text-decoration: none;
- 221. - }
- 222. - #friends .common .box_msg {
- 223. - background-color: #F7F7F7;
- 224. - border: 1px solid #CCC;
- 225. - font-weight: normal;
- 226. - margin: 0px;
- 227. - padding: 5px 11px;
- 228. - width: 225px;
- 229. - }
- 230. - #friends .common .box_msg .passive {
- 231. - color: #777777;
- 232. - }
- 233. - #friends .common .common_friends_label {
- 234. - margin-left: 0px;
- 235. - color: #777;
- 236. - }
- 237. - #friends .common .common_friends {
- 238. - padding-top: 6px;
- 239. - margin-left: 0px;
- 240. - color: #777;
- 241. - }
- 242. - #friends .common .labeled {
- 243. - width: 250px;
- 244. - }
- 245. - #friends .request .info a.deny_request, #friends .request .info_no_actions a.deny_request {
- 246. - display: block;
- 247. - }
- 248. -
- 249. - /* Filters block */
- 250. - #friends .side_panel {
- 251. - width: 150px;
- 252. - background-color: #F7F7F7;
- 253. - padding: 10px;
- 254. - }
- 255. - #friends .wide .side_panel {
- 256. - display: none;
- 257. - }
- 258. - #friends .sections_block {
- 259. - width: 150px;
- 260. - overflow: hidden;
- 261. - }
- 262. - #friends .sections_block .side_filter {
- 263. - border: none;
- 264. - color: #2B587A;
- 265. - cursor: pointer;
- 266. - display: block;
- 267. - padding: 6px 6px 7px 10px;
- 268. - background-color: #F7F7F7;
- 269. - background-repeat: no-repeat;
- 270. - background-position: 127px center;
- 271. - width: 134px;
- 272. - }
- 273. - #friends .sections_block .side_filter:hover {
- 274. - background-color: #E1E7ED;
- 275. - text-decoration: none;
- 276. - }
- 277. - #friends .sections_block .cur_section {
- 278. - color: white;
- 279. - background-color: #5e82a8;
- 280. - }
- 281. - #friends .sections_block .loading {
- 282. - background-image: url('/images/upload_inv_mini.gif');
- 283. - }
- 284. - #friends .sections_block .cur_section:hover {
- 285. - background-color: #5e82a8;
- 286. - }
- 287. - #friends .sections_block .sep {
- 288. - border-top: 1px solid #DAE1E8;
- 289. - margin-top: 6px;
- 290. - margin-bottom: 6px;
- 291. - }
- 292. - #friends .create_list {
- 293. - display: block;
- 294. - text-align: right;
- 295. - width: 200px;
- 296. - padding-top: 5px;
- 297. - }
- 298. - #friends .page_end {
- 299. - display: block;
- 300. - position: relative;
- 301. - }
- 302. -
- 303. - /* Lists */
- 304. - #friends .lists span {
- 305. - margin: 3px 4px 4px 0px;
- 306. - cursor: pointer;
- 307. - display: block;
- 308. - font-size: 1em;
- 309. - padding: 1px 5px;
- 310. - border-radius: 3px;
- 311. - -moz-border-radius: 3px;
- 312. - -webkit-border-radius: 3px;
- 313. - }
- 314. -
- 315. - /* Tabs */
- 316. -
- 317. - #friends .tabs {
- 318. - background: #FFFFFF;
- 319. - }
- 320. -
- 321. - /* for input focus at start */
- 322. - #friends .search .input_back {
- 323. - color: #C0C8D0;
- 324. - }
- 325. - .common_friends_box {
- 326. - overflow: auto;
- 327. - max-height: 380px;
- 328. - padding: 10px;
- 329. - padding-bottom: 0px;
- 330. - width: 388px;
- 331. - }
- 332. - .common_friends_box .common_row {
- 333. - border-bottom: 1px solid #dee4e8;
- 334. - margin-bottom: 5px;
- 335. - padding-bottom: 2px;
- 336. - height: 53px;
- 337. - }
- 338. - .common_friends_box .common_row:last-child {
- 339. - border-bottom: none;
- 340. - }
- 341. - .common_friends_box .common_row .common_info {
- 342. - display: block;
- 343. - float: left;
- 344. - width: 300px;
- 345. - }
- 346. - .common_friends_box .common_row .photo {
- 347. - display: block;
- 348. - width: 60px;
- 349. - float:left;
- 350. - }
- 351. - .common_friends_box .common_row b {
- 352. - color: #888888;
- 353. - font-weight: normal;
- 354. - }
- 355. -
- 356. - /*lists*/
- 357. - #friends .lists_menu {
- 358. - position: absolute;
- 359. - margin-left: -1px;
- 360. - margin-top: 0px;
- 361. - }
- 362. - #friends .lists_header {
- 363. - border: 1px solid #517295;
- 364. - cursor: pointer;
- 365. - width: 130px;
- 366. - z-index: 1500;
- 367. - position: absolute;
- 368. - }
- 369. - #friends .lists_header div {
- 370. - border-color:#7E9CBC #5C82AB #5e82a8;
- 371. - border-style:solid;
- 372. - border-width:1px;
- 373. - color:#FFFFFF;
- 374. - padding:2px 5px;
- 375. - white-space: nowrap;
- 376. - padding-right: 17px;
- 377. - line-height: 1.27em;
- 378. - *line-height: 1.18em;
- 379. - *padding-right: 16px;
- 380. - background:#5e82a8 url('/images/flydead.gif') no-repeat right -15px;
- 381. - *background-position: -14px right;
- 382. - }
- 383. - #friends .friends_header_up div {
- 384. - background: #5e82a8 url('/images/flydead.gif') no-repeat right -57px;
- 385. - }
- 386. - #friends .lists_body {
- 387. - margin-left: -32px;
- 388. - margin-top: 20px;
- 389. - z-index: 1499;
- 390. - position: absolute;
- 391. - }
- 392. - #friends .summary_wrap #result_msg {
- 393. - margin-bottom: 10px;
- 394. - color: #000;
- 395. - }
- 396. -
- 397. -
- 398. - /* dropdown */
- 399. - #friends .lists_shad_l div, #friends .lists_shad_r div {width: 1px}
- 400. - #friends .lists_shad_l {background:#000000;filter: alpha(opacity=6);opacity:0.06;overflow:hidden;width:1px;}
- 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;}
- 402. - #friends .lists_shad_b2 {filter: alpha(opacity=5);opacity:0.05;}
- 403. - #friends .lists_shad_r {background:#000000;filter: alpha(opacity=6);opacity:0.06;overflow:hidden;width:1px;}
- 404. -
- 405. - #friends .lists_rows {
- 406. - background: #FFFFFF;
- 407. - border: 1px solid #96AABE;
- 408. - margin: 0px;
- 409. - position: relative;
- 410. - z-index: 1499;
- 411. - width: 161px;
- 412. - overflow: hidden;
- 413. - }
- 414. -
- 415. - .friends_dd_item {
- 416. - display: block;
- 417. - padding: 4px 3px 0px 24px;
- 418. - height: 18px;
- 419. - }
- 420. - .friends_dd_item:hover {
- 421. - background: #EEF2F6;
- 422. - text-decoration: none;
- 423. - }
- 424. -
- 425. - .friends_dd_item.checked {
- 426. - background: url('/images/dropdead_check.gif') no-repeat 4px 3px;
- 427. - }
- 428. - .friends_dd_item.checked:hover {
- 429. - background: #EEF2F6 url('/images/dropdead_check.gif') no-repeat 4px 3px;
- 430. - }
- 431. -
- 432. - .friends_tt .tt_text,
- 433. - .tt.friends_tt .tt_text {
- 434. - padding: 4px;
- 435. - }
- 436. - .friends_tt_item {
- 437. - display: block;
- 438. - padding: 4px 12px 0px 22px;
- 439. - height: 18px;
- 440. - }
- 441. - .friends_tt_item:hover {
- 442. - background: #E1E7ED;
- 443. - text-decoration: none;
- 444. - }
- 445. - .friends_tt_menu {
- 446. - padding: 0px 0px;
- 447. - }
- 448. - .friends_online {
- 449. - color: #AAA;
- 450. - margin-left: 8px;
- 451. - }
- 452. - .friends_tt_icon {
- 453. - margin: 1px 0 0 -16px;
- 454. - width: 11px;
- 455. - height: 11px;
- 456. - background-image: url(/images/icons/mono_iconset.gif?8);
- 457. - position: absolute;
- 458. - }
- 459. - .friends_tt_msg {
- 460. - background-position: 0 -192px;
- 461. - }
- 462. - .friends_tt_add {
- 463. - background-position: 0 -15px;
- 464. - }
- 465. - .friends_tt_cancel {
- 466. - background-position: 0 -236px;
- 467. - }
- 468. - .friends_tt_gift {
- 469. - background-position: 0 -104px;
- 470. - }
- 471. -
- 472. - /*#friends .no_lists .user_block .actions a.lists_select {
- 473. - display: none;
- 474. - }
- 475. - #friends .no_lists .select_lists {
- 476. - display: none;
- 477. - }*/
- 478. - #friends .box_msg .lists_select {
- 479. - margin: 0px 5px;
- 480. - }
- 481. - #friends .no_lists .box_msg .lists_select {
- 482. - display: none;
- 483. - }
- 484. - #friends .box_msg .lists_menu {
- 485. - margin-top: -4px;
- 486. - margin-left: -1px;
- 487. - }
- 488. -
- 489. - .box_labels .label {
- 490. - color: #777;
- 491. - padding-top: 3px;
- 492. - position: absolute;
- 493. - text-align: right;
- 494. - width: 100px;
- 495. - }
- 496. - .box_labels .labeled {
- 497. - padding-left: 110px;
- 498. - width: 200px;
- 499. - }
- 500. - .box_labels .labeled input {
- 501. - width: 200px;
- 502. - }
- 503. -
- 504. - /* hide suggestions */
- 505. - #friends .delete_row {
- 506. - height: 13px;
- 507. - width: 17px;
- 508. - margin-top: -2px;
- 509. - }
- 510. - #friends .delete_row div {
- 511. - background: #FFFFFF url(/images/pics/statusx.gif) no-repeat;
- 512. - cursor: pointer;
- 513. - height: 17px;
- 514. - width: 17px;
- 515. - }
- 516. -
- 517. - .user_block .res {
- 518. - background-color: #F7F7F7;
- 519. - border: 1px solid #CCC;
- 520. - padding: 5px 11px;
- 521. - margin: 10px 0 0 10px;
- 522. - width: 315px;
- 523. - }
- 524. -
- 525. - /* Convert requests to subscribers */
- 526. - #friend_convert_sure {
- 527. - line-height: 160%;
- 528. - width: 300px;
- 529. - }
- 530. - #friend_convert_progress {
- 531. - display: none;
- 532. - padding: 15px 40px;
- 533. - line-height: 160%;
- 534. - }
- 535. - #friend_convert_bar {
- 536. - background: #FFF;
- 537. - border: 1px solid #CCC;
- 538. - margin-top: 20px;
- 539. - width: 298px;
- 540. - height: 18px;
- 541. - }
- 542. - #friend_convert_bar div {
- 543. - background: #597DA3 url(/images/progress_grad.gif) repeat;
- 544. - border: 1px solid #45688E;
- 545. - margin: -1px;
- 546. - width: 1%;
- 547. - height: 18px;
- 548. - }
- 549. - #friend_add_warn {
- 550. - padding-top: 10px;
- 551. - color: #777;
- 552. - }
- 553. - #friends_list .summary_wrap {
- 554. - padding: 6px 0px 0px;
- 555. - }
- 556. - .friends_added {
- 557. - padding-bottom: 5px;
- 558. - }
- 559. - .friends_added .checkbox{
- 560. - margin-top: 6px;
- 561. - }
- 562. - .friends_added_text {
- 563. - color: #777777;
- 564. - padding-bottom: 3px;
- 565. - line-height: 150%;
- 566. - }
- 567. - .friends_done .friends_added_text {
- 568. - color: #FFFFFF;
- 569. - padding: 0px;
- 570. - }
- 571. - .friends_go_to_search {
- 572. - text-align: center;
- 573. - padding: 10px;
- 574. - display: block;
- 575. - margin-bottom: 10px;
- 576. - border-top: 1px solid #EDEDED;
- 577. - }
- 578. - .friends_go_to_search:hover {
- 579. - text-decoration: none;
- 580. - border-top: 1px solid #DAE1E8;
- 581. - background: #E9EDF1;
- 582. - }
- 583. -
- 584. - #friends_hide_all {
- 585. - margin: 5px;
- 586. - }
- 587. - .friends_req_sended {
- 588. - line-height: 160%;
- 589. - }
- 590. - .friends_req_header {
- 591. - padding-bottom: 3px;
- 592. - }
- 593. - .friends_added_help_h {
- 594. - color: #2B587A;
- 595. - font-weight: bold;
- 596. - padding: 12px 0px 4px 0px;
- 597. - }
- 598. - .friends_added_help_rows {
- 599. - padding: 8px 0px 10px 0px;
- 600. - }
- 601. - .friends_add_help_row {
- 602. - width: 200px;
- 603. - height: 50px;
- 604. - padding: 0px 0px 0px 0px;
- 605. - margin: 5px 0px;
- 606. - }
- 607. - .friends_add_help_img {
- 608. - position: absolute;
- 609. - }
- 610. - .friends_add_help_c {
- 611. - padding: 2px 8px 2px 60px;
- 612. - }
- 613. - .friends_add_help_name {
- 614. - font-weight: bold;
- 615. - display: block;
- 616. - margin-bottom: 2px;
- 617. - }
- 618. - .friends_add_recomm_sended {
- 619. - color: #888888;
- 620. - }
- 621. -
- 622. - b.friends_mob_onl {
- 623. - background-position: -1px 0px;
- 624. - *background-position: -1px -1px;
- 625. - }
- 626. - #friends_search_cont {
- 627. - display: none;
- 628. - }
- 629. - #friends_loading {
- 630. - background: url('/images/upload.gif') center center no-repeat;
- 631. - width: 32px;
- 632. - height: 9px;
- 633. - margin: 7px 0px 0px 308px;
- 634. - z-index: 95;
- 635. - position: absolute;
- 636. - display: none;
- 637. - }
- 638. - .is_rtl1 #friends_loading {
- 639. - margin: 7px 308px 0px 0px;
- 640. - }
- 641. - #friends_reset_search {
- 642. - margin: 1px 0px 0px 320px;
- 643. - display: none;
- 644. - cursor: pointer;
- 645. - background: transparent url(/images/icons/input_clear.gif) 6px 6px no-repeat;
- 646. - padding: 2px;
- 647. - width: 19px;
- 648. - height: 19px;
- 649. - opacity: 0.6;
- 650. - filter: alpha(opacity=60);
- 651. - position: absolute;
- 652. - z-index: 95;
- 653. - }
- 654. - .is_rtl1 #friends_reset_search {
- 655. - margin: 1px 322px 0px 0px;
- 656. - }
- 657. - .friends_photos {
- 658. - width: 310px;
- 659. - padding: 12px 0px 0px;
- 660. - overflow: hidden;
- 661. - }
- 662. - .friends_user_photo {
- 663. - display: inline-block;
- 664. - *display: block;
- 665. - *zoom: 1;
- 666. - margin: 0px 5px 0px 0px;
- 667. - overflow: hidden;
- 668. - vertical-align: top;
- 669. - max-width: 70px;
- 670. - }
- 671. - .friends_search_info {
- 672. - padding-top: 2px;
- 673. - padding-left: 10px;
- 674. - width: 314px;
- 675. - }
- 676. - .friends_searchrow_info {
- 677. - height: 14px;
- 678. - color: #777;
- 679. - margin-left: 8px;
- 680. - }
- 681. - .is_rtl1 .friends_searchrow_info {
- 682. - margin: 0px 8px 0px 8px;
- 683. - }
- 684. - #friends_search_more {
- 685. - display: none;
- 686. - }
- 687. - .friends_fltr {
- 688. - padding: 0px 0px 0px 0px;
- 689. - }
- 690. - .friends_fltr_label {
- 691. - font-weight: bold;
- 692. - cursor: default;
- 693. - color: #555;
- 694. - padding-bottom: 1px;
- 695. - }
- 696. - .friends_fltr_sel {
- 697. - padding: 5px 0px 16px 0px;
- 698. - }
- 699. - .friends_fltr_field {
- 700. - width: 142px;
- 701. - height: 14px;
- 702. - }
- 703. - #friends_fltr_progress {
- 704. - width: 30px;
- 705. - height: 8px;
- 706. - background: url('/images/upload.gif') no-repeat;
- 707. - display: none;
- 708. - margin-top: 2px;
- 709. - }
- 710. - .friends_age_sep {
- 711. - line-height: 2em;
- 712. - text-align: center;
- 713. - width: 10px;
- 714. - }
- 715. - #friends_age_from,
- 716. - #friends_age_to {
- 717. - width: 62px;
- 718. - height: 14px;
- 719. - }
- 720. - .friends_fltr_sel .radiobtn {
- 721. - display: block;
- 722. - height: 22px;
- 723. - }
- 724. - .friends_fltr_last {
- 725. - padding-bottom: 0px;
- 726. - }
- 727. -
- 728. - .friends_bigph_wrap {
- 729. - position: relative;
- 730. - height: 100px;
- 731. - overflow: hidden;
- 732. - }
- 733. - .friends_bigph {
- 734. - position: absolute;
- 735. - color: #FFF;
- 736. - margin-top: 100px;
- 737. - background: #333;
- 738. - background: rgba(0, 0, 0, 0.5);
- 739. - width: 100px;
- 740. - height: 15px;
- 741. - line-height: 15px;
- 742. - padding: 4px 0px 6px 0px;
- 743. - text-align: center;
- 744. - filter: alpha(opacity=75);
- 745. - }
- 746. - @media all and (min-width:0) { /* IE9-10 */
- 747. - .friends_bigph { filter: none; }
- 748. - }
- 749. - .friends_bigph:hover {
- 750. - text-decoration: none;
- 751. - }
- 752. - .friends_bigph_label {
- 753. - opacity: 0.75;
- 754. - -webkit-transition: opacity 100ms linear;
- 755. - -moz-transition: opacity 100ms linear;
- 756. - -o-transition: opacity 100ms linear;
- 757. - transition: opacity 100ms linear;
- 758. - padding: 0px 0px 1px 20px;
- 759. - background: url(/images/icons/photo_icons.png?2) no-repeat left -62px;
- 760. - }
- 761. - .is_rtl1 .friends_bigph_label {
- 762. - padding: 0px 20px 1px 0px;
- 763. - background-position: right -62px;
- 764. - }
- 765. - .friends_bigph:hover .friends_bigph_label {
- 766. - opacity: 1;
- 767. - }
- 768. - .friends_photo_img {
- 769. - width: 100px;
- 770. - }
- 771. - .friends_find_cont {
- 772. - background: #F7F7F7;
- 773. - padding: 10px 10px;
- 774. - }
- 775. - .friends_import_row {
- 776. - width: 277px;
- 777. - padding: 10px 13px;
- 778. - display: block;
- 779. - color: #777;
- 780. - }
- 781. - .friends_import_icon {
- 782. - position: absolute;
- 783. - width: 40px;
- 784. - height: 40px;
- 785. - background: url(/images/icons/import_contacts.png?3) no-repeat;
- 786. - }
- 787. - .friends_import_facebook {
- 788. - background-position: 0px -40px;
- 789. - }
- 790. - .friends_import_ok {
- 791. - background-position: 0px -80px;
- 792. - }
- 793. - .friends_import_twitter {
- 794. - background-position: 0px -120px;
- 795. - }
- 796. - .friends_import_icon_big {
- 797. - position: absolute;
- 798. - width: 50px;
- 799. - height: 50px;
- 800. - background: url(/images/icons/import_contacts_big.png?3) no-repeat;
- 801. - }
- 802. - .friends_import_icon_big.friends_import_facebook {
- 803. - background-position: 0px -50px;
- 804. - }
- 805. - .friends_import_icon_big.friends_import_ok {
- 806. - background-position: 0px -100px;
- 807. - }
- 808. - .friends_import_icon_big.friends_import_twitter {
- 809. - background-position: 0px -150px;
- 810. - }
- 811. - .friends_import_cont {
- 812. - padding-left: 51px;
- 813. - padding-top: 3px;
- 814. - height: 37px;
- 815. - color: #777;
- 816. - }
- 817. - .friends_import_row:hover {
- 818. - text-decoration: none;
- 819. - background-color: #EDF0F2;
- 820. - color: #6A7989;
- 821. - }
- 822. - .friends_import_header {
- 823. - margin: 0px 0px 2px;
- 824. - padding: 0;
- 825. - color: #36638E;
- 826. - font-size: 1.18em;
- 827. - font-weight: bold;
- 828. - border: none;
- 829. - }
- 830. - .friends_import_services {
- 831. - padding: 10px 0px 0px;
- 832. - }
- 833. - .friends_import_error {
- 834. - border: 1px solid #E89B88;
- 835. - background-color: #FFEFE8;
- 836. - padding: 8px 11px;
- 837. - line-height: 160%;
- 838. - margin-bottom: 10px;
- 839. - display: none;
- 840. - }
- 841. - .friends_import_success {
- 842. - margin-top: 10px;
- 843. - background-color: #F9F6E7;
- 844. - border: 1px solid #D4BC4C;
- 845. - font-size: 1em;
- 846. - line-height: 160%;
- 847. - padding: 8px 11px;
- 848. - }
- 849. - .friends_import_fail {
- 850. - margin-top: 10px;
- 851. - border: 1px solid #E89B88;
- 852. - background-color: #FFEFE8;
- 853. - font-size: 1em;
- 854. - line-height: 160%;
- 855. - padding: 8px 11px;
- 856. - }
- 857. - .wide #not_found {
- 858. - max-width: inherit;
- 859. - }
- 860. - .friends_sugg_service {
- 861. - color: #777777;
- 862. - padding-bottom: 4px;
- 863. - }
- 864. - .friends_find_list {
- 865. - padding: 5px 15px;
- 866. - }
- 867. - .friends_find_summary {
- 868. - padding: 13px 13px 3px;
- 869. - }
- 870. - .friends_find_summary .summary {
- 871. - font-size: 12px;
- 872. - }
- 873. - .friends_find_search {
- 874. - padding-top: 4px;
- 875. - display: block;
- 876. - }
- 877. - .friends_find_header {
- 878. - background: #F7F7F7;
- 879. - padding: 12px 14px;
- 880. - }
- 881. - .friends_import_empty {
- 882. - padding: 20px;
- 883. - font-size: 12px;
- 884. - text-align: center;
- 885. - color: #777777;
- 886. - }
- 887. - .friends_find_controls {
- 888. - width: 200px;
- 889. - position: absolute;
- 890. - margin: 32px 0px 0px 283px;
- 891. - }
- 892. - .friends_import_list {
- 893. - padding: 2px 14px;
- 894. - }
- 895. - .friends_imp_cont {
- 896. - padding-left: 61px;
- 897. - padding-top: 7px;
- 898. - height: 43px;
- 899. - color: #777;
- 900. - }
- 901. - .friends_imp_r {
- 902. - padding: 10px 0px;
- 903. - border-top: 1px solid #ededed;
- 904. - }
- 905. - .friends_imp_r_first {
- 906. - border-top: none;
- 907. - }
- 908. - .friends_imp_r_info {
- 909. - padding-left: 10px;
- 910. - color: #999;
- 911. - }
- 912. - .friends_imp_r_name {
- 913. - display: block;
- 914. - padding: 6px 0px 4px;
- 915. - color: #45688E;
- 916. - font-weight: bold;
- 917. - }
- 918. - .friends_imp_r_controls {
- 919. - padding-top: 11px;
- 920. - }
- 921. - .friends_imp_status {
- 922. - color: #999;
- 923. - padding-top: 7px;
- 924. - }
- 925. - .friends_find_empty {
- 926. - padding: 40px;
- 927. - font-size: 12px;
- 928. - text-align: center;
- 929. - color: #777777;
- 930. - }
- ------
Advertisement
Add Comment
Please, Sign In to add comment