Hormold

VK Change (#1373300104)

Jul 8th, 2013
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 24.03 KB | None | 0 0
  1. Файл - page_help.css (Старый размер - 5879 | Новый - 4553):
  2. 33.  - .tb_tabs .summary_tab2,
  3. 34.  - .tb_tabs .summary_tab2:hover {
  4. 35.  + .tb_tabs .summary_tab2 {
  5. 65.  +
  6. 101.  -   padding-top: 4px;
  7. 102.  +   padding-top: 5px;
  8. 109.  -   margin-top: 12px;
  9. 110.  +   margin-top: 10px;
  10. 114.  -   margin-top: 0px;
  11. 115.  - }
  12. 116.  - .fans_idol_space {
  13. 117.  -   padding-top: 0px;
  14. 118.  -   height: 14px;
  15. 119.  -   padding-bottom: 2px;
  16. 120.  +   margin-top: 14px;
  17. 164.  -   overflow: hidden;
  18. 258.  -   opacity: 1;
  19. 259.  - }
  20. 260.  - #fans_idol_search {
  21. 261.  -   margin: 7px -48px 6px;
  22. 262.  - }
  23. 263.  - #fans_idol_search_inp {
  24. 264.  -   padding: 4px 20px 5px;
  25. 265.  -   width: 70px;
  26. 266.  -   background: url(/images/magglass.png) no-repeat scroll 5px 6px white;
  27. 267.  -   height: 13px;
  28. 268.  -   outline: none;
  29. 269.  - }
  30. 270.  - #fans_idol_search_inp::-ms-clear {
  31. 271.  -   display: none;
  32. 272.  - }
  33. 273.  - .fans_search_focused .fans_row_highlight {
  34. 274.  -   background: #E1E7ED;
  35. 275.  -   border-bottom: 1px solid #DAE1E8;
  36. 276.  -   padding: 0px 1px 0px;
  37. 277.  -   margin: 0px -1px;
  38. 278.  -   *padding: 0px;
  39. 279.  -   *margin: 0px;
  40. 280.  - }
  41. 281.  - #fans_reset_search {
  42. 282.  -   margin: 1px 0px 0px 89px;
  43. 283.  -   display: none;
  44. 284.  -   cursor: pointer;
  45. 285.  -   background: transparent url(/images/icons/input_clear.gif) 6px 6px no-repeat;
  46. 286.  -   padding: 2px;
  47. 287.  -   width: 19px;
  48. 288.  -   height: 19px;
  49. 289.  -   opacity: 0.6;
  50. 290.  -   filter: alpha(opacity=60);
  51. 291.  -   position: absolute;
  52. 292.  -   z-index: 95;
  53. 293.  -   -webkit-transition: opacity 100ms linear;
  54. 294.  -   -moz-transition: opacity 100ms linear;
  55. 295.  -   -o-transition: opacity 100ms linear;
  56. 296.  -   transition: opacity 100ms linear;
  57. 297.  - }
  58. 298.  - #fans_reset_search:hover {
  59. 300.  - }
  60. 301.  - .fans_count {
  61. 302.  -   padding-left: 4px;
  62. 303.  -   color: #a6b5c6;
  63. 304.  - }
  64. 305.  - .summary_tab_sel .fans_count {
  65. 306.  -   color: #dce1e6;
  66. 307.  - }
  67. 308.  - .fans_search_link {
  68. 309.  -   position: absolute;
  69. 310.  -   padding-top: 11px;
  70. 311.  -   right: 15px;
  71. 312.  - }
  72. 313.  - .is_rtl1 .fans_search_link {
  73. 314.  -   left: 15px;
  74. 315.  -   right: auto;
  75. ------
  76. Файл - fansbox.js (Старый размер - 18336 | Новый - 0):
  77. 0.  - var FansBox = {
  78. 1.  -   init: function(box, opts) {
  79. 2.  -     if (cur.lSTL) re(cur.lSTL);
  80. 3.  -     extend(cur, {
  81. 4.  -       fnbxOffsets: cur.fnbxOffsets || {},
  82. 5.  -       fnbxPhCache: cur.fnbxPhCache || {},
  83. 6.  -       fnbxPhShown: cur.fnbxPhShown || {},
  84. 7.  -       fnbxIdolsList: cur.fnbxIdolsList || {},
  85. 8.  -       fnbxIdolsCache: cur.fnbxIdolsCache || {},
  86. 9.  -       fnbxIdolsIndex: cur.fnbxIdolsIndex || {},
  87. 10.  -       fnbxIdolsProcessed: cur.fnbxIdolsProcessed || {},
  88. 11.  -       fnbxIdolsQuery: cur.fnbxIdolsQuery || '',
  89. 12.  -
  90. 13.  -       fnbxAutoload: true,
  91. 14.  -       fnbxWasScroll: false,
  92. 15.  -       fnbxHash: opts.hash,
  93. 16.  -       fnbxOwnerId: opts.ownerId,
  94. 17.  -       fnbxId: box.tbId,
  95. 18.  -       fnbxSearchLink: opts.searchLink || '',
  96. 19.  -       fnbxPage: opts.address || 'al_fans.php',
  97. 20.  -
  98. 21.  -       lSTL: boxLayerWrap.appendChild(ce('div', {id: 'layer_stl', innerHTML: '<div id="layer_stl_bg" class="fixed"></div><div id="layer_stl_cl"></div><nobr id="layer_stl_text" class="fixed">' + getLang('global_to_top') + '</nobr>', el: box.bodyNode, onclick: cancelEvent, onmousedown: FansBox.lSTLDown, sc: FansBox.onScroll})),
  99. 22.  -       lSTLShown: 0,
  100. 23.  -       lSTLWas: 0,
  101. 24.  -       lSTLWasSet: 0
  102. 25.  -     });
  103. 26.  -     cur.fnbxOffsets[opts.tab] = opts.offset;
  104. 27.  -
  105. 28.  -     ajax.preload(cur.fnbxPage, {
  106. 29.  -       act: cur.fnbxAct || 'box',
  107. 30.  -       tab: opts.tab,
  108. 31.  -       oid: opts.ownerId,
  109. 32.  -       offset: opts.offset
  110. 33.  -     }, opts.preload);
  111. 34.  -
  112. 35.  -     box.setOptions({width: 620, bodyStyle: 'margin-top: 50px', onShow: function() {
  113. 36.  -       if (cur.fnbxWasScroll) {
  114. 37.  -         boxLayerWrap.scrollTop = cur.fnbxWasScroll;
  115. 38.  -         cur.fnbxWasScroll = false;
  116. 39.  -       }
  117. 40.  -       addEvent(boxLayerWrap, 'scroll', FansBox.onScroll);
  118. 41.  -       setTimeout(FansBox.onScroll, 0);
  119. 42.  -     }, onHide: function() {
  120. 43.  -       removeEvent(boxLayerWrap, 'scroll', FansBox.onScroll);
  121. 44.  -       hide(cur.lSTL);
  122. 45.  -       cur.lSTLShown = 0;
  123. 46.  -     }});
  124. 47.  -
  125. 48.  -     if (!box.tbDeinit) {
  126. 49.  -       extend(box, {
  127. 50.  -         tbDeinit: function() {
  128. 51.  -           cur.fnbxOwnerId = cur.fnbxOffsets = cur.fnbxPhShown = false;
  129. 52.  -           re(cur.lSTL);
  130. 53.  -           removeEvent(boxLayerWrap, 'scroll', FansBox.onScroll);
  131. 54.  -         },
  132. 55.  -         tbcShowProgress: function() {
  133. 56.  -           hide('fans_idol_search');
  134. 57.  -           if (cur.fnbxSearchLink) hide(cur.fnbxSearchLink);
  135. 58.  -         },
  136. 59.  -         tbcOnLoad: function() {
  137. 60.  -           if (curBox().tbVis == 'idols') {
  138. 61.  -             if (ge('fans_rowsidols') && ge('fans_rowsidols').childNodes.length > 10) {
  139. 62.  -               show('fans_idol_search');
  140. 63.  -               var oid = cur.fnbxOwnerId;
  141. 64.  -               if (!cur.fnbxIdolsList[oid]) {
  142. 65.  -                 cur.fnbxIdolsList[oid] = 'loading';
  143. 66.  -                 ajax.post(cur.fnbxPage, {act: 'load_idols', oid: oid}, {onDone: function(result) {
  144. 67.  -                   if (!cur.fnbxIdolsList) return;
  145. 68.  -
  146. 69.  -                   var rf = (cur.fnbxIdolsList[oid] == 'update'), upd = rf || (cur.fnbxIdolsList[oid] == 'more');
  147. 70.  -                   cur.fnbxIdolsCache[oid] = {all: []};
  148. 71.  -                   var processed = cur.fnbxIdolsProcessed;
  149. 72.  -                   for (var i = 0, count = result.length; i < count; ++i) {
  150. 73.  -                     if (processed[result[i][0]] !== undefined) {
  151. 74.  -                       result[i][1] = processed[result[i][0]];
  152. 75.  -                     }
  153. 76.  -                     cur.fnbxIdolsCache[oid].all.push(i);
  154. 77.  -                   }
  155. 78.  -                   cur.fnbxIdolsList[oid] = result;
  156. 79.  -
  157. 80.  -                   cur.fnbxIdolsIndex[oid] = new vkIndexer(cur.fnbxIdolsCache[oid].all, function(obj) {
  158. 81.  -                     return cur.fnbxIdolsList[oid][obj][2];
  159. 82.  -                   }, upd ? function() {
  160. 83.  -                     if (cur.fnbxOwnerId == oid && curBox().tbId == cur.fnbxId && curBox().tbVis == 'idols') {
  161. 84.  -                       FansBox.moreIdols(rf);
  162. 85.  -                     }
  163. 86.  -                   } : function() {});
  164. 87.  -                 }});
  165. 88.  -               } else if (cur.fnbxIdolsQuery) {
  166. 89.  -                 FansBox.moreIdols(true);
  167. 90.  -               }
  168. 91.  -             }
  169. 92.  -           } else {
  170. 93.  -             hide('fans_idol_search');
  171. 94.  -             if (cur.fnbxSearchLink) show(cur.fnbxSearchLink);
  172. 95.  -           }
  173. 96.  -         }
  174. 97.  -       });
  175. 98.  -       addEvent(boxLayerWrap, 'scroll', FansBox.onScroll);
  176. 99.  -     }
  177. 100.  -
  178. 101.  -     placeholderSetup('fans_idol_search_inp', {back: true});
  179. 102.  -     box.tbcOnLoad();
  180. 103.  -
  181. 104.  -     if (cur.fnbxLoaded) cur.fnbxLoaded();
  182. 105.  -     onBodyResize();
  183. 106.  -     FansBox.onScroll();
  184. 107.  -   },
  185. 108.  -   getHighlight: function(q) {
  186. 109.  -     var indxr = cur.fnbxIdolsIndex[cur.fnbxOwnerId], delimiter = indxr.delimiter, trimmer = indxr.trimmer;
  187. 110.  -
  188. 111.  -     q += ' ' + (parseLatin(q) || '');
  189. 112.  -     q = escapeRE(q).replace(/&/g, '&amp;');
  190. 113.  -     q = q.replace(trimmer, '').replace(delimiter, '|');
  191. 114.  -     return {
  192. 115.  -       re: new RegExp('(' + q + ')', 'gi'),
  193. 116.  -       val: '<span class="fans_row_highlight">$1</span>'
  194. 117.  -     }
  195. 118.  -   },
  196. 119.  -   moreIdols: function(force) {
  197. 120.  -     var oid = cur.fnbxOwnerId, list = cur.fnbxIdolsList[oid];
  198. 121.  -     if (curBox().tbId != cur.fnbxId) return;
  199. 122.  -
  200. 123.  -     if (!list || list == 'loading' || list == 'update' || list == 'more') {
  201. 124.  -       if (list == 'loading') cur.fnbxIdolsList[oid] = 'more';
  202. 125.  -       return;
  203. 126.  -     }
  204. 127.  -
  205. 128.  -     var list = cur.fnbxIdolsCache[oid].all, q = trim(val('fans_idol_search_inp'));
  206. 129.  -     toggle('fans_reset_search', !!q);
  207. 130.  -
  208. 131.  -     if (!isVisible('fans_idol_search')) {
  209. 132.  -       q = '';
  210. 133.  -     }
  211. 134.  -
  212. 135.  -     var refresh = (force || q != cur.fnbxIdolsQuery), highlight = false;
  213. 136.  -     cur.fnbxIdolsQuery = q;
  214. 137.  -     if (q) {
  215. 138.  -       list = cur.fnbxIdolsCache[oid]['_' + q];
  216. 139.  -       if (list === undefined) {
  217. 140.  -         var tmp = cur.fnbxIdolsIndex[oid].search(q), mp = {};
  218. 141.  -         list = [];
  219. 142.  -         for (var i = 0, l = tmp.length; i < l; ++i) {
  220. 143.  -           if (!mp[tmp[i]]) {
  221. 144.  -             mp[tmp[i]] = true;
  222. 145.  -             list.push(tmp[i]);
  223. 146.  -           }
  224. 147.  -         }
  225. 148.  -         list.sort(function(a,b){return a-b;});
  226. 149.  -         cur.fnbxIdolsCache[oid]['_' + q] = list;
  227. 150.  -       }
  228. 151.  -       highlight = FansBox.getHighlight(q);
  229. 152.  -     }
  230. 153.  -
  231. 154.  -     var len = list.length, cont = ge('fans_rowsidols'), more = ge('fans_more_linkidols');
  232. 155.  -     if (!len) {
  233. 156.  -       hide(more);
  234. 157.  -       val(cont, FansBox.genIdolEmpty(val('fans_idol_search_inp')));
  235. 158.  -       return;
  236. 159.  -     }
  237. 160.  -
  238. 161.  -     var start = refresh ? 0 : cont.childNodes.length, end = Math.min(len, start + 32), html = [];
  239. 162.  -     for (var i = start; i < end; ++i) {
  240. 163.  -       var row = cur.fnbxIdolsList[oid][list[i]], name = row[2];
  241. 164.  -       if (!row) continue;
  242. 165.  -       row = FansBox.genIdolRow(row, highlight ? name.replace(highlight.re, highlight.val) : name);
  243. 166.  -       if (refresh) {
  244. 167.  -         html.push(row);
  245. 168.  -       } else {
  246. 169.  -         cont.appendChild(se(row));
  247. 170.  -       }
  248. 171.  -     }
  249. 172.  -     if (refresh) {
  250. 173.  -       val(cont, html.join(''));
  251. 174.  -       curBox().tbToTop();
  252. 175.  -     }
  253. 176.  -     toggle(more, end < len);
  254. 177.  -   },
  255. 178.  -   genIdolEmpty: function(q) {
  256. 179.  -     var lnk = '<a href="/search?c[section]=groups&c[q]=' + encodeURIComponent(q) + '">';
  257. 180.  -     var text = trim(q) ? (getLang('fans_idols_not_found') + '<br><br>' + getLang('groups_you_can_find').replace('{term}', lnk + clean(q) + '</a>').replace('{link}', lnk).replace('{/link}', '</a>')) : getLang('fans_no_idols');
  258. 181.  -     return '<div class="fans_no_rows">' + text + '</div>';
  259. 182.  -   },
  260. 183.  -   genIdolRow: function(row, name) {
  261. 184.  -     var oid = row[0], evs = row[6] ? ' onmouseover="FansBox.bigphOver(this, ' + oid + ')"' : '', href = '/' + (row[4] ? row[4] : (oid > 0 ? 'id' + oid : 'public' + (-oid))), photo = row[3], size = getLang('public_N_followers', row[5], true), non = ' style="display: none"', status = row[7].length ? row[7] : getLang(oid > 0 ? 'profile_own_profile' : 'groups_type_public'), btns = vk.id && vk.id != oid;
  262. 185.  -     var feed_act = row[8] ? '<a onclick="FansBox.feedToggle(this, ' + oid + ')">'+getLang('public_feedunblock')+'</a>' : '';
  263. 186.  -     return ['\
  264. 187.  - <div class="fans_idol_row inl_bl">\
  265. 188.  -   <div class="fans_idolph_wrap fl_l"', evs, '>\
  266. 189.  -     <a class="fans_idol_ph" href="', href, '">\
  267. 190.  -       <img class="fans_idol_img" src="', photo, '" />\
  268. 191.  -     </a>\
  269. 192.  -   </div>\
  270. 193.  -   <div class="fans_idol_info fl_l">\
  271. 194.  -     <div class="fans_idol_name"><a class="fans_idol_lnk" href="', href, '">', name, '</a></div>\
  272. 195.  -     <div class="fans_idol_status">', status, '</div><div class="fans_idol_size">', size, '</div>\
  273. 196.  -     <div id="fans_idol_sub', oid, '" class="button_blue fans_idol_sub"', ((row[1] || !btns) ? non : ''), '>\
  274. 197.  -       <button onclick="FansBox.subscribe(this, ', oid, ')">', getLang('public_subscribe'), '</button>\
  275. 198.  -     </div>\
  276. 199.  -     <div id="fans_idol_feedact', oid, '" class="fans_idol_space"', (row[1] && btns ? '' : non), '>', feed_act,'</div>\
  277. 200.  -     <div id="fans_idol_unsub', oid, '" class="fans_idol_unsub"', (row[1] && btns ? '' : non), '>\
  278. 201.  -       <a onclick="FansBox.unsubscribe(this, ', oid, ')">', getLang('public_unsubscribe'), '</a>\
  279. 202.  -     </div>\
  280. 203.  -   </div>\
  281. 204.  - </div>'].join('');
  282. 205.  -   },
  283. 206.  -
  284. 207.  -   resetSearch: function() {
  285. 208.  -     val('fans_idol_search_inp', '');
  286. 209.  -     FansBox.moreIdols(true);
  287. 210.  -     setTimeout(elfocus.pbind('fans_idol_search_inp'), 0);
  288. 211.  -   },
  289. 212.  -   more: function() {
  290. 213.  -     var t = curBox().tbCur;
  291. 214.  -     if (t == 'idols') return FansBox.moreIdols();
  292. 215.  -     if (isVisible('fans_more_prg' + t)) return;
  293. 216.  -     ajax.post(cur.fnbxPage, {act: cur.fnbxAct || 'box', tab: t, oid: cur.fnbxOwnerId, offset: cur.fnbxOffsets[t]}, {
  294. 217.  -       onDone: function(rows, newOffset, needMore) {
  295. 218.  -         var el = ce('div', {innerHTML: rows}), cnt = ge('fans_rows' + t);
  296. 219.  -         if (!cnt) return;
  297. 220.  -
  298. 221.  -         for (var e = domFC(el); e; e = domFC(el)) {
  299. 222.  -           cnt.appendChild(e);
  300. 223.  -         }
  301. 224.  -         cur.fnbxOffsets[t] = newOffset;
  302. 225.  -         if (needMore) {
  303. 226.  -           FansBox.preload();
  304. 227.  -         } else {
  305. 228.  -           hide('fans_more_link' + t);
  306. 229.  -         }
  307. 230.  -       }, showProgress: function() {
  308. 231.  -         hide('fans_more_link' + t);
  309. 232.  -         show('fans_more_prg' + t);
  310. 233.  -       }, hideProgress: function() {
  311. 234.  -         show('fans_more_link' + t);
  312. 235.  -         hide('fans_more_prg' + t);
  313. 236.  -       }, cache: 1
  314. 237.  -     });
  315. 238.  -     cur.fnbxAutoload = true;
  316. 239.  -   },
  317. 240.  -   preload: function() {
  318. 241.  -     var t = curBox().tbCur;
  319. 242.  -     ajax.post(cur.fnbxPage, {act: cur.fnbxAct || 'box', tab: t, oid: cur.fnbxOwnerId, offset: cur.fnbxOffsets[t]}, {
  320. 243.  -       cache: 1
  321. 244.  -     });
  322. 245.  -   },
  323. 246.  -   markSubsc: function(oid, v) {
  324. 247.  -     cur.fnbxIdolsProcessed[oid] = v;
  325. 248.  -     var lst = cur.fnbxIdolsList[cur.fnbxOwnerId];
  326. 249.  -     if (lst && lst.length) {
  327. 250.  -       for (var i = 0, l = lst.length; i < l; ++i) {
  328. 251.  -         if (lst[i][0] == oid) {
  329. 252.  -           cur.fnbxIdolsList[cur.fnbxOwnerId][i][1] = v;
  330. 253.  -           break;
  331. 254.  -         }
  332. 255.  -       }
  333. 256.  -     }
  334. 257.  -   },
  335. 258.  -
  336. 259.  -   subscribe: function(el, oid) {
  337. 260.  -     ajax.post('al_feed.php', {act: 'subscr', oid: oid, hash: cur.fnbxHash}, {
  338. 261.  -       onDone: function() {
  339. 262.  -         hide('fans_idol_sub' + oid);
  340. 263.  -         show('fans_idol_unsub' + oid);
  341. 264.  -         show('fans_idol_feedact' + oid);
  342. 265.  -         if (cur.fnbxOwnerId == vk.id) {
  343. 266.  -           FansBox.recache(1);
  344. 267.  -         }
  345. 268.  -         FansBox.markSubsc(oid, 1);
  346. 269.  -       },
  347. 270.  -       showProgress: lockButton.pbind(el),
  348. 271.  -       hideProgress: unlockButton.pbind(el)
  349. 272.  -     });
  350. 273.  -   },
  351. 274.  -   blacklistTip: function(el) {
  352. 275.  -     showTooltip(el, {
  353. 276.  -       text: getLang('fans_block_fan'),
  354. 277.  -       shift: [13, 1, 1],
  355. 278.  -       black: 1
  356. 279.  -     });
  357. 280.  -   },
  358. 281.  -   blacklist: function(el, oid, ev) {
  359. 282.  -     if (el.tt && el.tt.destroy) el.tt.destroy();
  360. 283.  -     cur.fnbxWasScroll = boxLayerWrap.scrollTop;
  361. 284.  -     showBox(cur.fnbxPage, {act: 'block', oid: oid});
  362. 285.  -     return cancelEvent(ev);
  363. 286.  -   },
  364. 287.  -   unsubscribe: function(el, oid) {
  365. 288.  -     ajax.post(cur.fnbxPage, {act: 'unsub', oid: oid, hash: cur.fnbxHash, from: 'box'}, {
  366. 289.  -       onDone: function() {
  367. 290.  -         show('fans_idol_sub' + oid);
  368. 291.  -         hide('fans_idol_unsub' + oid);
  369. 292.  -         hide('fans_idol_feedact' + oid);
  370. 293.  -         if (cur.fnbxOwnerId == vk.id) {
  371. 294.  -           FansBox.recache(-1);
  372. 295.  -         }
  373. 296.  -         FansBox.markSubsc(oid, 0);
  374. 297.  -       },
  375. 298.  -       showProgress: function() {
  376. 299.  -         hide(el);
  377. 300.  -         show(domNS(el) || domPN(el).appendChild(ce('span', {className: 'progress_inline fans_idol_unsub_p'})));
  378. 301.  -       },
  379. 302.  -       hideProgress: function() {
  380. 303.  -         show(el);
  381. 304.  -         re(domNS(el));
  382. 305.  -       }
  383. 306.  -     })
  384. 307.  -   },
  385. 308.  -   feedToggle: function(el, oid) {
  386. 309.  -     ajax.post(cur.fnbxPage, {act: 'feedtgl', oid: oid, hash: cur.fnbxHash, from: 'box'}, {
  387. 310.  -       onDone: function(val, str) {
  388. 311.  -         el.innerHTML = str;
  389. 312.  -         if (cur.fnbxOwnerId == vk.id) {
  390. 313.  -           FansBox.recache(-1);
  391. 314.  -         }
  392. 315.  -         var lst = cur.fnbxIdolsList[cur.fnbxOwnerId];
  393. 316.  -         if (lst && lst.length) {
  394. 317.  -           for (var i = 0, l = lst.length; i < l; ++i) {
  395. 318.  -             if (lst[i][0] == oid) {
  396. 319.  -               cur.fnbxIdolsList[cur.fnbxOwnerId][i][0] = val;
  397. 320.  -               break;
  398. 321.  -             }
  399. 322.  -           }
  400. 323.  -         }
  401. 324.  -       },
  402. 325.  -       showProgress: function() {
  403. 326.  -         el.innerHTML = '<span class="progress_inline"></span>';
  404. 327.  -       }
  405. 328.  -     })
  406. 329.  -   },
  407. 330.  -   lSTLDown: function(e) {
  408. 331.  -     e = e || window.event;
  409. 332.  -     if (checkEvent(e)) return;
  410. 333.  -
  411. 334.  -     if (!__afterFocus) {
  412. 335.  -       var to = 0, st = boxLayerWrap.scrollTop;
  413. 336.  -       if (cur.lSTLWasSet && cur.lSTLWas) {
  414. 337.  -         to = cur.lSTLWas;
  415. 338.  -         cur.lSTLWas = 0;
  416. 339.  -       } else {
  417. 340.  -         cur.lSTLWas = st;
  418. 341.  -       }
  419. 342.  -       boxLayerWrap.scrollTop = to;
  420. 343.  - /*      var diff = st - to;
  421. 344.  -       if (Math.abs(diff) > 6) {
  422. 345.  -         boxLayerWrap.scrollTop = (to + (diff > 0 ? 6 : -6));
  423. 346.  -       }
  424. 347.  -       setTimeout(function() {
  425. 348.  -         animate(boxLayerWrap, {scrollTop: to, transition: Fx.Transitions.easeInCirc}, 100);
  426. 349.  -       }, 0);/**/
  427. 350.  -     }
  428. 351.  -     return cancelEvent(e);
  429. 352.  -   },
  430. 353.  -   onScroll: function() {
  431. 354.  -     var st = boxLayerWrap.scrollTop, mx = 200, vis = cur.lSTLWas || (st > mx), o = 0;
  432. 355.  -     cur.lSTL.style.marginTop = st + 'px';
  433. 356.  -     if (!vis) {
  434. 357.  -       if (cur.lSTLShown !== 0) {
  435. 358.  -         hide(cur.lSTL);
  436. 359.  -         cur.lSTLShown = 0;
  437. 360.  -       }
  438. 361.  -     } else {
  439. 362.  -       if (cur.lSTLShown !== 1) {
  440. 363.  -         show(cur.lSTL);
  441. 364.  -         cur.lSTLShown = 1;
  442. 365.  -       }
  443. 366.  -       if (cur.lSTLWas && st > 500) {
  444. 367.  -         cur.lSTLWas = 0;
  445. 368.  -       }
  446. 369.  -       if (st > mx) {
  447. 370.  -         o = (st - mx) / mx;
  448. 371.  -         if (cur.lSTLWasSet) {
  449. 372.  -           cur.lSTLWasSet = 0;
  450. 373.  -           val(domLC(cur.lSTL), getLang('global_to_top'));
  451. 374.  -           removeClass(domLC(cur.lSTL), 'down');
  452. 375.  -         }
  453. 376.  -       } else {
  454. 377.  -         o = (mx - st) / mx;
  455. 378.  -         if (cur.lSTLWas) {
  456. 379.  -           if (!cur.lSTLWasSet) {
  457. 380.  -             cur.lSTLWasSet = 1;
  458. 381.  -             val(domLC(cur.lSTL), '');
  459. 382.  -             addClass(domLC(cur.lSTL), 'down');
  460. 383.  -           }
  461. 384.  -         }
  462. 385.  -       }
  463. 386.  -     }
  464. 387.  -     setStyle(cur.lSTL, {opacity: Math.min(Math.max(o, 0), 1)});
  465. 388.  -     if (!cur.fnbxAutoload) return;
  466. 389.  -     var bt = lastWindowHeight, objMore = ge('fans_more_link' + curBox().tbCur);
  467. 390.  -     if (isVisible(objMore) && (bt > getXY(objMore, true)[1])) {
  468. 391.  -       objMore.click();
  469. 392.  -     }
  470. 393.  -   },
  471. 394.  -   recache: function(d) {
  472. 395.  -     cur.fnbxOffsets[curBox().tbCur] += d;
  473. 396.  -     for (var i in ajaxCache) {
  474. 397.  -       if (i.match(new RegExp('^\\/' + cur.fnbxPage + '\\#act=' + (cur.fnbxAct || 'box'), ''))) {
  475. 398.  -         delete(ajaxCache[i]);
  476. 399.  -       }
  477. 400.  -     }
  478. 401.  -   },
  479. 402.  -   remove: function(oid) {
  480. 403.  -     re('fans_fan_row' + oid);
  481. 404.  -     FansBox.recache(-1);
  482. 405.  -     FansBox.onScroll();
  483. 406.  -     if (!domFC(ge('fans_rowsfans'))) {
  484. 407.  -       oid = cur.fnbxOwnerId;
  485. 408.  -       curBox().hide();
  486. 409.  -       showBox(cur.fnbxPage, {act: cur.fnbxAct || 'box', tab: 'fans', oid: oid});
  487. 410.  -     }
  488. 411.  -   },
  489. 412.  -
  490. 413.  -   bigphOver: function(obj, uid) {
  491. 414.  -     if (!cur.lang || !cur.lang.global_photo_full_size || !cur.fnbxPhShown || browser.mobile) return;
  492. 415.  -     var o = obj.firstChild, ch = cur.fnbxPhCache[uid];
  493. 416.  -     if (o.tagName != 'A' || o.className != 'fans_fanph') {
  494. 417.  -       (o = obj.insertBefore(ce('a', {className: 'fans_fanph', href: ch && ch._id ? ('/photo' + ch._id + '?all=1') : ('/albums' + uid), innerHTML: '<span class="fans_fanph_label">' + getLang('global_photo_full_size') + '</span>'}), obj.firstChild)).onclick = FansBox.bigphClick.pbind(uid);
  495. 418.  -       o._uid = uid;
  496. 419.  -     }
  497. 420.  -
  498. 421.  -     clearTimeout(o.hideTO);
  499. 422.  -     animate(o, {marginTop: 75}, {duration: 200, transition: Fx.Transitions.easeOutCirc});
  500. 423.  -     cur.fnbxPhShown[uid] = o;
  501. 424.  -
  502. 425.  -     if (!obj.onmouseout) obj.onmouseout = FansBox.bigphOut.pbind(obj);
  503. 426.  -   },
  504. 427.  -   bigphOut: function(obj) {
  505. 428.  -     var o = obj.firstChild;
  506. 429.  -     if (!o || o.tagName != 'A' || o.className != 'fans_fanph') return;
  507. 430.  -
  508. 431.  -     clearTimeout(o.hideTO);
  509. 432.  -     o.hideTO = setTimeout(function() {
  510. 433.  -       animate(o, {marginTop: 100}, 200);
  511. 434.  -       delete(cur.fnbxPhShown[o._uid]);
  512. 435.  -     }, 150);
  513. 436.  -   },
  514. 437.  -   bigphClick: function(uid, ev) {
  515. 438.  -     if (checkEvent(ev) !== false) return;
  516. 439.  -
  517. 440.  -     var ch = cur.fnbxPhCache[uid], t = curBox().tbCur, o = cur.fnbxPhShown[uid], obj = domPN(o);
  518. 441.  -     if (!o || !obj) return;
  519. 442.  -     if (ch === undefined) {
  520. 443.  -       ch = cur.fnbxPhCache[uid] = 'show';
  521. 444.  -       ajax.post('al_photos.php', {act: 'fast_get_photo', oid: uid}, {onDone: function(res) {
  522. 445.  -         if (!res) {
  523. 446.  -           obj.onmouseover = function() {};
  524. 447.  -           re(o);
  525. 448.  -           return;
  526. 449.  -         }
  527. 450.  -         var sh = (cur.fnbxPhCache[uid] == 'show');
  528. 451.  -         cur.fnbxPhCache[uid] = res;
  529. 452.  -         o.href = '/photo' + res._id + '?all=1';
  530. 453.  -         if (sh) FansBox.bigphClick(uid);
  531. 454.  -       }, onFail: function() {
  532. 455.  -         obj.onmouseover = function() {};
  533. 456.  -         re(o);
  534. 457.  -         return true;
  535. 458.  -       }});
  536. 459.  -     }
  537. 460.  -     if (ch == 'show') {
  538. 461.  -       return cancelEvent(ev);
  539. 462.  -     }
  540. 463.  -     if (!ch) return;
  541. 464.  -
  542. 465.  -     for (var i in cur.fnbxPhShown) {
  543. 466.  -       animate(cur.fnbxPhShown[i], {marginTop: 100}, 0);
  544. 467.  -     }
  545. 468.  -     cur.fnbxPhShown = false;
  546. 469.  -     extend(cur, {
  547. 470.  -       fnbxBack: {
  548. 471.  -         tab: t,
  549. 472.  -         initial: curBox().tbInitial,
  550. 473.  -         oid: cur.fnbxOwnerId,
  551. 474.  -         offsets: cur.fnbxOffsets,
  552. 475.  -         scroll: boxLayerWrap.scrollTop,
  553. 476.  -         query: cur.fnbxIdolsQuery,
  554. 477.  -         vis: isVisible('fans_more_link' + t) || isVisible('fans_more_prg' + t),
  555. 478.  -         cont: ge('fans_rows' + t)
  556. 479.  -       }
  557. 480.  -     });
  558. 481.  -     extend(ch, {
  559. 482.  -       jumpTo: {z: 'albums' + uid},
  560. 483.  -       onHide: function() {
  561. 484.  -         cur.fnbxLoaded = function() {
  562. 485.  -           var t = curBox().tbVis, cont = ge('fans_rows' + t), s = cur.fnbxBack.scroll;
  563. 486.  -           if (t != cur.fnbxBack.tab) {
  564. 487.  -             curBox().tbTab(cur.fnbxBack.tab);
  565. 488.  -             return;
  566. 489.  -           }
  567. 490.  -           extend(cur, {
  568. 491.  -             fnbxOffsets: cur.fnbxBack.offsets,
  569. 492.  -             fnbxIdolsQuery: cur.fnbxBack.query
  570. 493.  -           });
  571. 494.  -           domPN(cont).replaceChild(cur.fnbxBack.cont, cont);
  572. 495.  -           toggle('fans_more_link' + t, !!cur.fnbxBack.vis);
  573. 496.  -           hide('fans_more_prg' + t);
  574. 497.  -           cur.fnbxLoaded = cur.fnbxBack = false;
  575. 498.  -
  576. 499.  -           boxLayerWrap.scrollTop = s;
  577. 500.  -           val('fans_idol_search_inp', cur.fnbxIdolsQuery);
  578. 501.  -           if (t == 'idols' && cur.fnbxIdolsQuery) {
  579. 502.  -             elfocus('fans_idol_search_inp');
  580. 503.  -             show('fans_reset_search');
  581. 504.  -           }
  582. 505.  -           setTimeout(function() { boxLayerWrap.scrollTop = s; onBodyResize(); FansBox.onScroll(); }, 0);
  583. 506.  -         }
  584. 507.  -         showBox(cur.fnbxPage, {act: cur.fnbxAct || 'box', tab: cur.fnbxBack.initial, oid: cur.fnbxBack.oid}, {cache: 1});
  585. 508.  -       }
  586. 509.  -     });
  587. 510.  -     cur.fnbxAutoload = false;
  588. 511.  -     return showPhoto(ch._id, 'album' + uid + '_0/rev', ch, ev);
  589. 512.  -   }
  590. 513.  - };
  591. 514.  -
  592. 515.  - try{stManager.done('fansbox.js');}catch(e){}
  593. ------
Advertisement
Add Comment
Please, Sign In to add comment