var tns=function(){var t=window,Ai=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(t){return setTimeout(t,16)},e=window,Ni=e.cancelAnimationFrame||e.mozCancelAnimationFrame||function(t){clearTimeout(t)};function Li(){for(var t,e,n,i=arguments[0]||{},a=1,r=arguments.length;a";return r.innerHTML=o,a.appendChild(r),n.appendChild(a),t=Math.abs(a.getBoundingClientRect().left-r.children[67].getBoundingClientRect().left)<2,n.fake?Di(n,i):a.remove(),t}(),n),D=e.tMQ?Bi(e.tMQ):Si(e,"tMQ",function(){if(window.matchMedia||window.msMatchMedia)return!0;var t,e=document,n=Hi(),i=Oi(n),a=e.createElement("div"),r=e.createElement("style"),o="@media all and (min-width:1px){.tns-mq-test{position:absolute}}";return r.type="text/css",a.className="tns-mq-test",n.appendChild(r),n.appendChild(a),r.styleSheet?r.styleSheet.cssText=o:r.appendChild(e.createTextNode(o)),t=window.getComputedStyle?window.getComputedStyle(a).position:a.currentStyle.position,n.fake?Di(n,i):a.remove(),"absolute"===t}(),n),r=e.tTf?Bi(e.tTf):Si(e,"tTf",Ki("transform"),n),o=e.t3D?Bi(e.t3D):Si(e,"t3D",function(t){if(!t)return!1;if(!window.getComputedStyle)return!1;var e,n=document,i=Hi(),a=Oi(i),r=n.createElement("p"),o=9=-St)return t}:function(){return at&&I&&!ft?Q-1:ft||I?Math.max(0,Lt-Math.ceil(rt)):Lt-1},It=en(sn("startIndex")),Pt=It,zt=(tn(),0),Wt=$?null:Rt(),qt=H.preventActionWhenRunning,Ft=H.swipeAngle,jt=!Ft||"?",Vt=!1,Gt=H.onInit,Qt=new Zi,Xt=" tns-slider tns-"+H.mode,Yt=V.id||(S=window.tnsId,window.tnsId=S?S+1:1,"tns"+window.tnsId),Kt=sn("disable"),Jt=!1,Ut=H.freezable,_t=!(!Ut||$)&&Tn(),Zt=!1,$t={click:oi,keydown:function(t){t=pi(t);var e=[a.LEFT,a.RIGHT].indexOf(t.keyCode);0<=e&&(0===e?we.disabled||oi(t,-1):Ce.disabled||oi(t,1))}},te={click:function(t){if(Vt){if(qt)return;ai()}var e=hi(t=pi(t));for(;e!==Ae&&!qi(e,"data-nav");)e=e.parentNode;if(qi(e,"data-nav")){var n=Se=Number(Fi(e,"data-nav")),i=tt||$?n*Q/Le:n*rt,a=le?n:Math.min(Math.ceil(i),Q-1);ri(a,t),He===n&&(Pe&&fi(),Se=-1)}},keydown:function(t){t=pi(t);var e=O.activeElement;if(!qi(e,"data-nav"))return;var n=[a.LEFT,a.RIGHT,a.ENTER,a.SPACE].indexOf(t.keyCode),i=Number(Fi(e,"data-nav"));0<=n&&(0===n?0"," animation"];if(ce||fe)var Qe,Xe,Ye={},Ke={},Je=!1,Ue=F?function(t,e){return t.x-e.x}:function(t,e){return t.y-e.y};$||$e(Kt||_t),r&&(Ot=r,Dt="translate",o?(Dt+=F?"3d(":"3d(0px, ",kt=F?", 0px, 0px)":", 0px)"):(Dt+=F?"X(":"Y(",kt=")")),I&&(V.className=V.className.replace("tns-vpfix","")),function(){ln("gutter");T.className="tns-outer",j.className="tns-inner",T.id=Yt+"-ow",j.id=Yt+"-iw",""===V.id&&(V.id=Yt);Xt+=g||$?" tns-subpixel":" tns-no-subpixel",Xt+=y?" tns-calc":" tns-no-calc",$&&(Xt+=" tns-autowidth");Xt+=" tns-"+H.axis,V.className+=Xt,I?((M=O.createElement("div")).id=Yt+"-mw",M.className="tns-ovh",T.appendChild(M),M.appendChild(j)):T.appendChild(j);if(dt){var t=M||j;t.className+=" tns-ah"}if(E.insertBefore(T,V),j.appendChild(V),Ii(G,function(t,e){zi(t,"tns-item"),t.id||(t.id=Yt+"-item"+e),!I&&W&&zi(t,W),ji(t,{"aria-hidden":"true",tabindex:"-1"})}),Nt){for(var e=O.createDocumentFragment(),n=O.createDocumentFragment(),i=Nt;i--;){var a=i%Q,r=G[a].cloneNode(!0);if(zi(r,ve),Vi(r,"id"),n.insertBefore(r,n.firstChild),I){var o=G[Q-1-a].cloneNode(!0);zi(o,ve),Vi(o,"id"),e.appendChild(o)}}V.insertBefore(e,V.firstChild),V.appendChild(n),G=V.children}}(),function(){if(!I)for(var t=It,e=It+Math.min(Q,rt);t .tns-item","font-size:"+m.getComputedStyle(G[0]).fontSize+";",Ri(Mt)),ki(Mt,"#"+Yt,"font-size:0;",Ri(Mt))):I&&Ii(G,function(t,e){var n;t.style.marginLeft=(n=e,y?y+"("+100*n+"% / "+Lt+")":100*n/Lt+"%")}));if(D){if(x){var i=M&&H.autoHeight?hn(H.speed):"";ki(Mt,"#"+Yt+"-mw",i,Ri(Mt))}i=cn(H.edgePadding,H.gutter,H.fixedWidth,H.speed,H.autoHeight),ki(Mt,"#"+Yt+"-iw",i,Ri(Mt)),I&&(i=F&&!$?"width:"+fn(H.fixedWidth,H.gutter,H.items)+";":"",x&&(i+=hn(st)),ki(Mt,"#"+Yt,i,Ri(Mt))),i=F&&!$?dn(H.fixedWidth,H.gutter,H.items):"",H.gutter&&(i+=vn(H.gutter)),I||(x&&(i+=hn(st)),b&&(i+=mn(st))),i&&ki(Mt,"#"+Yt+" > .tns-item",i,Ri(Mt))}else{I&&dt&&(M.style[x]=st/1e3+"s"),j.style.cssText=cn(et,nt,tt,dt),I&&F&&!$&&(V.style.width=fn(tt,nt,rt));var i=F&&!$?dn(tt,nt,rt):"";nt&&(i+=vn(nt)),i&&ki(Mt,"#"+Yt+" > .tns-item",i,Ri(Mt))}if(k&&D)for(var a in k){a=parseInt(a);var r=k[a],i="",o="",u="",l="",s="",c=$?null:sn("items",a),f=sn("fixedWidth",a),d=sn("speed",a),v=sn("edgePadding",a),p=sn("autoHeight",a),h=sn("gutter",a);x&&M&&sn("autoHeight",a)&&"speed"in r&&(o="#"+Yt+"-mw{"+hn(d)+"}"),("edgePadding"in r||"gutter"in r)&&(u="#"+Yt+"-iw{"+cn(v,h,f,d,p)+"}"),I&&F&&!$&&("fixedWidth"in r||"items"in r||tt&&"gutter"in r)&&(l="width:"+fn(f,h,c)+";"),x&&"speed"in r&&(l+=hn(d)),l&&(l="#"+Yt+"{"+l+"}"),("fixedWidth"in r||tt&&"gutter"in r||!I&&"items"in r)&&(s+=dn(f,h,c)),"gutter"in r&&(s+=vn(h)),!I&&"speed"in r&&(x&&(s+=hn(d)),b&&(s+=mn(d))),s&&(s="#"+Yt+" > .tns-item{"+s+"}"),(i=o+u+l+s)&&Mt.insertRule("@media (min-width: "+a/16+"em) {"+i+"}",Mt.cssRules.length)}}(),yn();var _e=ft?I?function(){var t=zt,e=Wt;t+=ot,e-=ot,et?(t+=1,e-=1):tt&&(it+nt)%(tt+nt)&&(e-=1),Nt&&(e=parseInt(i)&&t in k[i]&&(n=k[i][t]);return"slideBy"===t&&"page"===n&&(n=sn("items")),I||"slideBy"!==t&&"items"!==t||(n=Math.floor(n)),n}function cn(t,e,n,i,a){var r="";if(void 0!==t){var o=t;e&&(o-=e),r=F?"margin: 0 "+o+"px 0 "+t+"px;":"margin: "+t+"px 0 "+o+"px 0;"}else if(e&&!n){var u="-"+e+"px";r="margin: 0 "+(F?u+" 0 0":"0 "+u+" 0")+";"}return!I&&a&&x&&i&&(r+=hn(i)),r}function fn(t,e,n){return t?(t+e)*Lt+"px":y?y+"("+100*Lt+"% / "+n+")":100*Lt/n+"%"}function dn(t,e,n){var i;if(t)i=t+e+"px";else{I||(n=Math.floor(n));var a=I?Lt:n;i=y?y+"(100% / "+a+")":100/a+"%"}return i="width:"+i,"inner"!==R?i+";":i+" !important;"}function vn(t){var e="";!1!==t&&(e=(F?"padding-":"margin-")+(F?"right":"bottom")+": "+t+"px;");return e}function pn(t,e){var n=t.substring(0,t.length-e).toLowerCase();return n&&(n="-"+n+"-"),n}function hn(t){return pn(x,18)+"transition-duration:"+t/1e3+"s;"}function mn(t){return pn(b,17)+"animation-duration:"+t/1e3+"s;"}function yn(){if(ln("autoHeight")||$||!F){var t=V.querySelectorAll("img");Ii(t,function(t){var e=t.src;Tt||(e&&e.indexOf("data:image")<0?(t.src="",Ui(t,he),zi(t,"loading"),t.src=e):kn(t))}),Ai(function(){zn(Gi(t),function(){L=!0})}),ln("autoHeight")&&(t=In(It,Math.min(It+rt-1,Lt-1))),Tt?gn():Ai(function(){zn(Gi(t),gn)})}else I&&$n(),bn(),wn()}function gn(){if($&&1slide '+Hn()+" of "+Q+""),B=T.querySelector(".tns-liveregion .current"),se){var t=gt?"stop":"start";je?ji(je,{"data-action":t}):H.autoplayButtonOutput&&(T.insertAdjacentHTML(on(H.autoplayPosition),'"),je=T.querySelector("[data-action]")),je&&Ui(je,{click:di}),gt&&(ci(),wt&&Ui(V,ee),Ct&&Ui(V,ne))}if(ue){if(Ae)ji(Ae,{"aria-label":"Carousel Pagination"}),Ii(Ee=Ae.children,function(t,e){ji(t,{"data-nav":e,tabindex:"-1","aria-label":ke+(e+1),"aria-controls":Yt})});else{for(var e="",n=le?"":'style="display:none"',i=0;i';e='
'+e+"
",T.insertAdjacentHTML(on(H.navPosition),e),Ae=T.querySelector(".tns-nav"),Ee=Ae.children}if(Ti(),x){var a=x.substring(0,x.length-18).toLowerCase(),r="transition: all "+st/1e3+"s";a&&(r="-"+a+"-"+r),ki(Mt,"[aria-controls^="+Yt+"-item]",r,Ri(Mt))}ji(Ee[He],{"aria-label":ke+(He+1)+Re}),Vi(Ee[He],"tabindex"),zi(Ee[He],De),Ui(Ae,te)}oe&&(xe||we&&Ce||(T.insertAdjacentHTML(on(H.controlsPosition),'
"),xe=T.querySelector(".tns-controls")),we&&Ce||(we=xe.children[0],Ce=xe.children[1]),H.controlsContainer&&ji(xe,{"aria-label":"Carousel Navigation",tabindex:"0"}),(H.controlsContainer||H.prevButton&&H.nextButton)&&ji([we,Ce],{"aria-controls":Yt,tabindex:"-1"}),(H.controlsContainer||H.prevButton&&H.nextButton)&&(ji(we,{"data-controls":"prev"}),ji(Ce,{"data-controls":"next"})),ye=Qn(we),ge=Qn(Ce),Kn(),xe?Ui(xe,$t):(Ui(we,$t),Ui(Ce,$t))),An()}function wn(){if(I&&s){var t={};t[s]=ai,Ui(V,t)}mt&&Ui(V,ae,H.preventScrollOnTouch),yt&&Ui(V,re),lt&&Ui(O,ie),"inner"===R?Qt.on("outerResized",function(){Mn(),Qt.emit("innerLoaded",Ei())}):(k||tt||$||dt||!F)&&Ui(m,{resize:Cn}),dt&&("outer"===R?Qt.on("innerLoaded",Pn):Kt||Pn()),Dn(),Kt?Bn():_t&&Ln(),Qt.on("indexChanged",Wn),"inner"===R&&Qt.emit("innerLoaded",Ei()),"function"==typeof Gt&&Gt(Ei()),Y=!0}function Cn(t){Ai(function(){Mn(pi(t))})}function Mn(t){if(Y){"outer"===R&&Qt.emit("outerResized",Ei(t)),X=rn();var e,n=q,i=!1;k&&(En(),(e=n!==q)&&Qt.emit("newBreakpointStart",Ei(t)));var a,r,o,u,l=rt,s=Kt,c=_t,f=lt,d=vt,v=ht,p=mt,h=yt,m=gt,y=wt,g=Ct,x=It;if(e){var b=tt,w=dt,C=pt,M=at,T=bt;if(!D)var E=nt,A=et}if(lt=sn("arrowKeys"),vt=sn("controls"),ht=sn("nav"),mt=sn("touch"),at=sn("center"),yt=sn("mouseDrag"),gt=sn("autoplay"),wt=sn("autoplayHoverPause"),Ct=sn("autoplayResetOnVisibility"),e&&(Kt=sn("disable"),tt=sn("fixedWidth"),st=sn("speed"),dt=sn("autoHeight"),pt=sn("controlsText"),bt=sn("autoplayText"),xt=sn("autoplayTimeout"),D||(et=sn("edgePadding"),nt=sn("gutter"))),$e(Kt),it=un(),F&&!$||Kt||(jn(),F||(Ci(),i=!0)),(tt||$)&&(St=_n(),Wt=Rt()),(e||tt)&&(rt=sn("items"),ot=sn("slideBy"),(r=rt!==l)&&(tt||$||(Wt=Rt()),_e())),e&&Kt!==s&&(Kt?Bn():function(){if(!Jt)return;if(Mt.disabled=!1,V.className+=Xt,$n(),ft)for(var t=Nt;t--;)I&&Xi(G[t]),Xi(G[Lt-t-1]);if(!I)for(var e=It,n=It+Q;e .tns-item",S,Ri(Mt))}dt&&Pn(),i&&($n(),Pt=It)}e&&Qt.emit("newBreakpointEnd",Ei(t))}}function Tn(){if(!tt&&!$)return Q<=(at?rt-(rt-1)/2:rt);var t=tt?(tt+nt)*Q:N[Q],e=et?it+2*et:it+nt;return at&&(e-=tt?(it-tt)/2:(it-(N[It+1]-N[It]-nt))/2),t<=e}function En(){for(var t in q=0,k)(t=parseInt(t))<=X&&(q=t)}function An(){!gt&&je&&Qi(je),!ht&&Ae&&Qi(Ae),vt||(xe?Qi(xe):(we&&Qi(we),Ce&&Qi(Ce)))}function Nn(){gt&&je&&Xi(je),ht&&Ae&&Xi(Ae),vt&&(xe?Xi(xe):(we&&Xi(we),Ce&&Xi(Ce)))}function Ln(){if(!Zt){if(et&&(j.style.margin="0px"),Nt)for(var t="tns-transparent",e=Nt;e--;)I&&zi(G[e],t),zi(G[Lt-e-1],t);An(),Zt=!0}}function Bn(){if(!Jt){if(Mt.disabled=!0,V.className=V.className.replace(Xt.substring(1),""),Vi(V,["style"]),ft)for(var t=Nt;t--;)I&&Qi(G[t]),Qi(G[Lt-t-1]);if(F&&I||Vi(j,["style"]),!I)for(var e=It,n=It+Q;e=N[Lt-1])It=Wt;else for(var n=0;n=N[n];)e>N[It=n]&&a<0&&(It+=1),n++}ni(i,a),Qt.emit(mi(i)?"touchEnd":"dragEnd",Ei(i))}):jt&&oi(i,0').addClass('thisfavgame'); var thisfavgameLink = $('').attr('href', '/favorites/').text('В избранном'); thisfavgame.append(thisfavgameLink); $('.poster-imgbox').append(thisfavgame); } else { $('.thisfavgame').remove(); } }).fail(function(error) { DLEalert(error.responseText, dle_info); }).always(function() { HideLoading(); }); }); $(function(){$('.open-scr').click(function(){$('.scrblock-hide').toggleClass('expand');$(".open-scr").remove();});}); $('#comments').click(function(){ $('.add-commform').addClass('active_comment'); $(this).attr('placeholder', 'Если в планах задать вопрос, читаем FAQ ...'); }).on('input', function () { $('.add-commform').addClass('nofaq'); this.style.height = 'auto'; this.style.height = (this.scrollHeight) + 'px'; }); document.addEventListener("DOMContentLoaded",()=>{const textarea=document.getElementById("comments");if(textarea){const counter=document.createElement("div");counter.id="counter";counter.style.display="none";textarea.parentNode.appendChild(counter);const updateCounterAndMessage=()=>{const length=textarea.value.length;let text=`${length}`;const checkRange=(min,max,message)=>{return(length>=min&&length<=max)?message:null};text=checkRange(140,150,"Супер, коммент 👍")||checkRange(200,210,"Отличный объём 💪")||checkRange(280,290,"🚀 Избранный коммент")||text;counter.innerHTML=text;if(length>0){counter.style.display="block";}else{counter.style.display="none";}};textarea.addEventListener("input",updateCounterAndMessage);}}); $("body").on("click",".notreg",function(){return DLEalert("
  • Скачивайте последние версии игр первыми
  • Получите доступ к закрытым возможностям
  • Комментируйте без проверки и ограничений
Регистрация
или вход через
","Войдите на сайт"),!1}); const hide = () => { const el = document.querySelector('.tracker_notice'); if (el) el.style.display = 'none'; }, isValid = () => localStorage.getItem('blconfirmed') && Date.now() < Number(localStorage.getItem('blconfirmed_expiration')); const closeBtn = document.querySelector('.tracker_notice .close'); isValid() ? hide() : (closeBtn && closeBtn.addEventListener('click', () => { localStorage.setItem('blconfirmed', 'yes'); localStorage.setItem('blconfirmed_expiration', (Date.now() + 10 * 24 * 60 * 60 * 1000).toString()); hide(); })); const marquee = document.querySelector('#marquee'); marquee.onmouseover = () => marquee.style.animationPlayState = "paused", marquee.onmouseout = () => marquee.style.animationPlayState = "running"; $(document).ready(function() { const body = $('body'); const nightModeInput = $("input#night-mode"); const toggleTheme = (isDark) => { if (isDark) { body.addClass('dark'); localStorage.setItem('theme-dark', 'true'); nightModeInput.prop("checked", true); } else { body.removeClass('dark'); localStorage.removeItem('theme-dark'); nightModeInput.prop("checked", false); } }; // Инициализация начального состояния const initialTheme = localStorage.getItem('theme-dark') === 'true'; toggleTheme(initialTheme); body.removeClass('hide'); // Функция смены темы window.changeTheme = () => { const isDark = !body.hasClass('dark'); toggleTheme(isDark); }; }); $(".catfaq-item__head").on("click", function() { $(this).toggleClass("active").next().toggle(); }); // переход и подсветка блока $('a[href^="#"]').on('click', function(e) { const target = $($(this).attr('href')); if (!target.length) return; e.preventDefault(); $('html, body').animate({scrollTop: target.offset().top - 80}, 1000); target.addClass('highlighted').delay(1500).queue(function() { $(this).removeClass('highlighted').dequeue(); }); }); // ротация комментариев с Local Storage let currentComment=0,$rcomm=$('.rcomm'),$commright=$('.commright'),getCommentOffset=index=>$rcomm.slice(0,index).toArray().reduce((offset,el)=>offset+$(el).outerHeight(true),0),setContainerHeight=()=>$commright.height($rcomm.slice(currentComment,currentComment+5).toArray().reduce((totalHeight,el)=>totalHeight+$(el).outerHeight(true),0)),scrollComments=()=>{currentComment=currentComment>$rcomm.length-5?0:currentComment+1;setContainerHeight();$commright.animate({scrollTop:getCommentOffset(currentComment)},1500);};setContainerHeight();let intervalId=null,startScrolling=()=>{if(intervalId===null){scrollComments();intervalId=setTimeout(()=>{intervalId=null;requestAnimationFrame(startScrolling);},3500);}},stopScrollingTime=localStorage.getItem('stopScrollingTime');if(!stopScrollingTime||Date.now()-stopScrollingTime>48*60*60*1000){startScrolling();}$commright.hover(()=>{clearTimeout(intervalId);localStorage.setItem('stopScrollingTime',Date.now());}); // запоминаем блок меток $(function() { const list1 = $('.lmenu-list'); const list2 = $('.lmenu-list2'); const setState = state => { localStorage.setItem('listState', state); localStorage.setItem('listStateExpires', Date.now() + 4 * 60 * 60 * 1000); }; // Получаем сохраненное состояние из localStorage localStorage.getItem('listState') === 'list2' ? list1.hide() : list1.show(); localStorage.getItem('listState') === 'list2' ? list2.show() : list2.hide(); $('.open_alltag.genres').click(() => { list1.toggle(); list2.toggle(); // Сохраняем текущее состояние в localStorage на 4 часа list1.is(':visible') ? setState('list1') : setState('list2'); $('html, body').animate({scrollTop: $('nav.block-right.menu').offset().top - 8}, 500); }); // Проверяем, истекло ли время действия состояния if (localStorage.getItem('listStateExpires') && Date.now() > localStorage.getItem('listStateExpires')) { localStorage.removeItem('listState'); localStorage.removeItem('listStateExpires'); } }); var tnsSlider1, tnsSlider2, tnsSlider3; var $tnsCarousel1 = $('.head-carusel'); $tnsCarousel1.each(function() { tnsSlider1 = tns({ container: this, controls: false, items: 5, gutter: 16, speed: 500, slideBy: 'page', loop: false, navPosition: 'bottom', responsive: { 0: {items: 1,}, 320: {items: 2,}, 438: {items: 3,}, 630: {items: 4,}, 760: {items: 5,}, 961: {items: 4,}, 1100: {items: 5,} } }); }); var $tnsCarousel2 = $('.head-carusel2'); $tnsCarousel2.each(function() { tnsSlider2 = tns({ container: this, controls: false, items: 7, gutter: 17, speed: 500, slideBy: 'page', loop: false, navPosition: 'bottom', responsive: { 0: {items: 2,}, 460: {items: 3,}, 615: {items: 4,}, 768: {items: 5,}, 992: {items: 6,}, 1200: {items: 7,} } }); }); var $tnsCarousel3 = $('.fixnews'); $tnsCarousel3.each(function() { tnsSlider3 = tns({ container: this, controls: false, items: 4, gutter: 17, speed: 500, slideBy: 'page', loop: false, responsive: { 0: {items: 2,}, 438: {items: 3,}, 691: {items: 4,} } }); }); $('.button_showrelgame').on('click', function() { const $this = $(this); const $relgame = $('#relgame'); if ($this.hasClass('active')) { if (tnsSlider1) { tnsSlider1 = tnsSlider1.rebuild(); } $relgame.find('.related_game') .removeClass('related_game') .addClass('head-carusel'); } else { if (tnsSlider1) { tnsSlider1.destroy(); } $relgame.find('.head-carusel') .removeClass('head-carusel') .addClass('related_game'); } $this.toggleClass('active'); }); $(".rate-label").each(function(){var a = parseFloat($(this).text(), 5).toFixed(0); $(this).addClass('rate-'+a) }); $('.steaminf').click(function() { $(".steamreviews").slideToggle('slow'); }); $('.button_showtag').click(function() { $('.apptag_ctn').toggleClass("active");return false;}); $(".apptag, .cat").each(function(){ if ($(this).hasClass('apptag')) { var text = $(this).html(); text = text.replace(/,/g, ''); $(this).html(text); } else if ($(this).hasClass('cat')) { $(this).contents().filter(function() { return this.nodeType == 3; }).each(function(){ this.textContent = this.textContent.replace(/,/ig, " "); }); } }); $(document).on('click', '.tabs-nav li:not(.active)', function(){ $(this).addClass('active').siblings().removeClass('active'); var group = $(this).parent('ul').data('group'); var box = $(this).data('box'); $('.' + group + ' .box-' + box).addClass('active').siblings().removeClass('active'); // Получаем текущий URL страницы и удаляем номер страницы из URL, если он есть var currentPage = window.location.href.replace(/\/page\/\d+\//, '/'); // Сохраняем номер выбранной вкладки в localStorage для текущей страницы вместе со временем истечения срока хранения var expirationTime = new Date().getTime() + (24 * 60 * 60 * 1000); // текущее время + 24 часа var data = { selectedTab: box, expirationTime: expirationTime }; localStorage.setItem(currentPage + '_selectedTab', JSON.stringify(data)); }); $(function() { // Получаем текущий URL страницы и удаляем номер страницы из URL, если он есть var currentPage = window.location.href; if (currentPage.indexOf('/page/') !== -1) { currentPage = currentPage.replace(/\/page\/\d+\//, '/'); } // Получаем данные о номере выбранной вкладки и времени истечения срока хранения из localStorage для текущей страницы var data = localStorage.getItem(currentPage + '_selectedTab'); if (data) { data = JSON.parse(data); // Проверяем, не истек ли срок хранения номера выбранной вкладки if (new Date().getTime() > data.expirationTime) { localStorage.removeItem(currentPage + '_selectedTab'); } else { // Если срок хранения не истек, выбираем сохраненную вкладку $('.tabs-nav li[data-box="' + data.selectedTab + '"]').trigger('click'); } } }); const colors = ["#778ca3", "#F57F17", "#5ec162", "#9575CD", "#999", "#00BCD4", "#c57c3b", "#6D4C41", "#5C6BC0", "#FBC02D", "#45aaf2", "#757575", "#EF5350", "#7986CB", "#2bcbba", "#37474F", "#546E7A", "#00838F", "#FFD54F", "#607D8B"]; let colorIndex = 0; $(document).ready(function() { $('.comm-author').each(function() { const commentElem = $(this).closest('.comm-item'); const avatarElem = commentElem.find('.comm-av'); if (avatarElem.children('img').attr('src') === '/templates/'+dle_skin+'/dleimages/noavatar.png') { avatarElem.empty().append( $('
') .addClass('comm-avbox') .css('background-color', colors[colorIndex++ % colors.length]) .text($(this).text().substr(0,1)) ); } }); }); /* mobile menu */ $(document).ready(() => { const $body = $('body'); const btnMenu = '.btn-menu'; function toggleMenu() { const $sidePanel = $('
'); const $closeOverlay = $('
'); $('.block-right.menu').appendTo($sidePanel); $body.append($closeOverlay, $sidePanel); $sidePanel.toggleClass('active'); $closeOverlay.fadeToggle(200); $body.toggleClass('opened-menu'); $(btnMenu).toggleClass('toggle-close'); $closeOverlay.on("click", () => { $sidePanel.removeClass('active'); $closeOverlay.fadeOut(200, function() { $sidePanel.remove(); $closeOverlay.remove(); }); $body.removeClass('opened-menu'); $(btnMenu).removeClass('toggle-close'); }); } $(".btn-menu-wr").on("click", toggleMenu); }); $('#search_btn').click(function() { $('html').toggleClass("search_open");return false;}); for (let i = 1; i <= 5; i++) { $(`.open_hidecat.md${i}`).click(function() { $(`.menu_hidecat.md${i}, .open_hidecat.md${i}`).toggleClass("active"); return false; }); } $(function(){function Dropdown(selector, linkClass, menuClass, multiple){this.el=$(selector)||{};this.multiple=multiple||false;this.linkClass=linkClass;this.menuClass=menuClass;this.el.find(this.linkClass).on("click",{el:this.el,multiple:this.multiple,menuClass:this.menuClass},this.toggleDropdown);}Dropdown.prototype.toggleDropdown=function(event){var el=event.data.el;var $this=$(this);var $next=$this.next();var menuClass=event.data.menuClass;$next.toggle();$this.parent().toggleClass("open");if(!event.data.multiple){el.find(menuClass).not($next).hide().parent().removeClass("open");}};new Dropdown("#side-panel, .nav-menu",".link",".menu-headnav-list",false);new Dropdown(".footer-navi_menu",".link1",".menu-headnav-list1",false);new Dropdown(".menu-headnav-list",".selyears",".selyears-content",false);}); const setupToggle = (selector) => $(selector).click(function() { $(this).toggleClass('active'); var $panel = $(this).next(); $panel.css('display', $panel.css('display') === 'block' ? 'none' : 'block'); }); setupToggle(".head-right"); /* xsort */ $(document).ready(function() { if (sessionStorage.getItem('xsort_open') === 'true') { $('html').addClass('xsort_open'); } else { $('html').removeClass('xsort_open'); } $('#xsort-button').click(function() { $('html').toggleClass('xsort_open'); sessionStorage.setItem('xsort_open', $('html').hasClass('xsort_open') ? 'true' : 'false'); return false; }); }); (function($){ function xsort_empty(){ $("#dle-content").html('
Ничего не найдено
'); } $(document) .on('click','.xsort-selected',function(e){ var ul = $(this).parents('.xsort-div').find('.xsort-ul'); var d = ul.css('display'); $('.xsort-ul').hide(); if(d=='none') ul.slideDown(200); return false; }) .on('click','.xsort-ul li',function(){ $this = $(this); var text = $this.text(); var val = $this.data('val'); var field = $this.parents('.xsort-ul').data('field'); var sel = $this.parents('.xsort-div'); if(val!=='') sel.addClass('xsort-active'); else sel.removeClass('xsort-active'); sel = sel.find('.xsort-selected'); var url = window.location.href; if(field=='defaultsort'){ $this.siblings().removeClass('xasc xdesc'); sel = sel.find('span'); if(val!==''){ if($this.hasClass('xdesc')){ $this.removeClass('xdesc').addClass('xasc'); sel.attr("class","xasc"); }else{ $this.removeClass('xasc').addClass('xdesc'); sel.attr("class","xdesc"); } }else{ sel.removeClass('xasc xdesc'); } }else{ if($(this).hasClass('current')){ $this.parents('.xsort-ul').find('li').eq(0).click(); return false; } } sel.html(text); $this.addClass('current').siblings().removeClass('current'); if(url.indexOf('/page/')>=0){ url = url.split('/page/'); url = url[0]+'/'; } ShowLoading(''); $(".berrors").remove(); $.ajax({ url: url, type: "POST", method: "POST", data: {xsort:1,xs_field:field,xs_value:val} }).done(function(d){ HideLoading(); var html = $("#dle-content", d).html(); if (html) { $("#dle-content").html(html); if(url != window.location.href) window.history.pushState(null, null, url); } else xsort_empty(); }).fail(function(d){ HideLoading(); xsort_empty(); }) }) .on('click','body:not(.xsort-ul)',function(){ $('.xsort-ul').fadeOut(100); }) .on('click','.xsort-div-clearall',function(){ var url = window.location.href.replace(/\/page\/\d+\//i, '/'); ShowLoading(''); $(".berrors").remove(); $.ajax({ url: url, type: "POST", method: "POST", data: {xsort:1,xs_field:'clearallfields'} }).done(function(d){ HideLoading(); if (window.location.href == url) { window.location.reload(); } else { window.location.href = url; } }).fail(function(d){ HideLoading(); xsort_empty(); }) }) })(window.$ || window.jQuery); /* youtube lazyframe */ class LiteYTEmbed extends HTMLElement {connectedCallback(){this.videoId=this.getAttribute('videoid');let playBtnEl=this.querySelector('.lty-playbtn');this.playLabel=(playBtnEl&&playBtnEl.textContent.trim())||this.getAttribute('playlabel')||'Play';if(!this.style.backgroundImage){this.style.backgroundImage=`url("https://i.ytimg.com/vi/${this.videoId}/hqdefault.jpg")`;}if(!playBtnEl){playBtnEl=document.createElement('button');playBtnEl.type='button';playBtnEl.classList.add('lty-playbtn');this.append(playBtnEl);}if(!playBtnEl.textContent){const playBtnLabelEl=document.createElement('span');playBtnLabelEl.className='lyt-visually-hidden';playBtnLabelEl.textContent=this.playLabel;playBtnEl.append(playBtnLabelEl);}this.addEventListener('pointerover',LiteYTEmbed.warmConnections,{once:true});this.addEventListener('click',this.addIframe);}static addPrefetch(kind,url,as){const linkEl=document.createElement('link');linkEl.rel=kind;linkEl.href=url;if(as){linkEl.as=as;}document.head.append(linkEl);}static warmConnections(){if(LiteYTEmbed.preconnected)return;LiteYTEmbed.addPrefetch('preconnect','https://www.youtube-nocookie.com');LiteYTEmbed.addPrefetch('preconnect','https://www.google.com');LiteYTEmbed.addPrefetch('preconnect','https://googleads.g.doubleclick.net');LiteYTEmbed.addPrefetch('preconnect','https://static.doubleclick.net');LiteYTEmbed.preconnected=true;}addIframe(e){if(this.classList.contains('lyt-activated'))return;e.preventDefault();this.classList.add('lyt-activated');const params=new URLSearchParams(this.getAttribute('params')||[]);params.append('autoplay','1');const iframeEl=document.createElement('iframe');iframeEl.width=560;iframeEl.height=315;iframeEl.title=this.playLabel;iframeEl.allow='accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture';iframeEl.allowFullscreen=true;iframeEl.src=`https://www.youtube-nocookie.com/embed/${encodeURIComponent(this.videoId)}?${params.toString()}`;this.append(iframeEl);iframeEl.focus();}}customElements.define('lite-youtube',LiteYTEmbed); /* скролл наверх */ $(".scrollup").on("click",()=>{$("html, body").animate({scrollTop:0},200)}).end().on("scroll",()=>{$(this).scrollTop()>600?$(".scrollup").fadeIn():$(".scrollup").fadeOut()}); /* показать ещё стр */ document.addEventListener('DOMContentLoaded', () => document.body.addEventListener('click', async (event) => { if (!event.target.closest('#nav-load a')) return; event.preventDefault(); const link = event.target.closest('#nav-load a'); const urlNext = link.getAttribute('href'); const scrollNext = link.offsetTop - 200; if (!urlNext) return; try { ShowLoading(''); const response = await fetch(urlNext); const text = await response.text(); const parser = new DOMParser(); const data = parser.parseFromString(text, "text/html"); document.querySelector('#bottom-nav').remove(); document.querySelector('#dle-content').insertAdjacentHTML('beforeend', data.querySelector('#dle-content').innerHTML); document.querySelector('#dle-content').insertAdjacentElement('afterend', document.querySelector('#bottom-nav')); window.history.pushState("", "", urlNext); window.scrollTo({top: scrollNext, behavior: 'smooth'}); } finally { HideLoading(''); } })); /* Организация поиска */ // Обработка отправки формы function submitForm(e) { e.preventDefault(); const query = document.querySelector('#search-input').value; window.open(`https://yandex.ru/search/?text=${encodeURIComponent(query + ' site:byrut.org')}`, '_blank'); } // Показ подсказки при активации поля поиска function showHint() { const hint = document.querySelector('#search-hint'); if (hint) hint.textContent = 'Введите запрос для поиска'; const hint2 = document.querySelector('#search-hint2'); if (hint2) hint2.style.display = ''; } // Скрытие подсказки при деактивации поля поиска function hideHint() { const hint = document.querySelector('#search-hint'); if (hint) hint.textContent = 'Поиск ...'; const searchInput = document.querySelector('#search-input'); const hint2 = document.querySelector('#search-hint2'); if (hint2 && searchInput && !searchInput.value) { hint2.style.display = ''; } } // Обработка изменений в поле поиска function inputChange() { const searchInput = document.querySelector('#search-input'); const hint = document.querySelector('#search-hint'); if (searchInput && hint) { if (searchInput.value) { hint.style.display = 'none'; } else { hint.style.display = ''; } } } // Переключение между различными поисковыми системами const changeSearchBr = document.querySelector('.change_search_br'); if (changeSearchBr) { changeSearchBr.addEventListener('click', function() { const quicksearchYa = document.querySelector('#quicksearch.ya_search'); if (quicksearchYa) quicksearchYa.style.display = 'none'; const quicksearchBr = document.querySelector('#quicksearch.br_search'); if (quicksearchBr) quicksearchBr.style.display = 'flex'; }); } // Скрытие подсказки при клике вне ее области document.addEventListener('click', function(e) { const searchHint2 = document.querySelector('#search-hint2'); const changeSearchBr = document.querySelector('.change_search_br'); const searchInput = document.querySelector('#search-input'); if (searchHint2 && !searchHint2.contains(e.target) && e.target !== changeSearchBr && e.target !== searchInput) { searchHint2.style.display = 'none'; } }); function setWithExpiry(key,value,ttl){const now=new Date();const item={value:value,expiry:now.getTime()+ttl};localStorage.setItem(key,JSON.stringify(item));}function getWithExpiry(key){const itemStr=localStorage.getItem(key);if(!itemStr){return null;}const item=JSON.parse(itemStr);const now=new Date();if(now.getTime()>item.expiry){localStorage.removeItem(key);return null;}return item.value;}document.addEventListener('DOMContentLoaded',()=>{const teamStatuses=document.querySelectorAll('.team_status');const valuesDayGroup1=[2,3,4,5,6,7,8,9,10,11,12,13];const valuesDayGroup2=[2,3,4,6,7,9,11,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29];const valuesDayGroup3=[2,3,4,6,7,9,11,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39];const valuesNightGroup1=[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45];const valuesNightGroup2=[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59];const valuesNightGroup3=[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59];const sortTeamAuthors=()=>{const teamSite=document.querySelector('.team_site');const teamAuthors=Array.from(document.querySelectorAll('.team_author'));teamAuthors.sort((a,b)=>{const statusA=a.querySelector('.team_status').textContent.split(': ')[1];const statusB=b.querySelector('.team_status').textContent.split(': ')[1];const timeA=statusA==="Только что"?0:parseInt(statusA,10);const timeB=statusB==="Только что"?0:parseInt(statusB,10);return timeA-timeB;});teamAuthors.forEach((author)=>{teamSite.appendChild(author);});};const updateStatuses=()=>{teamStatuses.forEach((status,index)=>{let storedStatus=getWithExpiry(`status-${index}`);if(storedStatus){status.textContent=storedStatus;return;}let chosenValue;const now=new Date();const hours=now.getUTCHours()+3;const isDayTime=(hours>=6&&hours<=23);let values;let probabilityDay,probabilityNight;if(index<2){probabilityDay=0.73;probabilityNight=0.27;values=isDayTime?valuesDayGroup1:valuesNightGroup1;}else if(index>=2&&index<=6){probabilityDay=0.29;probabilityNight=0.17;values=isDayTime?valuesDayGroup2:valuesNightGroup2;}else{probabilityDay=0.22;probabilityNight=0.11;values=isDayTime?valuesDayGroup3:valuesNightGroup3;}const actualProbability=isDayTime?probabilityDay:probabilityNight;chosenValue=Math.random()=2&&lastDigit<=4&&(lastTwoDigits<10||lastTwoDigits>=20)){minutesText='минуты';}const finalStatus=`Был: ${chosenValue} ${minutesText} назад`;status.textContent=finalStatus;setWithExpiry(`status-${index}`,finalStatus,7*60*1000);}else{const finalStatus=`Был: ${chosenValue}`;status.textContent=finalStatus;setWithExpiry(`status-${index}`,finalStatus,7*60*1000);}});sortTeamAuthors();};updateStatuses();}) ;!function(i,e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):i.Fresco=e(jQuery)}(this,function($){var Fresco={};$.extend(Fresco,{version:"2.3.0"}),Fresco.Skins={fresco:{}};var Bounds={viewport:function(){var i={width:$(window).width()};if(Browser.MobileSafari||Browser.Android&&Browser.Gecko){var e=document.documentElement.clientWidth/window.innerWidth;i.height=window.innerHeight*e}else i.height=$(window).height();return i}},Browser=(e=navigator.userAgent,{IE:!(!window.attachEvent||-1!==e.indexOf("Opera"))&&f("MSIE "),Opera:-1i.width||h&&s.height>i.height);){var r=1,d=1;a&&s.width>i.width&&(r=i.width/s.width),h&&s.height>i.height&&(d=i.height/s.height),n=Math.min(r,d),s={width:e.width*n,height:e.height*n},o--}return s.width=Math.max(s.width,0),s.height=Math.max(s.height,0),s}};$.extend($.easing,{frescoEaseInCubic:function(i,e,t,s,n){return s*(e/=n)*e*e+t},frescoEaseInSine:function(i,e,t,s,n){return-s*Math.cos(e/n*(Math.PI/2))+s+t},frescoEaseOutSine:function(i,e,t,s,n){return s*Math.sin(e/n*(Math.PI/2))+t}});var Support=(O=document.createElement("div"),P="Webkit Moz O ms Khtml".split(" "),{canvas:(ba=document.createElement("canvas"),!(!ba.getContext||!ba.getContext("2d"))),css:{animation:S("animation"),transform:S("transform"),prefixed:function(i){return S(i,"prefix")}},svg:!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,touch:function(){try{return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}catch(i){return!1}}()}),ba,O,P;function S(i,e){var t=i.charAt(0).toUpperCase()+i.substr(1);return function(i,e){for(var t in i)if(void 0!==O.style[i[t]])return"prefix"!==e||i[t];return!1}((i+" "+P.join(t+" ")+t).split(" "),e)}Support.detectMobileTouch=function(){Support.mobileTouch=Support.touch&&(Browser.MobileSafari||Browser.Android||Browser.IEMobile||Browser.ChromeMobile||!/^(Win|Mac|Linux)/.test(navigator.platform))},Support.detectMobileTouch();var ImageReady=function(){return this.initialize.apply(this,Array.prototype.slice.call(arguments))};function Timers(){return this.initialize.apply(this,_slice.call(arguments))}function getURIData(s){var n={type:"image"};return $.each(Types,function(i,e){var t=e.data(s);t&&((n=t).type=i,n.url=s)}),n}function detectExtension(i){var e=(i||"").replace(/\?.*/g,"").match(/\.([^.]{3,4})$/);return e?e[1].toLowerCase():null}$.extend(ImageReady.prototype,{supports:{naturalWidth:"naturalWidth"in new Image},initialize:function(i,e,t){this.img=$(i)[0],this.successCallback=e,this.errorCallback=t,this.isLoaded=!1,this.options=$.extend({method:"naturalWidth",pollFallbackAfter:1e3},arguments[3]||{}),this.supports.naturalWidth&&"onload"!==this.options.method?this.img.complete&&"undefined"!==$.type(this.img.naturalWidth)?setTimeout($.proxy(function(){0=this.options.pollFallbackAfter&&!this._usedPollFallback&&(this._usedPollFallback=!0,this.fallback()),this._time>this.intervals[this._ipos][0]){if(!this.intervals[this._ipos+1])return void this.error();this._ipos++,this._delay=this.intervals[this._ipos][1]}this.poll()}},this),this._delay)},fallback:function(){var i=new Image;(this._fallbackImg=i).onload=$.proxy(function(){i.onload=function(){},this.supports.naturalWidth||(this.img.naturalWidth=i.width,this.img.naturalHeight=i.height),this.success()},this),i.onerror=$.proxy(this.error,this),i.src=this.img.src},abort:function(){this._fallbackImg&&(this._fallbackImg.onload=function(){}),this._polling&&(clearTimeout(this._polling),this._polling=null)},success:function(){this._calledSuccess||(this._calledSuccess=!0,this.isLoaded=!0,this.successCallback(this))},error:function(){this._calledError||(this._calledError=!0,this.abort(),this.errorCallback&&this.errorCallback(this))}}),$.extend(Timers.prototype,{initialize:function(){this._timers={}},set:function(i,e,t){this._timers[i]=setTimeout(e,t)},get:function(i){return this._timers[i]},clear:function(i){i?this._timers[i]&&(clearTimeout(this._timers[i]),delete this._timers[i]):this.clearAll()},clearAll:function(){$.each(this._timers,function(i,e){clearTimeout(e)}),this._timers={}}});var Type={isVideo:function(i){return/^(youtube|vimeo)$/.test(i)}},Types={image:{extensions:"bmp gif jpeg jpg png webp",detect:function(i){return-1<$.inArray(detectExtension(i),this.extensions.split(" "))},data:function(i){return!!this.detect()&&{extension:detectExtension(i)}}},vimeo:{detect:function(i){var e=/(vimeo\.com)\/([a-zA-Z0-9-_]+)(?:\S+)?$/i.exec(i);return!(!e||!e[2])&&e[2]},data:function(i){var e=this.detect(i);return!!e&&{id:e}}},youtube:{detect:function(i){var e=/(youtube\.com|youtu\.be)\/watch\?(?=.*vi?=([a-zA-Z0-9-_]+))(?:\S+)?$/.exec(i);return e&&e[2]?e[2]:!(!(e=/(youtube\.com|youtu\.be)\/(vi?\/|u\/|embed\/)?([a-zA-Z0-9-_]+)(?:\S+)?$/i.exec(i))||!e[3])&&e[3]},data:function(i){var e=this.detect(i);return!!e&&{id:e}}}},VimeoThumbnail=function(){function i(){return this.initialize.apply(this,_slice.call(arguments))}$.extend(i.prototype,{initialize:function(i,e,t){this.url=i,this.successCallback=e,this.errorCallback=t,this.load()},load:function(){var i=s.get(this.url);if(i)return this.successCallback(i.data.url);var e="http"+(window.location&&"https:"===window.location.protocol?"s":"")+":",t=getURIData(this.url).id;this._xhr=$.getJSON(e+"//vimeo.com/api/oembed.json?url="+e+"//vimeo.com/"+t+"&callback=?",$.proxy(function(i){if(i&&i.thumbnail_url){var e={url:i.thumbnail_url};s.set(this.url,e),this.successCallback(e.url)}else this.errorCallback()},this))},abort:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)}});var s={cache:[],get:function(i){for(var e=null,t=0;t").addClass("fr-overlay").hide().append($("
").addClass("fr-overlay-background")),this.element.on("click",$.proxy(function(){var i=Pages.page;i&&i.view&&i.view.options.overlay&&!i.view.options.overlay.close||Window.hide()},this)),Support.mobileTouch&&this.element.addClass("fr-mobile-touch"),this.element.on("fresco:mousewheel",function(i){i.preventDefault()})},setSkin:function(i){this.skin&&this.element.removeClass("fr-overlay-skin-"+this.skin),this.element.addClass("fr-overlay-skin-"+i),this.skin=i},attach:function(){$(document.body).append(this.element)},detach:function(){this.element.detach()},show:function(i,e){if(this.visible)i&&i();else{this.visible=!0,this.attach(),this.max();var t=Pages.page&&Pages.page.view.options.effects.window.show||0,s=("number"===$.type(e)?e:t)||0;this.element.stop(!0).fadeTo(s,1,i)}},hide:function(i,e){if(this.visible){var t=Pages.page&&Pages.page.view.options.effects.window.hide||0,s=("number"===$.type(e)?e:t)||0;this.element.stop(!0).fadeOut(s||0,$.proxy(function(){this.detach(),this.visible=!1,i&&i()},this))}else i&&i()},getScrollDimensions:function(){var n={};return $.each(["width","height"],function(i,e){var t=e.substr(0,1).toUpperCase()+e.substr(1),s=document.documentElement;n[e]=(Browser.IE?Math.max(s["offset"+t],s["scroll"+t]):Browser.WebKit?document.body["scroll"+t]:s["scroll"+t])||0}),n},max:function(){var i;if(Browser.MobileSafari&&Browser.WebKit&&Browser.WebKit<533.18&&(i=this.getScrollDimensions(),this.element.css(i)),Browser.IE&&Browser.IE<9){var e=Bounds.viewport();this.element.css({height:e.height,width:e.width})}Support.mobileTouch&&!i&&this.element.css({height:this.getScrollDimensions().height})}},Window={initialize:function(){this.queues=[],this.queues.hide=$({}),this.pages=[],this._tracking=[],this._first=!0,this.timers=new Timers,this.build(),this.setSkin(Options.defaults.skin)},build:function(){if(this.element=$("
").addClass("fr-window fr-measured").hide().append(this._box=$("
").addClass("fr-box").append(this._pages=$("
").addClass("fr-pages"))).append(this._thumbnails=$("
").addClass("fr-thumbnails")),Overlay.initialize(),Pages.initialize(this._pages),Thumbnails.initialize(this._thumbnails),Spinner.initialize(),UI.initialize(),this.element.addClass("fr"+(Support.mobileTouch?"":"-no")+"-mobile-touch"),this.element.addClass("fr"+(Support.svg?"":"-no")+"-svg"),Browser.IE)for(var i=7;i<=9;i++)Browser.IE").addClass("fr-stroke fr-stroke-top fr-stroke-horizontal").append($("
").addClass("fr-stroke-color")).add($("
").addClass("fr-stroke fr-stroke-bottom fr-stroke-horizontal").append($("
").addClass("fr-stroke-color"))).add($("
").addClass("fr-stroke fr-stroke-left fr-stroke-vertical").append($("
").addClass("fr-stroke-color"))).add($("
").addClass("fr-stroke fr-stroke-right fr-stroke-vertical").append($("
").addClass("fr-stroke-color"))),$.extend(Oc.prototype,{initialize:function(i,e,t){this.view=i,this.dimensions={width:0,height:0},this.uid=Lc++,this._position=e,this._total=t,this._fullClick=!1,this._visible=!1,this.queues={},this.queues.showhide=$({})},create:function(){if(!this._created){Pages.element.append(this.element=$("
").addClass("fr-page").append(this.container=$("
").addClass("fr-container")).css({opacity:0}).hide());var i=this.view.options.position&&1").addClass("fr-info").append($("
").addClass("fr-info-background")).append(Nc.clone(!0)).append(this.infoPadder=$("
").addClass("fr-info-padder"))),i&&(this.element.addClass("fr-has-position"),this.infoPadder.append(this.pos=$("
").addClass("fr-position").append($("").addClass("fr-position-text").html(this._position+" / "+this._total)))),this.view.caption&&this.infoPadder.append(this.caption=$("
").addClass("fr-caption").html(this.view.caption))),this.container.append(this.background=$("
").addClass("fr-content-background")).append(this.content=$("
").addClass("fr-content")),"image"==this.view.type&&(this.content.append(this.image=$("").addClass("fr-content-element").attr({src:this.view.url})),this.content.append(Nc.clone(!0))),i&&"outside"==this.view.options.ui&&this.container.append(this.positionOutside=$("
").addClass("fr-position-outside").append($("
").addClass("fr-position-background")).append($("").addClass("fr-position-text").html(this._position+" / "+this._total))),"inside"==this.view.options.ui){this.content.append(this.previousInside=$("
").addClass("fr-side fr-side-previous fr-toggle-ui").append($("
").addClass("fr-side-button").append($("
").addClass("fr-side-button-background")).append($("
").addClass("fr-side-button-icon")))).append(this.nextInside=$("
").addClass("fr-side fr-side-next fr-toggle-ui").append($("
").addClass("fr-side-button").append($("
").addClass("fr-side-button-background")).append($("
").addClass("fr-side-button-icon")))).append(this.closeInside=$("
").addClass("fr-close fr-toggle-ui").append($("
").addClass("fr-close-background")).append($("
").addClass("fr-close-icon"))),(this.view.caption||i&&this.view.grouped.caption)&&(this.content.append(this.infoInside=$("
").addClass("fr-info fr-toggle-ui").append($("
").addClass("fr-info-background")).append(Nc.clone(!0)).append(this.infoPadderInside=$("
").addClass("fr-info-padder"))),i&&this.infoPadderInside.append(this.posInside=$("
").addClass("fr-position").append($("").addClass("fr-position-text").html(this._position+" / "+this._total))),this.view.caption&&this.infoPadderInside.append(this.captionInside=$("
").addClass("fr-caption").html(this.view.caption))),this.view.caption||!i||this.view.grouped.caption||this.content.append(this.positionInside=$("
").addClass("fr-position-inside fr-toggle-ui").append($("
").addClass("fr-position-background")).append($("").addClass("fr-position-text").html(this._position+" / "+this._total)));var e=this.view.options.loop&&1").addClass("fr-error fr-content-element").append($("
").addClass("fr-error-icon"))),this.element.addClass("fr-has-error"),this.setDimensions({width:this.error.outerWidth(),height:this.error.outerHeight()}),this.error.css({width:"100%",height:"100%"}),e&&e()},this),{method:this.view.options.loadedMethod});break;case"vimeo":this.vimeoReady=new VimeoReady(this.view.url,$.proxy(function(i){this._markAsLoaded(),this.setDimensions({width:i.dimensions.width,height:i.dimensions.height}),e&&e()},this));break;case"youtube":this._markAsLoaded(),this.setDimensions({width:this.view.options.width,height:this.view.options.height}),e&&e()}},setDimensions:function(i){if(this.dimensions=i,this.view.options.maxWidth||this.view.options.maxHeight){var e=this.view.options,t={width:e.maxWidth?e.maxWidth:this.dimensions.width,height:e.maxHeight?e.maxHeight:this.dimensions.height};this.dimensions=Fit.within(t,this.dimensions)}},_markAsLoaded:function(){this._abortSpinnerDelay(),this.loading=!1,this.loaded=!0,Mc[this.view.url]=!0,Spinner.hide(null,null,this._position)},isVideo:function(){return Type.isVideo(this.view.type)},insertVideo:function(i){if(!this.playerIframe&&this.isVideo()){var e="http"+(window.location&&"https:"===window.location.protocol?"s":"")+":",t=$.extend({},this.view.options[this.view.type]||{}),s=$.param(t),n={vimeo:e+"//player.vimeo.com/video/{id}?{queryString}",youtube:e+"//www.youtube.com/embed/{id}?{queryString}"}[this.view.type].replace("{id}",this.view._data.id).replace("{queryString}",s);this.content.prepend(this.playerIframe=$("