Hormold

VK Change (#1379414706)

Sep 17th, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 36.78 KB | None | 0 0
  1. Файл - board.js (Старый размер - 30296 | Новый - 0):
  2. 0.  - var Board = {
  3. 1.  -   createTopic: function(oid, hash) {
  4. 2.  -     var title = trim(val('bnt_title')), post = trim(val('bnt_text')), question, answers = [];
  5. 3.  -     var chosen = cur.boardNewMedia.chosenMedias || {}, media = [], types = [];
  6. 4.  -     for (var i = 0, l = chosen.length; i < l; ++i) {
  7. 5.  -       var m = chosen[i];
  8. 6.  -       if (m) {
  9. 7.  -         types.push(m[0]);
  10. 8.  -         media.push(m[1]);
  11. 9.  -       }
  12. 10.  -     }
  13. 11.  -     if (!title) return elfocus('bnt_title');
  14. 12.  -     if (!post && !media.length) return elfocus('bnt_text');
  15. 13.  -     if (cur.pollPreview) {
  16. 14.  -       question = trim(val('bnt_poll_question'));
  17. 15.  -       if (!question) {
  18. 16.  -         return elfocus('bnt_poll_question');
  19. 17.  -       }
  20. 18.  -       for (var el = ge('bnt_poll_answers').firstChild; el; el = el.nextSibling) {
  21. 19.  -         if (!isVisible(el)) break;
  22. 20.  -         var answer = trim(val(el));
  23. 21.  -         if (answer) {
  24. 22.  -           answers.push(answer);
  25. 23.  -         }
  26. 24.  -       }
  27. 25.  -       if (!answers.length) {
  28. 26.  -         return elfocus(ge('bnt_poll_answers').firstChild);
  29. 27.  -       }
  30. 28.  -     }
  31. 29.  -
  32. 30.  -     globalHistoryDestroy('board' + (-oid));
  33. 31.  -     ajax.post('al_board.php', {
  34. 32.  -       act: 'do_create',
  35. 33.  -       oid: oid,
  36. 34.  -       hash: hash,
  37. 35.  -       title: title,
  38. 36.  -       post: post,
  39. 37.  -       media_types: types,
  40. 38.  -       media: media,
  41. 39.  -       question: question,
  42. 40.  -       from_group: isChecked('bnt_from_group'),
  43. 41.  -       answers: answers
  44. 42.  -     }, {
  45. 43.  -       showProgress: lockButton.pbind(ge('bnt_subm')),
  46. 44.  -       hideProgress: unlockButton.pbind(ge('bnt_subm'))
  47. 45.  -     });
  48. 46.  -   },
  49. 47.  -   attachPoll: function() {
  50. 48.  -     var prev = ge('bnt_media_preview');
  51. 49.  -     cur.pollPreview = prev.parentNode.insertBefore(ce('div', {id: 'bnt_poll', innerHTML: '\
  52. 50.  - <div class="bnt_header">' + getLang('voting_topic') + '</div>\
  53. 51.  - <input type="text" class="text" id="bnt_poll_question" />\
  54. 52.  - <nobr class="no_select fl_r" onselectstart="return false;" ondblclick="return false;">\
  55. 53.  -   <a id="bnt_poll_add" onclick="Board.incPoll(\'bnt\')">' + getLang('voting_variants_add') + '</a><span class="sdivide">|</span><a id="bnt_poll_delete" class="bnt_disabled" onclick="Board.decPoll(\'bnt\')">' + getLang('voting_variants_del') + '</a>\
  56. 54.  - </nobr>\
  57. 55.  - <div class="bnt_header">' + getLang('voting_variants') + '</div>\
  58. 56.  - <div id="bnt_poll_answers"></div>\
  59. 57.  -     '}, {display: 'none'}), prev);
  60. 58.  -     Board.initAddPoll('bnt');
  61. 59.  -     slideDown(cur.pollPreview, 200, function() {
  62. 60.  -       show('bnt_cancel_poll');
  63. 61.  -       elfocus('bnt_poll_question');
  64. 62.  -     });
  65. 63.  -   },
  66. 64.  -   initAddPoll: function(prefix) {
  67. 65.  -     var html = [];
  68. 66.  -     for (var i = 0; i < 20; ++i) {
  69. 67.  -       html.push('<input type="text" class="text ' + prefix + '_poll_answer" style="' + (i > 1 ? 'display: none' : '') + '" />');
  70. 68.  -     }
  71. 69.  -     ge(prefix + '_poll_answers').innerHTML = html.join('');
  72. 70.  -   },
  73. 71.  -   cancelPoll: function() {
  74. 72.  -     hide('bnt_cancel_poll');
  75. 73.  -     slideUp(cur.pollPreview, 200, function() {
  76. 74.  -       re(cur.pollPreview);
  77. 75.  -       cur.pollPreview = false;
  78. 76.  -       show('bnt_attach');
  79. 77.  -     });
  80. 78.  -   },
  81. 79.  -   incPoll: function(prefix) {
  82. 80.  -     var answers = ge(prefix + '_poll_answers');
  83. 81.  -     for (var el = answers.firstChild; el; el = el.nextSibling) {
  84. 82.  -       if (!isVisible(el)) {
  85. 83.  -         break;
  86. 84.  -       }
  87. 85.  -     }
  88. 86.  -     if (el) {
  89. 87.  -       ge(prefix + '_poll_delete').className = '';
  90. 88.  -       show(el);
  91. 89.  -     }
  92. 90.  -     if (!el || !el.nextSibling) {
  93. 91.  -       ge(prefix + '_poll_add').className = prefix + '_disabled';
  94. 92.  -     }
  95. 93.  -   },
  96. 94.  -   decPoll: function(prefix) {
  97. 95.  -     var answers = ge(prefix + '_poll_answers'), first = answers.firstChild;
  98. 96.  -     for (var el = answers.lastChild; el; el = el.previousSibling) {
  99. 97.  -       if (isVisible(el)) {
  100. 98.  -         break;
  101. 99.  -       }
  102. 100.  -     }
  103. 101.  -     if (el) {
  104. 102.  -       if (el == first || el == first.nextSibling) {
  105. 103.  -         el = false;
  106. 104.  -       }
  107. 105.  -       if (el) {
  108. 106.  -         ge(prefix + '_poll_add').className = '';
  109. 107.  -         hide(el);
  110. 108.  -       }
  111. 109.  -     }
  112. 110.  -     if (!el || !el.previousSibling || el.previousSibling == first.nextSibling) {
  113. 111.  -       ge(prefix + '_poll_delete').className = prefix + '_disabled';
  114. 112.  -     }
  115. 113.  -   },
  116. 114.  -
  117. 115.  -   scrollResize: function() {
  118. 116.  -     if (browser.mobile || cur.pvShown) return;
  119. 117.  -
  120. 118.  -     var docEl = document.documentElement;
  121. 119.  -     var ch = window.innerHeight || docEl.clientHeight || bodyNode.clientHeight;
  122. 120.  -     var st = scrollGetY();
  123. 121.  -     var lnk = ge('blst_load_more');
  124. 122.  -
  125. 123.  -     if (!isVisible(lnk)) return;
  126. 124.  -     if (st + ch > lnk.offsetTop) {
  127. 125.  -       Board.load();
  128. 126.  -     }
  129. 127.  -   },
  130. 128.  -   initScroll: function() {
  131. 129.  -     cur.module = 'board';
  132. 130.  -
  133. 131.  -     Board.scrollnode = browser.msie6 ? pageNode : window;
  134. 132.  -
  135. 133.  -     addEvent(Board.scrollnode, 'scroll', Board.scrollResize);
  136. 134.  -     addEvent(window, 'resize', Board.scrollResize);
  137. 135.  -     removeEvent(window, 'load', Board.initScroll);
  138. 136.  -     cur.destroy.push(Board.deinitScroll);
  139. 137.  -   },
  140. 138.  -   deinitScroll: function() {
  141. 139.  -     removeEvent(Board.scrollnode, 'scroll', Board.scrollResize);
  142. 140.  -     removeEvent(window, 'resize', Board.scrollResize);
  143. 141.  -   },
  144. 142.  -   loaded: function(off, rows) {
  145. 143.  -     cur.offset = off;
  146. 144.  -
  147. 145.  -     var cont = ge('blst_cont'), d = ce('div', {innerHTML: rows});
  148. 146.  -     while (d.firstChild) {
  149. 147.  -       cont.appendChild(d.firstChild);
  150. 148.  -     }
  151. 149.  -
  152. 150.  -     if (off >= cur.count || !rows) {
  153. 151.  -       hide('blst_load_more');
  154. 152.  -       return;
  155. 153.  -     }
  156. 154.  -     cur.loading = 1;
  157. 155.  -     var params = cur.query ? {act: 'search', q: cur.query} : {order: cur.order};
  158. 156.  -     ajax.post('/board' + cur.gid, extend(params, {offset: cur.offset, part: 1}), {cache: 1, onDone: function() {
  159. 157.  -       if (cur.loading == 2) {
  160. 158.  -         Board.loaded.apply(window, arguments);
  161. 159.  -       } else {
  162. 160.  -         cur.loading = false;
  163. 161.  -       }
  164. 162.  -     }, onFail: function() {
  165. 163.  -       cur.loading = 0;
  166. 164.  -       return true;
  167. 165.  -     }});
  168. 166.  -   },
  169. 167.  -   load: function() {
  170. 168.  -     if (!isVisible('blst_load_more') || isVisible('blst_more_progress')) return;
  171. 169.  -     if (cur.loading) {
  172. 170.  -       cur.loading = 2;
  173. 171.  -       return;
  174. 172.  -     }
  175. 173.  -
  176. 174.  -     var params = cur.query ? {act: 'search', q: cur.query} : {order: cur.order};
  177. 175.  -     ajax.post('/board' + cur.gid, extend(params, {offset: cur.offset, part: 1}), {onDone: Board.loaded, onFail: function() {
  178. 176.  -       cur.loading = 0;
  179. 177.  -       return true;
  180. 178.  -     }, showProgress: function() {
  181. 179.  -       show('blst_more_progress');
  182. 180.  -       hide(ge('blst_load_more').firstChild);
  183. 181.  -     }, hideProgress: function() {
  184. 182.  -       show(ge('blst_load_more').firstChild);
  185. 183.  -       hide('blst_more_progress');
  186. 184.  -     }, cache: 1});
  187. 185.  -   },
  188. 186.  -
  189. 187.  -   topicFieldUpdated: function() {
  190. 188.  -     var newt = val(cur.addField), newh = getSize(cur.addBlock)[1];
  191. 189.  -     var ch = (cur.addBlockHeight != newh), ct = (cur.addText != newt);
  192. 190.  -     if (ch) {
  193. 191.  -       cur.addBlockHeight = newh;
  194. 192.  -       cur.addBlockWrap.style.height = newh + 'px';
  195. 193.  -     }
  196. 194.  -     if (ct) {
  197. 195.  -       cur.addText = newt;
  198. 196.  -     }
  199. 197.  -     if (ch || ct) {
  200. 198.  -       Board.topicOnScroll(false, false, true);
  201. 199.  -     }
  202. 200.  -   },
  203. 201.  -   topicOnProgress: function() {
  204. 202.  -     Board.topicFieldUpdated();
  205. 203.  -   },
  206. 204.  -   topicCheckAttach: function() {
  207. 205.  -     var img = geByClass1('photo', cur.addAttach);
  208. 206.  -     if (!img) return;
  209. 207.  -     if (img.width && img.height) {
  210. 208.  -       Board.topicFieldUpdated();
  211. 209.  -     } else {
  212. 210.  -       img.onload = Board.topicCheckAttach;
  213. 211.  -     }
  214. 212.  -   },
  215. 213.  -   topicAttachAdded: function() {
  216. 214.  -     Board.topicFieldUpdated();
  217. 215.  -     Board.topicCheckAttach();
  218. 216.  -   },
  219. 217.  -   topicAttachWillAdd: function() {
  220. 218.  -     setTimeout(Board.topicAttachAdded, 10);
  221. 219.  -     setTimeout(Board.topicAttachAdded, 100);
  222. 220.  -     setTimeout(Board.topicAttachAdded, 1000);
  223. 221.  -   },
  224. 222.  -   repliesCount: function() {
  225. 223.  -     var m = cur.addText.match(/\[post\d+\|[^\]]+\]/g), res = 0;
  226. 224.  -     for (var i in (m || {})) ++res;
  227. 225.  -     return res;
  228. 226.  -   },
  229. 227.  -   replyPost: function(post, mid) {
  230. 228.  -     if (browser.mobile) return elfocus(cur.addField);
  231. 229.  -     cur.addForce = true;
  232. 230.  -     Board.topicOnScroll(false, false, true);
  233. 231.  -     var count = Board.repliesCount();
  234. 232.  -     if (count >= 10) {
  235. 233.  -       return setTimeout(elfocus.pbind(cur.addField), 0);
  236. 234.  -     }
  237. 235.  -     var insert = replaceEntities(cur.names[mid].replace('{post_id}', 'post' + post)), pos;
  238. 236.  -     if (document.selection) {
  239. 237.  -       var range = document.selection.createRange();
  240. 238.  -       if (range.parentElement() == cur.addField) {
  241. 239.  -         range.text = insert + (range.text || '');
  242. 240.  -         pos = -1;
  243. 241.  -         range.select();
  244. 242.  -       } else {
  245. 243.  -         val(cur.addField, cur.addText + insert);
  246. 244.  -         pos = cur.addText.length + insert.length;
  247. 245.  -       }
  248. 246.  -     } else {
  249. 247.  -       pos = cur.addField.selectionEnd + insert.length;
  250. 248.  -       cur.addField.blur();
  251. 249.  -       val(cur.addField, cur.addText.substr(0, cur.addField.selectionStart) + insert + cur.addText.substr(cur.addField.selectionStart));
  252. 250.  -     }
  253. 251.  -     if (pos >= 0) {
  254. 252.  -       elfocus(cur.addField, pos, pos);
  255. 253.  -     }
  256. 254.  -     cur.addText = val(cur.addField);
  257. 255.  -   },
  258. 256.  -   privacyChanged: function(key) {
  259. 257.  -     if (key == 'voting_action') {
  260. 258.  -       Board.votingAction(key);
  261. 259.  -     } else if (key == 'topic_action') {
  262. 260.  -       Board.topicAction(key);
  263. 261.  -     }
  264. 262.  -   },
  265. 263.  -   topicAction: function(key) {
  266. 264.  -     ge('privacy_edit_topic_action').innerHTML = getLang('global_edit');
  267. 265.  -     var act = cur.privacy[key][0];
  268. 266.  -     cur.privacy[key] = [0, 0, []];
  269. 267.  -     if (act == 'edit') {
  270. 268.  -       showFastBox(getLang('board_edit_topic'), '\
  271. 269.  - <div class="bte_label fl_l">' + getLang('board_new_topic_title') + '</div>\
  272. 270.  - <div class="bte_labeled fl_l">\
  273. 271.  -   <input id="bte_title" class="text" type="text" onchange="curBox().changed = true;" onkeypress="if (event.keyCode == 10 || event.keyCode == 13) Board.saveTopic()" />\
  274. 272.  - </div><br class="clear">\
  275. 273.  -       ', getLang('global_save'), Board.saveTopic, getLang('global_cancel'));
  276. 274.  -       val('bte_title', winToUtf(val('bt_title')));
  277. 275.  -       elfocus('bte_title');
  278. 276.  -     } else if (act == 'voting') {
  279. 277.  -       showBox('al_board.php', {act: 'create_voting', topic: cur.topic});
  280. 278.  -     } else if (act == 'delete') {
  281. 279.  -       showFastBox(getLang('board_edit_topic'), '<div>' + getLang('board_sure_delete_topic') + '</div>', getLang('global_delete'), Board.deleteTopic, getLang('global_cancel'));
  282. 280.  -     } else if (act == 'open' || act == 'close') {
  283. 281.  -       ajax.post('al_board.php', {act: (act == 'open') ? 'open_topic' : 'close_topic', topic: cur.topic, hash: cur.hash, offset: nav.objLoc.offset}, {
  284. 282.  -         showProgress: function() {
  285. 283.  -           hide('privacy_edit_topic_action');
  286. 284.  -           show('edit_topic_prg');
  287. 285.  -         },
  288. 286.  -         hideProgress: function() {
  289. 287.  -           hide('edit_topic_prg');
  290. 288.  -           show('privacy_edit_topic_action');
  291. 289.  -         }
  292. 290.  -       });
  293. 291.  -     } else if (act == 'fix' || act == 'unfix') {
  294. 292.  -       var t = cur.topic;
  295. 293.  -       ajax.post('al_board.php', {act: (act == 'fix') ? 'fix_topic' : 'unfix_topic', topic: t, hash: cur.hash}, {
  296. 294.  -         onDone: function(text, priv) {
  297. 295.  -           if (cur.topic !== t) return;
  298. 296.  -           cur.privacy.topic_action_types = priv;
  299. 297.  -           var msg = ge('bt_msg');
  300. 298.  -           if (!msg) {
  301. 299.  -             msg = ge('content').insertBefore(ce('div', {id: 'bt_msg', className: 'msg'}), ge('bt_title').parentNode.nextSibling);
  302. 300.  -             re('bv_msg');
  303. 301.  -           }
  304. 302.  -           msg.innerHTML = text;
  305. 303.  -           msg.style.backgroundColor = '#F4EBBD';
  306. 304.  -           animate(msg, {backgroundColor: '#F9F6E7'}, 2000);
  307. 305.  -         },
  308. 306.  -         showProgress: function() {
  309. 307.  -           hide('privacy_edit_topic_action');
  310. 308.  -           show('edit_topic_prg');
  311. 309.  -         },
  312. 310.  -         hideProgress: function() {
  313. 311.  -           hide('edit_topic_prg');
  314. 312.  -           show('privacy_edit_topic_action');
  315. 313.  -         }
  316. 314.  -       });
  317. 315.  -     }
  318. 316.  -   },
  319. 317.  -   saveTopic: function() {
  320. 318.  -     var newtitle = trim(val('bte_title'));
  321. 319.  -     if (!newtitle) {
  322. 320.  -       return elfocus('bte_title');
  323. 321.  -     }
  324. 322.  -     ajax.post('al_board.php', {act: 'save_topic', topic: cur.topic, hash: cur.hash, title: newtitle}, {onDone: function(text) {
  325. 323.  -       ge('bt_title').innerHTML = text;
  326. 324.  -       curBox().hide();
  327. 325.  -     }, progress: curBox().progress});
  328. 326.  -   },
  329. 327.  -   deleteTopic: function() {
  330. 328.  -     ajax.post('al_board.php', {act: 'delete_topic', topic: cur.topic, hash: cur.hash}, {progress: curBox().progress});
  331. 329.  -   },
  332. 330.  -   initTopic: function(opts, preload) {
  333. 331.  -     extend(cur, {
  334. 332.  -       module: 'board',
  335. 333.  -
  336. 334.  -       docked: false,
  337. 335.  -       topic: opts.topic,
  338. 336.  -       owner: opts.owner,
  339. 337.  -       hash: opts.hash,
  340. 338.  -       postLimit: opts.limit,
  341. 339.  -       postTo: 'board' + (-opts.owner),
  342. 340.  -
  343. 341.  -       names: opts.names,
  344. 342.  -       mediaTypes: opts.media,
  345. 343.  -
  346. 344.  -       addField: ge('ba_text'),
  347. 345.  -       addBlock: ge('ba_post'),
  348. 346.  -       addAttach: ge('ba_media_preview'),
  349. 347.  -       addBlockWrap: ge('ba_post_wrap'),
  350. 348.  -
  351. 349.  -       pgStart: opts.start,
  352. 350.  -       pgOffset: opts.offset,
  353. 351.  -       pgCount: opts.count,
  354. 352.  -       pgPerPage: opts.perpage,
  355. 353.  -       pgCont: ge('bt_rows'),
  356. 354.  -       pgMore: ge('bt_load_more'),
  357. 355.  -       pgPages: ge('bt_pages'),
  358. 356.  -       pgMorePrg: ge('bt_more_progress'),
  359. 357.  -       pgPreload: preload,
  360. 358.  -       pgUrl: opts.url,
  361. 359.  -       pgHref: opts.url + '?offset=',
  362. 360.  -
  363. 361.  -       pgPostProcess: Board.loadedPosts,
  364. 362.  -       pgOnScroll: Board.topicOnScroll,
  365. 363.  -       pgNoArrowNav: Board.noArrowNav,
  366. 364.  -
  367. 365.  -       onPrivacyChanged: Board.privacyChanged,
  368. 366.  -       updates: opts.updates,
  369. 367.  -       topicMyReplied: false,
  370. 368.  -       topicMyDeleted: {}
  371. 369.  -     });
  372. 370.  -     cur.privacy = extend(cur.privacy || {}, opts.privacy);
  373. 371.  -     Board.initUpdates();
  374. 372.  -
  375. 373.  -     if (cur.addField) {
  376. 374.  -       cur.boardAddMedia = initAddMedia(ge('ba_add_media').firstChild, 'ba_media_preview', cur.mediaTypes, {
  377. 375.  -         limit: 10,
  378. 376.  -         editable: 1,
  379. 377.  -         sortable: 1,
  380. 378.  -         teWidth: 280,
  381. 379.  -         teHeight: 200
  382. 380.  -       });
  383. 381.  -       cur.boardAddMedia.onChange = Board.topicAttachWillAdd;
  384. 382.  -       cur.boardAddMedia.onProgress = Board.topicOnProgress;
  385. 383.  -       placeholderSetup(cur.addField);
  386. 384.  -       autosizeSetup(cur.addField, {minHeight: 42, maxHeight: 160});
  387. 385.  -       addEvent(cur.addField, 'change keydown keyup paste', Board.topicFieldUpdated);
  388. 386.  -       Board.topicFieldUpdated();
  389. 387.  -     }
  390. 388.  -
  391. 389.  -     Board.topicOnScroll(false, false, true);
  392. 390.  -
  393. 391.  -     Pagination.init(opts.bottom);
  394. 392.  -     cur.destroy.push(Pagination.deinit);
  395. 393.  -     cur.destroy.push(removeEvent.pbind(window, 'keydown', Board.handleEditEsc));
  396. 394.  -   },
  397. 395.  -   initUpdates: function () {
  398. 396.  -     if (!cur.updates || !window.Notifier) {
  399. 397.  -       return
  400. 398.  -     }
  401. 399.  -     Board.checkUpdates();
  402. 400.  -     cur.updates.unread = 0;
  403. 401.  -     cur.updates.interval = setInterval(Board.checkUpdates, 20000);
  404. 402.  -     cur.destroy.push(function () {
  405. 403.  -       clearInterval(cur.updates.interval);
  406. 404.  -     });
  407. 405.  -
  408. 406.  -     if (!isArray(cur.onUnidle)) {
  409. 407.  -       cur.onUnidle = [];
  410. 408.  -     }
  411. 409.  -     cur.onUnidle.push(function () {
  412. 410.  -       Board.updateTitle(true);
  413. 411.  -     });
  414. 412.  -   },
  415. 413.  -   checkUpdates: function () {
  416. 414.  -     if (!cur.updates || !cur.updates.queue) {
  417. 415.  -       return;
  418. 416.  -     }
  419. 417.  -     Notifier.addKey(cur.updates.queue, Board.checkedUpdates);
  420. 418.  -   },
  421. 419.  -   getAbsDate: function (ts) {
  422. 420.  -     var date = new Date(ts || vkNow()),
  423. 421.  -         hours = date.getHours(),
  424. 422.  -         minutes = date.getMinutes(),
  425. 423.  -         ampm = '', numhours;
  426. 424.  -     if (cur.updates.time_system) {
  427. 425.  -       ampm = cur.updates.time_system[hours > 11 ? 1 : 0];
  428. 426.  -       hours = (hours % 12) || 12;
  429. 427.  -     }
  430. 428.  -     numhours = hours > 9 ? hours : ('0' + hours);
  431. 429.  -     minutes = minutes > 9 ? minutes : ('0' + minutes);
  432. 430.  -     return cur.updates.date_format.replace('{am_pm}', ampm).replace('{hour}', hours).replace('{num_hour}', numhours).replace('{minute}', minutes);
  433. 431.  -   },
  434. 432.  -   checkedUpdates: function (key, data) {
  435. 433.  -     if (!cur.updates || !cur.updates.queue || cur.updates.queue.key != key) {
  436. 434.  -       return;
  437. 435.  -     }
  438. 436.  -     if (data.failed) {
  439. 437.  -       cur.updates.queue = false;
  440. 438.  -       return;
  441. 439.  -     }
  442. 440.  -     cur.updates.queue.ts = data.ts;
  443. 441.  -     if (!isArray(data.events) || !data.events.length) {
  444. 442.  -       return;
  445. 443.  -     }
  446. 444.  -     // debugLog('board updated', data);
  447. 445.  -     var count = false;
  448. 446.  -     each(data.events, function () {
  449. 447.  -       var ev = this.split('<!>'), evVer = ev[0], evType = ev[1],
  450. 448.  -           topicId = ev[2], postId = ev[4], el = ge('post' + postId);
  451. 449.  -
  452. 450.  -       if (evVer != cur.updates.qversion) {
  453. 451.  -         location.reload();
  454. 452.  -         return false;
  455. 453.  -       }
  456. 454.  -       if (ev[3] > -1) count = ev[3];
  457. 455.  -       // debugLog(ev, count, evType);
  458. 456.  -       switch (evType) {
  459. 457.  -         case 'new_post':
  460. 458.  -           if (cur.topicMyReplied || el || cur.pgOffset < cur.pgCount) break;
  461. 459.  -
  462. 460.  -           var data = {
  463. 461.  -             actions: '',
  464. 462.  -             owner_id: cur.owner,
  465. 463.  -             topic_raw: cur.topic,
  466. 464.  -             post_raw: postId,
  467. 465.  -             post_id: ev[5],
  468. 466.  -             post_uid: ev[6],
  469. 467.  -             name: ev[7],
  470. 468.  -             photo: ev[8],
  471. 469.  -             link: ev[9],
  472. 470.  -             text: ev[10],
  473. 471.  -             media: ev[11],
  474. 472.  -             date: Board.getAbsDate(),
  475. 473.  -             online: ''
  476. 474.  -           }, skin = cur.updates.skin, actions = '';
  477. 475.  -           if (vk.id) {
  478. 476.  -             if (vk.id == data.post_uid || cur.updates.admin_level > 0) {
  479. 477.  -               if (vk.id == data.post_uid || cur.updates.admin_level > 1) {
  480. 478.  -                 actions += skin.sep + skin.act_edit;
  481. 479.  -               }
  482. 480.  -               actions += skin.sep + skin.act_delete;
  483. 481.  -             } else if (vk.id != data.post_uid) {
  484. 482.  -               actions += skin.sep + skin.act_report;
  485. 483.  -             }
  486. 484.  -             if (vk.id != data.post_uid) {
  487. 485.  -               actions += skin.sep + skin.act_reply;
  488. 486.  -             }
  489. 487.  -           }
  490. 488.  -           data.actions = actions;
  491. 489.  -           cur.names[data.post_uid] = ev[12];
  492. 490.  -
  493. 491.  -           var newEl = se(rs(skin.post, data));
  494. 492.  -           // debugLog(skin, data, actions);
  495. 493.  -           ge('bt_rows').appendChild(newEl);
  496. 494.  -           setStyle(newEl, {backgroundColor: '#FEFAE4'});
  497. 495.  -           animate(newEl, {backgroundColor: '#FFF'}, 6000);
  498. 496.  -
  499. 497.  -           cur.pgOffset++;
  500. 498.  -           cur.pgCount++;
  501. 499.  -           if (window.curNotifier && curNotifier.idle_manager && curNotifier.idle_manager.is_idle) {
  502. 500.  -             cur.updates.unread++;
  503. 501.  -           }
  504. 502.  -           break;
  505. 503.  -
  506. 504.  -         case 'del_post':
  507. 505.  -           if (cur.topicMyDeleted[ev[4]] || !el) break;
  508. 506.  -           hide(el);
  509. 507.  -           cur.pgOffset--;
  510. 508.  -           cur.pgCount--;
  511. 509.  -           break;
  512. 510.  -
  513. 511.  -         case 'res_post':
  514. 512.  -           if (isVisible(el)) break;
  515. 513.  -           show(el);
  516. 514.  -           cur.pgOffset++;
  517. 515.  -           cur.pgCount++;
  518. 516.  -           break;
  519. 517.  -       }
  520. 518.  -     });
  521. 519.  -     if (count !== false) {
  522. 520.  -       val('bt_summary', count ? getLang('board_msgs_in_topic', count) : getLang('board_no_msgs_in_topic'));
  523. 521.  -       Pagination.pageReady(false);
  524. 522.  -       Board.topicOnScroll(false, false, true);
  525. 523.  -       Board.updateTitle();
  526. 524.  -     }
  527. 525.  -   },
  528. 526.  -   updateTitle: function (unidle) {
  529. 527.  -     if (!cur.updates) {
  530. 528.  -       return;
  531. 529.  -     }
  532. 530.  -     if (unidle) {
  533. 531.  -       cur.updates.unread = 0;
  534. 532.  -     }
  535. 533.  -     document.title = replaceEntities((cur.updates.unread ? '('+ cur.updates.unread + ') ' : '') + cur.updates.skin.title);
  536. 534.  -   },
  537. 535.  -   cancelAddPost: function(clear) {
  538. 536.  -     cur.addForce = false;
  539. 537.  -     hide('ba_cancel');
  540. 538.  -     cur.addBlock.className = '';
  541. 539.  -     cur.boardAddMedia.menu.updateFixed(false);
  542. 540.  -     if (browser.msie6) {
  543. 541.  -       cur.addBlockWrap.appendChild(cur.addBlock);
  544. 542.  -     }
  545. 543.  -     cur.docked = false;
  546. 544.  -     if (clear === true) {
  547. 545.  -       val(cur.addField, '');
  548. 546.  -       cur.boardAddMedia.unchooseMedia();
  549. 547.  -       hide('bp_warn');
  550. 548.  -       cur.addField.autosize.update();
  551. 549.  -       Board.topicFieldUpdated();
  552. 550.  -     }
  553. 551.  -   },
  554. 552.  -   topicResetStyle: function() {
  555. 553.  -     cur.addBlock.style.left = '';
  556. 554.  -   },
  557. 555.  -   topicOnScroll: function(e, st, pp) {
  558. 556.  -     if (st === false || st === undefined) {
  559. 557.  -       st = scrollGetY();
  560. 558.  -     }
  561. 559.  -     if (!cur.addField) return;
  562. 560.  -     if (pp === true) {
  563. 561.  -       cur.addBlockTop = getXY(cur.addBlockWrap)[1];
  564. 562.  -       if (browser.msie6) cur.addBlockTop += st;
  565. 563.  -     }
  566. 564.  -     var needDock = (cur.addText || cur.addForce || cur.boardAddMedia.chosenMedia) && (st + lastWindowHeight < cur.addBlockTop + cur.addBlockHeight);
  567. 565.  -     if (needDock && !cur.docked) {
  568. 566.  -       cur.addBlock.className = 'fixed';
  569. 567.  -       if (browser.msie6) {
  570. 568.  -         bodyNode.appendChild(cur.addBlock);
  571. 569.  -         e = {type: 'resize'};
  572. 570.  -       } else {
  573. 571.  -         cur.boardAddMedia.menu.updateFixed(true);
  574. 572.  -       }
  575. 573.  -       cur.docked = true;
  576. 574.  -       show('ba_cancel');
  577. 575.  -       cur.addForce = true;
  578. 576.  -     } else if (!needDock && cur.docked) {
  579. 577.  -       Board.cancelAddPost();
  580. 578.  -     }
  581. 579.  -     if (cur.docked && e && e.type == 'resize') {
  582. 580.  -       if (browser.msie6) {
  583. 581.  -         cur.addBlock.style.left = getXY(ge('content'))[0] + 'px';
  584. 582.  -       } else {
  585. 583.  -         cur.addBlock.style.left = (ge('page_layout').offsetLeft + ge('content').offsetLeft) + 'px';
  586. 584.  -         setTimeout(Board.topicResetStyle, 0);
  587. 585.  -       }
  588. 586.  -     }
  589. 587.  -   },
  590. 588.  -   loadedPosts: function(count, from, rows, offset, pages, preload, names) {
  591. 589.  -     Board.topicOnScroll(false, false, true);
  592. 590.  -     ge('bt_summary').innerHTML = count ? getLang('board_msgs_in_topic', count) : getLang('board_no_msgs_in_topic');
  593. 591.  -     if (preload) { // got new page
  594. 592.  -       Board.cancelEditPost();
  595. 593.  -     } else {
  596. 594.  -       names = offset;
  597. 595.  -     }
  598. 596.  -     extend(cur.names, names);
  599. 597.  -   },
  600. 598.  -   noArrowNav: function() {
  601. 599.  -     return cur.__focused || cur.bEditingPost;
  602. 600.  -   },
  603. 601.  -   scrollToEnd: function() {
  604. 602.  -     var st = cur.addBlockTop + cur.addBlockHeight + 20 - lastWindowHeight;
  605. 603.  -     if (scrollGetY() < st) {
  606. 604.  -       Pagination.setScroll(st);
  607. 605.  -     }
  608. 606.  -   },
  609. 607.  -   sendPost: function() {
  610. 608.  -     var prg = ge('ba_progress');
  611. 609.  -     if (isVisible(prg)) return;
  612. 610.  -
  613. 611.  -     var value = trim(val(cur.addField)),
  614. 612.  -         addmedia = cur.boardAddMedia || {},
  615. 613.  -         media = addmedia.chosenMedia || {},
  616. 614.  -         medias = cur.boardAddMedia ? addmedia.getMedias() : [],
  617. 615.  -         params = {
  618. 616.  -       act: 'post_comment',
  619. 617.  -       topic: cur.topic,
  620. 618.  -       hash: cur.hash,
  621. 619.  -       comment: value,
  622. 620.  -       last: last,
  623. 621.  -       from_group: isChecked('ba_from_group')
  624. 622.  -     }, attachI = 0;
  625. 623.  -
  626. 624.  -     if (isArray(media) && media.length) {
  627. 625.  -       medias.push(clone(media));
  628. 626.  -     }
  629. 627.  -
  630. 628.  -     if (medias.length) {
  631. 629.  -       each(medias, function(k, v) {
  632. 630.  -         if (!v) return;
  633. 631.  -         ++attachI;
  634. 632.  -         params['attach' + attachI + '_type'] = this[0];
  635. 633.  -         params['attach' + attachI] = this[1];
  636. 634.  -       });
  637. 635.  -     }
  638. 636.  -     if (!attachI && !value) {
  639. 637.  -       return elfocus(cur.addField);
  640. 638.  -     }
  641. 639.  -
  642. 640.  -     cur.topicMyReplied = true;
  643. 641.  -     var last = ((cur.pgCont.childNodes[cur.pgNodesCount - 1].id || '').match(/\d+$/) || [0])[0];
  644. 642.  -     ajax.post('al_board.php', params, {onDone: function(count, from, rows, offset, pages, preload) {
  645. 643.  -       cur.topicMyReplied = false;
  646. 644.  -       re('b_no_content');
  647. 645.  -       Pagination.loaded.apply(window, arguments);
  648. 646.  -       Board.cancelAddPost(true);
  649. 647.  -       setTimeout(Board.scrollToEnd, 0);
  650. 648.  -       if (pages && offset) {
  651. 649.  -         nav.setLoc(extend(nav.objLoc, {offset: offset}));
  652. 650.  -       }
  653. 651.  -     }, progress: prg});
  654. 652.  -   },
  655. 653.  -   deleteReportPost: function(post, act) {
  656. 654.  -     post = cur.owner + '_' + post;
  657. 655.  -     var prg = geByClass1('bp_progress', ge('post' + post));
  658. 656.  -     if (isVisible(prg)) return;
  659. 657.  -
  660. 658.  -     cur.topicMyDeleted[post] = 1;
  661. 659.  -     ajax.post('al_board.php', {act: act, post: post, hash: cur.hash}, {onDone: function(text, deleted) {
  662. 660.  -       var info = ge('post' + post).firstChild.nextSibling;
  663. 661.  -       if (info) {
  664. 662.  -         info.firstChild.rows[0].cells[0].innerHTML = text;
  665. 663.  -       } else {
  666. 664.  -         info = ge('post' + post).appendChild(ce('div', {className: 'bp_deleted', innerHTML: '\
  667. 665.  - <table cellspacing="0" cellpadding="0" style="width: 100%"><tr><td class="bp_deleted_td">\
  668. 666.  -   ' + text + '\
  669. 667.  - </td></tr></table>'}));
  670. 668.  -         hide(info.previousSibling);
  671. 669.  -       }
  672. 670.  -
  673. 671.  -       if (deleted) {
  674. 672.  -         Pagination.recache(-1);
  675. 673.  -         Board.loadedPosts(cur.pgCount);
  676. 674.  -       }
  677. 675.  -     }, progress: prg});
  678. 676.  -   },
  679. 677.  -   deletePost: function(post) {
  680. 678.  -     Board.deleteReportPost(post, 'delete_comment');
  681. 679.  -   },
  682. 680.  -   reportPost: function(post) {
  683. 681.  -     Board.deleteReportPost(post, 'spam_comment');
  684. 682.  -   },
  685. 683.  -   restorePost: function(post) {
  686. 684.  -     post = cur.owner + '_' + post;
  687. 685.  -     cur.topicMyDeleted[post] = 0;
  688. 686.  -     ajax.post('al_board.php', {act: 'restore_comment', post: post, hash: cur.hash}, {onDone: function() {
  689. 687.  -       var info = ge('post' + post).firstChild.nextSibling;
  690. 688.  -       if (info) {
  691. 689.  -         show(info.previousSibling);
  692. 690.  -         re(info);
  693. 691.  -
  694. 692.  -         Pagination.recache(1);
  695. 693.  -         Board.loadedPosts(cur.pgCount);
  696. 694.  -       }
  697. 695.  -     }});
  698. 696.  -   },
  699. 697.  -   editPost: function(post) {
  700. 698.  -     if (cur.bEditingPost) {
  701. 699.  -       return ge('bpe_text') ? elfocus('bpe_text') : false;
  702. 700.  -     }
  703. 701.  -     post = cur.owner + '_' + post;
  704. 702.  -     cur.bEditingPost = post;
  705. 703.  -
  706. 704.  -     var postNode = ge('post' + post), dataNode = ge('bp_data' + post);
  707. 705.  -     var bottom = geByClass1('bp_bottom', postNode), prg = geByClass1('bp_progress', bottom);
  708. 706.  -     ajax.post('al_board.php', {act: 'edit_comment', post: post}, {onDone: function(text, media, add) {
  709. 707.  -       addEvent(window, 'keydown', Board.handleEditEsc);
  710. 708.  -       var textField = dataNode.parentNode.insertBefore(ce('div', {className: 'bpe_wrap', innerHTML: '\
  711. 709.  - <textarea id="bpe_text" onkeyup="checkTextLength(cur.postLimit, this, \'bpe_warn\')" onkeypress="onCtrlEnter(event, Board.savePost)">' + text + '</textarea>\
  712. 710.  - <div id="bpe_warn"></div>\
  713. 711.  - <div id="bpe_media_preview" class="clear_fix media_preview"></div>\
  714. 712.  - ' + (add ? '<div class="wpe_auth">' + add + '</div>' : '') + '\
  715. 713.  - <div class="bpe_buttons">\
  716. 714.  -   <div id="bpe_add_media" class="fl_r"><span class="add_media_lnk">' + getLang('board_add_attach') + '</span></div>\
  717. 715.  -   <div class="button_blue fl_l">\
  718. 716.  -     <button onclick="Board.savePost()">' + getLang('global_save') + '</button>\
  719. 717.  -   </div>\
  720. 718.  -   <div class="button_cancel bpe_cancel fl_l">\
  721. 719.  -     <div class="button" onclick="Board.cancelEditPost()">' + getLang('global_cancel') + '</div>\
  722. 720.  -   </div>\
  723. 721.  -   <div class="progress fl_l" id="bpe_progress"></div>\
  724. 722.  - </div>'}), dataNode).firstChild;
  725. 723.  -       autosizeSetup(textField, {minHeight: 17, delta: 0});
  726. 724.  -       setTimeout(function() {
  727. 725.  -         show(textField.parentNode);
  728. 726.  -         elfocus(textField);
  729. 727.  -         hide(dataNode, bottom);
  730. 728.  -         cur.boardEditMedia = initAddMedia(ge('bpe_add_media').firstChild, 'bpe_media_preview', cur.mediaTypes, {limit: 10, editable: 1, sortable: 1, teWidth: 280, teHeight: 200});
  731. 729.  -         if (media && media.length) {
  732. 730.  -           for (var i = 0, l = (media || []).length; i < l; ++i) {
  733. 731.  -             cur.boardEditMedia.chooseMedia.apply(window, media[i]);
  734. 732.  -           }
  735. 733.  -         }
  736. 734.  -       }, 0);
  737. 735.  -     }, onFail: function() {
  738. 736.  -       cur.bEditingPost = false;
  739. 737.  -     }, progress: prg});
  740. 738.  -   },
  741. 739.  -   cancelEditPost: function(nt, nm, ne) {
  742. 740.  -     var post = cur.bEditingPost, prg = ge('bpe_progress');
  743. 741.  -     if (!post || isVisible(prg)) return;
  744. 742.  -
  745. 743.  -     cur.bEditingPost = false;
  746. 744.  -     if (!prg) return;
  747. 745.  -
  748. 746.  -     removeEvent(window, 'keydown', Board.handleEditEsc);
  749. 747.  -     cleanElems(ge('bpe_add_media').firstChild);
  750. 748.  -
  751. 749.  -     var postNode = ge('post' + post), dataNode = ge('bp_data' + post);
  752. 750.  -     var textNode = dataNode.firstChild, mediaNode = textNode.nextSibling;
  753. 751.  -     var bottom = geByClass1('bp_bottom', postNode);
  754. 752.  -
  755. 753.  -     if (nt !== undefined) {
  756. 754.  -       val(textNode, nt);
  757. 755.  -       (nt ? show : hide)(textNode);
  758. 756.  -     }
  759. 757.  -     if (nm !== undefined) {
  760. 758.  -       if (mediaNode && !nm) {
  761. 759.  -         re(mediaNode);
  762. 760.  -       } else if (nm) {
  763. 761.  -         if (!mediaNode) {
  764. 762.  -           mediaNode = dataNode.appendChild(ce('div'));
  765. 763.  -         }
  766. 764.  -         dataNode.replaceChild(ce('div', {innerHTML: nm}).firstChild, mediaNode);
  767. 765.  -       }
  768. 766.  -     }
  769. 767.  -     if (ne !== undefined) {
  770. 768.  -       var ed = geByClass1('bp_edited_by', postNode);
  771. 769.  -       val(ed, ne);
  772. 770.  -       (ne ? show : hide)(ed);
  773. 771.  -     }
  774. 772.  -     show(bottom, dataNode);
  775. 773.  -     re(ge('bpe_text').parentNode);
  776. 774.  -   },
  777. 775.  -   handleEditEsc: function(e) {
  778. 776.  -     if (e.keyCode == KEY.ESC) {
  779. 777.  -       Board.cancelEditPost();
  780. 778.  -     }
  781. 779.  -   },
  782. 780.  -   savePost: function() {
  783. 781.  -     var post = cur.bEditingPost, prg = ge('bpe_progress');
  784. 782.  -     if (!post || !prg || isVisible(prg)) return;
  785. 783.  -
  786. 784.  -     var newtext = trim(val('bpe_text')),
  787. 785.  -         addmedia = cur.boardEditMedia || {},
  788. 786.  -         media = addmedia.chosenMedia || {},
  789. 787.  -         medias = cur.boardEditMedia ? addmedia.getMedias() : [],
  790. 788.  -         params = {
  791. 789.  -       act: 'save_comment',
  792. 790.  -       post: post,
  793. 791.  -       hash: cur.hash,
  794. 792.  -       comment: newtext
  795. 793.  -     }, attachI = 0;
  796. 794.  -
  797. 795.  -     if (isArray(media) && media.length) {
  798. 796.  -       medias.push(clone(media));
  799. 797.  -     }
  800. 798.  -
  801. 799.  -     if (medias.length) {
  802. 800.  -       each(medias, function(k, v) {
  803. 801.  -         if (!v) return;
  804. 802.  -         ++attachI;
  805. 803.  -         params['attach' + attachI + '_type'] = this[0];
  806. 804.  -         params['attach' + attachI] = this[1];
  807. 805.  -       });
  808. 806.  -     }
  809. 807.  -     if (!attachI && !newtext) {
  810. 808.  -       return elfocus('bpe_text');
  811. 809.  -     }
  812. 810.  -
  813. 811.  -     ajax.post('al_board.php', params, {
  814. 812.  -       onDone: Board.cancelEditPost,
  815. 813.  -       progress: prg
  816. 814.  -     });
  817. 815.  -   },
  818. 816.  -
  819. 817.  -   votingUpdate: function(html, js) {
  820. 818.  -     if (curBox()) {
  821. 819.  -       curBox().hide();
  822. 820.  -     }
  823. 821.  -
  824. 822.  -     var wrap = ge('bv_wrap');
  825. 823.  -     wrap.innerHTML = html;
  826. 824.  -     if (js) eval(js);
  827. 825.  -     if (!/^board\d+([\?#]|$)/.test(_tbLink.loc || '')) {
  828. 826.  -       globalHistoryDestroy(_tbLink.loc);
  829. 827.  -     }
  830. 828.  -     if (html) {
  831. 829.  -       delete(cur.privacy.topic_action_types.voting);
  832. 830.  -     } else {
  833. 831.  -       var newTypes = {edit: cur.privacy.topic_action_types.edit, voting: getLang('board_create_voting')};
  834. 832.  -       for (var i in cur.privacy.topic_action_types) {
  835. 833.  -         newTypes[i] = cur.privacy.topic_action_types[i];
  836. 834.  -       }
  837. 835.  -       cur.privacy.topic_action_types = newTypes;
  838. 836.  -     }
  839. 837.  -   },
  840. 838.  -   vote: function(el, oid, vid, option) {
  841. 839.  -     var pr = hasClass(el.firstChild, 'progress') ? el.firstChild : el.insertBefore(ce('span', {className: 'fl_r progress'}), el.firstChild);
  842. 840.  -     ajax.post('al_voting.php', {
  843. 841.  -       act: 'vote',
  844. 842.  -       option_id: option,
  845. 843.  -       owner_id: oid,
  846. 844.  -       voting_id: vid,
  847. 845.  -       context: 'topic',
  848. 846.  -       hash: cur.polls[vid].hash
  849. 847.  -     }, {onDone: Board.votingUpdate, progress: pr});
  850. 848.  -   },
  851. 849.  -   votingAction: function(key) {
  852. 850.  -     ge('privacy_edit_voting_action').innerHTML = getLang('voting_settings');
  853. 851.  -     var act = intval(cur.privacy[key][0]);
  854. 852.  -     cur.privacy[key] = [0, 0, []];
  855. 853.  -     Board.votingActionPerform(act);
  856. 854.  -   },
  857. 855.  -   votingActionPerform: function(act, sure) {
  858. 856.  -     if (act == 105) {
  859. 857.  -       if (sure) {
  860. 858.  -         curBox().hide();
  861. 859.  -       } else {
  862. 860.  -         return showFastBox(getLang('global_warning'), getLang('voting_sure_del_quiz'), getLang('global_delete'), Board.votingActionPerform.pbind(act, true), getLang('global_cancel'));
  863. 861.  -       }
  864. 862.  -     }
  865. 863.  -     var state = 0;
  866. 864.  -     switch (act) {
  867. 865.  -       case 101: act = 'openclose'; state = 0; break;
  868. 866.  -       case 102: act = 'openclose'; state = 1; break;
  869. 867.  -       case 103: act = 'tomain';    state = 0; break;
  870. 868.  -       case 104: act = 'tomain';    state = 1; break;
  871. 869.  -       case 105: act = 'delete';    state = 0; break;
  872. 870.  -     }
  873. 871.  -     ajax.post('al_voting.php', {
  874. 872.  -       act: act,
  875. 873.  -       owner_id: cur._voting.oid,
  876. 874.  -       voting_id: cur._voting.vid,
  877. 875.  -       state: state,
  878. 876.  -       context: 'topic',
  879. 877.  -       hash: cur._voting.hash
  880. 878.  -     }, {onDone: Board.votingUpdate, showProgress: function() {
  881. 879.  -       hide('privacy_edit_voting_action');
  882. 880.  -       show('bv_progress');
  883. 881.  -     }, onHideProgress: function() {
  884. 882.  -       hide('bv_progress');
  885. 883.  -       show('privacy_edit_voting_action');
  886. 884.  -     }});
  887. 885.  -   },
  888. 886.  -
  889. 887.  -   mentionOver: function(el) {
  890. 888.  -     var post = ((el.getAttribute('mention') || '').match(/^bp(-?\d+_\d+)$/) || {})[1];
  891. 889.  -     if (!post) {
  892. 890.  -       mentionOver(el);
  893. 891.  -       return;
  894. 892.  -     }
  895. 893.  -     showTooltip(el, {
  896. 894.  -       url: 'al_board.php',
  897. 895.  -       params: {act: 'post_tt', post: post},
  898. 896.  -       slide: 15,
  899. 897.  -       shift: [78, -3, 0],
  900. 898.  -       ajaxdt: 100,
  901. 899.  -       showdt: 400,
  902. 900.  -       hidedt: 200,
  903. 901.  -       className: 'rich board_tt'
  904. 902.  -     });
  905. 903.  -   },
  906. 904.  -   docTooltip: function(el, post, doc) {
  907. 905.  -     showTooltip(el, {
  908. 906.  -       url: 'al_board.php',
  909. 907.  -       params: {act: 'doc_tt', post: post, doc: doc},
  910. 908.  -       slide: 15,
  911. 909.  -       shift: [78, -3, 0],
  912. 910.  -       ajaxdt: 100,
  913. 911.  -       showdt: 400,
  914. 912.  -       hidedt: 200,
  915. 913.  -       className: 'rich board_tt'
  916. 914.  -     });
  917. 915.  -   },
  918. 916.  -
  919. 917.  -   searchGo: function(el, ev) {
  920. 918.  -     return nav.go(el, ev, {params: {q: nav.objLoc.q}});
  921. 919.  -   }
  922. 920.  -
  923. 921.  - }
  924. 922.  -
  925. 923.  - try{stManager.done('board.js');}catch(e){}
  926. ------
Advertisement
Add Comment
Please, Sign In to add comment