Вход Регистрация
Файл: touchSpace/js/ajaxify.js
Строк: 998
<?php
function PageLoader(e){this.opts=$.extend({iframe_transport:!0,loading_indicator:!0},e),this.refresh_url=null,this.refresh_interval=null,this.pages_id={},this.page_cache_time=18e5,this.is_break_version=!1,this.prev_url=null,this.last={link_id:0,sid:"0"},this.callbacks={requeststart:{},requestend:{},shutdown:{},beforerequest:{}},this._last_xhr_request=null,this.user_id=Spaces.params.nid,this._profiller={req_start:0,req_end:0},this.GAMES_DOMAINS=["aquatika","bratva","bt","drako","farma","ferma","gbn","generals","gfarm","gonki","hata","heroes","li","looters","mdog","millioner-online","mt","naemniki","nazone","nebomobi","redline","sb","vi","vkletke","voindorog","voyna","wartank","wekings"],this.__construct()}var IFrameXHR,HistoryManager,use_iframe_transport;Spaces.WidgetsTypes={HEADER:1,SIDEBAR:2,FOOTER:4,CSS:8},Spaces.SettingsTypes={SOUND_NOTIFY_BLOCK:1,FORM_SUBMIT_KEY:2,FONT_SIZE:3},IFrameXHR=function(){function e(e){a(e)}function t(e,t){a(null),_=o(e,"POST",t),document.body.appendChild(_),f.onload=d,f.onerror=u,_.submit()}function r(e,t){a(null),e=n(e,t),document.body.appendChild(e),e.submit()}function a(e){s(),document.domain=(""+location.host).match(/[a-zA-Z-_d]+.[a-zA-Z-_d]+.?$/)[0];var t="iframe_xhr_transport";navigator.userAgent.indexOf("MSIE 7")>-1?f=document.createElement('<iframe src="javascript:false;" name="'+t+'">'):(f=document.createElement("iframe"),f.src="javascript:false;",f.name=t),f.style.display="none",f.id=t,"string"==typeof e&&(f.src=e),document.body.appendChild(f),m=!1,h=!0}function o(e,t,r){var a,o,n=document.createElement("form");n.action=e,n.method=t,n.target="iframe_xhr_transport",n.name="iframe_form",n.style.display="none";for(a in r)if(r[a]instanceof Array)for(o=0;o<r[a].length;++o)n.appendChild(i(a,r[a][o]));else n.appendChild(i(a,r[a]));return n}function n(e,t){var r,a,o,n=document.createElement("form");for(n.action=t||e.action,n.method=e.method,n.enctype=e.enctype,n.encoding=e.encoding,n.target="iframe_xhr_transport",n.name="iframe_form",n.style.display="none",r=0;r<e.elements.length;++r)a=e.elements[r],o=a.type.toLowerCase(),a.name.length&&("radio"!=o&&"checkbox"!=o||a.checked)&&("submit"!=o||a==e.submit_btn)&&n.appendChild(i(a.name,a.value));return n}function i(e,t){var r=document.createElement("input");return r.type="hidden",r.name=e,r.value=t,r}function s(){if(_&&(_.parentNode.removeChild(_),_=null),f){if(!h){try{f.stop()}catch(e){}try{f.execCommand("stop")}catch(e){}try{f.contentWindow.document.execCommand("stop")}catch(e){}f.src="javascript:false;"}f.parentNode.removeChild(f),f=null}}function l(e){m=!0,s(),setTimeout(function(){callbacks.always&&callbacks.always(),callbacks.success&&callbacks.success(e)},0)}function c(e){s(),h=!1,setTimeout(function(){callbacks.always&&callbacks.always(),callbacks.error&&callbacks.error(e)},0)}function u(){c(!1)}function d(){h=!1,setTimeout(function(){m||h||(s(),c(!0))},1)}function p(e){callbacks=extend({success:null,error:null,always:null},e)}var f,_,m=!1,h=!1;return{get:e,post:t,formSend:r,_data:l,abort:s,setCallbacks:p}}(),HistoryManager={default_id:null,callbacks:{},old_url:null,cur_url:null,_startup_url:null,init:function(){HistoryManager.old_url=location.href,HistoryManager.cur_url=location.href,window.onpopstate=HistoryManager.handler,HistoryManager._startup_url=location.href},setDefault:function(e){HistoryManager.default_id=e},add:function(e,t){HistoryManager.callbacks[e]=t},remove:function(e){delete HistoryManager.callbacks[e]},clean:function(){for(var e in HistoryManager.callbacks)HistoryManager.default_id!=e&&delete HistoryManager.callbacks[e]},handler:function(e){if(HistoryManager._startup_url==location.href)return console.error("prevent html5 history bug"),HistoryManager._startup_url=null,!1;HistoryManager.old_url=HistoryManager.cur_url,HistoryManager.cur_url=document.location.href;var t=HistoryManager.default_id;return e.state&&e.state.route&&void 0!==HistoryManager.callbacks[e.state.route]&&(t=e.state.route),t&&HistoryManager.callbacks[t](e),e.preventDefault(),!1},pushState:function(e,t,r){HistoryManager._startup_url&&(HistoryManager._startup_url=null),e=e||{},HistoryManager.old_url=document.location.href,window.history.pushState(e,t,r),HistoryManager.cur_url=document.location.href},replaceState:function(e,t,r){HistoryManager._startup_url&&(HistoryManager._startup_url=null),HistoryManager.old_url=document.location.href,window.history.replaceState(e,t,r),HistoryManager.cur_url=document.location.href}},extend(PageLoader.prototype,{handlers:{onLinkClick:function(e,t){return/(s|^)(no_ajax)(s|$)/.test(this.className)?!0:t.loadPage({url:this.href})?(e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation(),!1):!0},onFormSubmit:function(e,t){if(/(s|^)(no_ajax)(s|$)/.test(this.className))return!0;var r=this.getAttribute("enctype");return r&&"multipart/form-data"==r.toLowerCase()?!0:t.loadPage({url:this.action,form:this})?(e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation(),!1):!0}},__construct:function(){var e=this;this.onShutdown("Loader::onNewRequestHandler",Loader.onNewRequestHandler,!0),HistoryManager.setDefault("common"),HistoryManager.add("common",function(t){require("ga",function(){__ga("send","pageview",{page:document.location.href,title:document.title})}),e.loadPage({url:document.location.href,state:t.state,history:!1,scroll:!1,from_history:!0})||document.location.replace(document.location.href)})},setup:function(){var e,t=this;$.event.special.click||($.event.special.click={postDispatch:null}),$.event.special.submit||($.event.special.submit={postDispatch:null,trigger:null}),$.event.special.click.postDispatch=function(e){!e.ajaxify||e.originalEvent&&(e.originalEvent.returnValue===!1||e.originalEvent.cancelBubble||e.originalEvent.defaultPrevented)||e.isDefaultPrevented()||t.handlers.onLinkClick.call(e.ajaxify.el,e,t)===!1&&e.preventDefault()},$.event.special.submit.postDispatch=function(e){!e.ajaxify||e.originalEvent&&(e.originalEvent.returnValue===!1||e.originalEvent.cancelBubble||e.originalEvent.defaultPrevented)||e.isDefaultPrevented()||t.handlers.onFormSubmit.call(e.ajaxify.el,e,t)===!1&&e.preventDefault()},this._addAjaxCallbacks($(document.body)),window.PAGE_REFRESH&&(e=PAGE_REFRESH.params.match(/^(d+);s*url=(.*?)$/i),e&&(this.setRefresh(e[2],e[1]),PAGE_REFRESH.timer&&clearTimeout(PAGE_REFRESH.timer))),window.pushstream&&pushstream.addMessageHandler("ajaxify",function(e){e.act==Spaces.LongPollingTypes.REFRESH_WIDGETS&&(t.current_tab_widgets_updated||Spaces.api("common.refreshWidget",{widgets:e.widgets},function(e){0==e.code&&e.widgets&&t.updateWidgets(e.widgets)}),t.current_tab_widgets_updated=!1),e.act==Spaces.LongPollingTypes.SETTINGS&&t.updateSettings(e.newSettings)}),t.on("shutdown","spaces_footer",function(){Spaces.footer&&Spaces.footer.update()},!0),setTimeout(function(){var e,t=$("#navi_footer_wrap, #header_elements, #page_sidebar").find("a"),r=/([&?;])sid=d+/g;for(e=0;e<t.length;++e)t[e].href=t[e].href.replace(r,"$1sid=")},1),t._proccessInternalCb(location.hash.substr(1))},onShutdown:function(e,t,r){return this.on("shutdown",e,t,r)},onRequestStart:function(e,t){return this.on("requeststart",e,t,!0)},onRequestEnd:function(e,t){return this.on("requestend",e,t,!0)},_addAjaxCallbacks:function(e){e.on("submit.ajaxify","form",function(e){e.ajaxify={el:this}}),e.on("click.ajaxify","a",function(e){e.ajaxify={el:this}})},setRefresh:function(e,t){var r=this;this.refresh_interval&&(clearInterval(this.refresh_interval),this.refresh_interval=null,this.refresh_url=null),e&&(this.refresh_url=e,console.error("set refresh: "+e+", "+t),this.refresh_interval=setInterval(function(){r.loadPage({url:r.refresh_url})},1e3*t))},loadPage:function(e){var t,r,a,o,n,i,s,l,c,u,d,p,f,_,m,h,g,y=this;if(e=$.extend({url:"",form:null,history:!0,state:null,scroll:!0,from_history:!1},e),t=$(document.body),!y._trigger("beforerequest",e))return!0;if(y.off("beforerequest"),//(w{2})/([a-f0-9]{32})/i.test(e.url))return!1;if(a=new Url(e.url),o=new Url(document.location.href),/^/(moders|i/|js/|css/)/i.test(a.path))return!1;if(a.domain!=o.domain){if(n=o.parseDomain(),i=a.parseDomain(),i.sub_domains.length>0&&$.inArray(i.sub_domains[i.sub_domains.length-1].toLowerCase(),y.GAMES_DOMAINS)>-1)return!1;if(i.base_domain!=o.domain)return!1;s="/"==a.path.replace(//+/g,"/")||!a.path.length,/.grp./i.test(a.domain)?(s&&(a.path="/comm/",a.query={r:"comm/comm_show"}),a.query.address=i.sub_domains[0].replace(/-/g,"_")):(s&&(a.path="/mysite/",a.query={}),a.query.name=i.sub_domain.replace(/-/g,"_")),a.domain=o.domain}return this.is_break_version?(y._onBreakVersion(),!1):(l=null,e.form&&("get"==e.form.method.toLowerCase()?(a.query={},this.serializeForm(e.form,a.query),e.form=null):(l={},this.serializeForm(e.form,l))),c=function(e){y.setRefresh(!1),y._trigger("requestend"),e?y._proccessInternalCb(location.hash.substr(1)):y._trigger("shutdown"),Spaces.clearErrors()},u=function(){document.body.style.height="auto",y.opts.loading_indicator&&y.hideLoading()},d=a.hash,p=new Url(e.history?HistoryManager.cur_url:HistoryManager.old_url),(p.hash.length>0||a.hash.length>0)&&a.isSame(p)?(y._trigger("requeststart"),c(!0),e.from_history?!0:!1):(delete a.query.sid,r=a.url(),a.hash="",f=a.url(),_=y.pages_id[f],page_id=e.from_history&&_?_.rnd:(new Date).getTime(),y.pages_id[f]||(y.pages_id[f]={}),y.pages_id[f].time=(new Date).getTime(),y.pages_id[f].rnd=page_id,e.state&&e.state.post_data&&(l=e.state.post_data),m=document.cookie.match(/sid=(d+)/)[1],h=function(t){var a,n,i,s,p,_,h,g,b,v,S,w,k,E,T,H;if(void 0!==t.http_error)return void y.showLoadingError(Spaces.getHttpError(t.http_error),e);if(a=!1,t.copy_link_id&&(a=e.from_history&&y.last.link_id>t.copy_link_id&&y.last.sid==m,y.last.sid=m,y.last.link_id<t.copy_link_id&&(y.last.link_id=t.copy_link_id)),n=$(window).scrollTop(),c(),y._profiller.req_end=(new Date).getTime(),void 0!==window.Sidebar&&Sidebar.openFunction("left"),a||(t.newSettings&&y.updateSettings(t.newSettings),t.refreshWidgets&&(y.current_tab_widgets_updated=!0,y.updateWidgets(t.refreshWidgets)),t.friends&&($("#friends_cnt").text(t.friends[0]).parent().toggle(t.friends[0]>0),$("#friends_cake").toggle(t.friends[1]>0))),t.redirect){for(i=new Url(t.redirect.replace(/&amp;/gi,"&")).merge(new Url(r)),console.error("redirect: "+i.url(),"("+t.redirect+")"),s=0;s<t.cookie.length;++s)document.cookie=t.cookie[s];return i.domain==location.hostname.toLowerCase()&&t.user_id==y.user_id&&y.loadPage({url:i.url()})||document.location.replace(i.url()),void u()}if(t.revision&&(t.revision[1]>SPACES_REV?y._onBreakVersion():t.revision[0]>SPACES_REV&&Spaces.notifications.showNotification("Доступна новая версия. Для обновления <a href='' class='no_ajax' onclick='location.reload(); return false'>перезагрузите страницу</a>","info",{silent:!1})),$("#main_search_input").val(""),t.refresh){if(i=new Url(t.refresh.link),t.refresh.link=t.refresh.link.replace(/&amp;/gi,"&"),i.domain!=o.domain)return document.location.replace("/?redirect="+encodeURIComponent(t.refresh.link)+"&xyz=1"),void u();y.setRefresh(t.refresh.link,t.refresh.time)}if(t.user_id!=y.user_id)return document.location.replace(r),void u();e.from_history?y.prev_url&&(y.pages_id[y.prev_url].forms=FormState.save(document.getElementById("main_content"))):(y.pages_id[f]&&delete y.pages_id[f].forms,p=history.state||{},p.scroll=n,p.forms=FormState.save(document.getElementById("main_content")),HistoryManager.replaceState(p,null,null)),e.history&&(HistoryManager.pushState({rnd:page_id,post_data:l},t.title,r),require("ga",function(){__ga("send","pageview",{page:document.location.href,title:document.title})})),y.prev_url=f,_=(new Date).getTime();for(h in y.pages_id){if(y.pages_id[h].time+y.page_cache_time>=_)break;delete y.pages_id[h]}document.title=t.title,g=document.getElementById("location_footer"),b=document.getElementById("location_header"),b&&(b.innerHTML=t.location||""),g&&(g.innerHTML=t.location&&t.reklama?t.location:""),v=$("#main_content"),v[0].innerHTML=t.content,$("#page_counters, #index_counters, #coins_gift").empty(),w=$("#coins_gift"),t.coins_gift&&(w[0].innerHTML=t.coins_gift),k=$("#main_page_footer"),E=$("#navi_footer_wrap, #bottom_tools_wrap"),T=$("#sharing_buttons_wrap"),"desktop"==Device.type?t.footer_links?(E.visible(!1),k.length?(T.visible(!0),k.visible(!0)):($("#main_shadow").append(Spaces.templates.mainpageFooter(t.footer_links)),$("#wrap_all").append(Spaces.templates.mainpageShareButtons()),require("sharing_buttons")),S=$("#index_counters")):(T.visible(!1),k.visible(!1),E.visible(!0),S=$("#page_counters")):t.footer_links?(S=$("#index_counters"),E.visible(!1)):(S=$("#page_counters"),E.visible(!0)),t.notifications&&!a&&Spaces.notifications.pushNotifications(t.notifications),t.topCounters&&!a&&(H=t.topCounters,H.compl&&(H.compl.ads&&$("#compl_ads_cnt").text(H.compl.ads),H.compl.forum&&($("#compl_forum_cnt").text(H.compl.forum[0]),$("#compl_forum_cnt_new").text(H.compl.forum[1])),H.compl.files&&($("#compl_files_cnt").text(H.compl.files[0]),$("#compl_files_cnt_new").text(H.compl.files[1]))),Spaces.notifications.updateCounter(Notifications.COUNTER.MAIL,H.mail_new,{blink:!1}).updateCounter(Notifications.COUNTER.LENTA,H.lenta,{blink:!1}).updateCounter(Notifications.COUNTER.JOURNAL,H.journal_imp+H.journal,{important:H.journal_imp>0,blink:!1})),setTimeout(function(){var r,a,o;e.state&&e.state.forms&&(r=e.state.forms),y.pages_id[f]&&y.pages_id[f].forms&&(r=y.pages_id[f].forms),r&&FormState.restore(document.getElementById("main_content"),r),Loader.loadScripts(v.find("script").toArray()),S&&S.length&&(S[0].innerHTML=t.counters,Loader.loadScripts(S.find("script").toArray(),function(){})),a=$("#page_ads"),t.reklama?(a[0].innerHTML=t.reklama,Loader.loadScripts(a.find("script").toArray(),function(){})):a[0].innerHTML="",o=$("#sharings"),t.shareButtons?(o[0].innerHTML=t.shareButtons,Loader.loadScripts(o.find("script").toArray(),function(){})):o[0].innerHTML="",t.copy_link_id&&$("#bottom_tools_wrap, #navi_footer_wrap, #header_elements, #page_sidebar").find("a").each(function(){this.href=this.href.replace(/(link_id=)(d+)/gi,"$1"+t.copy_link_id)}),$("#copy_url").visible(!!t.copy_link_show),!e.scroll||e.state&&e.state.scroll||y.scrollDocument(d),u()},0),e.state&&e.state.scroll&&y.scrollDocument(e.state.scroll),(Spaces.setTimeout!=window.setTimeout||Spaces.setInterval!=window.setInterval)&&(window.setTimeout=Spaces.setTimeout,window.setInterval=Spaces.setInterval,Spaces.showError("<b>Внимание!</b><br />У вас установлено вредоносное расширение, которое может создавать проблемы с загрузкой страниц. <br />Так же, возможно, все ваши переходы фиксируются и отправляются на сервер злоумышленников. <br />Перейдите в список расширений своего браузера и отключайте поочерёдно, пока эта ошибка не перестанет появляться. ","malware"))},"firefox"==Device.browser&&"mobile"==Device["class"]&&(g=h,h=function(t){!e.scroll||e.state&&e.state.scroll||y.scrollDocument(),setTimeout(function(){g(t)},0)}),y._trigger("requeststart"),Spaces.clearError("ajax_error"),y._profiller.req_start=(new Date).getTime(),this.opts.loading_indicator&&y.showLoading(),this.opts.iframe_transport?(a.path="/xhr"+page_id+a.path,IFrameXHR.setCallbacks({success:h,error:function(t){u(),y._trigger("requestend"),y.scrollDocument(),y.showLoadingError(Spaces.getHttpError(t?-500:0),e)},always:function(){}}),l?IFrameXHR.post(a.url(!0),l):IFrameXHR.get(a.url(!0)),!0):(a.path="/ajax"+page_id+a.path,this._last_xhr_request&&4!=this._last_xhr_request.readyState&&(this._last_xhr_request.__manual_abort=!0,this._last_xhr_request.abort()),this._last_xhr_request=$.ajax({url:a.url(!0),processData:!1,data:Url.buildQuery(l),method:l?"POST":"GET",dataType:"json",cache:!0}).success(h).fail(function(t){u(),y._trigger("requestend"),t.__manual_abort||(console.error("ajax error",t),y.scrollDocument(),y.showLoadingError(Spaces.getHttpError(200==t.status?502:t.status),e))}).always(function(){y._last_xhr_request=null}),!0)))},setJSC:function(e,t,r){var a=new Url(location.href),o=location.hash.substr(1);e?(a.hash=e+"/"+t,HistoryManager[r?"replaceState":"pushState"](null,null,a.url())):o.match(/^([^/]+)/?(.*?)$/i)&&(a.hash="",HistoryManager.replaceState(null,null,a.url()))},_proccessInternalCb:function(e,t){var r,a=(new Url(location.href),this);e&&(!(r=e.match(/^([^/]+)/?(.*?)$/i))||t&&t!=r[1]||a._trigger("js_cb_"+r[1],[r[2]]))},_onBreakVersion:function(){Spaces.showError("Доступна новая версия Spaces. Для продолжения корректной работы необходимо <a href='' onclick='location.reload(); return false'>перезагрузите страницу</a>!","error",{silent:!1}),this.is_break_version=!0},showLoadingError:function(e,t){var r=this,a=Spaces.showError(e,"ajax_error");a.append(document.createTextNode(" ")).append($('<input type="button" id="repeat_link" value="Повторить"/>').click(function(e){e.preventDefault(),r.loadPage(t)}))},documentAutoScroller:function(e,t,r){var a,o,n,i,s=this,l=$("html, body"),c=$(window),u=(new Date).getTime(),d=0,p="object"!=typeof e&&$.isNumeric(e)?parseInt(e):null;t=t||200,r=r||3e4,o="touchmove.auto_scroller touchstart.auto_scroller keydown.auto_scroller click.auto_scroller MozMousePixelScroll.auto_scroller mousewheel.auto_scroller wheel.auto_scroller scroll.auto_scroller",n=function(e){(!e||e.originalEvent)&&(e&&"scroll"==e.type&&e.originalEvent&&d==c.scrollTop()||(clearInterval(a),a=null,c.off(".auto_scroller")))},i=function(){l.scrollTop(null!==p?p:parseInt(e.offset().top)),d=c.scrollTop(),(new Date).getTime()-u>r&&n()},a=setInterval(i,t),i(),c.on(o,n),s.onRequestStart("auto_scroller",n)},scrollDocument:function(e){var t,r=this,a=parseInt(e);if(isNaN(a)&&e&&("object"==typeof e||e.length>0)){if("string"==typeof e&&"/"==e.substr(0,1))return;try{if(t=$("object"==typeof e?e:"#"+e+', a[name="'+e+'"]'),t.length>0)return void r.documentAutoScroller(t,200,3e4)}catch(o){console.error(""+o)}}"firefox"==Device.browser?($("html, body").scrollTop(a||0),setTimeout(function(){$("html, body").scrollTop(a||0)},15)):$("html, body").scrollTop(a||0)},serializeForm:function(e,t){var r,a,o,n="",i=!0;for(r=0;r<e.elements.length;++r)a=e.elements[r],o=a.type.toLowerCase(),a.name.length&&("radio"!=o&&"checkbox"!=o||a.checked)&&("submit"!=o||a==e.submit_btn)&&(t?void 0!==t[a.name]?(t[a.name]instanceof Array||(t[a.name]=[t[a.name]]),t[a.name].push(a.value)):t[a.name]=a.value:(n+=(i?"":"&")+encodeURIComponent(a.name)+"="+encodeURIComponent(a.value),i&&(i=!1)));return n},updateWidgets:function(e){var t,r,a,o=[],n={},i={};n[Spaces.WidgetsTypes.FOOTER]="navi_footer_wrap",n[Spaces.WidgetsTypes.HEADER]="header_elements",n[Spaces.WidgetsTypes.SIDEBAR]="page_sidebar",i[Spaces.WidgetsTypes.FOOTER]="footer",i[Spaces.WidgetsTypes.HEADER]="header",i[Spaces.WidgetsTypes.SIDEBAR]="sidebar",i[Spaces.WidgetsTypes.CSS]="CSS",void 0!==window.Sidebar&&Sidebar.openFunction("left");for(t in e)console.error("Обновляем: "+i[t]),void 0!==n[t]?(t==Spaces.WidgetsTypes.FOOTER&&Spaces.footer&&Spaces.footer.update(),t==Spaces.WidgetsTypes.HEADER&&Spaces.view.clock(),r=document.getElementById(n[t]),r&&(r.innerHTML=e[t],o.push(r))):t==Spaces.WidgetsTypes.CSS&&(a=$("head"),a.find("link[main_css], style[main_css]").remove(),a.append(e[t]));Loader.loadScripts($(o).find("script").toArray())},updateSettings:function(e){var t,r,a,o,n,i;for(t in e)if(r=e[t],t==Spaces.SettingsTypes.FORM_SUBMIT_KEY)Spaces.params.form_submit_key=r?"ENTER":"CTRL_ENTER";else if(t==Spaces.SettingsTypes.SOUND_NOTIFY_BLOCK)window.play_sound=!r;else if(t==Spaces.SettingsTypes.FONT_SIZE){for(a=$("body"),n=/(^|s)(font-[^s]+)/g,i=[];o=n.exec(document.body.className);)i.push(o[2]);a.removeClass(i.join(" ")).addClass("font-"+r)}},back:function(){return history.back(),!1},showLoading:function(){var e=$("#main_shadow");e.append($('<div id="ajax_loader"></div>').css({top:0,left:e.offset().left,width:e.outerWidth()}))},hideLoading:function(){$("#main_shadow").find('[id="ajax_loader"]').remove()},one:function(e,t){return this.on(e,"__signle__",t,!0)},push:function(e,t){return this.on(e,"shd"+ ++this._rnd,t,!1)},onJSC:function(e,t,r){return this.on("js_cb_"+e,"js_cb_"+e,t,r)._proccessInternalCb(location.hash.substr(1),e)},on:function(e,t,r,a){return r?(this.callbacks[e]=this.callbacks[e]||{},this.callbacks[e][t]={func:r,persist:!!a},this):this.off(e,t)},off:function(e,t){return t&&this.callbacks[e]?delete this.callbacks[e][t]:this.callbacks[e]={},this},_trigger:function(e,t){var r,a,o=!1;if(this.callbacks[e]){for(r in this.callbacks[e]){if(a=this.callbacks[e][r],a.func)try{a.func.apply(this,t)===!1&&(o=!0)}catch(n){console.error("Handler ("+e+", "+r+") error:",n.stack?"n"+n.stack:n)}a.func&&a.persist||this.off(e,r)}return!o}}}),/(spaces_js_debug=1|sandbox=)/i.test(document.cookie)&&(window.onerror=function(e,t,r,a){Spaces.notifications&&Spaces.notifications.showNotification(e+" at "+t+":"+r+":"+a,"error",{silent:!0})}),"firefox"==Device.browser&&"desktop"!=Device.type&&($("html").css({overflow:"hidden",height:"100%"}),$("body").css({overflow:"auto",height:"100%"})),HistoryManager.init(),-1==document.cookie.indexOf("sid=")||!history.pushState||/ajaxify=0/i.test(document.cookie)||document.location.pathname.match(/^/(complaints|compl|moders)/i)||(use_iframe_transport="desktop"==Device.type&&"msie"!=Device.browser,/force_ajax_transport=1/i.test(document.cookie)?use_iframe_transport=!1:/force_iframe_transport=1/i.test(document.cookie)&&(use_iframe_transport=!0),page_loader=new PageLoader({iframe_transport:use_iframe_transport,loading_indicator:!use_iframe_transport}),$(function(){(ge("#navi_footer")||ge("#main_page_footer")||ge("#navi"))&&page_loader.setup()}));
?>
Онлайн: 0
Реклама