Hormold

VK Change (#1375725605)

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