Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Файл - wall.js (Старый размер - 19289 | Новый - 0):
- 0. - var FullWall = {
- 1. - getsect: function() {
- 2. - var current = ge('full_wall_filters').firstChild;
- 3. - for (; !hasClass(current, 'active_link') && current;) {
- 4. - current = current.nextSibling;
- 5. - }
- 6. - return current;
- 7. - },
- 8. - failed: function(old, text) {
- 9. - FullWall.getsect().className = '';
- 10. - if (old) old.className = 'active_link';
- 11. - if (!text) return;
- 12. -
- 13. - setTimeout(showFastBox(getLang('global_error'), text).hide, 2000);
- 14. - return true;
- 15. - },
- 16. - go: function(el, ev) {
- 17. - var current = FullWall.getsect();
- 18. - var result = nav.go(el, ev, {onFail: FullWall.failed.pbind(current)});
- 19. - if (result === false) {
- 20. - if (current) current.className = '';
- 21. - el.parentNode.className = 'active_link';
- 22. - }
- 23. - },
- 24. - scrollCheck: function(e, st) {
- 25. - var ch = lastWindowHeight, top, ntop = 0, el, nel, bits, posts = [];
- 26. - if (domPN(cur.topRow) != cur.pgCont) {
- 27. - cur.topRow = domFC(cur.pgCont);
- 28. - }
- 29. - if (
- 30. - !vk.id ||
- 31. - !cur.topRow ||
- 32. - ((window.curNotifier || {}).idle_manager || {}).is_idle
- 33. - ) {
- 34. - return;
- 35. - }
- 36. - for (el = domPS(cur.topRow); el && cur.topRow.offsetTop > st; el = domPS(el)) cur.topRow = el;
- 37. - for (el = cur.topRow; el; el = nel) {
- 38. - top = ntop ? ntop : el.offsetTop;
- 39. - if (top >= st + ch) break;
- 40. -
- 41. - nel = domNS(el);
- 42. -
- 43. - ntop = nel ? nel.offsetTop : top + el.offsetHeight;
- 44. - if (ntop < st && nel) cur.topRow = nel;
- 45. -
- 46. - bits = el.bits || 0;
- 47. - if (bits >= 3) continue;
- 48. -
- 49. - if (bits |= ((top >= st && top < st + ch) ? 1 : 0) | ((ntop >= st && ntop < st + ch) ? 2 : 0)) {
- 50. - el.bits = bits;
- 51. - if (bits == 3) {
- 52. - posts.push(FullWall.postsGetRaws(el));
- 53. - }
- 54. - }
- 55. - }
- 56. - Page.postsSeen(posts);
- 57. - },
- 58. - postsGetRaws: function(el) {
- 59. - var m, res = {};
- 60. - if (m = el.id.match(new RegExp('^post(' + cur.oid + '_\\d+)$', ''))) {
- 61. - res[m[1]] = 1;
- 62. - if (m = (el.getAttribute('data-copy') || '').match(/^(-?\d+_\d+)$/)) {
- 63. - res[m[1]] = -1;
- 64. - }
- 65. - }
- 66. - return res;
- 67. - },
- 68. - init: function(opts, preload) {
- 69. - extend(cur, {
- 70. - options: opts,
- 71. - module: 'wall',
- 72. -
- 73. - pgStart: opts.start,
- 74. - pgOffset: opts.offset,
- 75. - pgCount: opts.count,
- 76. - pgPerPage: opts.per_page,
- 77. - pgCont: ge('page_wall_posts'),
- 78. - pgMore: ge('fw_load_more'),
- 79. - pgPages: ge('fw_pages'),
- 80. - pgMorePrg: ge('fw_more_progress'),
- 81. - pgPreload: preload,
- 82. - pgUrl: opts.url,
- 83. - pgOnScroll: FullWall.scrollCheck,
- 84. -
- 85. - pgParams: opts.params,
- 86. - pgHref: opts.href,
- 87. -
- 88. - pgPostProcess: FullWall.loadedPosts,
- 89. - pgNoArrowNav: FullWall.noArrowNav,
- 90. -
- 91. - oid: opts.owner_id,
- 92. - postTo: opts.owner_id,
- 93. - fullPostView: true
- 94. - });
- 95. - wall.init(opts);
- 96. - if (!opts.wall_type || opts.wall_type != 'cards' && opts.wall_type != 'supp' && opts.wall_type != 'phone_info') {
- 97. - Pagination.init();
- 98. - }
- 99. - cur.destroy.push(Pagination.deinit);
- 100. - if (opts.with_id) return;
- 101. -
- 102. - if (opts.search) {
- 103. - var searchEl = ge('wall_search');
- 104. - placeholderSetup(searchEl, {back: 1});
- 105. - addEvent(searchEl, 'keydown', function (e) {
- 106. - if (e.keyCode == KEY.RETURN) {
- 107. - FullWall.doSearch();
- 108. - searchEl.blur();
- 109. - return cancelEvent(e);
- 110. - }
- 111. - });
- 112. - elfocus(searchEl);
- 113. - setTimeout(elfocus.pbind(searchEl), 100);
- 114. - if (val(searchEl)) show('wall_reset_search');
- 115. - }
- 116. -
- 117. - wall.initUpdates(opts.add_queue_key);
- 118. - if (opts.wall_type && (opts.wall_type == 'cards' || opts.wall_type == 'supp' || opts.wall_type == 'phone_info')) return;
- 119. - cur.nav.push(function(changed, current, next) {
- 120. - var own = changed.own;
- 121. - delete(changed.own);
- 122. - delete(changed.offset);
- 123. - if (!isEmpty(changed) || own === undefined) return;
- 124. - ajax.post('al_wall.php', {
- 125. - act: 's',
- 126. - owner_id: cur.oid,
- 127. - own: next.own || undefined,
- 128. - lnav: 1,
- 129. - offset: next.offset || undefined
- 130. - }, {onDone: function(summary, rows, names, href, start, offset, perpage, count, preload, queue) {
- 131. - ge('fw_summary_wrap').innerHTML = summary;
- 132. - Pagination.deinit();
- 133. - extend(cur, {
- 134. - pgStart: start,
- 135. - pgOffset: offset,
- 136. - pgCount: count,
- 137. - pgParams: next.own ? {own: 1} : false,
- 138. - pgHref: href,
- 139. - pgPages: ge('fw_pages'),
- 140. - pgPreload: preload
- 141. - });
- 142. - toggle(cur.pgMore, (count > offset + cur.pgPerPage));
- 143. - wall.cancelEdit();
- 144. - var posts = ge('page_wall_posts');
- 145. - posts.innerHTML = rows;
- 146. - each(geByTag('textarea', posts), function() { placeholderSetup(this, {fast: 1}); });
- 147. - Pagination.init();
- 148. - wall.initUpdates(queue);
- 149. -
- 150. - for (var mid in names) {
- 151. - cur.options.reply_names[mid] = names[mid];
- 152. - }
- 153. -
- 154. - cur.wallType = 'full_' + (next.own ? 'own' : 'all');
- 155. - nav.setLoc(next);
- 156. -
- 157. - scrollToTop();
- 158. -
- 159. - ge('wall_' + (next.own ? 'all' : 'own') + '_filter').className = '';
- 160. - var selFilter = ge('wall_' + (next.own ? 'own' : 'all') + '_filter');
- 161. - selFilter.className = 'active_link';
- 162. - }, showProgress: function() {
- 163. - hide('full_wall_return', 'fw_search_toggler');
- 164. - show('full_wall_progress');
- 165. - }, hideProgress: function() {
- 166. - hide('full_wall_progress');
- 167. - show('full_wall_return', 'fw_search_toggler');
- 168. - }, onFail: FullWall.failed.pbind(FullWall.getsect())});
- 169. - return false;
- 170. - });
- 171. - },
- 172. - loadedPosts: function(count, from, rows, offset, pages, preload, names) {
- 173. - if (preload) {
- 174. - each(geByTag('textarea', cur.pgCont), function() { placeholderSetup(this, {fast: 1}); });
- 175. - wall.cancelEdit();
- 176. - } else {
- 177. - var l = cur.pgCont.childNodes.length, i = 0;
- 178. - for (var el = cur.pgCont.lastChild; el && ++i <= cur.pgPerPage; el = el.previousSibling) {
- 179. - placeholderSetup(geByTag1('textarea', el), {fast: 1});
- 180. - }
- 181. - names = offset;
- 182. - }
- 183. - for (var mid in names) {
- 184. - cur.options.reply_names[mid] = names[mid];
- 185. - }
- 186. - FullWall.updateSummary(count);
- 187. - },
- 188. - updateSummary: function(count) {
- 189. - var ds = re('wall_datesearch_wrap');
- 190. - if (count > 1) {
- 191. - ge('fw_summary').innerHTML = getLang('wall_x_posts_at_all', count, true);
- 192. - } else if (count > 0) {
- 193. - ge('fw_summary').innerHTML = getLang('wall_one_post');
- 194. - } else {
- 195. - ge('fw_summary').innerHTML = getLang('wall_no_posts');
- 196. - }
- 197. - if (ds) ge('fw_summary').appendChild(ds);
- 198. - },
- 199. - noArrowNav: function() {
- 200. - return cur.__focused || (ge('own_reply_field') || {}).focused || cur.editingPost;
- 201. - },
- 202. -
- 203. - initOnePost: function(opts, preload) {
- 204. - Page.postsSeen(opts.seen);
- 205. - extend(cur, {
- 206. - onepost: true,
- 207. - options: opts,
- 208. - module: 'wall',
- 209. -
- 210. - docked: false,
- 211. -
- 212. - addField: ge('fwr_text'),
- 213. - addBlock: ge('fwr_form'),
- 214. - addBlockWrap: ge('fwr_wrap'),
- 215. -
- 216. - pgStart: opts.start,
- 217. - pgOffset: opts.offset,
- 218. - pgCount: opts.count,
- 219. - pgPerPage: opts.per_page,
- 220. - pgCont: ge('fw_replies_rows'),
- 221. - pgMore: ge('fwp_load_more'),
- 222. - pgPages: ge('fw_pages'),
- 223. - pgMorePrg: ge('fw_more_progress'),
- 224. - pgPreload: preload,
- 225. - pgUrl: opts.url,
- 226. - pgParams: opts.params,
- 227. - pgHref: opts.href,
- 228. -
- 229. - pgPostProcess: FullWall.loadedReplies,
- 230. - pgOnScroll: FullWall.onePostOnScroll,
- 231. - pgNoArrowNav: FullWall.noArrowNav,
- 232. -
- 233. - oid: opts.owner_id,
- 234. - pid: opts.post_id,
- 235. - nid: opts.note_id,
- 236. - fullPostView: true,
- 237. - named: {replies: ge('fw_one_replies_wrap')}
- 238. - });
- 239. - wall.init(opts);
- 240. -
- 241. - if (cur.addField) {
- 242. - placeholderSetup(cur.addField);
- 243. - autosizeSetup(cur.addField, {minHeight: opts.note ? 62 : 42, maxHeight: 300});
- 244. - addEvent(cur.addField, 'change keydown keyup paste', FullWall.replyFieldUpdated);
- 245. -
- 246. - var mediaTypes = [];
- 247. - each (cur.options.rmedia_types, function () {
- 248. - if (inArray(this[0], ['photo', 'video', 'audio', 'doc', 'link', 'page'])) {
- 249. - mediaTypes.push(this);
- 250. - }
- 251. - });
- 252. - var media;
- 253. - if (mediaTypes.length) {
- 254. - media = {
- 255. - lnk: ge('fwr_reply_media_lnk').firstChild,
- 256. - preview: ge('fwr_reply_media_preview'),
- 257. - types: mediaTypes,
- 258. - options: {limit: 2, disabledTypes: ['album'], toggleLnk: true}
- 259. - };
- 260. - }
- 261. - Wall.initComposer(cur.addField, {
- 262. - lang: {
- 263. - introText: getLang('profile_mention_start_typing'),
- 264. - noResult: getLang('profile_mention_not_found')
- 265. - },
- 266. - media: media
- 267. - });
- 268. - FullWall.replyFieldUpdated();
- 269. - }
- 270. - Pagination.init(opts.scroll);
- 271. - cur.destroy.push(Pagination.deinit);
- 272. -
- 273. - wall.initUpdates(opts.add_queue_key);
- 274. - },
- 275. - scrollToEnd: function() {
- 276. - var st = cur.addBlockTop + cur.addBlockHeight + 20 - lastWindowHeight;
- 277. - if (scrollGetY() < st) {
- 278. - Pagination.setScroll(st);
- 279. - }
- 280. - },
- 281. - replyFieldUpdated: function() {
- 282. - if (!cur.addField) return;
- 283. -
- 284. - var newt = val(cur.addField), newh = getSize(cur.addBlock)[1];
- 285. - var ch = (cur.addBlockHeight != newh), ct = (cur.addText != newt);
- 286. - if (ch) {
- 287. - cur.addBlockHeight = newh;
- 288. - cur.addBlockWrap.style.height = newh + 'px';
- 289. - }
- 290. - if (ct) {
- 291. - cur.addText = newt;
- 292. - }
- 293. - if (ch || ct) {
- 294. - FullWall.onePostOnScroll(false, false, true);
- 295. - }
- 296. - },
- 297. - onePostResetStyle: function() {
- 298. - cur.addBlock.style.left = '';
- 299. - },
- 300. - onePostOnScroll: function(e, st, pp) {
- 301. - if (!cur.addField) return;
- 302. -
- 303. - if (st === false || st === undefined) {
- 304. - st = scrollGetY();
- 305. - }
- 306. - if (pp === true) {
- 307. - cur.addBlockTop = getXY(cur.addBlockWrap)[1];
- 308. - if (browser.msie6) cur.addBlockTop += st;
- 309. - }
- 310. - var needDock = (cur.addText || cur.addForce) && (st + lastWindowHeight < cur.addBlockTop + cur.addBlockHeight);
- 311. - if (needDock && !cur.docked) {
- 312. - cur.addBlock.className = 'fixed';
- 313. - if (browser.msie6) {
- 314. - bodyNode.appendChild(cur.addBlock);
- 315. - e = {type: 'resize'};
- 316. - }
- 317. - cur.docked = true;
- 318. - show('fwr_cancel');
- 319. - cur.addForce = true;
- 320. - } else if (!needDock && cur.docked) {
- 321. - FullWall.cancelAddReply();
- 322. - }
- 323. - if (cur.docked && e && e.type == 'resize') {
- 324. - if (browser.msie6) {
- 325. - cur.addBlock.style.left = getXY(ge('content'))[0] + 'px';
- 326. - } else {
- 327. - cur.addBlock.style.left = (ge('page_layout').offsetLeft + ge('content').offsetLeft) + 'px';
- 328. - setTimeout(FullWall.onePostResetStyle, 0);
- 329. - }
- 330. - }
- 331. - },
- 332. - loadedReplies: function(count, from, rows, offset, pages, preload, names) {
- 333. - if (!preload) {
- 334. - names = offset;
- 335. - }
- 336. - for (var mid in names) {
- 337. - cur.options.reply_names[mid] = names[mid];
- 338. - }
- 339. - FullWall.onePostOnScroll(false, false, true);
- 340. - FullWall.repliesSummary(count);
- 341. - },
- 342. - repliesSummary: function(count) {
- 343. - var summary = ge('fw_summary');
- 344. - summary.innerHTML = count ? getLang('wall_n_replies', count) : getLang('wall_no_replies');
- 345. - show(summary.parentNode);
- 346. - },
- 347. - sendReply: function() {
- 348. - var rf = ge('fwr_text'),
- 349. - composer = rf && data(rf, 'composer'),
- 350. - params = composer ? Composer.getSendParams(composer, FullWall.sendReply) : {message: trim(val(rf))},
- 351. - replyName = cur.reply_to && cur.options.reply_names[cur.reply_to[0]],
- 352. - state;
- 353. -
- 354. - if (params.delayed) {
- 355. - return;
- 356. - }
- 357. -
- 358. - if (!params.attach1_type) {
- 359. - if (!params.message ||
- 360. - isArray(replyName) && !replyName[1].indexOf(params.message)) {
- 361. - elfocus(rf);
- 362. - return;
- 363. - }
- 364. - }
- 365. -
- 366. - rf.blur();
- 367. - cur.wallMyReplied[cur.oid + '_' + cur.pid] = 1;
- 368. - cur.wallMyOpened[cur.oid + '_' + cur.pid] = 1;
- 369. - if (cur.pid) {
- 370. - var replyTo = cur.oid + '_' + cur.pid;
- 371. - } else {
- 372. - var replyTo = cur.oid + '_note' + cur.nid;
- 373. - }
- 374. -
- 375. - if (composer) {
- 376. - state = Composer.reset(composer);
- 377. - } else {
- 378. - val(rf, '');
- 379. - }
- 380. -
- 381. - extend(params, {
- 382. - act: 'post',
- 383. - type: cur.wallType,
- 384. - reply_to: replyTo,
- 385. - reply_to_msg: val('fwr_to'),
- 386. - reply_to_user: cur.reply_to && cur.reply_to[0] || 0,
- 387. - last: ((cur.pgCont.lastChild || {}).id || '').split('_')[1],
- 388. - from_group: isChecked('fwr_as_group'),
- 389. - hash: cur.options.post_hash
- 390. - });
- 391. - ajax.post('al_wall.php', params, {
- 392. - onDone: function(count, from, rows, offset, pages, preload, names) {
- 393. - cur.wallMyReplied[cur.oid + '_' + cur.pid] = 0;
- 394. - Pagination.loaded.apply(window, arguments);
- 395. - FullWall.cancelAddReply(true);
- 396. - setTimeout(FullWall.scrollToEnd, 0);
- 397. - if (pages && offset) {
- 398. - nav.setLoc(extend(nav.objLoc, {offset: offset}));
- 399. - }
- 400. - },
- 401. - onFail: function () {
- 402. - if (composer) {
- 403. - Composer.restore(composer, state);
- 404. - }
- 405. - },
- 406. - showProgress: lockButton.pbind(ge('fwr_send')),
- 407. - hideProgress: unlockButton.pbind(ge('fwr_send'))
- 408. - });
- 409. - },
- 410. - cancelAddReply: function(clear) {
- 411. - cur.addForce = false;
- 412. - hide('fwr_cancel');
- 413. - cur.addBlock.className = '';
- 414. - if (browser.msie6) {
- 415. - cur.addBlockWrap.appendChild(cur.addBlock);
- 416. - }
- 417. - cur.docked = false;
- 418. - if (clear === true) {
- 419. - val(cur.addField, '');
- 420. - hide('fwr_warn');
- 421. - cur.addField.autosize.update();
- 422. - FullWall.cancelReplyTo();
- 423. - FullWall.replyFieldUpdated();
- 424. - }
- 425. - },
- 426. -
- 427. - replyTo: function(post, toMsgId, toId, event) {
- 428. - event = normEvent(event);
- 429. - val('fwr_to', toMsgId);
- 430. - var replyName = cur.options.reply_names[toId], cancel = '<span class="fwr_no_to" onclick="FullWall.cancelReplyTo(); elfocus(\'fwr_text\');"></span>';
- 431. - if (isArray(replyName)) {
- 432. - val('fwr_to_title', replyName[0] + cancel);
- 433. - var rf = ge('fwr_text'), replyNameOld = cur.reply_to && cur.options.reply_names[cur.reply_to[0]], v = trim(val(rf));
- 434. - if (!v || replyNameOld && isArray(replyNameOld) && !replyNameOld[1].indexOf(v)) {
- 435. - val(rf, !checkEvent(event) ? replaceEntities(replyName[1]) : '');
- 436. - FullWall.replyFieldUpdated();
- 437. - }
- 438. - } else {
- 439. - val('fwr_to_title', replyName + cancel);
- 440. - }
- 441. - cur.reply_to = [toId, toMsgId];
- 442. - cur.addForce = true;
- 443. - FullWall.onePostOnScroll();
- 444. - setTimeout(elfocus.pbind(cur.addField), 0);
- 445. - return false;
- 446. - },
- 447. - cancelReplyTo: function() {
- 448. - var rf = ge('fwr_text'), replyNameOld = cur.reply_to && cur.options.reply_names[cur.reply_to[0]], v = trim(val(rf));
- 449. - val('fwr_to_title', '');
- 450. - val('fwr_to', '');
- 451. - cur.reply_to = false;
- 452. - if (!v || replyNameOld && isArray(replyNameOld) && !replyNameOld[1].indexOf(v)) {
- 453. - val(rf, '');
- 454. - FullWall.replyFieldUpdated();
- 455. - }
- 456. - },
- 457. - deletePost: function(post, hash) {
- 458. - return FullWall.replyAction('delete', post, hash);
- 459. - },
- 460. - markAsSpam: function(post, hash) {
- 461. - return FullWall.replyAction('spam', post, hash);
- 462. - },
- 463. - restorePost: function(post, hash, root) {
- 464. - if (!root) {
- 465. - if (cur.pid) {
- 466. - root = (post == cur.oid + '_' + cur.pid);
- 467. - } else {
- 468. - root = (post == cur.oid + 'note_' + cur.nid);
- 469. - }
- 470. - }
- 471. - ajax.post('al_wall.php', {act: 'restore', post: post, hash: hash, root: root ? 1 : 0}, {onDone: function() {
- 472. - var p = root ? ge('fw_post') : ge('post' + post);
- 473. - if (!p || isVisible(p.firstChild)) return;
- 474. - if (root) {
- 475. - cur.pgPaused = false;
- 476. - show('fwr_wrap', 'fw_one_replies_wrap', 'post_publish' + post);
- 477. - } else {
- 478. - Pagination.recache(1);
- 479. - FullWall.repliesSummary(cur.pgCount);
- 480. - }
- 481. - show(p.firstChild);
- 482. - re(p.firstChild.nextSibling);
- 483. - }});
- 484. - },
- 485. - replyAction: function(act, post, hash, force) {
- 486. - if (cur.pid) {
- 487. - var root = (post == cur.oid + '_' + cur.pid);
- 488. - } else {
- 489. - var root = (post == cur.oid + 'note_' + cur.nid);
- 490. - }
- 491. - cur.wallMyDeleted[post] = act == 'restore' ? 0 : 1;
- 492. - ajax.post('al_wall.php', {act: act, post: post, hash: hash, from: 'full', root: root ? 1 : 0, confirm: force ? 1 : 0}, {onDone: function(msg, deleted, need_confirm) {
- 493. - if (need_confirm && act == 'delete') {
- 494. - var box = showFastBox(msg, need_confirm, getLang('global_delete'), function() { box.hide(); FullWall.replyAction(act, post, hash, 1); }, getLang('box_cancel'));
- 495. - return;
- 496. - }
- 497. - var p = root ? ge('fw_post') : ge('post' + post);
- 498. - if (!p) return;
- 499. - if (root) {
- 500. - cur.pgPaused = true;
- 501. - hide('fwr_wrap', 'fw_one_replies_wrap', 'post_publish' + post);
- 502. - }
- 503. - if (p.firstChild.nextSibling) {
- 504. - p.firstChild.nextSibling.innerHTML = msg;
- 505. - } else {
- 506. - p.appendChild(ce('div', {id: 'post_del' + post, innerHTML: msg, className: 'fw_deleted'}));
- 507. - hide(p.firstChild);
- 508. - if (deleted && !root) {
- 509. - Pagination.recache(-1);
- 510. - FullWall.repliesSummary(cur.pgCount);
- 511. - }
- 512. - }
- 513. - }, progress: ge('wpe_prg' + post) || geByClass1('fw_reply_prg', ge('post' + post))});
- 514. - },
- 515. -
- 516. - addTetaTet: function(repls, ev) {
- 517. - var upd = {
- 518. - own_reply_link: '',
- 519. - tet_a_tet: ''
- 520. - };
- 521. - if (ev[9] && ev[9] != ev[2].split('_')[0] && cur.wallTpl.tet_a_tet) {
- 522. - upd.tet_a_tet = cur.wallTpl.tet_a_tet.replace('%from_uid%', ev[9]);
- 523. - } else {
- 524. - upd.own_reply_link = cur.wallTpl.own_reply_link.replace('%post_id%', ev[2]);
- 525. - }
- 526. - // debugLog(ev[9], ev[2], cur.wallTpl.tet_a_tet, upd);
- 527. - return upd;
- 528. - },
- 529. -
- 530. - notePart: function(obj, obj_id) {
- 531. - hide(obj);
- 532. - show(obj_id);
- 533. - },
- 534. -
- 535. - doSearch: function () {
- 536. - var q = trim(val('wall_search'));
- 537. - if (nav.objLoc[0].split('/').length > 1) {
- 538. - nav.change({0: 'wall'+cur.oid, q: q || false, search: !q && 1, offset: false});
- 539. - } else {
- 540. - nav.change({q: q || false, search: !q && 1, offset: false});
- 541. - }
- 542. - lockButton('wall_search_btn');
- 543. - },
- 544. - fixPost: function (link, post, hash, value) {
- 545. - ajax.post('al_wall.php', {act: 'a_fix_post', post: post, hash: hash, value: value}, {
- 546. - progress: ge('wpe_prg' + post),
- 547. - onDone: function () {
- 548. - val(link, getLang(value ? 'wall_unfix_post' : 'wall_fix_post'));
- 549. - link.onclick = function () {
- 550. - return FullWall.fixPost(link, post, hash, value ? 0 : 1);
- 551. - }
- 552. - }
- 553. - });
- 554. - return false;
- 555. - },
- 556. - calendar: function() {
- 557. - stManager.add(['ui_controls.js', 'datepicker.js', 'datepicker.css'], function() {
- 558. - if (!cur.wallDP) {
- 559. - cur.wallSD = val('wall_datesearch');
- 560. - cur.wallDP = new Datepicker(ge('wall_datesearch'), {
- 561. - width: 140,
- 562. - resfmt: 'plain',
- 563. - addRows: nav.objLoc.day ? '<tr><td class="wall_cal_clear" colspan="7"><a onclick="nav.change({day: false, offset: false, search: nav.objLoc.q ? false : 1})" id="wall_cal_clear_lnk">' + getLang('wall_clear_date_filter') + '</a></td></tr>' : '',
- 564. - onUpdate: function() {
- 565. - if (cur.wallSD != val('wall_datesearch')) {
- 566. - var nd = val('wall_datesearch').split('.');
- 567. - nav.change({'day': (nd[0] < 10 ? '0' : '') + nd[0] + (nd[1] < 10 ? '0' : '') + nd[1] + nd[2], search: false, offset: false});
- 568. - }
- 569. - }
- 570. - });
- 571. - }
- 572. - triggerEvent(geByClass1('datepicker_control', ge('wall_datesearch_cont')), 'mousedown', false, true);
- 573. - ge('wall_datesearch_cal_box').style[vk.rtl ? 'right' : 'left'] = Math.floor((ge('wall_datesearch_lnk').offsetWidth - ge('wall_datesearch_cal_div').offsetWidth) / 2 + ge('wall_datesearch_lnk')[vk.rtl ? 'offsetRight' : 'offsetLeft']) + 'px';
- 574. - ge('wall_datesearch_cal_box').style.marginTop = '-2px';
- 575. - });
- 576. - }
- 577. - }
- 578. -
- 579. - try{stManager.done('wall.js');}catch(e){}
- ------
Advertisement
Add Comment
Please, Sign In to add comment