Hormold

VK Change (#1375803901)

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