Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Файл - claims.css (Старый размер - 9157 | Новый - 5898):
- 345. - #claim_search_wrap {
- 346. - background: #F7F7F7;
- 347. - border-bottom: 1px solid #DAE1E8;
- 348. - padding: 10px;
- 349. - position: relative;
- 350. - }
- 351. - #claim_search {
- 352. - padding: 5px 5px 5px 20px;
- 353. - background: url(/images/magglass.png) no-repeat scroll 5px 6px white;
- 354. - height: 13px;
- 355. - outline: none;
- 356. - width: 448px;
- 357. - }
- 358. - #claim_search_wrap button {
- 359. - width: 120px;
- 360. - }
- 361. - #claim_clear_search {
- 362. - cursor: pointer;
- 363. - display: none;
- 364. - background: transparent url(/images/icons/input_clear.gif) 6px 6px no-repeat;
- 365. - padding: 2px;
- 366. - width: 19px;
- 367. - height: 19px;
- 368. - margin-left: 450px;
- 369. - margin-top: 1px;
- 370. - opacity: 0.6;
- 371. - filter: alpha(opacity=60);
- 372. - position: absolute;
- 373. - z-index: 100;
- 374. - }
- 375. - #claim_clear_search.shown {
- 376. - display: block;
- 377. - }
- 378. - .claim_title_row {
- 379. - border-top: 1px solid #DAE1E8;
- 380. - }
- 381. - .claim_title_row:first-child {
- 382. - border-top: none;
- 383. - }
- 384. - .claim_title {
- 385. - width: 400px;
- 386. - padding: 7px 10px;
- 387. - overflow: hidden;
- 388. - text-overflow: ellipsis;
- 389. - }
- 390. - .claim_title_duration {
- 391. - width: 150px;
- 392. - overflow: hidden;
- 393. - text-overflow: ellipsis;
- 394. - padding: 2px;
- 395. - }
- 396. - .claim_title_dur {
- 397. - margin: 2px;
- 398. - zoom: 1;
- 399. - padding: 4px !important;
- 400. - vertical-align: top;
- 401. - color: #45688E;
- 402. - background: #D5DDE5;
- 403. - font-weight: bold;
- 404. - font-style: normal !important;
- 405. - font-size: 10px;
- 406. - line-height: 11px;
- 407. - -webkit-border-radius: 2px;
- 408. - -khtml-border-radius: 2px;
- 409. - -moz-border-radius: 2px;
- 410. - border-radius: 2px;
- 411. - display: inline-block;
- 412. - cursor: pointer;
- 413. - }
- 414. - .claim_title_dur.add {
- 415. - width: 24px;
- 416. - text-align: center;
- 417. - }
- 418. - .claim_title_row .claim_title_remove_wrap {
- 419. - margin: 3px;
- 420. - padding: 4px;
- 421. - opacity: 0;
- 422. - filter: alpha(opacity=0);
- 423. - -webkit-transition: opacity 200ms linear, color 200ms linear;
- 424. - -moz-transition: opacity 200ms linear, color 200ms linear;
- 425. - -o-transition: opacity 200ms linear, color 200ms linear;
- 426. - transition: opacity 200ms linear, color 200ms linear;
- 427. - cursor: pointer;
- 428. - }
- 429. - .claim_title_row .claim_title_remove {
- 430. - background: url(/images/icons/audio_icons.png?4) -107px -51px no-repeat;
- 431. - height: 13px;
- 432. - width: 13px;
- 433. - position: relative;
- 434. - overflow: hidden;
- 435. - }
- 436. - .claim_title_row.over .claim_title_remove_wrap {
- 437. - opacity: 0.4;
- 438. - filter: alpha(opacity=40);
- 439. - }
- 440. - .claim_title_row.over .claim_title_remove_wrap.over {
- 441. - opacity: 1;
- 442. - filter: alpha(opacity=100);
- 443. - }
- 444. - .claim_msg {
- 445. - line-height: 200%;
- 446. - color: #777;
- 447. - font-size: 1.09em;
- 448. - text-align: center;
- 449. - padding: 100px;
- 450. - }
- 451. - #claim_show_more {
- 452. - display: block;
- 453. - padding: 8px 0px;
- 454. - text-align: center;
- 455. - margin: 0px;
- 456. - border-top: 1px solid #DAE1E8;
- 457. - }
- 458. - #claim_show_more.loading .claim_more {
- 459. - display: none;
- 460. - }
- 461. - #claim_show_more.loading .claim_more_progress {
- 462. - display: block;
- 463. - }
- 464. - #claim_show_more:hover {
- 465. - text-decoration: none;
- 466. - background: #E9EDF1;
- 467. - }
- 468. - #claim_show_more.search {
- 469. - display: none;
- 470. - }
- 471. - .claim_titles_list.light div.claim_title span {
- 472. - background-color: #FFF8CC;
- 473. - border-bottom: 1px solid #FFE222;
- 474. - }
- 475. - .claim_add_title {
- 476. - width: 80px;
- 477. - color: #555;
- 478. - padding: 5px 10px 0;
- 479. - }
- 480. - .claim_add_value {
- 481. - width: 305px;
- 482. - }
- 483. - .claim_add_value input {
- 484. - width: 301px;
- 485. - height: 13px;
- 486. - padding: 5px !important;
- 487. - }
- 488. - .claim_add_row {
- 489. - padding: 3px;
- 490. - }
- 491. - #claim_error {
- 492. - margin: 6px 6px 18px;
- 493. - display: none;
- 494. - }
- 495. - .claim_choose_added {
- 496. - display: block;
- 497. - height: 28px;
- 498. - line-height: 28px;
- 499. - margin: 0px;
- 500. - padding: 0px 6px;
- 501. - color: #777;
- 502. - max-width: 118px;
- 503. - }
- ------
- Файл - claims.js (Старый размер - 16930 | Новый - 0):
- 0. - Claims = {
- 1. - switchTab: function(el, evt) {
- 2. - if (evt.button) return true;
- 3. - show('claims_loading');
- 4. - if (hasClass(el.parentNode, 'claim_tab')) {
- 5. - each(geByClass('claim_tab_active', ge('claims_tabs')), function(i, v) {
- 6. - removeClass(v, 'claim_tab_active');
- 7. - addClass(v, 'claim_tab');
- 8. - });
- 9. - removeClass(el.parentNode, 'claim_tab');
- 10. - addClass(el.parentNode, 'claim_tab_active');
- 11. - } else if (hasClass(el.firstChild, 'claims_section_filter')) {
- 12. - each(geByClass('claims_section_filter', ge('claims_section_filters')), function(i, v) {
- 13. - removeClass(v, 'selected');
- 14. - });
- 15. - addClass(el.firstChild, 'selected');
- 16. - }
- 17. - return nav.go(el, evt);
- 18. - },
- 19. - toggleDetails: function(cid) {
- 20. - if (isVisible('details' + cid)) {
- 21. - Claims.hideDetails(cid);
- 22. - } else {
- 23. - Claims.showDetails(cid);
- 24. - }
- 25. - },
- 26. - showDetails: function(cid) {
- 27. - if (!cur.claimed_content) cur.claimed_content = {};
- 28. - if (!cur.claimed_content[cid]) {
- 29. - hide('details_link_' + cid);
- 30. - show('details_loading_' + cid);
- 31. - ajax.post('/claims', {act: 'a_get_content', claim_id: cid}, {
- 32. - onDone: function(content) {
- 33. - var cont = ge('details' + cid);
- 34. - var el = ge('content' + cid);
- 35. - el.innerHTML = content;
- 36. - hide('details_loading_' + cid);
- 37. - show('details_hide_' + cid);
- 38. - if (content == "") {
- 39. - hide('content_wrap' + cid);
- 40. - }
- 41. - if (!isVisible(cont)) slideToggle(cont, 200);
- 42. - }
- 43. - });
- 44. - } else {
- 45. - cont = ge('details' + cid);
- 46. - slideToggle(cont, 200, function(){
- 47. - hide('details_link_' + cid);
- 48. - show('details_hide_' + cid);
- 49. - });
- 50. - }
- 51. - cur.claimed_content[cid] = true;
- 52. - return false;
- 53. - },
- 54. - hideDetails: function(cid) {
- 55. - cont = ge('details' + cid);
- 56. - if (isVisible(cont)) slideToggle(cont, 200, function() {
- 57. - hide('details_hide_' + cid);
- 58. - show('details_link_' + cid);
- 59. - });
- 60. - return false;
- 61. - },
- 62. - getPage: function(offset) {
- 63. - show('pages_loading_top');
- 64. - show('pages_loading_bottom');
- 65. - ajax.post('/claims', {act: nav.objLoc.act, filter: nav.objLoc.filter, offset: offset, load: 1}, {
- 66. - cache: 1,
- 67. - onDone: function(content, script) {
- 68. - ge('content').innerHTML = content;
- 69. - if (window.tooltips) tooltips.hideAll();
- 70. - if (script) eval(script);
- 71. - if (offset) {
- 72. - nav.setLoc(extend(nav.objLoc, {offset: offset}));
- 73. - } else {
- 74. - delete nav.objLoc.offset;
- 75. - nav.setLoc(nav.objLoc);
- 76. - }
- 77. - },
- 78. - onFail: function() {
- 79. - hide('pages_loading_top');
- 80. - hide('pages_loading_bottom');
- 81. - }
- 82. - });
- 83. - return false;
- 84. - },
- 85. -
- 86. - claimContent: function(cid, type, owner_id, id, hash) {
- 87. - ge('claim' + cid + type + owner_id + '_' + id).innerHTML = '';
- 88. - ajax.post('/claims', {act: 'a_claim', claim_id: cid, type: type, id: id, owner_id: owner_id, hash: hash}, {
- 89. - onDone: function(response) {
- 90. - ge('claim' + cid + type + owner_id + '_' + id).innerHTML = '<a href="#" onclick="Claims.unclaimContent(' + cid + ',\'' + type + '\',' + owner_id + ',' + id + ',\'' + hash + '\');">�������</a>';
- 91. - }
- 92. - });
- 93. - },
- 94. - unclaimContent: function(cid, type, owner_id, id, hash) {
- 95. - ge('claim' + cid + type + owner_id + '_' + id).innerHTML = '';
- 96. - ajax.post('/claims', {act: 'a_unclaim', claim_id: cid, type: type, id: id, owner_id: owner_id, hash: hash}, {
- 97. - onDone: function(response) {
- 98. - ge('claim' + cid + type + owner_id + '_' + id).innerHTML = '<a href="#" onclick="Claims.claimContent(' + cid + ',\'' + type + '\',' + owner_id + ',' + id + ',\'' + hash + '\');">������</a>';
- 99. - }
- 100. - });
- 101. - },
- 102. - setClaimStatus: function(cid, status, onDone, sure, comment) {
- 103. - var params = {act: 'a_set_status', claim_id: cid, status: status};
- 104. - if (status == 2) {
- 105. - if (sure) {
- 106. - params.comment = comment;
- 107. - } else {
- 108. - var box = cur.showDeclineBox(function() {
- 109. - var comment = val('claims_decline_comment');
- 110. - box.hide();
- 111. - Claims.setClaimStatus(cid, status, onDone, true, comment);
- 112. - });
- 113. - return;
- 114. - }
- 115. - }
- 116. - ajax.post('/claims', params, {
- 117. - onDone: function(newstatus, message) {
- 118. - if (message) {
- 119. - showFastBox(getLang('global_error'), message);
- 120. - }
- 121. - removeClass('claim' + cid, 'status0');
- 122. - removeClass('claim' + cid, 'status1');
- 123. - removeClass('claim' + cid, 'status2');
- 124. - addClass('claim' + cid, 'status' + newstatus);
- 125. - if (onDone) {
- 126. - onDone(cid, newstatus);
- 127. - }
- 128. - }
- 129. - });
- 130. - },
- 131. - updateClaimButtons: function(cid, status) {
- 132. - if (status == 0) {
- 133. - ge('claim_status').innerHTML = "�������";
- 134. - ge('claim_buttons').innerHTML = "<div class=\"button_blue fl_l\"><button onclick=\"Claims.setClaimStatus(" + cid + ", 1, Claims.updateClaimButtons);\">�������</button></div>" +
- 135. - "<div class=\"button_gray fl_l\"><button onclick=\"Claims.setClaimStatus(" + cid + ", 2, Claims.updateClaimButtons);\">���������</button></div>";
- 136. - } else
- 137. - if (status == 1 || status == 2) {
- 138. - ge('claim_status').innerHTML = (status == 1 ? "�������" : "���������");
- 139. - ge('claim_buttons').innerHTML = "<div class=\"button_blue fl_l\"><button onclick=\"Claims.setClaimStatus(" + cid + ", 0, Claims.updateClaimButtons);\">�������</button></div>";
- 140. - }
- 141. - ge('claim_updated_msg').innerHTML = "<b>������</b><br/>������ ������ ������� �������.";
- 142. - show('claim_updated_msg');
- 143. - setStyle('claim_updated_msg', 'backgroundColor', '#F4EBBD');
- 144. - animate(ge('claim_updated_msg'), {backgroundColor: '#F9F6E7'}, 2000);
- 145. - scrollToTop(0);
- 146. - },
- 147. - updateClaimLinks: function(cid, status) {
- 148. - if (status == 0) {
- 149. - ge('claim' + cid + '_status').innerHTML = "�������<br/><a href='#' onclick='Claims.setClaimStatus(" + cid + ", 1, Claims.updateClaimLinks); return cancelEvent(event);'>�������</a>" +
- 150. - " | <a href='#' onclick='Claims.setClaimStatus(" + cid + ", 2, Claims.updateClaimLinks); return cancelEvent(event);'>���������</a>";
- 151. - } else
- 152. - if (status == 1 || status == 2) {
- 153. - ge('claim' + cid + '_status').innerHTML = ((status == 1) ? "�������" : "���������") + "<br/><a href='#' onclick='Claims.setClaimStatus(" + cid + ", 0, Claims.updateClaimLinks); return cancelEvent(event);'>�������</a>";
- 154. - }
- 155. - },
- 156. - toggleObjectionDetails: function(oid) {
- 157. - var cont = ge('objection_details' + oid);
- 158. - slideToggle(cont, 200, function() {
- 159. - //ge('objection_details_link_0').innerHTML = isVisible(cont) ? "������" : "��������";
- 160. - });
- 161. - },
- 162. - approveObjection: function(oid) {
- 163. - ge('objection_status_' + oid).innerHTML = '';
- 164. - show('objection_loading_' + oid);
- 165. - ajax.post('/claims', {act: 'a_approve_objection', objection_id: oid}, {
- 166. - onDone: function(newstatus, oids) {
- 167. - hide('objection_loading_' + oid);
- 168. - if (oids && oids.length) {
- 169. - for (var i in oids) {
- 170. - ge('objection_status_' + oids[i]).innerHTML = newstatus;
- 171. - addClass('objection' + oids[i], 'approved');
- 172. - }
- 173. - }
- 174. - }
- 175. - });
- 176. - },
- 177. - declineObjection: function(oid) {
- 178. - ge('objection_status_' + oid).innerHTML = '';
- 179. - show('objection_loading_' + oid);
- 180. - ajax.post('/claims', {act: 'a_decline_objection', objection_id: oid}, {
- 181. - onDone: function(newstatus, oids) {
- 182. - hide('objection_loading_' + oid);
- 183. - if (oids && oids.length) {
- 184. - for (var i in oids) {
- 185. - ge('objection_status_' + oids[i]).innerHTML = newstatus;
- 186. - addClass('objection' + oids[i], 'declined');
- 187. - }
- 188. - }
- 189. - }
- 190. - });
- 191. - },
- 192. -
- 193. - indexTitles: function(callback) {
- 194. - var all = cur.blacklist,
- 195. - replacer = function(str, p) {
- 196. - var c = intval(p);
- 197. - return (c >= 33 && c < 48) ? String.fromCharCode(c) : str;
- 198. - };
- 199. -
- 200. - cur.titles = cur.titles || {};
- 201. - cur.titlesIndex = new vkIndexer(all, function(obj) {
- 202. - cur.titles[parseInt(obj.id)] = obj;
- 203. - return obj.title_sorted.replace(/\&\#(\d+);?/gi, replacer);
- 204. - }, function() {
- 205. - if (callback) {
- 206. - callback();
- 207. - }
- 208. - });
- 209. - },
- 210. -
- 211. - filterClaimedTitles: function(e, obj, force) {
- 212. - clearTimeout(this.filterTimeout);
- 213. - this.filterTimeout = setTimeout((function() {
- 214. - var str = trim(obj.value);
- 215. - if (str == cur.searchStr && !force) return;
- 216. - toggleClass(cur.clearSearch, 'shown', !!str);
- 217. - if (str && hasClass(cur.addButton.parentNode, 'button_disabled')) {
- 218. - disableButton(cur.addButton, false);
- 219. - } else if (!str && !hasClass(cur.addButton.parentNode, 'button_disabled')) {
- 220. - disableButton(cur.addButton, true);
- 221. - }
- 222. - cur.searchStr = str;
- 223. - this.searchTitles(str);
- 224. -
- 225. - scrollToTop();
- 226. - }).bind(this), 10);
- 227. - },
- 228. -
- 229. - clearTitlesSearch: function(el, event) {
- 230. - setStyle(el, {opacity: .6});
- 231. - elfocus(cur.aSearch);
- 232. - val(cur.aSearch, '');
- 233. - removeClass(cur.clearSearch, 'shown');
- 234. - if (!hasClass(cur.addButton.parentNode, 'button_disabled')) {
- 235. - disableButton(cur.addButton, true);
- 236. - }
- 237. - this.filterClaimedTitles(null, cur.aSearch);
- 238. - },
- 239. -
- 240. - scrollCheck: function () {
- 241. - if (browser.mobile || cur.disableAutoMore) return;
- 242. -
- 243. - if (!isVisible(cur.showMore) || !cur.curList) return;
- 244. -
- 245. - var docEl = document.documentElement;
- 246. - var ch = window.innerHeight || docEl.clientHeight || bodyNode.clientHeight;
- 247. - var st = scrollGetY();
- 248. -
- 249. - if (st + ch + 400 > cur.showMore.offsetTop) {
- 250. - Claims.showTitleRows();
- 251. - }
- 252. - },
- 253. -
- 254. - scrollnode: browser.msie6 ? pageNode : window,
- 255. - startTitleEvents: function() {
- 256. - addEvent(Claims.scrollnode, 'scroll', Claims.scrollCheck);
- 257. - addEvent(window, 'resize', Claims.scrollCheck);
- 258. - addEvent(cur.aSearch, 'blur', Claims.searchTitleBlur);
- 259. - addEvent(cur.aSearch, 'focus', Claims.searchTitleFocus);
- 260. - },
- 261. -
- 262. - stopTitleEvents: function() {
- 263. - removeEvent(Claims.scrollnode, 'scroll', AudClaimsio.scrollCheck);
- 264. - removeEvent(window, 'resize', Claims.scrollCheck);
- 265. - removeEvent(cur.aSearch, 'blur', Claims.searchTitleBlur);
- 266. - removeEvent(cur.aSearch, 'focus', Claims.searchTitleFocus);
- 267. - },
- 268. -
- 269. - searchTitleFocus: function() {
- 270. - addClass(cur.aContent, 'light');
- 271. - },
- 272. -
- 273. - searchTitleBlur: function() {
- 274. - removeClass(cur.aContent, 'light');
- 275. - },
- 276. -
- 277. - filterDeletedTitles: function(arr) {
- 278. - var len = arr.length;
- 279. - var res = [];
- 280. - for (var i = 0; i < len; i++) {
- 281. - var t = arr[i];
- 282. - if (cur.titles && cur.titles[t.id] && !cur.titles[t.id].deleted) {
- 283. - res.push(t);
- 284. - }
- 285. - }
- 286. - return res;
- 287. - },
- 288. -
- 289. - searchTitles: function(str) {
- 290. - cur.shownTitles = 0;
- 291. - if (str) {
- 292. - var htmlentities = function(s){
- 293. - var el = document.createElement('div');
- 294. - el.innerText = el.textContent = s;
- 295. - s = el.innerHTML;
- 296. - delete el;
- 297. - return s.split('"').join('"');
- 298. - }
- 299. - var htmlencode = function(str){
- 300. - return str.toLowerCase().replace(/\u2013|\u2014/g, '-');
- 301. - var aStr = str.toLowerCase().replace(/\u2013|\u2014/g, '-').split(''), i = aStr.length, aRet = [];
- 302. - while (i--) {
- 303. - var iC = aStr[i].charCodeAt();
- 304. - if ((iC > 127 && iC < 994)) {
- 305. - aRet.push('&#'+iC+';');
- 306. - } else if (iC == 36) {
- 307. - aRet.push('�'+iC+';');
- 308. - } else {
- 309. - aRet.push(htmlentities(aStr[i]));
- 310. - }
- 311. - }
- 312. - return aRet.reverse().join('');
- 313. - }
- 314. - var res = cur.titlesIndex.search(htmlencode(str));
- 315. - cur.curList = 'search_' + str;
- 316. - cur.titlesList[cur.curList] = res.sort(function(a,b) {return a._order - b._order});
- 317. -
- 318. - if (str) {
- 319. - str += ' '+(parseLatin(str) || '');
- 320. - str = trim(escapeRE(str.replace(/\)/g, '')).split('&').join('&'));
- 321. - cur.selection = {
- 322. - re: new RegExp('('+str.replace(cur.titlesIndex.delimiter, '|').replace(/(^\||\|$|\?)/g, '')+')', 'gi'),
- 323. - val: '<span>$1</span>'
- 324. - };
- 325. - }
- 326. - } else {
- 327. - cur.curList = 'all';
- 328. - cur.selection = false;
- 329. - }
- 330. -
- 331. - cur.sectionCount = (cur.titlesList[cur.curList]) ? cur.titlesList[cur.curList].length : 0;
- 332. - this.filterTimeout = setTimeout((function() {
- 333. - this.showTitleRows();
- 334. - }).bind(this), 10);
- 335. - },
- 336. -
- 337. - showTitleRows: function(start, end) {
- 338. - var list = cur.titlesList[cur.curList] || [];
- 339. - if (start == undefined) {
- 340. - start = cur.shownTitles;
- 341. - }
- 342. - if (end == undefined) {
- 343. - end = cur.shownTitles + cur.titlesPerPage;
- 344. - }
- 345. - if (window.tooltips && cur.tooltips) {
- 346. - for (var i = 0; i < cur.tooltips.length; ++i) {
- 347. - if (cur.tooltips[i].el) {
- 348. - if (cur.tooltips[i].el.ttimer) {
- 349. - clearTimeout(cur.tooltips[i].el.ttimer);
- 350. - }
- 351. - }
- 352. - cur.tooltips[i].hide({fasthide: true});
- 353. - }
- 354. - }
- 355. - if (!cur.searchStr) {
- 356. - list = Claims.filterDeletedTitles(list);
- 357. - }
- 358. - if (!list || !list.length) {
- 359. - var msg = (cur.blacklist.length) ? getLang('claim_no_audios_found').split('{query}').join('<b>'+cur.searchStr.replace(/([<>&#]*)/g, '')+'</b>'): getLang('claim_no_blacklist_audios');
- 360. - cur.aContent.innerHTML = '<div id="not_found" class="claim_msg">'+msg+'</div>';
- 361. - hide(cur.showMore);
- 362. - } else {
- 363. - if (!cur.shownTitles) cur.aContent.innerHTML = '';
- 364. - var titles = list.slice(start, end);
- 365. - if (!titles.length) {
- 366. - if (cur.shownTitles >= cur.sectionCount) {
- 367. - hide(cur.showMore);
- 368. - }
- 369. - return;
- 370. - }
- 371. - var html = [];
- 372. - for (i in titles) {
- 373. - var row = clone(titles[i]);
- 374. - if (cur.selection) {
- 375. - row.title = row.title.replace(cur.selection.re, cur.selection.val).replace(/&#(\d*)<span>(\d+)<\/span>(\d*);/g, "&#$1$2$3;");
- 376. - }
- 377. - html.push(cur.titleTpl(row));
- 378. - cur.shownTitles += 1;
- 379. - }
- 380. - var au = ce('div', {innerHTML: html.join('')});
- 381. - while (au.firstChild) {
- 382. - var el = au.firstChild;
- 383. - cur.aContent.appendChild(el);
- 384. - }
- 385. - toggle(cur.showMore, (cur.shownTitles < cur.sectionCount));
- 386. - }
- 387. - },
- 388. -
- 389. - deleteClaimedTitle: function(title_id) {
- 390. - var obj = cur.titles[title_id], title = obj.title || '';
- 391. - var box = showFastBox({title: getLang('claim_delete_blacklist_title'), dark: 1, width: 450}, rs(cur.sureDelete, {title: '<b>' + title + '</b>'}), getLang('global_delete'), function(btn) {
- 392. - ajax.post('/claims', {act: 'a_delete_blacklist', title_id: title_id, hash: cur.hash}, {
- 393. - showProgress: lockButton.pbind(btn),
- 394. - hideProgress: unlockButton.pbind(btn),
- 395. - onDone: function() {
- 396. - cur.titlesIndex.remove(obj);
- 397. - cur.titles[title_id].deleted = true;
- 398. - cur.sectionCount--;
- 399. - if (cur.shownTitles) cur.shownTitles--;
- 400. - slideUp('row'+title_id, 200, re.pbind('row'+title_id));
- 401. - box.hide();
- 402. - },
- 403. - onFail: function(err) {
- 404. - ge('claim_error').innerHTML = err;
- 405. - show('claim_error');
- 406. - return true;
- 407. - }
- 408. - });
- 409. - }, getLang('global_cancel'));
- 410. - },
- 411. -
- 412. - saveClaimedTitle: function(btn){
- 413. - var box = curBox();
- 414. - title = trim(val('claim_add_title')),
- 415. - claim_id = val('claim_add_claim');
- 416. - ajax.post('/claims', {act: 'a_add_blacklist', str: title, claim_id: claim_id, hash: cur.hash}, {
- 417. - showProgress: lockButton.pbind(btn),
- 418. - hideProgress: unlockButton.pbind(btn),
- 419. - onDone: function(obj) {
- 420. - var all_list = cur.blacklist;
- 421. - if (all_list && all_list.length) {
- 422. - obj._order = all_list[0]._order - 1;
- 423. - cur.titlesList['all'].splice(0, 0, obj);
- 424. - } else {
- 425. - obj._order = 0;
- 426. - cur.titlesList['all'] = [obj];
- 427. - }
- 428. - cur.titles[obj[1]] = obj;
- 429. - cur.titlesIndex.add(obj);
- 430. - Claims.filterClaimedTitles(null, cur.aSearch, true);
- 431. - box.hide();
- 432. - },
- 433. - onFail: function(err) {
- 434. - ge('claim_error').innerHTML = err;
- 435. - show('claim_error');
- 436. - return true;
- 437. - }
- 438. - });
- 439. - },
- 440. -
- 441. - newClaimedTitle: function() {
- 442. - var str = trim(cur.aSearch.value), claim_id = '';
- 443. - if (!str) {
- 444. - notaBene(cur.aSearch);
- 445. - return;
- 446. - }
- 447. - showFastBox({title: getLang('claim_add_blacklist_title'), dark: 1, width: 450}, rs(cur.addForm, {title: str, claim_id: claim_id}), getLang('global_add'), Claims.saveClaimedTitle, getLang('global_cancel'));
- 448. - elfocus('claim_add_title');
- 449. - },
- 450. -
- 451. - addTitleDuration: function(title_id, title) {
- 452. - cur.currentTitleId = title_id;
- 453. - showBox('audio', {act: 'a_choose_audio_box', q: title, blacklist: 1}, {cache: 1, dark: 1});
- 454. - },
- 455. -
- 456. - chooseTitleDuration: function(link, duration) {
- 457. - ajax.post('/claims', {act: 'a_add_blacklist_duration', title_id: cur.currentTitleId, duration: duration, hash: cur.hash}, {
- 458. - onDone: function() {
- 459. - var parEl = geByClass1('claim_title_duration', ge('row' + cur.currentTitleId));
- 460. - if (parEl) {
- 461. - var addEl = geByClass1('add', parEl);
- 462. - if (addEl) {
- 463. - parEl.insertBefore(se('<div class="claim_title_dur">' + cur.formatTime(duration) + '</div>'), addEl)
- 464. - }
- 465. - }
- 466. - }
- 467. - });
- 468. - link.parentNode.innerHTML = '<div class="claim_choose_added">' + getLang('claim_choose_added') + '</div>';
- 469. - },
- 470. -
- 471. - deleteTitleDuration: function(title_id, duration_id, el) {
- 472. - var box = showFastBox({title: getLang('claim_delete_blacklist_duration_title'), dark: 1, width: 450}, getLang('claim_sure_delete_blacklist_duration'), getLang('global_delete'), function(btn) {
- 473. - ajax.post('/claims', {act: 'a_delete_blacklist_duration', title_id: title_id, duration_id: duration_id, hash: cur.hash}, {
- 474. - showProgress: lockButton.pbind(btn),
- 475. - hideProgress: unlockButton.pbind(btn),
- 476. - onDone: function() {
- 477. - delete ((cur.titles[title_id] || {}).duration || {})[duration_id];
- 478. - re(el);
- 479. - box.hide();
- 480. - },
- 481. - onFail: box.hide
- 482. - });
- 483. - }, getLang('global_cancel'));
- 484. - },
- 485. -
- 486. - _eof: 1};try{stManager.done('claims.js');}catch(e){}
- ------
Advertisement
Add Comment
Please, Sign In to add comment