Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Файл - audio.js (Старый размер - 113052 | Новый - 0):
- 0. - var Audio = {
- 1. - address: '/audio',
- 2. - scrollnode: browser.msie6 ? pageNode : window,
- 3. - fixedScroll: !(browser.msie && browser.version < 8 || browser.mobile),
- 4. - initPad: function() {
- 5. - if (window._pads && _pads.cur) {
- 6. - var __cur = _pads.cur;
- 7. - extend(__cur, {
- 8. - searchCont: ge('pad_audio_search'),
- 9. - aSearch: ge('pad_search'),
- 10. - clearSearch: ge('pad_audio_reset'),
- 11. - aContent: ge('pad_playlist'),
- 12. - sContent: ge('pad_search_list'),
- 13. - sPreload: ge('pad_search_preload'),
- 14. - showMore: ge('pad_more_audio'),
- 15. - sShowMore: ge('pad_more_search_link'),
- 16. - sWrap: ge('pad_audio_search_wrap'),
- 17. - sSummary: ge('pad_audio_search_summary'),
- 18. - albumFilters: ge('pad_album_filters'),
- 19. - audioFriends: ge('pad_audio_friends'),
- 20. - albumFiltered: ge('pad_album_filtered'),
- 21. - popularFilters: ge('pad_audio_popular_filters'),
- 22. - audioAlbums: ge('pad_audio_albums'),
- 23. - searchFilters: ge('pad_audio_search_filters'),
- 24. - popularOwners: ge('pad_audio_popular_owners'),
- 25. - popularGenres: ge('pad_audio_genres'),
- 26. - audioAlbumsWrap: ge('pad_audio_albums_wrap'),
- 27. - searchInfoCont: ge('pad_audio_search_info'),
- 28. - feedFilter: ge('pad_feed_filter'),
- 29. - topFilter: ge('pad_top_audios'),
- 30. - recFilter: ge('pad_recommendations'),
- 31. - albumsFilter: ge('pad_audios_albums'),
- 32. - friendsList: ge('pad_audio_friends_list'),
- 33. - currentFilter: ge('pad_current_filter'),
- 34. - friendsSearch: ge('pad_audio_friends_search_input'),
- 35. - audioMoreFriensId: 'pad_audio_more_friends',
- 36. - popularPerformersId: 'pad_audio_performers',
- 37. - searchStr: '',
- 38. - htitle: getLang('audio_header')
- 39. - });
- 40. - __cur.audiosList = __cur.audiosList || {};
- 41. - __cur.audios = __cur.audios || {};
- 42. - if (cur.module == 'audio' && cur.oid == vk.id && cur.audiosList && cur.audiosList['all']) {
- 43. - __cur.audiosList['all'] = clone(cur.audiosList['all']);
- 44. - __cur.allAudiosIndex = 'all';
- 45. - if (cur.summaryLang) {
- 46. - __cur.summaryLang = extend(__cur.summaryLang || {}, cur.summaryLang);
- 47. - }
- 48. - Audio.generateAlbums(true);
- 49. - Audio.changeAllIndex({from_pad: true, index: 'all', clbk: function() {}});
- 50. - }
- 51. - Audio.startPadEvents();
- 52. - }
- 53. - },
- 54. - init: function(obj, audioTpl) {
- 55. - extend(cur, {
- 56. - searchCont: ge('audio_search'),
- 57. - aSearch: ge('s_search'),
- 58. - clearSearch: ge('audio_query_reset'),
- 59. - aContent: ge('initial_list'),
- 60. - sContent: ge('search_list'),
- 61. - sPreload: ge('search_preload'),
- 62. - showMore: ge('more_link'),
- 63. - sShowMore: ge('s_more_link'),
- 64. - sWrap: ge('audio_search_wrap'),
- 65. - sSummary: ge('audio_search_summary'),
- 66. - albumFilters: ge('album_filters'),
- 67. - albumFiltered: ge('album_filtered'),
- 68. - searchFilters: ge('audio_search_filters'),
- 69. - popularFilters: ge('audio_popular_filters'),
- 70. - popularOwners: ge('audio_popular_owners'),
- 71. - popularGenres: ge('audio_genres'),
- 72. - audioFriends: ge('audio_friends'),
- 73. - audioAlbums: ge('audio_albums'),
- 74. - audioAlbumsWrap: ge('audio_albums_wrap'),
- 75. - audioWrap: ge('audio_wrap'),
- 76. - searchInfoCont: ge('audio_search_info'),
- 77. - feedFilter: ge('feed_filter'),
- 78. - topFilter: ge('top_audios'),
- 79. - recFilter: ge('recommendations'),
- 80. - albumsFilter: ge('audios_albums'),
- 81. - friendsList: ge('audio_friends_list'),
- 82. - friendsSearch: ge('audio_friends_search_input'),
- 83. - audioMoreFriensId: 'audio_more_friends',
- 84. - popularPerformersId: 'audio_performers',
- 85. - searchStr: "",
- 86. - autoComplete: 1,
- 87. - audioTpl: audioTpl,
- 88. - audioEl: {
- 89. - head: ge('page_header'),
- 90. - bar: ge('ac'),
- 91. - cont: ge('audio'),
- 92. - filters: ge('side_filters')
- 93. - }
- 94. - });
- 95. -
- 96. - if (ge('ac') && window.audioPlayer) {
- 97. - audioPlayer.initEvents();
- 98. - audioPlayer.registerPlayer('ac', {
- 99. - container: ge('ac'),
- 100. - performer: ge('ac_performer'),
- 101. - title: ge('ac_title'),
- 102. - titleWrap: ge('ac_name'),
- 103. - duration: ge('ac_duration'),
- 104. - load: ge('ac_load_line'),
- 105. - progress: ge('ac_pr_line'),
- 106. - progressArea: ge('ac_pr'),
- 107. - volume: ge('ac_vol_line'),
- 108. - volumeArea: ge('ac_vol'),
- 109. - play: ge('ac_play'),
- 110. - prev: ge('ac_prev'),
- 111. - next: ge('ac_next'),
- 112. - add: ge('ac_add'),
- 113. - repeat: ge('ac_repeat'),
- 114. - shuffle: ge('ac_shuffle'),
- 115. - rec: ge('ac_rec'),
- 116. - status: ge('ac_status'),
- 117. - fixed: !(browser.msie && browser.version < 8 || browser.mobile)
- 118. - });
- 119. - }
- 120. - if (browser.mobile) {
- 121. - hide('ac_vol');
- 122. - setStyle('ac_duration', {margin: 0});
- 123. - }
- 124. -
- 125. - if (!cur.allAudiosIndex) cur.allAudiosIndex = 'all';
- 126. -
- 127. - extend(cur, obj);
- 128. - cur.module = 'audio';
- 129. - //cur.disableAutoMore = true;
- 130. - if (cur.aSearch) {
- 131. - cur.aSearch.value = cur.q;
- 132. - toggleClass(cur.clearSearch, 'shown', !!cur.q);
- 133. - placeholderSetup(cur.aSearch, {back: true});
- 134. - setTimeout(function() {
- 135. - cur.aSearch.focus();
- 136. - }, 0);
- 137. - }
- 138. - if (ge('audio_friends_search_input')) {
- 139. - placeholderSetup(ge('audio_friends_search_input'));
- 140. - }
- 141. -
- 142. - Audio.scrollnode = browser.msie6 ? pageNode : window;
- 143. - Audio.fixedScroll = !(browser.msie && browser.version < 8 || browser.mobile);
- 144. - window.scrollTop = bodyNode.scrollTop = pageNode.scrollTop = htmlNode.scrollTop = 0;
- 145. - Audio.startEvents();
- 146. - cur.destroy.push(function() {
- 147. - Audio.stopEvents();
- 148. - });
- 149. -
- 150. - cur.nav.push(function(changed, old, n) {
- 151. - if (changed.act == 'popular') {
- 152. - Audio.loadPopular({update: true, genre: intval(n.genre)});
- 153. - return false;
- 154. - }
- 155. - });
- 156. -
- 157. -
- 158. - var _a = window.audioPlayer;
- 159. - if (_a && _a.showCurrentTrack) {
- 160. - _a.shuffle = false;
- 161. - _a.showCurrentTrack();
- 162. - }
- 163. -
- 164. - cur.audios = {};
- 165. - hide(cur.sContent);
- 166. -
- 167. - cur.silent = true;
- 168. - var query = {act: 'load_audios_silent', id: (cur.allAudiosIndex == 'all' ? cur.id : cur.audioFriend), gid: cur.gid, claim: nav.objLoc.claim, please_dont_ddos: 2};
- 169. - if (cur.allAudiosIndex != 'all') {
- 170. - Audio.cacheFriendsList();
- 171. - }
- 172. - if (cur.club) {
- 173. - cur.curSection = 'club' + cur.club;
- 174. - query.club = cur.club;
- 175. - cur.searchStr = cur.q;
- 176. - }
- 177. - ajax.post(Audio.address, query, {onDone: (function(data, opts) {
- 178. - opts = eval('('+opts+')');
- 179. - if (opts.exp) {
- 180. - _a.statusExport = opts.exp;
- 181. - checkbox('currinfo_audio', (_a.hasStatusExport()));
- 182. - if (_a && _a.showCurrentTrack) _a.showCurrentTrack();
- 183. - delete opts.exp;
- 184. - }
- 185. - extend(cur, opts);
- 186. - if (cur.hashes && cur.hashes.add_hash && !_a.addHash) {
- 187. - _a.addHash = cur.hashes.add_hash;
- 188. - }
- 189. - if (query.id > 0) {
- 190. - cur.allFriendsTitles = cur.allFriendsTitles || {};
- 191. - cur.allFriendsTitles[query.id] = opts.summaryLang.all_friend_title;
- 192. - cur.allFriendsHTitles = cur.allFriendsHTitles || {};
- 193. - cur.allFriendsHTitles[query.id] = opts.summaryLang.all_friend_htitle;
- 194. - }
- 195. - var obj = eval('('+data+')');
- 196. - if (!obj) {
- 197. - return;
- 198. - }
- 199. - cur.audiosList = cur.audiosList || {};
- 200. - if ((query.club || query.id < 0) && obj.club) {
- 201. - var club = query.club || -query.id;
- 202. - cur.allClubsHTitles = cur.allClubsHTitles || {};
- 203. - cur.allClubsHTitles[club] = opts.summaryLang.all_club_htitle || cur.htitle;
- 204. - cur.allFriendsHTitles = cur.allFriendsHTitles || {};
- 205. - cur.allFriendsHTitles[-club] = opts.summaryLang.all_club_htitle || cur.htitle;
- 206. - cur.curList = 'club' + club;
- 207. - cur.audiosList[cur.curList] = obj.club;
- 208. - } else {
- 209. - cur.curList = (cur.album_id) ? 'album'+cur.album_id : cur.allAudiosIndex;
- 210. - }
- 211. - cur.searchOffset = 0;
- 212. - cur.audiosList[cur.allAudiosIndex] = obj.all ? obj.all : [];
- 213. - if (cur.allAudiosIndex == 'all') Audio.generateAlbums();
- 214. - cur.sectionCount = (cur.audiosList[cur.curList] || []).length;
- 215. - if (cur.canEdit && nav.objLoc.act != 'popular' && nav.objLoc.act != 'recommendations' && nav.objLoc.act != 'feed' && !browser.mobile && cur.allAudiosIndex == 'all' && !cur.shuffled && !cur.club) {
- 216. - if (cur.sectionCount) {
- 217. - var opts = {onReorder: Audio.onAudioReorder, onMouseDown: Audio.onDragStart, onMouseUp: Audio.onDragEnd, noMoveCursor: 1};
- 218. - if (cur.audioAlbumsWrap) {
- 219. - extend(opts, {target: cur.audioAlbumsWrap, onDragOver: Audio.onDragOver, onDragOut: Audio.onDragOut});
- 220. - }
- 221. - sorter.init(cur.aContent, opts);
- 222. - }
- 223. - }
- 224. - if (cur.albums) {
- 225. - Audio.initAlbumsSort();
- 226. - }
- 227. - this.indexAll({callback: function() {
- 228. - cur.silent = false;
- 229. - if (cur.onSilentLoad) {
- 230. - cur.onSilentLoad();
- 231. - }
- 232. - if (!cur.q || cur.club) {
- 233. - if (cur.curSection == 'recommendations' || cur.curSection == 'popular' || cur.curSection == 'feed') {
- 234. - if (cur[cur.curSection+'Audios']) {
- 235. - var k = 0;
- 236. - for (var i in cur[cur.curSection+'Audios']) {
- 237. - cur[cur.curSection+'Audios'][i]._order = k++;
- 238. - }
- 239. - audioPlayer.genPlaylist(cur[cur.curSection+'Audios'], false);
- 240. - }
- 241. - } else {
- 242. - audioPlayer.genPlaylist(cur.audiosList[cur.curList], false, {my: (cur.curList == 'all' && cur.oid == vk.id ? 'my' : false)});
- 243. - }
- 244. - } else if (!query.club) {
- 245. - Audio.selectPerformer({name: cur.q});
- 246. - }
- 247. - if (cur.audio_id) {
- 248. - var audio = cur.audios[cur.audio_id];
- 249. - if (audio) {
- 250. - var audio_id = audio[0] + '_' + audio[1];
- 251. - if (audio[11] && parseInt(audio[11])) {
- 252. - var claim = parseInt(audio[11]) || 0;
- 253. - if (claim == -2) claim = 0;
- 254. - Audio.showAudioClaimWarning(audio_id, claim, audio[5] + ' – ' + audio[6]);
- 255. - } else {
- 256. - try{
- 257. - playAudioNew(audio_id);
- 258. - }catch(e){};
- 259. - }
- 260. - }
- 261. - }
- 262. - }});
- 263. - }).bind(this), local: 1});
- 264. - },
- 265. -
- 266. - startEvents: function() {
- 267. - addEvent(Audio.scrollnode, 'scroll', Audio.scrollCheck);
- 268. - addEvent(window, 'resize', Audio.scrollCheck);
- 269. - addEvent(cur.aSearch, 'blur', Audio.searchBlur.pbind(false));
- 270. - addEvent(cur.aSearch, 'focus', Audio.searchFocus.pbind(false));
- 271. - cur.gpHidden = true;
- 272. - toggleGlobalPlayer(false);
- 273. - if (Audio.fixedScroll) {
- 274. - var els = geByClass('top_info_wrap', ge('page_wrap'));
- 275. - each(els, function() { hide(this); });
- 276. - hide(_stlSide);
- 277. - setTimeout(function() {
- 278. - each(els, function() { hide(this); });
- 279. - hide(_stlSide);
- 280. - }, 110);
- 281. - var headH = cur.audioEl.head.clientHeight,
- 282. - headT = getXY(cur.audioEl.head)[1],
- 283. - audioNavH = cur.audioEl.bar.offsetHeight,
- 284. - headW = cur.audioEl.head.clientWidth,
- 285. - contentY = headH + audioNavH;
- 286. - setStyle(cur.audioEl.head, {width: headW, top: headT});
- 287. - setStyle('side_bar', {top: headH + headT});
- 288. - setStyle(cur.audioEl.bar, {top: headH + headT});
- 289. - setStyle(cur.audioEl.cont, {paddingTop: contentY});
- 290. - setStyle(cur.audioEl.filters, {top: contentY});
- 291. -
- 292. - addClass(bodyNode, 'audio_fixed_nav');
- 293. - _fixedNav = true;
- 294. - }
- 295. - Audio.updateAlbumsTitles();
- 296. - Audio.handleFilterPos();
- 297. - },
- 298. -
- 299. - stopEvents: function() {
- 300. - removeEvent(Audio.scrollnode, 'scroll', Audio.scrollCheck);
- 301. - removeEvent(window, 'resize', Audio.scrollCheck);
- 302. - removeEvent(cur.aSearch, 'blur', Audio.searchBlur.pbind(false));
- 303. - removeEvent(cur.aSearch, 'focus', Audio.searchFocus.pbind(false));
- 304. - if (Audio.fixedScroll) {
- 305. - var els = geByClass('top_info_wrap', ge('page_wrap'));
- 306. - each(els, function() { show(this); });
- 307. - setStyle(cur.audioEl.head, {width: '', top: ''});
- 308. - setStyle('side_bar', {top: ''});
- 309. -
- 310. - removeClass(bodyNode, 'audio_fixed_nav');
- 311. - _fixedNav = false;
- 312. -
- 313. - show(_stlSide);
- 314. - }
- 315. - audioPlayer.deregisterPlayer('ac');
- 316. - setTimeout(function() {
- 317. - toggleGlobalPlayer(true);
- 318. - updGlobalPlayer();
- 319. - }, 100);
- 320. - },
- 321. -
- 322. - startPadEvents: function() {
- 323. - var __cur = window._pads && _pads.cur;
- 324. - addEvent(__cur.aSearch, 'blur', Audio.searchBlur.pbind(true));
- 325. - addEvent(__cur.aSearch, 'focus', Audio.searchFocus.pbind(true));
- 326. - Audio.updateAlbumsTitles({from_pad: true});
- 327. - },
- 328. -
- 329. - stopPadEvents: function() {
- 330. - var __cur = window._pads && _pads.cur;
- 331. - removeEvent(__cur.aSearch, 'blur', Audio.searchBlur.pbind(true));
- 332. - removeEvent(__cur.aSearch, 'focus', Audio.searchFocus.pbind(true));
- 333. - audioPlayer.deregisterPlayer('pd');
- 334. - },
- 335. -
- 336. - searchFocus: function(from_pad) {
- 337. - var alist = from_pad ? ge('pad_playlist_panel') : ge('audios_list');
- 338. - if (!hasClass(alist, 'light')) addClass(alist, 'light');
- 339. - },
- 340. -
- 341. - searchBlur: function(from_pad) {
- 342. - var alist = from_pad ? ge('pad_playlist_panel') : ge('audios_list');
- 343. - if (hasClass(alist, 'light')) removeClass(alist, 'light');
- 344. - },
- 345. -
- 346. - scrollToTop: function(from_pad) {
- 347. - if (from_pad && window._pads) {
- 348. - animate(_pads.content, {scrollTop: 0}, 200);
- 349. - } else {
- 350. - scrollToTop();
- 351. - }
- 352. - },
- 353. -
- 354. - clearSearch: function(opts) {
- 355. - opts = opts || {};
- 356. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 357. - from_pad = !!opts.from_pad, event = opts.event, el = opts.el;
- 358. - setStyle(el, {opacity: .6});
- 359. - __cur.aSearch.focus();
- 360. - if (__cur.allAudiosIndex == 'all') {
- 361. - Audio.loadAlbum({from_pad: from_pad, album: 0});
- 362. - } else {
- 363. - this.filterTimeout = setTimeout((function() {
- 364. - val(__cur.aSearch, '');
- 365. - removeClass(__cur.clearSearch, 'shown');
- 366. - this.updateList({from_pad: from_pad});
- 367. - this.hideSearchResults(from_pad);
- 368. - this.scrollToTop(from_pad);
- 369. - }).bind(this), 10);
- 370. - }
- 371. - if (isVisible(__cur.searchInfoCont)) {
- 372. - hide(__cur.searchInfoCont);
- 373. - if (from_pad) {
- 374. - Audio.updatePadFiltersHeight();
- 375. - }
- 376. - }
- 377. - },
- 378. -
- 379. - updateSorterRows: function(fromEl) {
- 380. - if (fromEl && fromEl.parentNode.sorter){
- 381. - sorter.update(fromEl);
- 382. - }
- 383. - },
- 384. -
- 385. - showLyrics: function(id, lid, top) {
- 386. - var lyrics_div = ge('lyrics'+id);
- 387. - if (!isVisible(lyrics_div)) {
- 388. - show(lyrics_div);
- 389. - lyrics_div.innerHTML = "<div style='text-align: center; height: 50px; padding: 30px 10px 10px 10px'><img valign='middle' src='/images/progress7.gif'></div>";
- 390. - Audio.updateSorterRows(ge('audio'+id));
- 391. - ajax.post(Audio.address, {act: 'get_lyrics', lid: lid, aid: id, top: top ? 1 : 0}, {cache: 1, onDone: (function(responseText) {
- 392. - lyrics_div.innerHTML = responseText;
- 393. - Audio.updateSorterRows(ge('audio'+id));
- 394. - }).bind(this)});
- 395. - } else {
- 396. - lyrics_div.innerHTML = "";
- 397. - hide(lyrics_div);
- 398. - Audio.updateSorterRows(ge('audio'+id));
- 399. - Audio.handleFilterPos();
- 400. - }
- 401. - },
- 402. -
- 403. - allAudios: function(from_pad) {
- 404. - var __cur = from_pad ? window._pads && _pads.cur : window.cur;
- 405. - return __cur.audiosList ? __cur.audiosList[__cur.allAudiosIndex] || [] : [];
- 406. - },
- 407. -
- 408. - showRows: function(opts) {
- 409. - opts = opts || {};
- 410. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 411. - from_pad = !!opts.from_pad, force = opts.force, start = opts.start, end = opts.end;
- 412. -
- 413. - if (from_pad && !__cur.curSection) {
- 414. - Pads.showAudios();
- 415. - return;
- 416. - } else if (__cur.curSection == 'recommendations') {
- 417. - Audio.loadRecommendations({from_pad: from_pad});
- 418. - return;
- 419. - } else if (__cur.curSection == 'popular') {
- 420. - Audio.loadPopular({from_pad: from_pad});
- 421. - return;
- 422. - } else if (__cur.curSection == 'feed') {
- 423. - Audio.loadFeed({from_pad: from_pad});
- 424. - return;
- 425. - }
- 426. - if (__cur.silent) {
- 427. - __cur.onSilentLoad = function() {
- 428. - Audio.showRows(opts);
- 429. - };
- 430. - return;
- 431. - }
- 432. - var list = __cur.audiosList[__cur.curList] || [];
- 433. - if (list[0] && list[0]._order !== undefined) {
- 434. - list = list.sort(function(a,b) {return a._order - b._order});
- 435. - }
- 436. - list = Audio.filterClaimed(list);
- 437. - __cur.sectionCount = list.length;
- 438. - if (!__cur.searchStr) {
- 439. - list = Audio.filterDeleted(list, from_pad);
- 440. - if (__cur.filterUnsorted) {
- 441. - list = Audio.filterByAlbum(list, 0);
- 442. - }
- 443. - __cur.sectionCount = list.length;
- 444. - }
- 445. - if (start == undefined) {
- 446. - start = __cur.shownAudios;
- 447. - }
- 448. - if (end == undefined) {
- 449. - end = __cur.shownAudios + __cur.audiosPerPage;
- 450. - }
- 451. - if (window.tooltips && cur.tooltips) {
- 452. - for (var i = 0; i < cur.tooltips.length; ++i) {
- 453. - if (cur.tooltips[i].el) {
- 454. - if (hasClass(cur.tooltips[i].el, 'audio_friend')) continue;
- 455. - if (cur.tooltips[i].el.ttimer) {
- 456. - clearTimeout(cur.tooltips[i].el.ttimer);
- 457. - }
- 458. - }
- 459. - cur.tooltips[i].hide({fasthide: true});
- 460. - }
- 461. - }
- 462. - if (from_pad && ge('pad_footer_text')) {
- 463. - ge('pad_footer_text').innerHTML = '';
- 464. - }
- 465. - var _a = window.audioPlayer;
- 466. - if (!list || !list.length) {
- 467. - if (__cur.shownAudios == 0 && (__cur.album_id || (!Audio.allAudios(from_pad).length && !__cur.searchStr))) {
- 468. - var msg;
- 469. - if (Audio.allAudios(from_pad).length) {
- 470. - msg = (__cur.album_id) ? getLang('audio_album_no_recs') : getLang('audio_no_audios_found').split('{query}').join('<b>'+cur.searchStr.replace(/([<>&#]*)/g, '')+'</b>');
- 471. - } else {
- 472. - if (__cur.oid > 0 && !__cur.audioFriend) {
- 473. - if ((__cur.id == vk.id || from_pad) && __cur.allAudiosIndex == 'all') {
- 474. - msg = getLang('audio_no_rec_load_msg').split('{link}').join('<a href="#" onclick="Audio.addAudio(); return false">').split('{/link}').join('</a>');
- 475. - } else {
- 476. - msg = getLang('audio_user_no_recs');
- 477. - }
- 478. - } else {
- 479. - msg = __cur.audioFriend > 0 ? getLang('audio_user_no_recs') : getLang('audio_group_no_recs');
- 480. - }
- 481. - }
- 482. - var style = from_pad && window._pads && _pads.content ? ' style="height: ' + (getSize(_pads.content)[1] - 110 - ge('pad_playlist').offsetTop) + 'px;"' : '';
- 483. - __cur.aContent.innerHTML = '<div id="not_found" class="info_msg" ' + style + '>'+msg+'</div>';
- 484. - }
- 485. - hide(__cur.showMore);
- 486. - } else {
- 487. - if (!__cur.shownAudios) {
- 488. - __cur.aContent.innerHTML = '';
- 489. - }
- 490. - var audios = list.slice(start, end);
- 491. - if (!audios.length) {
- 492. - if (__cur.shownAudios >= __cur.sectionCount) {
- 493. - hide(__cur.showMore);
- 494. - if (__cur.searchStr) {
- 495. - this.loadRows(from_pad);
- 496. - }
- 497. - }
- 498. - return;
- 499. - }
- 500. - var html = [];
- 501. - for (i in audios) {
- 502. - var audio = audios[i].slice();
- 503. - if (__cur.selection) {
- 504. - audio[5] = audio[5].replace(__cur.selection.re, __cur.selection.val);
- 505. - audio[6] = audio[6].replace(__cur.selection.re, __cur.selection.val);
- 506. - }
- 507. - html.push(this.drawAudio(audio, from_pad));
- 508. - __cur.shownAudios += 1;
- 509. - }
- 510. - var au = ce('div', {innerHTML: html.join('')});
- 511. - while (au.firstChild) {
- 512. - var el = au.firstChild;
- 513. - __cur.aContent.appendChild(el);
- 514. - }
- 515. - if (from_pad && window.Pads && Pads.updateHeight) {
- 516. - Pads.updateHeight();
- 517. - } else if (__cur.canEdit && nav.objLoc.act != 'popular' && nav.objLoc.act != 'recommendations' && nav.objLoc.act != 'feed' && !browser.mobile && !__cur.searchStr && __cur.sectionCount && __cur.allAudiosIndex == 'all' && !__cur.shuffled && !__cur.club) {
- 518. - if (start > 0) {
- 519. - setTimeout(sorter.added.pbind(__cur.aContent), 0);
- 520. - } else {
- 521. - setTimeout(function(){
- 522. - var opts = {onReorder: Audio.onAudioReorder, onMouseDown: Audio.onDragStart, onMouseUp: Audio.onDragEnd, noMoveCursor: 1};
- 523. - if (__cur.audioAlbumsWrap) {
- 524. - extend(opts, {target: __cur.audioAlbumsWrap, onDragOver: Audio.onDragOver, onDragOut: Audio.onDragOut});
- 525. - }
- 526. - sorter.init(__cur.aContent, opts);
- 527. - }, 0);
- 528. - }
- 529. - }
- 530. - if (__cur.searchCount && isVisible(__cur.sContent)) {
- 531. - show(__cur.sWrap);
- 532. - __cur.sContent.style.paddingTop = '12px';
- 533. - __cur.sSummary.innerHTML = langNumeric(__cur.searchCount, __cur.summaryLang['list_found'], true);
- 534. - }
- 535. - if (_a && _a.showCurrentTrack) _a.showCurrentTrack();
- 536. - }
- 537. - setTimeout(Audio.handleFilterPos, 0);
- 538. - var aid = currentAudioId(), clubList = (__cur.curSection && __cur.curSection.substr(0, 4) == 'club');
- 539. - if (_a && _a.gpDisabled && aid) {
- 540. - var track_id = aid.split('_')[1];
- 541. - if (!__cur.audios[track_id]) _a.stop();
- 542. - }
- 543. - if (__cur.justShuffled) {
- 544. - toggle(__cur.showMore, __cur.shownAudios < __cur.sectionCount);
- 545. - return;
- 546. - }
- 547. - if (clubList) {
- 548. - Audio.hideSearchResults(from_pad);
- 549. - }
- 550. - if (force) return;
- 551. - if (__cur.shownAudios >= __cur.sectionCount) {
- 552. - hide(__cur.showMore);
- 553. - if (__cur.searchStr && !clubList) {
- 554. - this.loadRows(from_pad);
- 555. - } else if (!from_pad) {
- 556. - Audio.setQLoc(__cur.searchStr);
- 557. - }
- 558. - } else {
- 559. - show(__cur.showMore);
- 560. - if (!from_pad) {
- 561. - Audio.setQLoc(__cur.searchStr);
- 562. - }
- 563. - }
- 564. - },
- 565. -
- 566. - toggleSearchFriends: function(show, el) {
- 567. - var inpWrap = el.nextSibling, inp = geByTag1('input', inpWrap);
- 568. - if (val(inp) && !show) return;
- 569. - toggle(el, !show);
- 570. - toggle(inpWrap, show);
- 571. - if (show) {
- 572. - setTimeout(function() {inp.select();}, 0);
- 573. - }
- 574. - },
- 575. -
- 576. - clearFriendsSearch: function(opts) {
- 577. - opts = opts || {};
- 578. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 579. - from_pad = !!opts.from_pad, inp = opts.el;
- 580. - val(inp, '');
- 581. - this.searchFriends({from_pad: from_pad, str: '', el: inp});
- 582. - this.toggleSearchFriends(false, domPS(inp.parentNode));
- 583. - },
- 584. -
- 585. - searchFriends: function(opts) {
- 586. - opts = opts || {};
- 587. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 588. - from_pad = !!opts.from_pad, str = trim(val(__cur.friendsSearch)),
- 589. - inp = opts.el, event = opts.event;
- 590. - if (event && event.keyCode == KEY.ESC) {
- 591. - inp.blur();
- 592. - return;
- 593. - }
- 594. - if (str == __cur.searchFriendsStr) return;
- 595. - __cur.searchFriendsStr = str;
- 596. - toggleClass(inp.parentNode, 'str', !!str);
- 597. -
- 598. - clearTimeout(this.searchFTimeout);
- 599. - this.searchFTimeout = setTimeout((function() {
- 600. - Audio.searchFriendsRequest({from_pad: from_pad, str: __cur.searchFriendsStr});
- 601. - }).bind(this), 150);
- 602. - },
- 603. -
- 604. - searchFriendsRequest: function(opts) {
- 605. - opts = opts || {};
- 606. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 607. - from_pad = !!opts.from_pad, str = opts.str;
- 608. - if (__cur.searchFriendsSent) {
- 609. - return;
- 610. - }
- 611. - __cur.searchFriendsSent = true;
- 612. -
- 613. - var query = {act: 'search_friends', str: str};
- 614. - if (__cur.audioFriend && __cur.allAudiosIndex && !__cur.allAudiosIndex.indexOf('friend')) {
- 615. - query.owner = __cur.audioFriend;
- 616. - }
- 617. - if (from_pad) {
- 618. - query.from_pad = 1;
- 619. - }
- 620. - ajax.post(Audio.address, query, {onDone: function(cont, friends) {
- 621. - __cur.searchFriendsSent = false;
- 622. - if (cont) {
- 623. - __cur.friendsList.innerHTML = cont;
- 624. - setTimeout(Audio.handleFilterPos, 0);
- 625. - if (friends) {
- 626. - __cur.shownFriends = friends;
- 627. - }
- 628. - }
- 629. - if (ge(__cur.audioMoreFriensId)) {
- 630. - toggle(ge(__cur.audioMoreFriensId).parentNode, !str);
- 631. - }
- 632. - if (from_pad) {
- 633. - Audio.updatePadFiltersHeight();
- 634. - }
- 635. - }});
- 636. - },
- 637. -
- 638. - loadRows: function(from_pad) {
- 639. - var __cur = from_pad ? window._pads && _pads.cur : window.cur;
- 640. - if (__cur.sPreload.innerHTML) {
- 641. - while (__cur.sPreload.firstChild) {
- 642. - var el = __cur.sPreload.firstChild
- 643. - __cur.sContent.appendChild(el);
- 644. - }
- 645. - if (from_pad && window.Pads && Pads.updateHeight) {
- 646. - Pads.updateHeight();
- 647. - }
- 648. - }
- 649. - clearTimeout(this.searchTimeout);
- 650. - this.searchTimeout = setTimeout((function() {
- 651. - Audio.searchRequest({from_pad: from_pad, str: __cur.searchStr, offset: __cur.searchOffset});
- 652. - }).bind(this), 300);
- 653. - },
- 654. -
- 655. - searchRequest: function(opts) {
- 656. - opts = opts || {};
- 657. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 658. - from_pad = !!opts.from_pad, val = opts.str, offset = opts.offset;
- 659. - if (!val) return;
- 660. - if (val[val.length - 1] == ' ') {
- 661. - val[val.length - 1] = '_';
- 662. - }
- 663. - addClass(__cur.searchCont, 'loading');
- 664. - setStyle(__cur.clearSearch, {opacity: .6});
- 665. - var query = {act: 'search', q: val, offset: offset, id: __cur.id, gid: __cur.gid, performer: __cur.searchTypeMenu ? __cur.searchTypeMenu.val() : 0};
- 666. - if (!from_pad) {
- 667. - var l = ge('audio_lyrics_filter');
- 668. - if (l && parseInt(l.value)) query.lyrics = 1;
- 669. - }
- 670. - if (__cur.searchSortFilter) query.sort = parseInt(__cur.searchSortFilter.val());
- 671. - if (__cur.autoComplete) query.autocomplete = __cur.autoComplete;
- 672. - if (nav.objLoc.claim && !from_pad) query.claim = nav.objLoc.claim;
- 673. - if (from_pad) {
- 674. - query.from_pad = 1;
- 675. - }
- 676. - ajax.post(Audio.address, query, {onDone: function(res, preload, options) {
- 677. - removeClass(__cur.searchCont, 'loading');
- 678. - var newVal = __cur.searchStr;
- 679. - if (newVal[newVal.length - 1] == ' ') {
- 680. - newVal[newVal.length - 1] = '_';
- 681. - }
- 682. - if (val != newVal) {
- 683. - return;
- 684. - }
- 685. - if (res) {
- 686. - __cur.sContent.innerHTML = res;
- 687. - if (from_pad && window.Pads && Pads.updateHeight) {
- 688. - Pads.updateHeight();
- 689. - }
- 690. - }
- 691. - if (preload) {
- 692. - __cur.sPreload.innerHTML = preload;
- 693. - }
- 694. - Audio.applyOptions(__cur, options, offset);
- 695. - if (from_pad) {
- 696. - Audio.updatePadFiltersHeight();
- 697. - }
- 698. - show(__cur.sContent);
- 699. - if (!__cur.sectionCount) {
- 700. - hide(__cur.sWrap);
- 701. - __cur.sContent.style.paddingTop = '0px';
- 702. - __cur.aContent.innerHTML = '';
- 703. - if (!__cur.searchCount && !res && !preload) {
- 704. - msg = getLang('audio_no_audios_found').split('{query}').join('<b>'+__cur.searchStr.replace(/([<>&#]*)/g, '')+'</b>');
- 705. - var style = from_pad && window._pads && _pads.content ? ' style="height: ' + (getSize(_pads.content)[1] - 110 - ge('pad_playlist').offsetTop) + 'px;"' : '';
- 706. - __cur.aContent.innerHTML = '<div id="not_found" class="info_msg"' + style + '>'+msg+'</div>';
- 707. - hide(__cur.showMore);
- 708. - hide(__cur.sContent);
- 709. - }
- 710. - } else {
- 711. - __cur.sContent.style.paddingTop = '12px';
- 712. - if (__cur.searchCount) {
- 713. - __cur.sSummary.innerHTML = langNumeric(__cur.searchCount, __cur.summaryLang['list_found'], true);
- 714. - show(__cur.sWrap);
- 715. - } else {
- 716. - Audio.hideSearchResults(from_pad);
- 717. - hide(__cur.sWrap);
- 718. - }
- 719. - }
- 720. - Audio.changeSummary({from_pad: from_pad, from_search: true});
- 721. - Audio.scrollCheck();
- 722. - if (!offset && !from_pad) {
- 723. - Audio.setQLoc(__cur.searchStr);
- 724. - }
- 725. - var _a = window.audioPlayer;
- 726. - if (_a && _a.showCurrentTrack) _a.showCurrentTrack();
- 727. - },
- 728. - onFail: function() {
- 729. - removeClass(__cur.searchCont, 'loading');
- 730. - },
- 731. - showProgress: function () {
- 732. - __cur.isAudioLoading = true;
- 733. - },
- 734. - hideProgress: function () {
- 735. - __cur.isAudioLoading = false;
- 736. - }
- 737. - });
- 738. - },
- 739. -
- 740. - changeSearchFilters: function(from_pad) {
- 741. - var __cur = from_pad ? window._pads && _pads.cur : window.cur;
- 742. - __cur.searchOffset = 0;
- 743. - Audio.searchRequest({from_pad: from_pad, str: __cur.searchStr, offset: 0});
- 744. - },
- 745. -
- 746. - hideSearchResults: function(from_pad) {
- 747. - setTimeout(function(){
- 748. - var __cur = from_pad ? window._pads && _pads.cur : window.cur;
- 749. - __cur.sContent.innerHTML = '';
- 750. - if (__cur.curSection != 'recommendations' && __cur.curSection != 'popular' && __cur.curSection != 'feed') __cur.sPreload.innerHTML = '';
- 751. - hide(__cur.sContent);
- 752. - hide(__cur.sWrap);
- 753. - hide(__cur.sShowMore);
- 754. - Audio.scrollCheck();
- 755. - }, 0);
- 756. - },
- 757. -
- 758. - drawAudio: function(audio, from_pad) {
- 759. - return from_pad ? Pads.audioRow(audio, {}) : cur.audioTpl(audio, cur.curSection);
- 760. - },
- 761. -
- 762. - applyOptions: function(__cur, options, offset) {
- 763. - extend(__cur, options);
- 764. - if (!__cur.has_more) {
- 765. - hide(__cur.sShowMore);
- 766. - } else {
- 767. - show(__cur.sShowMore);
- 768. - }
- 769. - if (!offset) {
- 770. - if (options.searchInfo) {
- 771. - __cur.searchInfoCont.innerHTML = options.searchInfo;
- 772. - if (!isVisible(__cur.searchInfoCont)) {
- 773. - show(__cur.searchInfoCont);
- 774. - }
- 775. - each(geByClass('audio_friend_name_now', __cur.searchInfoCont), function() {
- 776. - if (this.scrollWidth > this.clientWidth) {
- 777. - this.setAttribute('title', this.innerText || this.textContent);
- 778. - } else {
- 779. - this.removeAttribute('title');
- 780. - }
- 781. - })
- 782. - } else if (isVisible(__cur.searchInfoCont)) {
- 783. - hide(__cur.searchInfoCont);
- 784. - }
- 785. - }
- 786. - },
- 787. -
- 788. - handleFilterPos: function() {
- 789. - if (!Audio.fixedScroll || !cur.audioEl) return false;
- 790. - var headH = cur.audioEl.head.clientHeight, audioNavH = cur.audioEl.bar.offsetHeight,
- 791. - contentY = headH + audioNavH,
- 792. - st = Math.max(0, scrollGetY()), wh = window.lastWindowHeight || 0, pos = 0,
- 793. - filt = ge('side_panel'), filtPos = getXY(filt)[1], filtY = getSize(filt)[1],
- 794. - sf = ge('side_filters'), sfPos = (getStyle(sf, 'position') == 'fixed') ? parseInt(getStyle(sf, 'top')) : getXY(sf)[1], sfY = getSize(sf)[1],
- 795. - bottomPad = Math.max(0, st + wh - filtY - contentY),
- 796. - tooBig = (filtPos + filtY - sfPos - sfY < 20),
- 797. - lastPos = cur.filterLastPos || 100, lastSt = cur.lastSt || 0;
- 798. -
- 799. - if (!tooBig) {
- 800. - addClass(sf, 'fixed');
- 801. - pos = (wh > sfY + contentY) ? Math.min(contentY, wh - sfY - bottomPad) : Math.max(Math.min(contentY, lastPos + lastSt - st), wh - sfY - bottomPad);
- 802. - } else {
- 803. - removeClass(sf, 'fixed');
- 804. - pos = 0;
- 805. - }
- 806. - cur.filterLastPos = pos;
- 807. - cur.lastSt = st;
- 808. - setStyle(sf, {top: pos + 'px'});
- 809. -
- 810. - if (!browser.mozilla && !browser.msie && cur.lastWW !== lastWindowWidth) {
- 811. - cur.lastWW = lastWindowWidth;
- 812. - var goodLeft1 = ge('page_layout').offsetLeft,
- 813. - goodLeft2 = goodLeft1 + cur.audioEl.cont.offsetLeft,
- 814. - goodLeft3 = goodLeft2 + getSize(cur.audioEl.cont)[0] - getSize(cur.audioEl.filters)[0] - 10;
- 815. - cur.audioEl.head.style.left = ge('side_bar').style.left = goodLeft1 + 'px';
- 816. - cur.audioEl.bar.style.left = goodLeft2 + 'px';
- 817. - cur.audioEl.filters.style.left = goodLeft3 + 'px';
- 818. - setTimeout(Audio.resetStyles, 0);
- 819. - }
- 820. - },
- 821. -
- 822. - resetStyles: function() {
- 823. - cur.audioEl.head.style.left = ge('side_bar').style.left =
- 824. - cur.audioEl.bar.style.left = cur.audioEl.filters.style.left = '';
- 825. - },
- 826. -
- 827. - scrollCheck: function () {
- 828. - Audio.handleFilterPos();
- 829. - if (browser.mobile || cur.isAudioLoading || cur.disableAutoMore) return;
- 830. -
- 831. - if (!isVisible(cur.showMore) && !isVisible(cur.sShowMore)) return;
- 832. - if (!cur.curList) {
- 833. - setTimeout(Audio.scrollCheck, 50);
- 834. - return;
- 835. - }
- 836. -
- 837. - var docEl = document.documentElement;
- 838. - var ch = window.innerHeight || docEl.clientHeight || bodyNode.clientHeight;
- 839. - var st = scrollGetY();
- 840. -
- 841. - if (isVisible(cur.showMore) && st + ch + 400 > cur.showMore.offsetTop) {
- 842. - Audio.showRows();
- 843. - }
- 844. - if (isVisible(cur.sShowMore) && st + ch + 400 > cur.sShowMore.offsetTop) {
- 845. - Audio.loadRows();
- 846. - }
- 847. - },
- 848. -
- 849. - updateList: function(opts) {
- 850. - opts = opts || {};
- 851. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 852. - from_pad = !!opts.from_pad, e = opts.event, force = opts.force,
- 853. - showAlbums = opts.showAlbums, fromIndex = opts.fromIndex, obj = __cur.aSearch;
- 854. - if (__cur.silent) {
- 855. - __cur.onSilentLoad = function() {
- 856. - Audio.updateList(opts);
- 857. - };
- 858. - return;
- 859. - }
- 860. - if (e && (e.keyCode == 10 || e.keyCode == 13) || __cur.forceNoAutoComplete) {
- 861. - delete __cur.forceNoAutoComplete
- 862. - delete __cur.autoComplete;
- 863. - } else {
- 864. - __cur.autoComplete = 1;
- 865. - }
- 866. - clearTimeout(this.filterTimeout);
- 867. - this.filterTimeout = setTimeout((function() {
- 868. - var str = trim(obj.value), el;
- 869. - if (str == __cur.searchStr && __cur.autoComplete && !__cur.ignoreEqual) {
- 870. - return;
- 871. - }
- 872. - delete __cur.ignoreEqual;
- 873. - if (!from_pad) {
- 874. - delete nav.objLoc.audio_id;
- 875. - if (nav.objLoc.act == 'recommendations' || nav.objLoc.act == 'popular' || nav.objLoc.act == 'feed' || nav.objLoc.act == 'albums') {
- 876. - delete nav.objLoc.act;
- 877. - }
- 878. - }
- 879. -
- 880. - if (__cur.allAudiosIndex == 'all') {
- 881. - __cur.album_id = 0;
- 882. - }
- 883. - each(geByClass('audio_filter', __cur.albumFilters), function(i, e) {
- 884. - removeClass(e, 'selected');
- 885. - });
- 886. - var c = Audio.allAudios(from_pad).length;
- 887. - if (str) {
- 888. - el = __cur.albumFiltered;
- 889. - hide(__cur.audioFriends);
- 890. - Audio.hideAlbums({from_pad: from_pad});
- 891. - addClass(__cur.clearSearch, 'shown');
- 892. - show(__cur.searchFilters);
- 893. - hide(__cur.searchInfoCont);
- 894. - if (__cur.audioWrap && !c && __cur.allAudiosIndex == 'all') {
- 895. - removeClass(__cur.audioWrap, 'audio_no_recs');
- 896. - }
- 897. - } else {
- 898. - if (showAlbums || __cur.oid != vk.id && !from_pad) {
- 899. - if (__cur.allAudiosIndex == 'all') {
- 900. - el = __cur.albumsFilter || ge((from_pad ? 'pad_' : '') + 'album0');
- 901. - }
- 902. - hide(__cur.audioFriends);
- 903. - Audio.showAlbums({from_pad: from_pad});
- 904. - } else if (fromIndex == 2) {
- 905. - Audio.hideAlbums({from_pad: from_pad});
- 906. - hide(__cur.audioFriends);
- 907. - __cur.searchInfoCont.innerHTML = __cur.performerInfo[__cur.allAudiosIndex];
- 908. - show(__cur.searchInfoCont);
- 909. - } else {
- 910. - Audio.hideAlbums({from_pad: from_pad});
- 911. - show(__cur.audioFriends);
- 912. - hide(__cur.searchInfoCont);
- 913. - if (__cur.allAudiosIndex == 'all') {
- 914. - el = ge((from_pad ? 'pad_' : '') + 'album0');
- 915. - var curEl = geByClass1('current', __cur.friendsList);
- 916. - if (curEl) removeClass(curEl, 'current');
- 917. - }
- 918. - }
- 919. - removeClass(__cur.clearSearch, 'shown');
- 920. - removeClass(__cur.albumFiltered, 'selected');
- 921. - hide(__cur.searchFilters);
- 922. - if (__cur.audioWrap && !c && __cur.allAudiosIndex == 'all' && __cur.oid <= 0) {
- 923. - addClass(__cur.audioWrap, 'audio_no_recs');
- 924. - }
- 925. - }
- 926. - if (el) addClass(el, 'selected');
- 927. - hide(__cur.popularFilters, __cur.popularOwners);
- 928. - if (from_pad) {
- 929. - Audio.updatePadFiltersHeight();
- 930. - }
- 931. - __cur.searchStr = str;
- 932. - this.searchAudios({from_pad: from_pad, str: str, type: __cur.allAudiosIndex, force: force});
- 933. - this.scrollToTop(from_pad);
- 934. - }).bind(this), fromIndex ? 0 : 10);
- 935. - },
- 936. -
- 937. - selectPerformer: function(opts) {
- 938. - opts = opts || {};
- 939. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 940. - from_pad = !!opts.from_pad, event = opts.event, name = opts.name;
- 941. - __cur.aSearch.setValue(name);
- 942. - __cur.forceNoAutoComplete = true;
- 943. - if (event) {
- 944. - __cur.searchTypeMenu.value = 1;
- 945. - __cur.searchTypeChanged({target: {index: 1}}, true);
- 946. - }
- 947. - Audio.updateList({from_pad: from_pad});
- 948. - if (event) cancelEvent(event);
- 949. - },
- 950. -
- 951. - searchAudios: function(opts) {
- 952. - opts = opts || {};
- 953. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 954. - from_pad = !!opts.from_pad, str = opts.str, type = opts.type, force = opts.force;
- 955. - __cur.shownAudios = 0;
- 956. - __cur.curSection = type;
- 957. - if (from_pad && !__cur.audiosIndex) {
- 958. - Audio.loadFriendsAudios({from_pad: from_pad, id: vk.id, index: 'all', str: str});
- 959. - return;
- 960. - }
- 961. - var clubList = (type && type.substr(0, 4) == 'club');
- 962. - if (!clubList && __cur.searchSortFilter) {
- 963. - __cur.searchSortFilter.disable(false);
- 964. - __cur.searchLyricsFilter.disable(false);
- 965. - removeClass(__cur.albumFiltered, 'club_shown');
- 966. - delete __cur.club;
- 967. - }
- 968. - if (str) {
- 969. - var htmlentities = function(s){
- 970. - var el = document.createElement('div');
- 971. - el.innerText = el.textContent = s;
- 972. - s = el.innerHTML;
- 973. - delete el;
- 974. - return s.split('"').join('"');
- 975. - }
- 976. - var htmlencode = function(str){
- 977. - return str.toLowerCase().replace(/\u2013|\u2014/g, '-');
- 978. - var aStr = str.toLowerCase().replace(/\u2013|\u2014/g, '-').split(''), i = aStr.length, aRet = [];
- 979. - while (i--) {
- 980. - var iC = aStr[i].charCodeAt();
- 981. - if ((iC > 127 && iC < 994)) {
- 982. - aRet.push('&#'+iC+';');
- 983. - } else if (iC == 36) {
- 984. - aRet.push('�'+iC+';');
- 985. - } else {
- 986. - aRet.push(htmlentities(aStr[i]));
- 987. - }
- 988. - }
- 989. - return aRet.reverse().join('');
- 990. - }
- 991. - var res = __cur.audiosIndex.search(htmlencode(str));
- 992. - var newList = __cur.curSection;
- 993. - newList += '_search_'+str;
- 994. -
- 995. - __cur.curList = newList;
- 996. - __cur.audiosList[__cur.curList] = res.sort(function(a,b) {return a._order - b._order});
- 997. - audioPlayer.genPlaylist(res, false);
- 998. -
- 999. - if (str) {
- 1000. - str += ' '+(parseLatin(str) || '');
- 1001. - str = trim(escapeRE(str.replace(/\)/g, '')).split('&').join('&'));
- 1002. - __cur.selection = {
- 1003. - re: new RegExp('(\\s|^)('+str.replace(__cur.audiosIndex.delimiter, '|').replace(/(^\||\|$|\?)/g, '')+')', 'gi'),
- 1004. - val: '$1<span>$2</span>'
- 1005. - };
- 1006. - }
- 1007. - } else {
- 1008. - if (!clubList) Audio.hideSearchResults(from_pad);
- 1009. - __cur.curList = __cur.curSection;
- 1010. - audioPlayer.genPlaylist(__cur.audiosList[__cur.curList], false, {my: (__cur.curList == 'all' && (__cur.oid == vk.id || from_pad) ? 'my' : false), htitle: __cur.justShuffled && window.audioPlaylist && audioPlaylist.htitle});
- 1011. - __cur.selection = false;
- 1012. - }
- 1013. -
- 1014. - __cur.sectionCount = (__cur.audiosList[__cur.curList]) ? __cur.audiosList[__cur.curList].length : 0;
- 1015. - this.filterTimeout = setTimeout((function() {
- 1016. - if (!force) {
- 1017. - hide(__cur.sShowMore);
- 1018. - __cur.searchOffset = 0;
- 1019. - }
- 1020. - this.showRows({from_pad: from_pad, force: force});
- 1021. - if (__cur.sectionCount || !__cur.searchStr) {
- 1022. - this.changeSummary({from_pad: from_pad});
- 1023. - }
- 1024. - if (__cur.justShuffled) {
- 1025. - delete __cur.justShuffled;
- 1026. - var aid = currentAudioId();
- 1027. - if (cur.nextPlaylist && (!aid || window.audioPlaylist && !window.audioPlaylist[aid])) {
- 1028. - window.audioPlaylist = clone(cur.nextPlaylist);
- 1029. - }
- 1030. - if (!from_pad) {
- 1031. - Audio.loadCurrentPlaylist();
- 1032. - }
- 1033. - }
- 1034. - }).bind(this), 10);
- 1035. - },
- 1036. -
- 1037. - indexAll: function(opts) {
- 1038. - opts = opts || {};
- 1039. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1040. - from_pad = !!opts.from_pad, callback = opts.callback;
- 1041. - var all = Audio.allAudios(from_pad),
- 1042. - replacer = function(str, p) {
- 1043. - var c = intval(p);
- 1044. - return (c >= 33 && c < 48) ? String.fromCharCode(c) : str;
- 1045. - };
- 1046. -
- 1047. - __cur.audiosIndex = new vkIndexer(all, function(obj) {
- 1048. - __cur.audios[parseInt(obj[1])] = obj;
- 1049. - return (obj[5]+' '+obj[6]).replace(/\&\#(\d+);?/gi, replacer);
- 1050. - }, function() {
- 1051. - if (callback) {
- 1052. - callback();
- 1053. - }
- 1054. - });
- 1055. - },
- 1056. -
- 1057. - changeAllIndex: function(opts) {
- 1058. - opts = opts || {};
- 1059. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1060. - from_pad = !!opts.from_pad, index = opts.index, albumSelected = opts.album,
- 1061. - showAlbums = opts.showAlbums, owner = opts.owner, str = opts.str || '';
- 1062. -
- 1063. - if (!__cur.audiosList[index]) return;
- 1064. - __cur.allAudiosIndex = __cur.curList = index;
- 1065. - this.indexAll({from_pad: from_pad, callback: opts.clbk || function() {
- 1066. - var _a = window.audioPlayer;
- 1067. - Audio.mixAllAudios({from_pad: from_pad, mix: (_a && _a.shuffle), noShuffle: true});
- 1068. - audioPlayer.genPlaylist(__cur.audiosList[__cur.curList], from_pad && index == 'all' && !currentAudioId(), {my: (index == 'all' && (__cur.oid == vk.id || from_pad) ? 'my' : false)});
- 1069. - each(geByTag('div', __cur.albumFilters), function(i, e) {
- 1070. - removeClass(e, 'loading');
- 1071. - });
- 1072. - if (__cur.allLoadedCallback) {
- 1073. - __cur.allLoadedCallback();
- 1074. - delete __cur.allLoadedCallback;
- 1075. - return;
- 1076. - }
- 1077. -
- 1078. - __cur.ignoreEqual = true;
- 1079. -
- 1080. - setStyle(__cur.clearSearch, {opacity: .6});
- 1081. - val(__cur.aSearch, str, true);
- 1082. - toggleClass(__cur.clearSearch, 'shown', !!str);
- 1083. - __cur.searchStr = str;
- 1084. - if (str) {
- 1085. - __cur.forceNoAutoComplete = true;
- 1086. - } else {
- 1087. - Audio.hideSearchResults(from_pad);
- 1088. - }
- 1089. - if (albumSelected) {
- 1090. - Audio.loadAlbum({from_pad: from_pad, album: albumSelected});
- 1091. - } else {
- 1092. - Audio.updateList({from_pad: from_pad, showAlbums: showAlbums, fromIndex: (owner ? 2 : 1)});
- 1093. - }
- 1094. - }});
- 1095. - },
- 1096. -
- 1097. - generateAlbums: function(from_pad) {
- 1098. - var __cur = from_pad ? window._pads && _pads.cur : window.cur;
- 1099. - for (var i in __cur.audiosList) {
- 1100. - if (i.substr(0, 5) == 'album') __cur.audiosList[i] = [];
- 1101. - }
- 1102. - var all = Audio.allAudios(from_pad);
- 1103. - for (var i in all) {
- 1104. - var el = all[i];
- 1105. - if (el[8] && parseInt(el[8])) {
- 1106. - if (!__cur.audiosList['album'+el[8]]) {
- 1107. - __cur.audiosList['album'+el[8]] = [];
- 1108. - }
- 1109. - __cur.audiosList['album'+el[8]].push(el);
- 1110. - }
- 1111. - }
- 1112. - },
- 1113. -
- 1114. - changeHTitle: function(opts) {
- 1115. - opts = opts || {};
- 1116. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1117. - from_pad = !!opts.from_pad, from_search = opts.from_search;
- 1118. - var htitle = __cur.htitle, pad_htitle = '';
- 1119. - if (__cur.curSection && !__cur.curSection.indexOf('album')) {
- 1120. - var album = ge((from_pad ? 'pad_' : '') + __cur.curSection);
- 1121. - if (album) {
- 1122. - htitle = album.innerText || album.textContent;
- 1123. - }
- 1124. - } else if (__cur.curSection && __cur.curSection == 'recommendations') {
- 1125. - htitle = __cur.recommendTitle ? __cur.recommendTitle : getLang('audio_recommended_audios');
- 1126. - } else if (__cur.curSection && __cur.curSection == 'feed') {
- 1127. - htitle = __cur.feedTitle ? __cur.feedTitle : getLang('audio_friends_feed');
- 1128. - } else if (__cur.curSection && __cur.curSection == 'popular') {
- 1129. - htitle = __cur.popularTitle ? __cur.popularTitle : getLang('audio_popular_audios');
- 1130. - } else if (__cur.curSection && __cur.curSection.indexOf('owner') === 0) {
- 1131. - htitle = __cur.allFriendsHTitles[__cur.audioFriend];
- 1132. - } else if (from_search) {
- 1133. - htitle = getLang('audio_title_search').replace('{q}', val(__cur.aSearch));
- 1134. - pad_htitle = getLang('audio_title_search').replace('{q}', '<b>' + val(__cur.aSearch) + '</b>');
- 1135. - } else if (__cur.curSection && !__cur.curSection.indexOf('club')) {
- 1136. - htitle = __cur.allClubsHTitles[__cur.club] || htitle;
- 1137. - } else if (__cur.audioFriend && __cur.allAudiosIndex && !__cur.allAudiosIndex.indexOf('friend')) {
- 1138. - htitle = __cur.allFriendsHTitles[__cur.audioFriend];
- 1139. - }
- 1140. - __cur.lastHTitle = pad_htitle || htitle;
- 1141. - if (from_pad) {
- 1142. - return;
- 1143. - }
- 1144. - if (opts.count && cur.lang.audio_N_recs) {
- 1145. - htitle += ' | ' + getLang('audio_N_recs', opts.count);
- 1146. - }
- 1147. - // Updating document title
- 1148. - document.title = replaceEntities(stripHTML(htitle));
- 1149. - },
- 1150. -
- 1151. - changeSummary: function(opts) {
- 1152. - opts = opts || {};
- 1153. - var from_pad = opts.from_pad, from_search = opts.from_search;
- 1154. - var count = (from_search) ? cur.searchCount : cur.sectionCount;
- 1155. - Audio.changeHTitle({from_pad: from_pad, count: count, from_search: from_search});
- 1156. - },
- 1157. -
- 1158. - setQLoc: function(query) {
- 1159. - clearTimeout(this.qTimeout);
- 1160. - this.qTimeout = setTimeout(function() {
- 1161. - if (cur.allAudiosIndex != 'all') {
- 1162. - if (cur.allAudiosIndex && cur.allAudiosIndex.substr(0, 5) == 'owner') {
- 1163. - extend(nav.objLoc, {owner: cur.audioFriend});
- 1164. - } else {
- 1165. - extend(nav.objLoc, {friend: cur.audioFriend});
- 1166. - }
- 1167. - } else {
- 1168. - delete nav.objLoc.owner;
- 1169. - delete nav.objLoc.friend;
- 1170. - }
- 1171. - if (cur.curSection && cur.curSection.substr(0, 4) == 'club') {
- 1172. - extend(nav.objLoc, {club: cur.club});
- 1173. - } else {
- 1174. - delete nav.objLoc.club;
- 1175. - delete nav.objLoc.genre;
- 1176. - }
- 1177. - if (query) {
- 1178. - extend(nav.objLoc, {q: query});
- 1179. - var performer = cur.searchTypeMenu ? parseInt(cur.searchTypeMenu.val()) : 0;
- 1180. - if (performer) {
- 1181. - extend(nav.objLoc, {performer: performer});
- 1182. - } else {
- 1183. - delete nav.objLoc.performer;
- 1184. - }
- 1185. - } else {
- 1186. - delete nav.objLoc.q;
- 1187. - }
- 1188. - nav.setLoc(nav.objLoc);
- 1189. - }, 500);
- 1190. - },
- 1191. -
- 1192. - filterClaimed: function(arr) {
- 1193. - var len = arr.length;
- 1194. - var res = [];
- 1195. - for (var i = 0; i < len; i++) {
- 1196. - var t = arr[i];
- 1197. - if (t && (!(t[11] && parseInt(t[11])) || t[12] && parseInt(t[12])) || nav.objLoc.claim) {
- 1198. - res.push(t);
- 1199. - }
- 1200. - }
- 1201. - return res;
- 1202. - },
- 1203. -
- 1204. - filterDeleted: function(arr, from_pad) {
- 1205. - var __cur = from_pad ? window._pads && _pads.cur : window.cur;
- 1206. - var len = arr.length;
- 1207. - var res = [];
- 1208. - for (var i = 0; i < len; i++) {
- 1209. - var t = arr[i];
- 1210. - if (__cur && __cur.audios && __cur.audios[t[1]] && !__cur.audios[t[1]].deleted) {
- 1211. - res.push(t);
- 1212. - }
- 1213. - }
- 1214. - return res;
- 1215. - },
- 1216. -
- 1217. - filterByAlbum: function(arr, album) {
- 1218. - var len = arr.length;
- 1219. - var res = [];
- 1220. - for (var i = 0; i < len; i++) {
- 1221. - var t = arr[i];
- 1222. - if (album == t[8]) {
- 1223. - res.push(t);
- 1224. - }
- 1225. - }
- 1226. - return res;
- 1227. - },
- 1228. -
- 1229. - animateAdded: function(el, speed) {
- 1230. - var c = se('<div class="audio_add_wrap anim fl_r"><div class="audio_add_anim_wrap"><div class="audio_add_anim clear_fix"><div class="audio_add fl_l"></div><div class="audio_add done fl_l"></div></div></div></div>');
- 1231. - el.parentNode.replaceChild(c, el);
- 1232. - el = c;
- 1233. - setTimeout(function() {
- 1234. - var anim = geByClass1('audio_add_anim', el), add = anim.firstChild, added = add.nextSibling;
- 1235. - cssAnim(anim, {left: '-15px'}, {duration: speed}, function() {
- 1236. - setStyle(anim.parentNode, {width: '15px'});
- 1237. - setStyle(anim.parentNode.parentNode, {paddingLeft: '2px'});
- 1238. - setStyle(anim, {left: '-13px'});
- 1239. - });
- 1240. - cssAnim(add, {opacity: 0}, {duration: speed});
- 1241. - cssAnim(added, {opacity: 1}, {duration: speed});
- 1242. - }, 0);
- 1243. - return el;
- 1244. - },
- 1245. -
- 1246. - addShareAudio: function(opts) {
- 1247. - opts = opts || {};
- 1248. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1249. - from_pad = !!opts.from_pad, el = opts.el, aid = opts.aid, oid = opts.oid,
- 1250. - hash = opts.hash, gid = opts.gid, top = opts.top;
- 1251. -
- 1252. - if (el.tt) el.tt.hide();
- 1253. - el = Audio.animateAdded(el, 200);
- 1254. - var query = {act:'add', aid:aid, oid:oid, hash:hash, top:top};
- 1255. - if (gid) query.gid = cur.gid;
- 1256. - if (__cur.curSection == 'recommendations') query.recommendation = 1;
- 1257. - if ((cur.module == 'audio' || cur.module == 'feed') && nav.objLoc['q'] || cur.module == 'search' && nav.objLoc['c[q]']) query.search = 1;
- 1258. - ajax.post(Audio.address, query, {
- 1259. - onDone: function (data, res) {
- 1260. - var obj = eval('('+data+')'), all_list;
- 1261. - if (((!cur.gid && (cur.id == vk.id || from_pad)) || (cur.gid && gid)) && obj) {
- 1262. - setTimeout(function(){
- 1263. - obj = obj['all'][0];
- 1264. - if (cur.audiosIndex) {
- 1265. - all_list = cur.audiosList['all'];
- 1266. - if (all_list && all_list.length) {
- 1267. - obj._order = all_list[0]._order - 1;
- 1268. - cur.audiosList['all'].splice(0,0,obj);
- 1269. - } else {
- 1270. - obj._order = 0;
- 1271. - cur.audiosList['all'] = [obj];
- 1272. - }
- 1273. - cur.audios[obj[1]] = obj;
- 1274. - if (cur.allAudiosIndex == 'all') {
- 1275. - cur.audiosIndex.add(obj);
- 1276. - }
- 1277. - }
- 1278. - if (window._pads && _pads.cur && _pads.cur.audiosIndex && _pads.cur.audiosList) {
- 1279. - all_list = _pads.cur.audiosList['all'];
- 1280. - if (all_list && all_list.length) {
- 1281. - obj._order = all_list[0]._order - 1;
- 1282. - _pads.cur.audiosList['all'].splice(0,0,obj);
- 1283. - } else {
- 1284. - obj._order = 0;
- 1285. - _pads.cur.audiosList['all'] = [obj];
- 1286. - }
- 1287. - if (_pads.cur.audios) {
- 1288. - _pads.cur.audios[obj[1]] = obj;
- 1289. - }
- 1290. - if (_pads.cur.allAudiosIndex == 'all') {
- 1291. - _pads.cur.audiosIndex.add(obj);
- 1292. - }
- 1293. - }
- 1294. - if (window.Pads && Pads.clearAudioLoadCache) {
- 1295. - Pads.clearAudioLoadCache();
- 1296. - }
- 1297. - }, 0);
- 1298. - }
- 1299. - var showShare = function() {
- 1300. - addClass(ge('audio'+oid+'_'+aid), 'tt_shown');
- 1301. - showTooltip(el, {
- 1302. - content: res.content,
- 1303. - slide: 15,
- 1304. - shift: [59, 5, 0],
- 1305. - black: 1,
- 1306. - hidedt: 200,
- 1307. - className: 'audio_add_tt wall_tt rich',
- 1308. - onHide: function() {
- 1309. - removeClass(ge('audio'+oid+'_'+aid), 'tt_shown');
- 1310. - }
- 1311. - });
- 1312. - var tip = el.tt;
- 1313. - if (tip && !tip.inited) {
- 1314. - var a = geByClass('add_cont', tip.container)[0];
- 1315. - tip.onClean = function() {
- 1316. - tip.inited = false;
- 1317. - removeEvent(tip.container, 'mouseover', tip.show);
- 1318. - removeEvent(tip.container, 'mouseout', tip.hide);
- 1319. - }
- 1320. - addEvent(tip.container, 'mouseover', tip.show);
- 1321. - addEvent(tip.container, 'mouseout', tip.hide);
- 1322. - addEvent(a, 'click', function(){
- 1323. - toggleClass(this, 'on');
- 1324. - var share_q = {act: 'share_audio', audio:res.audio, status: tip.status? tip.status : 0, check: hasClass(a, 'on')?1:0, hash: res.hash};
- 1325. - if (gid) share_q.gid = cur.gid;
- 1326. - ajax.post(Audio.address, share_q, {
- 1327. - onDone: function(data) {
- 1328. - if (data) tip.status = data;
- 1329. - }
- 1330. - });
- 1331. - });
- 1332. - tip.inited = true;
- 1333. - }
- 1334. - }
- 1335. - addEvent(el, 'mouseover', showShare);
- 1336. - if (!cur.addedIds) cur.addedIds = {};
- 1337. - cur.addedIds[oid+'_'+aid] = 1;
- 1338. - if (window.audioPlayer && currentAudioId()) {
- 1339. - var cur_aids = currentAudioId().split('_');
- 1340. - if (cur_aids[0] == oid && cur_aids[1] == aid) {
- 1341. - audioPlayer.showCurrentAdded();
- 1342. - }
- 1343. - }
- 1344. - }
- 1345. - });
- 1346. - },
- 1347. -
- 1348. - alistOver: function(obj){
- 1349. - if (!hasClass(obj, 'audio_list_cell_on')) {
- 1350. - obj.className = 'audio_list_cell_over';
- 1351. - }
- 1352. - },
- 1353. -
- 1354. - alistOff: function(obj) {
- 1355. - if (!hasClass(obj, 'audio_list_cell_on')){
- 1356. - obj.className = 'audio_list_cell';
- 1357. - }
- 1358. - },
- 1359. -
- 1360. - listOut: function(obj) {
- 1361. - removeClass(obj, 'over');
- 1362. - },
- 1363. -
- 1364. - listOver: function(obj) {
- 1365. - addClass(obj, 'over');
- 1366. - },
- 1367. -
- 1368. - loadAlbum: function(opts) {
- 1369. - opts = opts || {};
- 1370. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1371. - from_pad = !!opts.from_pad,
- 1372. - album_id = opts.album, filter = opts.filter, showAlbums = opts.showAlbums;
- 1373. - if (__cur.silent) {
- 1374. - __cur.onSilentLoad = function() {
- 1375. - Audio.loadAlbum(opts);
- 1376. - };
- 1377. - return;
- 1378. - }
- 1379. - if (!album_id && !showAlbums && (__cur.oid == vk.id) && isVisible(__cur.audioMoreFriensId) && !__cur.searchFriendsStr) {
- 1380. - __cur.shownFriends = [];
- 1381. - Audio.showMoreFriends({from_pad: from_pad, onShow: addClass.pbind(ge((from_pad ? 'pad_' : '') + 'album0'), 'loading'), onHide: removeClass.pbind(ge((from_pad ? 'pad_' : '') + 'album0'), 'loading')});
- 1382. - }
- 1383. - hide(__cur.searchInfoCont);
- 1384. - if (__cur.allAudiosIndex != 'all') {
- 1385. - Audio.loadFriendsAudios({from_pad: from_pad, id: vk.id, index: 'all', album: album_id, showAlbums: showAlbums});
- 1386. - return;
- 1387. - }
- 1388. - if (__cur.audioWrap && !Audio.allAudios(from_pad).length && __cur.allAudiosIndex == 'all' && __cur.oid <= 0) {
- 1389. - addClass(__cur.audioWrap, 'audio_no_recs');
- 1390. - }
- 1391. - if (filter) {
- 1392. - __cur.filterUnsorted = 1;
- 1393. - } else {
- 1394. - delete __cur.filterUnsorted;
- 1395. - }
- 1396. - var curSel = __cur.filterUnsorted ? ge('album_unsorted') : (showAlbums ? __cur.albumsFilter : ge((from_pad ? 'pad_' : '') + 'album' + album_id));
- 1397. - __cur.lastAct = 'album' + album_id;
- 1398. - album_id = album_id || 0;
- 1399. - each(geByClass('audio_filter', __cur.albumFilters), function(i, e) {
- 1400. - removeClass(e, 'selected');
- 1401. - });
- 1402. - if (curSel) addClass(curSel, 'selected');
- 1403. - removeClass(__cur.albumFiltered, 'selected');
- 1404. - hide(__cur.popularFilters, __cur.popularOwners, __cur.searchFilters);
- 1405. - if (album_id == 0 && !showAlbums && (__cur.oid == vk.id || from_pad)) {
- 1406. - Audio.hideAlbums({from_pad: from_pad});
- 1407. - show(__cur.audioFriends);
- 1408. - var curEl = geByClass1('current', __cur.friendsList);
- 1409. - if (curEl) removeClass(curEl, 'current');
- 1410. - } else {
- 1411. - hide(__cur.audioFriends);
- 1412. - Audio.showAlbums({from_pad: from_pad});
- 1413. - }
- 1414. - if (from_pad) {
- 1415. - Audio.updatePadFiltersHeight();
- 1416. - } else {
- 1417. - if (showAlbums && !filter && !album_id) {
- 1418. - Audio.updateAlbums();
- 1419. - }
- 1420. - delete nav.objLoc.q;
- 1421. - delete nav.objLoc.owner;
- 1422. - delete nav.objLoc.friend;
- 1423. - delete __cur.recsOffset;
- 1424. - delete __cur.popularOffset;
- 1425. - delete nav.objLoc.club;
- 1426. - delete nav.objLoc.genre;
- 1427. - delete nav.objLoc.audio_id;
- 1428. - delete __cur._back;
- 1429. - if (nav.objLoc.act == 'recommendations' || nav.objLoc.act == 'popular' || nav.objLoc.act == 'feed' || nav.objLoc.act == 'albums') delete nav.objLoc.act;
- 1430. - if (album_id) {
- 1431. - extend(nav.objLoc, {album_id: album_id});
- 1432. - } else {
- 1433. - delete nav.objLoc.album_id;
- 1434. - }
- 1435. - nav.setLoc(nav.objLoc);
- 1436. - }
- 1437. - clearTimeout(this.filterTimeout);
- 1438. - this.filterTimeout = setTimeout((function() {
- 1439. - val(__cur.aSearch, '');
- 1440. - removeClass(__cur.clearSearch, 'shown');
- 1441. - __cur.searchStr = '';
- 1442. - __cur.album_id = album_id;
- 1443. - var type = (album_id) ? 'album'+album_id : __cur.allAudiosIndex;
- 1444. - this.searchAudios({from_pad: from_pad, type: type, str: ''});
- 1445. - this.hideSearchResults(from_pad);
- 1446. - this.scrollToTop(from_pad);
- 1447. - }).bind(this), 10);
- 1448. - if (__cur.oid == vk.id || from_pad) {
- 1449. - ajax.post(Audio.address, {act: 'list_stats', albums: (album_id || showAlbums) ? 1 : 0});
- 1450. - }
- 1451. - },
- 1452. -
- 1453. - hideAlbums: function(opts) {
- 1454. - opts = opts || {};
- 1455. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1456. - from_pad = !!opts.from_pad, icon = geByClass1('icon', __cur.albumsFilter);
- 1457. - if (isVisible(__cur.audioAlbums)) {
- 1458. - slideUp(__cur.audioAlbums, 200, function() {
- 1459. - if (from_pad) {
- 1460. - Audio.updatePadFiltersHeight();
- 1461. - }
- 1462. - removeClass(icon, 'up');
- 1463. - });
- 1464. - }
- 1465. - },
- 1466. -
- 1467. - showAlbums: function(opts) {
- 1468. - opts = opts || {};
- 1469. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1470. - from_pad = !!opts.from_pad, icon = geByClass1('icon', __cur.albumsFilter);
- 1471. - if (!isVisible(__cur.audioAlbums)) {
- 1472. - if (!from_pad) {
- 1473. - Audio.updateAlbumsStart();
- 1474. - }
- 1475. - slideUp(__cur.audioAlbums, 200, function() {
- 1476. - addClass(icon, 'up');
- 1477. - if (from_pad) {
- 1478. - Audio.updatePadFiltersHeight();
- 1479. - } else {
- 1480. - Audio.updateAlbumsFinish();
- 1481. - }
- 1482. - });
- 1483. - }
- 1484. - },
- 1485. -
- 1486. - toggleAlbums: function(opts) {
- 1487. - opts = opts || {};
- 1488. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1489. - from_pad = !!opts.from_pad, down = isVisible(__cur.audioAlbums),
- 1490. - icon = geByClass1('icon', __cur.albumsFilter);
- 1491. - if (!from_pad) {
- 1492. - Audio.updateAlbumsStart();
- 1493. - }
- 1494. - slideToggle(__cur.audioAlbums, 200, function() {
- 1495. - if (from_pad) {
- 1496. - Audio.updatePadFiltersHeight();
- 1497. - } else {
- 1498. - Audio.updateAlbumsFinish();
- 1499. - }
- 1500. - });
- 1501. - toggleClass(icon, 'up', !down);
- 1502. - },
- 1503. -
- 1504. - addAudio: function(params, event) {
- 1505. - if (cur.uploadBanned) {
- 1506. - setTimeout(showFastBox({title: getLang('audio_no_upload_title'), bodyStyle: 'line-height: 160%;'}, getLang('audio_claims_no_upload')).hide, 5000);
- 1507. - if (event) cancelEvent(event);
- 1508. - return false;
- 1509. - }
- 1510. - showBox(Audio.address, extend(params || {}, {act: 'new_audio', gid: cur.gid}), {
- 1511. - params: {width: '440px', bodyStyle: 'padding: 0px; position: relative;'}
- 1512. - });
- 1513. - if (event) cancelEvent(event);
- 1514. - return false;
- 1515. - },
- 1516. -
- 1517. - mixAllAudios: function(opts) {
- 1518. - opts = opts || {};
- 1519. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1520. - from_pad = !!opts.from_pad, mix = opts.mix, noShuffle = opts.noShuffle;
- 1521. - var all_list = Audio.allAudios(from_pad), _a = window.audioPlayer, current = 0;
- 1522. - if (!all_list) return;
- 1523. - if (mix) {
- 1524. - if (all_list[0] && all_list[0]._old_order !== undefined) return;
- 1525. - for (var i = all_list.length; i; ) {
- 1526. - var j = parseInt(Math.random() * i)
- 1527. - var x = all_list[--i];
- 1528. - all_list[i] = all_list[j];
- 1529. - all_list[i]._old_order = all_list[i]._order;
- 1530. - all_list[i]._order = i;
- 1531. - if (currentAudioId() == all_list[i][0]+'_'+all_list[i][1]) {
- 1532. - current = i;
- 1533. - }
- 1534. - all_list[j] = x;
- 1535. - };
- 1536. - if (current) {
- 1537. - var x = all_list[current];
- 1538. - all_list[current] = all_list[0];
- 1539. - all_list[current]._order = current;
- 1540. - all_list[0] = x;
- 1541. - all_list[0]._order = 0;
- 1542. - }
- 1543. - } else {
- 1544. - for (var i in all_list) {
- 1545. - if (all_list[i]._old_order !== undefined) {
- 1546. - all_list[i]._order = all_list[i]._old_order;
- 1547. - delete all_list[i]._old_order;
- 1548. - }
- 1549. - };
- 1550. - }
- 1551. - if (!noShuffle) __cur.justShuffled = true;
- 1552. - },
- 1553. - mixAudios: function() {
- 1554. - if (cur.silent) {
- 1555. - cur.onSilentLoad = function() {
- 1556. - Audio.mixAudios();
- 1557. - };
- 1558. - return;
- 1559. - }
- 1560. - var _a = window.audioPlayer;
- 1561. - Audio.mixAllAudios({mix: _a && _a.shuffle});
- 1562. - if (cur.curSection == 'recommendations') {
- 1563. - Audio.loadRecommendations({update: 'remix'});
- 1564. - return;
- 1565. - }
- 1566. - if (cur.curSection == 'popular') {
- 1567. - Audio.loadPopular({update: 'remix'});
- 1568. - return;
- 1569. - }
- 1570. - cur.ignoreEqual = true;
- 1571. - if (cur.album_id) {
- 1572. - this.loadAlbum({album: cur.album_id});
- 1573. - } else {
- 1574. - this.updateList();
- 1575. - }
- 1576. - cur.shuffled = _a && _a.shuffle;
- 1577. - },
- 1578. -
- 1579. - loadRecommendations: function(opts) {
- 1580. - opts = opts || {};
- 1581. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1582. - from_pad = !!opts.from_pad, update = opts.update, audioId = opts.audioId;
- 1583. - if (__cur.loadingRecs) return;
- 1584. - if (update) {
- 1585. - delete __cur.recsOffset;
- 1586. - delete __cur.recommendIds;
- 1587. - delete __cur.recommendAudios;
- 1588. - delete __cur.preloadJSON;
- 1589. - }
- 1590. - if (audioId) {
- 1591. - __cur.recsAudioId = audioId;
- 1592. - } else if (update === true) {
- 1593. - delete __cur.recsAudioId;
- 1594. - }
- 1595. - each(geByClass('audio_filter', __cur.albumFilters), function(i, e) {
- 1596. - removeClass(e, 'selected');
- 1597. - });
- 1598. - if (__cur.searchStr && isVisible(__cur.searchInfoCont)) {
- 1599. - hide(__cur.searchInfoCont);
- 1600. - }
- 1601. - if (from_pad && ge('pad_footer_text')) {
- 1602. - ge('pad_footer_text').innerHTML = '';
- 1603. - }
- 1604. - var rec_filter = __cur.recFilter;
- 1605. - addClass(rec_filter, 'selected');
- 1606. - removeClass(__cur.albumFiltered, 'selected');
- 1607. - hide(__cur.searchFilters, __cur.popularFilters);
- 1608. - if (from_pad || __cur.oid == vk.id) {
- 1609. - hide(__cur.audioFriends, __cur.searchInfoCont);
- 1610. - Audio.hideAlbums({from_pad: from_pad});
- 1611. - }
- 1612. - if (from_pad && ge('pad_footer_text')) {
- 1613. - ge('pad_footer_text').innerHTML = '';
- 1614. - }
- 1615. - removeClass(__cur.albumFiltered, 'club_shown');
- 1616. - Audio.handleFilterPos();
- 1617. - __cur.lastSection = __cur.curSection;
- 1618. - __cur.curSection = 'recommendations';
- 1619. - if (__cur.recsOffset === undefined) {
- 1620. - __cur.recsOffset = 0;
- 1621. - } else {
- 1622. - addClass(__cur.showMore, 'loading');
- 1623. - }
- 1624. - if (__cur.recommendIds === undefined) __cur.recommendIds = [];
- 1625. - if (__cur.recommendAudios === undefined) __cur.recommendAudios = [];
- 1626. - if (__cur.recsCount === undefined) __cur.recsCount = 0;
- 1627. - if (__cur.sPreload.innerHTML) {
- 1628. - while (__cur.sPreload.firstChild) {
- 1629. - var el = __cur.sPreload.firstChild;
- 1630. - __cur.aContent.appendChild(el);
- 1631. - __cur.recsCount++;
- 1632. - }
- 1633. - if (from_pad && window.Pads && Pads.updateHeight) {
- 1634. - Pads.updateHeight();
- 1635. - }
- 1636. - }
- 1637. - if (__cur.preloadJSON) {
- 1638. - json = __cur.preloadJSON['all'];
- 1639. - var cur_order = __cur.recsCount;
- 1640. - for (var i in json) {
- 1641. - var audio = json[i];
- 1642. - audio._order = cur_order++;
- 1643. - if (indexOf(__cur.recommendIds, audio[0]+"_"+audio[1]) == -1) {
- 1644. - __cur.recommendIds.push(audio[0]+"_"+audio[1]);
- 1645. - __cur.recommendAudios.push(audio);
- 1646. - }
- 1647. - }
- 1648. - var aid = currentAudioId(), needs_update = __cur.recsOffset && (aid && __cur.recommendIds && indexOf(__cur.recommendIds, aid) != -1);
- 1649. - audioPlayer.genPlaylist(__cur.recommendAudios, needs_update);
- 1650. - }
- 1651. - if (__cur.noRecommendations) {
- 1652. - hide(__cur.showMore);
- 1653. - delete __cur.noRecommendations;
- 1654. - return;
- 1655. - }
- 1656. - if (opts.tt) {
- 1657. - opts.tt.hide();
- 1658. - }
- 1659. - __cur.loadingRecs = true;
- 1660. - __cur.lastAct = 'recommendations';
- 1661. - var offset = __cur.recsOffset, query = {act: 'get_recommendations', id: __cur.id, offset: offset},
- 1662. - needsUpdate = window.audioPlayer && audioPlayer.shuffle;
- 1663. - if (from_pad) {
- 1664. - query.from_pad = 1;
- 1665. - }
- 1666. - if (update == 'remix' || needsUpdate != __cur.recsRemix) {
- 1667. - __cur.recsRemix = needsUpdate;
- 1668. - query.remix = needsUpdate ? 1 : 0;
- 1669. - var aid = currentAudioId();
- 1670. - if (aid && window.audioPlaylist && audioPlaylist[aid] && audioPlaylist.address && audioPlaylist.address.indexOf('act=recommendations') > 0) {
- 1671. - var a = audioPlaylist[aid];
- 1672. - if (a[10]) query.current = a[10]+' '+aid;
- 1673. - }
- 1674. - }
- 1675. - if (__cur.recsAudioId) {
- 1676. - query.audio_id = __cur.recsAudioId;
- 1677. - }
- 1678. - ajax.post(Audio.address, query, {
- 1679. - onDone: function(rows, preload, json, preload_json, options, ownersRows) {
- 1680. - delete __cur.loadingRecs;
- 1681. - if (__cur.lastAct != 'recommendations') return;
- 1682. - if (!offset) {
- 1683. - if (ownersRows) {
- 1684. - val((from_pad ? 'pad_' : '') + 'audio_popular_owners_rows', ownersRows);
- 1685. - show(__cur.popularOwners);
- 1686. - } else {
- 1687. - hide(__cur.popularOwners);
- 1688. - }
- 1689. - }
- 1690. - if (from_pad) {
- 1691. - Audio.updatePadFiltersHeight();
- 1692. - }
- 1693. - if (options.recsCount === 0 && offset) {
- 1694. - __cur.noRecommendations = true;
- 1695. - delete options.recsOffset;
- 1696. - }
- 1697. - if (json) {
- 1698. - json = eval('('+json+')');
- 1699. - json = json['all'];
- 1700. - var cur_order = __cur.recsCount;
- 1701. - for (var i in json) {
- 1702. - var audio = json[i];
- 1703. - audio._order = cur_order++;
- 1704. - if (indexOf(__cur.recommendIds, audio[0]+"_"+audio[1]) == -1) {
- 1705. - __cur.recommendIds.push(audio[0]+"_"+audio[1]);
- 1706. - __cur.recommendAudios.push(audio);
- 1707. - }
- 1708. - }
- 1709. - var aid = currentAudioId(), needs_update = query.offset && (aid && __cur.recommendIds && indexOf(__cur.recommendIds, aid) != -1);
- 1710. - audioPlayer.genPlaylist(__cur.recommendAudios, needs_update);
- 1711. - if (query.audio_id) {
- 1712. - cur.nextPlaylist.rec = 1;
- 1713. - }
- 1714. - }
- 1715. - removeClass(__cur.showMore, 'loading');
- 1716. - if (offset) {
- 1717. - delete options.recsCount;
- 1718. - }
- 1719. - if (options) extend(__cur, options);
- 1720. - if (!offset) {
- 1721. - __cur.aContent.innerHTML = rows;
- 1722. - if (from_pad && window.Pads && Pads.updateHeight) {
- 1723. - Pads.updateHeight();
- 1724. - }
- 1725. - }
- 1726. -
- 1727. - __cur.preloadJSON = preload_json ? eval('('+preload_json+')') : false;
- 1728. - __cur.sPreload.innerHTML = '';
- 1729. - var au = ce('div', {innerHTML: preload});
- 1730. - while (au.firstChild) {
- 1731. - if (!ge(au.firstChild.id)) {
- 1732. - var el = au.firstChild;
- 1733. - __cur.sPreload.appendChild(el);
- 1734. - } else {
- 1735. - au.removeChild(au.firstChild);
- 1736. - }
- 1737. - }
- 1738. -
- 1739. - if (__cur.recsCount && !query.audio_id) {
- 1740. - show(__cur.showMore);
- 1741. - } else {
- 1742. - hide(__cur.showMore);
- 1743. - }
- 1744. - if (query.remix) {
- 1745. - __cur.justShuffled = true;
- 1746. - }
- 1747. - Audio.changeHTitle({from_pad: from_pad});
- 1748. - val(__cur.aSearch, '');
- 1749. - removeClass(__cur.clearSearch, 'shown');
- 1750. - __cur.searchStr = '';
- 1751. - __cur.album_id = 0;
- 1752. - Audio.hideSearchResults(from_pad);
- 1753. - hide(__cur.sShowMore);
- 1754. - if (!offset) {
- 1755. - Audio.scrollToTop(from_pad);
- 1756. - }
- 1757. - if (!from_pad) {
- 1758. - delete nav.objLoc.q;
- 1759. - delete nav.objLoc.owner;
- 1760. - delete nav.objLoc.friend;
- 1761. - delete nav.objLoc.album_id;
- 1762. - delete nav.objLoc.club;
- 1763. - delete nav.objLoc.genre;
- 1764. - delete __cur._back;
- 1765. - extend(nav.objLoc, {act: 'recommendations'});
- 1766. - if (query.audio_id) {
- 1767. - extend(nav.objLoc, {audio_id: query.audio_id});
- 1768. - } else {
- 1769. - delete nav.objLoc.audio_id;
- 1770. - }
- 1771. - nav.setLoc(nav.objLoc);
- 1772. - }
- 1773. - var _a = window.audioPlayer;
- 1774. - if (_a && _a.showCurrentTrack) _a.showCurrentTrack();
- 1775. - if (!from_pad) {
- 1776. - Audio.loadCurrentPlaylist();
- 1777. - }
- 1778. - },
- 1779. - onFail: function(msg) {
- 1780. - delete __cur.loadingRecs;
- 1781. - __cur.curSection = __cur.lastSection;
- 1782. - removeClass(__cur.recFilter, 'selected');
- 1783. - setTimeout(showFastBox(getLang('global_error'), msg).hide, 3000);
- 1784. - return true;
- 1785. - },
- 1786. - showProgress: function () {
- 1787. - addClass(rec_filter, 'loading');
- 1788. - },
- 1789. - hideProgress: function () {
- 1790. - removeClass(rec_filter, 'loading');
- 1791. - }
- 1792. - });
- 1793. - __cur.recsOffset += offset ? 50 : 100;
- 1794. - },
- 1795. -
- 1796. - loadPopular: function(opts) {
- 1797. - opts = opts || {};
- 1798. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 1799. - from_pad = !!opts.from_pad, update = opts.update, genre = opts.genre;
- 1800. - if (__cur.silent) {
- 1801. - __cur.onSilentLoad = function() {
- 1802. - Audio.loadPopular(opts);
- 1803. - };
- 1804. - return;
- 1805. - }
- 1806. - if (__cur.loadingPopular) return;
- 1807. - if (__cur.popularAudios === undefined) {
- 1808. - __cur.popularAudios = [];
- 1809. - }
- 1810. - if (update) {
- 1811. - delete __cur.popularOffset;
- 1812. - delete __cur.popularIds;
- 1813. - delete __cur.popularAudios[genre];
- 1814. - delete __cur.preloadJSON;
- 1815. - if (genre !== undefined) {
- 1816. - __cur.genre = genre;
- 1817. - }
- 1818. - }
- 1819. - each(geByClass('audio_filter', __cur.albumFilters), function(i, e) {
- 1820. - removeClass(e, 'selected');
- 1821. - });
- 1822. - if (__cur.searchStr && isVisible(__cur.searchInfoCont)) {
- 1823. - hide(__cur.searchInfoCont);
- 1824. - }
- 1825. - if (from_pad && ge('pad_footer_text')) {
- 1826. - ge('pad_footer_text').innerHTML = '';
- 1827. - }
- 1828. - var genre_filter = false;
- 1829. - if (__cur.genre) {
- 1830. - var prevGenre = geByClass1('selected', __cur.popularGenres);
- 1831. - if (prevGenre) {
- 1832. - removeClass(prevGenre, 'selected');
- 1833. - }
- 1834. -
- 1835. - genre_filter = ge((from_pad ? 'pad_' : '') + 'audio_genre_'+__cur.genre);
- 1836. - if (genre_filter) {
- 1837. - addClass(genre_filter, 'selected');
- 1838. - } else {
- 1839. - __cur.genre = 0;
- 1840. - }
- 1841. - }
- 1842. - var pop_filter = __cur.topFilter;
- 1843. - addClass(pop_filter, 'selected');
- 1844. - removeClass(__cur.albumFiltered, 'selected');
- 1845. - toggle(__cur.audioFriends, false);
- 1846. - hide(__cur.searchInfoCont);
- 1847. - if (__cur.popularFilters) {
- 1848. - show(__cur.popularFilters);
- 1849. - Audio.hideAlbums({from_pad: from_pad});
- 1850. - } else {
- 1851. - Audio.showAlbums({from_pad: from_pad});
- 1852. - }
- 1853. - removeClass(__cur.albumFiltered, 'club_shown');
- 1854. - hide(__cur.searchFilters, __cur.popularOwners);
- 1855. - Audio.handleFilterPos();
- 1856. - __cur.curSection = 'popular';
- 1857. - if (__cur.popularOffset === undefined) {
- 1858. - __cur.popularOffset = 0;
- 1859. - } else {
- 1860. - addClass(__cur.showMore, 'loading');
- 1861. - }
- 1862. - if (__cur.popularIds === undefined) __cur.popularIds = [];
- 1863. - if (__cur.popularAudios[genre] === undefined) __cur.popularAudios[genre] = [];
- 1864. - if (__cur.popularCount === undefined) __cur.popularCount = 0;
- 1865. - if (__cur.sPreload.innerHTML) {
- 1866. - while (__cur.sPreload.firstChild) {
- 1867. - var el = __cur.sPreload.firstChild;
- 1868. - __cur.aContent.appendChild(el);
- 1869. - __cur.popularCount++;
- 1870. - }
- 1871. - if (from_pad && window.Pads && Pads.updateHeight) {
- 1872. - Pads.updateHeight();
- 1873. - }
- 1874. - }
- 1875. - if (__cur.preloadJSON) {
- 1876. - json = __cur.preloadJSON['all'];
- 1877. - var cur_order = __cur.popularCount;
- 1878. - for (var i in json) {
- 1879. - var audio = json[i];
- 1880. - audio._order = cur_order++;
- 1881. - if (indexOf(__cur.popularIds, audio[0]+"_"+audio[1]) == -1) {
- 1882. - __cur.popularIds.push(audio[0]+"_"+audio[1]);
- 1883. - __cur.popularAudios[genre].push(audio);
- 1884. - }
- 1885. - }
- 1886. - var aid = currentAudioId(), needs_update = __cur.popularOffset && (aid && __cur.popularIds && indexOf(__cur.popularIds, aid) != -1);
- 1887. - audioPlayer.genPlaylist(__cur.popularAudios[genre], needs_update);
- 1888. - }
- 1889. - if (__cur.noPopular) {
- 1890. - hide(__cur.showMore);
- 1891. - delete __cur.noPopular;
- 1892. - return;
- 1893. - }
- 1894. - __cur.loadingPopular = true;
- 1895. - __cur.lastAct = 'popular';
- 1896. - var offset = __cur.popularOffset, query = {act: 'get_popular', offset: offset},
- 1897. - needsUpdate = window.audioPlayer && audioPlayer.shuffle;
- 1898. - if (from_pad) {
- 1899. - query.from_pad = 1;
- 1900. - }
- 1901. - if (nav.objLoc.update) {
- 1902. - query.update = 1;
- 1903. - }
- 1904. - if (needsUpdate && !offset) query.offset = -1;
- 1905. - if (update == 'remix' || needsUpdate != __cur.popRemix) {
- 1906. - __cur.popRemix = needsUpdate;
- 1907. - query.remix = needsUpdate ? 1 : 0;
- 1908. - var aid = currentAudioId();
- 1909. - if (aid && window.audioPlaylist && audioPlaylist[aid] && audioPlaylist.address && audioPlaylist.address.indexOf('act=popular') > 0) {
- 1910. - query.current = aid;
- 1911. - }
- 1912. - }
- 1913. - if (__cur.topType !== undefined) {
- 1914. - query.type = __cur.topType;
- 1915. - delete __cur.topType;
- 1916. - }
- 1917. - if (__cur.genre) {
- 1918. - query.genre = __cur.genre;
- 1919. - }
- 1920. - ajax.post(Audio.address, query, {
- 1921. - onDone: function(rows, preload, json, preload_json, options, genres) {
- 1922. - delete __cur.loadingPopular;
- 1923. - if (__cur.lastAct != 'popular') return;
- 1924. - if (options.popularCount === 0 && offset) {
- 1925. - __cur.noPopular = true;
- 1926. - delete options.popularOffset;
- 1927. - }
- 1928. - if (json) {
- 1929. - json = eval('('+json+')');
- 1930. - json = json['all'];
- 1931. - var cur_order = __cur.popularCount;
- 1932. - for (var i in json) {
- 1933. - var audio = json[i];
- 1934. - audio._order = cur_order++;
- 1935. - if (indexOf(__cur.popularIds, audio[0]+"_"+audio[1]) == -1) {
- 1936. - __cur.popularIds.push(audio[0]+"_"+audio[1]);
- 1937. - __cur.popularAudios[genre].push(audio);
- 1938. - }
- 1939. - }
- 1940. - var aid = currentAudioId(), needs_update = query.offset && (aid && __cur.popularIds && indexOf(__cur.popularIds, aid) != -1);
- 1941. - audioPlayer.genPlaylist(__cur.popularAudios[genre], needs_update);
- 1942. - }
- 1943. - removeClass(__cur.showMore, 'loading');
- 1944. - if (offset) {
- 1945. - delete options.popularCount;
- 1946. - }
- 1947. - if (options) extend(__cur, options);
- 1948. - if (!offset) {
- 1949. - __cur.aContent.innerHTML = rows;
- 1950. - if (from_pad && window.Pads && Pads.updateHeight) {
- 1951. - Pads.updateHeight();
- 1952. - }
- 1953. - Audio.scrollToTop(from_pad);
- 1954. - }
- 1955. -
- 1956. - if (preload_json) {
- 1957. - __cur.preloadJSON = eval('('+preload_json+')');
- 1958. - } else {
- 1959. - __cur.preloadJSON = {};
- 1960. - }
- 1961. - __cur.sPreload.innerHTML = '';
- 1962. - var au = ce('div', {innerHTML: preload});
- 1963. - while (au.firstChild) {
- 1964. - if (!ge(au.firstChild.id)) {
- 1965. - var el = au.firstChild;
- 1966. - __cur.sPreload.appendChild(el);
- 1967. - } else {
- 1968. - au.removeChild(au.firstChild);
- 1969. - }
- 1970. - }
- 1971. -
- 1972. - if (__cur.popularCount) {
- 1973. - show(__cur.showMore);
- 1974. - } else {
- 1975. - hide(__cur.showMore);
- 1976. - }
- 1977. - if (update == 'remix') {
- 1978. - __cur.justShuffled = true;
- 1979. - }
- 1980. - if (genres) {
- 1981. - __cur.popularGenres.innerHTML = genres;
- 1982. - }
- 1983. - Audio.changeHTitle({from_pad: from_pad});
- 1984. - val(__cur.aSearch, '');
- 1985. - removeClass(__cur.clearSearch, 'shown');
- 1986. - __cur.searchStr = '';
- 1987. - __cur.album_id = 0;
- 1988. - Audio.hideSearchResults(from_pad);
- 1989. - hide(__cur.sShowMore);
- 1990. - if (!from_pad) {
- 1991. - delete nav.objLoc.q;
- 1992. - delete nav.objLoc.owner;
- 1993. - delete nav.objLoc.friend;
- 1994. - delete nav.objLoc.album_id;
- 1995. - delete nav.objLoc.club;
- 1996. - delete nav.objLoc.genre;
- 1997. - delete nav.objLoc.audio_id;
- 1998. - nav.objLoc.act = 'popular';
- 1999. - if (__cur.genre) {
- 2000. - nav.objLoc.genre = __cur.genre;
- 2001. - } else {
- 2002. - delete nav.objLoc.genre;
- 2003. - }
- 2004. - nav.setLoc(nav.objLoc);
- 2005. - }
- 2006. - var _a = window.audioPlayer;
- 2007. - if (_a && _a.showCurrentTrack) _a.showCurrentTrack();
- 2008. - if (window.tooltips) {
- 2009. - tooltips.destroyAll();
- 2010. - }
- 2011. - if (!from_pad) {
- 2012. - Audio.loadCurrentPlaylist();
- 2013. - }
- 2014. - if (options.infoJS) {
- 2015. - eval('(function(){' + options.infoJS + ';})()');
- 2016. - }
- 2017. - },
- 2018. - showProgress: function () {
- 2019. - addClass(genre_filter || pop_filter, 'loading');
- 2020. - },
- 2021. - hideProgress: function () {
- 2022. - removeClass(genre_filter || pop_filter, 'loading');
- 2023. - }
- 2024. - });
- 2025. - __cur.popularOffset += offset ? 50 : 100;
- 2026. - },
- 2027. -
- 2028. - loadFeed: function(opts) {
- 2029. - opts = opts || {};
- 2030. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 2031. - from_pad = !!opts.from_pad, update = opts.update;
- 2032. - if (__cur.silent) {
- 2033. - __cur.onSilentLoad = function() {
- 2034. - Audio.loadFeed(opts);
- 2035. - };
- 2036. - return;
- 2037. - }
- 2038. - if (__cur.isFeedLoading) return;
- 2039. - __cur.isFeedLoading = true;
- 2040. - if (__cur.audiosList && __cur.audiosList['all'] && __cur.allAudiosIndex != 'all') {
- 2041. - __cur.allAudiosIndex = 'all';
- 2042. - this.indexAll({from_pad: from_pad});
- 2043. - var curEl = geByClass1('current', __cur.friendsList);
- 2044. - if (curEl) removeClass(curEl, 'current');
- 2045. - }
- 2046. - if (update) {
- 2047. - delete __cur.feedFrom;
- 2048. - delete __cur.feedOffset;
- 2049. - delete __cur.feedIds;
- 2050. - delete __cur.feedAudios;
- 2051. - if (update === 'reload') {
- 2052. - var params = {act: 'feed', part: 1, update: 1}, q = Audio.address + '#' + ajx2q(params);
- 2053. - delete window.ajaxCache[q];
- 2054. - }
- 2055. - }
- 2056. - each(geByClass('audio_filter', __cur.albumFilters), function(i, e) {
- 2057. - removeClass(e, 'selected');
- 2058. - });
- 2059. - if (__cur.searchStr && isVisible(__cur.searchInfoCont)) {
- 2060. - hide(__cur.searchInfoCont);
- 2061. - }
- 2062. - if (from_pad && ge('pad_footer_text')) {
- 2063. - ge('pad_footer_text').innerHTML = '';
- 2064. - }
- 2065. - addClass(__cur.feedFilter, 'selected');
- 2066. - removeClass(__cur.albumFiltered, 'selected');
- 2067. - hide(__cur.searchFilters, __cur.popularFilters, __cur.popularOwners);
- 2068. - if (from_pad || __cur.oid == vk.id) {
- 2069. - show(__cur.audioFriends);
- 2070. - hide(__cur.searchInfoCont);
- 2071. - Audio.hideAlbums({from_pad: from_pad});
- 2072. - }
- 2073. - removeClass(__cur.albumFiltered, 'club_shown');
- 2074. - Audio.handleFilterPos();
- 2075. - __cur.lastSection = __cur.curSection;
- 2076. - __cur.curSection = 'feed';
- 2077. - if (!update) {
- 2078. - addClass(__cur.showMore, 'loading');
- 2079. - }
- 2080. - __cur.lastAct = 'feed';
- 2081. - var query = {act: 'feed', offset: __cur.feedOffset, from: __cur.feedFrom, part: 1, update: update ? 1 : ''};
- 2082. - if (from_pad) {
- 2083. - query.from_pad = 1;
- 2084. - }
- 2085. - ajax.post(Audio.address, query, {
- 2086. - onDone: function (rows, script) {
- 2087. - if (__cur.lastAct != 'feed') return;
- 2088. - if (rows) {
- 2089. - if (update) {
- 2090. - __cur.aContent.innerHTML = rows;
- 2091. - } else {
- 2092. - var au = ce('div'), par = geByClass1('wall_module', __cur.aContent), row;
- 2093. - au.innerHTML = rows;
- 2094. - if (par && update) {
- 2095. - par.innerHTML = '';
- 2096. - }
- 2097. - while (row = au.firstChild) {
- 2098. - if (!row.id || ge(row.id)) {
- 2099. - au.removeChild(row);
- 2100. - continue;
- 2101. - }
- 2102. - if (par) {
- 2103. - par.appendChild(row);
- 2104. - }
- 2105. - }
- 2106. - }
- 2107. - } else {
- 2108. - hide(__cur.showMore);
- 2109. - }
- 2110. - if (from_pad && window.Pads && Pads.updateHeight) {
- 2111. - Pads.updateHeight();
- 2112. - }
- 2113. - if (script) {
- 2114. - eval(script);
- 2115. - }
- 2116. - var aid = currentAudioId(), needs_update = query.offset && (aid && __cur.feedIds && indexOf(__cur.feedIds, aid) != -1 && window.audioPlaylist && audioPlaylist.address && audioPlaylist.address.indexOf('act=feed') != -1);
- 2117. - audioPlayer.genPlaylist(__cur.feedAudios, needs_update);
- 2118. - removeClass(__cur.showMore, 'loading');
- 2119. - Audio.changeHTitle({from_pad: from_pad});
- 2120. - val(__cur.aSearch, '');
- 2121. - removeClass(__cur.clearSearch, 'shown');
- 2122. - __cur.searchStr = '';
- 2123. - __cur.album_id = 0;
- 2124. - Audio.hideSearchResults(from_pad);
- 2125. - hide(__cur.sShowMore);
- 2126. - if (update) {
- 2127. - Audio.scrollToTop(from_pad);
- 2128. - }
- 2129. - if (!from_pad) {
- 2130. - delete nav.objLoc.q;
- 2131. - delete nav.objLoc.owner;
- 2132. - delete nav.objLoc.friend;
- 2133. - delete nav.objLoc.album_id;
- 2134. - delete nav.objLoc.club;
- 2135. - delete nav.objLoc.genre;
- 2136. - delete nav.objLoc.audio_id;
- 2137. - delete __cur._back;
- 2138. - extend(nav.objLoc, {act: 'feed'});
- 2139. - nav.setLoc(nav.objLoc);
- 2140. - }
- 2141. - var _a = window.audioPlayer;
- 2142. - if (_a && _a.showCurrentTrack) _a.showCurrentTrack();
- 2143. - },
- 2144. - showProgress: function () {
- 2145. - __cur.isFeedLoading = true;
- 2146. - addClass(__cur.feedFilter, 'loading');
- 2147. - },
- 2148. - hideProgress: function () {
- 2149. - __cur.isFeedLoading = false;
- 2150. - removeClass(__cur.feedFilter, 'loading');
- 2151. - },
- 2152. - cache: 1
- 2153. - });
- 2154. - },
- 2155. -
- 2156. - loadCurrentPlaylist: function() {
- 2157. - if (!window.Pads || !Pads.showAudios || !window._pads || _pads.shown != 'mus') {
- 2158. - return;
- 2159. - }
- 2160. - var __cur = _pads.cur;
- 2161. - __cur.aContent.innerHTML = '';
- 2162. -
- 2163. - each(geByClass('audio_filter', __cur.albumFilters), function(i, e) {
- 2164. - removeClass(e, 'selected');
- 2165. - });
- 2166. - removeClass(__cur.albumFiltered, 'selected');
- 2167. - addClass(__cur.currentFilter, 'selected');
- 2168. - hide(__cur.popularFilters, __cur.popularOwners, __cur.searchFilters, __cur.searchInfoCont);
- 2169. - show(__cur.audioFriends, __cur.showMore, __cur.currentFilter);
- 2170. - Audio.hideAlbums({from_pad: true});
- 2171. -
- 2172. - val(__cur.aSearch, '');
- 2173. - removeClass(__cur.clearSearch, 'shown');
- 2174. - __cur.lastSection = __cur.curSection;
- 2175. - __cur.lastAct = __cur.searchStr = __cur.curSection = '';
- 2176. - __cur.album_id = 0;
- 2177. - Audio.hideSearchResults(true);
- 2178. -
- 2179. - Pads.showAudios();
- 2180. -
- 2181. - var _a = window.audioPlayer;
- 2182. - if (_a && _a.showCurrentTrack) _a.showCurrentTrack();
- 2183. - },
- 2184. -
- 2185. - reorderPlaylist: function(aid, before_id, after_id) {
- 2186. - each([window.audioPlaylist, cur.nextPlaylist], function(i, e) {
- 2187. - var list = e;
- 2188. - if (before_id && !after_id && list && list[before_id]) {
- 2189. - after_id = list[before_id]._prev;
- 2190. - }
- 2191. - if (list && list[aid] && after_id && list[after_id] && after_id != aid) {
- 2192. - var next_id = list[aid]._next, prev_id = list[aid]._prev;
- 2193. - if (next_id != aid) {
- 2194. - list[next_id]._prev = prev_id;
- 2195. - list[prev_id]._next = next_id;
- 2196. - list[aid]._prev = after_id;
- 2197. - list[aid]._next = list[after_id]._next;
- 2198. - list[after_id]._next = list[list[after_id]._next]._prev = aid;
- 2199. - }
- 2200. - }
- 2201. - });
- 2202. - var plist = ls.get('pad_playlist');
- 2203. - if (plist && plist[aid] && after_id && plist[after_id] && after_id != aid && window.audioPlayer) {
- 2204. - audioPlayer.setPadPlaylist();
- 2205. - }
- 2206. - },
- 2207. -
- 2208. - removeFromPlaylist: function(aid) {
- 2209. - each([window.audioPlaylist, cur.nextPlaylist], function(i, e) {
- 2210. - var list = e;
- 2211. - if (list && list[aid]) {
- 2212. - var next_id = list[aid]._next, prev_id = list[aid]._prev;
- 2213. - if (next_id != aid) {
- 2214. - // delete list[aid];
- 2215. - list[next_id]._prev = prev_id;
- 2216. - list[prev_id]._next = next_id;
- 2217. - }
- 2218. - }
- 2219. - });
- 2220. - var plist = ls.get('pad_playlist');
- 2221. - if (plist && plist[aid] && window.audioPlayer) {
- 2222. - audioPlayer.setPadPlaylist();
- 2223. - }
- 2224. - },
- 2225. -
- 2226. - backToPlaylist: function(aid) {
- 2227. - each([window.audioPlaylist, cur.nextPlaylist], function(i, e) {
- 2228. - var list = e;
- 2229. - if (list && list[aid]) {
- 2230. - var next_id = list[aid]._next, prev_id = list[aid]._prev;
- 2231. - if (next_id != aid) {
- 2232. - list[next_id]._prev = list[prev_id]._next = aid;
- 2233. - }
- 2234. - }
- 2235. - });
- 2236. - var plist = ls.get('pad_playlist');
- 2237. - if (plist && plist[aid] && window.audioPlayer) {
- 2238. - audioPlayer.setPadPlaylist();
- 2239. - }
- 2240. - },
- 2241. -
- 2242. - hideRecommendation: function(aid, q, hash, event) {
- 2243. - if (window.audioPlayer && currentAudioId() == aid) {
- 2244. - audioPlayer.nextTrack(true);
- 2245. - }
- 2246. - var recRow = ge('audio'+aid);
- 2247. - if (recRow) {
- 2248. - if (window.tooltips) {
- 2249. - tooltips.hide(ge('remove'+aid))
- 2250. - }
- 2251. - slideUp(recRow, 200, function() {
- 2252. - recRow.parentNode.removeChild(recRow);
- 2253. - Audio.removeFromPlaylist(aid);
- 2254. - cur.recsCount--;
- 2255. - Audio.changeHTitle();
- 2256. - });
- 2257. - }
- 2258. - ajax.post(Audio.address, {act: 'hide_recommendation', q: q, hash: hash});
- 2259. - if (event) cancelEvent(event);
- 2260. - return false;
- 2261. - },
- 2262. -
- 2263. - _animDelX: function(el, opacity, set_active) {
- 2264. - if (!el) return;
- 2265. - if (set_active !== undefined) {
- 2266. - el.active = set_active;
- 2267. - } else if (el.active) {
- 2268. - return;
- 2269. - }
- 2270. - animate(el, {opacity: opacity}, 200);
- 2271. - },
- 2272. -
- 2273. - rowActive: function(el, tt, sh) {
- 2274. - Audio._animDelX(el, 1, 1);
- 2275. - if (tt) showTooltip(el, {text: tt, showdt: 0, black: 1, shift: (sh ? sh : [12, 4, 0])});
- 2276. - },
- 2277. - rowInactive: function(el, light) {
- 2278. - var opacity = light ? 0.6 : 0.4;
- 2279. - Audio._animDelX(el, opacity, 0);
- 2280. - },
- 2281. -
- 2282. - selectFriend: function(opts, ev) {
- 2283. - opts = opts || {};
- 2284. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 2285. - from_pad = !!opts.from_pad, id = opts.id;
- 2286. - if (__cur.skipSelectFriend) {
- 2287. - __cur.skipSelectFriend = false;
- 2288. - return;
- 2289. - }
- 2290. - each(geByTag('div', __cur.audioFriends), function(i, e) {
- 2291. - removeClass(e, 'current');
- 2292. - });
- 2293. - addClass(ge((from_pad ? 'pad_' : '') + 'audio_friend' + id), 'current');
- 2294. - addClass(ge((from_pad ? 'pad_' : '') + 'album0'), 'loading');
- 2295. - each(geByClass('audio_filter', __cur.albumFilters), function(i, e) {
- 2296. - removeClass(e, 'selected');
- 2297. - });
- 2298. - Audio.loadFriendsAudios({id: id, index: 'friend' + id, from_pad: from_pad});
- 2299. - if (id && (__cur.oid == vk.id || from_pad)) {
- 2300. - ajax.post(Audio.address, {act: 'list_stats', owner: id});
- 2301. - }
- 2302. - return ev ? cancelEvent(ev) : false;
- 2303. - },
- 2304. - skipSelectFriend: function(opts) {
- 2305. - opts = opts || {};
- 2306. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur;
- 2307. - __cur.skipSelectFriend = true;
- 2308. - },
- 2309. - selectCommunity: function(opts, ev) {
- 2310. - opts = opts || {};
- 2311. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 2312. - from_pad = !!opts.from_pad, id = opts.id;
- 2313. - if (__cur.skipSelectCommunity) {
- 2314. - __cur.skipSelectCommunity = false;
- 2315. - return;
- 2316. - }
- 2317. - each(geByClass('audio_friend', __cur.searchInfoCont), function(i, e) {
- 2318. - removeClass(e, 'current');
- 2319. - });
- 2320. - addClass(ge((from_pad ? 'pad_' : '') + 'audio_community' + id), 'current');
- 2321. - mentionOver(ge((from_pad ? 'pad_' : '') + 'audio_community' + id), {shift: [47, 7, 7]});
- 2322. - each(geByClass('audio_filter', __cur.albumFilters), function(i, e) {
- 2323. - removeClass(e, 'selected');
- 2324. - });
- 2325. - addClass(__cur.albumFiltered, 'club_shown');
- 2326. - __cur.searchSortFilter.disable(true);
- 2327. - __cur.searchLyricsFilter.disable(true);
- 2328. - removeClass(__cur.albumFiltered, 'selected');
- 2329. - __cur.club = id;
- 2330. - Audio.loadCommunityAudios({from_pad: from_pad, gid: id, index: 'club' + id});
- 2331. - if (id && (__cur.oid == vk.id || from_pad)) {
- 2332. - ajax.post(Audio.address, {act: 'list_stats', club: id});
- 2333. - }
- 2334. - return ev ? cancelEvent(ev) : false;
- 2335. - },
- 2336. - skipSelectCommunity: function(opts) {
- 2337. - opts = opts || {};
- 2338. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur;
- 2339. - __cur.skipSelectCommunity = true;
- 2340. - },
- 2341. - backToSearch: function(from_pad) {
- 2342. - var __cur = from_pad ? window._pads && _pads.cur : window.cur;
- 2343. - if (__cur.curSection && __cur.curSection.substr(0, 4) == 'club') {
- 2344. - __cur.ignoreEqual = true;
- 2345. - each(geByClass('audio_friend', __cur.searchInfoCont), function() {
- 2346. - removeClass(this, 'current');
- 2347. - });
- 2348. - this.updateList({from_pad: from_pad});
- 2349. - }
- 2350. - },
- 2351. - playCurrent: function(el, hash, ev) {
- 2352. - var _a = window.audioPlayer, aid = currentAudioId(), audioId = el.getAttribute('data-audio');
- 2353. - if (_a) _a.gpDisabled = false;
- 2354. - if ((window.audioPlaylist || {})[audioId]) {
- 2355. - if (!_a || aid != audioId || _a.player.paused()) playAudioNew(audioId);
- 2356. - return cancelEvent(ev);
- 2357. - }
- 2358. -
- 2359. - var prg = el.nextSibling || el.parentNode.appendChild(ce('span', {className: 'progress_inline current_audio_prg'}));
- 2360. - stManager.add(['audioplayer.css', 'audioplayer.js'], ajax.post.pbind(Audio.address, {act: 'play_audio_status', id: audioId, hash: hash}, {
- 2361. - onDone: function(info, data, uid) {
- 2362. - if (data && uid) {
- 2363. - audioPlayer.statusData = audioPlayer.statusData || {};
- 2364. - audioPlayer.statusData[uid] = data;
- 2365. - }
- 2366. - if (!info) return;
- 2367. -
- 2368. - if (!window.audioPlaylist) {
- 2369. - window.audioPlaylist = {};
- 2370. - }
- 2371. - audioPlaylist[audioId] = info;
- 2372. - audioPlaylist.start = audioId;
- 2373. - if (data && uid) {
- 2374. - audioPlaylist.statusData = data;
- 2375. - } else {
- 2376. - delete audioPlaylist.statusData;
- 2377. - }
- 2378. - audioPlayer.setPadPlaylist(audioPlaylist);
- 2379. - playAudioNew(audioId);
- 2380. - },
- 2381. - showProgress: function() {
- 2382. - show(prg);
- 2383. - hide(el);
- 2384. - },
- 2385. - hideProgress: function() {
- 2386. - hide(prg);
- 2387. - show(el);
- 2388. - }
- 2389. - }));
- 2390. - return cancelEvent(ev);
- 2391. - },
- 2392. - loadFriendsAudios: function(opts) {
- 2393. - opts = opts || {};
- 2394. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 2395. - from_pad = !!opts.from_pad, id = opts.id, index = opts.index, str = opts.str,
- 2396. - album = opts.album, showAlbums = opts.showAlbums, owner = opts.owner;
- 2397. - if (__cur.silent) {
- 2398. - __cur.onSilentLoad = function() {
- 2399. - Audio.loadFriendsAudios(opts);
- 2400. - };
- 2401. - return;
- 2402. - }
- 2403. - if (!__cur.audiosList[index]) {
- 2404. - if (index == 'all') {
- 2405. - each(geByClass('audio_filter', __cur.albumFilters), function(i, e) {
- 2406. - removeClass(e, 'selected');
- 2407. - });
- 2408. - if (showAlbums) {
- 2409. - addClass(__cur.albumsFilter, 'loading');
- 2410. - } else if (album) {
- 2411. - addClass(ge((from_pad ? 'pad_' : '') + 'album' + album), 'selected loading');
- 2412. - } else {
- 2413. - addClass(ge((from_pad ? 'pad_' : '') + 'album0'), 'selected loading');
- 2414. - }
- 2415. - removeClass(__cur.albumFiltered, 'selected');
- 2416. - }
- 2417. - __cur.lastAct = index;
- 2418. - var query = {act: 'load_audios_silent', id: id, claim: nav.objLoc.claim, please_dont_ddos: 3};
- 2419. - if (owner) {
- 2420. - query.is_owner = 1;
- 2421. - }
- 2422. - if (index != 'all' && !ge((from_pad ? 'pad_' : '') + 'audio_friend' + id) && !owner) {
- 2423. - __cur.shownFriends = [];
- 2424. - var txt = domFC(ge(__cur.audioMoreFriensId)), prg = domLC(ge(__cur.audioMoreFriensId));
- 2425. - Audio.showMoreFriends({from_pad: from_pad, onShow: function() {
- 2426. - hide(txt);
- 2427. - show(prg);
- 2428. - }, onHide: function() {
- 2429. - hide(prg);
- 2430. - show(txt);
- 2431. - }, friend: id});
- 2432. - }
- 2433. - ajax.post(Audio.address, query, {
- 2434. - cache: 1,
- 2435. - onDone: function(data, options) {
- 2436. - if (__cur.lastAct != index) return;
- 2437. - options = eval('('+options+')');
- 2438. - if (options.summaryLang) {
- 2439. - __cur.summaryLang = extend(__cur.summaryLang || {}, options.summaryLang);
- 2440. - }
- 2441. - if (id < 0) {
- 2442. - __cur.allFriendsHTitles = __cur.allFriendsHTitles || {};
- 2443. - __cur.allFriendsHTitles[id] = options.summaryLang.all_club_htitle;
- 2444. - } else {
- 2445. - __cur.allFriendsTitles = __cur.allFriendsTitles || {};
- 2446. - __cur.allFriendsTitles[id] = options.summaryLang.all_friend_title;
- 2447. - __cur.allFriendsHTitles = __cur.allFriendsHTitles || {};
- 2448. - __cur.allFriendsHTitles[id] = options.summaryLang.all_friend_htitle;
- 2449. - }
- 2450. - var obj = eval('('+data+')');
- 2451. - if (!obj) return;
- 2452. - __cur.audiosList[index] = obj['all'];
- 2453. - if (id == vk.id && index == 'all') {
- 2454. - __cur.allAudiosIndex = 'all';
- 2455. - Audio.generateAlbums(from_pad);
- 2456. - }
- 2457. - if (!__cur.performerInfo) {
- 2458. - __cur.performerInfo = {};
- 2459. - }
- 2460. - __cur.performerInfo[index] = options.performerInfo;
- 2461. - if (options.backLink && !from_pad) {
- 2462. - __cur.backLink = options.backLink;
- 2463. - showBackLink('/audio?act=popular'+(__cur.genre ? '&genre='+__cur.genre : ''), __cur.backLink);
- 2464. - }
- 2465. - if (index != 'all') __cur.audioFriend = id;
- 2466. - Audio.changeAllIndex({from_pad: from_pad, index: index, album: album, showAlbums: showAlbums, owner: owner, str: str});
- 2467. - Audio.cacheFriendsList(from_pad);
- 2468. - }
- 2469. - });
- 2470. - } else {
- 2471. - if (index != 'all') __cur.audioFriend = id;
- 2472. - if (owner && !from_pad) {
- 2473. - showBackLink('/audio?act=popular'+(__cur.genre ? '&genre='+__cur.genre : ''), __cur.backLink);
- 2474. - }
- 2475. - Audio.changeAllIndex({from_pad: from_pad, index: index, album: album, showAlbums: showAlbums, owner: owner, str: str});
- 2476. - }
- 2477. - },
- 2478. - loadCommunityAudios: function(opts) {
- 2479. - opts = opts || {};
- 2480. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 2481. - from_pad = !!opts.from_pad, gid = opts.gid, index = opts.index;
- 2482. - if (__cur.silent) {
- 2483. - __cur.onSilentLoad = function() {
- 2484. - Audio.loadCommunityAudios(opts);
- 2485. - };
- 2486. - return;
- 2487. - }
- 2488. - if (!__cur.audiosList[index]) {
- 2489. - __cur.lastAct = index;
- 2490. - ajax.post(Audio.address, {act: 'load_audios_silent', gid: gid, claim: nav.objLoc.claim, please_dont_ddos: 1}, {
- 2491. - cache: 1,
- 2492. - showProgress: addClass.pbind(ge((from_pad ? 'pad_' : '') + 'album0'), 'loading'),
- 2493. - hideProgress: removeClass.pbind(ge((from_pad ? 'pad_' : '') + 'album0'), 'loading'),
- 2494. - onDone: function(data, options) {
- 2495. - if (__cur.lastAct != index) return;
- 2496. - options = eval('('+options+')');
- 2497. - __cur.allClubsHTitles = __cur.allClubsHTitles || {};
- 2498. - __cur.allClubsHTitles[gid] = options.summaryLang.all_club_htitle;
- 2499. - var obj = eval('('+data+')');
- 2500. - if (!obj) return;
- 2501. - __cur.audiosList[index] = obj['all'];
- 2502. - Audio.searchAudios({from_pad: from_pad, type: index, str: ''});
- 2503. - Audio.scrollToTop(from_pad);
- 2504. - }
- 2505. - });
- 2506. - } else {
- 2507. - Audio.searchAudios({from_pad: from_pad, type: index, str: ''});
- 2508. - Audio.scrollToTop(from_pad);
- 2509. - }
- 2510. - },
- 2511. - showMoreFriends: function(opts) {
- 2512. - opts = opts || {};
- 2513. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 2514. - from_pad = !!opts.from_pad, friend = opts.friend,
- 2515. - onShow = opts.onShow || function() {}, onHide = opts.onHide || function() {};
- 2516. - if (__cur.moreFriendsSent) {
- 2517. - return;
- 2518. - }
- 2519. - __cur.moreFriendsSent = true;
- 2520. - var query = {act: 'more_friends', ids: __cur.shownFriends};
- 2521. - if (friend) {
- 2522. - query.owner = friend;
- 2523. - }
- 2524. - if (from_pad) {
- 2525. - query.from_pad = 1;
- 2526. - }
- 2527. - ajax.post(Audio.address, query, {
- 2528. - onDone: function(cont, friends, reset) {
- 2529. - __cur.moreFriendsSent = false;
- 2530. - if (cont) {
- 2531. - var list = __cur.friendsList;
- 2532. - re('audio_friends_old');
- 2533. - var old = ce('div', {innerHTML: '<div id="audio_friends_old" style="position: absolute; top: ' + list.offsetTop + 'px">'+list.innerHTML+'</div>'}).firstChild;
- 2534. - list.parentNode.insertBefore(old, list);
- 2535. - list.innerHTML = '';
- 2536. - setStyle(list, {display: 'none'});
- 2537. - list.innerHTML = cont;
- 2538. - var oldRows = geByClass('audio_friend', old), oldCnt = oldRows.length,
- 2539. - newCnt = geByClass('audio_friend', list).length;
- 2540. - if (oldCnt > newCnt) {
- 2541. - oldRows = oldRows.slice(newCnt);
- 2542. - each(oldRows, function() {
- 2543. - re(this);
- 2544. - });
- 2545. - }
- 2546. - setTimeout(Audio.handleFilterPos, 0);
- 2547. - fadeIn(list, 400, re.pbind(old));
- 2548. - if (friends) {
- 2549. - __cur.shownFriends = reset ? friends : __cur.shownFriends.concat(friends);
- 2550. - }
- 2551. - } else {
- 2552. - Audio.handleFilterPos();
- 2553. - }
- 2554. - },
- 2555. - onFail: function() {
- 2556. - __cur.moreFriendsSent = false;
- 2557. - },
- 2558. - showProgress: onShow,
- 2559. - hideProgress: onHide
- 2560. - });
- 2561. - },
- 2562. - cacheFriendsList: function(from_pad) {
- 2563. - var __cur = from_pad ? window._pads && _pads.cur : window.cur,
- 2564. - query = {act: 'more_friends'};
- 2565. - if (__cur.audioFriendPlaying) query.owner = __cur.audioFriendPlaying;
- 2566. - else if (__cur.audioFriend) query.owner = __cur.audioFriend;
- 2567. - ajax.post(Audio.address, query, {cache: 1});
- 2568. - },
- 2569. -
- 2570. - // Audio Edit functions
- 2571. -
- 2572. - showAudioClaimWarning: function(aid, claim_id, title, reason) {
- 2573. - if (cur.silent) {
- 2574. - cur.onSilentLoad = function() {
- 2575. - Audio.showAudioClaimWarning(aid, claim_id, title, reason);
- 2576. - };
- 2577. - return;
- 2578. - }
- 2579. - var claimText, claimTitle;
- 2580. - if (reason == 'crap') {
- 2581. - claimText = getLang(claim_id >= 0 ? 'audio_crap_warning_text' : 'audio_crap_warning') || getLang(claim_id > 0 ? 'audio_claim_warning_objection' : (claim_id == 0 ? 'audio_claim_warning_text' : 'audio_claim_warning'));
- 2582. - claimTitle = getLang('audio_crap_warning_title') || getLang('audio_claim_warning_title');
- 2583. - } else {
- 2584. - claimText = (claim_id > 0) ? getLang('audio_claim_warning_objection') : (claim_id == 0 ? getLang('audio_claim_warning_text') : getLang('audio_claim_warning'));
- 2585. - claimTitle = getLang('audio_claim_warning_title');
- 2586. - }
- 2587. - claimText = claimText.split('{audio}').join('<b>' + title + '</b>');
- 2588. - claimText = claimText.split('{objection_link}').join('<a href="/help?act=cc_objection&claim=' + claim_id + '&content=audio' + aid + '">' + getLang('audio_claim_objection') + '</a>');
- 2589. - claimText = claimText.split('{delete_link}').join('<a href="#" onclick="Audio.deleteAudio(\'' + aid + '\'); return false;">' + getLang('audio_claim_delete') + '</a>');
- 2590. - cur.claimWarning = showFastBox(claimTitle, claimText);
- 2591. - },
- 2592. -
- 2593. - deleteAudio: function(id) {
- 2594. - if (cur.silent) {
- 2595. - cur.onSilentLoad = function() {
- 2596. - Audio.deleteAudio(id);
- 2597. - };
- 2598. - return;
- 2599. - }
- 2600. - if (cur.deleting) {
- 2601. - return false;
- 2602. - }
- 2603. - cur.deleting = true;
- 2604. - var el = ge('audio' + id), aid = id.split('_')[1];
- 2605. - if (!cur.deletedAudios) cur.deletedAudios = [];
- 2606. - cur.deletedAudios[aid] = el.innerHTML;
- 2607. - var acts = geByClass1('actions', el);
- 2608. - each(acts.children, function(){if (this.tt && this.tt.hide) this.tt.hide()});
- 2609. - var a = (cur.audios || {})[aid] || [], lyrics = isVisible(ge('lyrics'+id)),
- 2610. - _tw = el && geByClass1('title_wrap', el),
- 2611. - performer = a[5] || _tw && (geByTag1('a', _tw) || {}).innerHTML || '',
- 2612. - title = a[6] || _tw && (geByClass1('title', _tw) || {}).innerHTML || '';
- 2613. - el.innerHTML = rs(cur.deletedTpl, {
- 2614. - audio_id: id,
- 2615. - performer: performer.split('<span>').join('').split('</span>').join(''),
- 2616. - title: title,
- 2617. - delete_all: ''
- 2618. - });
- 2619. - var _a = window.audioPlayer;
- 2620. - if (currentAudioId() == id) {
- 2621. - _a.showCurrentTrack();
- 2622. - }
- 2623. - if (lyrics) {
- 2624. - Audio.updateSorterRows(ge('audio'+id));
- 2625. - }
- 2626. - var addBtn = ge('audio_add'+id);
- 2627. - if (addBtn) {
- 2628. - addBtn.onmouseover = function() {};
- 2629. - }
- 2630. - ajax.post(Audio.address, {act: 'delete_audio', oid: cur.oid, aid: aid, hash: cur.hashes.delete_hash, restore: 1}, {
- 2631. - onDone: function(action, delete_all) {
- 2632. - cur.deleting = false;
- 2633. - if (cur.claimWarning) {
- 2634. - cur.claimWarning.hide();
- 2635. - }
- 2636. - var acts = geByClass1('actions', el);
- 2637. - each(acts.children, function(){if (this.tt) this.tt.hide()});
- 2638. - el.innerHTML = rs(cur.deletedTpl, {
- 2639. - audio_id: id,
- 2640. - performer: performer.split('<span>').join('').split('</span>').join(''),
- 2641. - title: title,
- 2642. - delete_all: action ? action : ''
- 2643. - });
- 2644. - el.style.cursor = 'auto';
- 2645. - el.setAttribute('nosorthandle', '1');
- 2646. - if (currentAudioId() == id) {
- 2647. - _a.showCurrentTrack();
- 2648. - }
- 2649. - if (delete_all) {
- 2650. - cur.lang = cur.lang || {};
- 2651. - cur.lang.audio_delete_all = delete_all;
- 2652. - }
- 2653. - if (cur.audios[aid]) {
- 2654. - cur.audiosIndex.remove(cur.audios[aid]);
- 2655. - cur.audios[aid].deleted = true;
- 2656. - if (window.Pads && Pads.clearAudioLoadCache) {
- 2657. - Pads.clearAudioLoadCache();
- 2658. - }
- 2659. - }
- 2660. - Audio.removeFromPlaylist(id);
- 2661. - cur.sectionCount--;
- 2662. - if (cur.shownAudios) cur.shownAudios--;
- 2663. - Audio.changeSummary();
- 2664. - },
- 2665. - onFail: function() {
- 2666. - cur.deleting = false;
- 2667. - }
- 2668. - });
- 2669. - return false;
- 2670. - },
- 2671. -
- 2672. - restoreAudio: function(id) {
- 2673. - if (cur.restoring) {
- 2674. - return;
- 2675. - }
- 2676. - cur.restoring = true;
- 2677. - var el = ge('audio' + id), aid = id.split('_')[1];
- 2678. - ajax.post(Audio.address, {act: 'restore_audio', oid: cur.oid, aid: aid, hash: cur.hashes.restore_hash}, {
- 2679. - onDone: function() {
- 2680. - cur.restoring = false;
- 2681. - var acts = geByClass1('actions', el);
- 2682. - each(acts.children, function(){if (this.tt) this.tt.hide()});
- 2683. - el.innerHTML = cur.deletedAudios[aid];
- 2684. - var lyrics = isVisible(ge('lyrics'+id));
- 2685. - if (lyrics) {
- 2686. - Audio.updateSorterRows(ge('audio'+id));
- 2687. - }
- 2688. - el.removeAttribute('nosorthandle');
- 2689. - if (cur.audios[aid]) {
- 2690. - cur.audiosIndex.add(cur.audios[aid]);
- 2691. - cur.audios[aid].deleted = false;
- 2692. - if (window.Pads && Pads.clearAudioLoadCache) {
- 2693. - Pads.clearAudioLoadCache();
- 2694. - }
- 2695. - }
- 2696. - Audio.backToPlaylist(id);
- 2697. - cur.sectionCount++;
- 2698. - if (cur.shownAudios) cur.shownAudios++;
- 2699. - Audio.changeSummary();
- 2700. - toggleClass(ge('play'+id), 'playing', id == currentAudioId());
- 2701. - },
- 2702. - onFail: function() {
- 2703. - cur.restoring = false;
- 2704. - }
- 2705. - });
- 2706. - },
- 2707. -
- 2708. - deleteAll: function(object_id, from_id, to_id, hash) {
- 2709. - var box = showFastBox(getLang('audio_delete_all_title'), getLang('audio_delete_all') || '', getLang('global_delete'), function(btn){
- 2710. - ajax.post(Audio.address, {act: 'delete_all', object_id: object_id, to_id: to_id, from_id: from_id, hash: hash}, {
- 2711. - showProgress: lockButton.pbind(btn),
- 2712. - onDone: function() {
- 2713. - nav.reload();
- 2714. - },
- 2715. - onFail: box.hide
- 2716. - });
- 2717. - }, getLang('global_cancel'));
- 2718. - },
- 2719. -
- 2720. - editAudio: function(aid, event){
- 2721. - showBox(Audio.address, {act: 'edit_audio_box', aid: aid}, {
- 2722. - params: {width: '430px', bodyStyle: 'padding: 15px;'}
- 2723. - });
- 2724. - if (event) cancelEvent(event);
- 2725. - return false;
- 2726. - },
- 2727. -
- 2728. - editTopAudio: function(full_aid, event) {
- 2729. - showBox('al_search.php', {act: 'audio_top_edit_box', id: full_aid, full_id: full_aid}, {
- 2730. - params: {width: '430px', bodyStyle: 'padding: 15px;'}
- 2731. - });
- 2732. - if (event) cancelEvent(event);
- 2733. - return false;
- 2734. - },
- 2735. -
- 2736. - removeFromTop: function(audio_hash, hash, full_aid, event) {
- 2737. - ajax.post('al_search.php', {act: 'save_top_audio', deleted: 1, audio_hash: audio_hash, hash: hash, id: full_aid}, {
- 2738. - onDone: function() {
- 2739. - var audioRow = ge('audio'+full_aid);
- 2740. - slideUp(audioRow, 100);
- 2741. - }
- 2742. - })
- 2743. - },
- 2744. -
- 2745. - updateAlbumsStart: function() {
- 2746. - if (!cur.canEdit || browser.mobile || !cur.audioAlbumsWrap || !cur.audioAlbumsWrap.sorter) return;
- 2747. - each (cur.audioAlbumsWrap.sorter.elems, function() {
- 2748. - setStyle(this, {top: 'auto', left: 'auto', width: 'auto'});
- 2749. - });
- 2750. - cur.audioAlbumsWrap.sorter.destroy();
- 2751. - },
- 2752. -
- 2753. - updateAlbumsFinish: function() {
- 2754. - if (!cur.canEdit || browser.mobile) return;
- 2755. - this.initAlbumsSort();
- 2756. - this.updateAlbumsTitles();
- 2757. - },
- 2758. -
- 2759. - updateAlbums: function() {
- 2760. - this.updateAlbumsStart();
- 2761. - this.updateAlbumsFinish();
- 2762. - },
- 2763. -
- 2764. - updateAlbumsTitles: function(opts) {
- 2765. - opts = opts || {};
- 2766. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 2767. - from_pad = !!opts.from_pad;
- 2768. -
- 2769. - if (!__cur.audioAlbumsWrap) return;
- 2770. -
- 2771. - each (geByClass('label', __cur.audioAlbumsWrap), function() {
- 2772. - if (this.scrollWidth > this.clientWidth) {
- 2773. - this.setAttribute('title', this.innerText || this.textContent);
- 2774. - } else {
- 2775. - this.removeAttribute('title');
- 2776. - }
- 2777. - });
- 2778. - },
- 2779. -
- 2780. - updatePadFiltersHeight: function() {
- 2781. - var filters = ge('pad_side_filters'), td = ge('pad_filters_panel'),
- 2782. - curSz = getSize(td)[1], minSz = getSize(_pads.content)[1],
- 2783. - newSz = Math.max(minSz, getSize(filters)[1] + 10);
- 2784. - if (newSz != curSz) {
- 2785. - setStyle(td, {height: newSz});
- 2786. - if (window.Pads) {
- 2787. - Pads.updateHeight();
- 2788. - }
- 2789. - }
- 2790. - },
- 2791. -
- 2792. - initAlbumsSort: function() {
- 2793. - if (!cur.canEdit || browser.mobile || !cur.audioAlbumsWrap || cur.audioAlbumsWrap.sorter) return;
- 2794. - sorter.init(cur.audioAlbumsWrap, {onMouseDown: Audio.hideAlbumsTT, onReorder: Audio.onAlbumReorder, noMoveCursor: 1});
- 2795. - },
- 2796. -
- 2797. - hideAlbumsTT: function() {
- 2798. - each(geByClass('icon_wrap', cur.audioAlbumsWrap), function() {
- 2799. - if (this.tt) this.tt.hide();
- 2800. - })
- 2801. - },
- 2802. -
- 2803. - onAlbumReorder: function(album, before, after) {
- 2804. - var aid = album.id.replace('album', '');
- 2805. - var before_id = (before && before.id || '').replace('album', '');
- 2806. - var after_id = (after && after.id || '').replace('album', '');
- 2807. - ajax.post(Audio.address, {act: 'reorder_albums', oid: cur.oid, aid: aid, before: before_id, after: after_id, hash: cur.hashes.reorder_hash});
- 2808. - },
- 2809. -
- 2810. - editAlbum: function(aid){
- 2811. - if (cur.silent) {
- 2812. - cur.onSilentLoad = function() {
- 2813. - Audio.editAlbum(aid);
- 2814. - };
- 2815. - return;
- 2816. - }
- 2817. - if (!cur.audiosList) {
- 2818. - return;
- 2819. - }
- 2820. - var box = showTabbedBox(Audio.address, {act: 'edit_album_box', album_id: aid, oid: cur.oid}, {stat: ['privacy.js', 'privacy.css', 'ui_controls.js', 'ui_controls.css', 'indexer.js']});
- 2821. - cur.onOListSave = Audio.saveAlbum.pbind(box, aid);
- 2822. - return false;
- 2823. - },
- 2824. -
- 2825. - createAlbum: function() {
- 2826. - return this.editAlbum(0);
- 2827. - },
- 2828. -
- 2829. - saveAlbum: function(box, aid, audio_ids) {
- 2830. - var btn = geByClass1('button_blue', box.bodyNode.nextSibling).firstChild,
- 2831. - albumName = val('album_name');
- 2832. - if (!albumName) {
- 2833. - notaBene('album_name');
- 2834. - return false;
- 2835. - }
- 2836. - var query = {act: 'save_album', album_id: aid, name: albumName, gid: cur.gid, Audios: audio_ids.join(','), hash: cur.hashes.save_album_hash};
- 2837. - ajax.post(Audio.address, query, {
- 2838. - showProgress: lockButton.pbind(btn),
- 2839. - hideProgress: unlockButton.pbind(btn),
- 2840. - onFail: box.hide,
- 2841. - onDone: function(album_id, audio_ids, filters) {
- 2842. - try{
- 2843. - cur.audioAlbumsWrap.innerHTML = filters;
- 2844. - var old = cur.audiosList['album'+album_id];
- 2845. - if (old) {
- 2846. - for (var i in old) {
- 2847. - cur.audios[old[i][1]][8] = 0;
- 2848. - }
- 2849. - }
- 2850. - for (var i in audio_ids) {
- 2851. - cur.audios[audio_ids[i]][8] = album_id;
- 2852. - }
- 2853. - cur.albums[album_id] = {id: album_id, title: clean(albumName)};
- 2854. - Audio.generateAlbums();
- 2855. - Audio.loadAlbum({album: album_id});
- 2856. - Audio.initAlbumsSort();
- 2857. - Audio.updateAlbumsTitles();
- 2858. - box.hide();
- 2859. - }catch(e){}
- 2860. - }
- 2861. - });
- 2862. - return false;
- 2863. - },
- 2864. -
- 2865. - deleteAlbum: function(aid, hash){
- 2866. - var box = showFastBox(getLang('audio_delete_album_title'), getLang('audio_delete_album_are_you_sure'), getLang('audio_delete_album_button'), function(btn){
- 2867. - ajax.post(Audio.address, {act: 'delete_album', album_id: aid, hash: hash, gid: cur.gid}, {
- 2868. - showProgress: lockButton.pbind(btn),
- 2869. - hideProgress: unlockButton.pbind(btn),
- 2870. - onDone: function(audio_ids, filters){
- 2871. - try{
- 2872. - re('album'+aid);
- 2873. - boxQueue.hideAll();
- 2874. - for (var i in audio_ids) {
- 2875. - cur.audios[audio_ids[i]][8] = 0;
- 2876. - }
- 2877. - delete cur.albums[aid];
- 2878. - Audio.generateAlbums();
- 2879. - if (cur.album_id == aid) {
- 2880. - Audio.loadAlbum({album: 0, showAlbums: true});
- 2881. - }
- 2882. - Audio.updateAlbums();
- 2883. - }catch(e){}
- 2884. - },
- 2885. - onFail: function(){
- 2886. - box.hide(200);
- 2887. - }
- 2888. - });
- 2889. - }, getLang('global_cancel'));
- 2890. - },
- 2891. -
- 2892. - moveAudio: function(full_id, album_id) {
- 2893. - var id = full_id.split('_')[1];
- 2894. - ajax.post(Audio.address, {act:'move_to_album', album_id:album_id, audio_id:id, gid:cur.gid, hash:cur.hashes.move_hash}, {
- 2895. - onDone: function(text) {
- 2896. - if((cur.album_id && cur.album_id != album_id) || cur.filterUnsorted){
- 2897. - var el = ge('audio'+full_id);
- 2898. - fadeOut(el, 300, function(){
- 2899. - el.parentNode.removeChild(el);
- 2900. - each (cur.aContent.sorter.elems, function() {
- 2901. - setStyle(this, {top: 'auto', left: 'auto'});
- 2902. - });
- 2903. - cur.aContent.sorter.destroy();
- 2904. - var opts = {onReorder: Audio.onAudioReorder, onMouseDown: Audio.onDragStart, onMouseUp: Audio.onDragEnd, noMoveCursor: 1};
- 2905. - if (cur.audioAlbumsWrap) {
- 2906. - extend(opts, {target: cur.audioAlbumsWrap, onDragOver: Audio.onDragOver, onDragOut: Audio.onDragOut});
- 2907. - }
- 2908. - sorter.init(cur.aContent, opts);
- 2909. - cur.sectionCount--;
- 2910. - Audio.changeSummary();
- 2911. - if (cur.sectionCount == 0) {
- 2912. - cur.aContent.innerHTML = '<div id="not_found" class="info_msg">'+getLang('audio_album_no_recs')+'</div>';
- 2913. - }
- 2914. - hide(cur.showMore);
- 2915. - });
- 2916. - }
- 2917. - cur.audios[id][8] = album_id;
- 2918. - Audio.generateAlbums();
- 2919. - }
- 2920. - });
- 2921. - },
- 2922. -
- 2923. - onAudioReorder: function(audio, before, after) {
- 2924. - var aid = audio.id.replace('audio', '').split('_')[1];
- 2925. - var before_id = (before && before.id || '').replace('audio', '').split('_')[1];
- 2926. - var after_id = (after && after.id || '').replace('audio', '').split('_')[1];
- 2927. - ajax.post(Audio.address, {act: 'reorder_audios', oid: cur.oid, aid: aid, before: before_id, after: after_id, hash: cur.hashes.reorder_hash}, {
- 2928. - onDone: function(data) {
- 2929. - var val;
- 2930. - if (before_id && !after_id) {
- 2931. - val = cur.audios[before_id]._order - 0.01;
- 2932. - } else {
- 2933. - val = cur.audios[after_id]._order + 0.01;
- 2934. - }
- 2935. - cur.audios[aid]._order = val;
- 2936. - Audio.reorderPlaylist(cur.oid + '_' + aid, before_id ? cur.oid + '_' + before_id : '', after_id ? cur.oid + '_' + after_id : '');
- 2937. - }
- 2938. - });
- 2939. - },
- 2940. -
- 2941. - onDragStart: function(el) {
- 2942. - // addClass(ge('page_body'), 'no_overflow');
- 2943. - cur.dragStartTimer = setTimeout(function() {
- 2944. - addClass(cur.audioAlbumsWrap, 'drag');
- 2945. - hide('album_add');
- 2946. - var ids = el.id.substr(5), id = parseInt(ids.split('_')[1]);
- 2947. - var album_id = (cur.audios) ? cur.audios[id][8] : cur.album_id;
- 2948. - each(geByClass('audio_filter', cur.audioAlbumsWrap), function(i,v) {
- 2949. - if ('album'+album_id == v.id || (album_id == 0 && v.id == 'album_unsorted')) {
- 2950. - return;
- 2951. - }
- 2952. - addClass(v, 'drag_on');
- 2953. - });
- 2954. - animate(el, {opacity: .8}, 200);
- 2955. - }, 300);
- 2956. - },
- 2957. -
- 2958. - onDragEnd: function(el, target) {
- 2959. - if (cur.dragStartTimer) clearTimeout(cur.dragStartTimer);
- 2960. - // removeClass(ge('page_body'), 'no_overflow');
- 2961. - each(geByClass('audio_filter', cur.audioAlbumsWrap), function(i,v) {
- 2962. - removeClass(v, 'drag_on');
- 2963. - });
- 2964. - show('album_add');
- 2965. - if (target) {
- 2966. - var new_album, full_id = el.id.substr(5), aid = parseInt(full_id.split('_')[1]);
- 2967. - var album_id = (cur.audios) ? cur.audios[aid][8] : cur.album_id;
- 2968. - if (target.id != 'album_unsorted') {
- 2969. - new_album = parseInt(target.id.substr(5));
- 2970. - } else {
- 2971. - new_album = 0;
- 2972. - }
- 2973. - if (new_album != album_id) {
- 2974. - Audio.moveAudio(full_id, new_album);
- 2975. - }
- 2976. - }
- 2977. - removeClass(cur.audioAlbumsWrap, 'drag');
- 2978. - animate(el, {opacity: 1}, 200);
- 2979. - },
- 2980. -
- 2981. - onDragOver: function(el, target) {
- 2982. - cur.targetId = target.id || '';
- 2983. - var ids = el.id.substr(5), id = parseInt(ids.split('_')[1]);
- 2984. - var album_id = (cur.audios) ? cur.audios[id][8] : cur.album_id;
- 2985. - if ('album'+album_id == target.id || (album_id == 0 && target.id == 'album_unsorted')) {
- 2986. - return;
- 2987. - }
- 2988. - if (cur.dragOutTimer) {
- 2989. - clearTimeout(cur.dragOutTimer);
- 2990. - }
- 2991. - addClass(target, 'drag_over');
- 2992. - setStyle(el, {opacity: .4});
- 2993. - },
- 2994. -
- 2995. - onDragOut: function(el, target) {
- 2996. - removeClass(target, 'drag_over');
- 2997. - if (target.id && cur.targetId != target.id) return;
- 2998. - cur.dragOutTimer = setTimeout(function(){setStyle(el, {opacity: .8});}, 200);
- 2999. - },
- 3000. -
- 3001. - ignoreOwner: function (post_raw, owner_id, hash, btn) {
- 3002. - triggerEvent(ge('delete_post' + post_raw), 'mouseout');
- 3003. - cur.feedEntriesHTML = cur.feedEntriesHTML || {};
- 3004. - if (post_raw) {
- 3005. - cur.feedEntriesHTML[post_raw + '_ignored'] = val('post' + post_raw);
- 3006. - }
- 3007. - ajax.post(Audio.address, {act: 'a_ignore_owner', post_raw: post_raw, owner_id: owner_id, hash: hash}, {
- 3008. - onDone:function(html) {
- 3009. - val('post' + post_raw, html);
- 3010. - each(geByClass('post', cur.aContent), function(i,v) {
- 3011. - var ids = this.id.match(/post((-?\d+)_(-?\d+)(_\d+)?)/);
- 3012. - if (ids[1] != post_raw && (!ids[4] && ids[2] == owner_id || ids[4] && ids[3] == owner_id)) {
- 3013. - hide(this);
- 3014. - }
- 3015. - });
- 3016. - }
- 3017. - });
- 3018. - },
- 3019. -
- 3020. - unignoreOwner: function (post_raw, owner_id, hash) {
- 3021. - ajax.post(Audio.address, {act: 'a_unignore_owner', post_raw: post_raw || '', owner_id: owner_id, hash: hash}, {
- 3022. - onDone:function(html) {
- 3023. - if (post_raw) {
- 3024. - val('post' + post_raw, cur.feedEntriesHTML[post_raw + '_ignored']);
- 3025. - } else {
- 3026. - val('ignore_row' + owner_id, html);
- 3027. - }
- 3028. - each(geByClass('post', cur.aContent), function(i,v) {
- 3029. - var ids = this.id.match(/post((-?\d+)_(-?\d+)(_\d+)?)/);
- 3030. - if (!ids[4] && ids[2] == owner_id || ids[4] && ids[3] == owner_id) {
- 3031. - show(this);
- 3032. - }
- 3033. - });
- 3034. - }
- 3035. - });
- 3036. - },
- 3037. -
- 3038. - editHidden: function () {
- 3039. - showTabbedBox('al_settings.php', {act: 'a_edit_owners_list', list: 'audio', height: lastWindowHeight}, {stat: ['privacy.js', 'privacy.css', 'ui_controls.js', 'ui_controls.css', 'indexer.js']});
- 3040. - cur.onOListSave = Audio.onHiddenSave;
- 3041. - return false;
- 3042. - },
- 3043. -
- 3044. - onHiddenSave: function(white, black, list, options) {
- 3045. - var box = curBox(), params = {act: 'a_ignore_olist', hash: options.hash};
- 3046. - if (white.length < black.length) {
- 3047. - params.White = white.join(',');
- 3048. - } else {
- 3049. - params.Black = black.join(',');
- 3050. - }
- 3051. - ajax.post(Audio.address, params, {
- 3052. - onDone: function(control, rules) {
- 3053. - box.hide();
- 3054. - Audio.loadFeed({update: 'reload'});
- 3055. - },
- 3056. - showProgress: box.showProgress,
- 3057. - hiderogress: box.hideProgress
- 3058. - });
- 3059. - return false;
- 3060. - },
- 3061. -
- 3062. - loadGenre: function(opts, ev) {
- 3063. - if (checkEvent(ev)) {
- 3064. - return true;
- 3065. - }
- 3066. - opts = opts || {};
- 3067. - var from_pad = !!opts.from_pad, genre_id = opts.genre;
- 3068. - Audio.loadPopular({update: true, genre: genre_id, from_pad: from_pad});
- 3069. - return cancelEvent(ev);
- 3070. - },
- 3071. -
- 3072. - loadPerformer: function(opts, ev) {
- 3073. - if (checkEvent(ev)) {
- 3074. - return true;
- 3075. - }
- 3076. - opts = opts || {};
- 3077. - var from_pad = !!opts.from_pad, oid = opts.oid, index = 'owner' + oid;
- 3078. - Audio.loadFriendsAudios({id: oid, index: index, owner: true, from_pad: from_pad});
- 3079. - return cancelEvent(ev);
- 3080. - },
- 3081. -
- 3082. - moreCatalog: function(opts) {
- 3083. - opts = opts || {};
- 3084. - var __cur = opts.from_pad ? window._pads && _pads.cur : window.cur,
- 3085. - from_pad = !!opts.from_pad, obj = opts.el;
- 3086. - if (hasClass(obj, 'audio_performer_shown')) {
- 3087. - var height = getSize(ge('audio_more_performers'))[1];
- 3088. - removeClass(obj, 'audio_performer_shown');
- 3089. - hide('audio_more_performers');
- 3090. - if (height > 300) {
- 3091. - scrollToTop(0);
- 3092. - }
- 3093. - } else {
- 3094. - if (ge('audio_more_performers')) {
- 3095. - show('audio_more_performers')
- 3096. - addClass(obj, 'audio_performer_shown');
- 3097. - return false;
- 3098. - }
- 3099. - var exclude = [];
- 3100. - var nodes = ge(__cur.popularPerformersId).childNodes;
- 3101. - for (var i in nodes) {
- 3102. - if (hasClass(nodes[i], 'audio_owner')) {
- 3103. - exclude.push(intval(nodes[i].getAttribute('ref')));
- 3104. - }
- 3105. - }
- 3106. - var query = {act: 'get_more_performers', offset: 4, exclude: exclude.join(','), genre: parseInt(__cur.genre)};
- 3107. - if (from_pad) {
- 3108. - query.from_pad = 1;
- 3109. - }
- 3110. - ajax.post('al_audio.php', query, {
- 3111. - onDone: function(rows) {
- 3112. - ge(__cur.popularPerformersId).appendChild(ce('div', {
- 3113. - id: 'audio_more_performers',
- 3114. - innerHTML: rows
- 3115. - }));
- 3116. - addClass(obj, 'audio_performer_shown');
- 3117. - },
- 3118. - showProgress: addClass.pbind(obj, 'audio_performer_loading'),
- 3119. - hideProgress: removeClass.pbind(obj, 'audio_performer_loading')
- 3120. - });
- 3121. - }
- 3122. - },
- 3123. -
- 3124. - _eof: 1
- 3125. - }
- 3126. - try{stManager.done('audio.js');}catch(e){}
- ------
- Файл - exchange.css (Старый размер - 15510 | Новый - 0):
- 0. - #exchange_css {
- 1. - display: none;
- 2. - }
- 3. -
- 4. - #ads_page.exchange_page {
- 5. - padding: 20px;
- 6. - }
- 7. - .exchange_not_found {
- 8. - margin: 20px 20px 15px;
- 9. - padding: 20px 0;
- 10. - line-height: 200%;
- 11. - text-align: center;
- 12. - color: #777;
- 13. - }
- 14. - .exchange_not_found.table {
- 15. - margin: 0px;
- 16. - background-color: #f7f7f7;
- 17. - }
- 18. -
- 19. - .exchange_table {
- 20. - border-collapse: collapse;
- 21. - width: 100%;
- 22. - }
- 23. - .exchange_table th {
- 24. - padding: 9px 8px 11px 5px;
- 25. - background-color: #e9edf0;
- 26. - color: #587183;
- 27. - font-weight: bold;
- 28. - white-space: nowrap;
- 29. - }
- 30. - .exchange_table th:first-child {
- 31. - padding-left: 10px;
- 32. - }
- 33. - .exchange_table tr {
- 34. - border-left: 1px solid #e9edf0;
- 35. - border-right: 1px solid #e9edf0;
- 36. - }
- 37. - #exchange_comm_search_table.exchange_table tr {
- 38. - border-left: none;
- 39. - border-right: none;
- 40. - }
- 41. - .exchange_table tr.even {
- 42. - background-color: #f5f7f7;
- 43. - }
- 44. - .exchange_table tr:first-child {
- 45. - border-top: 1px solid #e9edf0;
- 46. - }
- 47. - .exchange_table tr:last-child {
- 48. - border-bottom: 1px solid #e9edf0;
- 49. - }
- 50. - #exchange_comm_search_table.exchange_table tr:first-child {
- 51. - border-top: none;
- 52. - }
- 53. - #exchange_comm_search_table.exchange_table tr:last-child {
- 54. - border-bottom: none;
- 55. - }
- 56. - .exchange_table td {
- 57. - padding: 10px 5px;
- 58. - text-align: left;
- 59. - vertical-align: top;
- 60. - line-height: 160%;
- 61. - }
- 62. - #exchange_requests_list_table.exchange_table td,
- 63. - #exchange_info_requests_table.exchange_table td {
- 64. - padding: 6px 5px;
- 65. - }
- 66. - .exchange_table td:first-child {
- 67. - padding-left: 10px !important;
- 68. - }
- 69. - .exchange_table td:last-child {
- 70. - padding-right: 10px;
- 71. - }
- 72. - .exchange_table td.not_found {
- 73. - padding: 0px !important;
- 74. - }
- 75. - .exchange_table .grey {
- 76. - color: #666666;
- 77. - display: inline-block;
- 78. - min-width: 40px;
- 79. - margin-right: 5px;
- 80. - }
- 81. - .exchange_table .green {
- 82. - color: #37702a;
- 83. - }
- 84. - .exchange_table .red {
- 85. - color: #aa3333;
- 86. - }
- 87. - th.exchange_table_col_no_sorted {
- 88. - cursor: pointer;
- 89. - }
- 90. - .is_2x th.exchange_table_col_sort {
- 91. - background-image: url(/images/wide_dd_2x.png);
- 92. - }
- 93. - .button_blue button.exchange_btn_with_arr {
- 94. - padding-left: 8px;
- 95. - padding-right: 0;
- 96. - }
- 97. - .exchange_btn_with_arr span {
- 98. - padding-right: 20px;
- 99. - background: url(/images/backlink.gif) no-repeat 105% -126px;
- 100. - }
- 101. - #exchange_box_comment {
- 102. - width: 322px;
- 103. - margin-top: 10px;
- 104. - }
- 105. - .exchange_box_send_wrap {
- 106. - margin-top: 10px;
- 107. - }
- 108. -
- 109. - #exchange_comm_search_wrap {
- 110. -
- 111. - }
- 112. - #exchange_comm_search_table {
- 113. - margin: 15px 10px;
- 114. - width: 769px;
- 115. - }
- 116. - #exchange_comm_search_table td {
- 117. - line-height: 160%;
- 118. - }
- 119. - #exchange_comm_search_filters {
- 120. - padding: 0 0 15px 20px;
- 121. - background-color: #F7F7F7;
- 122. - }
- 123. - #exchange_comm_search_count {
- 124. - color: #9cabb8;
- 125. - }
- 126. - .exchange_filter_block {
- 127. - float: left;
- 128. - width: 192px;
- 129. - }
- 130. -
- 131. - .exchange_comm_thumb {
- 132. - width: 50px;
- 133. - }
- 134. - .exchange_comm_thumb img {
- 135. - width: 50px;
- 136. - height: 50px;
- 137. - display: block;
- 138. - -moz-border-radius: 3px;
- 139. - -webkit-border-radius: 3px;
- 140. - -khtml-border-radius: 3px;
- 141. - border-radius: 3px;
- 142. - }
- 143. - .exchange_comm_name {
- 144. - float: left;
- 145. - display: block;
- 146. - font-weight: bold;
- 147. - width: 180px;
- 148. - white-space: nowrap;
- 149. - overflow: hidden;
- 150. - text-overflow: ellipsis;
- 151. - text-align: left;
- 152. - }
- 153. - .font_medium .exchange_comm_name {
- 154. - width: 160px;
- 155. - }
- 156. - .exchange_club_info {
- 157. - background-color: #f7f7f7;
- 158. - padding: 20px 30px;
- 159. - }
- 160. - .exchange_comm_info {
- 161. - padding-left: 10px;
- 162. - }
- 163. - .exchange_comm_title {
- 164. - font-weight: bold;
- 165. - max-width: 280px;
- 166. - white-space: nowrap;
- 167. - overflow: hidden;
- 168. - text-overflow: ellipsis;
- 169. - }
- 170. - .exchange_comm_info_row {
- 171. - color: #666;
- 172. - padding-top: 5px;
- 173. - }
- 174. - .exchange_comm_info_row .label {
- 175. - width: 80px;
- 176. - }
- 177. - .exchange_comm_label {
- 178. - color: #777;
- 179. - }
- 180. - .exchange_filter_label {
- 181. - padding: 15px 0 7px 0;
- 182. - font-weight: bold;
- 183. - color: #2B587A;
- 184. - }
- 185. - #exchange_comm_search_filters input {
- 186. - width: 158px;
- 187. - }
- 188. - #exchange_comm_search_filters input.text {
- 189. - padding: 7px 8px 8px !important;
- 190. - height: 13px;
- 191. - }
- 192. - #exchange_tasks_list,
- 193. - #exchange_requests_list {
- 194. - padding-top: 4px;
- 195. - }
- 196. - #exchange_tasks_list_table,
- 197. - #exchange_requests_list_table {
- 198. - margin-top: 12px;
- 199. - }
- 200. - #exchange_campaigns_list {
- 201. - margin-bottom: 20px;
- 202. - }
- 203. - #exchange_campaigns_list_table {
- 204. - margin: 4px 0px 10px;
- 205. - }
- 206. - #exchange_clients_list_table {
- 207. - margin-top: 4px;
- 208. - }
- 209. - #exchange_tasks_list_table .title,
- 210. - #exchange_campaigns_list_table .title {
- 211. - width: 250px;
- 212. - overflow: hidden;
- 213. - text-overflow: ellipsis;
- 214. - }
- 215. - #exchange_tasks_list_table .actions {
- 216. - width: 130px;
- 217. - }
- 218. - .exchange_new_btn {
- 219. - margin-top: 2px;
- 220. - }
- 221. - .exchange_grey {
- 222. - color: #777;
- 223. - }
- 224. - .exchange_table_hint {
- 225. - color: #9cabb8;
- 226. - font-size: 0.91em;
- 227. - cursor: pointer;
- 228. - }
- 229. - .exchange_comm_info_row .exchange_table_hint {
- 230. - font-size: 1em;
- 231. - }
- 232. - .exchange_task_label .title {
- 233. - font-weight: bold;
- 234. - }
- 235. - .exchange_task_label a,
- 236. - .exchange_task_actions a {
- 237. - color: #45688E;
- 238. - }
- 239. - .exchange_task_label .date,
- 240. - .exchange_request_club .size {
- 241. - color: #777;
- 242. - padding: 7px 0px 0px;
- 243. - }
- 244. - .exchange_task_request {
- 245. - color: #555;
- 246. - }
- 247. - #exchange_campaigns_list_table .exchange_task_request {
- 248. - width: 150px;
- 249. - }
- 250. - .exchange_task_actions .view {
- 251. - padding-top: 7px;
- 252. - }
- 253. - #exchange_post_requests .exchange_tabs {
- 254. - padding-top: 3px;
- 255. - }
- 256. - .exchange_subtab1 {
- 257. - float: left;
- 258. - -moz-border-radius: 2px;
- 259. - border-radius: 2px;
- 260. - cursor: pointer;
- 261. - margin-right: 5px;
- 262. - color: #2B587A;
- 263. - }
- 264. - #exchange_stats_period_tabs .exchange_subtab1 {
- 265. - margin-right: 0px;
- 266. - margin-left: 5px;
- 267. - }
- 268. - .exchange_subtab1.hidden {
- 269. - display: none;
- 270. - }
- 271. - .exchange_subtab1:hover {
- 272. - background-color: #E1E7ED;
- 273. - }
- 274. - .exchange_subtab1.active {
- 275. - background-color: #597DA3;
- 276. - color: white;
- 277. - cursor: default;
- 278. - }
- 279. - .exchange_subtab2 {
- 280. - padding: 3px 6px 4px;
- 281. - }
- 282. - .exchange_subtab_cnt {
- 283. - display: inline-block;
- 284. - padding-left: 3px;
- 285. - font-weight: bold;
- 286. - color: #6E859E;
- 287. - }
- 288. - .exchange_subtab1.active .exchange_subtab_cnt {
- 289. - color: #d5dde3;
- 290. - }
- 291. - .is_rtl1 .exchange_subtab_cnt {
- 292. - padding-left: 0px;
- 293. - padding-right: 3px;
- 294. - }
- 295. - #exchange_requests_list_table th.title,
- 296. - #exchange_requests_list_table th.club {
- 297. - width: 180px;
- 298. - }
- 299. - #exchange_requests_list_table th.status {
- 300. - width: 90px;
- 301. - }
- 302. - .exchange_request_task .title,
- 303. - .exchange_request_club .title {
- 304. - font-weight: bold;
- 305. - overflow: hidden;
- 306. - text-overflow: ellipsis;
- 307. - white-space: nowrap;
- 308. - }
- 309. - .exchange_request_task .title {
- 310. - max-width: 190px;
- 311. - }
- 312. - .exchange_request_club .title {
- 313. - max-width: 250px;
- 314. - }
- 315. - .exchange_request_task a,
- 316. - .exchange_request_club a {
- 317. - color: #45688E;
- 318. - }
- 319. - .exchange_request_status .extra_info {
- 320. - padding-top: 3px;
- 321. - }
- 322. - #exchange_info_requests_table .exchange_request_price {
- 323. - max-width: 400px;
- 324. - }
- 325. - .exchange_request_price .extra_info {
- 326. - padding-bottom: 3px;
- 327. - }
- 328. - .exchange_request_status span {
- 329. - display: inline-block;
- 330. - vertical-align: top;
- 331. - }
- 332. - .exchange_request_actions{
- 333. - white-space: nowrap;
- 334. - }
- 335. - #exchange_post_msg_wrap {
- 336. - width: 440px;
- 337. - }
- 338. - #exchange_post_msg {
- 339. - background-color: #edf1f5;
- 340. - padding: 6px 10px 10px;
- 341. - }
- 342. - #exchange_post_msg_wrap.short #exchange_post_msg {
- 343. - max-height: 150px;
- 344. - overflow: hidden;
- 345. - }
- 346. - #exchange_post_msg .wall_post_text,
- 347. - #exchange_post_msg .wpe_buttons {
- 348. - width: 410px;
- 349. - }
- 350. - #exchange_post_msg #wpe_text {
- 351. - width: 412px;
- 352. - }
- 353. - #exchange_post_msg #wpe_cont {
- 354. - margin-top: 4px;
- 355. - }
- 356. - #exchange_post_msg .fw_post_author,
- 357. - #exchange_post_msg .wpe_info {
- 358. - display: none;
- 359. - }
- 360. - .exchange_title_head {
- 361. - border-bottom: 1px solid #dee1e3;
- 362. - color: #45688E;
- 363. - margin: 1px 0 8px;
- 364. - padding: 0 0 4px;
- 365. - text-align: left;
- 366. - }
- 367. - .exchange_title_head .title {
- 368. - font-size: 1.18em;
- 369. - font-weight: bold;
- 370. - }
- 371. - #exchange_post_info_wrap {
- 372. - width: 290px;
- 373. - }
- 374. - .exchange_post_info_row {
- 375. - padding-bottom: 7px;
- 376. - }
- 377. - .exchange_post_info_row .label {
- 378. - width: 150px;
- 379. - color: #666666;
- 380. - }
- 381. - #exchange_post_wrap .exchange_post_info_row .label {
- 382. - width: 125px;
- 383. - }
- 384. - #ads_post_title_text {
- 385. - max-width: 165px;
- 386. - overflow: hidden;
- 387. - text-overflow: ellipsis;
- 388. - white-space: nowrap;
- 389. - position: relative;
- 390. - }
- 391. - .exchange_post_info_empty_row {
- 392. - padding-top: 10px;
- 393. - }
- 394. - .exchange_info_search {
- 395. - margin: 10px 0px;
- 396. - }
- 397. - #exchange_post_requests {
- 398. - padding-top: 20px;
- 399. - }
- 400. - #exchange_info_requests_table {
- 401. - margin-top: 12px;
- 402. - }
- 403. - #exchange_post_stats {
- 404. - padding-top: 20px;
- 405. - }
- 406. - #wrapper_ads_post_stats_graph {
- 407. - padding-top: 10px;
- 408. - }
- 409. - #ads_post_stats_graph .graph_menu_item {
- 410. - margin-top: -4px;
- 411. - }
- 412. - #exchange_box_error {
- 413. - margin-bottom: 10px;
- 414. - }
- 415. - #exchange_request_box_error {
- 416. - margin-bottom: 18px;
- 417. - display: none;
- 418. - }
- 419. - .exchange_request_title {
- 420. - color: #45688E;
- 421. - line-height: 1.27em;
- 422. - margin: 0px;
- 423. - padding: 26px 0px 9px;
- 424. - font-size: 1.09em;
- 425. - font-weight: bold;
- 426. - }
- 427. - .exchange_request_info {
- 428. - padding: 0 20px 22px 30px;
- 429. - }
- 430. - #exchange_request_time_from_d_datepicker_container,
- 431. - #exchange_request_time_to_d_datepicker_container {
- 432. - display: none;
- 433. - }
- 434. - .exchange_date_sep {
- 435. - width: 30px;
- 436. - height: 20px;
- 437. - line-height: 20px;
- 438. - text-align: center;
- 439. - }
- 440. - #exchange_request_comment {
- 441. - width: 282px;
- 442. - }
- 443. - .exchange_comm_title a {
- 444. - color: #45688e;
- 445. - }
- 446. - .exchange_comm_thumb_box {
- 447. - width: 75px;
- 448. - }
- 449. - .exchange_comm_thumb_box img {
- 450. - width: 75px;
- 451. - height: 75px;
- 452. - display: block;
- 453. - -moz-border-radius: 3px;
- 454. - -webkit-border-radius: 3px;
- 455. - -khtml-border-radius: 3px;
- 456. - border-radius: 3px;
- 457. - }
- 458. - #exchange_post_msg_more {
- 459. - margin-top: -3px;
- 460. - display: none;
- 461. - overflow: hidden;
- 462. - }
- 463. - #exchange_post_msg_wrap.short #exchange_post_msg_more {
- 464. - display: block;
- 465. - }
- 466. - #exchange_post_msg_more a {
- 467. - display: block;
- 468. - text-align: center;
- 469. - color: #45688E;
- 470. - padding: 10px 0px 12px;
- 471. - background: #E7ECF1;
- 472. - }
- 473. - #exchange_post_msg_more a:hover {
- 474. - text-decoration: none;
- 475. - background: #E0E6EC;
- 476. - }
- 477. - #exchange_post_msg_more .more_sh {
- 478. - background: #C1C7CA;
- 479. - height: 3px;
- 480. - overflow: hidden;
- 481. - position: relative;
- 482. - z-index: 1550;
- 483. - opacity: 0.55;
- 484. - filter: alpha(opacity=55);
- 485. - }
- 486. - #exchange_info_archive.loading {
- 487. - background: url(/images/upload.gif) no-repeat 100% 50%;
- 488. - }
- 489. - #exchange_info_archive.loading a {
- 490. - visibility: hidden;
- 491. - }
- 492. - #exchange_info_in_archive {
- 493. - color: #909090;
- 494. - padding-top: 10px;
- 495. - }
- 496. - #exchange_tasks_info {
- 497. - padding: 2px 0 20px;
- 498. - }
- 499. - #exchange_post_info {
- 500. - padding-top: 2px;
- 501. - }
- 502. - a.exchange_ad_post_stats,
- 503. - a.exchange_ad_post_link,
- 504. - .exchange_ad_post_club_commment {
- 505. - display: inline-block;
- 506. - margin: 3px 5px 0 0;
- 507. - padding: 0;
- 508. - width: 18px;
- 509. - height: 18px;
- 510. - background: #ebeff5 url(/images/icons/mono_iconset.gif) no-repeat 4px -204px;
- 511. - }
- 512. - a.exchange_ad_post_link {
- 513. - background-position: 4px -233px;
- 514. - }
- 515. - .exchange_ad_post_club_commment {
- 516. - background-position: 4px -189px;
- 517. - }
- 518. - a.exchange_ad_post_link.deleted {
- 519. - opacity: 0.5;
- 520. - filter: alpha(opacity=50);
- 521. - cursor: default;
- 522. - }
- 523. - a.exchange_ad_post_stats:hover,
- 524. - a.exchange_ad_post_link:hover,
- 525. - .exchange_ad_post_club_commment:hover {
- 526. - background-color: #dde4ed;
- 527. - }
- 528. - .even a.exchange_ad_post_stats:hover,
- 529. - .even a.exchange_ad_post_link:hover,
- 530. - .even .exchange_ad_post_club_commment:hover {
- 531. - background-color: #d5e0e5;
- 532. - }
- 533. - a.exchange_ad_post_link.deleted:hover {
- 534. - background-color: #ebeff5;
- 535. - }
- 536. - #ads_post_title_input,
- 537. - #ads_post_title_link {
- 538. - position: relative;
- 539. - }
- 540. - #ads_post_title_text {
- 541. - border-bottom: 1px dashed #2B587A;
- 542. - text-decoration: none;
- 543. - display: block;
- 544. - position: absolute;
- 545. - }
- 546. - #ads_post_title {
- 547. - width: 160px;
- 548. - position: absolute;
- 549. - top: -4px;
- 550. - left: -4px;
- 551. - }
- 552. - .exchange_post_more {
- 553. - position: relative;
- 554. - top: 2px;
- 555. - font-weight: bold;
- 556. - color: #91A4B8;
- 557. - -webkit-transition: color 200ms linear;
- 558. - -moz-transition: color 200ms linear;
- 559. - -o-transition: color 200ms linear;
- 560. - transition: color 200ms linear;
- 561. - }
- 562. - .exchange_post_more:hover {
- 563. - color: #45688E;
- 564. - text-decoration: none;
- 565. - }
- 566. - .exchange_info_msg {
- 567. - background-color: #FFFFFF;
- 568. - border: 1px solid #BCC9D7;
- 569. - font-weight: normal;
- 570. - padding: 8px 11px;
- 571. - line-height: 160%;
- 572. - }
- 573. - .dark_box_cont.exchange {
- 574. - padding-top: 5px;
- 575. - }
- 576. - .dark_box_cont.exchange .dark_box_label {
- 577. - padding-top: 20px;
- 578. - }
- 579. - .wk_postbox_content.exchange #wk_content {
- 580. - width: 510px;
- 581. - }
- 582. - .wk_postbox_content.exchange #pb_title,
- 583. - #exchange_repost_link {
- 584. - padding: 7px 5px 8px !important;
- 585. - width: 446px;
- 586. - }
- 587. - .wk_postbox_content.exchange #pb_text {
- 588. - width: 446px;
- 589. - }
- 590. - .wk_postbox_content.exchange #pb_send_btn {
- 591. - margin-top: 20px;
- 592. - }
- 593. - .wk_postbox_content.exchange #pb_error {
- 594. - margin-top: 20px;
- 595. - }
- 596. - .wk_postbox_content.exchange #pb_add_media {
- 597. - padding-top: 0px;
- 598. - }
- 599. - .wk_postbox_content.exchange #wk_close_link {
- 600. - padding: 17px 26px 18px;
- 601. - }
- 602. - #exchange_repost_preview .wall_module {
- 603. - margin-top: 15px;
- 604. - }
- 605. - #exchange_repost_preview .published_by_quote .wall_post_text {
- 606. - width: 420px;
- 607. - }
- 608. - #exchange_comment_label {
- 609. - display: none;
- 610. - }
- 611. -
- 612. - #filter_city_row {
- 613. - padding-top: 7px;
- 614. - }
- 615. - #exchange_comm_search_filters #exchange_search_input {
- 616. - padding: 7px 8px 8px!important;
- 617. - background: url(/images/magglass.png) no-repeat scroll 95% 8px white;
- 618. - height: 13px;
- 619. - outline: none;
- 620. - }
- 621. - #exchange_search_input::-ms-clear {
- 622. - display: none;
- 623. - }
- 624. - #exchange_search_progress {
- 625. - background: url("/images/upload.gif") no-repeat scroll center center transparent;
- 626. - display: none;
- 627. - height: 23px;
- 628. - margin-left: -41px;
- 629. - margin-top: 2px;
- 630. - position: relative;
- 631. - width: 32px;
- 632. - z-index: 95;
- 633. - }
- 634. - #exchange_search_wrap.loading #exchange_search_input {
- 635. - background-image: none;
- 636. - }
- 637. - #exchange_search_wrap.loading #exchange_search_progress {
- 638. - display: block;
- 639. - }
- 640. - #exchange_more_results td {
- 641. - padding: 0;
- 642. - border-bottom: none;
- 643. - }
- 644. - #exchange_more_results a {
- 645. - display: block;
- 646. - padding: 10px 0px;
- 647. - margin: 0;
- 648. - text-align: center;
- 649. - }
- 650. - #exchange_more_results a:hover {
- 651. - background: #E1E7ED;
- 652. - border-color: #DAE1E8;
- 653. - text-decoration: none;
- 654. - }
- 655. - #exchange_repost_link_wrap {
- 656. - display: none;
- 657. - }
- 658. -
- 659. - #exchange_button_send {
- 660. - display: block;
- 661. - padding-top: 15px;
- 662. - }
- 663. - #exchange_requests_terms {
- 664. - width: 290px;
- 665. - line-height: 160%;
- 666. - padding-top: 12px;
- 667. - }
- 668. - .exchange_hint_tt .tail_wrap {
- 669. - position: absolute;
- 670. - top: auto;
- 671. - bottom: -5px;
- 672. - left: 17px;
- 673. - z-index: 2001;
- 674. - }
- 675. - .exchange_hint_tt .toup .tail_wrap {
- 676. - top: -7px;
- 677. - bottom: auto;
- 678. - }
- 679. - .exchange_hint_tt .tail {
- 680. - background: url(/images/ddtooltip.png) -3px -5px no-repeat;
- 681. - width: 11px;
- 682. - height: 8px;
- 683. - }
- 684. - .exchange_hint_tt .toup .tail {
- 685. - background-position: -3px 2px;
- 686. - }
- 687. - .exchange_hint_tt .hint_wrap {
- 688. - width: 273px;
- 689. - padding: 8px 5px;
- 690. - line-height: 160%;
- 691. - color: #000000;
- 692. - }
- 693. - .exchange_hint_tt .hint_wrap.title {
- 694. - width: 170px;
- 695. - }
- 696. - .exchange_new_union {
- 697. - padding-top: 10px;
- 698. - }
- 699. - .exchange_new_union_img {
- 700. - margin: 30px 0px;
- 701. - height: 160px;
- 702. - background: url(/images/join/ads_union.png) no-repeat 50% 0%;
- 703. - }
- 704. - .exchange_create_union {
- 705. - text-align: center;
- 706. - }
- 707. - #exchange_new_union_error {
- 708. - margin: 10px 0px;
- 709. - display: none;
- 710. - }
- 711. - #exchange_campaign_title {
- 712. - padding: 7px 5px 8px !important;
- 713. - width: 212px;
- 714. - }
- 715. - #exchange_choose_campaign {
- 716. - display: inline-block;
- 717. - margin: 3px 2px 0px 0px;
- 718. - }
- 719. - #exchange_msg,
- 720. - #exchange_error {
- 721. - margin-bottom: 20px;
- 722. - }
- 723. -
- 724. - .exchange_table_tt table .tt_text {
- 725. - color: #000;
- 726. - line-height: 150%;
- 727. - padding: 10px;
- 728. - width: 285px;
- 729. - }
- 730. - .exchange_table_tt table.toup1 .bottom_pointer {
- 731. - margin-right: 0px;
- 732. - margin-left: 34px;
- 733. - display: block;
- 734. - background: url(/images/tooltip_arrow_white.gif) no-repeat;
- 735. - }
- 736. - .exchange_table_tt table.toup .top_pointer {
- 737. - margin-right: 0px;
- 738. - margin-left: 34px;
- 739. - display: block;
- 740. - bottom: -2px;
- 741. - background: url(/images/tooltip_arrow_up.gif) no-repeat;
- 742. - }
- 743. -
- 744. - .exchange_request_comment {
- 745. - padding-top: 15px;
- 746. - }
- 747. - .exchange_request_comment .exchange_hint_tt {
- 748. - border: 1px solid #C0CAD5;
- 749. - position: relative;
- 750. - background: #FFF;
- 751. - }
- 752. - .exchange_request_comment .exchange_hint_tt .tail_wrap {
- 753. - top: -6px;
- 754. - bottom: auto;
- 755. - left: 32px;
- 756. - }
- 757. - .exchange_request_comment .exchange_hint_tt .tail {
- 758. - background: url(/images/adcomment_arrow.png) no-repeat;
- 759. - width: 11px;
- 760. - height: 6px;
- 761. - }
- 762. - .exchange_union_box table {
- 763. - border-spacing: 0px;
- 764. - }
- 765. - .exchange_union_box .label {
- 766. - color: #777;
- 767. - padding: 7px 10px 7px 0px;
- 768. - }
- 769. - .exchange_union_box input {
- 770. - width: 200px;
- 771. - padding: 7px 5px 8px
- 772. - }
- 773. - .exchange_client_all_limit a {
- 774. - border-bottom: 1px dashed #2B587A;
- 775. - text-decoration: none;
- 776. - }
- 777. - .exchange_stats_period_wrap {
- 778. - padding: 4px 0px 8px;
- 779. - }
- 780. - .exchange_stats_period_info .exchange_post_info_row {
- 781. - padding: 3px 0px 4px;
- 782. - }
- ------
Advertisement
Add Comment
Please, Sign In to add comment