Стiна | ВКонтактi

n n n»,{«277293909»:[«Дмитрiю Иванцову»,»Дмитрий, «],»3605497»:[«Максовi Плескачу»,»Макс, «],»134889348»:[«Кристинi Бураковiй»,»Кристина, «],»295319112″:[» «,», «],»1594158»:[«Стасовi Терещенковi»,»Стас, «],»82933549»:[«Ромi Степанову»,»Рома, «],»58043559»:[«Филипповi Филиппен..»,»Филипп, «]}];
cur.lang = extend(cur.lang || {}, {
dont_attach: ‘Не прикріплювати’,
wall_n_replies: [«»,»%s коментар»,»%s коментарі»,»%s коментарів»],
wall_no_replies: ‘Немає коментарів’,
global_add_media: ‘Прикріпити’,
wall_fix_post: ‘Закріпити’,
wall_unfix_post: ‘Відкріпити’,
publish_postponed_title: ‘Підтвердження дії’,
publish_postponed_confirm: ‘Ви дійсно хочете опублікувати відкладений запис саме зараз?’,
publish_postponed_btn: ‘Опублікувати’,
global_store_stickers: ‘Крамниця стікерів’,
global_store_stickers_new_available: ‘Доступні нові стікери’,
global_link_choose_own_photo: ‘Вибрати своє зображення’,
global_link_remove_photo: ‘Прибрати ілюстрацію’,
});
var st = opts.scroll;
if (st) {
st = ge(st);
}
if (st) {
opts.scroll = getXY(st)[1];
animate(st, {backgroundColor: ‘#EDF1F5’}, 200, animate.pbind(st, {backgroundColor: ‘#FFF’}, 5000));
}
FullWall.initOnePost(opts, preload);;(function(){
var mp4Support = (function() {
var v = ce(‘video’);
return v.canPlayType
})();

if (!cur.gifAutoplayScrollHandler && mp4Support && !browser.mobile) {
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
}

cur.gifAutoplayScrollHandler = debounce(function () {
var autoplayGifs;
if (cur.wallPage) {
var selector = ‘.page_post_queue_’ + (cur.wallPageWide ? ‘wide’ : ‘narrow’) + ‘ .page_gif_autoplay’;
autoplayGifs = cur.wallPage.querySelectorAll(selector);
} else {
autoplayGifs = geByClass(‘page_gif_autoplay’);
}
if (!autoplayGifs.length) return;

var viewportHeight = window.innerHeight || document.documentElement.clientHeight;
var viewportMiddle = viewportHeight / 2;
var activeSpace = Math.min(viewportHeight, 800);
var activeTop = viewportMiddle — activeSpace/2;
var activeBottom = viewportMiddle + activeSpace/2;

var index = autoplayGifs.length — 1;
var direction = -1;
var candidateGif;
var tmpGif;

if (cur.activeGif) {
var rect = cur.activeGif.getBoundingClientRect();
var inViewport = rect.top > activeTop

if (inViewport) {
var inTheMiddle = rect.top < viewportMiddle if (inTheMiddle) { return; } var activeGifIndex = indexOf(autoplayGifs, domPN(cur.activeGif)); var distanceToMiddle = Math.min(Math.abs(viewportHeight/2 - rect.top), Math.abs(viewportHeight/2 - rect.bottom)); candidateGif = {el: domPN(cur.activeGif), distanceToMiddle: distanceToMiddle}; if (activeGifIndex > -1) {
index = activeGifIndex;
direction = Math.abs(viewportHeight/2 — rect.top) < Math.abs(viewportHeight/2 - rect.bottom) ? -1 : 1; } } else if (indexOf(autoplayGifs, domPN(cur.activeGif)) > -1) {
// hide active if it is autoplayable gif
Page.hideGif(cur.activeGif);
}
}

Читайте также:  ПОЛЕЗНАЯ ИНФОРМАЦИЯ

while (tmpGif = autoplayGifs[index]) {
var rect = tmpGif.getBoundingClientRect();
var inViewport = rect.width

if (inViewport && index == 0 && scrollGetY() < 300) { candidateGif = {el: tmpGif, distanceToMiddle: distanceToMiddle}; break; } if (inViewport) { var distanceToMiddle = Math.min(Math.abs(viewportHeight/2 - rect.top), Math.abs(viewportHeight/2 - rect.bottom)); if (candidateGif && distanceToMiddle > candidateGif.distanceToMiddle) {
break;
} else {
candidateGif = {el: tmpGif, distanceToMiddle: distanceToMiddle};
}
}

index += direction;
}

if (candidateGif && domFC(candidateGif.el) !== cur.activeGif) {
Page.showGif(domFC(candidateGif.el));

var nextGifIndex = indexOf(autoplayGifs, candidateGif.el) + 1;
var nextGif;
while (nextGif = autoplayGifs[nextGifIndex++]) {
var rect = nextGif.getBoundingClientRect();
if (rect.width && rect.height) { // if visible then preload
ce(‘video’, {
src: domFC(nextGif).href + ‘&wnd=1&mp4=1’,
preload: ‘auto’
});
break;
}
}
}

}, 50);

addEvent(window, ‘scroll’, cur.gifAutoplayScrollHandler);
addEvent(window, ‘resize’, cur.gifAutoplayScrollHandler);

cur.gifAutoplayScrollHandler();

cur.destroy.push(function() {
removeEvent(window, ‘scroll’, cur.gifAutoplayScrollHandler);
removeEvent(window, ‘resize’, cur.gifAutoplayScrollHandler);
delete cur.gifAutoplayScrollHandler;
});
}
})();
;(function (d, w) {
var ts = d.createElement(«script»); ts.type = «text/javascript»; ts.async = true;
ts.src = (d.location.protocol == «https:» ? «https:» : «http:») + «//top-fwz1.mail.ru/js/code.js»;
var f = function () {var s = d.getElementsByTagName(«script»)[0]; s.parentNode.insertBefore(ts, s);};
if (w.opera == «[object Opera]») { d.addEventListener(«DOMContentLoaded», f, false); } else { f(); }
})(document, window);
}