PageSourceSearch

https://voenchast.ru/bitrix/cache/js/s1/voenchast/page_live_feed_v2/page_live_feed_v2_v1.js?1791018176438918

js voenchast.ru collected 2026-10-09 22:39:02 UTC 438,918 bytes, 3,332 lines download raw bytes

1
2; /* Start:"a:4:{s:4:"full";s:104:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/user_blog/script.min.js?166624702327916";s:6:"source";s:84:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/user_blog/script.js";s:3:"min";s:88:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/user_blog/script.min.js";s:3:"map";s:88:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/user_blog/script.map.js";}"*/
3BX.CLBlock=function(e){this.arData=[];this.arData["Subscription"]=[];this.UTPopup=null;this.createTaskPopup=null;this.entity_type=null;this.entity_id=null;this.event_id=null;this.event_id_fullset=false;this.cb_id=null;this.t_val=null;this.ind=null;this.type=null};BX.CLBlock.prototype.DataParser=function(str){str=str.replace(/^\s+|\s+$/g,"");while(str.length>0&&str.charCodeAt(0)==65279)str=str.substring(1);if(str.length<=0)return false;if(str.substring(0,1)!="{"&&str.substring(0,1)!="["&&str.substring(0,1)!="*")str='"*"';eval("arData = "+str);return arData};function __logFilterShow(){if(BX("bx_sl_filter").style.display=="none"){BX("bx_sl_filter").style.display="block";BX("bx_sl_filter_hidden").style.display="none"}else{BX("bx_sl_filter").style.display="none";BX("bx_sl_filter_hidden").style.display="block"}}if(!window.XMLHttpRequest){var XMLHttpRequest=function(){try{return new ActiveXObject("MSXML3.XMLHTTP")}catch(e){}try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("MSXML2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}var sonetLXmlHttpGet=new XMLHttpRequest;var sonetLXmlHttpSet=new XMLHttpRequest;var LBlock=new BX.CLBlock;function __logOnAjaxInsertToNode(e){var t=false;if(BX("sonet_log_more_container")){nodeTmp1=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="none";nodeTmp2.style.display="inline"}t=BX.pos(BX("sonet_log_more_container"));nodeTmp1Cap=document.body.appendChild(BX.create("div",{style:{position:"absolute",width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:1e3}}))}if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="none";nodeTmp2.style.display="inline"}t=BX.pos(BX("sonet_log_more_container"));nodeTmp2Cap=document.body.appendChild(BX.create("div",{style:{position:"absolute",width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:1e3}}))}BX.unbind(BX("sonet_log_counter_2_container"),"click",__logOnAjaxInsertToNode)}function sonetLClearContainerExternalNew(){logAjaxMode="new"}function sonetLClearContainerExternalMore(){logAjaxMode="more"}function _sonetLClearContainerExternal(e){if(BX("sonet_log_more_container")){nodeTmp1=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="inline";nodeTmp2.style.display="none"}}if(BX("sonet_log_counter_2_wrap")){BX.removeClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim");BX("sonet_log_counter_2_wrap").style.visibility="hidden"}if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);nodeTmp3=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-reload"},false);
3if(nodeTmp1&&nodeTmp2&&nodeTmp3){nodeTmp1.style.display="inline";nodeTmp2.style.display="none";nodeTmp3.style.display="none"}}if(nodeTmp1Cap&&nodeTmp1Cap.parentNode){nodeTmp1Cap.parentNode.removeChild(nodeTmp1Cap)}if(nodeTmp2Cap&&nodeTmp2Cap.parentNode){nodeTmp2Cap.parentNode.removeChild(nodeTmp2Cap)}if(BX("sonet_log_counter_preset")&&logAjaxMode=="new"){BX("sonet_log_counter_preset").style.display="none"}}function __logChangeCounter(e){var t=parseInt(e)<=0;oCounter={iCommentsRead:0};BX.onCustomEvent(window,"onSonetLogChangeCounter",[oCounter]);e-=oCounter.iCommentsRead;__logChangeCounterAnimate(parseInt(e)>0,e,t)}function __logDecrementCounter(e){if(BX("sonet_log_counter_2")){e=parseInt(e);var t=parseInt(BX("sonet_log_counter_2").innerHTML);var n=t-e;if(n>0)BX("sonet_log_counter_2").innerHTML=n;else __logChangeCounterAnimate(false,0)}}function __logChangeCounterAnimate(e,t,n){n=!!n;if(!!window.bLockCounterAnimate){setTimeout(function(){__logChangeCounterAnimate(e,t)},200);return false}e=!!e;if(e){if(BX("sonet_log_counter_2"))BX("sonet_log_counter_2").innerHTML=t;if(BX("sonet_log_counter_2_wrap")){BX("sonet_log_counter_2_wrap").style.visibility="visible";BX.addClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim")}}else if(BX("sonet_log_counter_2_wrap")){if(n&&BX.hasClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim")){if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);nodeTmp3=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-reload"},false);
3if(nodeTmp1&&nodeTmp2&&nodeTmp3){nodeTmp1.style.display="none";nodeTmp2.style.display="none";nodeTmp3.style.display="inline"}}}else setTimeout(function(){BX.removeClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim");BX("sonet_log_counter_2_wrap").style.visibility="hidden"},400)}}function __logChangeCounterArray(e){if(typeof e[BX.message("sonetLCounterType")]!="undefined")__logChangeCounter(e[BX.message("sonetLCounterType")])}function __logShowPostMenu(e,t,n,o,s,a,i,r,l,d){BX.PopupMenu.destroy("post-menu-"+t);var f=null;if(BX.message("sonetLbUseFavorites")!="N"){f={text:l?BX.message("sonetLMenuFavoritesTitleY"):BX.message("sonetLMenuFavoritesTitleN"),className:"menu-popup-no-icon",onclick:function(e){__logChangeFavorites(r,"log_entry_favorites_"+r,l?"N":"Y",true);return BX.PreventDefault(e)}}}var p=[e.getAttribute("data-log-entry-url").length>0?{text:'<span id="post-menu-'+t+'-href-text">'+BX.message("sonetLMenuHref")+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-href",href:e.getAttribute("data-log-entry-url")}:null,e.getAttribute("data-log-entry-url").length>0?{text:'<span id="post-menu-'+t+'-link-text">'+BX.message("sonetLMenuLink")+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-link",onclick:function(){id="post-menu-"+t+"-link",it=BX.proxy_context,height=parseInt(!!it.getAttribute("bx-height")?it.getAttribute("bx-height"):it.offsetHeight);if(it.getAttribute("bx-status")!="shown"){it.setAttribute("bx-status","shown");if(!BX(id)&&!!BX(id+"-text")){var n=BX(id+"-text"),o=BX.pos(n),s=BX.pos(n.parentNode);pos3=BX.pos(BX.findParent(n,{className:"menu-popup-item"},true));o["height"]=s["height"]-1;BX.adjust(it,{attrs:{"bx-height":it.offsetHeight},style:{overflow:"hidden",display:"block"},children:[BX.create("BR"),BX.create("DIV",{attrs:{id:id},children:[BX.create("SPAN",{attrs:{className:"menu-popup-item-left"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-icon"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-text"},children:[BX.create("INPUT",{attrs:{id:id+"-input",type:"text",value:e.getAttribute("data-log-entry-url")},style:{height:o["height"]+"px",width:pos3["width"]-21+"px"},events:{click:function(e){this.select();BX.PreventDefault(e)}}})]})]}),BX.create("SPAN",{className:"menu-popup-item-right"})]})}new BX.fx({time:.2,step:.05,type:"linear",start:height,finish:height*2,callback:BX.delegate(function(e){this.style.height=e+"px"},it)}).start();BX.fx.show(BX(id),.2);BX(id+"-input").select()}else{it.setAttribute("bx-status","hidden");new BX.fx({time:.2,step:.05,type:"linear",start:it.offsetHeight,finish:height,callback:BX.delegate(function(e){this.style.height=e+"px"},it)}).start();BX.fx.hide(BX(id),.2)}}}:null,f,BX.message("sonetLCanDelete")=="Y"?{text:BX.message("sonetLMenuDelete"),className:"menu-popup-no-icon",onclick:function(e){if(confirm(BX.message("sonetLMenuDeleteConfirm"))){__logDelete(r,"log-entry-"+r,t)}return BX.PreventDefault(e)}}:null];if(!!d&&BX.type.isArray(d)){for(var c=0;c<d.length;c++)if(typeof d[c].className=="undefined")d[c].className="menu-popup-no-icon";p=BX.util.array_merge(p,d)}var u={offsetLeft:-14,offsetTop:4,lightShadow:false,angle:{position:"top",offset:50},events:{onPopupShow:function(e){if(BX("log_entry_favorites_"+r)){var n=BX.findChildren(e.contentContainer,{className:"menu-popup-item-text"},true);if(n!=null){for(var o=0;o<n.length;o++){if(n[o].innerHTML==BX.message("sonetLMenuFavoritesTitleY")||n[o].innerHTML==BX.message("sonetLMenuFavoritesTitleN")){var s=n[o];break}}}if(s!=undefined){if(BX.hasClass(BX("log_entry_favorites_"+r),"feed-post-important-switch-active"))BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY");else BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}if(BX("post-menu-"+t+"-link")){var a=BX.findChild(e.popupContainer,{className:"feed-entry-popup-menu-link"},true,false);if(a){var i=parseInt(!!a.getAttribute("bx-height")?a.getAttribute("bx-height"):0);if(i>0){BX("post-menu-"+t+"-link").style.display="none";a.setAttribute("bx-status","hidden");a.style.height=i+"px"}}}}}};BX.PopupMenu.show("post-menu-"+t,e,p,u)}
3function __logCommentFormAutogrow(e){var t=0;if(e&&BX.type.isDomNode(e))var n=e;else{var n=BX.proxy_context;var o=e||window.event;if((o.keyCode==13||o.keyCode==10)&&o.ctrlKey)__logCommentAdd()}var s=BX.findParent(n,{className:"sonet-log-comment-form-place"});if(BX(s))t=BX(s).offsetHeight;var a=0;var i=n.value.split("\n");for(var r=i.length-1;r>=0;--r)a+=Math.floor(i[r].length/CommentFormColsDefault+1);if(a>=CommentFormRowsDefault)n.rows=a+1;else n.rows=CommentFormRowsDefault}function __logGetNextPage(e,t,n){if(oLF.bLoadStarted){return false}oLF.bLoadStarted=true;window.bLockCounterAnimate=true;t=!!t;if(!t&&BX("feed-new-message-inf-wrap")){BX("feed-new-message-inf-wrap").classList.toggle("feed-new-message-anim")}var o={method:"GET",url:e};BX.onCustomEvent("SonetLogBeforeGetNextPage",[o]);if(BX.type.isNotEmptyString(o.url)){e=o.url}BX.ajax({url:e,method:"GET",dataType:"json",data:{},onsuccess:function(e){oLF.bLoadStarted=false;if(!t&&typeof n!="undefined"&&n&&n.parentNode){BX.cleanNode(n.parentNode,true)}window.bLockCounterAnimate=false;if(typeof e!="undefined"&&typeof e.PROPS!="undefined"&&typeof e.PROPS.CONTENT!="undefined"&&e.PROPS.CONTENT.length>0&&(typeof e.LAST_TS=="undefined"||parseInt(e.LAST_TS)<=0||parseInt(BX.message("sonetLFirstPageLastTS"))<=0||parseInt(e.LAST_TS)<parseInt(BX.message("sonetLFirstPageLastTS")))){var o="content_block_"+Math.floor(Math.random()*1e3);oLF.processAjaxBlock(e.PROPS,o,t);_sonetLClearContainerExternal(false);if(t){BX("feed-new-message-inf-wrap-first").style.display="block";var s=function(){if(BX(o)){BX(o).style.display="block"}BX.unbind(BX("sonet_log_more_container_first"),"click",s);BX("feed-new-message-inf-wrap-first").style.display="none";__logRecalcMoreButton()};BX.bind(BX("sonet_log_more_container_first"),"click",s)}else{setTimeout(function(){__logRecalcMoreButton()},1e3)}}},onfailure:function(e){oLF.bLoadStarted=false;if(!t&&BX("feed-new-message-inf-wrap")){BX("feed-new-message-inf-wrap").classList.toggle("feed-new-message-anim")}window.bLockCounterAnimate=false;_sonetLClearContainerExternal(false)}});return false}function __logGetNextPageLinkEntities(e,t){if(!!window.__logGetNextPageFormName&&!!e&&!!t&&!!window["UC"]&&!!window["UC"][window.__logGetNextPageFormName]&&!!window["UC"][window.__logGetNextPageFormName].linkEntity){window["UC"][window.__logGetNextPageFormName].linkEntity(e);for(var n in t){if(!!n&&!!t[n])window["UC"][window.__logGetNextPageFormName]["entitiesCorrespondence"][n]=t[n]}}}function __logRefresh(e){if(oLF.bLoadStarted){return}var t=BX("sonet_log_counter_2_wrap",true);oLF.bLoadStarted=true;if(t){var n=BX.findChild(t,{tag:"span",className:"feed-new-message-inf-text-reload"},true);if(n){n.style.display="none"}}window.bLockCounterAnimate=true;BX.ajax({url:e,method:"GET",dataType:"json",data:{},onsuccess:function(e){oLF.bLoadStarted=false;if(typeof e!="undefined"&&typeof e.PROPS!="undefined"&&typeof e.PROPS.CONTENT!="undefined"&&e.PROPS.CONTENT.length>0){window.bLockCounterAnimate=false;BX.cleanNode("log_internal_container",false);oLF.processAjaxBlock(e.PROPS);_sonetLClearContainerExternal(false);window.bStopTrackNextPage=false;if(BX("feed-new-message-inf-wrap-first")){BX("feed-new-message-inf-wrap-first").style.display="none"}if(typeof arCommentsMoreButtonID!="undefined"){arCommentsMoreButtonID=[]}if(t&&BX.hasClass(t,"feed-new-message-informer-fixed")){var n=BX("feed-up-btn-wrap",true);if(n){n.style.display="none";BX.removeClass(n,"feed-up-btn-wrap-anim")}var o=BX.GetWindowScrollPos();new BX.easing({duration:500,start:{scroll:o.scrollTop},finish:{scroll:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){window.scrollTo(0,e.scroll)},complete:function(){if(n)n.style.display="block";BX.onCustomEvent(window,"onGoUp")}}).animate()}}else{oLF.showRefreshError()}},onfailure:function(e){oLF.bLoadStarted=false;oLF.showRefreshError()}});return false}function __logChangeFavorites(e,t,n,o){if(!e||!BX(t)){return}if(!!o){var s=BX.proxy_context;if(!BX.hasClass(BX(s),"menu-popup-item-text")){s=BX.findChild(BX(s),{className:"menu-popup-item-text"},true)}}var a=BX.hasClass(BX(t),"feed-post-important-switch")?BX(t):BX.findChild(BX(t),{className:"feed-post-important-switch"});if(n!=undefined){if(n=="Y"){BX.addClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleY");
3if(typeof s!="undefined"){BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY")}}else{BX.removeClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleN");if(typeof s!="undefined"){BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}}var i=new XMLHttpRequest;i.open("POST",BX.message("sonetLESetPath"),true);i.setRequestHeader("Content-Type","application/x-www-form-urlencoded");i.onreadystatechange=function(){if(i.readyState==4){if(i.status==200){var e=LBlock.DataParser(i.responseText);if(typeof e=="object"){if(e[0]=="*"){if(sonetLErrorDiv!=null){sonetLErrorDiv.style.display="block";sonetLErrorDiv.innerHTML=i.responseText}return}i.abort();var t="";if(e["bResult"]!=undefined&&(e["bResult"]=="Y"||e["bResult"]=="N")){if(e["bResult"]=="Y"){BX.addClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleY");if(s!=undefined)BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY")}else{BX.removeClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleN");if(s!=undefined)BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}}}else{}}};i.send("r="+Math.floor(Math.random()*1e3)+"&"+BX.message("sonetLSessid")+"&site="+BX.util.urlencode(BX.message("sonetLSiteId"))+"&log_id="+encodeURIComponent(e)+"&action=change_favorites")}function __logDelete(e,t,n){if(!e){return}if(!BX(t)){return}BX.ajax({url:BX.message("sonetLESetPath"),method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),site:BX.message("sonetLSiteId"),log_id:e,action:"delete"},onsuccess:function(e){if(e.bResult!=undefined&&e.bResult=="Y"){if(typeof n!="undefined"){BX.PopupMenu.destroy("post-menu-"+n)}__logDeleteSuccess(BX(t))}else{__logDeleteFailure(BX(t))}},onfailure:function(e){__logDeleteFailure(BX(t))}})}function __logDeleteSuccess(e){if(typeof e=="undefined"||!e||!BX(e)){return}new BX.fx({time:.5,step:.05,type:"linear",start:BX(e).offsetHeight,finish:60,callback:BX.delegate(function(e){this.style.height=e+"px"},BX(e)),callback_start:BX.delegate(function(){this.style.overflow="hidden";this.style.minHeight=0},BX(e)),callback_complete:BX.delegate(function(){this.style.marginBottom=0;BX.cleanNode(this);this.appendChild(BX.create("DIV",{props:{className:"feed-add-successfully"},style:{marginLeft:"17px",marginRight:"17px",marginTop:"10px"},children:[BX.create("span",{props:{className:"feed-add-info-text"},children:[BX.create("span",{props:{className:"feed-add-info-icon"}}),BX.create("span",{html:BX.message("sonetLMenuDeleteSuccess")})]})]}))},BX(e))}).start()}function __logDeleteFailure(e){if(typeof e=="undefined"||!e||!BX(e)){return}e.insertBefore(BX.create("DIV",{props:{className:"feed-add-error"},style:{marginLeft:"84px",marginRight:"37px",marginTop:"18px",marginBottom:"4px"},children:[BX.create("span",{props:{className:"feed-add-info-text"},children:[BX.create("span",{props:{className:"feed-add-info-icon"}}),BX.create("span",{html:BX.message("sonetLMenuDeleteFailure")})]})]}),e.firstChild)}function __logOnFeedScroll(){if(window.feedScrollLock==undefined||window.feedScrollLock===false){window.feedScrollLock=true;setTimeout(function(){window.feedScrollLock=false},100);var e=BX.GetWindowSize();if(window.bStopTrackNextPage===undefined||window.bStopTrackNextPage==false){var t=parseInt(e.scrollHeight/2);if(e.scrollHeight-e.innerHeight<t){t=1}if(e.scrollTop>=t&&next_url){window.bStopTrackNextPage=true;__logGetNextPage(next_url,true)}}}var n=BX("sonet_log_counter_2_wrap",true);if(n){var o=n.parentNode.getBoundingClientRect().top;if(o<=0){BX.addClass(n,"feed-new-message-informer-fixed");setTimeout(function(){if(BX.hasClass(n,"feed-new-message-informer-fixed")){BX.addClass(n,"feed-new-message-informer-fix-anim")}},100)}else{BX.removeClass(n,"feed-new-message-informer-fixed feed-new-message-informer-fix-anim")}}}function __logScrollInit(e){if(!!e){BX.unbind(window,"scroll",__logOnFeedScroll);BX.bind(window,"scroll",__logOnFeedScroll)}else{BX.unbind(window,"scroll",__logOnFeedScroll)}}function __logRecalcMoreButton(){if(typeof arMoreButtonID!="undefined"){var e=false;var t=false;var n=false;var o=false;for(var s=0;s<arMoreButtonID.length;s++){e=BX.pos(BX(arMoreButtonID[s].bodyBlockID));if(e.height<280){BX(arMoreButtonID[s].moreButtonBlockID).style.display="none"}if(typeof arMoreButtonID[s].outerBlockID!="undefined"){n=BX(arMoreButtonID[s].outerBlockID);if(n){t=BX.pos(n);if(t.width<e.width){o=BX.findChild(n,{tag:"div",className:"feed-post-text-block-inner"},false);o.style.overflowX="scroll"}}}}}if(typeof arCommentsMoreButtonID!="undefined"){var e=false;for(var s=0;s<arCommentsMoreButtonID.length;s++){e=BX.pos(BX(arCommentsMoreButtonID[s].bodyBlockID));if(e.height<200){BX(arCommentsMoreButtonID[s].moreButtonBlockID).style.display="none"}}}}window.__socOnUCFormClear=function(e){LHEPostForm.reinitDataBefore(e.editorId)};window.__socOnUCFormAfterShow=function(e,t,n){n=!!n?n:{};var o=e.entitiesCorrespondence[e.id.join("-")][0],s=e.entitiesCorrespondence[e.id.join("-")][1];BX.show(BX("feed_comments_block_"+o));BX.onCustomEvent(window,"OnBeforeSocialnetworkCommentShowedUp",["socialnetwork"]);e.form.action=e.url.replace(/\#eId\#/,o).replace(/\#id\#/,s);var a={ENTITY_XML_ID:e.id[0],ENTITY_TYPE:e.entitiesId[e.id[0]][0],ENTITY_ID:e.entitiesId[e.id[0]][1],parentId:e.id[1],comment_post_id:e.entitiesId[e.id[0]][1],edit_id:e.id[1],act:e.id[1]>0?"edit":"add",logId:e.entitiesId[e.id[0]][2]};for(var i in a){if(!e.form[i]){e.form.appendChild(BX.create("INPUT",{attrs:{name:i,type:"hidden"}}))}e.form[i].value=a[i]}__socOnLightEditorShow(t,n)};window.__socOnUCFormSubmit=function(e,t){t["r"]=Math.floor(Math.random()*1e3);t["sessid"]=BX.bitrix_sessid();t["log_id"]=e.entitiesCorrespondence[e.id.join("-")][0];t["p_smile"]=BX.message("sonetLPathToSmile");t["p_ubp"]=BX.message("sonetLPathToUserBlogPost");t["p_gbp"]=BX.message("sonetLPathToGroupBlogPost");t["p_umbp"]=BX.message("sonetLPathToUserMicroblogPost");t["p_gmbp"]=BX.message("sonetLPathToGroupMicroblogPost");t["p_user"]=BX.message("sonetLPathToUser");t["p_le"]=BX.message("sonetLEPath");t["f_id"]=BX.message("sonetLForumID");t["bapc"]=BX.message("sonetLBlogAllowPostCode");t["site"]=BX.message("sonetLSiteId");t["lang"]=BX.message("sonetLLangId");t["nt"]=BX.message("sonetLNameTemplate");t["sl"]=BX.message("sonetLShowLogin");t["as"]=BX.message("sonetLAvatarSizeComment");t["dtf"]=BX.message("sonetLDateTimeFormat");t["message"]=t["REVIEW_TEXT"];t["action"]="add_comment";t["RATING_TYPE"]=BX.message("sonetRatingType");t["pull"]="Y";t["crm"]=BX.message("sonetLIsCRM");e.form["bx-action"]=e.form.action;e.form.action=BX.message("sonetLESetPath")};window.__socOnUCFormResponse=function(e,t){e.form.action=e.form["bx-action"];var n={errorMessage:t},o=e.entitiesCorrespondence[e.id.join("-")][0],s={};if(!(!!t&&typeof t=="object")){}else if(t[0]=="*"){n={errorMessage:BX.message("sonetLErrorSessid")}}else{if(!(t["commentID"]>0)||!!t["strMessage"])n["errorMessage"]=t["strMessage"];else if(t["return_data"])n=t["return_data"];
3else{var a=t["arCommentFormatted"],i=t["arComment"],r=!!window["__logBuildRating"]?window["__logBuildRating"](t["arComment"],t["arCommentFormatted"]):null,l=!!i["SOURCE_ID"]?i["SOURCE_ID"]:i["ID"],s={ID:l,ENTITY_XML_ID:e.id[0],FULL_ID:[e.id[0],l],NEW:"N",APPROVED:"Y",POST_TIMESTAMP:t["timestamp"]-BX.message("USER_TZ_OFFSET"),POST_TIME:a["LOG_TIME_FORMAT"],POST_DATE:a["LOG_TIME_FORMAT"],"~POST_MESSAGE_TEXT":a["MESSAGE"],POST_MESSAGE_TEXT:a["MESSAGE_FORMAT"],PANELS:{MODERATE:false},URL:{LINK:i["URL"]&&i["URL"].length>0?i["URL"]:BX.message("sonetLEPath").replace("#log_id#",i["LOG_ID"])+"?commentId="+i["ID"]+"#com"+(parseInt(i["SOURCE_ID"])>0?i["SOURCE_ID"]:i["ID"])},AUTHOR:{ID:a["USER_ID"],NAME:a["CREATED_BY"]["FORMATTED"],URL:a["CREATED_BY"]["URL"],AVATAR:a["AVATAR_SRC"]},BEFORE_ACTIONS:!!r?r:"",AFTER:a["UF"]};if(typeof t["hasEditCallback"]!="undefined"&&t["hasEditCallback"]=="Y"){s["PANELS"]["EDIT"]="Y";s["URL"]["EDIT"]="__logEditComment('"+e.id[0]+"', '"+i["ID"]+"', '"+i["LOG_ID"]+"');"}if(typeof t["hasDeleteCallback"]!="undefined"&&t["hasDeleteCallback"]=="Y"){s["PANELS"]["DELETE"]="Y";s["URL"]["DELETE"]=BX.message("sonetLESetPath")+"?lang="+BX.message("sonetLLangId")+"&action=delete_comment&delete_comment_id="+i["ID"]+"&post_id="+i["LOG_ID"]+"&site="+BX.message("sonetLSiteId")}n={errorMessage:"",okMessage:"",status:true,message:"",messageCode:a["MESSAGE"],messageId:[e.id[0],l],"~message":"",messageFields:s}}var d=BX("log_entry_follow_"+o,true),f=!!d?d.getAttribute("data-follow")=="Y"?"Y":"N":false;if(f=="N"){BX.findChild(d,{tagName:"a"}).innerHTML=BX.message("sonetLFollowY");d.setAttribute("data-follow","Y")}var d=BX("feed-comments-all-cnt-"+o,true),p=!!d?d.innerHTML.length>0?parseInt(d.innerHTML):0:false;if(p!==false)d.innerHTML=p+1}e.OnUCFormResponseData=n};window.__socOnLightEditorShow=function(e,t){var n={};if(t["arFiles"]){var o={},s,a;for(var i=0;i<t["arFiles"].length;i++){s=BX.findChild(BX("wdif-doc-"+t["arFiles"][i]),{className:"feed-com-file-name"},true);a=BX.findChild(BX("wdif-doc-"+t["arFiles"][i]),{className:"feed-con-file-size"},true);o["F"+i]={FILE_ID:t["arFiles"][i],FILE_NAME:s?s.innerHTML:"noname",FILE_SIZE:a?a.innerHTML:"unknown",CONTENT_TYPE:"notimage/xyz"}}n["UF_SONET_COM_DOC"]={USER_TYPE_ID:"file",FIELD_NAME:"UF_SONET_COM_FILE[]",VALUE:o}}if(t["arDocs"])n["UF_SONET_COM_FILE"]={USER_TYPE_ID:"webdav_element",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:BX.clone(t["arDocs"])};if(t["arDFiles"])n["UF_SONET_COM_FILE"]={USER_TYPE_ID:"disk_file",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:BX.clone(t["arDFiles"])};LHEPostForm.reinitData(SLEC.editorId,e,n)};BitrixLF=function(){this.bLoadStarted=false};BitrixLF.prototype.showRefreshError=function(){window.bLockCounterAnimate=false;_sonetLClearContainerExternal(false)};BitrixLF.prototype.LazyLoadCheckVisibility=function(e){var t=e.node;var n="comment";var o=BX.findParent(t,{className:"feed-com-text"});if(!o){n="post";o=BX.findParent(t,{className:"feed-post-text-block"})}if(o){var s=BX.findChild(o,{tag:"div",className:"feed-post-text-more"},false);if(s&&s.style.display!="none"){return t.parentNode.parentNode.offsetTop<(n=="comment"?220:270)}}return true};BitrixLF.prototype.processAjaxBlock=function(e,t,n){if(!e){return}if(!t){t="content_block_"+Math.floor(Math.random()*1e3)}n=!!n;var o=false;var s=false;a(i);r(l);function a(t){if(BX.type.isArray(e.CSS)&&e.CSS.length>0){BX.load(e.CSS,t)}else{t()}}function i(){BX("log_internal_container").appendChild(BX.create("DIV",{props:{id:t,className:"feed-wrap"},style:{display:n?"none":"block"},html:e.CONTENT}));o=true;if(s){l()}}function r(t){if(BX.type.isArray(e.JS)&&e.JS.length>0){BX.load(e.JS,t)}else{t()}}function l(){s=true;if(o){BX.ajax.processRequestData(e.CONTENT,{scriptsRunFirst:false,dataType:"HTML"})}}};BitrixLF.prototype.createTask=function(e){this.createTaskPopup=new BX.PopupWindow("BXCTP",null,{autoHide:false,zIndex:0,offsetLeft:0,offsetTop:0,overlay:false,lightShadow:true,closeIcon:{right:"12px",to
3p:"10px"},draggable:{restrict:true},closeByEsc:false,contentColor:"white",contentNoPaddings:true,buttons:[],content:BX.create("DIV",{attrs:{id:"BXCTP_content"},props:{className:"feed-create-task-popup-content"}}),events:{onAfterPopupShow:BX.proxy(function(){oLF.createTaskSetContent(BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskWait")}));BX.ajax({url:"/bitrix/components/bitrix/socialnetwork.log.ex/ajax.php",method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),ENTITY_TYPE:e.entityType,ENTITY_ID:e.entityId,action:"get_raw_data"},onsuccess:BX.proxy(function(t){if(typeof t.TITLE!="undefined"&&typeof t.DESCRIPTION!="undefined"&&typeof t.DISK_OBJECTS!="undefined"&&t.TITLE.length>0&&t.DESCRIPTION.length>0){BX.Tasks.Util.Query.runOnce("task.add",{data:{TITLE:t.TITLE,DESCRIPTION:t.DESCRIPTION,RESPONSIBLE_ID:BX.message("USER_ID"),CREATED_BY:BX.message("USER_ID"),UF_TASK_WEBDAV_FILES:t.DISK_OBJECTS}}).then(BX.proxy(function(t){var n=t.getData();if(typeof n!="undefined"&&typeof n.DATA!="undefined"&&typeof n.DATA.ID!="undefined"&&parseInt(n.DATA.ID)>0){oLF.createTaskSetContentSuccess(n.DATA.ID);BX.ajax({url:"/bitrix/components/bitrix/socialnetwork.log.ex/ajax.php",method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),ENTITY_TYPE:e.entityType,ENTITY_ID:e.entityId,TASK_ID:n.DATA.ID,action:"create_task_comment"}})}else{oLF.createTaskSetContentFailure(t.getErrors().getMessages())}},this))}else{oLF.createTaskSetContentFailure([BX.message("sonetLFCreateTaskErrorGetData")])}},this),onfailure:function(e){oLF.createTaskSetContentFailure([BX.message("sonetLFCreateTaskErrorGetData")])}})},this),onPopupClose:BX.proxy(function(){this.createTaskPopup.destroy()},this)}});this.createTaskPopup.params.zIndex=BX.WindowManager?BX.WindowManager.GetZIndex():0;this.createTaskPopup.show()};BitrixLF.prototype.createTaskSetContentSuccess=function(e){oLF.createTaskSetContent(BX.create("DIV",{children:[BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskSuccessTitle")}),BX.create("DIV",{props:{className:"feed-create-task-popup-description"},html:BX.message("sonetLFCreateTaskSuccessDescription")})]}));this.createTaskPopup.setButtons([new BX.PopupWindowButton({text:BX.message("sonetLFCreateTaskButtonTitle"),events:{click:BX.proxy(function(){this.createTaskPopup.destroy();window.open(BX.message("sonetLFCreateTaskTaskPath").replace("#user_id#",BX.message("USER_ID")).replace("#task_id#",e),"_blank")},this)}})])};BitrixLF.prototype.createTaskSetContentFailure=function(e){oLF.createTaskSetContent(BX.create("DIV",{children:[BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskFailureTitle")}),BX.create("DIV",{props:{className:"feed-create-task-popup-description"},html:e.join("<br>")})]}))};BitrixLF.prototype.createTaskSetContent=function(e){if(BX("BXCTP_content")){var t=BX("BXCTP_content");BX.cleanNode(t);t.appendChild(e)}};oLF=new BitrixLF;window.oLF=oLF;
4/* End */
5;
6; /* Start:"a:4:{s:4:"full";s:93:"/bitrix/components/bitrix/socialnetwork.admin.set/templates/.default/script.js?16662470722527";s:6:"source";s:78:"/bitrix/components/bitrix/socialnetwork.admin.set/templates/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
7var waitDiv = null;
8var waitPopup = null;
9var waitTimeout = null;
10var waitTime = 500;
11
12function __SASSetAdmin()
13{
14	__SASShowWait();
15	BX.ajax({
16		url: '/bitrix/components/bitrix/socialnetwork.admin.set/ajax.php',
17		method: 'POST',
18		dataType: 'json',
19		data: {'ACTION': 'SET', 'sessid': BX.bitrix_sessid(), 'site': BX.util.urlencode(BX.message('SASSiteId'))},
20		onsuccess: function(data) { __SASProcessAJAXResponse(data); }
21	});
22}
23
24function __SASProcessAJAXResponse(data)
25{
26	if (data["SUCCESS"] != "undefined" && data["SUCCESS"] == "Y")
27	{
28		BX.reload();
29		return false;
30	}
31	else if (data["ERROR"] != "undefined" && data["ERROR"].length > 0)
32	{
33		if (data["ERROR"].indexOf("SESSION_ERROR", 0) === 0)
34		{
35			__SASShowError(BX.message('SASErrorSessionWrong'));
36			BX.reload();
37		}
38		else if (data["ERROR"].indexOf("CURRENT_USER_NOT_ADMIN", 0) === 0)
39		{
40			__SASShowError(BX.message('SASErrorNotAdmin'));
41			return false;
42		}
43		else if (data["ERROR"].indexOf("CURRENT_USER_NOT_AUTH", 0) === 0)
44		{
45			__SASShowError(BX.message('SASErrorCurrentUserNotAuthorized'));
46			return false;
47		}
48		else if (data["ERROR"].indexOf("SONET_MODULE_NOT_INSTALLED", 0) === 0)
49		{
50			__SASShowError(BX.message('SASErrorModuleNotInstalled'));
51			return false;
52		}
53		else
54		{
55			__SASShowError(data["ERROR"]);
56			return false;		
57		}
58	}
59}
60				
61function __SASShowError(errorText) 
62{
63	__SASCloseWait();
64
65	var errorPopup = new BX.PopupWindow('sas-error' + Math.random(), window, {
66		autoHide: true,
67		lightShadow: false,
68		zIndex: 2,
69		content: BX.create('DIV', {props: {'className': 'sonet-adminset-error-text-block'}, html: errorText}),
70		closeByEsc: true,
71		closeIcon: true
72	});
73	errorPopup.show();
74
75}
76
77function __SASShowWait(timeout)
78{
79	if (timeout !== 0)
80	{
81		return (waitTimeout = setTimeout(function(){
82			__SASShowWait(0)
83		}, 50));
84	}
85
86	if (!waitPopup)
87	{
88		waitPopup = new BX.PopupWindow('sas_wait', window, {
89			autoHide: true,
90			lightShadow: true,
91			zIndex: 2,
92			content: BX.create('DIV', {
93				props: {
94					className: 'sonet-adminset-wait-cont'
95				},
96				children: [
97					BX.create('DIV', {
98						props: {
99							className: 'sonet-adminset-wait-icon'
100						}
101					}),
102					BX.create('DIV', {
103						props: {
104							className: 'sonet-adminset-wait-text'
105						},
106						html: BX.message('SASWaitTitle')
107					})
108				]
109			})
110		});
111	}
112	else
113		waitPopup.setBindElement(window);
114
115	waitPopup.show();
116}
117
118function __SASCloseWait()
119{
120	if (waitTimeout)
121	{
122		clearTimeout(waitTimeout);
123		waitTimeout = null;
124	}
125
126	if (waitPopup)
127		waitPopup.close();
128}
129/* End */
130;
131; /* Start:"a:4:{s:4:"full";s:104:"/local/templates/voenchast/components/bitrix/socialnetwork.log.ex/.default/script.min.js?166624702427916";s:6:"source";s:84:"/local/templates/voenchast/components/bitrix/socialnetwork.log.ex/.default/script.js";s:3:"min";s:88:"/local/templates/voenchast/components/bitrix/socialnetwork.log.ex/.default/script.min.js";s:3:"map";s:88:"/local/templates/voenchast/components/bitrix/socialnetwork.log.ex/.default/script.map.js";}"*/
132BX.CLBlock=function(e){this.arData=[];this.arData["Subscription"]=[];this.UTPopup=null;this.createTaskPopup=null;this.entity_type=null;this.entity_id=null;this.event_id=null;this.event_id_fullset=false;this.cb_id=null;this.t_val=null;this.ind=null;this.type=null};BX.CLBlock.prototype.DataParser=function(str){str=str.replace(/^\s+|\s+$/g,"");while(str.length>0&&str.charCodeAt(0)==65279)str=str.substring(1);if(str.length<=0)return false;if(str.substring(0,1)!="{"&&str.substring(0,1)!="["&&str.substring(0,1)!="*")str='"*"';eval("arData = "+str);return arData};function __logFilterShow(){if(BX("bx_sl_filter").style.display=="none"){BX("bx_sl_filter").style.display="block";BX("bx_sl_filter_hidden").style.display="none"}else{BX("bx_sl_filter").style.display="none";BX("bx_sl_filter_hidden").style.display="block"}}if(!window.XMLHttpRequest){var XMLHttpRequest=function(){try{return new ActiveXObject("MSXML3.XMLHTTP")}catch(e){}try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("MSXML2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}var sonetLXmlHttpGet=new XMLHttpRequest;var sonetLXmlHttpSet=new XMLHttpRequest;var LBlock=new BX.CLBlock;function __logOnAjaxInsertToNode(e){var t=false;if(BX("sonet_log_more_container")){nodeTmp1=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="none";nodeTmp2.style.display="inline"}t=BX.pos(BX("sonet_log_more_container"));nodeTmp1Cap=document.body.appendChild(BX.create("div",{style:{position:"absolute",width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:1e3}}))}if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);
132if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="none";nodeTmp2.style.display="inline"}t=BX.pos(BX("sonet_log_more_container"));nodeTmp2Cap=document.body.appendChild(BX.create("div",{style:{position:"absolute",width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:1e3}}))}BX.unbind(BX("sonet_log_counter_2_container"),"click",__logOnAjaxInsertToNode)}function sonetLClearContainerExternalNew(){logAjaxMode="new"}function sonetLClearContainerExternalMore(){logAjaxMode="more"}function _sonetLClearContainerExternal(e){if(BX("sonet_log_more_container")){nodeTmp1=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="inline";nodeTmp2.style.display="none"}}if(BX("sonet_log_counter_2_wrap")){BX.removeClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim");BX("sonet_log_counter_2_wrap").style.visibility="hidden"}if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);nodeTmp3=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-reload"},false);
132if(nodeTmp1&&nodeTmp2&&nodeTmp3){nodeTmp1.style.display="inline";nodeTmp2.style.display="none";nodeTmp3.style.display="none"}}if(nodeTmp1Cap&&nodeTmp1Cap.parentNode){nodeTmp1Cap.parentNode.removeChild(nodeTmp1Cap)}if(nodeTmp2Cap&&nodeTmp2Cap.parentNode){nodeTmp2Cap.parentNode.removeChild(nodeTmp2Cap)}if(BX("sonet_log_counter_preset")&&logAjaxMode=="new"){BX("sonet_log_counter_preset").style.display="none"}}function __logChangeCounter(e){var t=parseInt(e)<=0;oCounter={iCommentsRead:0};BX.onCustomEvent(window,"onSonetLogChangeCounter",[oCounter]);e-=oCounter.iCommentsRead;__logChangeCounterAnimate(parseInt(e)>0,e,t)}function __logDecrementCounter(e){if(BX("sonet_log_counter_2")){e=parseInt(e);var t=parseInt(BX("sonet_log_counter_2").innerHTML);var n=t-e;if(n>0)BX("sonet_log_counter_2").innerHTML=n;else __logChangeCounterAnimate(false,0)}}function __logChangeCounterAnimate(e,t,n){n=!!n;if(!!window.bLockCounterAnimate){setTimeout(function(){__logChangeCounterAnimate(e,t)},200);return false}e=!!e;if(e){if(BX("sonet_log_counter_2"))BX("sonet_log_counter_2").innerHTML=t;if(BX("sonet_log_counter_2_wrap")){BX("sonet_log_counter_2_wrap").style.visibility="visible";BX.addClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim")}}else if(BX("sonet_log_counter_2_wrap")){if(n&&BX.hasClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim")){if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);nodeTmp3=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-reload"},false);
132if(nodeTmp1&&nodeTmp2&&nodeTmp3){nodeTmp1.style.display="none";nodeTmp2.style.display="none";nodeTmp3.style.display="inline"}}}else setTimeout(function(){BX.removeClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim");BX("sonet_log_counter_2_wrap").style.visibility="hidden"},400)}}function __logChangeCounterArray(e){if(typeof e[BX.message("sonetLCounterType")]!="undefined")__logChangeCounter(e[BX.message("sonetLCounterType")])}function __logShowPostMenu(e,t,n,o,s,a,i,r,l,d){BX.PopupMenu.destroy("post-menu-"+t);var f=null;if(BX.message("sonetLbUseFavorites")!="N"){f={text:l?BX.message("sonetLMenuFavoritesTitleY"):BX.message("sonetLMenuFavoritesTitleN"),className:"menu-popup-no-icon",onclick:function(e){__logChangeFavorites(r,"log_entry_favorites_"+r,l?"N":"Y",true);return BX.PreventDefault(e)}}}var p=[e.getAttribute("data-log-entry-url").length>0?{text:'<span id="post-menu-'+t+'-href-text">'+BX.message("sonetLMenuHref")+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-href",href:e.getAttribute("data-log-entry-url")}:null,e.getAttribute("data-log-entry-url").length>0?{text:'<span id="post-menu-'+t+'-link-text">'+BX.message("sonetLMenuLink")+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-link",onclick:function(){id="post-menu-"+t+"-link",it=BX.proxy_context,height=parseInt(!!it.getAttribute("bx-height")?it.getAttribute("bx-height"):it.offsetHeight);if(it.getAttribute("bx-status")!="shown"){it.setAttribute("bx-status","shown");if(!BX(id)&&!!BX(id+"-text")){var n=BX(id+"-text"),o=BX.pos(n),s=BX.pos(n.parentNode);pos3=BX.pos(BX.findParent(n,{className:"menu-popup-item"},true));o["height"]=s["height"]-1;BX.adjust(it,{attrs:{"bx-height":it.offsetHeight},style:{overflow:"hidden",display:"block"},children:[BX.create("BR"),BX.create("DIV",{attrs:{id:id},children:[BX.create("SPAN",{attrs:{className:"menu-popup-item-left"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-icon"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-text"},children:[BX.create("INPUT",{attrs:{id:id+"-input",type:"text",value:e.getAttribute("data-log-entry-url")},style:{height:o["height"]+"px",width:pos3["width"]-21+"px"},events:{click:function(e){this.select();BX.PreventDefault(e)}}})]})]}),BX.create("SPAN",{className:"menu-popup-item-right"})]})}new BX.fx({time:.2,step:.05,type:"linear",start:height,finish:height*2,callback:BX.delegate(function(e){this.style.height=e+"px"},it)}).start();BX.fx.show(BX(id),.2);BX(id+"-input").select()}else{it.setAttribute("bx-status","hidden");new BX.fx({time:.2,step:.05,type:"linear",start:it.offsetHeight,finish:height,callback:BX.delegate(function(e){this.style.height=e+"px"},it)}).start();BX.fx.hide(BX(id),.2)}}}:null,f,BX.message("sonetLCanDelete")=="Y"?{text:BX.message("sonetLMenuDelete"),className:"menu-popup-no-icon",onclick:function(e){if(confirm(BX.message("sonetLMenuDeleteConfirm"))){__logDelete(r,"log-entry-"+r,t)}return BX.PreventDefault(e)}}:null];if(!!d&&BX.type.isArray(d)){for(var c=0;c<d.length;c++)if(typeof d[c].className=="undefined")d[c].className="menu-popup-no-icon";p=BX.util.array_merge(p,d)}var u={offsetLeft:-14,offsetTop:4,lightShadow:false,angle:{position:"top",offset:50},events:{onPopupShow:function(e){if(BX("log_entry_favorites_"+r)){var n=BX.findChildren(e.contentContainer,{className:"menu-popup-item-text"},true);if(n!=null){for(var o=0;o<n.length;o++){if(n[o].innerHTML==BX.message("sonetLMenuFavoritesTitleY")||n[o].innerHTML==BX.message("sonetLMenuFavoritesTitleN")){var s=n[o];break}}}if(s!=undefined){if(BX.hasClass(BX("log_entry_favorites_"+r),"feed-post-important-switch-active"))BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY");else BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}if(BX("post-menu-"+t+"-link")){var a=BX.findChild(e.popupContainer,{className:"feed-entry-popup-menu-link"},true,false);if(a){var i=parseInt(!!a.getAttribute("bx-height")?a.getAttribute("bx-height"):0);if(i>0){BX("post-menu-"+t+"-link").style.display="none";a.setAttribute("bx-status","hidden");a.style.height=i+"px"}}}}}};BX.PopupMenu.show("post-menu-"+t,e,p,u)}
132function __logCommentFormAutogrow(e){var t=0;if(e&&BX.type.isDomNode(e))var n=e;else{var n=BX.proxy_context;var o=e||window.event;if((o.keyCode==13||o.keyCode==10)&&o.ctrlKey)__logCommentAdd()}var s=BX.findParent(n,{className:"sonet-log-comment-form-place"});if(BX(s))t=BX(s).offsetHeight;var a=0;var i=n.value.split("\n");for(var r=i.length-1;r>=0;--r)a+=Math.floor(i[r].length/CommentFormColsDefault+1);if(a>=CommentFormRowsDefault)n.rows=a+1;else n.rows=CommentFormRowsDefault}function __logGetNextPage(e,t,n){if(oLF.bLoadStarted){return false}oLF.bLoadStarted=true;window.bLockCounterAnimate=true;t=!!t;if(!t&&BX("feed-new-message-inf-wrap")){BX("feed-new-message-inf-wrap").classList.toggle("feed-new-message-anim")}var o={method:"GET",url:e};BX.onCustomEvent("SonetLogBeforeGetNextPage",[o]);if(BX.type.isNotEmptyString(o.url)){e=o.url}BX.ajax({url:e,method:"GET",dataType:"json",data:{},onsuccess:function(e){oLF.bLoadStarted=false;if(!t&&typeof n!="undefined"&&n&&n.parentNode){BX.cleanNode(n.parentNode,true)}window.bLockCounterAnimate=false;if(typeof e!="undefined"&&typeof e.PROPS!="undefined"&&typeof e.PROPS.CONTENT!="undefined"&&e.PROPS.CONTENT.length>0&&(typeof e.LAST_TS=="undefined"||parseInt(e.LAST_TS)<=0||parseInt(BX.message("sonetLFirstPageLastTS"))<=0||parseInt(e.LAST_TS)<parseInt(BX.message("sonetLFirstPageLastTS")))){var o="content_block_"+Math.floor(Math.random()*1e3);oLF.processAjaxBlock(e.PROPS,o,t);_sonetLClearContainerExternal(false);if(t){BX("feed-new-message-inf-wrap-first").style.display="block";var s=function(){if(BX(o)){BX(o).style.display="block"}BX.unbind(BX("sonet_log_more_container_first"),"click",s);BX("feed-new-message-inf-wrap-first").style.display="none";__logRecalcMoreButton()};BX.bind(BX("sonet_log_more_container_first"),"click",s)}else{setTimeout(function(){__logRecalcMoreButton()},1e3)}}},onfailure:function(e){oLF.bLoadStarted=false;if(!t&&BX("feed-new-message-inf-wrap")){BX("feed-new-message-inf-wrap").classList.toggle("feed-new-message-anim")}window.bLockCounterAnimate=false;_sonetLClearContainerExternal(false)}});return false}function __logGetNextPageLinkEntities(e,t){if(!!window.__logGetNextPageFormName&&!!e&&!!t&&!!window["UC"]&&!!window["UC"][window.__logGetNextPageFormName]&&!!window["UC"][window.__logGetNextPageFormName].linkEntity){window["UC"][window.__logGetNextPageFormName].linkEntity(e);for(var n in t){if(!!n&&!!t[n])window["UC"][window.__logGetNextPageFormName]["entitiesCorrespondence"][n]=t[n]}}}function __logRefresh(e){if(oLF.bLoadStarted){return}var t=BX("sonet_log_counter_2_wrap",true);oLF.bLoadStarted=true;if(t){var n=BX.findChild(t,{tag:"span",className:"feed-new-message-inf-text-reload"},true);if(n){n.style.display="none"}}window.bLockCounterAnimate=true;BX.ajax({url:e,method:"GET",dataType:"json",data:{},onsuccess:function(e){oLF.bLoadStarted=false;if(typeof e!="undefined"&&typeof e.PROPS!="undefined"&&typeof e.PROPS.CONTENT!="undefined"&&e.PROPS.CONTENT.length>0){window.bLockCounterAnimate=false;BX.cleanNode("log_internal_container",false);oLF.processAjaxBlock(e.PROPS);_sonetLClearContainerExternal(false);window.bStopTrackNextPage=false;if(BX("feed-new-message-inf-wrap-first")){BX("feed-new-message-inf-wrap-first").style.display="none"}if(typeof arCommentsMoreButtonID!="undefined"){arCommentsMoreButtonID=[]}if(t&&BX.hasClass(t,"feed-new-message-informer-fixed")){var n=BX("feed-up-btn-wrap",true);if(n){n.style.display="none";BX.removeClass(n,"feed-up-btn-wrap-anim")}var o=BX.GetWindowScrollPos();new BX.easing({duration:500,start:{scroll:o.scrollTop},finish:{scroll:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){window.scrollTo(0,e.scroll)},complete:function(){if(n)n.style.display="block";BX.onCustomEvent(window,"onGoUp")}}).animate()}}else{oLF.showRefreshError()}},onfailure:function(e){oLF.bLoadStarted=false;oLF.showRefreshError()}});return false}function __logChangeFavorites(e,t,n,o){if(!e||!BX(t)){return}if(!!o){var s=BX.proxy_context;if(!BX.hasClass(BX(s),"menu-popup-item-text")){s=BX.findChild(BX(s),{className:"menu-popup-item-text"},true)}}var a=BX.hasClass(BX(t),"feed-post-important-switch")?BX(t):BX.findChild(BX(t),{className:"feed-post-important-switch"});if(n!=undefined){if(n=="Y"){BX.addClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleY");
132if(typeof s!="undefined"){BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY")}}else{BX.removeClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleN");if(typeof s!="undefined"){BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}}var i=new XMLHttpRequest;i.open("POST",BX.message("sonetLESetPath"),true);i.setRequestHeader("Content-Type","application/x-www-form-urlencoded");i.onreadystatechange=function(){if(i.readyState==4){if(i.status==200){var e=LBlock.DataParser(i.responseText);if(typeof e=="object"){if(e[0]=="*"){if(sonetLErrorDiv!=null){sonetLErrorDiv.style.display="block";sonetLErrorDiv.innerHTML=i.responseText}return}i.abort();var t="";if(e["bResult"]!=undefined&&(e["bResult"]=="Y"||e["bResult"]=="N")){if(e["bResult"]=="Y"){BX.addClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleY");if(s!=undefined)BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY")}else{BX.removeClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleN");if(s!=undefined)BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}}}else{}}};i.send("r="+Math.floor(Math.random()*1e3)+"&"+BX.message("sonetLSessid")+"&site="+BX.util.urlencode(BX.message("sonetLSiteId"))+"&log_id="+encodeURIComponent(e)+"&action=change_favorites")}function __logDelete(e,t,n){if(!e){return}if(!BX(t)){return}BX.ajax({url:BX.message("sonetLESetPath"),method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),site:BX.message("sonetLSiteId"),log_id:e,action:"delete"},onsuccess:function(e){if(e.bResult!=undefined&&e.bResult=="Y"){if(typeof n!="undefined"){BX.PopupMenu.destroy("post-menu-"+n)}__logDeleteSuccess(BX(t))}else{__logDeleteFailure(BX(t))}},onfailure:function(e){__logDeleteFailure(BX(t))}})}function __logDeleteSuccess(e){if(typeof e=="undefined"||!e||!BX(e)){return}new BX.fx({time:.5,step:.05,type:"linear",start:BX(e).offsetHeight,finish:60,callback:BX.delegate(function(e){this.style.height=e+"px"},BX(e)),callback_start:BX.delegate(function(){this.style.overflow="hidden";this.style.minHeight=0},BX(e)),callback_complete:BX.delegate(function(){this.style.marginBottom=0;BX.cleanNode(this);this.appendChild(BX.create("DIV",{props:{className:"feed-add-successfully"},style:{marginLeft:"17px",marginRight:"17px",marginTop:"10px"},children:[BX.create("span",{props:{className:"feed-add-info-text"},children:[BX.create("span",{props:{className:"feed-add-info-icon"}}),BX.create("span",{html:BX.message("sonetLMenuDeleteSuccess")})]})]}))},BX(e))}).start()}function __logDeleteFailure(e){if(typeof e=="undefined"||!e||!BX(e)){return}e.insertBefore(BX.create("DIV",{props:{className:"feed-add-error"},style:{marginLeft:"84px",marginRight:"37px",marginTop:"18px",marginBottom:"4px"},children:[BX.create("span",{props:{className:"feed-add-info-text"},children:[BX.create("span",{props:{className:"feed-add-info-icon"}}),BX.create("span",{html:BX.message("sonetLMenuDeleteFailure")})]})]}),e.firstChild)}function __logOnFeedScroll(){if(window.feedScrollLock==undefined||window.feedScrollLock===false){window.feedScrollLock=true;setTimeout(function(){window.feedScrollLock=false},100);var e=BX.GetWindowSize();if(window.bStopTrackNextPage===undefined||window.bStopTrackNextPage==false){var t=parseInt(e.scrollHeight/2);if(e.scrollHeight-e.innerHeight<t){t=1}if(e.scrollTop>=t&&next_url){window.bStopTrackNextPage=true;__logGetNextPage(next_url,true)}}}var n=BX("sonet_log_counter_2_wrap",true);if(n){var o=n.parentNode.getBoundingClientRect().top;if(o<=0){BX.addClass(n,"feed-new-message-informer-fixed");setTimeout(function(){if(BX.hasClass(n,"feed-new-message-informer-fixed")){BX.addClass(n,"feed-new-message-informer-fix-anim")}},100)}else{BX.removeClass(n,"feed-new-message-informer-fixed feed-new-message-informer-fix-anim")}}}function __logScrollInit(e){if(!!e){BX.unbind(window,"scroll",__logOnFeedScroll);BX.bind(window,"scroll",__logOnFeedScroll)}else{BX.unbind(window,"scroll",__logOnFeedScroll)}}function __logRecalcMoreButton(){if(typeof arMoreButtonID!="undefined"){var e=false;var t=false;var n=false;var o=false;for(var s=0;s<arMoreButtonID.length;s++){e=BX.pos(BX(arMoreButtonID[s].bodyBlockID));if(e.height<280){BX(arMoreButtonID[s].moreButtonBlockID).style.display="none"}if(typeof arMoreButtonID[s].outerBlockID!="undefined"){n=BX(arMoreButtonID[s].outerBlockID);if(n){t=BX.pos(n);if(t.width<e.width){o=BX.findChild(n,{tag:"div",className:"feed-post-text-block-inner"},false);o.style.overflowX="scroll"}}}}}if(typeof arCommentsMoreButtonID!="undefined"){var e=false;for(var s=0;s<arCommentsMoreButtonID.length;s++){e=BX.pos(BX(arCommentsMoreButtonID[s].bodyBlockID));if(e.height<200){BX(arCommentsMoreButtonID[s].moreButtonBlockID).style.display="none"}}}}window.__socOnUCFormClear=function(e){LHEPostForm.reinitDataBefore(e.editorId)};window.__socOnUCFormAfterShow=function(e,t,n){n=!!n?n:{};var o=e.entitiesCorrespondence[e.id.join("-")][0],s=e.entitiesCorrespondence[e.id.join("-")][1];BX.show(BX("feed_comments_block_"+o));BX.onCustomEvent(window,"OnBeforeSocialnetworkCommentShowedUp",["socialnetwork"]);e.form.action=e.url.replace(/\#eId\#/,o).replace(/\#id\#/,s);var a={ENTITY_XML_ID:e.id[0],ENTITY_TYPE:e.entitiesId[e.id[0]][0],ENTITY_ID:e.entitiesId[e.id[0]][1],parentId:e.id[1],comment_post_id:e.entitiesId[e.id[0]][1],edit_id:e.id[1],act:e.id[1]>0?"edit":"add",logId:e.entitiesId[e.id[0]][2]};for(var i in a){if(!e.form[i]){e.form.appendChild(BX.create("INPUT",{attrs:{name:i,type:"hidden"}}))}e.form[i].value=a[i]}__socOnLightEditorShow(t,n)};window.__socOnUCFormSubmit=function(e,t){t["r"]=Math.floor(Math.random()*1e3);t["sessid"]=BX.bitrix_sessid();t["log_id"]=e.entitiesCorrespondence[e.id.join("-")][0];t["p_smile"]=BX.message("sonetLPathToSmile");t["p_ubp"]=BX.message("sonetLPathToUserBlogPost");t["p_gbp"]=BX.message("sonetLPathToGroupBlogPost");t["p_umbp"]=BX.message("sonetLPathToUserMicroblogPost");t["p_gmbp"]=BX.message("sonetLPathToGroupMicroblogPost");t["p_user"]=BX.message("sonetLPathToUser");t["p_le"]=BX.message("sonetLEPath");t["f_id"]=BX.message("sonetLForumID");t["bapc"]=BX.message("sonetLBlogAllowPostCode");t["site"]=BX.message("sonetLSiteId");t["lang"]=BX.message("sonetLLangId");t["nt"]=BX.message("sonetLNameTemplate");t["sl"]=BX.message("sonetLShowLogin");t["as"]=BX.message("sonetLAvatarSizeComment");t["dtf"]=BX.message("sonetLDateTimeFormat");t["message"]=t["REVIEW_TEXT"];t["action"]="add_comment";t["RATING_TYPE"]=BX.message("sonetRatingType");t["pull"]="Y";t["crm"]=BX.message("sonetLIsCRM");e.form["bx-action"]=e.form.action;e.form.action=BX.message("sonetLESetPath")};window.__socOnUCFormResponse=function(e,t){e.form.action=e.form["bx-action"];var n={errorMessage:t},o=e.entitiesCorrespondence[e.id.join("-")][0],s={};if(!(!!t&&typeof t=="object")){}else if(t[0]=="*"){n={errorMessage:BX.message("sonetLErrorSessid")}}else{if(!(t["commentID"]>0)||!!t["strMessage"])n["errorMessage"]=t["strMessage"];else if(t["return_data"])n=t["return_data"];
132else{var a=t["arCommentFormatted"],i=t["arComment"],r=!!window["__logBuildRating"]?window["__logBuildRating"](t["arComment"],t["arCommentFormatted"]):null,l=!!i["SOURCE_ID"]?i["SOURCE_ID"]:i["ID"],s={ID:l,ENTITY_XML_ID:e.id[0],FULL_ID:[e.id[0],l],NEW:"N",APPROVED:"Y",POST_TIMESTAMP:t["timestamp"]-BX.message("USER_TZ_OFFSET"),POST_TIME:a["LOG_TIME_FORMAT"],POST_DATE:a["LOG_TIME_FORMAT"],"~POST_MESSAGE_TEXT":a["MESSAGE"],POST_MESSAGE_TEXT:a["MESSAGE_FORMAT"],PANELS:{MODERATE:false},URL:{LINK:i["URL"]&&i["URL"].length>0?i["URL"]:BX.message("sonetLEPath").replace("#log_id#",i["LOG_ID"])+"?commentId="+i["ID"]+"#com"+(parseInt(i["SOURCE_ID"])>0?i["SOURCE_ID"]:i["ID"])},AUTHOR:{ID:a["USER_ID"],NAME:a["CREATED_BY"]["FORMATTED"],URL:a["CREATED_BY"]["URL"],AVATAR:a["AVATAR_SRC"]},BEFORE_ACTIONS:!!r?r:"",AFTER:a["UF"]};if(typeof t["hasEditCallback"]!="undefined"&&t["hasEditCallback"]=="Y"){s["PANELS"]["EDIT"]="Y";s["URL"]["EDIT"]="__logEditComment('"+e.id[0]+"', '"+i["ID"]+"', '"+i["LOG_ID"]+"');"}if(typeof t["hasDeleteCallback"]!="undefined"&&t["hasDeleteCallback"]=="Y"){s["PANELS"]["DELETE"]="Y";s["URL"]["DELETE"]=BX.message("sonetLESetPath")+"?lang="+BX.message("sonetLLangId")+"&action=delete_comment&delete_comment_id="+i["ID"]+"&post_id="+i["LOG_ID"]+"&site="+BX.message("sonetLSiteId")}n={errorMessage:"",okMessage:"",status:true,message:"",messageCode:a["MESSAGE"],messageId:[e.id[0],l],"~message":"",messageFields:s}}var d=BX("log_entry_follow_"+o,true),f=!!d?d.getAttribute("data-follow")=="Y"?"Y":"N":false;if(f=="N"){BX.findChild(d,{tagName:"a"}).innerHTML=BX.message("sonetLFollowY");d.setAttribute("data-follow","Y")}var d=BX("feed-comments-all-cnt-"+o,true),p=!!d?d.innerHTML.length>0?parseInt(d.innerHTML):0:false;if(p!==false)d.innerHTML=p+1}e.OnUCFormResponseData=n};window.__socOnLightEditorShow=function(e,t){var n={};if(t["arFiles"]){var o={},s,a;for(var i=0;i<t["arFiles"].length;i++){s=BX.findChild(BX("wdif-doc-"+t["arFiles"][i]),{className:"feed-com-file-name"},true);a=BX.findChild(BX("wdif-doc-"+t["arFiles"][i]),{className:"feed-con-file-size"},true);o["F"+i]={FILE_ID:t["arFiles"][i],FILE_NAME:s?s.innerHTML:"noname",FILE_SIZE:a?a.innerHTML:"unknown",CONTENT_TYPE:"notimage/xyz"}}n["UF_SONET_COM_DOC"]={USER_TYPE_ID:"file",FIELD_NAME:"UF_SONET_COM_FILE[]",VALUE:o}}if(t["arDocs"])n["UF_SONET_COM_FILE"]={USER_TYPE_ID:"webdav_element",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:BX.clone(t["arDocs"])};if(t["arDFiles"])n["UF_SONET_COM_FILE"]={USER_TYPE_ID:"disk_file",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:BX.clone(t["arDFiles"])};LHEPostForm.reinitData(SLEC.editorId,e,n)};BitrixLF=function(){this.bLoadStarted=false};BitrixLF.prototype.showRefreshError=function(){window.bLockCounterAnimate=false;_sonetLClearContainerExternal(false)};BitrixLF.prototype.LazyLoadCheckVisibility=function(e){var t=e.node;var n="comment";var o=BX.findParent(t,{className:"feed-com-text"});if(!o){n="post";o=BX.findParent(t,{className:"feed-post-text-block"})}if(o){var s=BX.findChild(o,{tag:"div",className:"feed-post-text-more"},false);if(s&&s.style.display!="none"){return t.parentNode.parentNode.offsetTop<(n=="comment"?220:270)}}return true};BitrixLF.prototype.processAjaxBlock=function(e,t,n){if(!e){return}if(!t){t="content_block_"+Math.floor(Math.random()*1e3)}n=!!n;var o=false;var s=false;a(i);r(l);function a(t){if(BX.type.isArray(e.CSS)&&e.CSS.length>0){BX.load(e.CSS,t)}else{t()}}function i(){BX("log_internal_container").appendChild(BX.create("DIV",{props:{id:t,className:"feed-wrap"},style:{display:n?"none":"block"},html:e.CONTENT}));o=true;if(s){l()}}function r(t){if(BX.type.isArray(e.JS)&&e.JS.length>0){BX.load(e.JS,t)}else{t()}}function l(){s=true;if(o){BX.ajax.processRequestData(e.CONTENT,{scriptsRunFirst:false,dataType:"HTML"})}}};BitrixLF.prototype.createTask=function(e){this.createTaskPopup=new BX.PopupWindow("BXCTP",null,{autoHide:false,zIndex:0,offsetLeft:0,offsetTop:0,overlay:false,lightShadow:true,closeIcon:{right:"12px",to
132p:"10px"},draggable:{restrict:true},closeByEsc:false,contentColor:"white",contentNoPaddings:true,buttons:[],content:BX.create("DIV",{attrs:{id:"BXCTP_content"},props:{className:"feed-create-task-popup-content"}}),events:{onAfterPopupShow:BX.proxy(function(){oLF.createTaskSetContent(BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskWait")}));BX.ajax({url:"/bitrix/components/bitrix/socialnetwork.log.ex/ajax.php",method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),ENTITY_TYPE:e.entityType,ENTITY_ID:e.entityId,action:"get_raw_data"},onsuccess:BX.proxy(function(t){if(typeof t.TITLE!="undefined"&&typeof t.DESCRIPTION!="undefined"&&typeof t.DISK_OBJECTS!="undefined"&&t.TITLE.length>0&&t.DESCRIPTION.length>0){BX.Tasks.Util.Query.runOnce("task.add",{data:{TITLE:t.TITLE,DESCRIPTION:t.DESCRIPTION,RESPONSIBLE_ID:BX.message("USER_ID"),CREATED_BY:BX.message("USER_ID"),UF_TASK_WEBDAV_FILES:t.DISK_OBJECTS}}).then(BX.proxy(function(t){var n=t.getData();if(typeof n!="undefined"&&typeof n.DATA!="undefined"&&typeof n.DATA.ID!="undefined"&&parseInt(n.DATA.ID)>0){oLF.createTaskSetContentSuccess(n.DATA.ID);BX.ajax({url:"/bitrix/components/bitrix/socialnetwork.log.ex/ajax.php",method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),ENTITY_TYPE:e.entityType,ENTITY_ID:e.entityId,TASK_ID:n.DATA.ID,action:"create_task_comment"}})}else{oLF.createTaskSetContentFailure(t.getErrors().getMessages())}},this))}else{oLF.createTaskSetContentFailure([BX.message("sonetLFCreateTaskErrorGetData")])}},this),onfailure:function(e){oLF.createTaskSetContentFailure([BX.message("sonetLFCreateTaskErrorGetData")])}})},this),onPopupClose:BX.proxy(function(){this.createTaskPopup.destroy()},this)}});this.createTaskPopup.params.zIndex=BX.WindowManager?BX.WindowManager.GetZIndex():0;this.createTaskPopup.show()};BitrixLF.prototype.createTaskSetContentSuccess=function(e){oLF.createTaskSetContent(BX.create("DIV",{children:[BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskSuccessTitle")}),BX.create("DIV",{props:{className:"feed-create-task-popup-description"},html:BX.message("sonetLFCreateTaskSuccessDescription")})]}));this.createTaskPopup.setButtons([new BX.PopupWindowButton({text:BX.message("sonetLFCreateTaskButtonTitle"),events:{click:BX.proxy(function(){this.createTaskPopup.destroy();window.open(BX.message("sonetLFCreateTaskTaskPath").replace("#user_id#",BX.message("USER_ID")).replace("#task_id#",e),"_blank")},this)}})])};BitrixLF.prototype.createTaskSetContentFailure=function(e){oLF.createTaskSetContent(BX.create("DIV",{children:[BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskFailureTitle")}),BX.create("DIV",{props:{className:"feed-create-task-popup-description"},html:e.join("<br>")})]}))};BitrixLF.prototype.createTaskSetContent=function(e){if(BX("BXCTP_content")){var t=BX("BXCTP_content");BX.cleanNode(t);t.appendChild(e)}};oLF=new BitrixLF;window.oLF=oLF;
133/* End */
134;
135; /* Start:"a:4:{s:4:"full";s:99:"/bitrix/components/bitrix/socialnetwork.log.filter/templates/.default/script.min.js?175919381411034";s:6:"source";s:79:"/bitrix/components/bitrix/socialnetwork.log.filter/templates/.default/script.js";s:3:"min";s:83:"/bitrix/components/bitrix/socialnetwork.log.filter/templates/.default/script.min.js";s:3:"map";s:83:"/bitrix/components/bitrix/socialnetwork.log.filter/templates/.default/script.map.js";}"*/
136__logOnDateChange=function(e){var t=false,n=false,i=false,a=false;if(e.value=="interval")t=n=i=true;else if(e.value=="before")n=true;else if(e.value=="after"||e.value=="exact")t=true;else if(e.value=="days")a=true;BX("flt_date_from_span").style.display=t?"":"none";BX("flt_date_to_span").style.display=n?"":"none";BX("flt_date_hellip_span").style.display=i?"":"none";BX("flt_date_day_span").style.display=a?"inline-block":"none";BX("flt_date_day_text_span").style.display=a?"inline-block":"none"};function __logOnReload(e){if(BX("menu-popup-lenta-sort-popup")){var t=BX.findChildren(BX("menu-popup-lenta-sort-popup"),{className:"lenta-sort-item"},true);if(!BX.hasClass(t[0],"lenta-sort-item-selected")){for(var n=0;n<t.length;n++){if(n==0)BX.addClass(t[n],"lenta-sort-item-selected");else if(n!=t.length-1)BX.removeClass(t[n],"lenta-sort-item-selected")}}}if(BX("lenta-sort-button")){var i=BX.findChild(BX("lenta-sort-button"),{className:"lenta-sort-button-text-internal"},true,false);
136if(i)i.innerHTML=BX.message("sonetLFAllMessages")}var a=BX("sonet_log_counter_preset",true);if(a){if(parseInt(e)>0){a.style.display="inline-block";a.innerHTML=e}else{a.innerHTML="";a.style.display="none"}}}BitrixLFFilter=function(){this.id=null;this.filterPopup=false;this.currentName=null;this.obInputName={};this.obSearchInput={};this.obInputContainerName={};this.obContainerInput={};this.popupMenu=null;this.menuItems=[];this.actualSearchString="";this.minSearchStringLength=2};BitrixLFFilter.prototype.initLentaMenu=function(e){if(typeof e.menuItems!="undefined"){this.menuItems=e.menuItems}};BitrixLFFilter.prototype.showLentaMenu=function(e){var t=typeof e.short!="undefined"&&e.short,n=typeof e.bindElement!="undefined"?BX(e.bindElement):null;if(!n){return false}if(typeof e.siteTemplateId=="undefined"||e.siteTemplateId!="bitrix24"){BX.addClass(n,"lenta-sort-button-active")}const i=BX.util.array_merge(!t?BX.util.array_merge(this.menuItems.preset,this.menuItems.filter):[],this.menuItems.actions);if(!BX.Type.isArrayFilled(i)){return false}this.popupMenu=BX.PopupMenu.create("lenta-sort-popup",n,i,{offsetTop:e.siteTemplateId=="bitrix24"?-5:2,offsetLeft:e.siteTemplateId=="bitrix24"?17:43,angle:true,events:{onPopupClose:function(){if(typeof e.siteTemplateId!="undefined"||e.siteTemplateId!="bitrix24"){BX.removeClass(n,"lenta-sort-button-active")}}}});this.popupMenu.show();return false};BitrixLFFilter.prototype.initFilter=function(e){var t=typeof e!="undefined"&&typeof e.version!="undefined"?parseInt(e.version):0;var n=typeof e!="undefined"&&typeof e.filterId!="undefined"?e.filterId:"LIVEFEED";this.id=n;if(t>=2){if(typeof e!="undefined"&&typeof e.minSearchStringLength!="undefined"&&parseInt(e.minSearchStringLength)>0){this.minSearchStringLength=parseInt(e.minSearchStringLength)}var i=BX.Main.filterManager.getById(n);if(i&&(i.getSearch().getSquares().length>0||i.getSearch().getSearchString().length>0)){var a=BX.findParent(BX(n+"_filter_container"),{className:"pagetitle-wrap"});if(a){BX.addClass(a,"pagetitle-wrap-filter-opened")}}BX.addCustomEvent("BX.Livefeed:refresh",BX.delegate((function(){var e=BX.Main.filterManager.getById(n);if(e){e.getPreset().resetPreset(true);e.getSearch().clearForm()}}),this));BX.addCustomEvent("BX.Main.Filter:beforeApply",BX.delegate((function(e,t,i,a){if(e!=n||this.actualSearchString.length>0&&this.actualSearchString.length<this.minSearchStringLength){return}BX.onCustomEvent(window,"BX.Livefeed.Filter:beforeApply",[t,a])}),this));BX.addCustomEvent("BX.Main.Filter:apply",BX.delegate((function(e,t,i,a,o){if(e!=n||this.actualSearchString.length>0&&this.actualSearchString.length<this.minSearchStringLength){return}BX.onCustomEvent(window,"BX.Livefeed.Filter:apply",[t,a,o])}),this));BX.addCustomEvent("BX.Filter.Search:input",BX.delegate((function(e,t){if(e==n){this.actualSearchString=typeof t!="undefined"?BX.util.trim(t):"";if(this.actualSearchString.length>0&&this.actualSearchString.length>=this.minSearchStringLength){BX.onCustomEvent(window,"BX.Livefeed.Filter:searchInput",[t])}}}),this));BX.addCustomEvent("BX.Main.Filter:blur",BX.delegate((function(e){if(e.getParam("FILTER_ID")==n&&e.getSearch().getSquares().length<=0&&e.getSearch().getSearchString().length<=0){var t=BX.findParent(BX(n+"_filter_container"),{className:"pagetitle-wrap"});if(t){BX.removeClass(t,"pagetitle-wrap-filter-opened")}}})));if(BX(this.id+"_filter_container")){var o=BX.delegate((function(e){var t=BX.findParent(e.target,{className:"pagetitle-wrap"});if(t&&!BX.hasClass(t,"pagetitle-wrap-filter-opened")){BX.addClass(t,"pagetitle-wrap-filter-opened")}}),this);BX.bind(BX(this.id+"_search_container"),"click",o)}}else{__logOnDateChange(document.forms["log_filter"].flt_date_datesel);BX("flt_date_from_span").onclick=function(){BX.calendar({node:this,field:BX("flt_date_from"),bTime:false})};BX("flt_date_to_span").onclick=function(){BX.calendar({node:this,field:BX("flt_date_to"),bTime:false})}}};BitrixLFFilter.prototype.initDestination=function(e){this.obInputName[e.name]=e.inputName;this.obSearchInput[e.name]=BX(e.inputName);this.obInputContainerName[e.name]=e.inputContainerName;this.obContainerInput[e.name]=BX(e.inputContainerName);if(typeof e.items!="undefined"&&typeof e.items.department!="undefined"){if(typeof e.items.extranetRoot!="undefined"){for(var t in e.items.extranetRoot){if(e.items.extranetRoot.hasOwnProperty(t)){e.items.department[t]=e.items.extranetRoot[t]}}}if(!e.items.departmentRelation){e.items.departmentRelation=BX.SocNetLogDestination.buildDepartmentRelation(e.items.department)}}BX.SocNetLogDestination.init({name:e.name,pathToAjax:typeof e.pathToAjax!="undefined"?e.pathToAjax:false,searchInput:this.obSearchInput[e.name],extranetUser:!!e.extranetUser,departmentSelectDisable:!!e.departmentSelectDisable,bindMainPopup:{node:e.bindNode,offsetTop:"5px",offsetLeft:"15px"},bindSearchPopup:{node:e.bindNode,offsetTop:"5px",offsetLeft:"15px"},callback:{select:BX.proxy(this.onSelectDestination,{name:e.name,containerInput:BX(e.inputContainerName),inputContainerName:e.inputContainerName,inputName:e.inputName,searchInput:BX(e.inputName),resultFieldName:e.resultFieldName}),unSelect:BX.proxy(this.onUnSelectDestination,{name:e.name,inputContainerName:e.inputContainerName,inputName:e.inputName,searchInput:BX(e.inputName)})},items:e.items,itemsLast:e.itemsLast,itemsSelected:e.itemsSelected,itemsSelectedUndeleted:typeof e.itemsSelectedUndeleted!="undefined"?e.itemsSelectedUndeleted:{},isCrmFeed:false,useClientDatabase:true,destSort:e.destSort,allowAddUser:false,allowSearchEmailUsers:!e.extranetUser,userNameTemplate:e.userNameTemplate});BX.bind(this.obSearchInput[e.name],"click",(function(t){oLFFilter.currentName=e.name;BX.SocNetLogDestination.openDialog(e.name);return BX.PreventDefault(t)}));BX.bind(this.obSearchInput[e.name],"keyup",BX.delegate(BX.SocNetLogDestination.BXfpSearch,{formName:e.name,inputName:oLFFilter.obInputName[e.name]}));BX.bind(this.obSearchInput[e.name],"keydown",BX.delegate(BX.SocNetLogDestination.BXfpSearchBefore,{formName:e.name,inputName:oLFFilter.obInputName[e.name]}))};BitrixLFFilter.prototype.clearInput=function(){if(this.obContainerInput[this.currentName]){var e=BX.findChildren(this.obContainerInput[this.currentName],{className:"feed-add-post-destination"},false);for(var t=0;t<e.length;t++){BX.SocNetLogDestination.deleteItem(e[t].attributes["data-id"].value,e[t].attributes["data-type"].value,this.currentName)}}};BitrixLFFilter.prototype.onSelectDestination=function(e,t,n,i){oLFFilter.clearInput();BX.SocNetLogDestination.BXfpSelectCallback({formName:this.name,item:e,type:t,search:n,b
136Undeleted:i,containerInput:this.containerInput,valueInput:this.searchInput,varName:this.resultFieldName});this.searchInput.style.display="none";if(this.name=="feed-filter-created-by"&&BX("flt_comments_cont")){BX("flt_comments_cont").style.display="block"}BX.SocNetLogDestination.closeDialog();BX.SocNetLogDestination.closeSearch()};BitrixLFFilter.prototype.onUnSelectDestination=function(e){var t=BX.findChildren(BX(this.inputContainerName),{attribute:{"data-id":""+e.id+""}},true);if(t!==null){for(var n=0;n<t.length;n++){BX.remove(t[n])}}BX(this.inputName).value="";this.searchInput.style.display="inline-block";if(this.name=="feed-filter-created-by"&&BX("flt_comments_cont")){BX("flt_comments_cont").style.display="none"}};BitrixLFFilter.prototype.ShowFilterPopup=function(e){if(!oLFFilter.filterPopup){BX.ajax.get(BX.message("sonetLFAjaxPath"),(function(t){BX.closeWait(e);oLFFilter.filterPopup=new BX.PopupWindow("bx_log_filter_popup",e,{closeIcon:false,offsetTop:5,autoHide:true,zIndex:-100,className:"sonet-log-filter-popup-window",events:{onPopupClose:function(){if(!BX.hasClass(this.bindElement,"pagetitle-menu-filter-set"))BX.removeClass(this.bindElement,"pagetitle-menu-filter-selected")},onPopupShow:function(){BX.addClass(this.bindElement,"pagetitle-menu-filter-selected")}}});var n=BX.create("DIV",{html:BX.util.trim(t)});oLFFilter.filterPopup.setContent(n.firstChild);oLFFilter.filterPopup.show()}))}else{oLFFilter.filterPopup.show()}};BitrixLFFilter.prototype.__SLFShowInfoPopup=function(e){var t=[BX.create("BUTTON",{props:{className:"ui-btn ui-btn-md ui-btn-success"},text:BX.message("sonetLFDialogRead"),events:{click:function(){BX.ajax({method:"POST",dataType:"json",url:BX.message("ajaxControllerURL"),data:{sessid:BX.bitrix_sessid(),popupType:e.type,closePopup:"Y"},onsuccess:function(t){if(typeof t!="undefined"&&typeof t.SUCCESS!="undefined"&&t.SUCCESS=="Y"){a.close();if(e.reload){top.location=top.location.href}}}})}}})];if(BX.type.isArray(e.buttonsAdd)){var n=0;for(var i=0;i<e.buttonsAdd.length;i++){n=e.buttonsAdd[i];t.push(BX.create("BUTTON",{props:{className:"ui-btn ui-btn-md ui-btn-"+n.type},text:n.title,events:{click:n.click}}))}}var a=new BX.PopupWindow(e.name,e.bindObj,{closeByEsc:false,closeIcon:false,autoHide:false,overlay:true,events:{},width:700,buttons:[],zIndex:0,content:BX.create("DIV",{children:[BX.create("DIV",{props:{className:"bx-slf-popup-title"},text:e.title}),BX.create("DIV",{props:{className:"bx-slf-popup-content"},children:[BX.create("DIV",{props:{className:"bx-slf-popup-cont-title"},html:e.description1}),BX.create("DIV",{props:{className:"bx-slf-popup-descript"},children:[BX.type.isNotEmptyString(e.description2)?BX.create("DIV",{html:e.description2}):null,BX.type.isPlainObject(e.descriptionImage)&&BX.type.isNotEmptyString(e.descriptionImage.src)?BX.create("IMG",{props:{className:"bx-slf-popup-descript-img"},attrs:{src:e.descriptionImage.src,width:e.descriptionImage.width,height:e.descriptionImage.height}}):null]})]}),BX.create("DIV",{props:{className:"popup-window-buttons"},children:t})]})});a.show();return a};BitrixLFFilter.prototype.onClickMenuItem=function(e){if(typeof e.menuItem!="undefined"){BX.toggleClass(e.menuItem,"lenta-sort-item-selected")}this.popupMenu.close();if(typeof e.href!="undefined"){top.location.href=e.href}};BitrixLFFilter.prototype.closeHint=function(e){};oLFFilter=new BitrixLFFilter;window.oLFFilter=oLFFilter;
137/* End */
138;
139; /* Start:"a:4:{s:4:"full";s:107:"/local/components/UW/socialnetwork.blog.post.comment.custom/templates/.default/script.min.js?17865159524172";s:6:"source";s:88:"/local/components/UW/socialnetwork.blog.post.comment.custom/templates/.default/script.js";s:3:"min";s:92:"/local/components/UW/socialnetwork.blog.post.comment.custom/templates/.default/script.min.js";s:3:"map";s:92:"/local/components/UW/socialnetwork.blog.post.comment.custom/templates/.default/script.map.js";}"*/
140(function(){if(!!window.__blogEditComment)return;window.checkForQuote=function(e,i,o,t){if(window.mplCheckForQuote)mplCheckForQuote(e,i,o,t)};window.__blogLinkEntity=function(e,i){if(!!window["UC"]&&!!window["UC"]["f"+i]){window["UC"]["f"+i].linkEntity(e);for(var o in e){if(e.hasOwnProperty(o)){BX.bind(BX("blog-post-addc-add-"+e[o][1]),"click",BX.proxy(window["UC"][o].reply,window["UC"][o]));BX.bind(BX("blg-post-"+e[o][1]),"dragenter",BX.proxy(window["UC"][o].reply,window["UC"][o]));BX.addCustomEvent(window["UC"]["f"+i].eventNode,"OnUCFormBeforeShow",function(i){if(!!i&&!!i.id&&i.id[0]==o){BX.show(BX("blg-comment-"+e[o][1]))}});BX.addCustomEvent(window["UC"]["f"+i].eventNode,"OnUCFormAfterHide",function(i){if(!!i&&!!i.id&&i.id[0]==o){var t=BX("record-"
140+i.id[0]+"-new"),n=BX.findChildren(BX("blg-comment-"+e[o][1]),{className:"feed-com-block-cover"},false);t=!!t?t.childNodes:[];if(!(!!t&&t.length>0)&&!(!!n&&n.length>0)){BX.hide(BX("blg-comment-"+e[o][1]))}}})}}}};window.__blogEditComment=function(e,i){var o={messageBBCode:top["text"+e],messageFields:{arImages:top["arComFiles"+e],arDocs:top["arComDocs"+e],arFiles:top["arComFilesUf"+e],arDFiles:top["arComDFiles"+e],UrlPreview:top["UrlPreview"+e]}};BX.onCustomEvent(window,"OnUCAfterRecordEdit",["BLOG_"+i,e,o,"EDIT"])};window.__blogOnUCFormClear=function(e){LHEPostForm.reinitDataBefore(e.editorId)};window.__blogOnUCFormAfterShow=function(e,i,o){o=!!o?o:{};BX.onCustomEvent(window,"OnBeforeSocialnetworkCommentShowedUp",["socialnetwork_blog"]);var t={ENTITY_XML_ID:e.id[0],ENTITY_TYPE:e.entitiesId[e.id[0]][0],ENTITY_ID:e.entitiesId[e.id[0]][1],parentId:e.id[1],comment_post_id:e.entitiesId[e.id[0]][1],edit_id:e.id[1],act:e.id[1]>0?"edit":"add",logId:e.entitiesId[e.id[0]][2]};for(var n in t){if(!e.form[n])e.form.appendChild(BX.create("INPUT",{attrs:{name:n,type:"hidden"}}));e.form[n].value=t[n]}e.form.action=SBPC.actionUrl.replace(/#source_post_id#/,t["comment_post_id"]);var r=BX("captcha");if(!!r){BX.ajax.getCaptcha(function(e){BX("captcha_word").value="";BX("captcha_code").value=e["captcha_sid"];BX("captcha").src="/bitrix/tools/captcha.php?captcha_code="+e["captcha_sid"];BX("captcha").style.display=""})}onLightEditorShow(i,o)};window.__blogOnUCFormSubmit=function(e,i){i["decode"]="Y"};window.__blogOnUCAfterRecordAdd=function(e,i){if(i.errorMessage.length>0)return;if(BX("blg-post-inform-"+e.substr(5))){var o=BX.findChild(BX("blg-post-inform-"+e.substr(5)),{tag:"span",className:"feed-inform-follow"},true);if(o){var t=o.getAttribute("data-follow")=="Y"?"Y":"N";if(t=="N"){BX.findChild(o,{tagName:"a"}).innerHTML=BX.message("sonetBPFollowY");o.setAttribute("data-follow","Y")}}}};window.onLightEditorShow=function(e,i){var o={};if(i["arFiles"]){var t={},n,r;for(var a=0;a<i["arFiles"].length;a++){n=BX.findChild(BX("wdif-doc-"+i["arFiles"][a]),{className:"feed-com-file-name"},true);r=BX.findChild(BX("wdif-doc-"+i["arFiles"][a]),{className:"feed-con-file-size"},true);t["F"+a]={FILE_ID:i["arFiles"][a],FILE_NAME:n?n.innerHTML:"noname",FILE_SIZE:r?r.innerHTML:"unknown",CONTENT_TYPE:"notimage/xyz"}}o["UF_BLOG_COMMENT_DOC"]={USER_TYPE_ID:"file",FIELD_NAME:"UF_BLOG_COMMENT_DOC[]",VALUE:t}}if(i["arDocs"])o["UF_BLOG_COMMENT_FILE"]={USER_TYPE_ID:"webdav_element",FIELD_NAME:"UF_BLOG_COMMENT_FILE[]",VALUE:BX.clone(i["arDocs"])};if(i["arDFiles"])o["UF_BLOG_COMMENT_FILE"]={USER_TYPE_ID:"disk_file",FIELD_NAME:"UF_BLOG_COMMENT_FILE[]",VALUE:BX.clone(i["arDFiles"])};if(i["UrlPreview"])o["UF_BLOG_COMMENT_URL_PRV"]={USER_TYPE_ID:"url_preview",FIELD_NAME:"UF_BLOG_COMMENT_URL_PRV",VALUE:BX.clone(i["UrlPreview"])};LHEPostForm.reinitData(SBPC.editorId,e,o);if(i["arImages"]){var d,l=LHEPostForm.getHandler(SBPC.editorId),s="";for(var _ in i["arImages"]){if(i["arImages"].hasOwnProperty(_)){d={id:i["arImages"][_]["id"],element_id:i["arImages"][_]["id"],element_name:i["arImages"][_]["name"],element_size:0,element_content_type:i["arImages"][_]["type"],element_url:i["arImages"][_]["src"],element_thumbnail:i["arImages"][_]["thumbnail"],element_image:i["arImages"][_]["src"],parser:"postimage",storage:"bfile"};var c=l.checkFile(d.id,"common",d,true)}}}}})(window);
141/* End */
142;
143; /* Start:"a:4:{s:4:"full";s:98:"/local/templates/voenchast/components/bitrix/main.post.list/.default/script.min.js?166624702433924";s:6:"source";s:78:"/local/templates/voenchast/components/bitrix/main.post.list/.default/script.js";s:3:"min";s:82:"/local/templates/voenchast/components/bitrix/main.post.list/.default/script.min.js";s:3:"map";s:82:"/local/templates/voenchast/components/bitrix/main.post.list/.default/script.map.js";}"*/
144(function(){window["UC"]=window["UC"]||{};if(window["FCList"])return;var safeEditing=true,safeEditingCurrentObj=null,quoteData=null,repo={};window.FCList=function(e,t){this.CID=e["CID"];this.ENTITY_XML_ID=e["ENTITY_XML_ID"];this.container=e["container"];this.nav=e["nav"];this.mid=e["mid"];this.order=e["order"];this.status="ready";this.msg=!!this.nav?this.nav.innerHTML:"";this.params=t||{};this.pullNewRecords={};this.rights=e["rights"];this.DATE_TIME_FORMAT=this.params["DATE_TIME_FORMAT"]||null;this.comments={};this.bindEvents=[[this.nav,"click",BX.proxy(function(e){BX.eventCancelBubble(e);BX.PreventDefault(e);this.get();return false},this)]];this.windowEvents={OnUCUserIsWriting:BX.delegate(function(t){if(this.ENTITY_XML_ID==t){BX.aja
144x({url:"/bitrix/components/bitrix/main.post.list/activity.php",method:"POST",dataType:"json",data:{AJAX_POST:"Y",ENTITY_XML_ID:this.ENTITY_XML_ID,MODE:"PUSH&PULL",sessid:BX.bitrix_sessid(),sign:e["sign"],PATH_TO_USER:this.params["PATH_TO_USER"],AVATAR_SIZE:this.params["AVATAR_SIZE"],NAME_TEMPLATE:this.params["NAME_TEMPLATE"],SHOW_LOGIN:this.params["SHOW_LOGIN"]}})}},this),OnUCAfterRecordAdd:BX.delegate(function(e,t){if(this.ENTITY_XML_ID==e){this.add(t["messageId"],t,true,"simple")}},this),OnUCFormSubmit:BX.delegate(function(e){if(this.ENTITY_XML_ID==e){this.pullNewRecords[e+"-0"]="busy"}},this),OnUCFormResponse:BX.delegate(function(e,t){if(this.ENTITY_XML_ID==e){this.pullNewRecords[e+"-0"]="ready";this.pullNewRecords[e+"-"+t]="done"}},this),OnUCUserQuote:BX.delegate(function(e){if(this.ENTITY_XML_ID==e&&this.quote&&this.quote.popup){this.quote.popup.hide()}},this),"onPullEvent-unicomments":BX.delegate(function(e,t){if(this.ENTITY_XML_ID==t["ENTITY_XML_ID"]&&t["USER_ID"]+""!=BX.message("USER_ID")+""){if(e=="comment"&&t["ID"]){this.pullNewRecord(t)}else if(e=="answer"){this.pullNewAuthor(t["USER_ID"],t["NAME"],t["AVATAR"])}}},this)};if(this.params&&this.params["NOTIFY_TAG"]&&!!this.params["NOTIFY_TEXT"]&&!!window["UC"]["Informer"]){this.windowEvents["OnUCCommentWasPulled"]=BX.delegate(function(e,t){if(this.ENTITY_XML_ID==e[0]){window["UC"]["Informer"].check(e,t,this.params["NOTIFY_TAG"],this.params["NOTIFY_TEXT"])}},this);window["UC"]["InformerTags"][this.params["NOTIFY_TAG"]]=window["UC"]["InformerTags"][this.params["NOTIFY_TAG"]]||[]}var i;for(i=0;i<this.bindEvents.length;i++){BX.bind(this.bindEvents[i][0],this.bindEvents[i][1],this.bindEvents[i][2])}for(i in this.windowEvents){if(this.windowEvents.hasOwnProperty(i)){BX.addCustomEvent(window,i,this.windowEvents[i])}}if(location.hash&&parseInt(location.hash.replace("#com",""))>0)this.checkHash(parseInt(location.hash.replace("#com","")));if(this.params["BIND_VIEWER"]=="Y"&&BX["viewElementBind"]){BX.viewElementBind(BX("record-"+this.ENTITY_XML_ID+"-new").parentNode,{},function(e){return BX.type.isElementNode(e)&&(e.getAttribute("data-bx-viewer")||e.getAttribute("data-bx-image"))})}this.init(e);if(this.mid>0&&BX("record-"+[this.ENTITY_XML_ID,this.mid].join("-")+"-cover")){var s=BX("record-"+[this.ENTITY_XML_ID,this.mid].join("-")+"-cover").parentNode.firstChild,n=new RegExp("record-("+this.ENTITY_XML_ID+")-([0-9]+)-cover","gi");while(BX(s)){if(s["hasAttribute"]&&s.hasAttribute("id")&&n.test(s.getAttribute("id"))){(s.getAttribute("id")+"").replace(n,function(e,t,i){traceForReading([t,i])})}s=s.nextSibling}}if(repo[this.ENTITY_XML_ID])repo[this.ENTITY_XML_ID].destroy();repo[this.ENTITY_XML_ID]=this;return this};window.FCList.prototype={destroy:function(){var e,t;while((t=this.bindEvents.pop())&&t){BX.unbindAll(t[0]);t[0]=null;t[2]=null}for(e in this.windowEvents){if(this.windowEvents.hasOwnProperty(e)){BX.removeCustomEvent(window,e,this.windowEvents[e]);this.windowEvents[e]=null}}this.windowEvents=null;delete repo[this.ENTITY_XML_ID];BX.onCustomEvent(window,"OnUCHasBeenDestroyed",[this.ENTITY_XML_ID,this])},init:function(){if(this.params["SHOW_POST_FORM"]=="Y"){this.quote.show=BX.delegate(function(e,t){setTimeout(BX.delegate(function(){this.quoteShow(e,t)},this),50)},this);var e=BX("record-"+this.ENTITY_XML_ID+"-new"),t=BX.findChildren(e.parentNode,{tagName:"DIV",className:"feed-com-block-cover"},false);t=!!t?t:[];t.push(e);if(!!this.container)t.push(this.container);for(var i=0;i<t.length;i++){BX.bind(t[i],"mouseup",this.quote.show)}var s=BX("record-"+this.ENTITY_XML_ID+"-switcher");if(s&&!s.bxDndIsBound){s.bxDndIsBound="Y";BX.bind(s,"dragenter",BX.delegate(this.reply,this))}BX.addCustomEvent(window,"onQuote"+this.ENTITY_XML_ID,this.quote.show)}},quote:{show:BX.DoNothing(),popup:null},quoteCheck:function(){var e="",t,i=null;if(window.getSelection){t=window.getSelection();e=t.toString()}else if(document.selection){t=document.selection;e=t.createRange().text}if(e!=""){var s=BX("record-"+this.ENTITY_XML_ID+"-new"),n=BX.findParent(t.focusNode,{tagName:"DIV",className:"feed-com-block-cover"},s.parentNode),o=BX.findParent(t.anchorNode,{tagName:"DIV",className:"feed-com-block-cover"},s.parentNode);
144if(n!=o||BX(n)&&!n.hasAttribute("id")){e=""}else if(BX(n)){var a=BX(n.getAttribute("id").replace(/\-cover$/,"-actions-reply"));if(a){i={id:parseInt(a.getAttribute("bx-mpl-author-id")),name:a.getAttribute("bx-mpl-author-name")}}}}if(e==""){if(!!this.quote.popup)this.quote.popup.hide();return false}return{text:e,author:i}},quoteShow:function(e,t){t=t||this.quoteCheck();if(!t||!t["text"]){quoteData=null;return}quoteData=t;if(this.quote.popup==null){this.quote.popup=new MPLQuote({id:this.ENTITY_XML_ID,closeByEsc:true,autoHide:true,autoHideTimeout:2500,events:{click:BX.delegate(function(e){BX.PreventDefault(e);BX.eventCancelBubble(e);safeEditingCurrentObj=safeEditing;BX.onCustomEvent(window,"OnUCUserQuote",[this.ENTITY_XML_ID,t["author"],t["text"],safeEditingCurrentObj]);this.quote.popup.hide();return false},this)},classEvents:{onQuoteHide:BX.proxy(function(){quoteData=null;this.quote.popup=null},this)}})}this.quote.popup.show(e)},display:function(e,t){var i=0,s=0,n=0,o=this.container;e=e=="hide"?"hide":"show";if(e=="hide"){i=parseInt(this.container.offsetHeight);n=i/2e3;n=n<.3?.3:n>.5?.5:n;o.style.overflow="hidden";new BX["easing"]({duration:n*1e3,start:{height:i,opacity:100},finish:{height:s,opacity:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){o.style.maxHeight=e.height+"px";o.style.opacity=e.opacity/100},complete:BX.proxy(function(){o.style.cssText="";o.style.display="none";BX.onCustomEvent(this,"OnUCListWasHidden",[this,[],o])},this)}).animate()}else{i=parseInt(t||20);o.style.display="block";o.style.overflow="hidden";o.style.maxHeight=i;s=parseInt(this.container.offsetHeight);n=(s-i)/(2e3-i);n=n<.3?.3:n>.8?.8:n;new BX["easing"]({duration:n*1e3,start:{height:i,opacity:i>0?100:0},finish:{height:s,opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){o.style.maxHeight=e.height+"px";o.style.opacity=e.opacity/100},complete:BX.proxy(function(){o.style.cssText="";o.style.maxHeight="none";BX.onCustomEvent(this,"OnUCListWasShown",[this,[],o])},this)}).animate()}},get:function(){if(this.status=="done"){if(this.nav.getAttribute("bx-visibility-status")=="visible"){this.display("hide");BX.adjust(this.nav,{attrs:{"bx-visibility-status":"none"},html:this.msg})}else{this.display("show");BX.adjust(this.nav,{attrs:{"bx-visibility-status":"visible"},html:BX.message("BLOG_C_HIDE")})}}else if(this.status=="ready"){this.send()}return false},send:function(){this.status="busy";BX.addClass(this.nav,"feed-com-all-hover");var e=BX.ajax.prepareData({AJAX_POST:"Y",ENTITY_XML_ID:this.ENTITY_XML_ID,MODE:"LIST",FILTER:this.order=="ASC"?{">ID":this.mid}:{"<ID":this.mid},sessid:BX.bitrix_sessid()}),t=BX.util.htmlspecialcharsback(this.nav.getAttribute("href"));t=t.indexOf("#")!==-1?t.substr(0,t.indexOf("#")):t;var i={url:t,data:e};BX.onCustomEvent(this,"OnUCListHasToBeEnlarged",[this,i]);t=i.url;e=i.data;BX.ajax({url:t+(t.indexOf("?")!==-1?"&":"?")+e,method:"GET",dataType:"json",data:"",onsuccess:BX.proxy(this.build,this),onfailure:BX.proxy(this.complete,this)})},build:function(e){this.status="ready";this.wait("hide");BX.removeClass(this.nav,"feed-com-all-hover");if(!!e&&e["status"]=="success"){var t=!!e["navigation"]?BX.create("DIV",{html:e["navigation"]}):null,i=BX.processHTML(e["messageList"],false);var s=this.container.offsetHeight,n=BX.create("DIV",{html:i.HTML});if(this.order=="ASC"||!this.container.firstChild){this.container.appendChild(n)}else{this.container.insertBefore(n,this.container.firstChild)}BX.onCustomEvent(window,"OnUCFeedChanged",[[this.ENTITY_XML_ID,this.mid]]);this.display("show",s);if(!!t)t=t.firstChild;if(!!t)BX.adjust(this.nav,{attrs:{href:t.getAttribute("href")},html:t.innerHTML});else{BX.adjust(this.nav,{attrs:{href:"#","bx-visibility-status":"visible"},html:BX.message("BLOG_C_HIDE"),events:{click:function(e){BX.eventCancelBubble(e);BX.PreventDefault(e);return false}}});this.status="done"}var o=0,a=BX.delegate(function(){o++;if(o<100){if(this.container.childNodes.length>0){BX.ajax.processScripts(i.SCRIPT);var t=n.firstChild,s=n.lastChild,r=0,d=0;if(t&&t.hasAttribute("id")){r=parseInt(t.getAttribute("id").replace("record-"
144+this.ENTITY_XML_ID+"-","").replace("-cover",""));r=r>0?r:0}if(s&&s.hasAttribute("id")){d=parseInt(s.getAttribute("id").replace("record-"+this.ENTITY_XML_ID+"-","").replace("-cover",""));d=d>0?d:0}if(r>d){d=d+r;r=d-r;d=d-r}n.setAttribute("bx-mpl-min",r+"");n.setAttribute("bx-mpl-max",d+"");n.setAttribute("bx-mpl-loaded","Y");BX.onCustomEvent(this,"OnUCListWasBuilt",[this,e,n])}else BX.defer(a)()}},this);BX.defer(a)()}},complete:function(){this.status="done";BX.removeClass(this.nav,"feed-com-all-hover");this.wait("hide")},wait:function(e){e=e=="show"?"show":"hide";return e},reply:function(e){safeEditingCurrentObj=safeEditing;if(BX.type.isElementNode(e))BX.onCustomEvent(window,"OnUCUserReply",[this.ENTITY_XML_ID,e.getAttribute("bx-mpl-author-id"),e.getAttribute("bx-mpl-author-name"),safeEditingCurrentObj]);else BX.onCustomEvent(window,"OnUCUserReply",[this.ENTITY_XML_ID,undefined,undefined,safeEditingCurrentObj])},add:function(e,t,i,s){if(!(!!t&&!!e&&parseInt(e[1])>0))return false;var n=BX("record-"+e.join("-")+"-cover"),o=!!t["message"]?t["message"]:window.fcParseTemplate({messageFields:t["messageFields"]},{RIGHTS:this.rights,DATE_TIME_FORMAT:this.DATE_TIME_FORMAT,VIEW_URL:this.params.VIEW_URL,EDIT_URL:this.params.EDIT_URL,MODERATE_URL:this.params.MODERATE_URL,DELETE_URL:this.params.DELETE_URL,AUTHOR_URL:this.params.AUTHOR_URL,AUTHOR_URL_PARAMS:this.params.AUTHOR_URL_PARAMS,NAME_TEMPLATE:this.params.NAME_TEMPLATE,SHOW_LOGIN:this.params.SHOW_LOGIN},this.getTemplate()),a=BX.processHTML(o,false),r,d=BX("record-"+e[0]+"-new"),l=["MODERATE","EDIT","DELETE"],c=false,h=0;for(var u in l){if(l.hasOwnProperty(u)){if(this.rights[l[u]]=="OWNLAST"){c=true;break}}}if(c){r=!!d.lastChild&&d.lastChild.className=="feed-com-block-cover"?[d.lastChild]:[];var T,E;if(this.addCheckPreviousNodes!==true){r=BX.findChildren(d.parentNode,{tagName:"DIV",className:"feed-com-block-cover"},false);var p=BX.findChildren(d,{tagName:"DIV",className:"feed-com-block-cover"},false);r=!!r?r:[];p=!!p?p:[];while(p.length>0&&(T=p.pop())&&!!T)r.push(T);this.addCheckPreviousNodes=true}while((T=r.pop())&&T){E=BX(T.id.replace("-cover","-actions"));if(!!E){if(this.rights["EDIT"]=="OWNLAST")E.setAttribute("bx-mpl-edit-show","N");if(this.rights["MODERATE"]=="OWNLAST")E.setAttribute("bx-mpl-moderate-show","N");if(this.rights["DELETE"]=="OWNLAST")E.setAttribute("bx-mpl-delete-show","N")}}}var m=false;if(!n){n=BX.create("DIV",{attrs:{id:"record-"+e.join("-")+"-cover",className:"feed-com-block-cover"},style:{opacity:0,height:0,overflow:"hidden"},html:a.HTML});d.appendChild(n);m=true}else{var f=BX.create("DIV",{attrs:{id:"record-"+e.join("-")+"-cover",className:"feed-com-block-cover"},style:{display:"none"},html:a.HTML}),X=n;n.parentNode.insertBefore(f,n);n.removeAttribute("id");h=n.scrollHeight;BX.hide(n);BX.show(f);n=f;setTimeout(function(){BX.remove(X)},1e3)}if(s!=="simple"){var _=BX.pos(n),I=BX.GetWindowScrollPos(),B=BX.GetWindowInnerSize();new BX["easing"]({duration:1e3,start:{opacity:m?0:100,height:h},finish:{opacity:100,height:n.scrollHeight},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){n.style.height=e.height+"px";n.style.opacity=e.opacity/100;if(I.scrollTop>0&&_.top<I.scrollTop+B.innerHeight)window.scrollTo(0,I.scrollTop+e.height)},complete:function(){n.style.cssText=""}}).animate()}else{new BX["easing"]({duration:500,start:{height:h,opacity:m?0:100},finish:{height:n.scrollHeight,opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.cubic),step:function(e){n.style.height=e.height+"px";n.style.opacity=e.opacity/100},complete:BX.proxy(function(){n.style.cssText="";BX.onCustomEvent(this,"OnUCRecordWasShown",[this.ENTITY_XML_ID,e,n])},this)}).animate()}var R=0,w=function(){R++;if(R<100){var i=BX("record-"+e.join("-")+"-cover");if(i&&i.childNodes.length>0){BX.ajax.processScripts(a.SCRIPT);if(this.params["BIND_VIEWER"]=="Y"&&BX["viewElementBind"]){BX.viewElementBind(i,{},function(e){return BX.type.isElementNode(e)&&(e.getAttribute("data-bx-viewer")||e.getAttribute("data-bx-image"))})}}else BX.defer(w,this)()}BX.onCustomEvent(window,"OnUCRecordHasDrawn",[this.ENTITY_XML_ID,e,t["messageFields"]]);BX.onCustomEvent(window,"OnUCFeedChanged",[e])};BX.defer(w,this)();return true},pullNewAuthor:function(e,t,i){BX.onCustomEvent(window,"OnUCUsersAreWriting",[this.ENTITY_XML_ID,e,t,i])},pullNewRecord:function(e){var t=[this.ENTITY_XML_ID,parseInt(e["ID"])];if(!!this.pullNewRecords[t.join("-")]&&this.pullNewRecords[t.join("-")]=="busy")return true;else if(!!this.pullNewRecords[t[0]+"-0"]&&this.pullNewRecords[t[0]+"-0"]=="busy")return setTimeout(BX.proxy(function(){this.pullNewRecord(e)},this),100);BX.onCustomEvent(window,"OnUCBeforeCommentWillBePulled",[t,e]);if(e["NEED_REQUEST"]=="Y"){if(e["URL"]["LINK"].indexOf("#GROUPS_PATH#")>=0&&!!BX.message("MPL_WORKGROUPS_PATH"))e["URL"]["LINK"]=e["URL"]["LINK"].replace("#GROUPS_PATH#",BX.message("MPL_WORKGROUPS_PATH"));this.pullNewRecords[t.join("-")]="busy";var i=BX.ajax.prepareData({AJAX_POST:"Y",ENTITY_XML_ID:this.ENTITY_XML_ID,MODE:"RECORD",FILTER:{ID:e["ID"]},sessid:BX.bitrix_sessid()}),s=e["URL"]["LINK"];s=s.indexOf("#")!==-1?s.substr(0,s.indexOf("#")):s;BX.ajax({url:s+(s.indexOf("?")!==-1?"&":"?")+i,method:"GET",dataType:"json",data:"",onsuccess:BX.delegate(function(i){if(!!BX("record-"
144+t.join("-")+"-cover"))return;this.add([this.ENTITY_XML_ID,parseInt(e["ID"])],i);var s=BX("record-"+t.join("-")+"-cover"),n=BX.findChild(s,{className:"feed-com-block"},true,false);BX.addClass(s,"comment-new-answer");BX.addClass(n,"feed-com-block-pointer-to-new feed-com-block-new");this.pullNewRecords[t.join("-")]="done";if(BX("record-"+t[0]+"-corner")){BX.addClass(BX("record-"+t[0]+"-corner"),BX.hasClass(n,"feed-com-block-new")?"feed-post-block-yellow-corner":"");BX("record-"+t[0]+"-corner").removeAttribute("id")}BX.onCustomEvent(window,"OnUCCommentWasPulled",[t,i])},this)})}else if(e["ACTION"]=="DELETE"){if(BX("record-"+this.ENTITY_XML_ID+"-"+e["ID"]))BX.fx.hide(BX("record-"+this.ENTITY_XML_ID+"-"+e["ID"]),"scroll",{time:.2});BX.onCustomEvent(window,"OnUCommentWasDeleted",[this.ENTITY_XML_ID,[this.ENTITY_XML_ID,e["ID"]],e]);BX.onCustomEvent(window,"OnUCFeedChanged",[e["ID"]])}else if(e["ACTION"]=="HIDE"){var n=BX("record-"+this.ENTITY_XML_ID+"-"+e["ID"]),o=n?BX.findChild(n,{tagName:"DIV",className:"feed-com-block"},true):null;if(BX(o)){if(BX.hasClass(o,"blog-comment-user-"+BX.message("USER_ID"))){BX.removeClass(o,"feed-com-block-approved");BX.addClass(o,"feed-com-block-hidden")}else{BX.fx.hide(n,"scroll",{time:.2});BX.onCustomEvent(window,"OnUCommentWasHidden",[this.ENTITY_XML_ID,[this.ENTITY_XML_ID,e["ID"]],e]);BX.onCustomEvent(window,"OnUCFeedChanged",[e["ID"]])}}}else if(e["ACTION"]=="EDIT"&&!BX("record-"+this.ENTITY_XML_ID+"-"+e["ID"])){BX.DoNothing()}else{if(e&&!(e["AUTHOR"]&&e["AUTHOR"]["ID"]+""==BX.message("USER_ID")+""))e["NEW"]="Y";this.add(t,{messageFields:e});var a=BX("record-"+t.join("-")+"-cover"),r=BX.findChild(a,{className:"feed-com-block"},true,false);if(BX("record-"+t[0]+"-corner")){BX.addClass(BX("record-"+t[0]+"-corner"),e["NEW"]=="Y"?"feed-post-block-yellow-corner":"");BX("record-"+t[0]+"-corner").removeAttribute("id")}BX.addClass(a,"comment-new-answer");if(e["NEW"]=="Y"){BX.addClass(r,"feed-com-block-pointer-to-new feed-com-block-new")}this.pullNewRecords[t.join("-")]="done";BX.onCustomEvent(window,"OnUCCommentWasPulled",[t,{messageFields:e}])}return true},act:function(url,id,act){if(url.substr(0,1)!="/"){try{eval(url);return false}catch(e){}if(BX.type.isFunction(url)){url(this,id,act);return false}}this.showWait(id);act=act==="EDIT"?"EDIT":act==="DELETE"?"DELETE":"MODERATE";id=parseInt(id);var data=BX.ajax.prepareData({sessid:BX.bitrix_sessid(),MODE:"RECORD",NOREDIRECT:"Y",AJAX_POST:"Y",FILTER:{ID:id},ENTITY_XML_ID:this.ENTITY_XML_ID});url=url.indexOf("#")!==-1?url.substr(0,url.indexOf("#")):url;BX.ajax({method:"GET",url:url+(url.indexOf("?")!==-1?"&":"?")+data,data:"",dataType:"json",onsuccess:BX.proxy(function(e){this.closeWait(id);if(!!e&&typeof e=="object"&&e["status"]!=undefined){if(act!=="EDIT"){var t=BX("record-"+this.ENTITY_XML_ID+"-"+id+"-cover");if(!!e["message"]&&!!t){var i=BX.processHTML(e["message"],false);t.innerHTML=i.HTML;var s=0,n=function(){s++;if(s<100){if(t.childNodes.length>0)BX.ajax.processScripts(i.SCRIPT);else BX.defer(n)()}};BX.defer(n)();e["okMessage"]=""}else if(act=="DELETE"&&!!e["okMessage"]){BX.hide(BX("record-"+this.ENTITY_XML_ID+"-"+id));BX.onCustomEvent(window,"OnUCommentWasDeleted",[this.ENTITY_XML_ID,[this.ENTITY_XML_ID,id]])}}BX.onCustomEvent(window,"OnUCAfterRecordEdit",[this.ENTITY_XML_ID,id,e,act]);BX.onCustomEvent(window,"OnUCFeedChanged",[id])}this.busy=false},this),onfailure:BX.delegate(function(){this.closeWait(id)},this)});return false},checkHash:function(e){var t=[this.ENTITY_XML_ID,e],i=BX("record-"+t.join("-")+"-cover");if(!!i){var s=BX.pos(i);window.scrollTo(0,s["top"]);i=BX.findChild(i,{className:"feed-com-block"},true,false);BX.removeClass(i,"feed-com-block-pointer-to-new feed-com-block-new");BX.addClass(i,"feed-com-block-pointer")}},getTemplate:function(){return BX.message("MPL_RECORD_TEMPLATE")},showWait:function(e){window.fcShowWait(BX("record-"+this.ENTITY_XML_ID+"-"+e+"-actions"))},closeWait:function(e){window.fcCloseWait(BX("record-"+this.ENTITY_XML_ID+"-"+e+"-actions")||null)}};window.FCList.getQuoteData=function(){return quoteData};
144window.FCList.getInstance=function(e,t){if(!repo[e["ENTITY_XML_ID"]])new window.FCList(e,t);return repo[e["ENTITY_XML_ID"]]};window["fcExpandComment"]=function(e,t){if(!BX("record-"+e+"-text")){return}var i=BX("record-"+e+"-text"),s=i.parentNode,n=200,o=parseInt(i.offsetHeight),a={height:n},r={height:o};if(!!t)BX.remove(t);var d=(o-n)/(2e3-n);d=d<.3?.3:d>.8?.8:d;s.style.maxHeight=a.height+"px";s.style.overflow="hidden";new BX["easing"]({duration:d*1e3,start:a,finish:r,transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){s.style.maxHeight=e.height+"px";s.style.opacity=e.opacity/100},complete:function(){s.style.cssText="";s.style.maxHeight="none";BX.onCustomEvent(window,"OnUCRecordWasExpanded",[s]);BX.LazyLoad.showImages(true)}}).animate();BX.onCustomEvent(window,"OnUCFeedChanged",[e.split("-")])};var lastWaitElement=null;window["fcShowWait"]=function(e){if(e&&!BX.type.isElementNode(e))e=null;e=e||this;if(BX.type.isElementNode(e)){BX.defer(function(){e.disabled=true})();var t=BX.findParent(e,BX.is_relative);e.bxwaiter=(t||document.body).appendChild(BX.create("DIV",{props:{className:"feed-com-loader"},style:{position:"absolute"}}));lastWaitElement=e;return e.bxwaiter}return true};
144window["fcCloseWait"]=function(e){if(e&&!BX.type.isElementNode(e))e=null;e=e||lastWaitElement||this;if(BX.type.isElementNode(e)){if(e.bxwaiter&&e.bxwaiter.parentNode){e.bxwaiter.parentNode.removeChild(e.bxwaiter);e.bxwaiter=null}e.disabled=false;if(lastWaitElement==e)lastWaitElement=null}};window["fcShowActions"]=function(e,t,i){var s=[];if(i.getAttribute("bx-mpl-view-show")=="Y"){s.push({text:BX.message("MPL_MES_HREF"),href:i.getAttribute("bx-mpl-view-url").replace(/\\#(.+)$/gi,"")+"#com"+t});s.push({text:'<span id="record-popup-'+e+"-"+t+'-link-text">'+BX.message("B_B_MS_LINK")+"</span>",onclick:function(){var s="record-popup-"+e+"-"+t+"-link",n=BX.proxy_context,o=parseInt(!!n.getAttribute("bx-height")?n.getAttribute("bx-height"):n.offsetHeight);if(n.getAttribute("bx-status")!="shown"){n.setAttribute("bx-status","shown");if(!BX(s)&&!!BX(s+"-text")){var a=BX(s+"-text"),r=BX.pos(a),d=BX.pos(a.parentNode),l=BX.findChildren(a.parentNode.parentNode.parentNode,{className:"menu-popup-item-text"},true),c=i.getAttribute("bx-mpl-view-url").replace(/#(.+)$/gi,"")+"#com"+t;r["height"]=d["height"]-1;if(l){var h=0,u;for(var T=0;T<l.length;T++){u=BX.pos(l[T]);h=Math.max(h,u["width"])}d["width"]=h}BX.adjust(n,{attrs:{"bx-height":n.offsetHeight},style:{overflow:"hidden",display:"block"},children:[BX.create("BR"),BX.create("DIV",{attrs:{id:s},children:[BX.create("SPAN",{attrs:{className:"menu-popup-item-left"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-icon"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-text"},children:[BX.create("INPUT",{attrs:{id:s+"-input",type:"text",value:(c.indexOf("http")<0?location.protocol+"//"+location.host:"")+c},style:{height:d["height"]+"px",width:d["width"]+"px"},events:{click:function(e){this.select();BX.PreventDefault(e)}}})]})]}),BX.create("SPAN",{className:"menu-popup-item-right"})]})}new BX["fx"]({time:.2,step:.05,type:"linear",start:o,finish:o*2,callback:BX.delegate(function(e){this.style.height=e+"px"},n)}).start();BX.fx.show(BX(s),.2);BX(s+"-input").select()}else{n.setAttribute("bx-status","hidden");new BX["fx"]({time:.2,step:.05,type:"linear",start:n.offsetHeight,finish:o,callback:BX.delegate(function(e){this.style.height=e+"px"},n)}).start();BX.fx.hide(BX(s),.2)}}})}if(i.getAttribute("bx-mpl-edit-show")=="Y")s.push({text:BX.message("BPC_MES_EDIT"),onclick:function(){window["UC"][e].act(i.getAttribute("bx-mpl-edit-url"),t,"EDIT");this.popupWindow.close();return false}});if(i.getAttribute("bx-mpl-moderate-show")=="Y"){var n=i.getAttribute("bx-mpl-moderate-approved")=="hidden";s.push({text:n?BX.message("BPC_MES_SHOW"):BX.message("BPC_MES_HIDE"),onclick:function(){window["UC"][e].act(i.getAttribute("bx-mpl-moderate-url").replace("#action#",n?"show":"hide").replace("#ACTION#",n?"SHOW":"HIDE"),t,"MODERATE");this.popupWindow.close()}})}if(i.getAttribute("bx-mpl-delete-show")=="Y"){s.push({text:BX.message("BPC_MES_DELETE"),onclick:function(){if(window.confirm(BX.message("BPC_MES_DELETE_POST_CONFIRM")))window["UC"][e].act(i.getAttribute("bx-mpl-delete-url"),t,"DELETE");this.popupWindow.close();return false}})}if(i.getAttribute("bx-mpl-createtask-show")=="Y"&&typeof oLF!="undefined"){s.push({text:BX.message("BPC_MES_CREATE_TASK"),onclick:function(){oLF.createTask({entityType:"BLOG_COMMENT",entityId:t});this.popupWindow.close();return false}})}if(s.length>0){for(var o in s){if(s.hasOwnProperty(o)){s[o]["className"]="blog-comment-popup-menu"}}BX.PopupMenu.show("action-"+e+"-"+t,i,s,{offsetLeft:-18,offsetTop:2,lightShadow:false,angle:{position:"top",offset:50},events:{onPopupClose:function(){this.destroy();BX.PopupMenu.Data["action-"+e+"-"+t]=null}}})}};window["fcParseTemplate"]=function(e,t,i){t=t||{};t["RIGHTS"]=t["RIGHTS"]||{};for(var s=0,n=["MODERATE","EDIT","DELETE"];s<n.length;s++){t["RIGHTS"][n[s]]=BX.util.in_array(t["RIGHTS"][n[s]],["Y","ALL","OWN","OWNLAST"])?t["RIGHTS"][n[s]]:"N"}t["DATE_TIME_FORMAT"]=!!t["DATE_TIME_FORMAT"]?t["DATE_TIME_FORMAT"]:"d F Y G:i";t["TIME_FORMAT"]=!!t["DATE_TIME_FORMAT"]&&t["DATE_TIME_FORMAT"].indexOf("a")>=0?"g:i a":"G:i";t["VIEW_URL"]=t["VIEW_URL"]||"";t["EDIT_URL"]=t["EDIT_URL"]||"";t["MODERATE_URL"]=t["MODERATE_URL"]||"";t["DELETE_URL"]=t["DELETE_URL"]||"";t["AUTHOR_URL"]=t["AUTHOR_URL"]||"";t["NAME_TEMPLATE"]=t["NAME_TEMPLATE"]||"";t["SHOW_LOGIN"]=t["SHOW_LOGIN"]||"";var o=e&&e["messageFields"]?e["messageFields"]:e,a={ID:"",FULL_ID:"",ENTITY_XML_ID:"",NEW:"old",APPROVED:"Y",DATE:"",TEXT:"",CLASSNAME:"",VIEW_URL:"",VIEW_SHOW:"N",EDIT_URL:"",EDIT_SHOW:"N",MODERATE_URL:"",MODERATE_SHOW:"N",DELETE_URL:"",DELET
144E_SHOW:"N",BEFORE_HEADER:"",BEFORE_ACTIONS:"",AFTER_ACTIONS:"",AFTER_HEADER:"",BEFORE:"",AFTER:"",BEFORE_RECORD:"",AFTER_RECORD:"",AUTHOR_ID:0,AUTHOR_AVATAR_IS:"N",AUTHOR_AVATAR:"",AUTHOR_URL:"",AUTHOR_NAME:"",AUTHOR_EXTRANET_STYLE:"",SHOW_POST_FORM:"Y",VOTE_ID:"",AUTHOR_TOOLTIP_PARAMS:"","background:url('') no-repeat center;":""};if(!!o&&!!e["messageFields"]){o["AUTHOR"]=!!o["AUTHOR"]?o["AUTHOR"]:{};var r=parseInt(o["POST_TIMESTAMP"])+parseInt(BX.message("USER_TZ_OFFSET"))+parseInt(BX.message("SERVER_TZ_OFFSET"));var d=[["today",t["TIME_FORMAT"].indexOf("today")<0?"today, "+t["TIME_FORMAT"]:t["TIME_FORMAT"]],["yesterday",t["TIME_FORMAT"].indexOf("yesterday")<0?"yesterday, "+t["TIME_FORMAT"]:t["TIME_FORMAT"]],["",t["DATE_TIME_FORMAT"]]];var l="";if(typeof o["AUTHOR"]["TYPE"]!="undefined"){if(o["AUTHOR"]["TYPE"]=="EMAIL"){l=" feed-com-name-email"}else if(o["AUTHOR"]["TYPE"]=="EXTRANET"){l=" feed-com-name-extranet"}}else if(o["AUTHOR"]["IS_EXTRANET"]=="Y"){l=" feed-com-name-extranet"}a={ID:o["ID"],FULL_ID:o["FULL_ID"].join("-"),ENTITY_XML_ID:o["ENTITY_XML_ID"],NEW:o["NEW"]=="Y"?"new":"old",APPROVED:o["APPROVED"]!="Y"?"hidden":"approved",DATE:BX.date.format(d,r,false,true),TEXT:o["POST_MESSAGE_TEXT"].replace(/\001/gi,"").replace(/#/gi,"�"),CLASSNAME:o["CLASSNAME"]?" "+o["CLASSNAME"]:"",VIEW_URL:t["VIEW_URL"].replace("#ID#",o["ID"]).replace("#id#",o["ID"]),VIEW_SHOW:t["VIEW_URL"]!==""?"Y":"N",EDIT_URL:t["EDIT_URL"].replace("#ID#",o["ID"]).replace("#id#",o["ID"]),EDIT_SHOW:t["RIGHTS"]["EDIT"]=="Y"||t["RIGHTS"]["EDIT"]=="ALL"||t["RIGHTS"]["EDIT"]=="OWN"&&BX.message("USER_ID")==o["AUTHOR"]["ID"]?"Y":"N",MODERATE_URL:t["MODERATE_URL"].replace("#ID#",o["ID"]).replace("#id#",o["ID"]),MODERATE_SHOW:t["RIGHTS"]["MODERATE"]=="Y"||t["RIGHTS"]["MODERATE"]=="ALL"||t["RIGHTS"]["MODERATE"]=="OWN"&&BX.message("USER_ID")==o["AUTHOR"]["ID"]?"Y":"N",DELETE_URL:t["DELETE_URL"].replace("#ID#",o["ID"]).replace("#id#",o["ID"]),DELETE_SHOW:t["RIGHTS"]["DELET
144E"]=="Y"||t["RIGHTS"]["DELETE"]=="ALL"||t["RIGHTS"]["DELETE"]=="OWN"&&BX.message("USER_ID")==o["AUTHOR"]["ID"]?"Y":"N",BEFORE_HEADER:o["BEFORE_HEADER"],BEFORE_ACTIONS:o["BEFORE_ACTIONS"],AFTER_ACTIONS:o["AFTER_ACTIONS"],AFTER_HEADER:o["AFTER_HEADER"],BEFORE:o["BEFORE"],AFTER:o["AFTER"],BEFORE_RECORD:o["BEFORE_RECORD"],AFTER_RECORD:o["AFTER_RECORD"],AUTHOR_ID:o["AUTHOR"]["ID"],AUTHOR_AVATAR_IS:!!o["AUTHOR"]["AVATAR"]?"Y":"N",AUTHOR_AVATAR:!!o["AUTHOR"]["AVATAR"]?o["AUTHOR"]["AVATAR"]:"/bitrix/images/1.gif",AUTHOR_URL:t["AUTHOR_URL"].replace("#ID#",o["ID"]).replace("#id#",o["ID"]).replace("#USER_ID#",o["AUTHOR"]["ID"]).replace("#user_id#",o["AUTHOR"]["ID"])+(typeof o["AUTHOR"]["EXTERNAL_AUTH_ID"]!="undefined"&&o["AUTHOR"]["EXTERNAL_AUTH_ID"]=="email"&&typeof t["AUTHOR_URL_PARAMS"]!="undefined"?(t["AUTHOR_URL"].indexOf("?")>=0?"&":"?")+"entityType="+t["AUTHOR_URL_PARAMS"]["entityType"]+"&entityId="+t["AUTHOR_URL_PARAMS"]["entityId"]:""),AUTHOR_NAME:BX.formatName(o["AUTHOR"],t["NAME_TEMPLATE"],t["SHOW_LOGIN"]),AUTHOR_EXTRANET_STYLE:l,VOTE_ID:o["RATING"]&&o["RATING"]["VOTE_ID"]?o["RATING"]["VOTE_ID"]:"",AUTHOR_TOOLTIP_PARAMS:typeof o["AUTHOR_TOOLTIP_PARAMS"]!="undefined"?o["AUTHOR_TOOLTIP_PARAMS"]:"{}","background:url('') no-repeat center;":""}}else{for(s in a){if(a.hasOwnProperty(s)){a[s]=!!e[s]?e[s]:a[s]}}}for(s in a){if(a.hasOwnProperty(s)){a[s]=!!a[s]?a[s]:""}}a["SHOW_POST_FORM"]=BX("record-"+a["ENTITY_XML_ID"]+"-0-placeholder")?"Y":"N";for(var c in a){if(a.hasOwnProperty(c)){i=i.replace(new RegExp("#"+c+"#","g"),a[c])}}return i.replace("background:url('') no-repeat center;","").replace(/\001/gi,"#")};window["fcPull"]=function(e,t){BX.ajax({url:"/bitrix/components/bitrix/main.post.list/templates/.default/component_epilog.php",method:"POST",data:{AJAX_POST:"Y",ENTITY_XML_ID:e,MODE:"PUSH&PULL",sessid:BX.bitrix_sessid(),DATA:t}})};var newCommentsToCheckForReading={data:[],screen:{},timeout:0},traceForReading=function(e){newCommentsToCheckForReading.data.push(e);newCommentsToCheckForReading.screen=newCommentsToCheckForReading.screen||{scrollTop:BX.GetWindowScrollPos().scrollTop,time:(new Date).getTime()};newCommentsToCheckForReading.screen["checked"]=false;newCommentsToCheckForReading.timeout=newCommentsToCheckForReading.timeout||setTimeout(markReadComments,1e3)};BX.addCustomEvent(window,"OnUCRecordHasDrawn",function(e,t){traceForReading(t)});var markReadComments=function(){var e=BX.GetWindowScrollPos();if(e.scrollTop!=newCommentsToCheckForReading.screen["scrollTop"]){newCommentsToCheckForReading.screen["time"]=(new Date).getTime();newCommentsToCheckForReading.screen["scrollTop"]=e.scrollTop;newCommentsToCheckForReading.screen["checked"]=false}else if(!newCommentsToCheckForReading.screen["checked"]&&(new Date).getTime()-newCommentsToCheckForReading.screen["time"]>3e3){newCommentsToCheckForReading.screen["time"]=(new Date).getTime();newCommentsToCheckForReading.screen["checked"]=true;var t=0,i=BX.GetWindowInnerSize(),s=[],n,o,a,r;for(r=0;r<newCommentsToCheckForReading.data.length;r++){n=BX("record-"+newCommentsToCheckForReading.data[r].join("-")+"-cover");if(n){o=BX.pos(n);if(o.top>=e.scrollTop&&o.top<=e.scrollTop+i.innerHeight-20){BX.onCustomEvent(window,"OnUCCommentWasRead",[newCommentsToCheckForReading.data[r],n]);BX.removeClass(n,"comment-new-answer");a=BX.findChild(n,{className:"feed-com-block"},true,false);BX.removeClass(a,"feed-com-block-pointer-to-new feed-com-block-new");BX.addClass(a,"feed-com-block-read");t++}else{s.push(newCommentsToCheckForReading.data[r])}}}newCommentsToCheckForReading.data=s;if(t>0)BX.onCustomEvent(window,"onCounterDecrement",[t])}if(newCommentsToCheckForReading.data.length>0)newCommentsToCheckForReading.timeout=setTimeout(markReadComments,1e3);else{newCommentsToCheckForReading.timeout=0}};var MPLQuote=function(e){this.params=e;this.id=e["id"];this.closeByEsc=!!e["closeByEsc"];this.autoHide=!!e["autoHide"];this.autoHideTimeout=!!e["autoHideTimeout"]?parseInt(e["autoHideTimeout"]):0;if(this.params.classEvents){for(var t in this.params.classEvents)if(this.params.classEvents.hasOwnProperty(t))BX.addCustomEvent(this,t,this.params.classEvents[t])}this.node=document.createElement("A");BX.adjust(this.node,{props:{id:this.id},style:{zIndex:BX.PopupWindow.getOption("popupZindex")+this.params.zIndex,position:"absolute",display:"none",top:"0px",left:"0px"},attrs:{className:"mpl-quote-block",href:"#"},events:this.params.events});document.body.appendChild(this.node)};MPLQuote.prototype={show:function(e){var t=this.getPosition(this.node,e);
144BX.adjust(this.node,{style:{top:t.y+"px",left:t.x+"px",display:"block"}});BX.addClass(this.node,"mpl-quote-block-show");if(this.closeByEsc&&!this.isCloseByEscBinded){this.isCloseByEscBinded=BX.delegate(this._onKeyUp,this);BX.bind(document,"keyup",this.isCloseByEscBinded)}if(this.params.autoHide&&!this.isAutoHideBinded){setTimeout(BX.proxy(function(){BX.bind(this.node,"click",this.cancelBubble);this.isAutoHideBinded=BX.delegate(this.hide,this);BX.bind(document,"click",this.isAutoHideBinded)},this),0)}if(this.autoHideTimeout>0&&this.autoHideTimeoutInt<=0){if(!this.autoHideTimeoutBinded)this.autoHideTimeoutBinded=BX.delegate(this.hide,this);this.autoHideTimeoutInt=setTimeout(this.autoHideTimeoutBinded,this.autoHideTimeout)}},hide:function(e){if(!this.isShown())return;if(e&&!(BX.getEventButton(e)&BX.MSLEFT))return;this.node.style.display="none";if(this.isCloseByEscBinded){BX.unbind(document,"keyup",this.isCloseByEscBinded);this.isCloseByEscBinded=false}if(this.autoHideTimeout>0){clearTimeout(this.autoHideTimeoutInt);this.autoHideTimeoutInt=0}setTimeout(BX.proxy(this._hide,this),0)},_hide:function(){BX.onCustomEvent(this,"onQuoteHide",[this]);if(this.params.autoHide&&this.isAutoHideBinded){
145BX.unbind(this.node,"click",this.cancelBubble);BX.unbind(document,"click",this.isAutoHideBinded);this.isAutoHideBinded=false}BX.remove(this.node)},getPosition:function(e,t){var i;if(t.pageX==null){var s=document.documentElement,n=document.body;var o=t.clientX+(s&&s.scrollLeft||n&&n.scrollLeft||0)-(s.clientLeft||0);var a=t.clientY+(s&&s.scrollTop||n&&n.scrollTop||0)-(s.clientTop||0);i={x:o,y:a}}else{i={x:t.pageX,y:t.pageY}}return{x:i.x+5,y:i.y-16}},isShown:function(){return this.node.style.display=="block"},cancelBubble:function(e){if(!e)e=window.event;if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true},_onKeyUp:function(e){e=e||window.event;if(e.keyCode==27)this.hide(e)}};window.mplCheckForQuote=function(e,t,i,s){e=document.all?window.event:e;var n="",o,a=null;if(window.getSelection){o=window.getSelection();n=o.toString()}else if(document.selection){o=document.selection;n=o.createRange().text}if(n!=""){var r=BX.findParent(o.focusNode,{tagName:t.tagName,className:t.className},t),d=BX.findParent(o.anchorNode,{tagName:t.tagName,className:t.className},t);if(r!=d||r!=t){n=""}else{if(!!s&&BX(s,true)){var l=BX(s,true);if(!!l&&l.hasAttribute("bx-post-author-id")){a={id:parseInt(l.getAttribute("bx-post-author-id")),name:l.innerHTML}}}}}if(n!=""){BX.onCustomEvent(window,"onQuote"+i,[e,{text:n,author:a}]);return true}return false};window.mplReplaceUserPath=function(e){if(typeof e!="string"||e.length<=0){return""}if(BX("MPL_IS_EXTRANET_SITE")=="Y"){e=e.replace("/company/personal/user/","/extranet/contacts/personal/user/")}else{e=e.replace("/extranet/contacts/personal/user/","/company/personal/user/")}e=e.replace(new RegExp("[\\w/]*/mobile/users/\\?user_id=(\\d+)","igm"),BX("MPL_IS_EXTRANET_SITE")=="Y"?"/extranet/contacts/personal/user/$1/":"/company/personal/user/$1/");return e};BX.onCustomEvent("main.post.list/default",["script.js"])})();
146/* End */
147;
148; /* Start:"a:4:{s:4:"full";s:99:"/bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_form.min.js?166624706912332";s:6:"source";s:79:"/bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_form.js";s:3:"min";s:83:"/bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_form.min.js";s:3:"map";s:83:"/bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_form.map.js";}"*/
149(function(){window["UC"]=window["UC"]||{};if(!!window["FCForm"])return;window.FCForm=function(e){this.url="";this.lhe="";this.entitiesId={};this.form=BX(e["formId"]);this.handler=window.LHEPostForm.getHandler(e["editorId"]);this.editorName=e["editorName"];this.editorId=e["editorId"];this.windowEvents={OnUCUnlinkForm:BX.delegate(function(e){if(!!e&&!!this.entitiesId[e]){var t={},i=true;for(var s in this.entitiesId){if(this.entitiesId.hasOwnProperty(s)&&s!=e){i=false;t[s]=this.entitiesId[s]}}this.entitiesId=t;if(i&&!!this.windowEvents){for(s in this.windowEvents){if(this.windowEvents.hasOwnProperty(s)&&s)BX.removeCustomEvent(window,s,this.windowEvents[s])}this.windowEventsSet=false}}},this),OnUCQuote:BX.delegate(function(e,t,i){if(!this.entitiesId[e]||!this._checkTextSafety([e,0])){return}this.show([e,0]);var s=0;var n=function(){s++;if(s>10){return}if(!this.handler.oEditor||!this.handler.oEditor.action){return setTimeout(n,10)}if(!this.handler.oEditor.toolbar.controls.Quote){return}if(!t&&!i){return this.handler.oEditor.action.Exec("quote")}var e="";if(t){e=t.gender?BX.message("MPL_HAVE_WRITTEN_"+t.gender):BX.message("MPL_HAVE_WRITTEN");if(this.handler.oEditor.GetViewMode()==="wysiwyg"){if(t.id>0){t='<span id="'+this.handler.oEditor.SetBxTag(false,{tag:"postuser",userId:t.id,userName:t.name})+'" class="bxhtmled-metion">'+t.name.replace(/</gi,"&lt;").replace(/>/gi,"&gt;")+"</span>"}else{t="<span>"+t.name.replace(/</gi,"&lt;").replace(/>/gi,"&gt;")+"</span>"}e=t+e+"<br/>"}else if(this.handler.oEditor.bbCode){if(t.id>0){t="[USER="+t.id+"]"+t.name+"[/USER]"}else{t=t.name}e=t!==""?t+e+"\n":""}}if(this.handler.oEditor.action.actions.quote.setExternalSelectionFromRange){this.handler.oEditor.action.actions.quote.setExternalSelectionFromRange();var o=this.handler.oEditor.action.actions.quote.getExternalSelection();if(o===""&&i!==""){o=i}o=e+o;if(BX.type.isNotEmptyString(o)){this.handler.oEditor.action.actions.quote.setExternalSelection(o)}}else{this.handler.oEditor.action.actions.quote.setExternalSelection(i)}this.handler.oEditor.action.Exec("quote")}.bind(this);this.handler.exec(n)},this),OnUCReply:function(e,t,i,s,n){if(!this.entitiesId[e]||!this._checkTextSafety([e,0])||n.caught===true){return false}n.caught=true;this.show([e,0]);if(t>0){this.handler.exec(window.BxInsertMention,[{item:{entityId:t,name:i},type:"user",formID:this.form.id,editorId:this.editorId,bNeedComa:true,insertHtml:true}])}}.bind(this),OnUCAfterRecordEdit:BX.delegate(function(e,t,i,s){if(!!this.entitiesId[e]){
149if(s==="EDIT"){this.show([e,t],i["messageBBCode"],i["messageFields"]);this.editing=true}else{this.hide(true);if(!!i["errorMessage"]){this.id=[e,t];this.showError(i["errorMessage"])}else if(!!i["okMessage"]){this.id=[e,t];this.showNote(i["okMessage"]);this.id=null}}}},this)};this.linkEntity(e["entitiesId"]);BX.remove(BX("micro"+e["editorName"]));BX.remove(BX("micro"+e["editorId"]));this.eventNode=this.handler.eventNode;if(this.eventNode){BX.addCustomEvent(this.eventNode,"OnBeforeHideLHE",BX.delegate(function(){BX.removeClass(document.documentElement,"bx-ios-fix-frame-focus");if(top&&top["document"])BX.removeClass(top["document"]["documentElement"],"bx-ios-fix-frame-focus");if(!!this.id&&!!BX("uc-writing-"+this.form.id+"-"+this.id[0]+"-area")){BX.hide(BX("uc-writing-"+this.form.id+"-"+this.id[0]+"-area"))}},this));BX.addCustomEvent(this.eventNode,"OnAfterHideLHE",BX.delegate(function(){var e=this._getPlacehoder();if(e){BX.hide(e)}e=this._getSwitcher();if(e){BX.show(e);BX.focus(e.firstChild)}this.__content_length=0;if(!!this.id){BX.onCustomEvent(this.eventNode,"OnUCFormAfterHide",[this])}clearTimeout(this._checkWriteTimeout);this._checkWriteTimeout=0;this.clear();BX.onCustomEvent(window,"OnUCFeedChanged",[this.id])},this));BX.addCustomEvent(this.eventNode,"OnBeforeShowLHE",BX.delegate(function(){if(BX.browser.IsIOS()&&BX.browser.IsMobile()){BX.addClass(window["document"]["documentElement"],"bx-ios-fix-frame-focus");if(top&&top["document"])BX.addClass(top["document"]["documentElement"],"bx-ios-fix-frame-focus")}var e=this._getPlacehoder();if(e){BX.removeClass(e,"feed-com-add-box-no-form");BX.removeClass(e,"feed-com-add-box-header");BX.show(e)}e=this._getSwitcher();if(e){BX.hide(e)}if(!!this.id&&!!BX("uc-writing-"+this.form.id+"-"+this.id[0]+"-area")){BX.hide(BX("uc-writing-"+this.form.id+"-"+this.id[0]+"-area"))}},this));BX.addCustomEvent(this.eventNode,"OnAfterShowLHE",function(e,t){this._checkWrite(e,t);BX.onCustomEvent(window,"OnUCFeedChanged",[this.id])}.bind(this));BX.addCustomEvent(this.eventNode,"OnClickSubmit",BX.delegate(this.submit,this));BX.addCustomEvent(this.eventNode,"OnClickCancel",BX.delegate(this.cancel,this));BX.onCustomEvent(this.eventNode,"OnUCFormInit",[this])}this.id=null;this.jsCommentId=null;BX.addCustomEvent(window,"OnImageDataUriHandle",BX.delegate(this.showWait,this));BX.addCustomEvent(window,"OnImageDataUriCaughtUploaded",BX.delegate(this.closeWait,this));BX.addCustomEvent(window,"OnImageDataUriCaughtFailed",BX.delegate(this.closeWait,this))};window.FCForm.prototype={linkEntity:function(e){if(!!e){for(var t in e){if(e.hasOwnProperty(t)){BX.onCustomEvent(window,"OnUCUnlinkForm",[t]);this.entitiesId[t]=e[t]}}}if(!this.windowEventsSet&&!!this.entitiesId){BX.addCustomEvent(window,"OnUCUnlinkForm",this.windowEvents.OnUCUnlinkForm);BX.addCustomEvent(window,"OnUCReply",BX.debounce(this.windowEvents.OnUCReply,10));BX.addCustomEvent(window,"OnUCQuote",BX.debounce(this.windowEvents.OnUCQuote,10));BX.addCustomEvent(window,"OnUCAfterRecordEdit",this.windowEvents.OnUCAfterRecordEdit);this.windowEventsSet=true}},_checkTextSafety:function(e){if(this.id&&this.id.join("-")!==e.join("-")&&this.handler.editorIsLoaded&&this.handler.oEditor.IsContentChanged()){return window.confirm(BX.message("MPL_SAFE_EDIT"))}return true},_checkWrite:function(){if(this.handler.editorIsLoaded&&this._checkWriteTimeout!==false){this.__content_length=this.__content_length>0?this.__content_length:0;var e=this.handler.oEditor.GetContent(),t=2e3;if(e.length>=4&&this.__content_length!=e.length&&!!this.id){BX.onCustomEvent(window,"OnUCUserIsWriting",[this.id[0],{sent:false}]);t=3e4}this._checkWriteTimeout=setTimeout(this._checkWrite.bind(this),t);this.__content_length=e.length}},_getPlacehoder:function(e){e=!!e?e:this.id;return!!e?BX("record-"+e.join("-")+"-placeholder"):null},_getSwitcher:function(e){e=!!e?e:this.id;return!!e?BX("record-"+e[0]+"-switcher"):null},hide:function(e){if(this.eventNode.style.display!="none"){BX.onCustomEvent(this.eventNode,"OnShowLHE",[e===true?false:"hide"])}if(e){document.body.appendChild(this.form)}},clear:function(){this.editing=false;var e=this._getPlacehoder();if(!!e)BX.hide(e);this.clearNotification(e,"feed-add-error");BX.onCustomEvent(this.eventNode,"OnUCFormClear",[this]);var t=BX.findChild(this.form,{className:"wduf-placeholder-tbody"},true,false);
149if(t!==null&&typeof t!="undefined")BX.cleanNode(t,false);t=BX.findChild(this.form,{className:"wduf-selectdialog"},true,false);if(t!==null&&typeof t!="undefined")BX.hide(t);t=BX.findChild(this.form,{className:"file-placeholder-tbody"},true,false);if(t!==null&&typeof t!="undefined")BX.cleanNode(t,false);this.id=null;this.jsCommentId=null},show:function(e,t,i){if(this.id&&!!e&&this.id.join("-")==e.join("-")){var s=this._getPlacehoder(e);this.handler.oEditor.Focus();setTimeout(function(){var e=BX.pos(s);var t=BX.GetWindowSize(document);if(t.scrollTop>e.top){s.scrollIntoView()}else if(t.scrollTop+t.innerHeight<e.top){s.scrollIntoView(false)}},100);return true}else{this.hide(true)}this.id=e;this.jsCommentId=BX.util.getRandomString(20);var n=this._getPlacehoder();BX.removeClass(n,"feed-com-add-box-no-form");BX.removeClass(n,"feed-com-add-box-header");n.appendChild(this.form);BX.onCustomEvent(this.eventNode,"OnUCFormBeforeShow",[this,t,i]);BX.onCustomEvent(this.eventNode,"OnShowLHE",["show",null,this.id]);BX.onCustomEvent(this.eventNode,"OnUCFormAfterShow",[this,t,i]);return true},submit:function(){if(this.busy===true)return"busy";var e=this.handler.editorIsLoaded?this.handler.oEditor.GetContent():"";if(!e){this.showError(BX.message("JERROR_NO_MESSAGE"));return false}this.showWait();this.busy=true;var t={};window.convertFormToArray(this.form,t);t["REVIEW_TEXT"]=e;t["NOREDIRECT"]="Y";t["MODE"]="RECORD";t["AJAX_POST"]="Y";t["id"]=this.id;if(this.jsCommentId!==null)t["COMMENT_EXEMPLAR_ID"]=this.jsCommentId;t["SITE_ID"]=BX.message("SITE_ID");t["LANGUAGE_ID"]=BX.message("LANGUAGE_ID");t["ACTION"]="ADD";if(this.editing===true){t["REVIEW_ACTION"]="EDIT";t["FILTER"]={ID:this.id[1]};t["ACTION"]="EDIT";t["ID"]=this.id[1]}BX.onCustomEvent(this.eventNode,"OnUCFormSubmit",[this,t]);BX.onCustomEvent(window,"OnUCFormSubmit",[this.id[0],this.id[1],this,t]);var i=this.form.action;i=BX.util.remove_url_param(i,["b24statAction"]);i=BX.util.add_url_param(i,{b24statAction:this.id[1]>0?"editComment":"addComment"});this.form.action=i;BX.ajax({method:"POST",url:this.form.action,data:t,dataType:"json",onsuccess:BX.proxy(function(e){this.closeWait();var t=e,i=this.id[0];BX.onCustomEvent(this.eventNode,"OnUCFormResponse",[this,e]);if(!!this.OnUCFormResponseData)e=this.OnUCFormResponseData;if(!!e){if(e["errorMessage"]){this.showError(e["errorMessage"])}else if(e["status"]=="error"){this.showError(BX.type.isNotEmptyString(e["message"])?e["message"]:"")}else{BX.onCustomEvent(window,"OnUCAfterRecordAdd",[this.id[0],e,t]);this.hide(true)}}this.busy=false;BX.onCustomEvent(window,"OnUCFormResponse",[i,e["messageId"],this,e])},this),onfailure:BX.delegate(function(){this.closeWait();this.busy=false;BX.onCustomEvent(window,"OnUCFormResponse",[this.id[0],this.id[1],this,[]])},this)})},cancel:function(){},clearNotification:function(e,t){var i=BX.findChildren(e,{tagName:"DIV",className:t},true);if(!!i){var s=i.pop();do{BX.remove(s);BX.remove(s)}while((s=i.pop())&&!!s)}},showError:function(e){if(!e)return;var t=this._getPlacehoder();this.clearNotification(t,"feed-add-error");BX.addClass(t,!t.firstChild?"feed-com-add-box-no-form":"feed-com-add-box-header");t.insertBefore(BX.create("div",{attrs:{class:"feed-add-error"},html:'<span class="feed-add-info-text"><span class="feed-add-info-icon"></span>'+"<b>"+BX.message("FC_ERROR")+"</b><br />"+e+"</span>"}),t.firstChild);BX.show(t)},showNote:function(e){if(!e)return;var t=this._getPlacehoder();this.clearNotification(t,"feed-add-error");this.clearNotification(t,"feed-add-successfully");BX.addClass(t,!t.firstChild?"feed-com-add-box-no-form":"feed-com-add-box-header");t.insertBefore(BX.create("div",{attrs:{class:"feed-add-successfully"},html:'<span class="feed-add-info-text"><span class="feed-add-info-icon"></span>'+e+"</span>"}),t.firstChild);BX.addClass(t,"comment-deleted");BX.show(t)},showWait:function(){var e=BX("lhe_button_submit_"+this.form.id);this.busy=true;if(!!e){BX.addClass(e,"ui-btn-clock");BX.defer(function(){e.disabled=true})()}},closeWait:function(){var e=BX("lhe_button_submit_"+this.form.id);this.busy=false;if(!!e){e.disabled=false;BX.removeClass(e,"ui-btn-clock")}}};window.convertFormToArray=function(e,t){t=!!t?t:[];if(!!e){var i,s=[],n=e.elements.length;for(i=0;i<n;i++){var o=e.elements[i];if(o.disabled)continue;switch(o.type.toLowerCase()){case"text":case"textarea":case"password":case"hidden":case"select-one":s.push({name:o.name,value:o.value});break;case"radio":case"checkbox":if(o.checked)s.push({name:o.name,value:o.value});break;case"select-multiple":for(var d=0;d<o.options.length;d++){if(o.options[d].selected)s.push({name:o.name,value:o.options[d].value})}break;default:break}}var r=t;i=0;while(i<s.length){var a=s[i].name.indexOf("[");if(a==-1){r[s[i].name]=s[i].value;r=t;i++}else{var h=s[i].name.substring(0,a);var l=s[i].name.substring(a+1);if(!r[h])r[h]=[];var c=l.indexOf("]");
149if(c==-1){r=t;i++}else if(c===0){r=r[h];s[i].name=""+r.length}else{r=r[h];s[i].name=l.substring(0,c)+l.substring(c+1)}}}}return t};window["fRefreshCaptcha"]=function(e){var t=null,i=BX.findChild(e,{attr:{name:"captcha_code"}},true),s=BX.findChild(e,{attr:{name:"captcha_word"}},true),n=BX.findChild(e,{className:"comments-reply-field-captcha-image"},true);if(n)t=BX.findChild(n,{tag:"img"});if(i&&s&&t){s.value="";BX.ajax.getCaptcha(function(e){i.value=e["captcha_sid"];t.src="/bitrix/tools/captcha.php?captcha_code="+e["captcha_sid"]})}}})();
150/* End */
151;
152; /* Start:"a:4:{s:4:"full";s:96:"/bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_im.min.js?16662470698220";s:6:"source";s:77:"/bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_im.js";s:3:"min";s:81:"/bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_im.min.js";s:3:"map";s:81:"/bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_im.map.js";}"*/
153(function(){window["UC"]=!!window["UC"]?window["UC"]:{};if(!!window["UC"]["Informer"])return;window.SPC=function(){this.stack=[];this.stackTimeout=null;this.stackPopup={};this.stackPopupTimeout={};this.stackPopupTimeout2={};this.stackPopupId=0;this.stackOverflow=false;this.notifyShow=0;this.notifyHideTime=5e3;this.notifyHeightCurrent=10;this.notifyHeightMax=0;this.notifyGarbageTimeout=null;this.notifyAutoHide=true;this.notifyAutoHideTimeout=null};var t=window.SPC;t.prototype.add=function(t){if(typeof t!="object"||!t.html)return false;if(BX.type.isDomNode(t.html))t.html=t.html.outerHTML;this.stack.push(t);if(!this.stackOverflow)this.setShowTimer(300);return true};t.prototype.remove=function(t){delete this.stack[t]};t.prototype.show=function(){this.notifyHeightMax=document.body.offsetHeight;var t=BX.GetWindowInnerSize();for(var e=0;e<this.stack.length;e++){if(typeof this.stack[e]=="undefined")continue;var i=new BX.PopupWindow("bx-sbpc-notify-flash-"+this.stackPopupId,{top:0,left:0},{lightShadow:true,zIndex:200,events:{onPopupClose:BX.delegate(function(){BX.proxy_context.popupContainer.style.opacity=0;this.notifyShow--;this.notifyHeightCurrent-=BX.proxy_context.popupContainer.offsetHeight+10;this.stackOverflow=false;setTimeout(BX.delegate(function(){this.destroy()},BX.proxy_context),1500)},this),onPopupDestroy:BX.delegate(function(){BX.unbindAll(BX.findChild(BX.proxy_context.popupContainer,{className:"bx-spbc-notifier-item-delete"},true));BX.unbindAll(BX.proxy_context.popupContainer);delete this.stackPopup[BX.proxy_context.uniquePopupId];delete this.stackPopupTimeout[BX.proxy_context.uniquePopupId];delete this.stackPopupTimeout2[BX.proxy_context.uniquePopupId]},this)},bindOnResize:false,content:BX.create("div",{props:{className:"bx-notifyManager-item-sbpc"},html:this.stack[e].html})});i.notifyParams=this.stack[e];i.notifyParams.id=e;i.show();BX.removeClass(i.popupContainer.firstChild,"popup-window");i.popupContainer.style.left=10+"px";i.popupContainer.style.opacity=0;if(this.notifyHeightMax<this.notifyHeightCurrent+i.popupContainer.offsetHeight+10){if(this.notifyShow>0){i.destroy();this.stackOverflow=true;break}}BX.addClass(i.popupContainer,"bx-notifyManager-animation-spbc");new BX.easing({duration:500,start:{opacity:0}
153,finish:{opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(t){if(BX(i)&&BX(i.popupContainer))i.popupContainer.style.opacity=t.opacity/100}}).animate();i.popupContainer.style.top=t.innerHeight-this.notifyHeightCurrent-i.popupContainer.offsetHeight-10+"px";this.notifyHeightCurrent=this.notifyHeightCurrent+i.popupContainer.offsetHeight+10;this.stackPopupId++;this.notifyShow++;this.remove(e);this.stackPopupTimeout[i.uniquePopupId]=null;BX.bind(i.popupContainer,"mouseover",BX.delegate(function(){this.clearAutoHide()},this));BX.bind(i.popupContainer,"mouseout",BX.delegate(function(){this.setAutoHide(this.notifyHideTime/2)},this));BX.bind(i.popupContainer,"contextmenu",BX.delegate(function(t){if(this.stackPopup[BX.proxy_context.id].notifyParams.tag)this.closeByTag(this.stackPopup[BX.proxy_context.id].notifyParams.tag);else this.stackPopup[BX.proxy_context.id].close();return BX.PreventDefault(t)},this));var o=BX.findChildren(i.popupContainer,{tagName:"a"},true);for(var s=0;s<o.length;s++){if(o[s].href!="#")o[s].target="_blank"}BX.bind(BX.findChild(i.popupContainer,{className:"bx-spbc-notifier-item-delete"},true),"click",BX.delegate(function(t){var e=BX.proxy_context.parentNode.parentNode.parentNode.parentNode.id.replace("popup-window-content-","");if(this.stackPopup[e].notifyParams.close)this.stackPopup[e].notifyParams.close(this.stackPopup[e]);this.stackPopup[e].close();if(this.notifyAutoHide===false){this.clearAutoHide();this.setAutoHide(this.notifyHideTime/2)}return BX.PreventDefault(t)},this));if(i.notifyParams.click){i.popupContainer.style.cursor="pointer";BX.bind(i.popupContainer,"click",BX.delegate(function(t){this.notifyParams.click(this);return BX.PreventDefault(t)},i))}this.stackPopup[i.uniquePopupId]=i}if(this.stack.length>0){this.clearAutoHide(true);this.setAutoHide(this.notifyHideTime)}this.garbage()};t.prototype.closeByTag=function(t){for(var e=0;e<this.stack.length;e++){if(typeof this.stack[e]!="undefined"&&this.stack[e].tag==t){delete this.stack[e]}}for(e in this.stackPopup){if(this.stackPopup.hasOwnProperty(e))if(this.stackPopup[e].notifyParams.tag==t)this.stackPopup[e].close()}};t.prototype.setShowTimer=function(t){clearTimeout(this.stackTimeout);this.stackTimeout=setTimeout(BX.delegate(this.show,this),t)};t.prototype.setAutoHide=function(t){this.notifyAutoHide=true;clearTimeout(this.notifyAutoHideTimeout);this.notifyAutoHideTimeout=setTimeout(BX.delegate(function(){for(var e in this.stackPopupTimeout){if(this.stackPopupTimeout.hasOwnProperty(e)){this.stackPopupTimeout[e]=setTimeout(BX.delegate(function(){this.close()},this.stackPopup[e]),t-1e3);this.stackPopupTimeout2[e]=setTimeout(BX.delegate(function(){this.setShowTimer(300)},this),t-700)}}},this),1e3)};t.prototype.clearAutoHide=function(t){clearTimeout(this.notifyGarbageTimeout);this.notifyAutoHide=false;t=t===true;var e;if(t){clearTimeout(this.stackTimeout);for(e in this.stackPopupTimeout){if(this.stackPopupTimeout.hasOwnProperty(e)){clearTimeout(this.stackPopupTimeout[e]);clearTimeout(this.stackPopupTimeout2[e])}}}else{clearTimeout(this.notifyAutoHideTimeout);this.notifyAutoHideTimeout=setTimeout(BX.delegate(function(){clearTimeout(this.stackTimeout);for(var t in this.stackPopupTimeout){if(this.stackPopupTimeout.hasOwnProperty(t)){clearTimeout(this.stackPopupTimeout[t]);clearTimeout(this.stackPopupTimeout2[t])}}},this),300)}};t.prototype.garbage=function(){clearTimeout(this.notifyGarbageTimeout);this.notifyGarbageTimeout=setTimeout(BX.delegate(function(){var t=[];for(var e=0;e<this.stack.length;e++){if(typeof this.stack[e]!="undefined")t.push(this.stack[e])}this.stack=t},this),1e4)};t.prototype.check=function(t,e,i,o){if(t[1]<=0||!window["UC"]["Informer"]||!BX.type.isNotEmptyString(o))return;var s=/(\d+)/g.exec(t[0]),n=BX("record-"+t.join("-")+"-cover");s=!!s?parseInt(s):0;if(s<=0||!n)return false;else if(BX.util.in_array(s,window["UC"]["InformerTags"][i]))return true;window["UC"]["InformerTags"][i].push(s);var a=!!e&&!!e["messageFields"]?e["messageFields"]:false;if(!a)return;var r=BX.pos(n),p=BX.GetWindowScrollPos(),u=BX.GetWindowInnerSize();if(r.top<p.scrollTop||r.top>
153p.scrollTop+u.innerHeight-20){setTimeout(function(){if(parseInt(a["AUTHOR"]["ID"])!=parseInt(BX.message("USER_ID"))){var e=BX.create("div",{props:{className:"bx-spbc-notifier-item"},children:[BX.create("span",{props:{className:"bx-spbc-notifier-item-content"},children:[BX.create("span",{props:{className:"bx-spbc-notifier-item-avatar"},children:[!!a["AUTHOR"]["AVATAR"]?BX.create("img",{props:{className:"bx-spbc-notifier-item-avatar-img"},attrs:{src:a["AUTHOR"]["AVATAR"]}}):""]}),BX.create("a",{attrs:{href:"#"},props:{className:"bx-spbc-notifier-item-delete"}}),BX.create("span",{props:{className:"bx-spbc-notifier-item-name"},html:a["AUTHOR"]["NAME"]}),BX.create("span",{props:{className:"bx-spbc-notifier-item-time"},html:a["POST_TIME"]}),BX.create("span",{props:{className:"bx-spbc-notifier-item-text"}}),BX.create("span",{props:{className:"bx-spbc-notifier-item-text2"},html:'"'+o+'"'})]})]}),i=BX.GetWindowScrollPos();window["UC"]["Informer"].add({html:e,tag:"im-record-"+t.join("-"),click:BX.delegate(function(){var e=BX.pos(BX("record-"+t.join("-")));new BX.easing({duration:500,start:{scroll:i.scrollTop},finish:{scroll:e.top-100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(t){window.scrollTo(0,t.scroll)}}).animate()},this)})}},50)}};t.NativeNotify=function(){return window.webkitNotifications&&window.webkitNotifications.checkPermission()==0};window["UC"]["Informer"]=new t;window["UC"]["InformerTags"]={};t.notifyManagerShow=function(){BX.ready(function(){BX.addCustomEvent("onNotifyManagerShow",function(t){if(t.originalTag){var e=t.originalTag.lastIndexOf("|"),i=t.originalTag.substr(0,e);if(!!window["UC"]["InformerTags"][i]){var o=parseInt(t.originalTag.substr(e+1));window["UC"]["InformerTags"][i].push(o)}}})})}})();
154/* End */
155;
156; /* Start:"a:4:{s:4:"full";s:103:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/.default/script.min.js?166624702327916";s:6:"source";s:83:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/.default/script.js";s:3:"min";s:87:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/.default/script.min.js";s:3:"map";s:87:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/.default/script.map.js";}"*/
157BX.CLBlock=function(e){this.arData=[];this.arData["Subscription"]=[];this.UTPopup=null;this.createTaskPopup=null;this.entity_type=null;this.entity_id=null;this.event_id=null;this.event_id_fullset=false;this.cb_id=null;this.t_val=null;this.ind=null;this.type=null};BX.CLBlock.prototype.DataParser=function(str){str=str.replace(/^\s+|\s+$/g,"");while(str.length>0&&str.charCodeAt(0)==65279)str=str.substring(1);if(str.length<=0)return false;if(str.substring(0,1)!="{"&&str.substring(0,1)!="["&&str.substring(0,1)!="*")str='"*"';eval("arData = "+str);return arData};function __logFilterShow(){if(BX("bx_sl_filter").style.display=="none"){BX("bx_sl_filter").style.display="block";BX("bx_sl_filter_hidden").style.display="none"}else{BX("bx_sl_filter").style.display="none";BX("bx_sl_filter_hidden").style.display="block"}}if(!window.XMLHttpRequest){var XMLHttpRequest=function(){try{return new ActiveXObject("MSXML3.XMLHTTP")}catch(e){}try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("MSXML2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}var sonetLXmlHttpGet=new XMLHttpRequest;var sonetLXmlHttpSet=new XMLHttpRequest;var LBlock=new BX.CLBlock;function __logOnAjaxInsertToNode(e){var t=false;if(BX("sonet_log_more_container")){nodeTmp1=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="none";nodeTmp2.style.display="inline"}t=BX.pos(BX("sonet_log_more_container"));nodeTmp1Cap=document.body.appendChild(BX.create("div",{style:{position:"absolute",width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:1e3}}))}if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);
157if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="none";nodeTmp2.style.display="inline"}t=BX.pos(BX("sonet_log_more_container"));nodeTmp2Cap=document.body.appendChild(BX.create("div",{style:{position:"absolute",width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:1e3}}))}BX.unbind(BX("sonet_log_counter_2_container"),"click",__logOnAjaxInsertToNode)}function sonetLClearContainerExternalNew(){logAjaxMode="new"}function sonetLClearContainerExternalMore(){logAjaxMode="more"}function _sonetLClearContainerExternal(e){if(BX("sonet_log_more_container")){nodeTmp1=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="inline";nodeTmp2.style.display="none"}}if(BX("sonet_log_counter_2_wrap")){BX.removeClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim");BX("sonet_log_counter_2_wrap").style.visibility="hidden"}if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);nodeTmp3=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-reload"},false);
157if(nodeTmp1&&nodeTmp2&&nodeTmp3){nodeTmp1.style.display="inline";nodeTmp2.style.display="none";nodeTmp3.style.display="none"}}if(nodeTmp1Cap&&nodeTmp1Cap.parentNode){nodeTmp1Cap.parentNode.removeChild(nodeTmp1Cap)}if(nodeTmp2Cap&&nodeTmp2Cap.parentNode){nodeTmp2Cap.parentNode.removeChild(nodeTmp2Cap)}if(BX("sonet_log_counter_preset")&&logAjaxMode=="new"){BX("sonet_log_counter_preset").style.display="none"}}function __logChangeCounter(e){var t=parseInt(e)<=0;oCounter={iCommentsRead:0};BX.onCustomEvent(window,"onSonetLogChangeCounter",[oCounter]);e-=oCounter.iCommentsRead;__logChangeCounterAnimate(parseInt(e)>0,e,t)}function __logDecrementCounter(e){if(BX("sonet_log_counter_2")){e=parseInt(e);var t=parseInt(BX("sonet_log_counter_2").innerHTML);var n=t-e;if(n>0)BX("sonet_log_counter_2").innerHTML=n;else __logChangeCounterAnimate(false,0)}}function __logChangeCounterAnimate(e,t,n){n=!!n;if(!!window.bLockCounterAnimate){setTimeout(function(){__logChangeCounterAnimate(e,t)},200);return false}e=!!e;if(e){if(BX("sonet_log_counter_2"))BX("sonet_log_counter_2").innerHTML=t;if(BX("sonet_log_counter_2_wrap")){BX("sonet_log_counter_2_wrap").style.visibility="visible";BX.addClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim")}}else if(BX("sonet_log_counter_2_wrap")){if(n&&BX.hasClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim")){if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);nodeTmp3=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-reload"},false);
157if(nodeTmp1&&nodeTmp2&&nodeTmp3){nodeTmp1.style.display="none";nodeTmp2.style.display="none";nodeTmp3.style.display="inline"}}}else setTimeout(function(){BX.removeClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim");BX("sonet_log_counter_2_wrap").style.visibility="hidden"},400)}}function __logChangeCounterArray(e){if(typeof e[BX.message("sonetLCounterType")]!="undefined")__logChangeCounter(e[BX.message("sonetLCounterType")])}function __logShowPostMenu(e,t,n,o,s,a,i,r,l,d){BX.PopupMenu.destroy("post-menu-"+t);var f=null;if(BX.message("sonetLbUseFavorites")!="N"){f={text:l?BX.message("sonetLMenuFavoritesTitleY"):BX.message("sonetLMenuFavoritesTitleN"),className:"menu-popup-no-icon",onclick:function(e){__logChangeFavorites(r,"log_entry_favorites_"+r,l?"N":"Y",true);return BX.PreventDefault(e)}}}var p=[e.getAttribute("data-log-entry-url").length>0?{text:'<span id="post-menu-'+t+'-href-text">'+BX.message("sonetLMenuHref")+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-href",href:e.getAttribute("data-log-entry-url")}:null,e.getAttribute("data-log-entry-url").length>0?{text:'<span id="post-menu-'+t+'-link-text">'+BX.message("sonetLMenuLink")+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-link",onclick:function(){id="post-menu-"+t+"-link",it=BX.proxy_context,height=parseInt(!!it.getAttribute("bx-height")?it.getAttribute("bx-height"):it.offsetHeight);if(it.getAttribute("bx-status")!="shown"){it.setAttribute("bx-status","shown");if(!BX(id)&&!!BX(id+"-text")){var n=BX(id+"-text"),o=BX.pos(n),s=BX.pos(n.parentNode);pos3=BX.pos(BX.findParent(n,{className:"menu-popup-item"},true));o["height"]=s["height"]-1;BX.adjust(it,{attrs:{"bx-height":it.offsetHeight},style:{overflow:"hidden",display:"block"},children:[BX.create("BR"),BX.create("DIV",{attrs:{id:id},children:[BX.create("SPAN",{attrs:{className:"menu-popup-item-left"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-icon"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-text"},children:[BX.create("INPUT",{attrs:{id:id+"-input",type:"text",value:e.getAttribute("data-log-entry-url")},style:{height:o["height"]+"px",width:pos3["width"]-21+"px"},events:{click:function(e){this.select();BX.PreventDefault(e)}}})]})]}),BX.create("SPAN",{className:"menu-popup-item-right"})]})}new BX.fx({time:.2,step:.05,type:"linear",start:height,finish:height*2,callback:BX.delegate(function(e){this.style.height=e+"px"},it)}).start();BX.fx.show(BX(id),.2);BX(id+"-input").select()}else{it.setAttribute("bx-status","hidden");new BX.fx({time:.2,step:.05,type:"linear",start:it.offsetHeight,finish:height,callback:BX.delegate(function(e){this.style.height=e+"px"},it)}).start();BX.fx.hide(BX(id),.2)}}}:null,f,BX.message("sonetLCanDelete")=="Y"?{text:BX.message("sonetLMenuDelete"),className:"menu-popup-no-icon",onclick:function(e){if(confirm(BX.message("sonetLMenuDeleteConfirm"))){__logDelete(r,"log-entry-"+r,t)}return BX.PreventDefault(e)}}:null];if(!!d&&BX.type.isArray(d)){for(var c=0;c<d.length;c++)if(typeof d[c].className=="undefined")d[c].className="menu-popup-no-icon";p=BX.util.array_merge(p,d)}var u={offsetLeft:-14,offsetTop:4,lightShadow:false,angle:{position:"top",offset:50},events:{onPopupShow:function(e){if(BX("log_entry_favorites_"+r)){var n=BX.findChildren(e.contentContainer,{className:"menu-popup-item-text"},true);if(n!=null){for(var o=0;o<n.length;o++){if(n[o].innerHTML==BX.message("sonetLMenuFavoritesTitleY")||n[o].innerHTML==BX.message("sonetLMenuFavoritesTitleN")){var s=n[o];break}}}if(s!=undefined){if(BX.hasClass(BX("log_entry_favorites_"+r),"feed-post-important-switch-active"))BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY");else BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}if(BX("post-menu-"+t+"-link")){var a=BX.findChild(e.popupContainer,{className:"feed-entry-popup-menu-link"},true,false);if(a){var i=parseInt(!!a.getAttribute("bx-height")?a.getAttribute("bx-height"):0);if(i>0){BX("post-menu-"+t+"-link").style.display="none";a.setAttribute("bx-status","hidden");a.style.height=i+"px"}}}}}};BX.PopupMenu.show("post-menu-"+t,e,p,u)}
157function __logCommentFormAutogrow(e){var t=0;if(e&&BX.type.isDomNode(e))var n=e;else{var n=BX.proxy_context;var o=e||window.event;if((o.keyCode==13||o.keyCode==10)&&o.ctrlKey)__logCommentAdd()}var s=BX.findParent(n,{className:"sonet-log-comment-form-place"});if(BX(s))t=BX(s).offsetHeight;var a=0;var i=n.value.split("\n");for(var r=i.length-1;r>=0;--r)a+=Math.floor(i[r].length/CommentFormColsDefault+1);if(a>=CommentFormRowsDefault)n.rows=a+1;else n.rows=CommentFormRowsDefault}function __logGetNextPage(e,t,n){if(oLF.bLoadStarted){return false}oLF.bLoadStarted=true;window.bLockCounterAnimate=true;t=!!t;if(!t&&BX("feed-new-message-inf-wrap")){BX("feed-new-message-inf-wrap").classList.toggle("feed-new-message-anim")}var o={method:"GET",url:e};BX.onCustomEvent("SonetLogBeforeGetNextPage",[o]);if(BX.type.isNotEmptyString(o.url)){e=o.url}BX.ajax({url:e,method:"GET",dataType:"json",data:{},onsuccess:function(e){oLF.bLoadStarted=false;if(!t&&typeof n!="undefined"&&n&&n.parentNode){BX.cleanNode(n.parentNode,true)}window.bLockCounterAnimate=false;if(typeof e!="undefined"&&typeof e.PROPS!="undefined"&&typeof e.PROPS.CONTENT!="undefined"&&e.PROPS.CONTENT.length>0&&(typeof e.LAST_TS=="undefined"||parseInt(e.LAST_TS)<=0||parseInt(BX.message("sonetLFirstPageLastTS"))<=0||parseInt(e.LAST_TS)<parseInt(BX.message("sonetLFirstPageLastTS")))){var o="content_block_"+Math.floor(Math.random()*1e3);oLF.processAjaxBlock(e.PROPS,o,t);_sonetLClearContainerExternal(false);if(t){BX("feed-new-message-inf-wrap-first").style.display="block";var s=function(){if(BX(o)){BX(o).style.display="block"}BX.unbind(BX("sonet_log_more_container_first"),"click",s);BX("feed-new-message-inf-wrap-first").style.display="none";__logRecalcMoreButton()};BX.bind(BX("sonet_log_more_container_first"),"click",s)}else{setTimeout(function(){__logRecalcMoreButton()},1e3)}}},onfailure:function(e){oLF.bLoadStarted=false;if(!t&&BX("feed-new-message-inf-wrap")){BX("feed-new-message-inf-wrap").classList.toggle("feed-new-message-anim")}window.bLockCounterAnimate=false;_sonetLClearContainerExternal(false)}});return false}function __logGetNextPageLinkEntities(e,t){if(!!window.__logGetNextPageFormName&&!!e&&!!t&&!!window["UC"]&&!!window["UC"][window.__logGetNextPageFormName]&&!!window["UC"][window.__logGetNextPageFormName].linkEntity){window["UC"][window.__logGetNextPageFormName].linkEntity(e);for(var n in t){if(!!n&&!!t[n])window["UC"][window.__logGetNextPageFormName]["entitiesCorrespondence"][n]=t[n]}}}function __logRefresh(e){if(oLF.bLoadStarted){return}var t=BX("sonet_log_counter_2_wrap",true);oLF.bLoadStarted=true;if(t){var n=BX.findChild(t,{tag:"span",className:"feed-new-message-inf-text-reload"},true);if(n){n.style.display="none"}}window.bLockCounterAnimate=true;BX.ajax({url:e,method:"GET",dataType:"json",data:{},onsuccess:function(e){oLF.bLoadStarted=false;if(typeof e!="undefined"&&typeof e.PROPS!="undefined"&&typeof e.PROPS.CONTENT!="undefined"&&e.PROPS.CONTENT.length>0){window.bLockCounterAnimate=false;BX.cleanNode("log_internal_container",false);oLF.processAjaxBlock(e.PROPS);_sonetLClearContainerExternal(false);window.bStopTrackNextPage=false;if(BX("feed-new-message-inf-wrap-first")){BX("feed-new-message-inf-wrap-first").style.display="none"}if(typeof arCommentsMoreButtonID!="undefined"){arCommentsMoreButtonID=[]}if(t&&BX.hasClass(t,"feed-new-message-informer-fixed")){var n=BX("feed-up-btn-wrap",true);if(n){n.style.display="none";BX.removeClass(n,"feed-up-btn-wrap-anim")}var o=BX.GetWindowScrollPos();new BX.easing({duration:500,start:{scroll:o.scrollTop},finish:{scroll:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){window.scrollTo(0,e.scroll)},complete:function(){if(n)n.style.display="block";BX.onCustomEvent(window,"onGoUp")}}).animate()}}else{oLF.showRefreshError()}},onfailure:function(e){oLF.bLoadStarted=false;oLF.showRefreshError()}});return false}function __logChangeFavorites(e,t,n,o){if(!e||!BX(t)){return}if(!!o){var s=BX.proxy_context;if(!BX.hasClass(BX(s),"menu-popup-item-text")){s=BX.findChild(BX(s),{className:"menu-popup-item-text"},true)}}var a=BX.hasClass(BX(t),"feed-post-important-switch")?BX(t):BX.findChild(BX(t),{className:"feed-post-important-switch"});if(n!=undefined){if(n=="Y"){BX.addClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleY");
157if(typeof s!="undefined"){BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY")}}else{BX.removeClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleN");if(typeof s!="undefined"){BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}}var i=new XMLHttpRequest;i.open("POST",BX.message("sonetLESetPath"),true);i.setRequestHeader("Content-Type","application/x-www-form-urlencoded");i.onreadystatechange=function(){if(i.readyState==4){if(i.status==200){var e=LBlock.DataParser(i.responseText);if(typeof e=="object"){if(e[0]=="*"){if(sonetLErrorDiv!=null){sonetLErrorDiv.style.display="block";sonetLErrorDiv.innerHTML=i.responseText}return}i.abort();var t="";if(e["bResult"]!=undefined&&(e["bResult"]=="Y"||e["bResult"]=="N")){if(e["bResult"]=="Y"){BX.addClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleY");if(s!=undefined)BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY")}else{BX.removeClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleN");if(s!=undefined)BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}}}else{}}};i.send("r="+Math.floor(Math.random()*1e3)+"&"+BX.message("sonetLSessid")+"&site="+BX.util.urlencode(BX.message("sonetLSiteId"))+"&log_id="+encodeURIComponent(e)+"&action=change_favorites")}function __logDelete(e,t,n){if(!e){return}if(!BX(t)){return}BX.ajax({url:BX.message("sonetLESetPath"),method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),site:BX.message("sonetLSiteId"),log_id:e,action:"delete"},onsuccess:function(e){if(e.bResult!=undefined&&e.bResult=="Y"){if(typeof n!="undefined"){BX.PopupMenu.destroy("post-menu-"+n)}__logDeleteSuccess(BX(t))}else{__logDeleteFailure(BX(t))}},onfailure:function(e){__logDeleteFailure(BX(t))}})}function __logDeleteSuccess(e){if(typeof e=="undefined"||!e||!BX(e)){return}new BX.fx({time:.5,step:.05,type:"linear",start:BX(e).offsetHeight,finish:60,callback:BX.delegate(function(e){this.style.height=e+"px"},BX(e)),callback_start:BX.delegate(function(){this.style.overflow="hidden";this.style.minHeight=0},BX(e)),callback_complete:BX.delegate(function(){this.style.marginBottom=0;BX.cleanNode(this);this.appendChild(BX.create("DIV",{props:{className:"feed-add-successfully"},style:{marginLeft:"17px",marginRight:"17px",marginTop:"10px"},children:[BX.create("span",{props:{className:"feed-add-info-text"},children:[BX.create("span",{props:{className:"feed-add-info-icon"}}),BX.create("span",{html:BX.message("sonetLMenuDeleteSuccess")})]})]}))},BX(e))}).start()}function __logDeleteFailure(e){if(typeof e=="undefined"||!e||!BX(e)){return}e.insertBefore(BX.create("DIV",{props:{className:"feed-add-error"},style:{marginLeft:"84px",marginRight:"37px",marginTop:"18px",marginBottom:"4px"},children:[BX.create("span",{props:{className:"feed-add-info-text"},children:[BX.create("span",{props:{className:"feed-add-info-icon"}}),BX.create("span",{html:BX.message("sonetLMenuDeleteFailure")})]})]}),e.firstChild)}function __logOnFeedScroll(){if(window.feedScrollLock==undefined||window.feedScrollLock===false){window.feedScrollLock=true;setTimeout(function(){window.feedScrollLock=false},100);var e=BX.GetWindowSize();if(window.bStopTrackNextPage===undefined||window.bStopTrackNextPage==false){var t=parseInt(e.scrollHeight/2);if(e.scrollHeight-e.innerHeight<t){t=1}if(e.scrollTop>=t&&next_url){window.bStopTrackNextPage=true;__logGetNextPage(next_url,true)}}}var n=BX("sonet_log_counter_2_wrap",true);if(n){var o=n.parentNode.getBoundingClientRect().top;if(o<=0){BX.addClass(n,"feed-new-message-informer-fixed");setTimeout(function(){if(BX.hasClass(n,"feed-new-message-informer-fixed")){BX.addClass(n,"feed-new-message-informer-fix-anim")}},100)}else{BX.removeClass(n,"feed-new-message-informer-fixed feed-new-message-informer-fix-anim")}}}function __logScrollInit(e){if(!!e){BX.unbind(window,"scroll",__logOnFeedScroll);BX.bind(window,"scroll",__logOnFeedScroll)}else{BX.unbind(window,"scroll",__logOnFeedScroll)}}function __logRecalcMoreButton(){if(typeof arMoreButtonID!="undefined"){var e=false;var t=false;var n=false;var o=false;for(var s=0;s<arMoreButtonID.length;s++){e=BX.pos(BX(arMoreButtonID[s].bodyBlockID));if(e.height<280){BX(arMoreButtonID[s].moreButtonBlockID).style.display="none"}if(typeof arMoreButtonID[s].outerBlockID!="undefined"){n=BX(arMoreButtonID[s].outerBlockID);if(n){t=BX.pos(n);if(t.width<e.width){o=BX.findChild(n,{tag:"div",className:"feed-post-text-block-inner"},false);o.style.overflowX="scroll"}}}}}if(typeof arCommentsMoreButtonID!="undefined"){var e=false;for(var s=0;s<arCommentsMoreButtonID.length;s++){e=BX.pos(BX(arCommentsMoreButtonID[s].bodyBlockID));if(e.height<200){BX(arCommentsMoreButtonID[s].moreButtonBlockID).style.display="none"}}}}window.__socOnUCFormClear=function(e){LHEPostForm.reinitDataBefore(e.editorId)};window.__socOnUCFormAfterShow=function(e,t,n){n=!!n?n:{};var o=e.entitiesCorrespondence[e.id.join("-")][0],s=e.entitiesCorrespondence[e.id.join("-")][1];BX.show(BX("feed_comments_block_"+o));BX.onCustomEvent(window,"OnBeforeSocialnetworkCommentShowedUp",["socialnetwork"]);e.form.action=e.url.replace(/\#eId\#/,o).replace(/\#id\#/,s);var a={ENTITY_XML_ID:e.id[0],ENTITY_TYPE:e.entitiesId[e.id[0]][0],ENTITY_ID:e.entitiesId[e.id[0]][1],parentId:e.id[1],comment_post_id:e.entitiesId[e.id[0]][1],edit_id:e.id[1],act:e.id[1]>0?"edit":"add",logId:e.entitiesId[e.id[0]][2]};for(var i in a){if(!e.form[i]){e.form.appendChild(BX.create("INPUT",{attrs:{name:i,type:"hidden"}}))}e.form[i].value=a[i]}__socOnLightEditorShow(t,n)};window.__socOnUCFormSubmit=function(e,t){t["r"]=Math.floor(Math.random()*1e3);t["sessid"]=BX.bitrix_sessid();t["log_id"]=e.entitiesCorrespondence[e.id.join("-")][0];t["p_smile"]=BX.message("sonetLPathToSmile");t["p_ubp"]=BX.message("sonetLPathToUserBlogPost");t["p_gbp"]=BX.message("sonetLPathToGroupBlogPost");t["p_umbp"]=BX.message("sonetLPathToUserMicroblogPost");t["p_gmbp"]=BX.message("sonetLPathToGroupMicroblogPost");t["p_user"]=BX.message("sonetLPathToUser");t["p_le"]=BX.message("sonetLEPath");t["f_id"]=BX.message("sonetLForumID");t["bapc"]=BX.message("sonetLBlogAllowPostCode");t["site"]=BX.message("sonetLSiteId");t["lang"]=BX.message("sonetLLangId");t["nt"]=BX.message("sonetLNameTemplate");t["sl"]=BX.message("sonetLShowLogin");t["as"]=BX.message("sonetLAvatarSizeComment");t["dtf"]=BX.message("sonetLDateTimeFormat");t["message"]=t["REVIEW_TEXT"];t["action"]="add_comment";t["RATING_TYPE"]=BX.message("sonetRatingType");t["pull"]="Y";t["crm"]=BX.message("sonetLIsCRM");e.form["bx-action"]=e.form.action;e.form.action=BX.message("sonetLESetPath")};window.__socOnUCFormResponse=function(e,t){e.form.action=e.form["bx-action"];var n={errorMessage:t},o=e.entitiesCorrespondence[e.id.join("-")][0],s={};if(!(!!t&&typeof t=="object")){}else if(t[0]=="*"){n={errorMessage:BX.message("sonetLErrorSessid")}}else{if(!(t["commentID"]>0)||!!t["strMessage"])n["errorMessage"]=t["strMessage"];else if(t["return_data"])n=t["return_data"];
157else{var a=t["arCommentFormatted"],i=t["arComment"],r=!!window["__logBuildRating"]?window["__logBuildRating"](t["arComment"],t["arCommentFormatted"]):null,l=!!i["SOURCE_ID"]?i["SOURCE_ID"]:i["ID"],s={ID:l,ENTITY_XML_ID:e.id[0],FULL_ID:[e.id[0],l],NEW:"N",APPROVED:"Y",POST_TIMESTAMP:t["timestamp"]-BX.message("USER_TZ_OFFSET"),POST_TIME:a["LOG_TIME_FORMAT"],POST_DATE:a["LOG_TIME_FORMAT"],"~POST_MESSAGE_TEXT":a["MESSAGE"],POST_MESSAGE_TEXT:a["MESSAGE_FORMAT"],PANELS:{MODERATE:false},URL:{LINK:i["URL"]&&i["URL"].length>0?i["URL"]:BX.message("sonetLEPath").replace("#log_id#",i["LOG_ID"])+"?commentId="+i["ID"]+"#com"+(parseInt(i["SOURCE_ID"])>0?i["SOURCE_ID"]:i["ID"])},AUTHOR:{ID:a["USER_ID"],NAME:a["CREATED_BY"]["FORMATTED"],URL:a["CREATED_BY"]["URL"],AVATAR:a["AVATAR_SRC"]},BEFORE_ACTIONS:!!r?r:"",AFTER:a["UF"]};if(typeof t["hasEditCallback"]!="undefined"&&t["hasEditCallback"]=="Y"){s["PANELS"]["EDIT"]="Y";s["URL"]["EDIT"]="__logEditComment('"+e.id[0]+"', '"+i["ID"]+"', '"+i["LOG_ID"]+"');"}if(typeof t["hasDeleteCallback"]!="undefined"&&t["hasDeleteCallback"]=="Y"){s["PANELS"]["DELETE"]="Y";s["URL"]["DELETE"]=BX.message("sonetLESetPath")+"?lang="+BX.message("sonetLLangId")+"&action=delete_comment&delete_comment_id="+i["ID"]+"&post_id="+i["LOG_ID"]+"&site="+BX.message("sonetLSiteId")}n={errorMessage:"",okMessage:"",status:true,message:"",messageCode:a["MESSAGE"],messageId:[e.id[0],l],"~message":"",messageFields:s}}var d=BX("log_entry_follow_"+o,true),f=!!d?d.getAttribute("data-follow")=="Y"?"Y":"N":false;if(f=="N"){BX.findChild(d,{tagName:"a"}).innerHTML=BX.message("sonetLFollowY");d.setAttribute("data-follow","Y")}var d=BX("feed-comments-all-cnt-"+o,true),p=!!d?d.innerHTML.length>0?parseInt(d.innerHTML):0:false;if(p!==false)d.innerHTML=p+1}e.OnUCFormResponseData=n};window.__socOnLightEditorShow=function(e,t){var n={};if(t["arFiles"]){var o={},s,a;for(var i=0;i<t["arFiles"].length;i++){s=BX.findChild(BX("wdif-doc-"+t["arFiles"][i]),{className:"feed-com-file-name"},true);a=BX.findChild(BX("wdif-doc-"+t["arFiles"][i]),{className:"feed-con-file-size"},true);o["F"+i]={FILE_ID:t["arFiles"][i],FILE_NAME:s?s.innerHTML:"noname",FILE_SIZE:a?a.innerHTML:"unknown",CONTENT_TYPE:"notimage/xyz"}}n["UF_SONET_COM_DOC"]={USER_TYPE_ID:"file",FIELD_NAME:"UF_SONET_COM_FILE[]",VALUE:o}}if(t["arDocs"])n["UF_SONET_COM_FILE"]={USER_TYPE_ID:"webdav_element",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:BX.clone(t["arDocs"])};if(t["arDFiles"])n["UF_SONET_COM_FILE"]={USER_TYPE_ID:"disk_file",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:BX.clone(t["arDFiles"])};LHEPostForm.reinitData(SLEC.editorId,e,n)};BitrixLF=function(){this.bLoadStarted=false};BitrixLF.prototype.showRefreshError=function(){window.bLockCounterAnimate=false;_sonetLClearContainerExternal(false)};BitrixLF.prototype.LazyLoadCheckVisibility=function(e){var t=e.node;var n="comment";var o=BX.findParent(t,{className:"feed-com-text"});if(!o){n="post";o=BX.findParent(t,{className:"feed-post-text-block"})}if(o){var s=BX.findChild(o,{tag:"div",className:"feed-post-text-more"},false);if(s&&s.style.display!="none"){return t.parentNode.parentNode.offsetTop<(n=="comment"?220:270)}}return true};BitrixLF.prototype.processAjaxBlock=function(e,t,n){if(!e){return}if(!t){t="content_block_"+Math.floor(Math.random()*1e3)}n=!!n;var o=false;var s=false;a(i);r(l);function a(t){if(BX.type.isArray(e.CSS)&&e.CSS.length>0){BX.load(e.CSS,t)}else{t()}}function i(){BX("log_internal_container").appendChild(BX.create("DIV",{props:{id:t,className:"feed-wrap"},style:{display:n?"none":"block"},html:e.CONTENT}));o=true;if(s){l()}}function r(t){if(BX.type.isArray(e.JS)&&e.JS.length>0){BX.load(e.JS,t)}else{t()}}function l(){s=true;if(o){BX.ajax.processRequestData(e.CONTENT,{scriptsRunFirst:false,dataType:"HTML"})}}};BitrixLF.prototype.createTask=function(e){this.createTaskPopup=new BX.PopupWindow("BXCTP",null,{autoHide:false,zIndex:0,offsetLeft:0,offsetTop:0,overlay:false,lightShadow:true,closeIcon:{right:"12px",to
157p:"10px"},draggable:{restrict:true},closeByEsc:false,contentColor:"white",contentNoPaddings:true,buttons:[],content:BX.create("DIV",{attrs:{id:"BXCTP_content"},props:{className:"feed-create-task-popup-content"}}),events:{onAfterPopupShow:BX.proxy(function(){oLF.createTaskSetContent(BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskWait")}));BX.ajax({url:"/bitrix/components/bitrix/socialnetwork.log.ex/ajax.php",method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),ENTITY_TYPE:e.entityType,ENTITY_ID:e.entityId,action:"get_raw_data"},onsuccess:BX.proxy(function(t){if(typeof t.TITLE!="undefined"&&typeof t.DESCRIPTION!="undefined"&&typeof t.DISK_OBJECTS!="undefined"&&t.TITLE.length>0&&t.DESCRIPTION.length>0){BX.Tasks.Util.Query.runOnce("task.add",{data:{TITLE:t.TITLE,DESCRIPTION:t.DESCRIPTION,RESPONSIBLE_ID:BX.message("USER_ID"),CREATED_BY:BX.message("USER_ID"),UF_TASK_WEBDAV_FILES:t.DISK_OBJECTS}}).then(BX.proxy(function(t){var n=t.getData();if(typeof n!="undefined"&&typeof n.DATA!="undefined"&&typeof n.DATA.ID!="undefined"&&parseInt(n.DATA.ID)>0){oLF.createTaskSetContentSuccess(n.DATA.ID);BX.ajax({url:"/bitrix/components/bitrix/socialnetwork.log.ex/ajax.php",method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),ENTITY_TYPE:e.entityType,ENTITY_ID:e.entityId,TASK_ID:n.DATA.ID,action:"create_task_comment"}})}else{oLF.createTaskSetContentFailure(t.getErrors().getMessages())}},this))}else{oLF.createTaskSetContentFailure([BX.message("sonetLFCreateTaskErrorGetData")])}},this),onfailure:function(e){oLF.createTaskSetContentFailure([BX.message("sonetLFCreateTaskErrorGetData")])}})},this),onPopupClose:BX.proxy(function(){this.createTaskPopup.destroy()},this)}});this.createTaskPopup.params.zIndex=BX.WindowManager?BX.WindowManager.GetZIndex():0;this.createTaskPopup.show()};BitrixLF.prototype.createTaskSetContentSuccess=function(e){oLF.createTaskSetContent(BX.create("DIV",{children:[BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskSuccessTitle")}),BX.create("DIV",{props:{className:"feed-create-task-popup-description"},html:BX.message("sonetLFCreateTaskSuccessDescription")})]}));this.createTaskPopup.setButtons([new BX.PopupWindowButton({text:BX.message("sonetLFCreateTaskButtonTitle"),events:{click:BX.proxy(function(){this.createTaskPopup.destroy();window.open(BX.message("sonetLFCreateTaskTaskPath").replace("#user_id#",BX.message("USER_ID")).replace("#task_id#",e),"_blank")},this)}})])};BitrixLF.prototype.createTaskSetContentFailure=function(e){oLF.createTaskSetContent(BX.create("DIV",{children:[BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskFailureTitle")}),BX.create("DIV",{props:{className:"feed-create-task-popup-description"},html:e.join("<br>")})]}))};BitrixLF.prototype.createTaskSetContent=function(e){if(BX("BXCTP_content")){var t=BX("BXCTP_content");BX.cleanNode(t);t.appendChild(e)}};oLF=new BitrixLF;window.oLF=oLF;
158/* End */
159;
160; /* Start:"a:4:{s:4:"full";s:113:"/local/templates/voenchast/components/bitrix/socialnetwork.blog.post.edit/user_blog/script.min.js?166624702423897";s:6:"source";s:93:"/local/templates/voenchast/components/bitrix/socialnetwork.blog.post.edit/user_blog/script.js";s:3:"min";s:97:"/local/templates/voenchast/components/bitrix/socialnetwork.blog.post.edit/user_blog/script.min.js";s:3:"map";s:97:"/local/templates/voenchast/components/bitrix/socialnetwork.blog.post.edit/user_blog/script.map.js";}"*/
161(function(){if(window["SBPETabs"])return;window.SBPETabs=function(){if(window.SBPETabs.instance!=null){throw"SBPETabs is a singleton. Use SBPETabs.getInstance to get an object."}this.tabs={};this.bodies={};this.active=null;this.animation=null;this.animationStartHeight=0;this.menu=null;this.menuItems=[];if(this.inited!==true)this.init();window.SBPETabs.instance=this};window.SBPETabs.instance=null;window.SBPETabs.getInstance=function(){if(window.SBPETabs.instance==null){window.SBPETabs.instance=new SBPETabs}return window.SBPETabs.instance};window.SBPETabs.changePostFormTab=function(e,t){var o=window.SBPETabs.getInstance();return o.setActive(e,t)};window.SBPETabs.prototype={_createOnclick:function(e,t,o){return function(){var s=BX("feed-add-post-form-link-more",true);var i=BX("feed-add-post-form-link-text",true);i.innerHTML=t;s.className="feed-add-post-form-link feed-add-post-form-link-more feed-add-post-form-link-active feed-add-post-form-"+e+"-link";if(e!="lists"){window.SBPETabs.changePostFormTab(e)}if(BX.type.isNotEmptyString(o)){BX.evalGlobal(o)}this.popupWindow.close()}},init:function(){this.tabContainer=BX("feed-add-post-form-tab");var e=BX.findChildren(this.tabContainer,{tag:"span",className:"feed-add-post-form-link"},true);this.arrow=BX("feed-add-post-form-tab-arrow");this.tabs={};this.bodies={};for(var t=0;t<e.length;t++){var o=e[t].getAttribute("id").replace("feed-add-post-form-tab-","");this.tabs[o]=e[t];if(this.tabs[o].style.display=="none"){this.menuItems.push({tabId:o,text:e[t].getAttribute("data-name"),className:"feed-add-post-form-"+o+" feed-add-post-form-"+o+"-more",oncl
161ick:this._createOnclick(o,e[t].getAttribute("data-name"),e[t].getAttribute("data-onclick"))});this.tabs[o]=this.tabs[o].parentNode}this.bodies[o]=BX("feed-add-post-content-"+o)}if(!!this.tabs["file"])this.bodies["file"]=[this.bodies["message"]];if(!!this.tabs["calendar"])this.bodies["calendar"]=[this.bodies["calendar"]];if(!!this.tabs["vote"])this.bodies["vote"]=[this.bodies["message"],this.bodies["vote"]];if(!!this.tabs["more"])this.bodies["more"]=null;if(!!this.tabs["important"])this.bodies["important"]=[this.bodies["message"],this.bodies["important"]];if(!!this.tabs["grat"])this.bodies["grat"]=[this.bodies["message"],this.bodies["grat"]];if(!!this.tabs["lists"])this.bodies["lists"]=[this.bodies["lists"]];for(var s in this.bodies){if(this.bodies.hasOwnProperty(s)&&BX.type.isDomNode(this.bodies[s]))this.bodies[s]=[this.bodies[s]]}this.inited=true;this.previousTab=false;BX("bx-b-uploadfile-blogPostForm").setAttribute("bx-press","pressOut");BX.bind(BX("bx-b-uploadfile-blogPostForm"),"mousedown",BX.delegate(function(){BX("bx-b-uploadfile-blogPostForm").setAttribute("bx-press",BX("bx-b-uploadfile-blogPostForm").getAttribute("bx-press")=="pressOut"?"pressOn":"pressOut")},this));BX.onCustomEvent(this.tabContainer,"onObjectInit",[this]);var i=BX("blogPostForm");if(i){if(!i.changePostFormTab){i.appendChild(BX.create("INPUT",{props:{type:"hidden",name:"changePostFormTab",value:""}}))}BX.addCustomEvent(window,"changePostFormTab",function(e){if(e!="more"){i.changePostFormTab.value=e}});if(i["UF_BLOG_POST_IMPRTNT"]){BX.addCustomEvent(window,"changePostFormTab",function(e){if(e!="more"){i["UF_BLOG_POST_IMPRTNT"].value=e=="important"?1:0}})}}},setActive:function(e,t){if(e==null||this.active==e&&e!="lists")return this.active;else if(!this.tabs[e])return false;var o,s;this.startAnimation();for(o in this.tabs){if(this.tabs.hasOwnProperty(o)&&o!=e){BX.removeClass(this.tabs[o],"feed-add-post-form-link-active");if(this.bodies[o]==null||this.bodies[e]==null)continue;for(s=0;s<this.bodies[o].length;s++){if(this.bodies[e][s]!=this.bodies[o][s])BX.adjust(this.bodies[o][s],{style:{display:"none"}})}}}if(!!this.tabs[e]){this.active=e;BX.addClass(this.tabs[e],"feed-add-post-form-link-active");var i=BX.pos(this.tabs[e],true);this.arrow.style.left=i.left+25+"px";if(this.previousTab=="file"||e=="file"){var a=null,n=null,d=false,l=false,r=BX("divoPostFormLHE_blogPostForm");if(!!r.childNodes&&r.childNodes.length>0){for(o in r.childNodes){if(r.childNodes.hasOwnProperty(o)&&r.childNodes[o].className=="file-selectdialog"){a=r.childNodes[o];var c=BX.findChild(a,{className:"file-placeholder-tbody"},true),f=BX.findChildren(a,{className:"feed-add-photo-block"},true);if(c.rows>0||!!f&&f.length>1)d=true}else if(BX.type.isNotEmptyString(r.childNodes[o].className)&&(r.childNodes[o].className.indexOf("wduf-selectdialog")>=0||r.childNodes[o].className.indexOf("diskuf-selectdialog")>=0)){n=r.childNodes[o];var u=BX.findChildren(n,{className:"wd-inline-file"},true);l=!!u&&u.length>0}else if(BX.type.isElementNode(r.childNodes[o])){BX.adjust(r.childNodes[o],{style:{display:e=="file"?"none":""}})}}if(e=="file"){if(!!window["PlEditorblogPostForm"]){if(!window["PlEditorblogPostForm"]["SBPEBinded"]){window["PlEditorblogPostForm"].SBPEBinded=true;BX.addCustomEvent(window["PlEditorblogPostForm"].eventNode,"onUploadsHasBeenChanged",function(e){if(e.dialogName=="AttachFileDialog"&&e.urlUpload.indexOf("&dropped=Y")<0){e.urlUpload=e.agent.uploadFileUrl=e.urlUpload.replace("&random_folder=Y","&dropped=Y")}BX("bx-b-uploadfile-blogPostForm").setAttribute("bx-press","pressOn");window.SBPETabs.changePostFormTab("message")})}window["PlEditorblogPostForm"].controllerInit("show")}window["PlEditorblogPostForm"].controllerInit("show");BX.addClass(r,"feed-add-post-form");BX.addClass(r,"feed-add-post-edit-form");BX.addClass(r,"feed-add-post-edit-form-file")}else{BX.removeClass(r,"feed-add-post-form");BX.removeClass(r,"feed-add-post-edit-form");BX.removeClass(r,"feed-add-post-edit-form-file");if(!d&&!l&&BX("bx-b-uploadfile-blogPostForm").getAttribute("bx-press")=="pressOut"&&!!window["PlEditorblogPostForm"]){window["PlEditorblogPostForm"].controllerInit("hide")}}}}if(BX("divoPostFormLHE_blogPostForm").style.display=="none"){BX.onCustomEvent(BX("divoPostFormLHE_blogPostForm"),"OnShowLHE",["justShow"])}if(e=="lists"){BX.onCustomEvent("onDisplayClaimLiveFeed",[t])}this.previousTab=e;if(!!this.bodies[e]){for(s=0;s<this.bodies[e].length;s++){BX.adjust(this.bodies[e][s],{style:{display:"block"}})}}}this.endAnimation();if(e!="lists")this.restoreMoreMenu();BX.onCustomEvent(window,"changePostFormTab",[e]);return this.active},startAnimation:function(){if(this.animation)this.animation.stop();var e=BX("microblog-form",true);this.animationStartHeight=e.parentNode.offsetHeight;e.parentNode.style.height=this.animationStartHeight+"px";e.parentNode.style.overflowY="hidden";e.parentNode.style.position="relative";e.style.opacity=0},endAnimation:function(){var e=BX("microblog-form",true);this.animation=new BX["easing"]({duration:500,start:{height:this.animationStartHeight,opacity:0}
161,finish:{height:e.offsetHeight+e.offsetTop,opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(t){e.parentNode.style.height=t.height+"px";e.style.opacity=t.opacity/100},complete:BX.proxy(function(){e.style.cssText="";e.parentNode.style.cssText="";this.animation=null},this)});this.animation.animate()},collapse:function(){window.SBPETabs.changePostFormTab("message");this.startAnimation();BX.onCustomEvent(BX("divoPostFormLHE_blogPostForm"),"OnShowLHE",[false]);this.endAnimation();this.active=null},showMoreMenu:function(){if(!this.menu){this.menu=BX.PopupMenu.create("feed-add-post-form-popup",BX("feed-add-post-form-link-text"),this.menuItems,{closeByEsc:true,offsetTop:5,offsetLeft:3,angle:true})}this.menu.popupWindow.show()},restoreMoreMenu:function(){var e=this.menuItems.length;if(e<1){return}for(var t=0;t<e;t++){if(this.active==this.menuItems[t]["tabId"]){return}}var o=BX("feed-add-post-form-link-more",true);var s=BX("feed-add-post-form-link-text",true);o.className="feed-add-post-form-link feed-add-post-form-link-more";s.innerHTML=BX.message("SBPE_MORE")},getLists:function(){var e=BX("feed-add-post-form-tab-lists")&&BX("feed-add-post-form-tab-lists").style.display!="none"?BX("feed-add-post-form-tab-lists"):BX("feed-add-post-form-link-more"),t=BX.findChildren(e,{tag:"span",className:"feed-add-post-form-link-lists"},true),o=BX.findChildren(e,{tag:"span",className:"feed-add-post-form-link-lists-default"},true),s=[],i=[];if(t.length){i=this.getMenuItems(t,this.createOnclickLists);s=this.getMenuItemsDefault(o);i=i.concat(s);this.showMoreMenuLists(i)}else{var a=this.showMoreMenuLists,n=this.getMenuItems,d=this.getMenuItemsDefault,l=this.createOnclickLists,r=null;if(BX("bx-lists-select-site-id")){r=BX("bx-lists-select-site-id").value}BX.ajax({method:"POST",dataType:"json",url:"/bitrix/components/bitrix/socialnetwork.blog.post.edit/post.ajax.php",data:{bitrix_processes:1,siteId:r,sessid:BX.bitrix_sessid()},onsuccess:BX.delegate(function(r){if(r.success){for(var c in r.lists){e.appendChild(BX.create("span",{attrs:{"data-name":r.lists[c].NAME,"data-picture":r.lists[c].PICTURE,"data-description":r.lists[c].DESCRIPTION,"data-picture-small":r.lists[c].PICTURE_SMALL,"data-code":r.lists[c].CODE,iblockId:r.lists[c].ID},props:{className:"feed-add-post-form-link-lists",id:"feed-add-post-form-tab-lists"},style:{display:"none"}}))}t=BX.findChildren(e,{tag:"span",className:"feed-add-post-form-link-lists"},true);i=n(t,l);if(!o.length){for(var c in r.permissions){var f;if(c=="new"){f='document.location.href = "'+BX("bx-lists-lists-page").value+'0/edit/"'}else if(c=="market"){if(r.admin&&BX("bx-lists-lists-page")){f='document.location.href = "'+BX("bx-lists-lists-page").value+'?bp_catalog=y"'}else{if(BX("bx-lists-random-string")){f='BX["LiveFeedClass_'+BX("bx-lists-random-string").value+'"].errorPopup("'+BX.message("LISTS_CATALOG_PROCESSES_ACCESS_DENIED")+'");'}}}else if(c=="settings"){f='document.location.href = "'+BX("bx-lists-lists-page").value+'"'}e.appendChild(BX.create("span",{attrs:{"data-name":r.permissions[c],"data-picture-small":"","data-key":c,"data-onclick":f},props:{className:"feed-add-post-form-link-lists-default",id:"feed-add-post-form-tab-lists"},style:{display:"none"}}))}o=BX.findChildren(e,{tag:"span",className:"feed-add-post-form-link-lists-default"},true)}s=d(o);i=i.concat(s);a(i)}else{e.appendChild(BX.create("span",{attrs:{"data-name":r.error,"data-picture-small":""},props:{className:"feed-add-post-form-link-lists-default",id:"feed-add-post-form-tab-lists"},style:{display:"none"}}));t=BX.findChildren(e,{tag:"span",className:"feed-add-post-form-link-lists-default"},true);i=n(t,0);a(i)}})})}},getMenuItems:function(e,t){var o=[];for(var s=0;s<e.length;s++){var i=e[s].getAttribute("id").replace("feed-add-post-form-tab-","");if(t){o.push({tabId:i,text:BX.util.htmlspecialchars(e[s].getAttribute("data-name")),className:"feed-add-post-form-"+i+"feed-add-post-form-"+i+"-item",onclick:t(i,[e[s].getAttribute("iblockId"),e[s].getAttribute("data-name"),e[s].getAttribute("data-description"),e[s].getAttribute("data-picture"),e[s].getAttribute("data-code")])})}else{o.push({tabId:i,text:e[s].getAttribute("data-name"),className:"feed-add-post-form-"+i,onclick:""})}}return o},getMenuItemsDefault:function(e){var t=[];for(var o=0;o<e.length;o++){t.push({text:BX.util.htmlspecialchars(e[o].getAttribute("data-name")),className:"feed-add-post-form-lists-default-"+e[o].getAttribute("data-key"),onclick:e[o].getAttribute("data-onclick")})}return t},showMoreMenuLists:function(e){var t=BX("feed-add-post-form-tab-lists").style.display!="none"?BX("feed-add-post-form-tab-lists"):BX("feed-add-post-form-link-more");var o=BX.PopupMenu.create("lists",t,e,{closeByEsc:true,offsetTop:5,offsetLeft:12,angle:true});var s=BX.findChildren(BX("popup-window-content-menu-popup-lists"),{tag:"span",className:"menu-popup-item-icon"},true),i=BX.findChildren(t,{tag:"span",className:"feed-add-post-form-link-lists"},true),a=BX.findChildren(t,{tag:"span",className:"feed-add-post-form-link-lists-default"},true);i=i.concat(a);for(var n=0;n<s.length;n++){if(i[n].getAttribute("data-picture-small")){s[n].innerHTML=i[n].getAttribute("data-picture-small")}}o.popupWindow.show()},createOnclickLists:function(e,t){return function(){window.SBPETabs.changePostFormTab(e,t);this.popupWindow.close()}}};window.BXfpGratSelectCallback=function(e){BXfpGratMedalSelectCallback(e,"grat")};window.BXfpMedalSelectCallback=function(e){BXfpGratMedalSelectCallback(e,"medal")};window.BXfpGratMedalSelectCallback=function(e,t){if(t!="grat")t="medal";var o="U";BX("feed-add-post-"+t+"-item").appendChild(BX.create("span",{attrs:{"data-id":e.id},props:{className:"feed-add-post-"+t+" feed-add-post-destination-users"},children:[BX.create("input",{attrs:{type:"hidden",name:(t=="grat"?"GRAT":"MEDAL")+"["+o+"][]",value:e.id}}),BX.create("span",{props:{className:"feed-add-post-"+t+"-text"},html:e.name}),BX.create("span",{props:{className:"feed-add-post-del-but"},events:{click:function(t){BX.SocNetLogDestination.deleteItem(e.id,"users",window["BXSocNetLogGratFormName"]);BX.PreventDefault(t)},mouseover:function(){BX.addClass(this.parentNode,"feed-add-post-"+t+"-hover")},mouseout:function(){BX.removeClass(this.parentNode,"feed-add-post-"+t+"-hover")}}})]}));BX("feed-add-post-"+t+"-input").value="";BX.SocNetLogDestination.BXfpSetLinkName({formName:t=="grat"?window["BXSocNetLogGratFormName"]:window["BXSocNetLogMedalFormName"],tagInputName:"bx-"+t+"-tag",tagLink1:BX.message("BX_FPGRATMEDAL_LINK_1"),tagLink2:BX.message("BX_FPGRATMEDAL_LINK_2")})};if(!!BX.SocNetGratSelector)return;BX.SocNetGratSelector={popupWindow:null,obWindowCloseIcon:{},sendEvent:true,obCallback:{},gratsContentElement:null,itemSelectedImageItem:{}
161,itemSelectedInput:{},searchTimeout:null,obDepartmentEnable:{},obSonetgroupsEnable:{},obLastEnable:{},obWindowClass:{},obPathToAjax:{},obDepartmentLoad:{},obDepartmentSelectDisable:{},obItems:{},obItemsLast:{},obItemsSelected:{},obElementSearchInput:{},obElementBindMainPopup:{},obElementBindSearchPopup:{}};BX.SocNetGratSelector.init=function(e){if(!e.name)e.name="lm";BX.SocNetGratSelector.obCallback[e.name]=e.callback;BX.SocNetGratSelector.obWindowCloseIcon[e.name]=typeof e.obWindowCloseIcon=="undefined"?true:e.obWindowCloseIcon;BX.SocNetGratSelector.itemSelectedImageItem[e.name]=e.itemSelectedImageItem;BX.SocNetGratSelector.itemSelectedInput[e.name]=e.itemSelectedInput};BX.SocNetGratSelector.openDialog=function(e){if(!e)e="lm";if(BX.SocNetGratSelector.popupWindow!=null){BX.SocNetGratSelector.popupWindow.close();return false}var t=[];for(var o=0;o<arGrats.length;o++){t[t.length]=BX.create("span",{props:{className:"feed-add-grat-box "+arGrats[o].style},attrs:{title:arGrats[o].title},events:{click:BX.delegate(function(t){BX.SocNetGratSelector.selectItem(e,this.code,this.style,this.title);BX.PreventDefault(t)},arGrats[o])}})}var s=[];var i=1;for(o=0;o<t.length;o++){if(o>=t.length/2)i=2;if(s[i]==null||s[i]=="undefined")s[i]=BX.create("div",{props:{className:"feed-add-grat-list-row"}});s[i].appendChild(t[o])}BX.SocNetGratSelector.gratsContentElement=BX.create("div",{children:[BX.create("div",{props:{className:"feed-add-grat-list-title"},html:BX.message("BLOG_GRAT_POPUP_TITLE")}),BX.create("div",{props:{className:"feed-add-grat-list"},children:s})]});BX.SocNetGratSelector.popupWindow=new BX.PopupWindow("BXSocNetGratSelector",BX("feed-add-post-grat-type-selected"),{autoHide:true,offsetLeft:25,bindOptions:{forceBindPosition:true},closeByEsc:true,closeIcon:BX.SocNetGratSelector.obWindowCloseIcon[e]?{top:"5px",right:"10px"}:false,events:{onPopupShow:function(){if(BX.SocNetGratSelector.sendEvent&&BX.SocNetGratSelector.obCallback[e]&&BX.SocNetGratSelector.obCallback[e].openDialog)BX.SocNetGratSelector.obCallback[e].openDialog()},onPopupClose:function(){this.destroy()},onPopupDestroy:BX.proxy(function(){BX.SocNetGratSelector.popupWindow=null;if(BX.SocNetGratSelector.sendEvent&&BX.SocNetGratSelector.obCallback[e]&&BX.SocNetGratSelector.obCallback[e].closeDialog)BX.SocNetGratSelector.obCallback[e].closeDialog()},this)},content:BX.SocNetGratSelector.gratsContentElement,angle:{position:"bottom",offset:20},lightShadow:true});BX.SocNetGratSelector.popupWindow.setAngle({});BX.SocNetGratSelector.popupWindow.show();return true};BX.SocNetGratSelector.selectItem=function(e,t,o,s){var i=BX.findChild(BX.SocNetGratSelector.itemSelectedImageItem[e],{tag:"span"},false,false);if(typeof i!="undefined"&&i){i.className="feed-add-grat-box "+o}BX.SocNetGratSelector.itemSelectedImageItem[e].title=s;BX.SocNetGratSelector.itemSelectedInput[e].value=t;BX.SocNetGratSelector.popupWindow.close()};var e=function(e){var t="blogPostForm",o=BX(t),s="POST_TITLE",i=BX(s),a=BX(t).TAGS,n=function(e){BX.bind(i,"keydown",BX.proxy(e.Init,e));BX.bind(a,"keydown",BX.proxy(e.Init,e))};if(!o)return;BX.addCustomEvent(o,"onAutoSavePrepare",function(e){e.DISABLE_STANDARD_NOTIFY=true;var t=e;setTimeout(function(){n(t)},100)});BX.addCustomEvent(o,"onAutoSave",function(e,o){o["TAGS"]=BX(t).TAGS.value;delete o["POST_MESSAGE"]});if(e=="Y"){BX.addCustomEvent(o,"onAutoSaveRestoreFound",function(e,o){var i=BX.util.trim(o["text"+t])||"",a=BX.util.trim(o[s])||"";if(i.length<1&&a.length<1)return;e.Restore()})}else{BX.addCustomEvent(o,"onAutoSaveRestoreFound",BX.delegate(function(e,o){var i=BX.util.trim(o["text"+t])||"",a=BX.util.trim(o[s])||"";if(i.length<1&&a.length<1)return;var n=BX("microoPostFormLHE_blogPostForm"),d=BX.create("DIV",{attrs:{className:"feed-add-successfully"},children:[BX.create("SPAN",{attrs:{className:"feed-add-info-icon"}}),BX.create("A",{attrs:{className:"feed-add-info-text",href:"#"},events:{click:function(){e.Restore();d.parentNode.removeChild(d);return false}},text:BX.message("BLOG_POST_AUTOSAVE2")})]});if(n){n.parentNode.insertBefore(d,n)}},this))}BX.addCustomEvent(o,"onAutoSaveRestore",function(e,o){BX(s).value=o[s];if(o[s].length>
1610&&o[s]!=BX(s).getAttribute("placeholder")){if(BX("divoPostFormLHE_blogPostForm").style.display!="none")window["showPanelTitle_"+t](true);else window["bShowTitle"]=true;if(!!BX(s).__onchange)BX(s).__onchange()}var i=window["BXPostFormTags_"+t];if(o["TAGS"].length>0&&i){var a=i.addTag(o["TAGS"]);if(a.length>0){BX.show(i.tagsArea)}}if(BX.SocNetLogDestination){var d;if(o["SPERM[DR][]"]){for(d=0;d<o["SPERM[DR][]"].length;d++){BX.SocNetLogDestination.selectItem(BXSocNetLogDestinationFormName,"",3,o["SPERM[DR][]"][d],"department",false)}}if(o["SPERM[SG][]"]){for(d=0;d<o["SPERM[SG][]"].length;d++){BX.SocNetLogDestination.selectItem(BXSocNetLogDestinationFormName,"",3,o["SPERM[SG][]"][d],"sonetgroups",false)}}if(o["SPERM[U][]"]){for(d=0;d<o["SPERM[U][]"].length;d++){BX.SocNetLogDestination.selectItem(BXSocNetLogDestinationFormName,"",3,o["SPERM[U][]"][d],"users",false)}}if(!o["SPERM[UA][]"]){BX.SocNetLogDestination.deleteItem("UA","groups",BXSocNetLogDestinationFormName)}}n(e)})},t={},o=function(e){if(t[e]&&t[e]["editorID"]){if(t[e]["editor"])t[e]["editor"](t[e]["text"]);else setTimeout(function(){o(e)},50)}};BX.SocnetBlogPostInit=function(s,i){t[s]={editorID:i["editorID"],showTitle:!!i["showTitle"],submitted:false,text:i["text"],autoSave:i["autoSave"],handler:LHEPostForm&&LHEPostForm.getHandler(i["editorID"]),editor:LHEPostForm&&LHEPostForm.getEditor(i["editorID"])};window["showPanelTitle_"+s]=function(e,o){e=e===true||e===false?e:BX("blog-title").style.display=="none";o=o!==false;var i=t[s]["showTitle"],a=BX("lhe_button_title_"+s),n=BX("feed-add-post-block"+s),d=BX("show_title")||{};if(e){BX.show(BX("blog-title"));BX.focus(BX("POST_TITLE"));t[s]["showTitle"]=true;d.value="Y";if(a){BX.addClass(a,"feed-add-post-form-btn-active")}if(n){BX.addClass(n,"blog-post-edit-open")}}else{BX.hide(BX("blog-title"));t[s]["showTitle"]=false;d.value="N";if(a)BX.removeClass(a,"feed-add-post-form-btn-active")}if(o)BX.userOptions.save("socialnetwork","postEdit","showTitle",t[s]["showTitle"]?"Y":"N");else t[s]["showTitle"]=i};window["setBlogPostFormSubmitted"]=function(e){t[s]["submitted"]=e};window["submitBlogPostForm"]=function(e,o){if(typeof e!="object"){o=e;e=LHEPostForm.getEditor(t[s]["editorID"])}if(e&&e.id==t[s]["editorID"]){if(t[s]["submitted"])return false;e.SaveContent();if(!o)o="save";if(BX("blog-title").style.display=="none")BX("POST_TITLE").value="";if(BX("blog-submit-button-save")){BX.addClass(BX("blog-submit-button-save"),"feed-add-button-load")}BX.submit(BX(s),o);t[s]["submitted"]=true}};var a=function(e,o){if(o==s){t[s]["handler"]=e;BX.addCustomEvent(e.eventNode,"OnControlClick",function(){window.SBPETabs.changePostFormTab("message")});var i=function(){var e=[BX("feed-add-post-form-notice-blockblogPostForm"),BX("feed-add-buttons-blockblogPostForm"),BX("feed-add-post-content-message-add-ins")];for(var o=0;o<e.length;o++){if(!!e[o]){BX.adjust(e[o],{style:{display:"block",height:"auto",opacity:1}})}}if(t[s]["showTitle"])window["showPanelTitle_"+s](true,false)},a=function(){var e,o=[BX("feed-add-post-form-notice-blockblogPostForm"),BX("feed-add-buttons-blockblogPostForm"),BX("feed-add-post-content-message-add-ins")];for(e=0;e<o.length;e++){if(!!o[e]){BX.adjust(o[e],{style:{display:"block",height:"0px",opacity:0}})}}if(t[s]["showTitle"])window["showPanelTitle_"+s](false,false)};BX.addCustomEvent(e.eventNode,"OnAfterShowLHE",i);BX.addCustomEvent(e.eventNode,"OnAfterHideLHE",a);if(e.eventNode.style.display=="none")a();else i()}},n=function(o){if(o.id==t[s]["editorID"]){t[s]["editor"]=o;if(t[s]["autoSave"]!="N")new e(t[s]["autoSave"]);var i=window[o.id+"Files"],a=LHEPostForm.getHandler(o.id),n,d,l,r=[],c=null;for(d in a["controllers"]){if(a["controllers"].hasOwnProperty(d)){if(a["controllers"][d]["parser"]&&a["controllers"][d]["parser"]["bxTag"]=="postimage"){c=a["controllers"][d];break}}}var f=function(e,t){return function(){e.insertFile(t)}},u=function(e,t,o){return function(){if(c){c.deleteFile(t,{});BX.remove(BX("wd-doc"+t));BX.ajax({method:"GET",url:o})}else{e.deleteFile(t,o,e,{controlID:"common"})}}};for(n in i){if(i.hasOwnProperty(n)){if(c){c.addFile(i[n])}else{d=a.checkFile(n,"common",i[n]);r.push(n);if(!!d&&BX("wd-doc"+n)&&!BX("wd-doc"+n).hasOwnProperty("bx-bound")){BX("wd-doc"+n).setAttribute("bx-bound","Y");if((l=BX.findChild(BX("wd-doc"+n),{className:"feed-add-img-wrap"},true,false))&&l){BX.bind(l,"click",f(a,d));l.style.cursor="pointer"}if((l=BX.findChild(BX("wd-doc"+n),{className:"feed-add-img-title"},true,false))&&l){BX.bind(l,"click",f(a,d));l.style.cursor="pointer"}if((l=BX.findChild(BX("wd-doc"+n),{className:"feed-add-post-del-but"},true,false))&&l){BX.bind(l,"click",u(a,n,i[n]["del_url"]));l.style.cursor="pointer"}}}if((l=BX.findChild(BX("wd-doc"+n),{className:"feed-add-post-del-but"},true,false))&&l){BX.bind(l,"click",u(a,n,i[n]["del_url"]));l.style.cursor="pointer"}}}if(r.length>0){o.SaveContent();var m=o.GetContent();m=m.replace(new RegExp("\\&\\#91\\;IMG ID=("+r.join("|")+")([WIDTHHEIGHT=0-9 ]*)\\&\\#93\\;","gim"),"[IMG ID=$1$2]");o.SetContent(m);o.Focus()}}};BX.addCustomEvent(window,"onInitialized",a);if(t[s]["handler"])a(t[s]["handler"],s);
161BX.addCustomEvent(window,"OnEditorInitedAfter",n);if(t[s]["editor"])n(t[s]["editor"]);BX.addCustomEvent(window,"onSocNetLogMoveBody",function(e){if(e=="sonet_log_microblog_container"){o(s)}});BX.ready(function(){if(BX.browser.IsIE()&&BX("POST_TITLE")){var e=function(e){if(!this.value||this.value==this.getAttribute("placeholder")){this.value=this.getAttribute("placeholder");BX.removeClass(this,"feed-add-post-inp-active")}};BX.bind(BX("POST_TITLE"),"blur",e);e.apply(BX("POST_TITLE"));BX("POST_TITLE").__onchange=BX.delegate(function(e){if(this.value==this.getAttribute("placeholder")){this.value=""}if(this.className.indexOf("feed-add-post-inp-active")<0){BX.addClass(this,"feed-add-post-inp-active")}},BX("POST_TITLE"));BX.bind(BX("POST_TITLE"),"click",BX("POST_TITLE").__onchange);BX.bind(BX("POST_TITLE"),"keydown",BX("POST_TITLE").__onchange);BX.bind(BX("POST_TITLE").form,"submit",function(){if(BX("POST_TITLE").value==BX("POST_TITLE").getAttribute("placeholder")){BX("POST_TITLE").value=""}})}if(i["activeTab"]!=="")window.SBPETabs.changePostFormTab(i["activeTab"])})}})();
162/* End */
163;
164; /* Start:"a:4:{s:4:"full";s:95:"/local/templates/voenchast/components/bitrix/main.post.form/edit_post/script.js?166624702492358";s:6:"source";s:79:"/local/templates/voenchast/components/bitrix/main.post.form/edit_post/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
165;(function(){
166	if (window["LHEPostForm"])
167		return;
168var repo = { controller : {}, handler : {}};
169BX.addCustomEvent(window, "BFileDLoadFormControllerWasBound", function(obj) { repo.controller[obj.id] = true;});
170BX.addCustomEvent(window, "WDLoadFormControllerInit", function(obj) { repo.controller[obj.
170CID] = obj; });
171BX.addCustomEvent(window, "WDLoadFormControllerWasBound", function(obj) { repo.controller[obj.CID] = true; });
172BX.addCustomEvent(window, "DiskDLoadFormControllerInit", function(obj) { repo.controller[obj.CID] = obj; });
173BX.addCustomEvent(window, "DiskLoadFormControllerWasBound", function(obj) { repo.controller[obj.CID] = true; });
174BX.addCustomEvent(window, 'OnEditorInitedBefore', function(editor) {
175	if (repo.handler[editor.id])
176	{
177		editor.__lhe_flags = ['OnEditorInitedBefore'];
178		if (repo.handler[editor.id]["params"] && repo.handler[editor.id]["params"]['LHEJsObjName']) // for custom templates
179			window[repo.handler[editor.id].params['LHEJsObjName']] = editor;
180		repo.handler[editor.id].OnEditorInitedBefore(editor);
181	}
182});
183var OnCreateIframeAfter = function(editor){
184	if (repo.handler[editor.id] && repo.handler[editor.id].editorIsLoaded !== true)
185	{
186		repo.handler[editor.id].editorIsLoaded = true;
187		repo.handler[editor.id].exec();
188		BX.onCustomEvent(repo.handler[editor.id], 'OnEditorIsLoaded', [repo.handler[editor.id], editor]);
189	}
190};
191BX.addCustomEvent(window, 'OnCreateIframeAfter', OnCreateIframeAfter);
192
193BX.addCustomEvent(window, 'OnEditorInitedAfter', function(editor, forced){
194	if (repo.handler[editor.id])
195	{
196		editor.__lhe_flags.push('OnEditorInitedAfter');
197		repo.handler[editor.id].OnEditorInitedAfter(editor);
198
199		if (repo.handler[editor.id].editorIsLoaded !== true && forced && editor.sandbox && editor.sandbox.inited)
200			OnCreateIframeAfter.apply(editor, [editor]);
201	}
202});
203BX.util.object_search = function(needle, haystack)
204{
205	for(var i in haystack)
206	{
207		if (haystack.hasOwnProperty(i))
208		{
209			if (haystack[i] == needle)
210				return true;
211			else if (typeof haystack[i] == "object" && haystack[i] !== null)
212			{
213				var result = BX.util.object_search_key(needle, haystack[i]);
214				if (result !== false)
215					return result;
216			}
217		}
218	}
219	return false;
220};
221var parserClass = function(bxTag, tag, additionalTags)
222{
223	additionalTags = (additionalTags && additionalTags.length > 0 ? additionalTags : []);
224	if (typeof tag == "object" && tag.length > 0)
225	{
226		var res;
227		while((res = tag.pop()) && res && tag.length > 0)
228		{
229			additionalTags.push(res);
230		}
231		tag = res;
232	}
233	additionalTags.push(tag);
234	this.exist = true;
235	this.bxTag = bxTag;
236	this.tag = tag;
237	this.tags = additionalTags;
238	this.regexp = new RegExp("\\[(" + additionalTags.join("|") + ")=((?:\\s|\\S)*?)(?:\\s*?WIDTH=(\\d+)\\s*?HEIGHT=(\\d+))?\\]", "ig");
239	this.code = '[' + tag + '=#ID##ADDITIONAL#]';
240	this.wysiwyg = '<span style="color: #2067B0; border-bottom: 1px dashed #2067B0; margin:0 2px;" id="#ID#"#ADDITIONAL#>#NAME#</span>';
241},
242diskController = function(manager, id, params)
243{
244	this.CID = this.id = id;
245	this.parser = (manager.parser['disk_file'] || null);
246	this.params = params;
247	this.node = BX('diskuf-selectdialog-' + id);
248	this.handler = repo.controller[id]; // BX.Disk.UF
249	this.manager = manager;
250	this.eventNode = this.manager.eventNode;
251	this.parserName = 'disk_file';
252	this.prefixNode = 'disk-edit-attach';
253	this.prefixHTMLNode = 'disk-attach-';
254	this.props = {
255		valueEditClassName : 'wd-inline-file',
256		securityCID : 'disk-upload-cid'
257	};
258	this.storage = 'disk';
259	this.fileToAttach = {};
260	this.xmlToAttach = {};
261	this.events = {
262		onInit : 'DiskDLoadFormControllerInit',
263		onShow : 'DiskLoadFormController',
264		onBound : 'DiskLoadFormControllerWasBound'};
265};
266diskController.prototype = {
267	parser : false,
268	eventNode : null,
269	values : {},
270	initialized : false,
271	functionsToExec : [],
272	exec : function(func, args)
273	{
274		if (typeof func == "function")
275			this.functionsToExec.push([func, args]);
276		if (this.handler && this.handler !== true)
277		{
278			var res;
279			while((res = this.functionsToExec.shift()) && res)
280				res[0].apply(this, res[1]);
281		}
282	},
283	init : function()
284	{
285		if (this.initialized !== true)
286		{
287			this.values = {};
288			this.functionsToExec = [];
289			this.initialized = true;
290			this.bindMainEvents(this.manager);
291			if (this.parser !== null)
292			{
293				this.bindEvents(this.manager);
294				return this.initValues();
295			}
296		}
297		return false;
298	},
299	initValues : function()
300	{
301		var values = BX.findChildren(this.node, {'className' : this.props.valueEditClassName}, true);
302		if (values && values.length > 0)
303		{
304			this.exec(this.runCheckText);
305			return true;
306		}
307		return false;
308	},
309	bindMainEvents : function(manager)
310	{
311		var __status = null;
312		BX.addCustomEvent(manager.eventNode, 'onReinitializeBefore', BX.proxy(this.clean, this));
313		// Pass event to show/hide controller
314		BX.addCustomEvent(manager.eventNode, 'onShowControllers', BX.proxy(function(status) {
315			__status = status;
316			BX.onCustomEvent(manager.eventNode, this.events.onShow, [status]);
317		}, this));
318
319		if (!repo.controller[this.id]) // in case controller has not bound yet
320		{
321			var func = BX.delegate(function(obj) {
322				if (obj["UID"] == this.id || obj["id"] == this.id)
323				{
324					if (__status === 'show' || __status === 'hide')
325					{
326						BX.onCustomEvent(manager.eventNode, this.events.onShow, [__status]);
327						__status = null;
328					}
329					BX.removeCustomEvent(window, this.events.onBound, func);
330				}
331			}, this);
332			BX.addCustomEvent(window, this.events.onBound, func);
333		}
334		if (BX["DD"] && this.storage == 'disk')
335		{
336			var dndF = BX.delegate(function(params)
337			{
338				if ((params["UID"] == this.id || params["id"] == this.id) &&
339					this.manager["dropZoneExists"] !== true)
340				{
341					BX.removeCustomEvent(window, this.events.onBound, dndF);
342					this.manager["dropZoneExists"] = true;
343
344					var controller = this.eventNode,
345						id = this.id;
346
347					diskController.dndCatcher = (diskController.dndCatcher || {});
348					diskController.dndCatcher[id] = {
349						"catch" : true,
350						files : [],
351						dropZone : null,
352						dropZoneMicro : null,
353						initdrag : BX.delegate(function()
354						{
355							diskController.dndCatcher[id].dropZone = new BX.DD.dropFiles(manager.eventNode);
356
357							BX.addCustomEvent(manager.eventNode, "OnImageDataUriHandle", BX.delegate(function(editor, imageBase64)
358							{
359								if (BX["UploaderUtils"])
360								{
361									var blob = BX.UploaderUtils.dataURLToBlob(imageBase64.src);
362									if (blob && blob.size > 0 && blob.type.indexOf("image/") == 0)
363									{
364										blob.name = (blob.name || imageBase64.title || ("image." + blob.type.substr(6)));
365										blob.referrerToEditor = imageBase64;
366										if (diskController.dndCatcher[id]["catch"] === true)
367											diskController.dndCatcher[id]["drop"]([blob]);
368										else if (this.handler && this.handler["addFile"])
369											this.handler.addFile(blob);
370
371										BX.onCustomEvent(editor, "OnImageDataUriCaught", [imageBase64]);
372									}
373								}
374							}, this));
375
376							BX.addCustomEvent(diskController.dndCatcher[id].dropZone, "dropFiles", diskController.dndCatcher[id]["drop"]);
377							BX.addCustomEvent(diskController.dndCatcher[id].dropZone, "dragEnter", diskController.dndCatcher[id]["dragover"]);
378							BX.addCustomEvent(diskController.dndCatcher[id].dropZone, "dragLeave", diskController.dndCatcher[id]["dragleave"]);
379
380							if (BX('micro' + manager.__divId))
381							{
382								diskController.dndCatcher[id].dropZoneMicro = new BX.DD.dropFiles(BX('micro' + manager.__divId));
383								BX.addCustomEvent(diskController.dndCatcher[id].dropZoneMicro, "dragEnter", function(){
384									BX.onCustomEvent(manager.eventNode, 'OnShowLHE', ['justShow'])
385								});
386							}
387							BX.unbind(document, "dragover", diskController.dndCatcher[id]["initdrag"]);
388
389							BX.onCustomEvent(manager.eventNode, "onDropZoneExists", []);
390						}, this),
391						dragover : BX.delegate(function() {
392							BX.addClass(manager.eventNode, "feed-add-post-dnd-over");
393							BX.onCustomEvent(manager.eventNode, "dragover", []);
394						}, this),
395						dragleave : BX.delegate(function() {
396							BX.removeClass(manager.eventNode, "feed-add-post-dnd-over");
397							BX.onCustomEvent(manager.eventNode, "dragleave", []);
398						}, this),
399						dragenterwindow : BX.delegate(function() {
400							BX.addClass(manager.eventNode, "feed-add-post-dnd-ready");
401							if (BX('micro' + manager.__divId)) {
402								BX.addClass(BX('micro' + manager.__divId), "feed-add-post-micro-dnd-ready");
403							}
404							BX.onCustomEvent(manager.eventNode, "dragenterwindow", []);
405						}, this),
406						dragleavewindow : BX.delegate(function(e) {
407							BX.removeClass(manager.eventNode, "feed-add-post-dnd-ready");
408							if (BX('micro' + manager.__divId)) {
409								BX.removeClass(BX('micro' + manager.__divId), "feed-add-post-micro-dnd-ready");
410							}
411							BX.onCustomEvent(manager.eventNode, "dragleavewindow", []);
412						}, this),
413						drop : BX.delegate(function(files)
414						{
415							BX.onCustomEvent(manager.eventNode, "drop", []);
416							BX.onCustomEvent(window, "dragWindowLeave");
417							BX.onCustomEvent(window, "__dragWindowLeave");
418							var result = 0;
419							if (files && files.length > 0)
420							{
421								if (diskController.dndCatcher[id]["catch"] === true)
422								{
423									diskController.dndCatcher[id].files = files;
424									result = 1
425								}
426								else
427								{
428									result = 2;
429								}
430								BX.onCustomEvent(manager.eventNode, this.events.onShow, ['show']);
431								BX.removeClass(manager.eventNode, "feed-add-post-dnd-ready feed-add-post-dnd-over");
432							}
433							return result;
434						}, this)
435					};
436
437					BX.ready(function(){ diskController.dndCatcher[id]["initdrag"](); } );
438
439					BX.addCustomEvent(controller, "OnIframeDrop", BX.delegate(function(e) {
440						BX.PreventDefault(e);
441						if (e["dataTransfer"] && e["dataTransfer"]["files"])
442						{
443							if (diskController.dndCatcher[id].drop(e["dataTransfer"]["files"]) === 2)
444							{
445								this.handler.agent.onChange(e["dataTransfer"]["files"]);
446							}
447						}
448					}, this));
449					BX.addCustomEvent(controller, "OnIframeDragOver", diskController.dndCatcher[id].dragover);
450					BX.addCustomEvent(controller, "OnIframeDragLeave", diskController.dndCatcher[id].dragleave);
451					if (!window["bxMpfDndCatcher"])
452					{
453						window["bxMpfDndCatcher"] = true;
454						var
455							isStarted = false,
456							start = function()
457							{
458								if (isStarted === false)
459								{
460									isStarted = true;
461									BX.bind(document, "dragleave", mousemove);
462									BX.bind(document, "dragover", mousemove);
463									BX.bind(document, "mouseout", stop);
464									BX.onCustomEvent(window, "dragWindowEnter");
465								}
466							},
467							stop = function(e)
468							{
469								BX.unbind(document, "dragleave", mousemove);
470								BX.unbind(document, "dragover", mousemove);
471								BX.unbind(document, "mouseout", stop);
472								isStarted = false;
473								BX.onCustomEvent(window, "dragWindowLeave");
474							},
475							mousemove = function(e)
476						{
477							if (mouseTimeout > 0)
478							{
479								clearTimeout(mouseTimeout);
480								mouseTimeout = 0;
481							}
482							BX.fixEventPageXY(e);
483							var fire = true;
484							if (e.pageX > 0 && e.pageY > 0)
485							{
486								var pos = BX.GetWindowSize();
487								if (e.pageY < pos.scrollHeight && e.pageX < pos.scrollWidth)
488								{
489									var top = (e.pageY - pos.scrollTop),
490										left = (e.pageX - pos.scrollLeft);
491									if (0 < top && top < (pos.innerHeight - 20) &&
492										0 < left && left < (pos.innerWidth - 20))
493									{
494										fire = false;
495									}
496								}
497							}
498							if (fire)
499							{
500								stop(e);
501							}
502							else
503							{
504								mouseTimeout = setTimeout(function(){mousemove({type : 'intervalLimit'});}, 100);
505							}
506						},
507							mouseTimeout = 0;
508						BX.bind(document, "dragenter", function(e)
509						{
510							if (window["bxMpfDndCatcher"] > 0)
511							{
512								clearTimeout(window["bxMpfDndCatcher"]);
513							}
514							var isFileTransfer = true;
515							if (e && e["dataTransfer"] && e["dataTransfer"]["types"])
516							{
517								for (var i = 0; i < e["dataTransfer"]["types"].length; i++)
518								{
519									if (e["dataTransfer"]["types"][i] == "Files")
520									{
521										isFileTransfer = true;
522										break;
523									}
524								}
525							}
526							if (isFileTransfer)
527							{
528								start();
529							}
530						});
531						BX.addCustomEvent(window, "__dragWindowLeave", stop);
532						BX.bind(document, "dragover", function(e)
533						{
534							return BX.PreventDefault(e);
535						});
536						BX.bind(document, "drop", function(e)
537						{
538							stop(e);
539							return BX.PreventDefault(e);
540						});
541					}
542					BX.addCustomEvent(window, "dragWindowEnter", diskController.dndCatcher[id].dragenterwindow);
543					BX.addCustomEvent(window, "dragWindowLeave", diskController.dndCatcher[id].dragleavewindow);
544
545					this.__initCatcher = BX.delegate(function(id, uploader) {
546						if (id == this.id)
547						{
548							BX.removeCustomEvent(manager.eventNode, 'onControllerInitialized', this.__initCatcher);
549							uploader.agent.initDropZone(manager.eventNode);
550							if (diskController.dndCatcher[id].files.length > 0)
551							{
552								uploader.agent.onChange(diskController.dndCatcher[id].files);
553								diskController.dndCatcher[id].files = [];
554							}
555							diskController.dndCatcher[id]["catch"] = false;
556
557							this.__initCatcher = null;
558
559						}
560					}, this);
561					BX.addCustomEvent(manager.eventNode, 'onControllerInitialized', this.__initCatcher);
562				}
563			}, this);
564			BX.addCustomEvent(window, this.events.onBound, dndF);
565			if (repo.controller[this.id])
566				dndF(repo.controller[this.id]);
567		}
568
569	},
570	bindEvents : function(manager)
571	{
572		this._catchHandler = BX.delegate(function(handler)
573		{
574			BX.removeCustomEvent(this.eventNode, this.events.onInit, this._catchHandler);
575			this.handler = handler;
576			var node = BX.findChild(BX(manager.formID), {attr: {id: this.props.securityCID}}, true, false);
577			if (node)
578				node.value = this.handler.CID;
579			this.exec();
580			var func = BX.delegate(function() { BX.onCustomEvent(manager.eventNode, "onUploadsHasBeenChanged", arguments); }, this);
581			BX.addCustomEvent(this.handler.agent, "onFileIsInited", func); // new uploader
582			BX.addCustomEvent(this.handler.agent, "ChangeFileInput", func); // old uploader
583			BX.onCustomEvent(manager.eventNode, 'onControllerInitialized', [this.id, handler]);
584		}, this);
585		if (typeof this.handler != "object" || !this.handler)
586			BX.addCustomEvent(manager.eventNode, this.events.onInit, this._catchHandler);
587		else
588			this._catchHandler(this.handler);
589
590		BX.addCustomEvent(manager.eventNode, 'OnFileUploadSuccess', BX.delegate(function(result, obj, blob) {if (this.id == obj.CID || this.id == obj.id) { blob = (blob || {}); blob.usePostfix = true; this.addFile(result, blob, obj); } }, this));
591		BX.addCustomEvent(manager.eventNode, 'OnFileUploadFailed', BX.delegate(function(result, obj, blob) { if (this.id == obj.CID || this.id == obj.id) { this.failFile(result, blob, obj); } }, this));
592		BX.addCustomEvent(manager.eventNode, 'OnFileUploadRemove', BX.delegate(function(result, obj) { if (this.id == obj.CID || this.id == obj.id) { this.deleteFile(result, {usePostfix : true}, obj); } }, this));
593		BX.addCustomEvent(this, "onFileIsInText", BX.proxy(function(file, inText) { this.adjustFile(this.checkFile(file), inText) }, this));
594	},
595	addFile : function(result, blob, obj)
596	{
597		var file = this.checkFile(result.element_id, result, blob);
598		if (file)
599		{
600			setTimeout(BX.proxy(function(){
601				this.bindFile(file);
602				this.adjustFile(file, false);
603			}, this), 100);
604			BX.onCustomEvent(this.eventNode, 'onFileIsAdded', [file, this, obj, blob]);
605		}
606		else
607		{
608			this.failFile(this, blob, obj);
609		}
610		return true;
611	},
612	failFile : function(node, blob, obj)
613	{
614		BX.onCustomEvent(this.eventNode, 'onFileIsFailed', [this, obj, blob]);
615	},
616	checkFile : function(id, result)
617	{
618		id = '' + (typeof id == "object" ? id.id : id);
619		if (typeof result == "object" &&
620			result !== null && id &&
621			result.element_name &&
622			BX(result.place))
623		{
624			var data = {
625					id : id,
626					name : result.element_name,
627					url : result.element_url,
628					type : 'isnotimage/xyz',
629					isImage : false,
630					place : BX(result.place, true),
631					xmlID : BX(result.place, true).getAttribute("bx-attach-xml-id"),
632					fileID : BX(result.place, true).getAttribute("bx-attach-file-id")
633				},
634				preview;
635			if (/(\.png|\.jpg|\.jpeg|\.gif|\.bmp)$/i.test(result.element_name) &&
636				(preview = BX.findChild(data.place, {'className': 'files-preview', 'tagName' : 'IMG'}, true, false)) && preview)
637			{
638				data.type = 'image/xyz';
639				data.lowsrc = preview.src;
640				data.element_url = data.src = preview.src.replace(/\Wwidth=(\d+)/, '').replace(/\Wheight=(\d+)/, '');
641				data.isImage = true;
642				data.width = parseInt(preview.getAttribute("data-bx-full-width") || preview.getAttribute("data-bx-width"));
643				data.height = parseInt(preview.getAttribute("data-bx-full-height") || preview.getAttribute("data-bx-height"));
644			}
645			if (data.xmlID)
646				this.xmlToAttach[data.xmlID + ''] = id;
647			if (data.fileID)
648				this.fileToAttach[data.fileID + ''] = id;
649
650			this.values[id] = data;
651		}
652		return (this.values[id] || false);
653	},
654	bindFile : function(file)
655	{
656		var node = file.place;
657		if (typeof file == "object" && node && !node.hasAttribute("bx-file-is-bound"))
658		{
659			var name_wrap = BX.findChild(node, {className: 'f-wrap'}, true, false),
660				img_wrap = BX.findChild(node, {className: 'files-preview'}, true, false);
661			if (name_wrap)
662			{
663				BX.bind(name_wrap, "click", BX.delegate(function(){this.insertFile(file.id);}, this));
664				name_wrap.style.cursor = "pointer";
665				name_wrap.title = BX.message('MPF_FILE');
666			}
667			if (img_wrap)
668			{
669				BX.bind(img_wrap, "click", BX.delegate(function(){this.insertFile(file.id);}, this));
670			}
671		}
672	},
673	adjustFile : function(file, inText)
674	{
675		var node = file.place;
676		if (inText === true || inText === false)
677		{
678			if (!file.info)
679				file.info = BX.findChild(file.place, {className: 'files-info'}, true, false);
680			node = file.info;
681			if (BX.type.isDomNode(node))
682			{
683				var id = 'check-in-text-' + file.id,
684					button = BX(id),
685					props = (inText === false ? {
686						attrs : {
687							'bx-file-is-in-text' : "N"
688						},
689						props : {
690							className : 'insert-btn'
691						},
692						html : '<span class="insert-btn-text">' + BX.message("MPF_FILE_INSERT_IN_TEXT") + '</span>'
693					} : {
694						attrs : {
695							'bx-file-is-in-text' : "Y"
696						},
697						props : {
698							className : 'insert-text'
699						},
700						html : '<span class="insert-btn-text">' + BX.message("MPF_FILE_IN_TEXT") + '</span>'
701					});
702				if (!button)
703				{
704					props.attrs.id = id;
705					props.events = {
706						click : BX.proxy(function(){this.insertFile(file.id);}, this)
707					};
708					node.appendChild(BX.create('SPAN', props));
709				}
710				else
711				{
712					BX.adjust(button, props);
713				}
714			}
715		}
716	},
717	insertFile : function(file)
718	{
719		BX.onCustomEvent(this.eventNode, 'onFileIsInserted', [this.checkFile(file), this]);
720	},
721	deleteFile : function(file, params)
722	{
723		file = this.checkFile(file, params);
724		if (file)
725		{
726			BX.onCustomEvent(this.eventNode, 'onFileIsDeleted', [file, this]);
727			this.values[file.id].place = null;
728			delete this.values[file.id].place;
729			this.values[file.id] = null;
730			delete this.values[file.id];
731			file = null;
732			return true;
733		}
734		return false;
735	},
736	reinitValues : function(text, files) // when data needs to be generated
737	{
738		var id, node, data = {};
739		while ((id = files.pop()) && id)
740		{
741			node = BX(this.prefixHTMLNode + id);
742			node = (node ? (node.tagName == "A" ? node : BX.findChild(node, {tagName : "IMG"}, true)) : null);
743			if (node)
744			{
745				data['E' + id] = {
746					type: 'file',
747					id: id,
748					name: node.getAttribute("data-bx-title"),
749					size: node.getAttribute("data-bx-size"),
750					sizeInt: node.getAttribute("data-bx-size"),
751					width: node.getAttribute("data-bx-width"),
752					height: node.getAttribute("data-bx-height"),
753					storage: 'disk',
754					previewUrl: (node.tagName == "A" ? '' : node.getAttribute("data-bx-src")),
755					fileId: node.getAttribute("bx-attach-file-id")
756				};
757				if (node.hasAttribute("bx-attach-xml-id"))
758					data['E' + id]["xmlId"] = node.getAttribute("bx-attach-xml-id");
759			}
760		}
761		this.handler.selectFile({}, {}, data);
762		this.runCheckText();
763	},
764	runCheckText : function()
765	{
766		if (!this._checkText)
767			this._checkText = BX.delegate(this.checkText, this);
768		this.manager.exec(this._checkText);
769	},
770	checkText : function()
771	{
772		var
773			text1, text = this.manager.getContent(),
774			needToReparse = [], reg, ii;
775		if (text != '')
776		{
777			text1 = text;
778			for (ii in this.xmlToAttach)
779			{
780				if (this.xmlToAttach.hasOwnProperty(ii))
781				{
782					text = text.
783						replace(
784							new RegExp('\\&\\#91\\;DOCUMENT ID=(' + ii + ')([WIDTHHEIGHT=0-9 ]*)\\&\\#93\\;','gim'),
785							'[' + this.parser["tag"] + '=' + this.xmlToAttach[ii] + "$2]").
786						replace(
787							new RegExp('\\[DOCUMENT ID=(' + ii + ')([WIDTHHEIGHT=0-9 ]*)\\]','gim'),
788							'[' + this.parser["tag"] + '=' + this.xmlToAttach[ii] + "$2]");
789				}
790			}
791			for (ii in this.fileToAttach)
792			{
793				if (this.fileToAttach.hasOwnProperty(ii))
794				{
795					text = text.
796						replace(
797							new RegExp('\\&\\#91\\;' + this.parser["tag"] + '=(' + ii + ')([WIDTHHEIGHT=0-9 ]*)\\&\\#93\\;','gim'),
798							'[' + this.parser["tag"] + '=' + this.fileToAttach[ii] + "$2]").
799						replace(
800							new RegExp('\\[' + this.parser["tag"] + '=(' + ii + ')([WIDTHHEIGHT=0-9 ]*)\\]','gim'),
801							'[' + this.parser["tag"] + '=' + this.fileToAttach[ii] + "$2]");
802				}
803			}
804			reg = new RegExp('(?:\\&\\#91\\;)(' + this.parser["tags"].join("|") + ')=([a-z=0-9 ]+)(?:\\&\\#93\\;)','gim');
805			if (reg.test(text))
806			{
807				for (ii in this.values)
808				{
809					if (this.values.hasOwnProperty(ii))
810					{
811						needToReparse.push(ii);
812					}
813				}
814				if (needToReparse.length > 0)
815				{
816					reg = new RegExp('(?:\\&\\#91\\;|\\[)(' + this.parser["tags"].join("|") + ')=(' + needToReparse.join("|") + ')([WIDTHHEIGHT=0-9 ]*)(?:\\&\\#93\\;|\\])','gim');
817					if (reg.test(text))
818						text = text.replace(reg, BX.delegate(function(str, tagName, id, add) { return '[' + tagName + '=' + id + add + ']'; }, this));
819				}
820			}
821
822			if (text1 != text)
823				BX.onCustomEvent(this.eventNode, 'onFileIsDetected', [text, this]);
824		}
825		return text;
826	},
827	clean : function()
828	{
829		if (this.handler && this.handler.values)
830		{
831			var res, files, ii, form = BX(this.manager.formID);
832			while ((res = this.handler.values.pop()) && res)
833			{
834				BX.remove(res);
835			}
836			if (this.handler.params && this.handler.params.controlName)
837			{
838				files = BX.findChildren(form, {
839					tagName : "INPUT",
840					attribute : {
841						name : this.handler.params.controlName
842					}
843				}, true);
844			}
845			if (files)
846			{
847				for (ii = 0; ii < files.length; ii++)
848				{
849					BX.remove(files[ii]);
850				}
851			}
852		}
853	},
854	reinit : function(text, data)
855	{
856		var files = [], name, ii;
857		for (name in data)
858		{
859			if (data.hasOwnProperty(name))
860			{
861				if (data[name]['USER_TYPE_ID'] == this.parserName && data[name]['VALUE'])
862				{
863					for (ii in data[name]['VALUE'])
864					{
865						if (data[name]['VALUE'].hasOwnProperty(ii))
866						{
867							files.push(data[name]['VALUE'][ii]);
868						}
869					}
870				}
871			}
872		}
873		if (files.length > 0)
874		{
875			this.exec(this.reinitValues, [text, files]);
876			return true;
877		}
878		return false;
879	}
880};
881var webdavController = function(manager, id, params)
882{
883	webdavController.superclass.constructor.apply(this, arguments);
884	this.parser = (manager.parser['webdav_element'] || null);
885	this.node = BX('wduf-selectdialog-' + id);
886	this.manager = manager;
887	this.parserName = 'webdav_element';
888	this.prefixNode = 'wd-doc';
889	this.prefixHTMLNode = 'wdif-doc-';
890	this.storage = 'webdav';
891	this.events = {
892		onInit : 'WDLoadFormControllerInit',
893		onShow : 'WDLoadFormController',
894		onBound : 'WDLoadFormControllerWasBound'};
895};
896BX.extend(webdavController, diskController);
897webdavController.prototype.reinitValues = function(text, files) // when data needs to be generated
898{
899	var id, node, data = {};
900	this.waitAnswerFromServer = [];
901	while ((id = files.pop()) && id)
902	{
903		node = BX(this.prefixHTMLNode + id);
904		node = (node ? (node.tagName == "A" ? node : BX.findChild(node, {tagName : "IMG"}, true)) : null);
905		if (node)
906		{
907			data['E' + id] = {
908				type: 'file',
909				id: id,
910				name: node.getAttribute("alt"),
911				storage: 'webdav',
912				size: node.getAttribute("data-bx-size"),
913				sizeInt: 1,
914				ext: '',
915				link: node.getAttribute("data-bx-document")
916			};
917			if (node.hasAttribute("bx-attach-xml-id"))
918				data['E' + id]["xmlId"] = node.getAttribute("bx-attach-xml-id");
919			this.waitAnswerFromServer.push(id);
920		}
921	}
922	if (this.waitAnswerFromServer.length > 0)
923	{
924		if (!this._defferCheckText)
925			this._defferCheckText = BX.delegate(this.defferCheckText, this);
926		BX.addCustomEvent(this.eventNode, 'OnFileUploadSuccess', this._defferCheckText);
927		this.handler.WDFD_SelectFile({}, {}, data);
928	}
929};
930webdavController.prototype.defferCheckText = function(result)
931{
932	var key = BX.util.array_search(result.element_id, this.waitAnswerFromServer);
933	if (key >= 0)
934	{
935		this.runCheckText();
936		this.waitAnswerFromServer = BX.util.deleteFromArray(this.waitAnswerFromServer, key);
937	}
938	if (this.waitAnswerFromServer.length <= 0)
939		BX.removeCustomEvent(this.eventNode, 'OnFileUploadSuccess', this._defferCheckText);
940};
941var fileController = function(manager, id, params)
942{
943	fileController.superclass.constructor.apply(this, arguments);
944	this.parser = (manager.parser['file'] ? manager.parser['file'] : (manager.parser['postimage']['exist'] ? manager.parser['postimage'] : null));
945	this.postfix = (params['postfix'] || '');
946	this.node = BX('file-selectdialog-' + id);
947	this.parserName = 'file';
948	this.prefixNode = 'wd-doc';
949	this.prefixHTMLNode = 'file-doc-';
950	this.props = {
951		valueEditClassName : 'file-inline-file',
952		securityCID : 'upload-cid'
953	};
954	this.storage = 'bfile';
955	this.events = {
956		onInit : 'BFileDLoadFormControllerInit',
957		onShow : 'BFileDLoadFormController',
958		onBound : 'BFileDLoadFormControllerWasBound'};
959};
960BX.extend(fileController, diskController);
961fileController.prototype.initValues = function(result)
962{
963	var values;
964	if (result !== true)
965	{
966		values = BX.findChildren(this.node, {'className' : this.props.valueEditClassName}, true);
967		if (values && values.length > 1)
968		{
969			this.exec(this.initValues, [true]);
970			return true;
971		}
972		return false;
973	}
974	values = (this.handler.agent.values || []);
975	var
976		file, node, data, id,
977		ID = {},
978		url = '/bitrix/components/bitrix/main.file.input/file.php?mfi_mode=down&cid='+this.handler.CID + '&sessid='+BX.bitrix_sessid();
979	for (var ii = 0; ii < values.length; ii++)
980	{
981		id = parseInt(values[ii].getAttribute("id").replace(this.prefixNode, ""));
982		if (ID['id' + id])
983			continue;
984		ID['id' + id] = "Y";
985		if (id > 0)
986		{
987			node = BX.findChild(values[ii], {'className': 'f-wrap'}, true, false);
988			if(!node)
989				continue;
990			data = {
991				element_id : id,
992				element_name : node.innerHTML,
993				parser : this.parser.bxTag,
994				storage : 'bfile',
995				element_url : (url + '&fileID=' + id)
996			};
997			file = this.addFile(data, {usePostfix : true, hasPreview : false});
998		}
999	}
1000	this.runCheckText();
1001	return true;
1002};
1003fileController.prototype.checkFile = function(id, result, param)
1004{
1005	id = '' + (typeof id == "object" ? id.id : id);
1006	id = id + (param && param["usePostfix"] === true ? this.postfix : '');
1007	if (typeof result == "object" &&
1008		result !== null && id &&
1009		result.element_name &&
1010		BX(this.prefixNode + result.element_id, true))
1011	{
1012		var data = {
1013				id : id,
1014				name : result.element_name,
1015				url : result.element_url,
1016				type : 'isnotimage/xyz',
1017				isImage : false,
1018				place : BX(this.prefixNode + result.element_id, true)
1019			},
1020			preview;
1021		if ((result['element_type'] && result['element_type'].indexOf('image/') === 0 || /(\.png|\.jpg|\.jpeg|\.gif|\.bmp)$/i.test(result.element_name)) &&
1022			((preview = BX.findChild(data.place, {'tagName' : 'IMG'}, true, false)) && preview || (param && param["hasPreview"] === false)))
1023		{
1024			data.type = 'image/xyz';
1025			data.src = (result['element_thumbnail'] || result['element_url']);
1026			data.isImage = true;
1027			data.hasPreview = false;
1028			data.lowsrc = '';
1029			data.width = '';
1030			data.height = '';
1031			if (BX(preview))
1032			{
1033				data.hasPreview = true;
1034				data.lowsrc = (result['element_thumbnail'] || preview['src']);
1035				data.width = parseInt(preview.getAttribute("data-bx-full-width"));
1036				data.height = parseInt(preview.getAttribute("data-bx-full-height"));
1037			}
1038		}
1039		else if (this.parser.bxTag == 'postimage')
1040		{
1041			return false;
1042		}
1043
1044		this.values[id] = data;
1045	}
1046	return (this.values[id] || false);
1047};
1048fileController.prototype.bindFile = function(file)
1049{
1050	var node = (file && file['place'] ? file['place'] : null);
1051	if (typeof file == "object" && node && !node.hasAttribute("bx-file-is-bound"))
1052	{
1053		if (file.isImage && file.hasPreview)
1054		{
1055			var
1056				img_title = BX.findChild(node, {className: 'feed-add-img-title'}, true, false),
1057				img_wrap = BX.findChild(node, {className: 'feed-add-img-wrap'}, true, false);
1058			if (img_wrap)
1059			{
1060				BX.bind(img_wrap, "click", BX.proxy(function(){this.insertFile(file);}, this));
1061				img_wrap.style.cursor = "pointer";
1062				img_wrap.title = BX.message('MPF_IMAGE');
1063			}
1064			if (img_title)
1065			{
1066				BX.bind(img_title, "click", BX.delegate(function(){this.insertFile(file);}, this));
1067				img_title.style.cursor = "pointer";
1068				img_title.title = BX.message('MPF_IMAGE');
1069			}
1070		}
1071		else
1072			fileController.superclass.bindFile.apply(this, arguments);
1073	}
1074};
1075fileController.prototype.clean = function()
1076{
1077	fileController.superclass.clean.apply(this, arguments);
1078	if (this["handler"] && this.handler["agent"] && this.handler.agent["inputName"])
1079	{
1080		var files, ii, form = BX(this.manager.formID);
1081		files = BX.findChildren(form, {
1082			tagName : "INPUT",
1083			attribute : {
1084				name : this.handler.agent.inputName + "[]"
1085			}
1086		}, true);
1087		if (files)
1088		{
1089			for (ii = 0; ii < files.length; ii++)
1090			{
1091				BX.remove(files[ii]);
1092			}
1093		}
1094	}
1095};
1096
1097var LHEPostForm = function(formID, params)
1098{
1099	this.params = params;
1100	this.formID = formID;
1101	this.showPinButton = !!BX('lhe_button_editor_' + this.formID);
1102	if(this.showPinButton)
1103	{
1104		this.params.showPanelEditor = !!this.params.pinEditorPanel;
1105	}
1106	this.oEditorId = params['LHEJsObjId'];
1107	this.__divId = (params['LHEJsObjName'] || params['LHEJsObjId']);
1108	repo.handler[this.oEditorId] = this;
1109	this.oEditor = LHEPostForm.getEditor(this.oEditorId);
1110	this.urlPreview = this.initUrlPreview(params);
1111
1112	this.eventNode = BX('div' + this.__divId);
1113	BX.addCustomEvent(this.eventNode, 'OnShowLHE', BX.delegate(this.OnShowLHE, this));
1114	BX.addCustomEvent(this.eventNode, 'OnButtonClick', BX.delegate(this.OnButtonClick, this));
1115	BX.addCustomEvent(this.eventNode, 'OnAfterShowLHE', function(status, handler) {
1116		if (handler.oEditor && handler.oEditor["AllowBeforeUnloadHandler"])
1117			handler.oEditor.AllowBeforeUnloadHandler();
1118		if (handler.monitoringWakeUp === true)
1119			handler.monitoringStart();
1120	});
1121	BX.addCustomEvent(this.eventNode, 'OnAfterHideLHE', function(status, handler) {
1122		handler.monitoringWakeUp = handler.monitoringStop();
1123		if (handler.oEditor && handler.oEditor["DenyBeforeUnloadHandler"])
1124			handler.oEditor.DenyBeforeUnloadHandler();
1125	});
1126	this.initParsers(params);
1127	this.initFiles(formID, params);
1128
1129	BX.ready(
1130		BX.delegate(
1131			function()
1132			{
1133				if (BX('lhe_button_submit_' + formID, true))
1134				{
1135					BX.bind(BX('lhe_button_submit_' + formID, true), 'mousedown', function(){ BX.addClass(this, 'feed-add-button-press'); });
1136					BX.bind(BX('lhe_button_submit_' + formID, true), 'mouseup', function(){ BX.removeClass(this, 'feed-add-button-press'); });
1137					BX.bind(BX('lhe_button_submit_' + formID, true), 'click', BX.proxy(function(e){
1138						BX.onCustomEvent(this.eventNode, 'OnButtonClick', ['submit']);
1139						return BX.PreventDefault(e);
1140					}, this));
1141				}
1142				if (BX('lhe_button_cancel_' + formID, true))
1143				{
1144					BX.bind(BX('lhe_button_cancel_' + formID, true), 'mousedown', function(){ BX.addClass(this, 'feed-add-button-press'); });
1145					BX.bind(BX('lhe_button_cancel_' + formID, true), 'mouseup', function(){ BX.removeClass(this, 'feed-add-button-press'); });
1146					BX.bind(BX('lhe_button_cancel_' + formID, true), 'click', BX.proxy(function(e){
1147						BX.onCustomEvent(this.eventNode, 'OnButtonClick', ['cancel']);
1148						return BX.PreventDefault(e);
1149					}, this));
1150				}
1151			},
1152			this
1153		)
1154	);
1155
1156	this.inited = true;
1157	BX.addCustomEvent(BX(this.formID), 'onAutoSavePrepare', function(ob) { ob.FORM.setAttribute("bx-lhe-autosave-prepared", "Y"); });
1158
1159	BX.onCustomEvent(this, "onInitialized", [this, formID, params, this.parsers]);
1160	BX.onCustomEvent(this.eventNode, "onInitialized", [this, formID, params, this.parsers]);
1161	if (this.oEditor && this.oEditor.inited && !this.oEditor['__lhe_flags'])
1162	{
1163		BX.onCustomEvent(this.oEditor, "OnEditorInitedBefore", [this.oEditor]);
1164		BX.onCustomEvent(this.oEditor, "OnEditorInitedAfter", [this.oEditor, true]);
1165	}
1166};
1167LHEPostForm.prototype = {
1168	editorIsLoaded : false,
1169	arFiles : {},
1170	parser : {},
1171	controllers : {},
1172	exec : function(func, args)
1173	{
1174		this.functionsToExec = (this.functionsToExec || []);
1175		if (typeof func == "function")
1176			this.functionsToExec.push([func, args]);
1177		if (this.editorIsLoaded === true)
1178		{
1179			var res;
1180			while((res = this.functionsToExec.shift()) && res)
1181				res[0].apply(this, res[1]);
1182		}
1183	},
1184	initParsers : function(params)
1185	{
1186		this.parser = {
1187			postimage : {
1188				exist : false,
1189				bxTag : 'postimage',
1190				tag : "IMG ID",
1191				tags : ["IMG ID"],
1192				regexp : /\[(IMG ID)=((?:\s|\S)*?)(?:\s*?WIDTH=(\d+)\s*?HEIGHT=(\d+))?\]/ig,
1193				code : '[IMG ID=#ID##ADDITIONAL#]',
1194				wysiwyg : '<img id="#ID#" src="' + '#SRC#" lowsrc="' + '#LOWSRC#" title=""#ADDITIONAL# />'
1195			}
1196		};
1197		var parsers = (params["parsers"] ? params["parsers"] : {});
1198		for (var ii in parsers)
1199		{
1200			if (parsers.hasOwnProperty(ii) && /[a-z]/gi.test(ii+''))
1201			{
1202				this.parser[ii] = new parserClass(ii, parsers[ii]);
1203			}
1204		}
1205		if (BX.util.object_search('UploadImage', parsers))
1206		{
1207			this.parser['postimage']['exist'] = true;
1208		}
1209		if (typeof params['arSize'] == "object")
1210		{
1211			var style = '';
1212			if (params['arSize']['width'])
1213				style += 'max-width:' + params['arSize']['width'] + 'px;';
1214			if (params['arSize']['height'])
1215				style += 'max-height:' + params['arSize']['height'] + 'px;';
1216			if (style !== '')
1217				this.parser['postimage']['wysiwyg'] = this.parser['postimage']['wysiwyg'].replace('#ADDITIONAL#', 'style="' + style + '" #ADDITIONAL#');
1218		}
1219	},
1220	initFiles : function(formID, params)
1221	{
1222		this.arFiles = {};
1223		this.controllers = {
1224			common : {
1225				postfix : "",
1226				storage : "bfile",
1227				parser : "postimage",
1228				node : window,
1229				obj : null,
1230				init : false
1231			}
1232		};
1233		if (!params["CID"] || typeof params["CID"] !== "object")
1234			return;
1235
1236		BX.addCustomEvent(this.eventNode, 'onFileIsAdded', BX.delegate(this.OnFileUploadSuccess, this));
1237		BX.addCustomEvent(this.eventNode, 'onFileIsFailed', BX.delegate(this.OnFileUploadFailed, this));
1238		BX.addCustomEvent(this.eventNode, 'onFileIsDeleted', BX.delegate(this.OnFileUploadRemove, this));
1239		BX.addCustomEvent(this.eventNode, 'onFileIsDetected', BX.delegate(this.setContent, this));
1240		BX.addCustomEvent(this.eventNode, 'onFileIsInserted', BX.delegate(this.insertFile, this));
1241
1242		var parser, cid, init;
1243
1244		for (cid in params["CID"])
1245		{
1246			if (params["CID"].hasOwnProperty(cid))
1247			{
1248				parser = params["CID"][cid]["parser"];
1249				if (parser == 'disk_file')
1250					this.controllers[cid] = new diskController(this, cid, params["CID"][cid]);
1251				else if (parser == 'webdav_element')
1252					this.controllers[cid] = new webdavController(this, cid, params["CID"][cid]);
1253				else if (parser == 'file')
1254					this.controllers[cid] = new fileController(this, cid, params["CID"][cid]);
1255				if (this.controllers[cid] && this.controllers[cid].init() && !init)
1256					init = true;
1257			}
1258		}
1259
1260		BX.ready(
1261			BX.delegate(
1262				function()
1263				{
1264					BX.bind(BX('bx-b-uploadfile-' + formID), 'click', BX.proxy(this.controllerInit, this));
1265					if (init)
1266						this.controllerInit('show');
1267				},
1268				this
1269			)
1270		);
1271	},
1272	controllerInit : function(status)
1273	{
1274		this.controllerInitStatus = (status == 'show' || status == 'hide' ? status : (this.controllerInitStatus == 'show' ? 'hide' : 'show'));
1275		BX.onCustomEvent(this.eventNode, "onShowControllers", [this.controllerInitStatus]);
1276	},
1277	initUrlPreview: function()
1278	{
1279		if(this.params['urlPreviewId'] && window['BXUrlPreview'] && BX(this.params['urlPreviewId']))
1280		{
1281			return new BXUrlPreview(BX(this.params['urlPreviewId']));
1282		}
1283		return null;
1284	},
1285	getContent : function()
1286	{
1287		return (this.oEditor ? this.oEditor.GetContent() : '');
1288	},
1289	setContent : function(text)
1290	{
1291		if (this.oEditor)
1292			this.oEditor.SetContent(text);
1293	},
1294	OnFileUploadSuccess : function(file, controller, uploaded, blob)
1295	{
1296		if (this.controllers[controller.id])
1297		{
1298			var id = controller.parser.bxTag + file.id;
1299			this.arFiles[id] = (this.arFiles[id] || []);
1300			this.arFiles[id].push(controller.id);
1301
1302			if (blob && blob["referrerToEditor"])
1303			{
1304				var regs = this.getFileToInsert(file, controller);
1305				BX.onCustomEvent(blob["referrerToEditor"], "OnImageDataUriCaughtUploaded", [regs]);
1306				BX.onCustomEvent(this.oEditor, "OnImageDataUriCaughtUploaded", [blob["referrerToEditor"], file, regs]);
1307			}
1308			else if (uploaded === true && file.isImage && this.insertImageAfterUpload)
1309			{
1310				if (!this._insertFile)
1311					this._insertFile = BX.delegate(this.insertFile, this);
1312				this.exec(this._insertFile, arguments);
1313			}
1314		}
1315	},
1316	OnFileUploadFailed : function(file, controller, blob)
1317	{
1318		if (blob && blob["referrerToEditor"])
1319		{
1320			BX.onCustomEvent(blob["referrerToEditor"], "OnImageDataUriCaughtFailed", []);
1321			BX.onCustomEvent(this.editor, "OnImageDataUriCaughtFailed", [blob["referrerToEditor"]]);
1322		}
1323	},
1324	OnFileUploadRemove : function(file, controller)
1325	{
1326		if (this.controllers[controller.id])
1327		{
1328			var id = controller.parser.bxTag + file.id;
1329			if (this.arFiles[id])
1330			{
1331				var key = BX.util.array_search(controller.id, this.arFiles[id]);
1332				this.arFiles[id] = BX.util.deleteFromArray(this.arFiles[id], key);
1333				if (!this.arFiles[id] || this.arFiles[id].length <= 0)
1334				{
1335					this.arFiles[id] = null;
1336					delete this.arFiles[id];
1337					if (!this._deleteFile)
1338						this._deleteFile = BX.delegate(this.deleteFile, this);
1339					this.exec(this._deleteFile, arguments);
1340				}
1341			}
1342		}
1343	},
1344
1345	showPanelEditor : function(show, save)
1346	{
1347		if (show == undefined)
1348			show = !this.oEditor.toolbar.IsShown();
1349        //force show toolbar
1350		show = true;
1351		this.params.showPanelEditor = show;
1352		var
1353			button = BX('lhe_button_editor_' + this.formID),
1354			panelClose = BX('panel-close' + this.__divId);
1355
1356		if (panelClose)
1357		{
1358			this.oEditor.dom.cont.appendChild(panelClose);
1359		}
1360
1361		if(show)
1362		{
1363			this.oEditor.dom.toolbarCont.style.opacity = 'inherit';
1364			this.oEditor.toolbar.Show();
1365
1366			if (button)
1367				BX.addClass(button, 'feed-add-post-form-btn-active');
1368
1369			if (panelClose)
1370				panelClose.style.display = '';
1371		}
1372		else
1373		{
1374			this.oEditor.toolbar.Hide();
1375
1376			if (button)
1377				BX.removeClass(button, 'feed-add-post-form-btn-active');
1378
1379			if (panelClose)
1380				panelClose.style.display = 'none';
1381		}
1382		if (save !== false)
1383			BX.userOptions.save('main.post.form', 'postEdit', 'showBBCode', show ? "Y" : "N");
1384	},
1385	monitoring : {
1386		interval : null,
1387		text : '',
1388		savedText : '',
1389		files : [],
1390		savedFiles : []
1391	},
1392	monitoringStart : function()
1393	{
1394		if (this.monitoring.interval === null)
1395		{
1396			if (!this._monitoringStart)
1397			{
1398				this._monitoringStart = BX.delegate(this.checkFilesInText, this);
1399				BX.addCustomEvent(this.oEditor, 'OnContentChanged', BX.proxy(function(text) {
1400					this.monitoring.text = text;
1401				}, this));
1402			}
1403			this.monitoring.interval = setInterval(this._monitoringStart, 1000);
1404		}
1405	},
1406	monitoringStop : function()
1407	{
1408		var ret = (this.monitoring.interval !== null);
1409		if (this.monitoring.interval !== null)
1410			clearInterval(this.monitoring.interval);
1411		this.monitoring.interval = null;
1412		return ret;
1413	},
1414	monitoringSetStatus: function(parser, file, inText)
1415	{
1416		if (this.arFiles[parser + file])
1417		{
1418			var cid;
1419			for (var ii = 0; ii < this.arFiles[parser + file].length; ii++)
1420			{
1421				this.monitoring.files.push(parser + file);
1422				cid = this.arFiles[parser + file][ii];
1423				BX.onCustomEvent(this.controllers[cid], "onFileIsInText", [file, inText]);
1424			}
1425		}
1426	},
1427	checkFilesInText: function()
1428	{
1429		if (this.monitoring.text !== this.monitoring.savedText)
1430		{
1431			this.monitoring.savedText = this.monitoring.text;
1432			this.monitoring.files = [];
1433			var text = this.monitoring.savedText,
1434				ii, closure = function(a,parser) {return function(str, tagName, id) { a.monitoring.files.push([parser, id].join('/')); } };
1435			for (ii in this.parser)
1436			{
1437				if (this.parser.hasOwnProperty(ii))
1438				{
1439					if (!this.parser[ii]["checkFilesInText"])
1440					{
1441						this.parser[ii]["checkFilesInText"] = closure(this, ii);
1442					}
1443					text.replace(
1444						this.parser[ii]["regexp"],
1445						this.parser[ii]["checkFilesInText"]
1446					);
1447				}
1448			}
1449			if (this.monitoring.savedFiles.join(',') != this.monitoring.files.join(','))
1450			{
1451
1452				var files = this.monitoring.files.join('|') + '|', id;
1453				for (ii = 0; ii < this.monitoring.savedFiles.length; ii++)
1454				{
1455					id = this.monitoring.savedFiles[ii];
1456					if (files.indexOf(id + '|') >= 0)
1457						files = files.replace(id + '|', '');
1458					else
1459					{
1460						id = id.split('/');
1461						this.monitoringSetStatus(id[0], id[1], false);
1462					}
1463				}
1464				files = files.substring(0, files.length - 1).split('|');
1465				for (ii = 0; ii < files.length; ii++)
1466				{
1467					id = id = files[ii].split('/');
1468					this.monitoringSetStatus(id[0], id[1], true);
1469				}
1470			}
1471			this.monitoring.savedFiles = this.monitoring.files;
1472			if (this.monitoring.savedFiles.length <= 0)
1473				this.monitoringStop();
1474		}
1475	},
1476	checkFile : function(file, controller) // or fileId and controller or fileId and parser
1477	{
1478		var r = false;
1479		if (typeof file == 'string')
1480		{
1481			var parser = (typeof controller == 'string' ? controller : controller.parser);
1482
1483			if (!!this.arFiles[parser + file])
1484			{
1485				var fileController = this.arFiles[parser + file][0];
1486				controller = this.controllers[fileController];
1487				r = {
1488					file : controller.values[file],
1489					controller : controller
1490				};
1491			}
1492		}
1493		else if (this.controllers[controller.id])
1494		{
1495			r = {
1496				file : file,
1497				controller : controller
1498			};
1499		}
1500		return r
1501	},
1502	insertFile : function(file, controller)
1503	{
1504		var editor = this.oEditor;
1505		if (editor && file)
1506		{
1507			var editorMode = editor.GetViewMode(),
1508				res = this.getFileToInsert(file, controller);
1509
1510			if(editorMode == 'wysiwyg') // WYSIWYG
1511			{
1512				editor.InsertHtml(res.replacement);
1513				setTimeout(BX.delegate(editor.AutoResizeSceleton, editor), 500);
1514				setTimeout(BX.delegate(editor.AutoResizeSceleton, editor), 1000);
1515			}
1516			else if (editorMode == 'code' && editor.bbCode) // BB Codes
1517			{
1518				editor.textareaView.Focus();
1519				editor.textareaView.WrapWith(false, false, res.replacement);
1520			}
1521			res["callback"]();
1522		}
1523	},
1524	getFileToInsert : function(file, controller)
1525	{
1526		var editor = this.oEditor;
1527		if (editor && file)
1528		{
1529			var
1530				fileID = file['id'],
1531				params = '',
1532				parser = controller.parser,
1533				editorMode = editor.GetViewMode(),
1534				pattern = this.parser[parser.bxTag][editorMode];
1535
1536			if (file['isImage'])
1537			{
1538				pattern = (editorMode == "wysiwyg" ? this.parser["postimage"][editorMode] : pattern);
1539				if (file.width > 0 && file.height > 0 && editor.sEditorMode == "html" )
1540				{
1541					params = ' style="width:' + file.width + 'px;height:' + file.height + 'px;" onload="this.style=\' \'"';
1542				}
1543			}
1544
1545			if(editorMode == 'wysiwyg') // WYSIWYG
1546			{
1547				pattern = pattern.
1548					replace("#ID#", editor.SetBxTag(false, {'tag': parser.bxTag, params: {'value' : fileID}})).
1549					replace("#SRC#", file.src).replace("#URL#", file.url).
1550					replace("#LOWSRC#", (file.lowsrc || '')).
1551					replace("#NAME#", file.name).replace("#ADDITIONAL#", params) + '<span>&nbsp;</span>';
1552			}
1553			else if (editorMode == 'code' && editor.bbCode) // BB Codes
1554			{
1555				pattern = pattern.replace("#ID#", fileID).replace("#ADDITIONAL#", "");
1556			}
1557			return {
1558				replacement : pattern,
1559				"callback" : BX.proxy(function(){
1560					this.monitoringSetStatus(controller.parser.bxTag, file.id, true);
1561					this.monitoringStart();
1562				}, this)
1563			}
1564		}
1565		return {
1566			replacement : "",
1567			"callback" : BX.DoNothing
1568		};
1569	},
1570
1571	deleteFile: function(file, controller)
1572	{
1573		var
1574			editor = this.oEditor,
1575			parser = controller.parser,
1576			id = file.id,
1577			content = editor.GetContent();
1578
1579		if (parser && content.indexOf('=' + id) >= 0)
1580		{
1581			if(editor.GetViewMode() == 'wysiwyg') // WYSIWYG
1582			{
1583				var doc = editor.GetIframeDoc(), ii, n;
1584				for (ii in editor["bxTags"])
1585				{
1586					if (editor["bxTags"].hasOwnProperty(ii))
1587					{
1588						if (typeof editor.bxTags[ii] == "object" &&
1589							editor.bxTags[ii]["params"] &&
1590							editor.bxTags[ii]["params"]["value"] == file.id)
1591						{
1592							n = doc.getElementById(ii);
1593							if (n)
1594								n.parentNode.removeChild(n);
1595						}
1596					}
1597				}
1598				editor.SaveContent();
1599			}
1600			else
1601			{
1602				content = content.replace(parser.regexp, function(str, tagName, id) { return (id == file.id ? '' : str); } );
1603				editor.SetContent(content);
1604				editor.Focus();
1605			}
1606			this.monitoringSetStatus(parser.bxTag, file.id, false);
1607		}
1608	},
1609	reinit : function(text, data)
1610	{
1611		BX.onCustomEvent(this.eventNode, "onReinitializeBefore", [this, text, data]);
1612		this.arFiles = {};
1613
1614		delete this.monitoringWakeUp;
1615		this.monitoringStop();
1616		this.oEditor.CheckAndReInit(text || '');
1617
1618		BX.onCustomEvent(this.eventNode, "onReinitialize", [this, text, data]);
1619		var cid, needsToInit = false;
1620		for (cid in this.controllers)
1621		{
1622			if (this.controllers.hasOwnProperty(cid))
1623			{
1624				if (this.controllers[cid]['init'] && this.controllers[cid].reinit(text, data))
1625					needsToInit = true;
1626			}
1627		}
1628
1629		this.controllerInit((needsToInit ? 'show' : 'hide'));
1630
1631		if (this.params["~height"])
1632		{
1633			this.oEditor.SetConfigHeight(this.params["~height"]);
1634			this.oEditor.ResizeSceleton();
1635		}
1636
1637		if (this.urlPreview)
1638		{
1639			this.urlPreview.detachUrlPreview();
1640			var urlPreviewId;
1641			for(var uf in data)
1642			{
1643				if(data.hasOwnProperty(uf) && data[uf].hasOwnProperty('USER_TYPE_ID') && data[uf]['USER_TYPE_ID'] === 'url_preview')
1644				{
1645					urlPreviewId = data[uf]['VALUE'];
1646				}
1647			}
1648			if(urlPreviewId)
1649				this.urlPreview.attachUrlPreview({id: urlPreviewId});
1650		}
1651	},
1652	Parse : function(parser, content, editor)
1653	{
1654		var
1655			arParser = this.parser[parser],
1656			obj = this;
1657
1658		if (arParser)
1659		{
1660			content = content.replace(
1661				arParser.regexp,
1662				function(str, tagName, id, width, height)
1663				{
1664					var file = obj.checkFile(id, parser);
1665					if (file && (file = file.file) && file)
1666					{
1667						var
1668							strAdditional = "",
1669							template = (file.isImage ? obj.parser.postimage.wysiwyg : arParser.wysiwyg);
1670						obj.monitoringStart();
1671
1672						if (file.isImage)
1673						{
1674							width = parseInt(width);
1675							height = parseInt(height);
1676
1677							strAdditional = ((width && height) ?
1678								(" width=\"" + width + "\" height=\"" + height + "\"") : "");
1679
1680							if (strAdditional === "" && file["width"] > 0 && file["height"] > 0)
1681							{
1682								strAdditional = ' style="width:' + file["width"] + 'px;height:' + file["height"] + 'px;" onload="this.style=\' \'"';
1683							}
1684						}
1685
1686						return template.
1687							replace("#ID#", editor.SetBxTag(false, {tag: parser, params: {value : id}})).
1688							replace("#NAME#", file.name).
1689							replace("#SRC#", file.src).
1690							replace("#LOWSRC#", file.lowsrc).
1691							replace("#ADDITIONAL#", strAdditional).
1692							replace("#WIDTH#", parseInt(width)).
1693							replace("#HEIGHT#", parseInt(height));
1694					}
1695					return str;
1696				}
1697			)
1698		}
1699		return content;
1700	},
1701
1702	/**
1703	 * @return {string}
1704	 */
1705	Unparse: function(bxTag, oNode/*, editor*/)
1706	{
1707		var res = "", parser = bxTag.tag;
1708		if (this.parser[parser])
1709		{
1710			var
1711				width = parseInt(oNode.node.hasAttribute("width") ? oNode.node.getAttribute("width") : 0),
1712				height = parseInt(oNode.node.hasAttribute("height") ? oNode.node.getAttribute("height") : 0),
1713				strSize = "";
1714
1715			if (width > 0 && height > 0)
1716			{
1717				strSize = ' WIDTH=' + width + ' HEIGHT=' + height;
1718			}
1719
1720			res = this.parser[parser]["code"].
1721				replace("#ID#", bxTag.params.value).
1722				replace("#ADDITIONAL#", strSize).
1723				replace("#WIDTH#", width).
1724				replace("#HEIGHT#", height);
1725		}
1726
1727		return res;
1728	},
1729
1730	OnShowLHE : function(show, editor, setFocus)
1731	{
1732		var lheName = this.__divId;
1733		show = (show === false ? false : (show === 'hide' ? 'hide' : (show === 'justShow' ? 'justShow' : true)));
1734
1735		this.oEditor = (this.oEditor || LHEPostForm.getEditor(this.oEditorId));
1736		if (!this.oEditor)
1737			return;
1738		this.oEditor.Init();
1739
1740		var
1741			micro = BX('micro' + lheName),
1742			div = this.eventNode;
1743
1744		if (micro)
1745		{
1746			micro.style.display = ((show === true || show === 'justShow') ? "none" : "block");
1747		}
1748
1749		if (show == 'hide')
1750		{
1751			BX.onCustomEvent(this.eventNode, 'OnBeforeHideLHE', [show, this]);
1752			if (this.eventNode.style.display == "none")
1753			{
1754				BX.onCustomEvent(this.eventNode, 'OnAfterHideLHE', [show, this]);
1755			}
1756			else
1757			{
1758				(new BX["easing"]({
1759					duration : 200,
1760					start : { opacity: 100, height : this.eventNode.scrollHeight},
1761					finish : { opacity : 0, height : 20},
1762					transition : BX.easing.makeEaseOut(BX.easing.transitions.quad),
1763					step : function(state)
1764					{
1765						div.style.height = state.height + "px";
1766						div.style.opacity = state.opacity / 100;
1767					},
1768					complete : BX.proxy(function()
1769					{
1770						this.eventNode.style.cssText = "";
1771						this.eventNode.style.display = "none";
1772						BX.onCustomEvent(div, 'OnAfterHideLHE', [show, this]);
1773					}, this)
1774				})).animate();
1775			}
1776		}
1777		else if (show)
1778		{
1779			BX.onCustomEvent(this.eventNode, 'OnBeforeShowLHE', [show, this]);
1780			if (show == "justShow")
1781			{
1782				this.eventNode.style.display = "block";
1783				BX.onCustomEvent(this.eventNode, 'OnAfterShowLHE', [show, this]);
1784				if (setFocus !== false)
1785					this.oEditor.Focus();
1786			}
1787			else if (this.eventNode.style.display == "block")
1788			{
1789				BX.onCustomEvent(this.eventNode, 'OnAfterShowLHE', [show, this]);
1790				if (setFocus !== false)
1791					this.oEditor.Focus();
1792			}
1793			else
1794			{
1795				BX.adjust(this.eventNode, {style:{display:"block", overflow:"hidden", height:"20px", opacity:0.1}});
1796				(new BX["easing"]({
1797					duration : 200,
1798					start : { opacity : 10, height : 20 },
1799					finish : { opacity: 100, height : div.scrollHeight},
1800					transition : BX["easing"].makeEaseOut(BX.easing.transitions.quad),
1801					step : function(state)
1802					{
1803						div.style.height = state.height + "px";
1804						div.style.opacity = state.opacity / 100;
1805					},
1806					complete : BX.proxy(function()
1807					{
1808						BX.onCustomEvent(div, 'OnAfterShowLHE', [show, this]);
1809						this.oEditor.Focus();
1810						this.eventNode.style.cssText = "";
1811					}, this)
1812				})).animate();
1813			}
1814		}
1815		else
1816		{
1817			BX.onCustomEvent(this.eventNode, 'OnBeforeHideLHE', [show, this]);
1818			this.eventNode.style.display = "none";
1819			BX.onCustomEvent(this.eventNode, 'OnAfterHideLHE', [show, this]);
1820		}
1821	},
1822
1823	OnButtonClick : function(type)
1824	{
1825		if(type != 'cancel')
1826		{
1827			BX.onCustomEvent(this.eventNode, 'OnClickSubmit', [this]);
1828		}
1829		else
1830		{
1831			BX.onCustomEvent(this.eventNode, 'OnClickCancel', [this]);
1832			BX.onCustomEvent(this.eventNode, 'OnShowLHE', ['hide']);
1833		}
1834	},
1835	OnEditorInitedBefore : function(editor)
1836	{
1837		var _this = this;
1838		this.oEditor = editor;
1839		editor.formID = this.formID;
1840		if (this.params)
1841			this.params["~height"] = editor.config["height"];
1842
1843		BX.addCustomEvent(editor, 'OnCtrlEnter', function() {
1844			editor.SaveContent();
1845			if (_this.params && _this.params['ctrlEnterHandler'] && typeof window[_this.params['ctrlEnterHandler']] == 'function')
1846				window[_this.params['ctrlEnterHandler']]();
1847			else
1848				BX.submit(BX(_this.formID));
1849		});
1850
1851		var parsers = (this.params.parsers ? this.params.parsers : []);
1852
1853		if (BX.util.object_search('Spoiler', parsers))
1854		{
1855			editor.AddButton({
1856				id : 'spoiler',
1857				name : BX.message('spoilerText'),
1858				iconClassName : 'spoiler',
1859				disabledForTextarea : false,
1860				src : BX.message('MPF_TEMPLATE_FOLDER') + '/images/lhespoiler.png',
1861				toolbarSort : 205,
1862				handler : function()
1863				{
1864					var
1865						_this = this,
1866						res = false;
1867
1868					// Iframe
1869					if (!_this.editor.bbCode || !_this.editor.synchro.IsFocusedOnTextarea())
1870					{
1871						res = _this.editor.action.actions.formatBlock.exec('formatBlock', 'blockquote', 'bx-spoiler', false, {bxTagParams : {tag: "spoiler"}});
1872					}
1873					else // bbcode + textarea
1874					{
1875						res = _this.editor.action.actions.formatBbCode.exec('quote', {tag: 'SPOILER'});
1876					}
1877					return res;
1878				}
1879			});
1880			editor.AddParser({
1881				name : 'spoiler',
1882				obj : {
1883					Parse: function(sName, content, pLEditor)
1884					{
1885						if (/\[(cut|spoiler)(([^\]])*)\]/gi.test(content))
1886						{
1887							content = content.
1888								replace(/[\001-\006]/gi, '').
1889								replace(/\[cut(((?:=)[^\]]*)|)\]/gi, '\001$1\001').
1890								replace(/\[\/cut]/gi, '\002').
1891								replace(/\[spoiler([^\]]*)\]/gi, '\003$1\003').
1892								replace(/\[\/spoiler]/gi, '\004');
1893							var
1894								reg1 = /(?:\001([^\001]*)\001)([^\001-\004]+)\002/gi,
1895								reg2 = /(?:\003([^\003]*)\003)([^\001-\004]+)\004/gi,
1896								__replace_reg = function(title, body){
1897									title = title.replace(/^(="|='|=)/gi, '').replace(/("|')?$/gi, '');
1898									return '<blockquote class="bx-spoiler" id="' + pLEditor.SetBxTag(false, {tag: "spoiler"}) + '" title="' + title + '">' + body + '</blockquote>';
1899								},
1900								func = function(str, title, body){return __replace_reg(title, body);};
1901							while (content.match(reg1) || content.match(reg2))
1902							{
1903								content = content.
1904									replace(reg1, func).
1905									replace(reg2, func);
1906							}
1907						}
1908						content = content.
1909							replace(/\001([^\001]*)\001/gi, '[cut$1]').
1910							replace(/\003([^\003]*)\003/gi, '[spoiler$1]').
1911							replace(/\002/gi, '[/cut]').
1912							replace(/\004/gi, '[/spoiler]');
1913						return content;
1914					},
1915					/**
1916					 * @return {string}
1917					 */
1918					UnParse: function(bxTag, oNode)
1919					{
1920						if (bxTag.tag == 'spoiler')
1921						{
1922							var name = '', i;
1923							// Handle childs
1924							for (i = 0; i < oNode.node.childNodes.length; i++)
1925							{
1926								name += editor.bbParser.GetNodeHtml(oNode.node.childNodes[i]);
1927							}
1928							name = BX.util.trim(name);
1929							if (name != '')
1930								return "[SPOILER" + (oNode.node.hasAttribute("title") ? '=' + oNode.node.getAttribute("title") : '')+ "]" + name +"[/SPOILER]";
1931						}
1932						return "";
1933					}
1934				}
1935			});
1936		}
1937		if (BX.util.object_search('MentionUser', parsers))
1938		{
1939			editor.AddParser(
1940				{
1941					name: 'postuser',
1942					obj: {
1943						Parse: function(parserName, content)
1944						{
1945							content = content.replace(/\[USER\s*=\s*(\d+)\]((?:\s|\S)*?)\[\/USER\]/ig,
1946								function(str, id, name)
1947								{
1948									name = BX.util.trim(name);
1949									if (name == '')
1950										return '';
1951									return '<span id="' + editor.SetBxTag(false, {tag: "postuser", params: {value : parseInt(id)}}) + '" class="bxhtmled-metion">' + name + '</span>';
1952								});
1953							return content;
1954						},
1955						/**
1956						 * @return {string}
1957						 */
1958						UnParse: function(bxTag, oNode)
1959						{
1960							if (bxTag.tag == 'postuser')
1961							{
1962								var name = '', i;
1963								// Handle childs
1964								for (i = 0; i < oNode.node.childNodes.length; i++)
1965								{
1966									name += editor.bbParser.GetNodeHtml(oNode.node.childNodes[i]);
1967								}
1968								name = BX.util.trim(name);
1969								if (name != '')
1970									return "[USER=" + bxTag.params.value + "]" + name +"[/USER]";
1971							}
1972							return "";
1973						}
1974					}
1975				}
1976			);
1977		}
1978		var funcParse = function(parserName, content) {
1979				return _this.Parse(parserName, content, editor);
1980			},
1981			funcUnparse = function(bxTag, oNode) {
1982				return _this.Unparse(bxTag, oNode/*, editor*/);
1983			};
1984		for (var parser in this.parser)
1985		{
1986			if (this.parser.hasOwnProperty(parser))
1987			{
1988				editor.AddParser({
1989					name: parser,
1990					obj: {
1991						Parse: funcParse,
1992						UnParse: funcUnparse
1993					}
1994				});
1995			}
1996		}
1997
1998		if (this.showPinButton)
1999		{
2000			this.pinEditorPanel = this.params && this.params.pinEditorPanel === true;
2001			var pinId = 'toolbar_pin';
2002			var but = function (editor, wrap)
2003			{
2004				// Call parrent constructor
2005				but.superclass.constructor.apply(this, arguments);
2006				this.id = pinId;
2007				this.title = BX.message('MPF_PIN_EDITOR_PANNEL');
2008				this.className += ' ' + (_this.pinEditorPanel ? 'bxhtmled-button-toolbar-pined' : 'bxhtmled-button-toolbar-pin');
2009				this.Create();
2010				if (wrap)
2011					wrap.appendChild(this.GetCont());
2012			};
2013
2014			BX.extend(but, window.BXHtmlEditor.Button);
2015			but.prototype.OnClick = function ()
2016			{
2017				BX.removeClass(this.pCont, 'bxhtmled-button-toolbar-pined');
2018				BX.removeClass(this.pCont, 'bxhtmled-button-toolbar-pin');
2019				if (_this.pinEditorPanel)
2020				{
2021					_this.pinEditorPanel = false;
2022					BX.addClass(this.pCont, 'bxhtmled-button-toolbar-pin');
2023				}
2024				else
2025				{
2026					_this.pinEditorPanel = true;
2027					BX.addClass(this.pCont, 'bxhtmled-button-toolbar-pined');
2028				}
2029				BX.userOptions.save('main.post.form', 'postEdit', 'pinEditorPanel', _this.pinEditorPanel ? "Y" : "N");
2030			};
2031
2032			window.BXHtmlEditor.Controls[pinId] = but;
2033			BX.addCustomEvent(editor, "GetControlsMap", function (controlsMap)
2034			{
2035				controlsMap.push({
2036					id: pinId, compact: true, hidden: false, sort: 500, checkWidth: true, offsetWidth: 32, wrap: 'right'
2037				});
2038			});
2039		}
2040	},
2041	OnEditorInitedAfter : function(editor)
2042	{
2043		BX.addCustomEvent(editor, "OnIframeDrop", BX.proxy(function(){BX.onCustomEvent(this.eventNode, "OnIframeDrop", arguments);}, this));
2044		BX.addCustomEvent(editor, "OnIframeDragOver", BX.proxy(function(){BX.onCustomEvent(this.eventNode, "OnIframeDragOver", arguments);}, this));
2045		BX.addCustomEvent(editor, "OnIframeDragLeave", BX.proxy(function(){BX.onCustomEvent(this.eventNode, "OnIframeDragLeave", arguments);}, this));
2046		BX.addCustomEvent(editor, "OnImageDataUriHandle", BX.proxy(function(){BX.onCustomEvent(this.eventNode, "OnImageDataUriHandle", arguments);}, this));
2047
2048		BX.addCustomEvent(editor, "OnAfterUrlConvert", this.OnAfterUrlConvert.bind(this));
2049		BX.addCustomEvent(editor, "OnBeforeCommandExec", this.OnBeforeCommandExec.bind(this));
2050		// Contextmenu changing for images/files
2051		editor.contextMenu.items['postimage'] =
2052			editor.contextMenu.items['postdocument'] =
2053				editor.contextMenu.items['postfile'] =
2054					[
2055						{
2056							TEXT: BX.message('BXEdDelFromText'),
2057							bbMode: true,
2058							ACTION: function()
2059							{
2060								var node = editor.contextMenu.GetTargetItem('postimage');
2061								if (!node)
2062									node = editor.contextMenu.GetTargetItem('postdocument');
2063								if (!node)
2064									node = editor.contextMenu.GetTargetItem('postfile');
2065
2066								if (node && node.element)
2067								{
2068									editor.selection.RemoveNode(node.element);
2069								}
2070								editor.contextMenu.Hide();
2071							}
2072						}
2073					];
2074		if (!this.params["lazyLoad"])
2075		{
2076			BX.onCustomEvent(this.eventNode, 'OnShowLHE', ["justShow", editor, false])
2077		}
2078
2079		if (editor.toolbar.controls && editor.toolbar.controls.FontSelector)
2080		{
2081			editor.toolbar.controls.FontSelector.SetWidth(45);
2082		}
2083
2084		BX.addCustomEvent(BX(this.formID), 'onAutoSavePrepare', function (ob) {
2085			var _ob=ob;
2086			setTimeout(function() {
2087				BX.addCustomEvent(editor, 'OnContentChanged', BX.proxy(function(text) {
2088					this["mpfTextContent"] = text;
2089					this.Init();
2090				}, _ob));
2091			},1500);
2092		});
2093		BX.addCustomEvent(BX(this.formID), 'onAutoSave', BX.proxy(function(ob, form_data)
2094		{
2095			if (BX.type.isNotEmptyString(ob['mpfTextContent']))
2096				form_data['text' + this.formID] = ob['mpfTextContent'];
2097		}, this));
2098		BX.addCustomEvent(BX(this.formID), 'onAutoSaveRestore', BX.proxy(function(ob, form_data)
2099		{
2100			if (form_data['text' + this.formID] && /[^\s]+/gi.test(form_data['text' + this.formID]))
2101			{
2102				editor.CheckAndReInit(form_data['text' + this.formID]);
2103			}
2104		}, this));
2105
2106		if (BX(this.formID) && BX(this.formID).hasAttribute("bx-lhe-autosave-prepared") && BX(this.formID).BXAUTOSAVE)
2107		{
2108			BX(this.formID).removeAttribute("bx-lhe-autosave-prepared");
2109			setTimeout(BX.proxy(function(){ BX(this.formID).BXAUTOSAVE.Prepare(); }, this), 100);
2110		}
2111		var
2112			formID = this.formID,
2113			settings = this.params;
2114
2115		this.showPanelEditor(settings.showPanelEditor, false);
2116
2117		if (!editor.mainPostFormCustomized)
2118		{
2119			editor.mainPostFormCustomized = true;
2120
2121			BX.addCustomEvent(
2122				editor,
2123				'OnIframeKeydown',
2124				function(e)
2125				{
2126					if (window.onKeyDownHandler)
2127					{
2128						window.onKeyDownHandler(e, editor, formID);
2129					}
2130				}
2131			);
2132
2133			BX.addCustomEvent(
2134				editor,
2135				'OnIframeKeyup',
2136				function(e)
2137				{
2138					if (window.onKeyUpHandler)
2139					{
2140						window.onKeyUpHandler(e, editor, formID);
2141					}
2142				}
2143			);
2144
2145			if (window['BXfpdStopMent' + formID])
2146			{
2147				BX.addCustomEvent(
2148					editor,
2149					'OnIframeClick',
2150					function()
2151					{
2152						window['BXfpdStopMent' + formID]();
2153					}
2154				);
2155			}
2156
2157			// Just to avoid version dependence from fileman
2158			if (editor && editor.textareaView.GetCursorPosition)
2159			{
2160				BX.addCustomEvent(
2161					editor,
2162					'OnTextareaKeyup',
2163					function(e)
2164					{
2165						if (window.onTextareaKeyUpHandler)
2166						{
2167							window.onTextareaKeyUpHandler(e, editor, formID);
2168						}
2169					}
2170				);
2171
2172				BX.addCustomEvent(
2173					editor,
2174					'OnTextareaKeydown',
2175					function(e)
2176					{
2177						if (window.onTextareaKeyDownHandler)
2178						{
2179							window.onTextareaKeyDownHandler(e, editor, formID);
2180						}
2181					}
2182				);
2183			}
2184		}
2185	},
2186	OnAfterUrlConvert: function(url)
2187	{
2188		if(this.urlPreview)
2189		{
2190			this.urlPreview.attachUrlPreview({url: url});
2191		}
2192	},
2193	OnBeforeCommandExec: function(isContentAction, action, oAction, value)
2194	{
2195		if(this.urlPreview && action == 'createLink' && BX.type.isPlainObject(value) && value.hasOwnProperty('href'))
2196		{
2197			this.urlPreview.attachUrlPreview({url: value.href});
2198		}
2199	}
2200};
2201LHEPostForm.getEditor = function(editor)
2202{
2203	return (window["BXHtmlEditor"] ? window["BXHtmlEditor"].Get((typeof editor == "object" ? editor.id : editor)) : null);
2204};
2205LHEPostForm.getHandler = function(editor)
2206{
2207	return repo.handler[(typeof editor == "object" ? editor.id : editor)];
2208};
2209LHEPostForm.unsetHandler = function(editor)
2210{
2211	var editorId = (typeof editor == "object" ? editor.id : editor);
2212
2213	if (!repo.handler[editorId])
2214		return;
2215
2216	if (repo.handler[editorId].oEditor)
2217		repo.handler[editorId].oEditor.Destroy();
2218
2219	// TODO: unregister event handlers here
2220
2221	repo.handler[editorId] = null;
2222};
2223LHEPostForm.reinitData = function(editorID, text, data)
2224{
2225	var handler = LHEPostForm.getHandler(editorID);
2226	if (handler)
2227		handler.exec(handler.reinit, [text, data]);
2228	return false;
2229};
2230LHEPostForm.reinitDataBefore = function(editorID)
2231{
2232	var handler = LHEPostForm.getHandler(editorID);
2233	if (handler && handler["eventNode"])
2234		BX.onCustomEvent(handler.eventNode, "onReinitializeBefore", [handler]);
2235};
2236window.LHEPostForm = LHEPostForm;
2237window.BXPostFormTags = function(formID, buttonID)
2238{
2239	this.popup = null;
2240	this.formID = formID;
2241	this.buttonID = buttonID;
2242	this.sharpButton = null;
2243	this.addNewLink = null;
2244	this.tagsArea = null;
2245	this.hiddenField = null;
2246	this.popupContent = null;
2247
2248	BX.ready(BX.proxy(this.init, this));
2249};
2250
2251window.BXPostFormTags.prototype.init = function()
2252{
2253	this.sharpButton = BX(this.buttonID);
2254	this.addNewLink = BX("post-tags-add-new-" + this.formID);
2255	this.tagsArea = BX("post-tags-block-" + this.formID);
2256	this.tagsContainer = BX("post-tags-container-" + this.formID);
2257	this.hiddenField = BX("post-tags-hidden-" + this.formID);
2258	this.popupContent = BX("post-tags-popup-content-" + this.formID);
2259	this.popupInput = BX.findChild(this.popupContent, { tag : "input" });
2260
2261	var tags = BX.findChildren(this.tagsContainer, { className : "feed-add-post-del-but" }, true);
2262	for (var i = 0, cnt = tags.length; i < cnt; i++ )
2263	{
2264		BX.bind(tags[i], "click", BX.proxy(this.onTagDelete, {
2265			obj : this,
2266			tagBox : tags[i].parentNode,
2267			tagValue : tags[i].parentNode.getAttribute("data-tag")
2268		}));
2269	}
2270
2271	BX.bind(this.sharpButton, "click", BX.proxy(this.onButtonClick, this));
2272	BX.bind(this.addNewLink, "click", BX.proxy(this.onAddNewClick, this));
2273};
2274
2275window.BXPostFormTags.prototype.onTagDelete = function()
2276{
2277	BX.remove(this.tagBox);
2278	this.obj.hiddenField.value = this.obj.hiddenField.value.replace(this.tagValue + ',', '').replace('  ', ' ');
2279};
2280
2281window.BXPostFormTags.prototype.show = function()
2282{
2283	if (this.popup === null)
2284	{
2285		this.popup = new BX.PopupWindow("bx-post-tag-popup", this.addNewLink, {
2286			content : this.popupContent,
2287			lightShadow : false,
2288			offsetTop: 8,
2289			offsetLeft: 10,
2290			autoHide: true,
2291			angle : true,
2292			closeByEsc: true,
2293			zIndex: -840,
2294			buttons: [
2295				new BX.PopupWindowButton({
2296					text : BX.message("TAG_ADD"),
2297					events : {
2298						click : BX.proxy(this.onTagAdd, this)
2299					}
2300				})
2301			]
2302		});
2303
2304		BX.bind(this.popupInput, "keydown", BX.proxy(this.onKeyPress, this));
2305		BX.bind(this.popupInput, "keyup", BX.proxy(this.onKeyPress, this));
2306	}
2307
2308	this.popup.show();
2309	BX.focus(this.popupInput);
2310};
2311
2312window.BXPostFormTags.prototype.addTag = function(tagStr)
2313{
2314	var tags = BX.type.isNotEmptyString(tagStr) ? tagStr.split(",") : this.popupInput.value.split(",");
2315	var result = [];
2316	for (var i = 0; i < tags.length; i++ )
2317	{
2318		var tag = BX.util.trim(tags[i]);
2319		if(tag.length > 0)
2320		{
2321			var allTags = this.hiddenField.value.split(",");
2322			if(!BX.util.in_array(tag, allTags))
2323			{
2324				var newTagDelete;
2325				var newTag = BX.create("span", {
2326					children : [
2327						(newTagDelete = BX.create("span", { attrs : { "class": "feed-add-post-del-but" }}))
2328					],
2329					attrs : { "class": "feed-add-post-tags" }
2330				});
2331
2332				newTag.insertBefore(document.createTextNode(tag), newTagDelete);
2333				this.tagsContainer.insertBefore(newTag, this.addNewLink);
2334
2335				BX.bind(newTagDelete, "click", BX.proxy(this.onTagDelete, {
2336					obj : this,
2337					tagBox : newTag,
2338					tagValue : tag
2339				}));
2340
2341				this.hiddenField.value += tag + ',';
2342
2343				result.push(tag);
2344			}
2345		}
2346	}
2347
2348	return result;
2349};
2350
2351window.BXPostFormTags.prototype.onTagAdd = function()
2352{
2353	this.addTag();
2354	this.popupInput.value = "";
2355	this.popup.close();
2356};
2357
2358window.BXPostFormTags.prototype.onAddNewClick = function(event)
2359{
2360	event = event || window.event;
2361	this.show();
2362	BX.PreventDefault(event);
2363};
2364
2365window.BXPostFormTags.prototype.onButtonClick = function(event)
2366{
2367	event = event || window.event;
2368	BX.show(this.tagsArea);
2369	this.show();
2370	BX.PreventDefault(event);
2371};
2372
2373window.BXPostFormTags.prototype.onKeyPress = function(event)
2374{
2375	event = event || window.event;
2376	var key = (event.keyCode ? event.keyCode : (event.which ? event.which : null));
2377	if (key == 13)
2378	{
2379		setTimeout(BX.proxy(this.onTagAdd, this), 0);
2380	}
2381};
2382
2383window.BXPostFormImportant = function(formID, buttonID, inputName)
2384{
2385	if (inputName)
2386	{
2387		this.formID = formID;
2388		this.buttonID = buttonID;
2389		this.inputName = inputName;
2390
2391		this.fireButton = null;
2392		this.activeBlock = null;
2393		this.hiddenField = null;
2394
2395		BX.ready(BX.proxy(this.init, this));
2396	}
2397
2398	return false;
2399};
2400window.BXPostFormImportant.prototype.init = function()
2401{
2402	this.fireButton = BX(this.buttonID);
2403	this.activeBlock = BX(this.buttonID + '-active');
2404
2405	var form = BX(this.formID);
2406	if (form)
2407	{
2408		this.hiddenField = form[this.inputName];
2409		if (
2410			this.hiddenField
2411			&& this.hiddenField.value == 1
2412		)
2413		{
2414			this.showActive();
2415		}
2416	}
2417
2418	BX.bind(this.fireButton, "click", BX.proxy(function(event) {
2419		event = event || window.event;
2420		this.showActive();
2421		BX.PreventDefault(event);
2422	}, this));
2423
2424	BX.bind(this.activeBlock, "click", BX.proxy(function(event) {
2425		event = event || window.event;
2426		this.hideActive();
2427		BX.PreventDefault(event);
2428	}, this));
2429};
2430window.BXPostFormImportant.prototype.showActive = function(event)
2431{
2432	BX.hide(this.fireButton);
2433	BX.show(this.activeBlock, 'inline-block');
2434
2435	if (this.hiddenField)
2436	{
2437		this.hiddenField.value = 1;
2438	}
2439
2440	return false;
2441};
2442window.BXPostFormImportant.prototype.hideActive = function(event)
2443{
2444	BX.hide(this.activeBlock);
2445	BX.show(this.fireButton, 'inline-block');
2446
2447	if (this.hiddenField)
2448	{
2449		this.hiddenField.value = 0;
2450	}
2451
2452	return false;
2453};
2454
2455var lastWaitElement = null;
2456window.MPFbuttonShowWait = function(el)
2457{
2458	if (el && !BX.type.isElementNode(el))
2459		el = null;
2460	el = el || this;
2461	el = (el ? (el.tagName == "A" ? el : el.parentNode) : el);
2462	if (el)
2463	{
2464		BX.addClass(el, "feed-add-button-load");
2465		lastWaitElement = el;
2466		BX.defer(function(){el.disabled = true})();
2467	}
2468};
2469
2470window.MPFbuttonCloseWait = function(el)
2471{
2472	if (el && !BX.type.isElementNode(el))
2473		el = null;
2474	el = el || lastWaitElement || this;
2475	if (el)
2476	{
2477		el.disabled = false ;
2478		BX.removeClass(el, 'feed-add-button-load');
2479		lastWaitElement = null;
2480	}
2481};
2482
2483window.__mpf_wd_getinfofromnode = function(result, obj)
2484{
2485	var preview = BX.findChild(BX((result["prefixNode"] || 'wd-doc') + result.element_id), {'className': 'files-preview', 'tagName' : 'IMG'}, true, false);
2486	if (preview)
2487	{
2488		result.lowsrc = preview.src;
2489		result.element_url = preview.src.replace(/\Wwidth=(\d+)/, '').replace(/\Wheight\=(\d+)/, '');
2490		result.width = parseInt(preview.getAttribute("data-bx-full-width"));
2491		result.height = parseInt(preview.getAttribute("data-bx-full-height"));
2492	}
2493	else if (obj.urlGet)
2494	{
2495		result.element_url = obj.urlGet.
2496			replace("#element_id#", result.element_id).
2497			replace("#ELEMENT_ID#", result.element_id).
2498			replace("#element_name#", result.element_name).
2499			replace("#ELEMENT_NAME#", result.element_name);
2500	}
2501};
2502
2503var MPFMention = {
2504	listen: false,
2505	plus : false,
2506	text : '',
2507	bSearch: false
2508};
2509
2510window.BXfpdSelectCallback = function(item, type, search, bUndeleted)
2511{
2512	BX.SocNetLogDestination.BXfpSelectCallback({
2513		item: item,
2514		type: type,
2515		bUndeleted: bUndeleted,
2516		containerInput: BX('feed-add-post-destination-item'),
2517		valueInput: BX('feed-add-post-destination-input'),
2518		formName: window.BXSocNetLogDestinationFormName,
2519		tagInputName: 'bx-destination-tag',
2520		tagLink1: BX.message('BX_FPD_LINK_1'),
2521		tagLink2: BX.message('BX_FPD_LINK_2')
2522	});
2523};
2524
2525window.onKeyDownHandler = function(e, editor, formID)
2526{
2527	var keyCode = e.keyCode;
2528
2529	if (!window['BXfpdStopMent' + formID])
2530		return true;
2531
2532	if (keyCode == 107 ||
2533		((e.shiftKey || e.modifiers > 3) && BX.util.in_array(keyCode, [187, 50, 107, 43, 61])) ||
2534		(e.altKey && BX.util.in_array(keyCode, [76])) /* German @ == Alt + L*/)
2535	{
2536		setTimeout(function()
2537		{
2538			var
2539				range = editor.selection.GetRange(),
2540				doc = editor.GetIframeDoc(),
2541				txt = (range ? range.endContainer.textContent : ''),
2542				determiner = (txt ? txt.slice(range.endOffset - 1, range.endOffset) : ''),
2543				prevS = (txt ? txt.slice(range.endOffset - 2, range.endOffset-1) : '');
2544
2545			if ((determiner == "@" || determiner == "+")
2546				&&
2547				(!prevS || BX.util.in_array(prevS, ["+", "@", ",", "("]) || (prevS.length == 1 && BX.util.trim(prevS) === "")))
2548			{
2549				MPFMention.listen = true;
2550				MPFMention.listenFlag = true;
2551				MPFMention.text = '';
2552				MPFMention.leaveContent = true;
2553
2554				range.setStart(range.endContainer, range.endOffset - 1);
2555				range.setEnd(range.endContainer, range.endOffset);
2556				editor.selection.SetSelection(range);
2557				var mentNode = BX.create("SPAN", {props: {id: "bx-mention-node"}}, doc);
2558				editor.selection.Surround(mentNode, range);
2559				range.setStart(mentNode, 1);
2560				range.setEnd(mentNode, 1);
2561				editor.selection.SetSelection(range);
2562
2563				if(!BX.SocNetLogDestination.isOpenDialog())
2564				{
2565					BX.SocNetLogDestination.openDialog(window['BXSocNetLogDestinationFormNameMent' + formID],
2566						{
2567							bindNode: getMentionNodePosition(mentNode, editor)
2568						}
2569					);
2570				}
2571			}
2572		}, 10);
2573	}
2574
2575	if(MPFMention.listen)
2576	{
2577		var type = (
2578			MPFMention.bSearch
2579				? 'search'
2580				: BX.SocNetLogDestination.obTabSelected[window['BXSocNetLogDestinationFormNameMent' + formID]]
2581		);
2582
2583		if (keyCode == editor.KEY_CODES["enter"])
2584		{
2585			BX.SocNetLogDestination.selectCurrentItem(type, window['BXSocNetLogDestinationFormNameMent' + formID]);
2586			editor.iframeKeyDownPreventDefault = true;
2587			BX.PreventDefault(e);
2588		}
2589		else if (keyCode == editor.KEY_CODES["left"])
2590		{
2591			BX.SocNetLogDestination.moveCurrentItem(type, window['BXSocNetLogDestinationFormNameMent' + formID], 'left');
2592			editor.iframeKeyDownPreventDefault = true;
2593			BX.PreventDefault(e);
2594		}
2595		else if (keyCode == editor.KEY_CODES["right"])
2596		{
2597			BX.SocNetLogDestination.moveCurrentItem(type, window['BXSocNetLogDestinationFormNameMent' + formID], 'right');
2598			editor.iframeKeyDownPreventDefault = true;
2599			BX.PreventDefault(e);
2600		}
2601		else if (keyCode == editor.KEY_CODES["up"])
2602		{
2603			BX.SocNetLogDestination.moveCurrentItem(type, window['BXSocNetLogDestinationFormNameMent' + formID], 'up');
2604			editor.iframeKeyDownPreventDefault = true;
2605			BX.PreventDefault(e);
2606		}
2607		else if (keyCode == editor.KEY_CODES["down"])
2608		{
2609			BX.SocNetLogDestination.moveCurrentItem(type, window['BXSocNetLogDestinationFormNameMent' + formID], 'down');
2610			editor.iframeKeyDownPreventDefault = true;
2611			BX.PreventDefault(e);
2612		}
2613	}
2614
2615	if (!MPFMention.listen && MPFMention.listenFlag && keyCode === editor.KEY_CODES["enter"])
2616	{
2617		var range = editor.selection.GetRange();
2618		if (range.collapsed)
2619		{
2620			var
2621				node = range.endContainer,
2622				doc = editor.GetIframeDoc();
2623
2624			if (node)
2625			{
2626				if (node.className !== 'bxhtmled-metion')
2627				{
2628					node = BX.findParent(node, function(n)
2629					{
2630						return n.className == 'bxhtmled-metion';
2631					}, doc.body);
2632				}
2633
2634				if (node && node.className == 'bxhtmled-metion')
2635				{
2636					editor.selection.SetAfter(node);
2637				}
2638			}
2639		}
2640	}
2641};
2642
2643window.onKeyUpHandler = function(e, editor, formID)
2644{
2645	var
2646		keyCode = e.keyCode,
2647		doc, range, mentText;
2648
2649	if (!window['BXfpdStopMent' + formID])
2650		return true;
2651
2652	if(MPFMention.listen === true)
2653	{
2654		if(keyCode == editor.KEY_CODES["escape"]) //ESC
2655		{
2656			window['BXfpdStopMent' + formID]();
2657		}
2658		else if(
2659			keyCode !== editor.KEY_CODES["enter"]
2660			&& keyCode !== editor.KEY_CODES["left"]
2661			&& keyCode !== editor.KEY_CODES["right"]
2662			&& keyCode !== editor.KEY_CODES["up"]
2663			&& keyCode !== editor.KEY_CODES["down"]
2664		)
2665		{
2666			doc = editor.GetIframeDoc();
2667			var mentNode = doc.getElementById('bx-mention-node');
2668
2669			if (mentNode)
2670			{
2671				mentText = BX.util.trim(editor.util.GetTextContent(mentNode))
2672				var mentTextOrig = mentText;
2673
2674				mentText = mentText.replace(/^[\+@]*/, '');
2675				MPFMention.bSearch = (mentText.length > 0);
2676				BX.SocNetLogDestination.search(mentText, true, window['BXSocNetLogDestinationFormNameMent' + formID], BX.message("MPF_NAME_TEMPLATE"), {bindNode: getMentionNodePosition(mentNode, editor)});
2677
2678				if (MPFMention.leaveContent && MPFMention._lastText && mentTextOrig === '')
2679				{
2680					window['BXfpdStopMent' + formID]();
2681				}
2682				else if (MPFMention.leaveContent && MPFMention.lastText && mentTextOrig !== '' && mentText === '')
2683				{
2684					MPFMention.bSearch = false;
2685					window['BXfpdStopMent' + formID]();
2686					BX.SocNetLogDestination.openDialog(window['BXSocNetLogDestinationFormNameMent' + formID],
2687						{
2688							bindNode: getMentionNodePosition(mentNode, editor)
2689						}
2690					);
2691				}
2692
2693				MPFMention.lastText = mentText;
2694				MPFMention._lastText = mentTextOrig;
2695			}
2696			else
2697			{
2698				window['BXfpdStopMent' + formID]();
2699			}
2700		}
2701	}
2702	else
2703	{
2704		if (
2705			!e.shiftKey &&
2706			(keyCode === editor.KEY_CODES["space"] ||
2707			keyCode === editor.KEY_CODES["escape"] ||
2708			keyCode === 188 ||
2709			keyCode === 190
2710			))
2711		{
2712			range = editor.selection.GetRange();
2713			if (range.collapsed)
2714			{
2715				var node = range.endContainer;
2716				doc = editor.GetIframeDoc();
2717
2718				if (node)
2719				{
2720					if (node.className !== 'bxhtmled-metion')
2721					{
2722						node = BX.findParent(node, function(n)
2723						{
2724							return n.className == 'bxhtmled-metion';
2725						}, doc.body);
2726					}
2727
2728					if (node && node.className == 'bxhtmled-metion')
2729					{
2730						mentText = editor.util.GetTextContent(node);
2731						var matchSep = mentText.match(/[\s\.\,]$/);
2732						if (matchSep || keyCode === editor.KEY_CODES["escape"])
2733						{
2734							node.innerHTML = mentText.replace(/[\s\.\,]$/, '');
2735							var sepNode = BX.create('SPAN', {html: matchSep || editor.INVISIBLE_SPACE}, doc);
2736							editor.util.InsertAfter(sepNode, node);
2737							editor.selection.SetAfter(sepNode);
2738						}
2739					}
2740				}
2741			}
2742		}
2743	}
2744};
2745
2746window.onTextareaKeyDownHandler = function(e, editor, formID)
2747{
2748	var keyCode = e.keyCode;
2749
2750	if(MPFMention.listen && keyCode == editor.KEY_CODES["enter"])
2751	{
2752		BX.SocNetLogDestination.selectFirstSearchItem(window['BXSocNetLogDestinationFormNameMent' + formID]);
2753		editor.textareaKeyDownPreventDefault = true;
2754		BX.PreventDefault(e);
2755	}
2756};
2757
2758window.onTextareaKeyUpHandler = function(e, editor, formID)
2759{
2760	var
2761		cursor, value,
2762		keyCode = e.keyCode;
2763
2764	if(MPFMention.listen === true)
2765	{
2766		if(keyCode == 27) //ESC
2767		{
2768			window['BXfpdStopMent' + formID]();
2769		}
2770		else if(keyCode !== 13)
2771		{
2772			value = editor.textareaView.GetValue(false);
2773			cursor = editor.textareaView.GetCursorPosition();
2774
2775			if (value.indexOf('+') !== -1 || value.indexOf('@') !== -1)
2776			{
2777				var
2778					valueBefore = value.substr(0, cursor),
2779					charPos = Math.max(valueBefore.lastIndexOf('+'), valueBefore.lastIndexOf('@'));
2780
2781				if (charPos >= 0)
2782				{
2783					var
2784						mentText = valueBefore.substr(charPos),
2785						mentTextOrig = mentText;
2786
2787					mentText = mentText.replace(/^[\+@]*/, '');
2788
2789					if(BX.SocNetLogDestination && !BX.SocNetLogDestination.isOpenDialog())
2790					{
2791						BX.SocNetLogDestination.openDialog(window['BXSocNetLogDestinationFormNameMent' + formID]);
2792					}
2793
2794					MPFMention.bSearch = (mentText.length > 0);
2795					if (BX.SocNetLogDestination)
2796						BX.SocNetLogDestination.search(mentText, true, window['BXSocNetLogDestinationFormNameMent' + formID], BX.message("MPF_NAME_TEMPLATE"));
2797
2798					if (MPFMention.leaveContent && MPFMention._lastText && mentTextOrig === '')
2799					{
2800						window['BXfpdStopMent' + formID]();
2801					}
2802					else if (MPFMention.leaveContent && MPFMention.lastText && mentTextOrig !== '' && mentText === '')
2803					{
2804						window['BXfpdStopMent' + formID]();
2805						if (BX.SocNetLogDestination)
2806							BX.SocNetLogDestination.openDialog(window['BXSocNetLogDestinationFormNameMent' + formID]);
2807					}
2808
2809					MPFMention.lastText = mentText;
2810					MPFMention._lastText = mentTextOrig;
2811				}
2812			}
2813		}
2814	}
2815	else
2816	{
2817		if (keyCode == 16)
2818		{
2819			var _this = this;
2820			this.shiftPressed = true;
2821			if (this.shiftTimeout)
2822				this.shiftTimeout = clearTimeout(this.shiftTimeout);
2823
2824			this.shiftTimeout = setTimeout(function()
2825			{
2826				_this.shiftPressed = false;
2827			}, 100);
2828		}
2829
2830		if (keyCode == 107 || (e.shiftKey || e.modifiers > 3 || this.shiftPressed) &&
2831			BX.util.in_array(keyCode, [187, 50, 107, 43, 61]))
2832		{
2833			cursor = editor.textareaView.element.selectionStart;
2834			if (cursor > 0)
2835			{
2836				value = editor.textareaView.element.value;
2837				var
2838					lastChar = value.substr(cursor - 1, 1);
2839
2840				if (lastChar && (lastChar === '+' || lastChar === '@'))
2841				{
2842					MPFMention.listen = true;
2843					MPFMention.listenFlag = true;
2844					MPFMention.text = '';
2845					MPFMention.textarea = true;
2846
2847					if(!BX.SocNetLogDestination.isOpenDialog())
2848					{
2849						BX.SocNetLogDestination.openDialog(window['BXSocNetLogDestinationFormNameMent' + formID]);
2850					}
2851				}
2852			}
2853		}
2854	}
2855};
2856
2857
2858var getMentionNodePosition = function(mention, editor)
2859{
2860	var
2861		mentPos = BX.pos(mention),
2862		editorPos = BX.pos(editor.dom.areaCont),
2863		editorDocScroll = BX.GetWindowScrollPos(editor.GetIframeDoc()),
2864		top = editorPos.top + mentPos.bottom - editorDocScroll.scrollTop + 2,
2865		left = editorPos.left + mentPos.right - editorDocScroll.scrollLeft;
2866
2867	return {top: top, left: left};
2868};
2869
2870window.BxInsertMention = function (params)
2871{
2872	var
2873		item = params.item,
2874		type = params.type,
2875		formID = params.formID,
2876		editorId = params.editorId,
2877		bNeedComa = params.bNeedComa,
2878		editor = LHEPostForm.getEditor(editorId),
2879		spaceNode;
2880
2881	if(type == 'users' && item && item.entityId > 0 && editor)
2882	{
2883		if(editor.GetViewMode() == 'wysiwyg') // WYSIWYG
2884		{
2885			var
2886				doc = editor.GetIframeDoc(),
2887				range = editor.selection.GetRange(),
2888				mentNode = doc.getElementById('bx-mention-node'),
2889				mention = BX.create('SPAN',
2890					{
2891						props: {className: 'bxhtmled-metion'},
2892						text: BX.util.htmlspecialcharsback(item.name)
2893					}, doc);
2894				// &nbsp; - for chrome
2895			spaceNode = BX.create('SPAN', {html: (bNeedComa ? ',&nbsp;' : '&nbsp;')}, doc);
2896
2897			editor.SetBxTag(mention, {tag: "postuser", params: {value : item.entityId}});
2898
2899			if (mentNode)
2900			{
2901				editor.util.ReplaceNode(mentNode, mention);
2902			}
2903			else
2904			{
2905				editor.selection.InsertNode(mention, range);
2906			}
2907
2908			if (mention && mention.parentNode)
2909			{
2910				var parentMention = BX.findParent(mention, {className: 'bxhtmled-metion'}, doc.body);
2911				if (parentMention)
2912				{
2913					editor.util.InsertAfter(mention, parentMention);
2914				}
2915			}
2916
2917			if (mention && mention.parentNode)
2918			{
2919				editor.util.InsertAfter(spaceNode, mention);
2920				editor.selection.SetAfter(spaceNode);
2921			}
2922		}
2923		else if (editor.GetViewMode() == 'code' && editor.bbCode) // BB Codes
2924		{
2925			editor.textareaView.Focus();
2926
2927			var
2928				value = editor.textareaView.GetValue(false),
2929				cursor = editor.textareaView.GetCursorPosition(),
2930				valueBefore = value.substr(0, cursor),
2931				charPos = Math.max(valueBefore.lastIndexOf('+'), valueBefore.lastIndexOf('@'));
2932
2933			if (charPos >= 0 && cursor > charPos)
2934			{
2935				editor.textareaView.SetValue(value.substr(0, charPos) + value.substr(cursor));
2936				editor.textareaView.element.setSelectionRange(charPos, charPos);
2937			}
2938
2939			editor.textareaView.WrapWith(false, false, "[USER=" + item.entityId + "]" + item.name + "[/USER]" + (bNeedComa ? ', ' : ' '));
2940		}
2941
2942		delete BX.SocNetLogDestination.obItemsSelected[window['BXSocNetLogDestinationFormNameMent' + formID]][item.id];
2943		window['BXfpdStopMent' + formID]();
2944		MPFMention["text"] = '';
2945
2946		if(editor.GetViewMode() == 'wysiwyg') // WYSIWYG
2947		{
2948			editor.Focus();
2949			editor.selection.SetAfter(spaceNode);
2950		}
2951	}
2952};
2953
2954window.MPFMentionInit = function(formId, params)
2955{
2956	if (!params["items"]["departmentRelation"])
2957	{
2958		params["items"]["departmentRelation"] = BX.SocNetLogDestination.buildDepartmentRelation(params["items"]["department"]);
2959	}
2960
2961	window["departmentRelation"] = params["items"]["departmentRelation"]; // for calendar - do not remove
2962
2963	if (params["initDestination"] === true)
2964	{
2965		window.BXSocNetLogDestinationFormName = 'destination' + ('' + new Date().getTime()).substr(6);
2966		window.BXSocNetLogDestinationDisableBackspace = null;
2967		BX.SocNetLogDestination.init({
2968			name : window.BXSocNetLogDestinationFormName,
2969			searchInput : BX('feed-add-post-destination-input'),
2970			extranetUser :  params["extranetUser"],
2971			bindMainPopup : {
2972				node: BX('feed-add-post-destination-container'),
2973				offsetTop: '5px',
2974				offsetLeft: '15px'
2975			},
2976			bindSearchPopup : {
2977				node : BX('feed-add-post-destination-container'),
2978				offsetTop : '5px',
2979				offsetLeft: '15px'
2980			},
2981			callback : {
2982				select : window["BXfpdSelectCallback"],
2983				unSelect : BX.delegate(BX.SocNetLogDestination.BXfpUnSelectCallback, {
2984					formName: window.BXSocNetLogDestinationFormName,
2985					inputContainerName: 'feed-add-post-destination-item',
2986					inputName: 'feed-add-post-destination-input',
2987					tagInputName: 'bx-destination-tag',
2988					tagLink1: BX.message('BX_FPD_LINK_1'),
2989					tagLink2: BX.message('BX_FPD_LINK_2')
2990				}),
2991				openDialog : BX.delegate(BX.SocNetLogDestination.BXfpOpenDialogCallback, {
2992					inputBoxName: 'feed-add-post-destination-input-box',
2993					inputName: 'feed-add-post-destination-input',
2994					tagInputName: 'bx-destination-tag'
2995				}),
2996				closeDialog : BX.delegate(BX.SocNetLogDestination.BXfpCloseDialogCallback, {
2997					inputBoxName: 'feed-add-post-destination-input-box',
2998					inputName: 'feed-add-post-destination-input',
2999					tagInputName: 'bx-destination-tag'
3000				}),
3001				openSearch : BX.delegate(BX.SocNetLogDestination.BXfpOpenDialogCallback, {
3002					inputBoxName: 'feed-add-post-destination-input-box',
3003					inputName: 'feed-add-post-destination-input',
3004					tagInputName: 'bx-destination-tag'
3005				}),
3006				closeSearch : BX.delegate(BX.SocNetLogDestination.BXfpCloseSearchCallback, {
3007					inputBoxName: 'feed-add-post-destination-input-box',
3008					inputName: 'feed-add-post-destination-input',
3009					tagInputName: 'bx-destination-tag'
3010				})
3011			},
3012			items : params["items"],
3013			itemsLast : params["itemsLast"],
3014			itemsSelected : params["itemsSelected"],
3015			isCrmFeed : params["isCrmFeed"],
3016			useClientDatabase: (!!params["useClientDatabase"]),
3017			destSort: params["destSort"],
3018			allowAddUser: params["allowAddUser"],
3019			allowAddCrmContact: params["allowAddCrmContact"],
3020			allowSearchCrmEmailUsers: (typeof params["allowSearchCrmEmailUsers"] != 'undefined' ? !!params["allowSearchCrmEmailUsers"] : false),
3021			userNameTemplate: (typeof params["userNameTemplate"] != 'undefined' ? params["userNameTemplate"] : '')
3022		});
3023		BX.bind(BX('feed-add-post-destination-input'), 'keyup', BX.delegate(BX.SocNetLogDestination.BXfpSearch, {
3024			formName: window.BXSocNetLogDestinationFormName,
3025			inputName: 'feed-add-post-destination-input',
3026			tagInputName: 'bx-destination-tag'
3027		}));
3028		BX.bind(BX('feed-add-post-destination-input'), 'keydown', BX.delegate(BX.SocNetLogDestination.BXfpSearchBefore, {
3029			formName: window.BXSocNetLogDestinationFormName,
3030			inputName: 'feed-add-post-destination-input'
3031		}));
3032		BX.bind(BX('bx-destination-tag'), 'focus', function(e) {
3033			BX.SocNetLogDestination.openDialog(
3034				window.BXSocNetLogDestinationFormName,
3035				{
3036					bByFocusEvent: true
3037				}
3038			);
3039			return BX.PreventDefault(e);
3040		});
3041		BX.bind(BX('feed-add-post-destination-container'), 'click', function(e) {
3042			BX.SocNetLogDestination.openDialog(window.BXSocNetLogDestinationFormName);
3043			return BX.PreventDefault(e);
3044		});
3045		if (params["itemsHidden"])
3046		{
3047			for (var ii in params["itemsHidden"])
3048			{
3049				if (params["itemsHidden"].hasOwnProperty(ii))
3050				{
3051					window.BXfpdSelectCallback({id:('SG'+params["itemsHidden"][ii]["ID"]), name:params["itemsHidden"][ii]["
3051NAME"]}, 'sonetgroups', '', true);
3052				}
3053			}
3054		}
3055
3056		BX.SocNetLogDestination.BXfpSetLinkName({
3057			formName: window.BXSocNetLogDestinationFormName,
3058			tagInputName: 'bx-destination-tag',
3059			tagLink1: BX.message('BX_FPD_LINK_1'),
3060			tagLink2: BX.message('BX_FPD_LINK_2')
3061		});
3062	}
3063	window["BXfpdSelectCallbackMent" + formId] = function(item, type, search)
3064	{
3065		window.BxInsertMention({item: item, type: type, formID: formId, editorId: params["editorId"]});
3066	};
3067
3068	window["BXfpdStopMent" + formId] = function ()
3069	{
3070		BX.SocNetLogDestination.closeDialog();
3071		BX.SocNetLogDestination.closeSearch();
3072		clearTimeout(BX.SocNetLogDestination.searchTimeout);
3073		BX.SocNetLogDestination.searchOnSuccessHandle = false;
3074	};
3075
3076	window["BXfpdOnDialogOpen" + formId] = function ()
3077	{
3078		MPFMention.listen = true;
3079		MPFMention.listenFlag = true;
3080	};
3081
3082	window["BXfpdOnDialogClose" + formId] = function ()
3083	{
3084		MPFMention.listen = false;
3085		setTimeout(function()
3086		{
3087			MPFMention.listenFlag = false;
3088			if (!MPFMention.listen)
3089			{
3090				var editor = LHEPostForm.getEditor(params.editorId);
3091				if(editor)
3092				{
3093					var
3094						doc = editor.GetIframeDoc(),
3095						mentNode = doc.getElementById('bx-mention-node');
3096
3097					if (mentNode)
3098					{
3099						editor.selection.SetAfter(mentNode);
3100						if (MPFMention.leaveContent)
3101						{
3102							editor.util.ReplaceWithOwnChildren(mentNode);
3103						}
3104						else
3105						{
3106							BX.remove(mentNode);
3107						}
3108					}
3109					editor.Focus();
3110				}
3111			}
3112		}, 100);
3113	};
3114
3115	window["BXSocNetLogDestinationFormNameMent" + formId] = 'mention' + ('' + new Date().getTime()).substr(5);
3116	window["BXSocNetLogDestinationDisableBackspace"] = null;
3117	var bxBMent = BX('bx-b-mention-' + formId);
3118
3119	if (typeof params["items"]["extranetRoot"] != 'undefined')
3120	{
3121		params["items"]["departmentExtranet"] = BX.clone(params["items"]["department"]);
3122		for(var key in params["items"]["extranetRoot"])
3123		{
3124			if (params["items"]["extranetRoot"].hasOwnProperty(key))
3125			{
3126				params["items"]["departmentExtranet"][key] = params["items"]["extranetRoot"][key];
3127			}
3128		}
3129		params["items"]["departmentRelationExtranet"] = BX.SocNetLogDestination.buildDepartmentRelation(params["items"]["departmentExtranet"]);
3130	}
3131
3132	BX.SocNetLogDestination.init({
3133		name : window["BXSocNetLogDestinationFormNameMent" + formId],
3134		searchInput : bxBMent,
3135		extranetUser : params["extranetUser"],
3136		bindMainPopup :  {
3137			node : bxBMent,
3138			offsetTop : '1px',
3139			offsetLeft: '12px'
3140		},
3141		bindSearchPopup : {
3142			node : bxBMent,
3143			offsetTop : '1px',
3144			offsetLeft: '12px'
3145		},
3146		callback : {
3147			select : window["BXfpdSelectCallbackMent" + formId],
3148			openDialog : window["BXfpdOnDialogOpen" + formId],
3149			closeDialog : window["BXfpdOnDialogClose" + formId],
3150			openSearch : window["BXfpdOnDialogOpen" + formId],
3151			closeSearch : window["BXfpdOnDialogClose" + formId]
3152		},
3153		items : {
3154			users : params["items"]["mentionUsers"],
3155			groups : {},
3156			sonetgroups : {},
3157			department : (typeof params["items"]["departmentExtranet"] != 'undefined' ? params["items"]["departmentExtranet"] : params["items"]["department"]),
3158			departmentRelation : (typeof params["items"]["departmentRelationExtranet"] != 'undefined' ? params["items"]["departmentRelationExtranet"] : params["items"]["departmentRelation"])
3159		},
3160		itemsLast : {
3161			users : params["itemsLast"]["mentionUsers"],
3162			sonetgroups : {},
3163			department : {},
3164			groups : {}
3165		},
3166		itemsSelected : params["itemsSelected"],
3167		destSort: (typeof params["mentionDestSort"] != 'undefined' && params["mentionDestSort"] ? params["mentionDestSort"] : {}),
3168		departmentSelectDisable : true,
3169		obWindowClass : 'bx-lm-mention',
3170		obWindowCloseIcon : false,
3171		useClientDatabase: (!!params["useClientDatabase"]),
3172		userNameTemplate: (typeof params["userNameTemplate"] != 'undefined' ? params["userNameTemplate"] : '')
3173	});
3174
3175	BX.ready(function() {
3176			var ment = BX('bx-b-mention-' + formId);
3177			if(BX.browser.IsIE() && !BX.browser.IsIE9())
3178			{
3179				ment.style.width = '1px';
3180				ment.style.marginRight = '0';
3181			}
3182
3183			BX.bind(
3184				ment,
3185				"mousedown",
3186				function(e)
3187				{
3188					if(MPFMention.listen !== true)
3189					{
3190						var
3191							editor = LHEPostForm.getEditor(params.editorId),
3192							doc = editor.GetIframeDoc();
3193
3194						if(editor.GetViewMode() == 'wysiwyg' && doc)
3195						{
3196							MPFMention.listen = true;
3197							MPFMention.listenFlag = true;
3198							MPFMention.text = '';
3199							MPFMention.leaveContent = false;
3200
3201							var
3202								range = editor.selection.GetRange(),
3203								mentNode = doc.getElementById('bx-mention-node');
3204
3205							if (mentNode)
3206							{
3207								BX.remove(mentNode);
3208							}
3209							editor.InsertHtml('<span id="bx-mention-node">' + editor.INVISIBLE_SPACE + '</span>', range);
3210
3211							setTimeout(function()
3212							{
3213								if(!BX.SocNetLogDestination.isOpenDialog())
3214								{
3215									BX.SocNetLogDestination.openDialog(window["BXSocNetLogDestinationFormNameMent" + formId], {bindNode: ment});
3216								}
3217
3218								var mentionNode = doc.getElementById('bx-mention-node');
3219								if (mentionNode)
3220								{
3221									range.setStart(mentionNode, 0);
3222									if (mentionNode.firstChild && mentionNode.firstChild.nodeType == 3 && mentionNode.firstChild.nodeValue.length > 0)
3223									{
3224										range.setEnd(mentionNode, 1);
3225									}
3226									else
3227									{
3228										range.setEnd(mentionNode, 0);
3229									}
3230									editor.selection.SetSelection(range);
3231								}
3232								editor.Focus();
3233							}, 100);
3234						}
3235						else if (editor.GetViewMode() == 'code')
3236						{
3237							MPFMention.listen = true;
3238							MPFMention.listenFlag = true;
3239							MPFMention.text = '';
3240							MPFMention.leaveContent = false;
3241
3242							// TODO: get current cusrsor position
3243
3244							setTimeout(function()
3245							{
3246								if(!BX.SocNetLogDestination.isOpenDialog())
3247								{
3248									BX.SocNetLogDestination.openDialog(window["BXSocNetLogDestinationFormNameMent" + formId], {bindNode: ment});
3249								}
3250							}, 100);
3251						}
3252
3253						BX.onCustomEvent(ment, 'mentionClick');
3254					}
3255				}
3256			);
3257		}
3258	);
3259}
3260})();
3261
3262/* End */
3263;
3264; /* Start:"a:4:{s:4:"full";s:90:"/bitrix/components/bitrix/main.field.file/templates/main.edit/script.min.js?17702092095000";s:6:"source";s:71:"/bitrix/components/bitrix/main.field.file/templates/main.edit/script.js";s:3:"min";s:75:"/bitrix/components/bitrix/main.field.file/templates/main.edit/script.min.js";s:3:"map";s:75:"/bitrix/components/bitrix/main.field.file/templates/main.edit/script.map.js";}"*/
3265this.BX=this.BX||{};this.BX.Main=this.BX.Main||{};this.BX.Main.Field=this.BX.Main.Field||{};(function(e,t,n,i,l){"use strict";var r={components:{TileWidgetComponent:l.TileWidgetComponent},data:function e(){return{deletedValues:[],uploadedValues:[],uploadInProgress:false}},props:{fieldName:{type:String,required:true},controlId:{type:String,required:true},context:{type:Object,required:true},values:{type:Object}},computed:{sessionInputName:function e(){return"".concat(this.context.fieldName,"_session_id")},valueInputName:function e(){return this.context.fieldName+(this.context.multiple?"[]":"")},deletedValueInputName:function e(){return"".concat(this.context.fieldName,"_del").concat(this.context.multiple?"[]":"")},sessionId:function e(){return this.context.sessionId},currentValues:function e(){var t=[].concat(babelHelpers.toConsumableArray(this.values),babelHelpers.toConsumableArray(this.uploadedValues));return this.context.multiple?t:t.slice(-1)},uploaderOptions:function e(){var t=this,l;return{controller:"main.fileUploader.fieldFileUploaderController",controllerOptions:this.context.controllerOptions,files:this.values,events:(l={},babelHelpers.defineProperty(l,i.UploaderEvent.FILE_UPLOAD_COMPLETE,(function(e){var n,i,l;var r=(n=e.getData())===null||n===void 0?void 0:(i=n.file)===null||i===void 0?void 0:(l=i.getCustomData())===null||l===void 0?void 0:l.realFileId;if(r){t.uploadedValues.push(r)}t.emitChangeEvent()})),babelHelpers.defineProperty(l,i.UploaderEvent.FILE_REMOVE,(function(e){var i,l,r,o,a;var u=(i=e.getData())===null||i===void 0?void 0:(l=i.file)===null||l===void 0?void 0:(r=l.getCustomData())===null||r===void 0?void 0:r.realFileId;if(u&&t.uploadedValues.includes(u)){t.uploadedValues=t.uploadedValues.filter((function(e){return e!==u}))}var s=(o=e.getData())===null||o===void 0?void 0:(a=o.file)===null||a===void 0?void 0:a.getServerFileId();if(s&&n.Type.isInteger(s)){t.deletedValues.push(s)}t.emitChangeEvent()})),babelHelpers.defineProperty(l,i.UploaderEvent.FILE_STATUS_CHANGE,(function(e){var n;var l=(n=e.getTarget())===null||n===void 0?void 0:n.getFiles();if(!l){return}var r=l.some((function(e){var t=e.getStatus();return t===i.FileStatus.UPLOADING||t===i.FileStatus.PREPARING||t===i.FileStatus.PENDING||t===i.FileStatus.UPLOADING}));if(t.uploadInProgress!==r){t.uploadInProgress=r;if(r){t.emitUploadStartEvent()}else{t.emitUploadCompleteEvent()}}})),l),multiple:this.context.multiple,autoUpload:true,treatOversizeImageAsFile:true}},widgetOptions:function e(){return{}}},methods:{emitChangeEvent:function e(){BX.onCustomEvent(window,"onUIEntityEditorUserFieldExternalChanged",[this.fieldName]);BX.onCustomEvent(window,"onCrmEntityEditorUserFieldExternalChanged",[this.fieldName])},emitUploadStartEvent:function e(){n.Event.EventEmitter.emit("BX.UI.EntityEditor:onUserFieldFileUploadStart",{fieldName:this.fieldName})},emitUploadCompleteEvent:function e(){n.Event.EventEmitter.emit("BX.UI.EntityEditor:onUserFieldFileUploadComplete",{fieldName:this.fieldName})}},template:'\n\t\t<div class="main-field-file-wrapper">\n\t\t\t<input type="hidden" :name="sessionInputName" :value="sessionId" />\n\t\t\t<input v-if="currentValues.length" v-for="(value, index) in currentValues" :key="index" type="hidden" :name="valueInputName" :value="value"/>\n\t\t\t<input v-else type="hidden" :name="valueInputName" />\n\n\t\t\t<input v-for="(value, index) in deletedValues" :key="index" type="hidden" :name="deletedValueInputName" :value="value"/>\n\n\t\t\t<TileWidgetComponent\n\t\t\t\tref="uploader"\n\t\t\t\t:uploaderOptions="uploaderOptions"\n\t\t\t\t:widgetOptions="widgetOptions"\n\t\t\t/>\n\t\t</div>\n\t'};function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
3265t%2?o(Object(n),!0).forEach((function(t){babelHelpers.defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){s(e,t);t.set(e,n)}function s(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var d=new WeakMap;var p=function e(i){babelHelpers.classCallCheck(this,e);u(this,d,{writable:true,value:null});var l=document.getElementById(i.containerId);if(!n.Type.isDomNode(l)){throw new Error("container not found")}babelHelpers.classPrivateFieldSet(this,d,t.BitrixVue.createApp(a({},r),{fieldName:i.fieldName,controlId:i.controlId,context:i.context,values:i.value.map((function(e){return parseInt(e,10)}))}));babelHelpers.classPrivateFieldGet(this,d).mount(l)};e.App=p})(this.BX.Main.Field.File=this.BX.Main.Field.File||{},BX.Vue3,BX,BX.UI.Uploader,BX.UI.Uploader);
3266/* End */
3267;
3268; /* Start:"a:4:{s:4:"full";s:71:"/bitrix/components/bitrix/system.field.edit/script.min.js?1666247061814";s:6:"source";s:53:"/bitrix/components/bitrix/system.field.edit/script.js";s:3:"min";s:57:"/bitrix/components/bitrix/system.field.edit/script.min.js";s:3:"map";s:57:"/bitrix/components/bitrix/system.field.edit/script.map.js";}"*/
3269function addElement(e,n){if(document.getElementById("main_"+e)){var d=document.getElementById("main_"+e).getElementsByTagName("div");if(d&&d.length>0&&d[0]){var t=d[0].parentNode;t.appendChild(d[d.length-1].cloneNode(true))}}}function addElementFile(e,n){var d=document.getElementById("main_"+e);var t=document.getElementById("main_add_"+e);if(d&&t){t=t.cloneNode(true);t.id="";t.style.display="";d.appendChild(t)}}function addElementDate(e,n){var d=document.getElementById("date_container_"+n);var t=document.getElementById("hidden_"+n).innerHTML;if(d&&t){var a=e[n].fieldName;var i=e[n].index;t=t.replace(/[#]FIELD_NAME[#]/g,a+"["+i+"]");t=t.replace(/[\%]23FIELD_NAME[\%]23/g,escape(a+"["+i+"]"));var l=d.appendChild(document.createElement("DIV"));l.innerHTML+=t;e[n].index++}}
3270/* End */
3271;
3272; /* Start:"a:4:{s:4:"full";s:91:"/bitrix/components/bitrix/search.tags.input/templates/.default/script.min.js?17591936018379";s:6:"source";s:72:"/bitrix/components/bitrix/search.tags.input/templates/.default/script.js";s:3:"min";s:76:"/bitrix/components/bitrix/search.tags.input/templates/.default/script.min.js";s:3:"map";s:76:"/bitrix/components/bitrix/search.tags.input/templates/.default/script.map.js";}"*/
3273var Errors={result_unval:"Error in result",result_empty:"Empty result"};function JsTc(oHandler,sParams,sParser){var t=this;t.oObj=typeof oHandler=="object"?oHandler:document.getElementById("TAGS");t.sParams=sParams;if(sParser){t.sExp=new RegExp("["+sParser+"]+","i")}else{t.sExp=new RegExp(",")}t.oLast={str:false,arr:false};t.oThis={str:false,arr:false};t.oEl={start:false,end:false};t.oUnfinedWords={};t.bReady=true;t.eFocus=true;t.aDiv=null;t.oDiv=null;t.oActive=null;t.oPointer=[];t.oPointer_default=[];t.oPointer_this="input_field";t.oObj.onblur=function(){t.eFocus=false};t.oObj.onfocus=function(){if(!t.eFocus){t.eFocus=true;setTimeout((function(){t.CheckModif("focus")}),500)}};t.oLast["arr"]=t.oObj.value.split(t.sExp);t.oLast["str"]=t.oLast["arr"].join(":");setTimeout((function(){t.CheckModif("this")}),500);this.CheckModif=function(e){var o=false;var r=0;var n=false;var s="";var i={};if(!t.eFocus){return}if(t.bReady&&t.oObj.value.length>0){t.oThis["arr"]=t.oObj.value.split(t.sExp);t.oThis["str"]=t.oThis["arr"].join(":");if(t.oThis["str"]&&t.oThis["str"]!=t.oLast["str"]){i["position"]=TCJsUtils.getCursorPosition(t.oObj);if(i["position"]["end"]>0&&!t.sExp.test(t.oObj.value.substr(i["position"]["end"]-1,1))){i["arr"]=t.oObj.value.substr(0,i["position"]["end"]).split(t.sExp);o=t.oThis["arr"][i["arr"].length-1];t.oEl["start"]=i["position"]["end"]-i["arr"][i["arr"].length-1].length;t.oEl["end"]=t.oEl["start"]+o.length;t.oEl["content"]=o;t.oLast["arr"]=t.oThis["arr"];t.oLast["str"]=t.oThis["str"]}}if(o){for(r=2;r<=o.length;r++){s=o.substr(0,r);if(t.oUnfinedWords[s]=="!fined"){n=true;break}}if(!n){t.Send(o)}}}setTimeout((function(){t.CheckModif("this")}),500)};t.Send=function(sSearch){if(!sSearch){return}var oError=[];t.bReady=false;if(BX("wait_container")){BX("wait_container").innerHTML=BX.message("JS_CORE_LOADING");BX.show(BX("wait_container"))}BX.ajax.post("/bitrix/components/bitrix/search.tags.input/search.php",{search:sSearch,params:t.sParams},(function(data){var result={};t.bReady=true;try{eval("result = "+data+";")}catch(t){oError["result_unval"]=t}if(TCJsUtils.empty(result)){oError["result_empty"]=Errors["result_empty"]}
3273try{if(TCJsUtils.empty(oError)&&typeof result=="object"){if(!(result.length==1&&result[0]["NAME"]==t.oEl["content"])){t.Show(result);return}}else{t.oUnfinedWords[t.oEl["content"]]="!fined"}}catch(t){oError["unknown_error"]=t}if(BX("wait_container")){BX.hide(BX("wait_container"))}}))};t.Show=function(e){t.Destroy();t.oDiv=document.body.appendChild(document.createElement("DIV"));t.oDiv.id=t.oObj.id+"_div";t.oDiv.className="search-popup";t.oDiv.style.position="absolute";t.aDiv=t.Print(e);var o=TCJsUtils.GetRealPos(t.oObj);t.oDiv.style.width=parseInt(o["width"],10)+"px";TCJsUtils.show(t.oDiv,o["left"],o["bottom"]);TCJsUtils.addEvent(document,"click",t.CheckMouse);TCJsUtils.addEvent(document,"keydown",t.CheckKeyword)};t.Print=function(e){var o=null;var r=[];var n=[];var s=0;var i=null;var a=null;var l=t.oDiv.id;for(var c in e){if(e.hasOwnProperty(c)){o=e[c];n=[];n["ID"]=o["ID"]&&o["ID"].length>0?o["ID"]:s++;n["GID"]=l+"_"+n["ID"];n["NAME"]=TCJsUtils.htmlspecialcharsEx(o["NAME"]);n["~NAME"]=o["NAME"];n["CNT"]=o["CNT"];r[n["GID"]]=n;t.oPointer.push(n["GID"]);i=t.oDiv.appendChild(document.createElement("DIV"));i.id=n["GID"];i.name=l+"_div";i.className="search-popup-row";i.onmouseover=function(){t.Init();this.className="search-popup-row-active"};i.onmouseout=function(){t.Init();this.className="search-popup-row"};i.onclick=function(e){t.oActive=this.id;t.Replace();t.Destroy();BX.PreventDefault(e)};a=i.appendChild(document.createElement("DIV"));a.id=i.id+"_NAME";a.className="search-popup-el search-popup-el-cnt";a.innerHTML=n["CNT"];a=i.appendChild(document.createElement("DIV"));a.id=i.id+"_NAME";a.className="search-popup-el search-popup-el-name";a.innerHTML=n["NAME"]}}t.oPointer.push("input_field");t.oPointer_default=t.oPointer;return r};t.Destroy=function(){try{TCJsUtils.hide(t.oDiv);t.oDiv.parentNode.removeChild(t.oDiv)}catch{}t.aDiv=[];t.oPointer=[];t.oPointer_default=[];t.oPointer_this="input_field";t.bReady=true;t.eFocus=true;t.oActive=null;TCJsUtils.removeEvent(document,"click",t.CheckMouse);TCJsUtils.removeEvent(document,"keydown",t.CheckKeyword)};t.Replace=function(){if(typeof t.oActive=="string"){var e=t.aDiv[t.oActive];var o="";if(typeof e=="object"){var r=document.createElement("textarea");r.innerHTML=e["~NAME"];o=r.value}var n=t.oEl["start"];while(n<t.oObj.value.length&&t.oObj.value.substring(n,n+1)==" "){n++}t.oObj.value=t.oObj.value.substring(0,n)+o+t.oObj.value.substr(t.oEl["end"]);TCJsUtils.setCursorPosition(t.oObj,n+o.length)}};t.Init=function(){t.oActive=false;t.oPointer=t.oPointer_default;t.Clear();t.oPointer_this="input_pointer"};t.Clear=function(){var e=t.oDiv.getElementsByTagName("div");if(e.length>0&&typeof e=="object"){for(var o in e){if(e.hasOwnProperty(o)){var r=e[o];if(r&&typeof r=="object"&&r.name==t.oDiv.id+"_div"){r.className="search-popup-row"}}}}};t.CheckMouse=function(){t.Replace();t.Destroy()};t.CheckKeyword=function(e){var o=e||window.event;var r=null;var n=null;if(o.keyCode>37&&o.keyCode<41||o.keyCode==13){t.Clear();switch(o.keyCode){case 38:r=t.oPointer.pop();if(t.oPointer_this==r){t.oPointer.unshift(r);r=t.oPointer.pop()}if(r!="input_field"){t.oActive=r;n=document.getElementById(r);if(typeof n=="object"){n.className="search-popup-row-active"}}t.oPointer.unshift(r);break;case 40:r=t.oPointer.shift();if(t.oPointer_this==r){t.oPointer.push(r);r=t.oPointer.shift()}if(r!="input_field"){t.oActive=r;n=document.getElementById(r);if(typeof n=="object"){n.className="search-popup-row-active"}}t.oPointer.push(r);break;case 39:t.Replace();t.Destroy();break;case 13:t.Replace();t.Destroy();if(TCJsUtils.IsIE()){o.returnValue=false;o.cancelBubble=true}else{o.preventDefault();o.stopPropagation()}break;default:break}t.oPointer_this=r}else{t.Destroy()}}}var TCJsUtils={arEvents:[],addEvent:function(t,e,o){if(t.attachEvent){t.attachEvent("on"+e,o)}else if(t.addEventListener){t.addEventListener(e,o,false)}else{t["on"+e]=o}this.arEvents[this.arEvents.length]={element:t,event:e,fn:o}},removeEvent:function(t,e,o){if(t.detachEvent){t.detachEvent("on"+e,o)}else if(t.removeEventListener){t.removeEventListener(e,o,false)}else{t["on"+e]=null}},getCursorPosition:function(t){var e={start:0,end:0};if(!t||typeof t!="object"){return e}try{if(document.selection!=null&&t.selectionStart==null){t.focus();var o=document.selection.createRange();var r=o.parentElement();var n=o.getBookmark();var s=t.value;var i=t.value;var a="__"+Math.random()+"__";while(s.indexOf(a)!=-1){a="__"+Math.random()+"__"}
3273if(!r||r==null||r.type!="textarea"&&r.type!="text"){return e}o.text=a+o.text+a;s=t.value;e["start"]=s.indexOf(a);s=s.replace(a,"");e["end"]=s.indexOf(a);t.value=i;o.moveToBookmark(n);o.select();return e}return{start:t.selectionStart,end:t.selectionEnd}}catch{return e}},setCursorPosition:function(t,e){if(typeof t!="object"){return false}t.focus();try{if(document.selection!=null&&t.selectionStart==null){var o=document.selection.createRange();o.select()}else{t.selectionStart=e;t.selectionEnd=e}return true}catch{return false}},empty:function(t){if(t){for(var e in t){if(t.hasOwnProperty(e)){return false}}}return true},show:function(t,e,o){if(typeof t!="object"){return}var r=parseInt(t.style.zIndex,10);if(r<=0||isNaN(r)){r=2200}t.style.zIndex=r;t.style.left=e+"px";t.style.top=o+"px"},hide:function(t){if(t){t.style.display="none"}},GetRealPos:function(t){if(!t||!t.offsetParent){return false}var e={};var o=t.offsetParent;e["left"]=t.offsetLeft;e["top"]=t.offsetTop;while(o&&o.tagName!="BODY"){e["left"]+=o.offsetLeft;e["top"]+=o.offsetTop;o=o.offsetParent}e["right"]=e["left"]+t.offsetWidth;e["bottom"]=e["top"]+t.offsetHeight;e["width"]=t.offsetWidth;e["height"]=t.offsetHeight;return e},IsIE:function(){return document.attachEvent&&!TCJsUtils.IsOpera()},IsOpera:function(){return navigator.userAgent.toLowerCase().indexOf("opera")!=-1},htmlspecialcharsEx:function(t){return t.replaceAll("&amp;","&amp;amp;").replaceAll("&lt;","&amp;lt;").replaceAll("&gt;","&amp;gt;").replaceAll("&quot;","&amp;quot;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")},htmlspecialcharsback:function(t){return t.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&quot;;",'"').replaceAll("&amp;","&")}};
3274/* End */
3275;
3276; /* Start:"a:4:{s:4:"full";s:84:"/bitrix/components/bitrix/voting.uf/templates/.default/script.min.js?175919340611246";s:6:"source";s:64:"/bitrix/components/bitrix/voting.uf/templates/.default/script.js";s:3:"min";s:68:"/bitrix/components/bitrix/voting.uf/templates/.default/script.min.js";s:3:"map";s:68:"/bitrix/components/bitrix/voting.uf/templates/.default/script.map.js";}"*/
3277(function(t){var e=t.BX;if(e["Vote"])return;var i=t.BXMobileApp?e.message("SITE_DIR")+"mobile/?mobile_action=vote":"/bitrix/tools/vote/uf.php";e.Vote=function(){var a=function(i,s){this.node=i;this.form=e.findChild(this.node,{tagName:"FORM"},true);this.id=s["id"];this.voteId=s["voteId"];this.params=s;var a,o,r;this.errorNode=e.findChild(this.node,{attribute:{"data-bx-vote-role":"error"}},true);for(var n in this.buttons){if(this.buttons.hasOwnProperty(n)){a=e.findChild(this.node,{attribute:{"data-bx-vote-button":n}},true);if(a&&e.type.isFunction(this[n])){this[n]=e.delegate(this[n],this);this.buttons[n]=a;e.bind(a,"click",this[n])}}}a=e.findChildren(this.node,{tagName:"TR"},true);while(a&&(o=a.pop())&&o&&o.hasAttribute("data-bx-vote-answer")){r=e.findChild(o,{tagName:"A",attribute:{"data-bx-vote-result":"counter"}},true);if(r){if(t.BXMobileApp){e.bind(o,"click",e.proxy(this.checkMobileUsers,this))}else{e.bind(r,"click",e.proxy(this.checkUsers,this));e.adjust(r,{attrs:{"data-bx-vote-answer":o.getAttribute("data-bx-vote-answer")}})}}}this.onPullEvent=e.delegate((function(t,i){if(t=="voting"&&!!i&&i["VOTE_ID"]==this.voteId&&e(this.node)){this.adjustResults(i)}}),this);if(t.BXMobileApp){app.onCustomEvent("onPullExtendWatch",{id:"VOTE_"+this.voteId});e.addCustomEvent("onPull-vote",this.onPullEvent)}else if(e["PULL"]){e.PULL.extendWatch("VOTE_"+this.voteId);e.addCustomEvent("onPullEvent-vote",this.onPullEvent)}};a.prototype={buttons:{showVoteForm:null,showResults:null,actVoting:null,stopOrResume:null,exportXls:null},params:{},url:i,showVoteForm:function(t){if(this.node.getAttribute("data-bx-vote-lamp")=="green"){var i=e.proxy((function(t){if(t&&t.data&&t.data.event)this.adjustBallot(t.data.attach,t.data.event);this.node.setAttribute("data-bx-vote-form","shown")}),this),s=e.proxy((function(t){this.node.setAttribute("data-bx-vote-form","shown")}),this);this.send({action:"getBallot"},t.target,i,s)}e.eventCancelBubble(t);return e.PreventDefault(t)},showResults:function(t){this.node.setAttribute("data-bx-vote-result",this.node.getAttribute("data-bx-vote-result")=="shown"?"hidden":"shown");e.eventCancelBubble(t);return e.PreventDefault(t)},stopOrResume:function(t){this.send({action:this.node.getAttribute("data-bx-vote-lamp")=="red"?"resume":"stop"},t.target,e.proxy((function(t){if(t["action"]=="stop"){this.node.setAttribute("data-bx-vote-result","shown");this.node.setAttribute("data-bx-vote-form","hidden");this.node.setAttribute("data-bx-vote-lamp","red")}else{if(this.node.getAttribute("data-bx-vote-status")!=="voted")this.node.setAttribute("data-bx-vote-form","shown");this.node.setAttribute("data-bx-vote-lamp","green")}if(t["data"]&&t["data"]["attach"])this.adjustResults(t["data"]["attach"])}),this));e.eventCancelBubble(t);return e.PreventDefault(t)},exportXls:function(t){e.eventCancelBubble(t);top.location.href=e.util.add_url_param(this.url,{action:"exportXls",attachId:this.id,sessid:e.bitrix_sessid()});return e.PreventDefault(t)},actVoting:function(t){var i=e.ajax.prepareForm(this.form).data;i["action"]="vote";this.send(i,t.target,e.proxy((function(t){this.node.setAttribute("data-bx-vote-form","hidden");this.node.setAttribute("data-bx-vote-result","shown");this.adjustResults(t.data.attach)}),this),e.proxy((function(){this.node.setAttribute("data-bx-vote-form","shown")}),this));e.eventCancelBubble(t);return e.PreventDefault(t)},send:function(t,i,s,a){e.addClass(i,"ui-btn-clock");t["sessid"]=e.bitrix_sessid();t["attachId"]=this.id;e.ajax({method:"POST",url:e.util.add_url_param(this.url,{action:t["action"],attachId:this.id}),data:t,dataType:"json",onsuccess:e.proxy((function(t){e.removeClass(i,"ui-btn-clock");if(t.status=="success"){this.showError(null);if(e.type.isFunction(s))s.apply(this,arguments)}else{if(t.status=="error"&&t["errors"])this.showError(t["errors"]);if(e.type.isFunction(a))a.apply(this,arguments)}}),this),onfailure:e.proxy((function(){e.removeClass(i,"ui-btn-clock");if(e.type.isFunction(a))a.apply(this,arguments)}),this)})},adjustBallot:function(t,i){var s,a,o,r,n,u,l,h,p,d=t["QUESTIONS"],c=i["ballot"],f=i["extras"];for(s in d){if(d.hasOwnProperty(s)){l=d[s];o=[l["FIELD_NAME"],l["FIELD_NAME"]+"[]"];p=c[s]||{};while(r=o.shift()){if(this.form.elements[r]){u=e(this.form.elements[r])?[this.form.elements[r]]:this.form.elements[r];for(r=0;r<u.length;r++){if(p[u[r].value]){u[r].checked="checked"}else{delete u[r].checked}}}}
3277for(a in d[s]["ANSWERS"]){if(d[s]["ANSWERS"].hasOwnProperty(a)){h=d[s]["ANSWERS"][a];if(h["FIELD_TYPE"]>=4){if(this.form.elements[h["MESSAGE_FIELD_NAME"]])this.form.elements[h["MESSAGE_FIELD_NAME"]].value=c[s]&&c[s][a]&&c[s][a]["MESSAGE"]?c[s][a]["MESSAGE"]:"";else this.form.elements[h["FIELD_NAME"]].value=c[s]&&c[s][a]&&c[s][a]["MESSAGE"]?c[s][a]["MESSAGE"]:""}}}}}for(r in f){if(f.hasOwnProperty(r)&&(s=e(this.form.elements[String(t["FIELD_NAME"]).replace("#ENTITY_ID#",r)]))){if(s.value==f[r])s.checked=true;else delete s.checked}}},adjustResults:function(t){var i=t["QUESTIONS"];e.onCustomEvent(this.node,"OnBeforeChangeData");var s,a,o,r,n,u;for(r in i){if(i.hasOwnProperty(r)){s=e.findChild(this.node,{attr:{id:"question"+r}},true);if(s){for(o in i[r]["ANSWERS"]){if(i[r]["ANSWERS"].hasOwnProperty(o)){a=e.findChild(s,{attr:{"data-bx-vote-answer":o}},true);if(!!a){n=parseInt(i[r]["ANSWERS"][o]["PERCENT"]);n=isNaN(n)?0:n;u=e.findChild(a,{attribute:{"data-bx-vote-result":"counter"}},true);e.adjust(u,{html:i[r]["ANSWERS"][o]["COUNTER"]+""});
3277delete u["VOTED_USER_OBJ"];e.adjust(e.findChild(a,{tagName:"SPAN",attribute:{"data-bx-vote-result":"percent"}},true),{html:n+"%"});e.adjust(e.findChild(a,{tagName:"DIV",attribute:{"data-bx-vote-result":"bar"}},true),{style:{width:n+"%"}})}}}}}}u=e.findChild(this.node,{tagName:"DIV",attribute:{"data-bx-vote-result":"counter"}},true);e.adjust(u,{html:t["COUNTER"]+""});e.onCustomEvent(this.controller,"OnAfterChangeData")},checkUsers:function(t){var i=t?e(t.currentTarget):null;if(i.hasAttribute("data-bx-vote-answer")){if(!i["VOTED_USER_OBJ"]){i.VOTED_USER_OBJ=new s(i.getAttribute("data-bx-vote-answer"),i,{nameTemplate:this.params["nameTemplate"],urlTemplate:this.params["urlTemplate"],attachId:this.id})}i.VOTED_USER_OBJ.click()}},checkMobileUsers:function(t){if(this.node&&this.node.getAttribute("data-bx-vote-form")!=="shown"){var i=e.proxy_context,s=e.findChild(i,{tagName:"A",attribute:{"data-bx-vote-result":"counter"}},true);if(s&&parseInt(s.innerHTML)>0){e.PreventDefault(t);app.openBXTable({url:e.util.add_url_param(this.url,{action:"getMobileVoted",attachId:this.id,answerId:i.getAttribute("data-bx-vote-answer"),sessid:e.bitrix_sessid()}),TABLE_SETTINGS:{markmode:false,cache:false}});return false}}return true},showError:function(t){var i="";if(e.type.isArray(t)){var s=[];for(var a=0;a<t.length;a++){s.push(t[a]["message"])}s=s.join("<br />");i=s===""?"Unknown error":s;this.errorNode.innerHTML=i;this.node.setAttribute("data-bx-vote-error","shown")}else{this.errorNode.innerHTML="";this.node.setAttribute("data-bx-vote-error","hidden")}}};return a}();var s=function(){var t=function(t,e,i){this.id=["vote",t,(new Date).getTime()].join("-");this.answerId=t;this.node=e;this.status="ready";this.iNumPage=0;this.urlTemplate=i["urlTemplate"];this.nameTemplate=i["nameTemplate"];this.attachId=i["attachId"];this.data=[];this.queue=[];this.popup=null;this.popupScrollCheck=this.popupScrollCheck.bind(this)};t.prototype={url:i,click:function(){var t=parseInt(this.node.innerHTML);if(t>0){this.showPopup().then((()=>
3277{if(this.data.length>0){this.buildVoters(this.data)}}))}},buildVoters:function(t){var i=this.popup?this.popup.getPopupContainer():null;if(i===null){return}var s=i.querySelector(".bx-ilike-popup");i.querySelector(".bx-ilike-wrap-block").removeAttribute("style");var a=false;t.forEach((t=>{var i=e.util.htmlspecialchars(t["ID"]);var o=e.util.htmlspecialchars(t["FULL_NAME"]);var r=e.type.isNotEmptyString(t["PHOTO_SRC"])?encodeURI(e.util.htmlspecialchars(t["PHOTO_SRC"])):null;var n=e.type.isNotEmptyString(t["TYPE"])?e.util.htmlspecialchars(t["TYPE"]):null;var u=["a",this.answerId,"u",i].join("");if(s.querySelector("a#"+u)===null){var l=['<span class="bx-ilike-popup-avatar-new">','<img src="',r??"/bitrix/images/main/blank.gif",'" class="bx-ilike-popup-avatar-img',r?"":" bx-ilike-popup-avatar-img-default",'" />','<span class="bx-ilike-popup-avatar-status-icon"></span>',"</span>",'<span class="bx-ilike-popup-name-new">',o,"</span>"].join("");s.appendChild(e.create(t["ID"]!=="HIDDEN"&&this.urlTemplate?"A":"SPAN",{attrs:{id:u},props:{href:this.urlTemplate.replace(/#(USER_ID|ID)#/i,i),target:"_blank",className:"bx-ilike-popup-img"+(n?" bx-ilike-popup-img-"+n:"")},html:l}))}a=true}));if(a){this.popup.adjustPosition({forceBindPosition:true});this.popupScrollCheck({currentTarget:s})}},makeError:function(t){var i=this.popup?this.popup.getPopupContainer():null;if(i===null){return}var s=(t||[{message:e.message("VOTE_ERROR_DEFAULT")}]).map((t=>t.message)).join("");i.innerHTML='<div class="bx-vote-popup-error-block">'+s+"</div>";this.popup.adjustPosition({forceBindPosition:true})},showPopup:function(){return new Promise((t=>{var e=this.getPopup();e.show();e.setAngle({position:"bottom"});e.adjustPosition({forceBindPosition:true});t(e)}))},getPopup:function(){if(this.popup){return this.popup}this.popup=new e.PopupWindow("bx-vote-popup-cont-"+this.id,this.node,{lightShadow:true,offsetTop:-2,offsetLeft:3,autoHide:true,closeByEsc:true,cacheable:false,bindOptions:{position:"top"},content:['<span class="bx-ilike-wrap-block" style="display: none;">'+'<span class="bx-ilike-popup"><span class="bx-ilike-bottom_scroll"></span></span>'+"</span>",'<span class="bx-ilike-wait"></span>'].join(""),events:{onFirstShow:()=>{this.send();e.bind(this.popup.contentContainer.querySelector(".bx-ilike-popup"),"scroll",this.popupScrollCheck)},onClose:()=>{this.popup=null}}});return this.popup},popupScrollCheck:function(){var t=this.popup?this.popup.contentContainer:null;if(t===null){return}var e=t.querySelector(".bx-ilike-popup");if(e.scrollTop>(e.scrollHeight-e.offsetHeight)/1.5||t.offsetHeight>e.offsetHeight){this.send()}},send:function(){if(this.status!=="ready"){if(this.status==="busy"){this.queue.push(this.send.bind(this))}else if(this.status==="done"){this.finalize()}return}this.status="busy";e.ajax({url:e.util.add_url_param(this.url,{action:"getVoted",attachId:this.attachId,answerId:this.answerId}),method:"POST",dataType:"json",data:{iNumPage:++this.iNumPage,nameTemplate:this.nameTemplate,sessid:e.bitrix_sessid()},onsuccess:function(t){if(t&&t.status==="success"){t=t.data;this.buildVoters(t.items);this.data=this.data.concat(t.items);if(t["statusPage"]==="done"||t.items.length<=0){this.status="done";this.finalize()}else{this.status="ready";var e=this.queue.shift();if(e){e.call(this)}}}else{this.status="error";this.makeError(t.errors);this.finalize()}}.bind(this),onfailure:function(){this.status="error";this.makeError();this.finalize()}.bind(this)})},finalize:function(){this.queue=[];var t=this.popup?this.popup.getPopupContainer():null;if(t===null){return}t.querySelector(".bx-ilike-wait").style.display="none";e.unbind(t.querySelector(".bx-ilike-popup"),"scroll",this.popupScrollCheck)}};return t}()})(window);
3278/* End */
3279;
3280; /* Start:"a:4:{s:4:"full";s:91:"/bitrix/components/bitrix/voting.vote.edit/templates/.default/script.min.js?166624707312569";s:6:"source";s:71:"/bitrix/components/bitrix/voting.vote.edit/templates/.default/script.js";s:3:"min";s:75:"/bitrix/components/bitrix/voting.vote.edit/templates/.default/script.min.js";s:3:"map";s:75:"/bitrix/components/bitrix/voting.vote.edit/templates/.default/script.map.js";}"*/
3281(function(){if(window.BVoteConstructor)return;BX.addCustomEvent("onClickMulti",(function(t){var e=BX.findChildren(t.parentNode.previousSibling,{attribute:{"data-bx-answer-field":"field-type"}},true);for(var i=0;i<e.length;i++){e[i].value=t.checked?"1":"0"}}));var t=function(t){this.map=new Map;this.maxSort=0;this.currentId=0;t=t||{};this.maxCount=parseInt(t["maxCount"]||0);this.onEntityHasBeenDeleted=this.onEntityHasBeenDeleted.bind(this)};t.prototype={set:function(t,e){this.map.set(t,e);BX.addCustomEvent(e,"onEntityHasBeenDeleted",this.onEntityHasBeenDeleted);this.maxSort=Math.max(this.maxSort,e.getSort());this.currentId++}
3281,get:function(t){return this.map.get(t)},keys:function(){return this.map.keys()},delete:function(t){return this.map.delete(t)},onEntityHasBeenDeleted:function(t,e,i){this.delete(t);if(this.maxSort===parseInt(e)){var s=0;this.map.forEach((function(t){s=Math.max(s,parseInt(t.getSort()))}));this.maxSort=s}},getNextId:function(){return this.currentId},getMaxSort:function(){return this.maxSort},canAdd:function(){return!(this.maxCount>0&&this.maxCount<=this.map.size)}};var e=function(t,i){this.id=[i["groupId"]||"vote",t.getAttribute("data-bx-number").toString()];this.eventObject=i["eventObject"];this.nodes={main:t,sort:null};this.delete=this.delete.bind(this);this.__sortDD=this.__sortDD.bind(this);this.onbxdragstart=this.onbxdragstart.bind(this);this.onbxdragstop=this.onbxdragstop.bind(this);this.onbxdrag=this.onbxdrag.bind(this);this.onbxdraghout=this.onbxdraghout.bind(this);this.onbxdestdraghover=this.onbxdestdraghover.bind(this);this.onbxdestdraghout=this.onbxdestdraghout.bind(this);this.onbxdestdragfinish=this.onbxdestdragfinish.bind(this);BX.addCustomEvent(this.eventObject,"onEntityHasBeenSorted",this.__sortDD);this.init(i);e.repo.set(this.id,this)};e.repo=new Map;e.getByFullId=function(t){return e.repo.get(t)};e.deleteByFullId=function(t){return e.repo.delete(t)};e.prototype={init:function(t){},bind:function(t){var e,i,s;if(BX(t)){e=BX.findChildren(t,{attribute:"data-bx-action"},true);if(t.hasAttribute("data-bx-action")){e.unshift(t)}}else{e=BX.findChildren(this.nodes.main,{attribute:"data-bx-action"},true)}for(i=0;i<e.length;i++){if(!e[i].hasAttribute("data-bx-bo und")){s="__"+e[i].getAttribute("data-bx-action");if(typeof this[s]==="function"){e[i].setAttribute("data-bx-bound","Y");BX.bind(e[i],"click",this[s].bind(this))}}}this.nodes.main["entityId"]=this.getFullId()},initDD:function(){if(window["jsDD"]&&!this.nodes.main.hasAttribute("data-bx-drag-sensitive")){var t=BX.findChildren(this.nodes.main,{attribute:"data-bx-action"},true),e;for(e=0;e<t.length;e++){if(t[e].getAttribute("data-bx-action")==="sortDD"&&!t[e].hasAttribute("data-bx-bound-dd")&&t[e].getAttribute("data-bx-bound")==="Y"){BX.unbindAll(t[e],"click");this.nodes.dd=t[e];this.nodes.dd.setAttribute("data-bx-bound-dd","Y");this.nodes.dd["entityId"]=this.getFullId();BX.addClass(this.nodes.dd,"bx-drag-draggable");this.nodes.main.hasAttribute("data-bx-drag-sensitive","Y");BX.addClass(this.nodes.main,"bx-drag-drag-sensitive");window.jsDD.registerObject(this.nodes.dd);this.nodes.dd.onbxdragstart=this.onbxdragstart;this.nodes.dd.onbxdragstop=this.onbxdragstop;this.nodes.dd.onbxdrag=this.onbxdrag;this.nodes.dd.onbxdraghout=this.onbxdraghout;window.jsDD.registerDest(this.nodes.main);this.nodes.main.onbxdestdraghover=this.onbxdestdraghover;this.nodes.main.onbxdestdraghout=this.onbxdestdraghout;this.nodes.main.onbxdestdragfinish=this.onbxdestdragfinish;var i=BX.findChild(this.nodes.main,{tagName:"INPUT",props:{type:"text"}},true,true);for(e=0;e<=i.length;e++){BX.bind(i[e],"mousedown",BX.eventCancelBubble)}}}}},getSort:function(){if(!this.__sort)this.__sort=parseInt(this.nodes["sort"].value);return this.__sort},setSort:function(t){this.__sort=this.nodes["sort"].value=parseInt(t)},__sortDD:function(t,e,i,s){if(BX.type.isInteger(t)&&i.getGroupId()===this.getGroupId()){if(this===i){this.setSort(e)}else if(t>e){if(e<=this.getSort()&&this.getSort()<=t){this.setSort(this.getSort()+10)}}else if(t<e){if(t<this.getSort()&&this.getSort()<=e){this.setSort(this.getSort()-10)}}}},__sortDown:function(){if(this.nodes.main.nextSibling&&this.nodes.main.nextSibling["entityId"]){var t=e.getByFullId(this.nodes.main.nextSibling["entityId"]);this.nodes.main.parentNode.insertBefore(this.nodes.main.nextSibling,this.nodes.main);BX.onCustomEvent(this.eventObject,"onEntityHasBeenSorted",[this.getSort(),t.getSort(),this,t])}},__sortUp:function(){if(this.nodes.main.previousSibling&&this.nodes.main.previousSibling["entityId"]){var t=e.getByFullId(this.nodes.main.previousSibling["entityId"]);this.nodes.main.parentNode.insertBefore(this.nodes.main,this.nodes.main.previousSibling);BX.onCustomEvent(this.eventObject,"onEntityHasBeenSorted",[this.get
3281Sort(),t.getSort(),this,t])}},getFullId:function(t){return t===true?this.id.join("_"):this.id},getId:function(){return this.id[1]},getGroupId:function(){return this.id[0]},delete:function(){var t=[],i,s=this.getSort();for(i in this.nodes){if(this.nodes.hasOwnProperty(i)){t.push(i)}}for(i=0;i<=t.length;i++){if(this.nodes.hasOwnProperty(t[i])){this.nodes[t[i]]=null;delete this.nodes[t[i]]}}e.deleteByFullId(this.getFullId());BX.onCustomEvent(this,"onEntityHasBeenDeleted",[this.getFullId(),s,this])},onbxdragstart:function(){var t=BX.create("DIV",{attrs:{className:"bx-drag-object"},style:{position:"absolute",zIndex:10,width:this.nodes.main.parentNode.clientWidth+"px"},html:this.nodes.main.outerHTML.replace(new RegExp(this.nodes.main.getAttribute("id"),"gi"),"DragCopy")});this.nodes.drag=t;this.nodes.dd["entitySort"]=this.getSort();this.dragPos={main:BX.pos(this.nodes.main),parent:BX.pos(this.nodes.main.parentNode)};document.body.appendChild(this.nodes.drag);BX.addClass(this.nodes.main,"bx-drag-source");t=null},onbxdragstop:function(){if(this.dragPos){BX.removeClass(this.nodes.main,"bx-drag-source");this.nodes.drag.parentNode.removeChild(this.nodes.drag);this.nodes.drag=null;delete this.nodes.drag;delete this.dragPos}return true},onbxdrag:function(t,e){if(this.nodes.drag){if(this.dragPos){if(!this.dragPos.main.deltaX)this.dragPos.main.deltaX=this.dragPos.main.left-t;if(!this.dragPos.main.deltaY)this.dragPos.main.deltaY=this.dragPos.main.top-e;t+=this.dragPos.main.deltaX;e+=this.dragPos.main.deltaY;e=Math.min(Math.max(e,this.dragPos.parent.top),this.dragPos.parent.bottom)}this.nodes.drag.style.left=t+"px";this.nodes.drag.style.top=e+"px"}},onbxdraghout:function(){},onbxdestdraghover:function(t){if(this.nodes.dd!==t){var e=parseInt(t["entitySort"]);if(this.getSort()<e)BX.addClass(this.nodes.main,"bx-drag-over-up");else BX.addClass(this.nodes.main,"bx-drag-over-down")}},onbxdestdraghout:function(){BX.removeClass(this.nodes.main,"bx-drag-over-up");BX.removeClass(this.nodes.main,"bx-drag-over-down")},onbxdestdragfinish:function(t){BX.removeClass(this.nodes.main,"bx-drag-over-up");BX.removeClass(this.nodes.main,"bx-drag-over-down");if(this.nodes.dd!==t){var i=e.getByFullId(t["entityId"]);if(i.getGroupId()===this.getGroupId()){var s=parseInt(t["entitySort"]);if(this.getSort()<s){this.nodes.main.parentNode.insertBefore(i.nodes.main,this.nodes.main);BX.onCustomEvent(this.eventObject,"onEntityHasBeenSorted",[i.getSort(),this.getSort(),i,this])}else{if(this.nodes.main.nextSibling)this.nodes.main.parentNode.insertBefore(i.nodes.main,this.nodes.main.nextSibling);else this.nodes.main.parentNode.appendChild(i.nodes.main);BX.onCustomEvent(this.eventObject,"onEntityHasBeenSorted",[i.getSort(),this.getSort(),i,this])}}}}};var i=function(e,s){this.answers=new t({maxCount:s["maxAnswersCount"]});this.visibleId=0;i.superclass.constructor.apply(this,arguments);this.nodes.sort=BX.findChild(this.nodes["main"],{attribute:{"data-bx-question-field":"C_SORT"}},true)};BX.extend(i,e);i.prototype.init=function(t){this.nodes.answerList=BX.findChild(this.nodes.main,{attribute:{"data-bx-role":"answer-list"}},true);var e=BX.findChild(this.nodes.answerList,{tagName:"LI",attribute:{"data-bx-role":"answer"}},false,true),i,n;for(i=0;i<e.length;i++){n=new s(e[i],{eventObject:t["eventObject"],groupId:this.getId()});this.answers.set(n.getId(),n);this.visibleId++}this.bind();this.initDD();this.addAnswer=this.addAnswer.bind(this);this.toggleAddNode=this.toggleAddNode.bind(this);this.toggleAddNode(null,null);BX.addCustomEvent(this.eventObject,"onAnswerHasBeenAdded",this.toggleAddNode);BX.addCustomEvent(this.eventObject,"onAnswerHasBeenDeleted",this.toggleAddNode)};i.prototype.toggleAddNode=function(t,e){if(e===null||e.getGroupId()===this.getId()){var i=BX.findChild(this.nodes["main"],{attribute:{"data-bx-action":"adda"}},true,true),s;for(s=0;s<i.length;s++){BX.unbind(i[s],"focus",this.addAnswer)}if(this.answers.canAdd()){BX.bind(i[i.length-1],"focus",this.addAnswer)}}};i.prototype.addAnswer=function(){var t=this.answers.getNextId(),e={"#Q#":this.getId(),"#A#":t,"#A_FIELD_TYPE#":BX("multi_"+this.getId())&&BX("multi_"+this.getId()).checked?"1":"0","#A_VALUE#":"","#A_C_SORT#":this.answers.getMaxSort()+10,"#A_PH#":++this.visibleId},i=BX.message("VOTE_TEMPLATE_ANSWER"),n;for(n in e){if(e.hasOwnProperty(n)){i=i.replace(new RegExp(n,"gi"),e[n])}}var d=BX.create("DIV",{html:i}).firstChild;this.nodes.answerList.appendChild(d);var o=new s(d,{eventObject:this.eventObject,groupId:this.getId()});this.bind(d);this.initDD(d);this.answers.set(o.getId(),o);BX.onCustomEvent(this.eventObject,"onAnswerHasBeenAdded",[o.getFullId(),o])};i.prototype.__delq=function(){var t=BX.findChild(this.nodes.main,{attribute:{"data-bx-question-field":"MESSAGE"}},true);
3281if(!t||t.value===""||confirm(BX.message("VVE_QUESTION_DELETE"))){var e=this.answers.keys(),i=e.next();t=this.nodes.main;while(!i.done){this.answers.get(i.value).delete();i=e.next()}this.delete();t.parentNode.removeChild(t);BX.onCustomEvent(this.eventObject,"onQuestionHasBeenDeleted",[this.getFullId(),this])}};var s=function(t,e){s.superclass.constructor.apply(this,arguments);this.nodes.sort=BX.findChild(this.nodes["main"],{attribute:{"data-bx-answer-field":"C_SORT"}},true)};BX.extend(s,e);s.prototype.init=function(t){this.bind();this.initDD(this.nodes.main)};s.prototype.__dela=function(t){var e=BX.findChild(this.nodes.main,{attribute:{"data-bx-answer-field":"MESSAGE"}},true),i;if(!e||e.value===""||confirm(BX.message("VVE_ANS_DELETE"))){e=this.nodes.main;this.delete();e.parentNode.removeChild(e);BX.onCustomEvent(this.eventObject,"onAnswerHasBeenDeleted",[this.getFullId(),this])}};top.BVoteConstructor=window.BVoteConstructor=function(e){this.controller=e.controller;this.questions=new t({maxCount:e["maxQ"]});this.nodes={questionList:BX.findChild(this.controller,{attribute:{"data-bx-role":"question-list"}},true),action:BX.findChild(this.controller,{attribute:{"data-bx-action":"addq"}},true)};this.toggleAddNode=this.toggleAddNode.bind(this);this.visibleId=0;this.maxAnswersCount=e["maxA"];this.init(e)};window.BVoteConstructor.prototype.init=function(){var t=BX.findChild(this.controller,{tagName:"LI",attribute:{"data-bx-role":"question"}},true,true),e,s;for(e=0;e<t.length;e++){s=new i(t[e],{eventObject:this,maxAnswersCount:this.maxAnswersCount});this.questions.set(s.getId(),s)}this.toggleAddNode();BX.addCustomEvent(this,"onQuestionHasBeenAdded",this.toggleAddNode);BX.addCustomEvent(this,"onQuestionHasBeenDeleted",this.toggleAddNode);BX.bind(this.nodes.action,"click",this.addq.bind(this))};window.BVoteConstructor.prototype.toggleAddNode=function(){if(!this.questions.canAdd()){this.nodes.action.style.display="none"}else if(this.nodes.action.style.display==="none"){delete this.nodes.action.style.display}};window.BVoteConstructor.prototype.addq=function(t){BX.PreventDefault(t);if(this.questions.canAdd()){var e=BX.message("VOTE_TEMPLATE_ANSWER").replace(/#A#/gi,0).replace(/#A_PH#/gi,1).replace(/#A_FIELD_TYPE#/gi,"0").replace(/#A_C_SORT#/gi,"10").replace(/#A_VALUE#/gi,"")+BX.message("VOTE_TEMPLATE_ANSWER").replace(/#A#/gi,1).replace(/#A_PH#/gi,2).replace(/#A_FIELD_TYPE#/gi,"0").replace(/#A_C_SORT#/gi,"20").replace(/#A_VALUE#/gi,"");e=BX.create("DIV",{html:BX.message("VOTE_TEMPLATE_QUESTION").replace(/#ANSWERS#/gi,e).replace(/#Q#/gi,this.questions.getNextId()).replace(/#Q_C_SORT#/gi,this.questions.getMaxSort()+10).replace(/#Q_PH#/gi,++this.visibleId).replace(/#Q_VALUE#/gi,"").replace(/#Q_MULTY#/gi,"")});var s=new i(e.firstChild,{eventObject:this,maxAnswersCount:this.maxAnswersCount});s.visibleId=2;this.questions.set(s.getId(),s);this.nodes.questionList.appendChild(e.firstChild);BX.onCustomEvent(this,"onQuestionHasBeenAdded",[s.getFullId(),s])}}})();
3282/* End */
3283;
3284; /* Start:"a:4:{s:4:"full";s:119:"/local/templates/voenchast/components/bitrix/socialnetwork.blog.post/with_hidden_comments/script.min.js?166624702418229";s:6:"source";s:99:"/local/templates/voenchast/components/bitrix/socialnetwork.blog.post/with_hidden_comments/script.js";s:3:"min";s:103:"/local/templates/voenchast/components/bitrix/socialnetwork.blog.post/with_hidden_comments/script.min.js";s:3:"map";s:103:"/local/templates/voenchast/components/bitrix/socialnetwork.blog.post/with_hidden_comments/script.map.js";}"*/
3285function showHiddenDestination(t,e){BX.hide(e);BX("blog-destination-hidden-"+t).style.display="inline"}function showMenuLinkInput(t,e){id="post-menu-"+t+"-link",it=BX.proxy_context,height=parseInt(!!it.getAttribute("bx-height")?it.getAttribute("bx-height"):it.offsetHeight);if(it.getAttribute("bx-status")!="shown"){it.setAttribute("bx-status","shown");if(!BX(id)&&!!BX(id+"-text")){var i=BX(id+"-text"),o=BX.pos(i),s=BX.pos(i.parentNode);pos3=BX.pos(BX.findParent(i,{className:"menu-popup-item"},true));o["height"]=s["height"]-1;BX.adjust(it,{attrs:{"bx-height":it.offsetHeight},style:{overflow:"hidden",display:"block"},children:[BX.create("BR"),BX.create("DIV",{attrs:{id:id},children:[BX.create("SPAN",{attrs:{className:"menu-popup-item-left"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-icon"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-text"},children:[BX.create("INPUT",{attrs:{id:id+"-input",type:"text",value:e},style:{height:o["height"]+"px",width:pos3["width"]-21+"px"},events:{click:function(t){this.select();BX.PreventDefault(t)}}})]})]}),BX.create("SPAN",{className:"menu-popup-item-right"})]})}new BX.fx({time:.2,step:.05,type:"linear",start:height,finish:height*2,callback:BX.delegate(function(t){this.style.height=t+"px"},it)}).start();BX.fx.show(BX(id),.2);BX(id+"-input").select()}else{it.setAttribute("bx-status","hidden");new BX.fx({time:.2,step:.05,type:"linear",start:it.offsetHeight,finish:height,callback:BX.delegate(function(t){this.style.height=t+"px"},it)}).start();BX.fx.hide(BX(id),.2)}}function showBlogPost(t,e){var i=BX.findChild(BX("blg-post-"+t),{className:"feed-post-text-block-inner"},true,false);el2=BX.findChild(BX("blg-post-"+t),{className:"feed-post-text-block-inner-inner"},true,false);BX.remove(e);
3285if(i){var o=300;var s=el2.offsetHeight;new BX.fx({time:1*(s-o)/(1200-o),step:.05,type:"linear",start:o,finish:s,callback:BX.delegate(__blogExpandSetHeight,i),callback_complete:BX.delegate(function(){this.style.maxHeight="none";BX.LazyLoad.showImages(true)},i)}).start()}}function __blogExpandSetHeight(t){this.style.maxHeight=t+"px"}function deleteBlogPost(t){url=BX.message("sonetBPDeletePath");url1=url.replace("#del_post_id#",t);if(BX.findChild(BX("blg-post-"+t),{attr:{id:"form_c_del"}},true,false)){BX.hide(BX("form_c_del"));BX(BX("blg-post-"+t).parentNode.parentNode).appendChild(BX("form_c_del"))}BX.ajax.get(url1,function(e){if(window.deletePostEr&&window.deletePostEr=="Y"){var i=BX("blg-post-"+t);BX.findChild(i,{className:"feed-post-cont-wrap"},true,false).insertBefore(BX.create("SPAN",{html:e}),BX.findChild(i,{className:"feed-user-avatar"},true,false))}else{BX("blg-post-"+t).parentNode.innerHTML=e}});return false}var waitPopupBlogImage=null;function blogShowImagePopup(t){if(!waitPopupBlogImage){waitPopupBlogImage=new BX.PopupWindow("blogwaitPopupBlogImage",window,{autoHide:true,lightShadow:false,zIndex:2,content:BX.create("IMG",{props:{src:t,id:"blgimgppp"}}),closeByEsc:true,closeIcon:true})}else{BX("blgimgppp").src="/bitrix/images/1.gif";BX("blgimgppp").src=t}waitPopupBlogImage.setOffset({offsetTop:0,offsetLeft:0});setTimeout(function(){waitPopupBlogImage.adjustPosition()},100);waitPopupBlogImage.show()}function __blogPostSetFollow(t){var e=BX("log_entry_follow_"+t,true).getAttribute("data-follow")=="Y"?"Y":"N";var i=e=="Y"?"N":"Y";if(BX("log_entry_follow_"+t,true)){BX.findChild(BX("log_entry_follow_"+t,true),{tagName:"a"}).innerHTML=BX.message("sonetBPFollow"+i);BX("log_entry_follow_"+t,true).setAttribute("data-follow",i)}BX.ajax({url:BX.message("sonetBPSetPath"),method:"POST",dataType:"json",data:{log_id:t,action:"change_follow",follow:i,sessid:BX.bitrix_sessid(),site:BX.message("sonetBPSiteId")},onsuccess:function(i){if(i["SUCCESS"]!="Y"&&BX("log_entry_follow_"+t,true)){BX.findChild(BX("log_entry_follow_"+t,true),{tagName:"a"}).innerHTML=BX.message("sonetBPFollow"+e);BX("log_entry_follow_"+t,true).setAttribute("data-follow",e)}},onfailure:function(i){if(BX("log_entry_follow_"+t,true)){BX.findChild(BX("log_entry_follow_"+t,true),{tagName:"a"}).innerHTML=BX.message("sonetBPFollow"+e);BX("log_entry_follow_"+t,true).setAttribute("data-follow",e)}}});return false}(function(){if(!!window.SBPImpPost)return false;window.SBPImpPost=function(t){if(t.getAttribute("sbpimppost")=="Y")return false;this.CID="sbpimppost"+(new Date).getTime();this.busy=false;this.node=t;this.btn=t.parentNode;this.block=t.parentNode.parentNode;this.postId=t.getAttribute("bx-blog-post-id");t.setAttribute("sbpimppost","Y");BX.onCustomEvent(this.node,"onInit",[this]);if(this.postId>0)this.onclick();return false};window.SBPImpPost.prototype.onclick=function(){this.sendData()};window.SBPImpPost.prototype.showClick=function(){var t=this.btn.offsetWidth,e=BX.message("BLOG_ALREADY_READ"),i=BX.create("span",{props:{className:"have-read-text-block"},html:"<i></i>"+e+'<span class="feed-imp-post-footer-comma">,</span>'});this.block.style.minWidth=this.btn.offsetWidth-27+"px";var o=new BX.easing({duration:250,start:{width:t},finish:{width:1},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:BX.delegate(function(t){this.btn.style.width=t.width+"px"},this),complete:BX.delegate(function(){this.btn.innerHTML="";this.btn.appendChild(i);var t=i.offsetWidth,e=new BX.easing({duration:300,start:{width_2:0},finish:{width_2:t},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:BX.delegate(function(t){this.btn.style.width=t.width_2+"px"},this)});e.animate()},this)});o.animate()};window.SBPImpPost.prototype.wait=function(t){t=t=="show"?"show":"hide";if(t=="show"){this.node.disabled=true;BX.adjust(this.node,{style:{position:"relative"},children:[BX.create("DIV",{attrs:{className:"mpf-load-img","mpf-load-img":"Y"},style:{position:"absolute",top:0,left:0,width:"100%"}})]})}else{if(!!this.node.lastChild&&this.node.lastChild.hasAttribute("mpf-load-img")){BX.remove(this.node.lastChild)}}};window.SBPImpPost.prototype.sendData=function(){if(this.busy)return false;this.busy=true;window["node"]=this.node;window["obj"]=this;this.wait("show");var t={options:[{post_id:this.postId,name:"BLOG_POST_IMPRTNT",value:"Y"}],sessid:BX.bitrix_sessid()},e=this.node.href;BX.onCustomEvent(this.node,"onSend",[t]);t=BX.ajax.prepareData(t);
3285if(t){e+=(e.indexOf("?")!==-1?"&":"?")+t;t=""}BX.ajax({method:"GET",url:e,dataType:"json",onsuccess:BX.delegate(function(t){this.busy=false;this.wait("hide");this.showClick();BX.onCustomEvent(this.node,"onUserVote",[t]);BX.onCustomEvent("onImportantPostRead",[this.postId,this.CID])},this),onfailure:BX.delegate(function(t){this.busy=false;this.wait("hide")},this)})};top.SBPImpPostCounter=function(t,e,i){this.parentNode=t;this.node=BX.findChild(t,{tagName:"A"});if(!this.node)return false;BX.addCustomEvent(this.node,"onUserVote",BX.delegate(function(t){this.change(t)},this));this.parentNode.SBPImpPostCounter=this;this.node.setAttribute("status","ready");this.node.setAttribute("inumpage",0);this.postId=e;this.popup=null;this.data=[];BX.bind(t,"click",BX.proxy(function(){this.get()},this));BX.bind(t,"mouseover",BX.proxy(function(t){this.init(t)},this));BX.bind(t,"mouseout",BX.proxy(function(t){this.init(t)},this));this.pathToUser=i["pathToUser"];this.nameTemplate=i["nameTemplate"];this.onPullEvent=BX.delegate(function(t,e){if(t=="read"&&!!e&&e["POST_ID"]==this.postId){if(!!e["data"]){this.change(e["data"])}}},this);BX.addCustomEvent("onPullEvent-socialnetwork",this.onPullEvent)};top.SBPImpPostCounter.prototype.click=function(t){t.uController=this;BX.addCustomEvent(t.node,"onUserVote",BX.proxy(this.change,this));BX.addCustomEvent(t.node,"onSend",BX.proxy(function(t){t["PATH_TO_USER"]=this.pathToUser;t["NAME_TEMPLATE"]=this.nameTemplate;t["iNumPage"]=0;t["ID"]=this.postId;t["post_id"]=this.postId;t["name"]="BLOG_POST_IMPRTNT";t["value"]="Y";t["return"]="users"},this));this.btnObj=t};top.SBPImpPostCounter.prototype.change=function(t){if(!!t&&!!t.items){var e=false;this.data=[];for(var i in t.items){if(t.items.hasOwnProperty(i)){this.data.push(t.items[i])}}if(t["StatusPage"]=="done")this.node.setAttribute("inumpage","done");else this.node.setAttribute("inumpage",1);BX.adjust(this.parentNode,{style:{display:"inline-block"}})}else{this.node.setAttribute("inumpage","done");BX.hide(this.parentNode)}this.node.firstChild.innerHTML=t["RecordCount"]};top.SBPImpPostCounter.prototype.init=function(t){if(!!this.node.timeoutOver){clearTimeout(this.node.timeoutOver);this.node.timeoutOver=false}if(t.type=="mouseover"){if(!this.node.mouseoverFunc){this.node.mouseoverFunc=BX.delegate(function(){this.get();if(this.popup){BX.bind(this.popup.popupContainer,"mouseout",BX.proxy(function(){this.popup.timeoutOut=setTimeout(BX.proxy(function(){if(!!this.popup){this.popup.close()}},this),400)},this));BX.bind(this.popup.popupContainer,"mouseover",BX.proxy(function(){if(this.popup.timeoutOut)clearTimeout(this.popup.timeoutOut)},this))}},this)}this.node.timeoutOver=setTimeout(this.node.mouseoverFunc,400)}};top.SBPImpPostCounter.prototype.get=function(){if(this.node.getAttribute("inumpage")!="done")this.node.setAttribute("inumpage",parseInt(this.node.getAttribute("inumpage"))+1);this.show();if(this.data.length>0){this.make(this.node.getAttribute("inumpage")!="done")}if(this.node.getAttribute("inumpage")!="done"){this.node.setAttribute("status","busy");BX.ajax({url:"/bitrix/components/bitrix/socialnetwork.blog.blog/users.php",method:"POST",dataType:"json",data:{ID:this.postId,post_id:this.postId,name:"BLOG_POST_IMPRTNT",value:"Y",iNumPage:this.node.getAttribute("inumpage"),PATH_TO_USER:this.pathToUser,NAME_TEMPLATE:this.nameTemplate,sessid:BX.bitrix_sessid()},onsuccess:BX.proxy(function(t){if(!!t&&!!t.items){var e=false;for(var i in t.items){this.data.push(t.items[i])}if(t.StatusPage=="done")this.node.setAttribute("inumpage","done");this.make(this.node.getAttribute("inumpage")!="done")}else{this.node.setAttribute("inumpage","done")}this.node.firstChild.innerHTML=t["RecordCount"];this.node.setAttribute("status","ready")},this),onfailure:BX.proxy(function(t){this.node.setAttribute("status","ready")},this)})}};top.SBPImpPostCounter.prototype.show=function(){if(this.popup!=null)this.popup.close();if(this.popup==null){this.popup=new BX.PopupWindow("bx-vote-popup-cont-"+this.postId,this.node,{lightShadow:true,offsetTop:-2,offsetLeft:3,autoHide:true,closeByEsc:true,bindOptions:{position:"top"},events:{onPopupClose:function(){this.destroy()},onPopupDestroy:BX.proxy(function(){this.popup=null},this)},content:BX.create("SPAN",{props:{className:"bx-ilike-wait"}})});this.popup.isNew=true;this.popup.show()}this.popup.setAngle({position:"bottom"});this.popup.bindOptions.forceBindPosition=true;this.popup.adjustPosition();this.popup.bindOptions.forceBindPosition=false};top.SBPImpPostCounter.prototype.make=function(t){if(!this.popup)return true;t=t!==false;var e=this.popup&&this.popup.contentContainer?this.popup.contentContainer:BX("popup-window-content-bx-vote-popup-cont-"+this.postId),i=false,o=false,s=this.data;if(this.popup.isNew){i=BX.create("SPAN",{props:{className:"bx-ilike-popup"},children:[BX.create("SPAN",{props:{className:"bx-ilike-bottom_scroll"}})]});o=BX.create("SPAN",{props:{className:"bx-ilike-wrap-block"},children:[i]})}else{i=BX.findChild(this.popup.contentContainer,{className:"bx-ilike-popup"},true)}if(!!i){var n=null;for(var a in s){if(s.hasOwnProperty(a)){if(!BX.findChild(i,{tag:"A",attr:{id:"u"+s[a]["ID"]}},true)){if(s[a]["PHOTO_SRC"].length>0){n=BX.create("IMG",{attrs:{src:s[a]["PHOTO_SRC"]},props:{className:"bx-ilike-popup-avatar-img"}})}else{n=BX.create("IMG",{attrs:{src:"/bitrix/images/main/blank.gif"},props:{className:"bx-ilike-popup-avatar-img bx-ilike-popup-avatar-img-default"}})}i.appendChild(BX.create("A",{attrs:{id:"u"+s[a]["ID"]},props:{href:s[a]["URL"],target:"_blank",className:"bx-ilike-popup-img"+(!!s[a]["TYPE"]?" bx-ilike-popup-img-"+s[a]["TYPE"]:"")},text:"",children:[BX.create("SPAN",{props:{className:"bx-ilike-popup-avatar-new"},children:[n,BX.create("SPAN",{props:{className:"bx-ilike-popup-avatar-status-icon"}})]}),BX.create("SPAN",{props:{className:"bx-ilike-popup-name-new"},html:s[a]["FULL_NAME"]})]}))}}}if(t){BX.bind(i,"scroll",BX.delegate(this.popupScrollCheck,this))}}if(this.popup.isNew){this.popup.isNew=false;if(!!e){try{e.removeChild(e.firstChild)}catch(p){}e.appendChild(o)}}if(this.popup!=null){this.popup.bindOptions.forceBindPosition=true;this.popup.adjustPosition();this.popup.bindOptions.forceBindPosition=false}};top.SBPImpPostCounter.prototype.popupScrollCheck=function(){var t=BX.proxy_context;if(t.scrollTop>(t.scrollHeight-t.offsetHeight)/1.5){BX.unbind(t,"scroll",BX.delegate(this.popupScrollCheck,this));this.get()}}})(window);
3285window.BXfpdPostSelectCallback=function(t,e,i){BX.SocNetLogDestination.BXfpSelectCallback({item:t,type:e,bUndeleted:false,containerInput:BX("feed-add-post-destination-item-post"),valueInput:BX("feed-add-post-destination-input-post"),formName:BXSocNetLogDestinationFormNamePost,tagInputName:"bx-destination-tag-post",tagLink1:BX.message("BX_FPD_LINK_1"),tagLink2:BX.message("BX_FPD_LINK_2")})};window.BXfpdPostClear=function(){var t=BX.findChildren(BX("feed-add-post-destination-item-post"),{className:"feed-add-post-destination"},true);if(t!=null){for(var e=0;e<t.length;e++){BX.remove(t[e])}}BX("feed-add-post-destination-input-post").value="";BX.SocNetLogDestination.BXfpSetLinkName({formName:window.BXSocNetLogDestinationFormNamePost,tagInputName:"bx-destination-tag-post",tagLink1:BX.message("BX_FPD_LINK_1"),tagLink2:BX.message("BX_FPD_LINK_2")})};window.showSharing=function(t,e){BXfpdPostClear();BX("sharePostId").value=t;BX("shareUserId").value=e;BX.SocNetLogDestination.obItemsSelected[BXSocNetLogDestinationFormNamePost]={};if(window["postDest"+t]){for(var i=0;i<window["postDest"+t].length;i++){if(BX.SocNetLogDestination.obItemsSelected[BXSocNetLogDestinationFormNamePost]){BX.SocNetLogDestination.obItemsSelected[BXSocNetLogDestinationFormNamePost][window["postDest"+t][i].id]=window["postDest"+t][i].type}if(!BX.SocNetLogDestination.obItems[BXSocNetLogDestinationFormNamePost][window["postDest"+t][i].type][window["postDest"+t][i].id]){BX.SocNetLogDestination.obItems[BXSocNetLogDestinationFormNamePost][window["postDest"+t][i].type][window["postDest"+t][i].id]={avatar:"",entityId:window["postDest"+t][i].entityId,id:window["postDest"+t][i].id,name:window["postDest"+t][i].name}}}if(BXSocNetLogDestinationFormNamePost)BX.SocNetLogDestination.reInit(BXSocNetLogDestinationFormNamePost);var o=BX.findChildren(BX("feed-add-post-destination-item-post"),{className:"feed-add-post-destination"},true);if(o!=null){for(var s=0;s<o.length;s++){BX.addClass(o[s],"feed-add-post-destination-undelete");BX.remove(o[s].lastChild)}}var n=BX("destination-sharing");if(BX("blg-post-destcont-"+t)){BX("blg-post-destcont-"+t).appendChild(n)}n.style.height=0;n.style.opacity=0;n.style.overflow="hidden";n.style.display="inline-block";new BX.easing({duration:500,start:{opacity:0,height:0},finish:{opacity:100,height:n.scrollHeight-40},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:function(t){n.style.height=t.height+"px";n.style.opacity=t.opacity/100},complete:function(){n.style.cssText="";BX.SocNetLogDestination.openDialog(BXSocNetLogDestinationFormNamePost)}}).animate()}};window.closeSharing=function(){var t=BX("destination-sharing");if(BX("sharePostSubmitButton")){BX.removeClass(BX("sharePostSubmitButton"),"feed-add-button-load")}new BX.easing({duration:500,start:{opacity:100,height:t.scrollHeight-40},finish:{opacity:0,height:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:function(e){t.style.height=e.height+"px";t.style.opacity=e.opacity/100},complete:function(){BX.hide(t)}}).animate()};window.sharingPost=function(){var t=BX("sharePostId").value;var e=BX("shareUserId").value;var i=BX("blogShare");var o=socBPDest.shareUrl.replace(/#post_id#/,t).replace(/#user_id#/,e);if(BX("sharePostSubmitButton")){BX.addClass(BX("sharePostSubmitButton"),"feed-add-button-load")}i.action=o;i.target="";var s,n="";var a=i.elements.length;var p="";for(s=0;s<a;s++){if(n!="")p="&";var d=i.elements[s];if(d.disabled)continue;switch(d.type.toLowerCase()){case"text":case"hidden":n+=p+d.name+"="+BX.util.urlencode(d.value);break;default:break}}n+="&save=Y&MODE=RECORD&AJAX_POST=Y&ENTITY_XML_ID=BLOG_"+t;var r=renderSharingPost(t);BX.ajax({method:"POST",dataType:"json",url:o,data:n,onsuccess:function(e){if(typeof e=="undefined"||typeof e.status=="undefined"||e.status!="success"){hideRenderedSharingNodes(r)}else{var i=e;BX.onCustomEvent(window,"OnUCAfterRecordAdd",["BLOG_"+t,e,i])}},onfailure:function(t){hideRenderedSharingNodes(r)}});closeSharing()};window.renderSharingPost=function(t){var e=[];var i="";var o=BX.findChildren(BX("feed-add-post-destination-item-post"),{className:"feed-add-post-destination"},true);if(o!=null){var s=BX("blog-destination-hidden-"+t);if(!s){var n=BX.findChildren(BX("blg-post-img-"+t),{className:"feed-add-post-destination-new"},true);var a=n[n.length-1]}for(var p=0;p<o.length;p++){if(!BX.hasClass(o[p],"feed-add-post-destination-undelete")){var d=BX.findChild(o[p],{className:"feed-add-post-destination-text"},false,false).innerHTML;var r=BX.findChild(o[p],{tag:"input"},false,false);var l=r.value;var u="feed-add-post-destination-new";if(BX.hasClass(o[p],"feed-add-post-destination-email")){u+=" feed-add-post-destination-new-email"}else if(BX.hasClass(o[p],"feed-add-post-destination-extranet")){u+=" feed-add-post-destination-new-extranet"}var h;if(r.name=="SPERM[SG][]")h="sonetgroups";else if(r.name=="SPERM[DR][]")h="department";else if(r.name=="SPERM[G][]")h="groups";else if(r.name=="SPERM[U][]")h="users";else if(r.name=="SPERM[UE][]")h="users";else if(r.name=="SPERM[UA][]")h="groups";if(h.length>0){window["postDest"+t].push({id:l,name:d,type:h});i="post_"+t+"_dest_"+l;e.push(i);var f=BX.create("span",{props:{id:i},children:[BX.create("span",{html:", "}),BX.create("a",{props:{className:u},href:"",html:d})]});if(s){s.appendChild(f)}else if(a){BX(a.parentNode).insertBefore(f,a.nextSibling)}}}}}return e};window.hideRenderedSharingNodes=function(t){var e=false;for(i=0;i<t.length;i++){e=t[i];if(BX(e)){BX.cleanNode(BX(e),true)}}};
3286/* End */
3287;
3288; /* Start:"a:4:{s:4:"full";s:45:"/local/js/group.left.sidebar.js?1666247023123";s:6:"source";s:31:"/local/js/group.left.sidebar.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3289BX.ready(function () {
3290
3291    var joinBtn = $(".block.color_title .jal");
3292    joinBtn.on("click", onJoinPopupShow);
3293
3294});
3295/* End */
3296;
3297; /* Start:"a:4:{s:4:"full";s:104:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/vch_blogs/script.min.js?166624702327916";s:6:"source";s:84:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/vch_blogs/script.
3297js";s:3:"min";s:88:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/vch_blogs/script.min.js";s:3:"map";s:88:"/local/templates/voenchast/components/vamba/socialnetwork.log.ex/vch_blogs/script.map.js";}"*/
3298BX.CLBlock=function(e){this.arData=[];this.arData["Subscription"]=[];this.UTPopup=null;this.createTaskPopup=null;this.entity_type=null;this.entity_id=null;this.event_id=null;this.event_id_fullset=false;this.cb_id=null;this.t_val=null;this.ind=null;this.type=null};BX.CLBlock.prototype.DataParser=function(str){str=str.replace(/^\s+|\s+$/g,"");while(str.length>0&&str.charCodeAt(0)==65279)str=str.substring(1);if(str.length<=0)return false;if(str.substring(0,1)!="{"&&str.substring(0,1)!="["&&str.substring(0,1)!="*")str='"*"';eval("arData = "+str);return arData};function __logFilterShow(){if(BX("bx_sl_filter").style.display=="none"){BX("bx_sl_filter").style.display="block";BX("bx_sl_filter_hidden").style.display="none"}else{BX("bx_sl_filter").style.display="none";BX("bx_sl_filter_hidden").style.display="block"}}if(!window.XMLHttpRequest){var XMLHttpRequest=function(){try{return new ActiveXObject("MSXML3.XMLHTTP")}catch(e){}try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("MSXML2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}var sonetLXmlHttpGet=new XMLHttpRequest;var sonetLXmlHttpSet=new XMLHttpRequest;var LBlock=new BX.CLBlock;function __logOnAjaxInsertToNode(e){var t=false;if(BX("sonet_log_more_container")){nodeTmp1=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="none";nodeTmp2.style.display="inline"}t=BX.pos(BX("sonet_log_more_container"));nodeTmp1Cap=document.body.appendChild(BX.create("div",{style:{position:"absolute",width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:1e3}}))}if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="none";nodeTmp2.style.display="inline"}t=BX.pos(BX("sonet_log_more_container"));nodeTmp2Cap=document.body.appendChild(BX.create("div",{style:{position:"absolute",width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:1e3}}))}BX.unbind(BX("sonet_log_counter_2_container"),"click",__logOnAjaxInsertToNode)}function sonetLClearContainerExternalNew(){logAjaxMode="new"}function sonetLClearContainerExternalMore(){logAjaxMode="more"}function _sonetLClearContainerExternal(e){if(BX("sonet_log_more_container")){nodeTmp1=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_more_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);if(nodeTmp1&&nodeTmp2){nodeTmp1.style.display="inline";nodeTmp2.style.display="none"}}if(BX("sonet_log_counter_2_wrap")){BX.removeClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim");BX("sonet_log_counter_2_wrap").style.visibility="hidden"}if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);nodeTmp3=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-reload"},false);
3298if(nodeTmp1&&nodeTmp2&&nodeTmp3){nodeTmp1.style.display="inline";nodeTmp2.style.display="none";nodeTmp3.style.display="none"}}if(nodeTmp1Cap&&nodeTmp1Cap.parentNode){nodeTmp1Cap.parentNode.removeChild(nodeTmp1Cap)}if(nodeTmp2Cap&&nodeTmp2Cap.parentNode){nodeTmp2Cap.parentNode.removeChild(nodeTmp2Cap)}if(BX("sonet_log_counter_preset")&&logAjaxMode=="new"){BX("sonet_log_counter_preset").style.display="none"}}function __logChangeCounter(e){var t=parseInt(e)<=0;oCounter={iCommentsRead:0};BX.onCustomEvent(window,"onSonetLogChangeCounter",[oCounter]);e-=oCounter.iCommentsRead;__logChangeCounterAnimate(parseInt(e)>0,e,t)}function __logDecrementCounter(e){if(BX("sonet_log_counter_2")){e=parseInt(e);var t=parseInt(BX("sonet_log_counter_2").innerHTML);var n=t-e;if(n>0)BX("sonet_log_counter_2").innerHTML=n;else __logChangeCounterAnimate(false,0)}}function __logChangeCounterAnimate(e,t,n){n=!!n;if(!!window.bLockCounterAnimate){setTimeout(function(){__logChangeCounterAnimate(e,t)},200);return false}e=!!e;if(e){if(BX("sonet_log_counter_2"))BX("sonet_log_counter_2").innerHTML=t;if(BX("sonet_log_counter_2_wrap")){BX("sonet_log_counter_2_wrap").style.visibility="visible";BX.addClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim")}}else if(BX("sonet_log_counter_2_wrap")){if(n&&BX.hasClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim")){if(BX("sonet_log_counter_2_container")){nodeTmp1=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text"},false);nodeTmp2=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-waiting"},false);nodeTmp3=BX.findChild(BX("sonet_log_counter_2_container"),{tag:"span",className:"feed-new-message-inf-text-reload"},false);
3298if(nodeTmp1&&nodeTmp2&&nodeTmp3){nodeTmp1.style.display="none";nodeTmp2.style.display="none";nodeTmp3.style.display="inline"}}}else setTimeout(function(){BX.removeClass(BX("sonet_log_counter_2_wrap"),"feed-new-message-informer-anim");BX("sonet_log_counter_2_wrap").style.visibility="hidden"},400)}}function __logChangeCounterArray(e){if(typeof e[BX.message("sonetLCounterType")]!="undefined")__logChangeCounter(e[BX.message("sonetLCounterType")])}function __logShowPostMenu(e,t,n,o,s,a,i,r,l,d){BX.PopupMenu.destroy("post-menu-"+t);var f=null;if(BX.message("sonetLbUseFavorites")!="N"){f={text:l?BX.message("sonetLMenuFavoritesTitleY"):BX.message("sonetLMenuFavoritesTitleN"),className:"menu-popup-no-icon",onclick:function(e){__logChangeFavorites(r,"log_entry_favorites_"+r,l?"N":"Y",true);return BX.PreventDefault(e)}}}var p=[e.getAttribute("data-log-entry-url").length>0?{text:'<span id="post-menu-'+t+'-href-text">'+BX.message("sonetLMenuHref")+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-href",href:e.getAttribute("data-log-entry-url")}:null,e.getAttribute("data-log-entry-url").length>0?{text:'<span id="post-menu-'+t+'-link-text">'+BX.message("sonetLMenuLink")+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-link",onclick:function(){id="post-menu-"+t+"-link",it=BX.proxy_context,height=parseInt(!!it.getAttribute("bx-height")?it.getAttribute("bx-height"):it.offsetHeight);if(it.getAttribute("bx-status")!="shown"){it.setAttribute("bx-status","shown");if(!BX(id)&&!!BX(id+"-text")){var n=BX(id+"-text"),o=BX.pos(n),s=BX.pos(n.parentNode);pos3=BX.pos(BX.findParent(n,{className:"menu-popup-item"},true));o["height"]=s["height"]-1;BX.adjust(it,{attrs:{"bx-height":it.offsetHeight},style:{overflow:"hidden",display:"block"},children:[BX.create("BR"),BX.create("DIV",{attrs:{id:id},children:[BX.create("SPAN",{attrs:{className:"menu-popup-item-left"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-icon"}}),BX.create("SPAN",{attrs:{className:"menu-popup-item-text"},children:[BX.create("INPUT",{attrs:{id:id+"-input",type:"text",value:e.getAttribute("data-log-entry-url")},style:{height:o["height"]+"px",width:pos3["width"]-21+"px"},events:{click:function(e){this.select();BX.PreventDefault(e)}}})]})]}),BX.create("SPAN",{className:"menu-popup-item-right"})]})}new BX.fx({time:.2,step:.05,type:"linear",start:height,finish:height*2,callback:BX.delegate(function(e){this.style.height=e+"px"},it)}).start();BX.fx.show(BX(id),.2);BX(id+"-input").select()}else{it.setAttribute("bx-status","hidden");new BX.fx({time:.2,step:.05,type:"linear",start:it.offsetHeight,finish:height,callback:BX.delegate(function(e){this.style.height=e+"px"},it)}).start();BX.fx.hide(BX(id),.2)}}}:null,f,BX.message("sonetLCanDelete")=="Y"?{text:BX.message("sonetLMenuDelete"),className:"menu-popup-no-icon",onclick:function(e){if(confirm(BX.message("sonetLMenuDeleteConfirm"))){__logDelete(r,"log-entry-"+r,t)}return BX.PreventDefault(e)}}:null];if(!!d&&BX.type.isArray(d)){for(var c=0;c<d.length;c++)if(typeof d[c].className=="undefined")d[c].className="menu-popup-no-icon";p=BX.util.array_merge(p,d)}var u={offsetLeft:-14,offsetTop:4,lightShadow:false,angle:{position:"top",offset:50},events:{onPopupShow:function(e){if(BX("log_entry_favorites_"+r)){var n=BX.findChildren(e.contentContainer,{className:"menu-popup-item-text"},true);if(n!=null){for(var o=0;o<n.length;o++){if(n[o].innerHTML==BX.message("sonetLMenuFavoritesTitleY")||n[o].innerHTML==BX.message("sonetLMenuFavoritesTitleN")){var s=n[o];break}}}if(s!=undefined){if(BX.hasClass(BX("log_entry_favorites_"+r),"feed-post-important-switch-active"))BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY");else BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}if(BX("post-menu-"+t+"-link")){var a=BX.findChild(e.popupContainer,{className:"feed-entry-popup-menu-link"},true,false);if(a){var i=parseInt(!!a.getAttribute("bx-height")?a.getAttribute("bx-height"):0);if(i>0){BX("post-menu-"+t+"-link").style.display="none";a.setAttribute("bx-status","hidden");a.style.height=i+"px"}}}}}};BX.PopupMenu.show("post-menu-"+t,e,p,u)}
3298function __logCommentFormAutogrow(e){var t=0;if(e&&BX.type.isDomNode(e))var n=e;else{var n=BX.proxy_context;var o=e||window.event;if((o.keyCode==13||o.keyCode==10)&&o.ctrlKey)__logCommentAdd()}var s=BX.findParent(n,{className:"sonet-log-comment-form-place"});if(BX(s))t=BX(s).offsetHeight;var a=0;var i=n.value.split("\n");for(var r=i.length-1;r>=0;--r)a+=Math.floor(i[r].length/CommentFormColsDefault+1);if(a>=CommentFormRowsDefault)n.rows=a+1;else n.rows=CommentFormRowsDefault}function __logGetNextPage(e,t,n){if(oLF.bLoadStarted){return false}oLF.bLoadStarted=true;window.bLockCounterAnimate=true;t=!!t;if(!t&&BX("feed-new-message-inf-wrap")){BX("feed-new-message-inf-wrap").classList.toggle("feed-new-message-anim")}var o={method:"GET",url:e};BX.onCustomEvent("SonetLogBeforeGetNextPage",[o]);if(BX.type.isNotEmptyString(o.url)){e=o.url}BX.ajax({url:e,method:"GET",dataType:"json",data:{},onsuccess:function(e){oLF.bLoadStarted=false;if(!t&&typeof n!="undefined"&&n&&n.parentNode){BX.cleanNode(n.parentNode,true)}window.bLockCounterAnimate=false;if(typeof e!="undefined"&&typeof e.PROPS!="undefined"&&typeof e.PROPS.CONTENT!="undefined"&&e.PROPS.CONTENT.length>0&&(typeof e.LAST_TS=="undefined"||parseInt(e.LAST_TS)<=0||parseInt(BX.message("sonetLFirstPageLastTS"))<=0||parseInt(e.LAST_TS)<parseInt(BX.message("sonetLFirstPageLastTS")))){var o="content_block_"+Math.floor(Math.random()*1e3);oLF.processAjaxBlock(e.PROPS,o,t);_sonetLClearContainerExternal(false);if(t){BX("feed-new-message-inf-wrap-first").style.display="block";var s=function(){if(BX(o)){BX(o).style.display="block"}BX.unbind(BX("sonet_log_more_container_first"),"click",s);BX("feed-new-message-inf-wrap-first").style.display="none";__logRecalcMoreButton()};BX.bind(BX("sonet_log_more_container_first"),"click",s)}else{setTimeout(function(){__logRecalcMoreButton()},1e3)}}},onfailure:function(e){oLF.bLoadStarted=false;if(!t&&BX("feed-new-message-inf-wrap")){BX("feed-new-message-inf-wrap").classList.toggle("feed-new-message-anim")}window.bLockCounterAnimate=false;_sonetLClearContainerExternal(false)}});return false}function __logGetNextPageLinkEntities(e,t){if(!!window.__logGetNextPageFormName&&!!e&&!!t&&!!window["UC"]&&!!window["UC"][window.__logGetNextPageFormName]&&!!window["UC"][window.__logGetNextPageFormName].linkEntity){window["UC"][window.__logGetNextPageFormName].linkEntity(e);for(var n in t){if(!!n&&!!t[n])window["UC"][window.__logGetNextPageFormName]["entitiesCorrespondence"][n]=t[n]}}}function __logRefresh(e){if(oLF.bLoadStarted){return}var t=BX("sonet_log_counter_2_wrap",true);oLF.bLoadStarted=true;if(t){var n=BX.findChild(t,{tag:"span",className:"feed-new-message-inf-text-reload"},true);if(n){n.style.display="none"}}window.bLockCounterAnimate=true;BX.ajax({url:e,method:"GET",dataType:"json",data:{},onsuccess:function(e){oLF.bLoadStarted=false;if(typeof e!="undefined"&&typeof e.PROPS!="undefined"&&typeof e.PROPS.CONTENT!="undefined"&&e.PROPS.CONTENT.length>0){window.bLockCounterAnimate=false;BX.cleanNode("log_internal_container",false);oLF.processAjaxBlock(e.PROPS);_sonetLClearContainerExternal(false);window.bStopTrackNextPage=false;if(BX("feed-new-message-inf-wrap-first")){BX("feed-new-message-inf-wrap-first").style.display="none"}if(typeof arCommentsMoreButtonID!="undefined"){arCommentsMoreButtonID=[]}if(t&&BX.hasClass(t,"feed-new-message-informer-fixed")){var n=BX("feed-up-btn-wrap",true);if(n){n.style.display="none";BX.removeClass(n,"feed-up-btn-wrap-anim")}var o=BX.GetWindowScrollPos();new BX.easing({duration:500,start:{scroll:o.scrollTop},finish:{scroll:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){window.scrollTo(0,e.scroll)},complete:function(){if(n)n.style.display="block";BX.onCustomEvent(window,"onGoUp")}}).animate()}}else{oLF.showRefreshError()}},onfailure:function(e){oLF.bLoadStarted=false;oLF.showRefreshError()}});return false}function __logChangeFavorites(e,t,n,o){if(!e||!BX(t)){return}if(!!o){var s=BX.proxy_context;if(!BX.hasClass(BX(s),"menu-popup-item-text")){s=BX.findChild(BX(s),{className:"menu-popup-item-text"},true)}}var a=BX.hasClass(BX(t),"feed-post-important-switch")?BX(t):BX.findChild(BX(t),{className:"feed-post-important-switch"});if(n!=undefined){if(n=="Y"){BX.addClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleY");
3298if(typeof s!="undefined"){BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY")}}else{BX.removeClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleN");if(typeof s!="undefined"){BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}}var i=new XMLHttpRequest;i.open("POST",BX.message("sonetLESetPath"),true);i.setRequestHeader("Content-Type","application/x-www-form-urlencoded");i.onreadystatechange=function(){if(i.readyState==4){if(i.status==200){var e=LBlock.DataParser(i.responseText);if(typeof e=="object"){if(e[0]=="*"){if(sonetLErrorDiv!=null){sonetLErrorDiv.style.display="block";sonetLErrorDiv.innerHTML=i.responseText}return}i.abort();var t="";if(e["bResult"]!=undefined&&(e["bResult"]=="Y"||e["bResult"]=="N")){if(e["bResult"]=="Y"){BX.addClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleY");if(s!=undefined)BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleY")}else{BX.removeClass(BX(a),"feed-post-important-switch-active");BX(a).title=BX.message("sonetLMenuFavoritesTitleN");if(s!=undefined)BX(s).innerHTML=BX.message("sonetLMenuFavoritesTitleN")}}}}else{}}};i.send("r="+Math.floor(Math.random()*1e3)+"&"+BX.message("sonetLSessid")+"&site="+BX.util.urlencode(BX.message("sonetLSiteId"))+"&log_id="+encodeURIComponent(e)+"&action=change_favorites")}function __logDelete(e,t,n){if(!e){return}if(!BX(t)){return}BX.ajax({url:BX.message("sonetLESetPath"),method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),site:BX.message("sonetLSiteId"),log_id:e,action:"delete"},onsuccess:function(e){if(e.bResult!=undefined&&e.bResult=="Y"){if(typeof n!="undefined"){BX.PopupMenu.destroy("post-menu-"+n)}__logDeleteSuccess(BX(t))}else{__logDeleteFailure(BX(t))}},onfailure:function(e){__logDeleteFailure(BX(t))}})}function __logDeleteSuccess(e){if(typeof e=="undefined"||!e||!BX(e)){return}new BX.fx({time:.5,step:.05,type:"linear",start:BX(e).offsetHeight,finish:60,callback:BX.delegate(function(e){this.style.height=e+"px"},BX(e)),callback_start:BX.delegate(function(){this.style.overflow="hidden";this.style.minHeight=0},BX(e)),callback_complete:BX.delegate(function(){this.style.marginBottom=0;BX.cleanNode(this);this.appendChild(BX.create("DIV",{props:{className:"feed-add-successfully"},style:{marginLeft:"17px",marginRight:"17px",marginTop:"10px"},children:[BX.create("span",{props:{className:"feed-add-info-text"},children:[BX.create("span",{props:{className:"feed-add-info-icon"}}),BX.create("span",{html:BX.message("sonetLMenuDeleteSuccess")})]})]}))},BX(e))}).start()}function __logDeleteFailure(e){if(typeof e=="undefined"||!e||!BX(e)){return}e.insertBefore(BX.create("DIV",{props:{className:"feed-add-error"},style:{marginLeft:"84px",marginRight:"37px",marginTop:"18px",marginBottom:"4px"},children:[BX.create("span",{props:{className:"feed-add-info-text"},children:[BX.create("span",{props:{className:"feed-add-info-icon"}}),BX.create("span",{html:BX.message("sonetLMenuDeleteFailure")})]})]}),e.firstChild)}function __logOnFeedScroll(){if(window.feedScrollLock==undefined||window.feedScrollLock===false){window.feedScrollLock=true;setTimeout(function(){window.feedScrollLock=false},100);var e=BX.GetWindowSize();if(window.bStopTrackNextPage===undefined||window.bStopTrackNextPage==false){var t=parseInt(e.scrollHeight/2);if(e.scrollHeight-e.innerHeight<t){t=1}if(e.scrollTop>=t&&next_url){window.bStopTrackNextPage=true;__logGetNextPage(next_url,true)}}}var n=BX("sonet_log_counter_2_wrap",true);if(n){var o=n.parentNode.getBoundingClientRect().top;if(o<=0){BX.addClass(n,"feed-new-message-informer-fixed");setTimeout(function(){if(BX.hasClass(n,"feed-new-message-informer-fixed")){BX.addClass(n,"feed-new-message-informer-fix-anim")}},100)}else{BX.removeClass(n,"feed-new-message-informer-fixed feed-new-message-informer-fix-anim")}}}function __logScrollInit(e){if(!!e){BX.unbind(window,"scroll",__logOnFeedScroll);BX.bind(window,"scroll",__logOnFeedScroll)}else{BX.unbind(window,"scroll",__logOnFeedScroll)}}function __logRecalcMoreButton(){if(typeof arMoreButtonID!="undefined"){var e=false;var t=false;var n=false;var o=false;for(var s=0;s<arMoreButtonID.length;s++){e=BX.pos(BX(arMoreButtonID[s].bodyBlockID));if(e.height<280){BX(arMoreButtonID[s].moreButtonBlockID).style.display="none"}if(typeof arMoreButtonID[s].outerBlockID!="undefined"){n=BX(arMoreButtonID[s].outerBlockID);if(n){t=BX.pos(n);if(t.width<e.width){o=BX.findChild(n,{tag:"div",className:"feed-post-text-block-inner"},false);o.style.overflowX="scroll"}}}}}if(typeof arCommentsMoreButtonID!="undefined"){var e=false;for(var s=0;s<arCommentsMoreButtonID.length;s++){e=BX.pos(BX(arCommentsMoreButtonID[s].bodyBlockID));if(e.height<200){BX(arCommentsMoreButtonID[s].moreButtonBlockID).style.display="none"}}}}window.__socOnUCFormClear=function(e){LHEPostForm.reinitDataBefore(e.editorId)};window.__socOnUCFormAfterShow=function(e,t,n){n=!!n?n:{};var o=e.entitiesCorrespondence[e.id.join("-")][0],s=e.entitiesCorrespondence[e.id.join("-")][1];BX.show(BX("feed_comments_block_"+o));BX.onCustomEvent(window,"OnBeforeSocialnetworkCommentShowedUp",["socialnetwork"]);e.form.action=e.url.replace(/\#eId\#/,o).replace(/\#id\#/,s);var a={ENTITY_XML_ID:e.id[0],ENTITY_TYPE:e.entitiesId[e.id[0]][0],ENTITY_ID:e.entitiesId[e.id[0]][1],parentId:e.id[1],comment_post_id:e.entitiesId[e.id[0]][1],edit_id:e.id[1],act:e.id[1]>0?"edit":"add",logId:e.entitiesId[e.id[0]][2]};for(var i in a){if(!e.form[i]){e.form.appendChild(BX.create("INPUT",{attrs:{name:i,type:"hidden"}}))}e.form[i].value=a[i]}__socOnLightEditorShow(t,n)};window.__socOnUCFormSubmit=function(e,t){t["r"]=Math.floor(Math.random()*1e3);t["sessid"]=BX.bitrix_sessid();t["log_id"]=e.entitiesCorrespondence[e.id.join("-")][0];t["p_smile"]=BX.message("sonetLPathToSmile");t["p_ubp"]=BX.message("sonetLPathToUserBlogPost");t["p_gbp"]=BX.message("sonetLPathToGroupBlogPost");t["p_umbp"]=BX.message("sonetLPathToUserMicroblogPost");t["p_gmbp"]=BX.message("sonetLPathToGroupMicroblogPost");t["p_user"]=BX.message("sonetLPathToUser");t["p_le"]=BX.message("sonetLEPath");t["f_id"]=BX.message("sonetLForumID");t["bapc"]=BX.message("sonetLBlogAllowPostCode");t["site"]=BX.message("sonetLSiteId");t["lang"]=BX.message("sonetLLangId");t["nt"]=BX.message("sonetLNameTemplate");t["sl"]=BX.message("sonetLShowLogin");t["as"]=BX.message("sonetLAvatarSizeComment");t["dtf"]=BX.message("sonetLDateTimeFormat");t["message"]=t["REVIEW_TEXT"];t["action"]="add_comment";t["RATING_TYPE"]=BX.message("sonetRatingType");t["pull"]="Y";t["crm"]=BX.message("sonetLIsCRM");e.form["bx-action"]=e.form.action;e.form.action=BX.message("sonetLESetPath")};window.__socOnUCFormResponse=function(e,t){e.form.action=e.form["bx-action"];var n={errorMessage:t},o=e.entitiesCorrespondence[e.id.join("-")][0],s={};if(!(!!t&&typeof t=="object")){}else if(t[0]=="*"){n={errorMessage:BX.message("sonetLErrorSessid")}}else{if(!(t["commentID"]>0)||!!t["strMessage"])n["errorMessage"]=t["strMessage"];else if(t["return_data"])n=t["return_data"];
3298else{var a=t["arCommentFormatted"],i=t["arComment"],r=!!window["__logBuildRating"]?window["__logBuildRating"](t["arComment"],t["arCommentFormatted"]):null,l=!!i["SOURCE_ID"]?i["SOURCE_ID"]:i["ID"],s={ID:l,ENTITY_XML_ID:e.id[0],FULL_ID:[e.id[0],l],NEW:"N",APPROVED:"Y",POST_TIMESTAMP:t["timestamp"]-BX.message("USER_TZ_OFFSET"),POST_TIME:a["LOG_TIME_FORMAT"],POST_DATE:a["LOG_TIME_FORMAT"],"~POST_MESSAGE_TEXT":a["MESSAGE"],POST_MESSAGE_TEXT:a["MESSAGE_FORMAT"],PANELS:{MODERATE:false},URL:{LINK:i["URL"]&&i["URL"].length>0?i["URL"]:BX.message("sonetLEPath").replace("#log_id#",i["LOG_ID"])+"?commentId="+i["ID"]+"#com"+(parseInt(i["SOURCE_ID"])>0?i["SOURCE_ID"]:i["ID"])},AUTHOR:{ID:a["USER_ID"],NAME:a["CREATED_BY"]["FORMATTED"],URL:a["CREATED_BY"]["URL"],AVATAR:a["AVATAR_SRC"]},BEFORE_ACTIONS:!!r?r:"",AFTER:a["UF"]};if(typeof t["hasEditCallback"]!="undefined"&&t["hasEditCallback"]=="Y"){s["PANELS"]["EDIT"]="Y";s["URL"]["EDIT"]="__logEditComment('"+e.id[0]+"', '"+i["ID"]+"', '"+i["LOG_ID"]+"');"}if(typeof t["hasDeleteCallback"]!="undefined"&&t["hasDeleteCallback"]=="Y"){s["PANELS"]["DELETE"]="Y";s["URL"]["DELETE"]=BX.message("sonetLESetPath")+"?lang="+BX.message("sonetLLangId")+"&action=delete_comment&delete_comment_id="+i["ID"]+"&post_id="+i["LOG_ID"]+"&site="+BX.message("sonetLSiteId")}n={errorMessage:"",okMessage:"",status:true,message:"",messageCode:a["MESSAGE"],messageId:[e.id[0],l],"~message":"",messageFields:s}}var d=BX("log_entry_follow_"+o,true),f=!!d?d.getAttribute("data-follow")=="Y"?"Y":"N":false;if(f=="N"){BX.findChild(d,{tagName:"a"}).innerHTML=BX.message("sonetLFollowY");d.setAttribute("data-follow","Y")}var d=BX("feed-comments-all-cnt-"+o,true),p=!!d?d.innerHTML.length>0?parseInt(d.innerHTML):0:false;if(p!==false)d.innerHTML=p+1}e.OnUCFormResponseData=n};window.__socOnLightEditorShow=function(e,t){var n={};if(t["arFiles"]){var o={},s,a;for(var i=0;i<t["arFiles"].length;i++){s=BX.findChild(BX("wdif-doc-"+t["arFiles"][i]),{className:"feed-com-file-name"},true);a=BX.findChild(BX("wdif-doc-"+t["arFiles"][i]),{className:"feed-con-file-size"},true);o["F"+i]={FILE_ID:t["arFiles"][i],FILE_NAME:s?s.innerHTML:"noname",FILE_SIZE:a?a.innerHTML:"unknown",CONTENT_TYPE:"notimage/xyz"}}n["UF_SONET_COM_DOC"]={USER_TYPE_ID:"file",FIELD_NAME:"UF_SONET_COM_FILE[]",VALUE:o}}if(t["arDocs"])n["UF_SONET_COM_FILE"]={USER_TYPE_ID:"webdav_element",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:BX.clone(t["arDocs"])};if(t["arDFiles"])n["UF_SONET_COM_FILE"]={USER_TYPE_ID:"disk_file",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:BX.clone(t["arDFiles"])};LHEPostForm.reinitData(SLEC.editorId,e,n)};BitrixLF=function(){this.bLoadStarted=false};BitrixLF.prototype.showRefreshError=function(){window.bLockCounterAnimate=false;_sonetLClearContainerExternal(false)};BitrixLF.prototype.LazyLoadCheckVisibility=function(e){var t=e.node;var n="comment";var o=BX.findParent(t,{className:"feed-com-text"});if(!o){n="post";o=BX.findParent(t,{className:"feed-post-text-block"})}if(o){var s=BX.findChild(o,{tag:"div",className:"feed-post-text-more"},false);if(s&&s.style.display!="none"){return t.parentNode.parentNode.offsetTop<(n=="comment"?220:270)}}return true};BitrixLF.prototype.processAjaxBlock=function(e,t,n){if(!e){return}if(!t){t="content_block_"+Math.floor(Math.random()*1e3)}n=!!n;var o=false;var s=false;a(i);r(l);function a(t){if(BX.type.isArray(e.CSS)&&e.CSS.length>0){BX.load(e.CSS,t)}else{t()}}function i(){BX("log_internal_container").appendChild(BX.create("DIV",{props:{id:t,className:"feed-wrap"},style:{display:n?"none":"block"},html:e.CONTENT}));o=true;if(s){l()}}function r(t){if(BX.type.isArray(e.JS)&&e.JS.length>0){BX.load(e.JS,t)}else{t()}}function l(){s=true;if(o){BX.ajax.processRequestData(e.CONTENT,{scriptsRunFirst:false,dataType:"HTML"})}}};BitrixLF.prototype.createTask=function(e){this.createTaskPopup=new BX.PopupWindow("BXCTP",null,{autoHide:false,zIndex:0,offsetLeft:0,offsetTop:0,overlay:false,lightShadow:true,closeIcon:{right:"12px",to
3298p:"10px"},draggable:{restrict:true},closeByEsc:false,contentColor:"white",contentNoPaddings:true,buttons:[],content:BX.create("DIV",{attrs:{id:"BXCTP_content"},props:{className:"feed-create-task-popup-content"}}),events:{onAfterPopupShow:BX.proxy(function(){oLF.createTaskSetContent(BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskWait")}));BX.ajax({url:"/bitrix/components/bitrix/socialnetwork.log.ex/ajax.php",method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),ENTITY_TYPE:e.entityType,ENTITY_ID:e.entityId,action:"get_raw_data"},onsuccess:BX.proxy(function(t){if(typeof t.TITLE!="undefined"&&typeof t.DESCRIPTION!="undefined"&&typeof t.DISK_OBJECTS!="undefined"&&t.TITLE.length>0&&t.DESCRIPTION.length>0){BX.Tasks.Util.Query.runOnce("task.add",{data:{TITLE:t.TITLE,DESCRIPTION:t.DESCRIPTION,RESPONSIBLE_ID:BX.message("USER_ID"),CREATED_BY:BX.message("USER_ID"),UF_TASK_WEBDAV_FILES:t.DISK_OBJECTS}}).then(BX.proxy(function(t){var n=t.getData();if(typeof n!="undefined"&&typeof n.DATA!="undefined"&&typeof n.DATA.ID!="undefined"&&parseInt(n.DATA.ID)>0){oLF.createTaskSetContentSuccess(n.DATA.ID);BX.ajax({url:"/bitrix/components/bitrix/socialnetwork.log.ex/ajax.php",method:"POST",dataType:"json",data:{sessid:BX.bitrix_sessid(),ENTITY_TYPE:e.entityType,ENTITY_ID:e.entityId,TASK_ID:n.DATA.ID,action:"create_task_comment"}})}else{oLF.createTaskSetContentFailure(t.getErrors().getMessages())}},this))}else{oLF.createTaskSetContentFailure([BX.message("sonetLFCreateTaskErrorGetData")])}},this),onfailure:function(e){oLF.createTaskSetContentFailure([BX.message("sonetLFCreateTaskErrorGetData")])}})},this),onPopupClose:BX.proxy(function(){this.createTaskPopup.destroy()},this)}});this.createTaskPopup.params.zIndex=BX.WindowManager?BX.WindowManager.GetZIndex():0;this.createTaskPopup.show()};BitrixLF.prototype.createTaskSetContentSuccess=function(e){oLF.createTaskSetContent(BX.create("DIV",{children:[BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskSuccessTitle")}),BX.create("DIV",{props:{className:"feed-create-task-popup-description"},html:BX.message("sonetLFCreateTaskSuccessDescription")})]}));this.createTaskPopup.setButtons([new BX.PopupWindowButton({text:BX.message("sonetLFCreateTaskButtonTitle"),events:{click:BX.proxy(function(){this.createTaskPopup.destroy();window.open(BX.message("sonetLFCreateTaskTaskPath").replace("#user_id#",BX.message("USER_ID")).replace("#task_id#",e),"_blank")},this)}})])};BitrixLF.prototype.createTaskSetContentFailure=function(e){oLF.createTaskSetContent(BX.create("DIV",{children:[BX.create("DIV",{props:{className:"feed-create-task-popup-title"},html:BX.message("sonetLFCreateTaskFailureTitle")}),BX.create("DIV",{props:{className:"feed-create-task-popup-description"},html:e.join("<br>")})]}))};BitrixLF.prototype.createTaskSetContent=function(e){if(BX("BXCTP_content")){var t=BX("BXCTP_content");BX.cleanNode(t);t.appendChild(e)}};oLF=new BitrixLF;window.oLF=oLF;
3299/* End */
3300;
3301; /* Start:"a:4:{s:4:"full";s:98:"/bitrix/components/bitrix/socialnetwork.log.entry/templates/.default/scripts.min.js?17591933949338";s:6:"source";s:79:"/bitrix/components/bitrix/socialnetwork.log.entry/templates/.default/scripts.js";s:3:"min";s:83:"/bitrix/components/bitrix/socialnetwork.log.entry/templates/.default/scripts.min.js";s:3:"map";s:83:"/bitrix/components/bitrix/socialnetwork.log.entry/templates/.default/scripts.map.js";}"*/
3302window["__logCommentsListRedefine"]=function(e,t,n,a){if(window["UC"]&&!!window["UC"][e]){BX.addCustomEvent(window["UC"][e],"OnUCListWasBuilt",(function(t,n,s){if(BX(s)&&s.hasChildNodes){var i=s.firstChild,o;do{if(BX(i)&&i["getAttribute"]){o=i.getAttribute("id").replace("record-"+e+"-","").replace("-cover","");BX.onCustomEvent(window,"OnUCAddEntitiesCorrespondence",[e+"-"+o,[a,top["arLogCom"+a+o]]])}}while(i=i.nextSibling)}}))}if(!!window.mplCheckForQuote)BX.bind(BX(t),"mouseup",(function(t){mplCheckForQuote(t,this,e,n)}))};window["__logBuildRating"]=function(e,t,n){var a="";n=!!n?n:Math.floor(Math.random()*1e5)+1;if(BX.message("sonetLShowRating")=="Y"&&!!e["RATING_TYPE_ID"]>0&&e["RATING_ENTITY_ID"]>0&&(BX.message("sonetLRatingType")=="like"&&!!window["RatingLike"]||BX.message("sonetLRatingType")=="standart_text"&&!!window["Rating"])){if(BX.message("sonetLRatingType")=="like"){var s=e["RATING_USER_VOTE_VALUE"]>0?" bx-you-like":"",i=e["RATING_USER_VOTE_VALUE"]>0?BX.message("sonetLTextLikeN"):BX.message("sonetLTextLikeY"),o=null;if(!!t["ALLOW_VOTE"]&&!!t["ALLOW_VOTE"]["RESULT"])o=BX.create("span",{props:{className:"bx-ilike-text"},html:i});a=BX.create("span",{attrs:{id:"sonet-rating-"+e["RATING_TYPE_ID"]+"-"+e["RATING_ENTITY_ID"]+"-"+n},props:{className:"sonet-log-comment-like rating_vote_text"},children:[BX.create("span",{props:{className:"ilike-light"},children:[BX.create("span",{props:{id:"bx-ilike-button-"+e["RATING_TYPE_ID"]+"-"+e["RATING_ENTITY_ID"]+"-"+n,className:"bx-ilike-button"},children:[BX.create("span",{props:{className:"bx-ilike-right-wrap"+s},children:[BX.create("span",{props:{className:"bx-ilike-right"},html:e["RATING_TOTAL_POSITIVE_VOTES"]})]}),BX.create("span",{props:{className:"bx-ilike-left-wrap"},children:[o]})]}),BX.create("span",{props:{id:"bx-ilike-popup-cont-"+e["RATING_TYPE_ID"]+"-"+e["RATING_ENTITY_ID"]+"-"+n,className:"bx-ilike-wrap-block"},style:{display:"none"},children:[BX.create("span",{props:{className:"bx-ilike-popup"},children:[BX.create("span",{props:{className:"bx-ilike-wait"}})]})]})]})]})}else if(BX.message("sonetLRatingType")=="standart_text"){a=BX.create("span",{attrs:{id:"sonet-rating-"+e["RATING_TYPE_ID"]+"-"+e["RATING_ENTITY_ID"]+"-"+n},props:{className:"sonet-log-comment-like rating_vote_text"},children:[BX.create("span",{props:{className:"bx-rating"+(!t["ALLOW_VOTE"]["RESULT"]?" bx-rating-disabled":"")+(e["RATING_USER_VOTE_VALUE"]!=0?" bx-rating-active":""),id:"bx-rating-"+e["RATING_TYPE_ID"]+"-"+e["RATING_ENTITY_ID"]+"-"+n,title:!t["ALLOW_VOTE"]["RESULT"]?t["ERROR_MSG"]:""},children:[BX.create("span",{props:{className:"bx-rating-absolute"},children:[BX.create("span",{props:{className:"bx-rating-question"},html:!t["ALLOW_VOTE"]["RESULT"]?BX.message("sonetLTextDenied"):BX.message("sonetLTextAvailable")}),BX.create("span",{props:{className:"bx-rating-yes "+(e["RATING_USER_VOTE_VALUE"]>0?"  bx-rating-yes-active":""),title:e["RATING_USER_VOTE_VALUE"]>0?BX.message("sonetLTextCancel"):BX.message("sonetLTextPlus")},children:[BX.create("a",{props:{className:"bx-rating-yes-count",href:"#like"},html:""+parseInt(e["RATING_TOTAL_POSITIVE_VOTES"])}),BX.create("a",{props:{className:"bx-rating-yes-text",href:"#like"},html:BX.message("sonetLTextRatingY")})]}),BX.create("span",{props:{className:"bx-rating-separator"},html:"/"}),BX.create("span",{props:{className:"bx-rating-no "+(e["RATING_USER_VOTE_VALUE"]<0?"  bx-rating-no-active":""),title:e["RATING_USER_VOTE_VALUE"]<0?BX.message("sonetLTextCancel"):BX.message("sonetLTextMinus")},children:[BX.create("a",{props:{className:"bx-rating-no-count",href:"#dislike"},html:""+parseInt(e["RATING_TOTAL_NEGATIVE_VOTES"])}),BX.create("a",{props:{className:"bx-rating-no-text",href:"#dislike"},html:BX.message("sonetLTextRatingN")})]})]})]}),BX.create("span",{props:{id:"bx-rating-popup-cont-"+e["RATING_TYPE_ID"]+"-"+e["RATING_ENTITY_ID"]+"-"+n+"-plus"},style:{display:"none"},children:[BX.create("span",{props:{className:"bx-ilike-popup  bx-rating-popup"},children:[BX.create("span",{props:{className:"bx-ilike-wait"}})]})]}),BX.create("span",{props:{id:"bx-rating-popup-cont-"+e["RATING_TYPE_ID"]+"-"+e["RATING_ENTITY_ID"]+"-"+n+"-minus"},style:{display:"none"},children:[BX.create("span",{props:{className:"bx-ilike-popup  bx-rating-popup"},children:[BX.create("span",{props:{className:"bx-ilike-wait"}})]})]})]})}}if(!!a){a=BX.create("span",{children:[a]});a=a.innerHTML+'<script>window["#OBJ#"].Set("#ID#", "#RATING_TYPE_ID#", #RATING_ENTITY_ID#, "#ALLOW_VOTE#", BX.message("sonetLCurrentUserID"), #TEMPLATE#, "light", BX.message("sonetLPathToUser"));<\/script>'.replace("#OBJ#",BX.message("sonetLRatingType")=="like"?"RatingLike":"Rating").replace("#ID#",e["RATING_TYPE_ID"]+"-"+e["RATING_ENTITY_ID"]+"-"+n).replace("#RATING_TYPE_ID#",e["RATING_TYPE_ID"]).replace("#RATING_ENTITY_ID#",e["RATING_ENTITY_ID"]).replace("#ALLOW_VOTE#",!!t["ALLOW_VOTE"]&&!!t["ALLOW_VOTE"]["RESULT"]?"Y":"N").replace("#TEMPLATE#",BX.message("sonetLRatingType")=="like"?'{LIKE_Y:BX.message("sonetLTextLikeN"),LIKE_N:BX.message("sonetLTextLikeY"),LIKE_D:BX.message("sonetLTextLikeD")}':'{PLUS:BX.message("sonetLTextPlus"),MINUS:BX.message("sonetLTextMinus"),CANCEL:BX.message("sonetLTextCancel")}')}return a};window["__logShowCommentForm"]=function(e){if(!!window["UC"][e])window["UC"][e].reply()};function __logShowHiddenDestination(e,t,n){BX.ajax.runAction("socialnetwork.api.livefeed.logentry.getHiddenDestinations",{data:{params:{logId:e,createdById:t,pathToUser:BX.message("sonetLPathToUser"),pathToWorkgroup:BX.message("sonetLPathToGroup"),pathToDepartment:BX.message("sonetLPathToDepartment"),nameTemplate:BX.message("sonetLNameTemplate"),showLogin:BX.message("sonetLShowLogin"),destinationLimit:BX.message("sonetLDestinationLimit")}}}).then((function(e){var t=e.data.destinationList;if(!BX.type.isNotEmptyObject(t)){return}if(BX(n)){var a=n.parentNode;a.removeChild(n);var s="";for(var i in t){if(!t.hasOwnProperty(i)){continue}
3302if(BX.type.isNotEmptyString(t[i]["TITLE"])){a.appendChild(BX.create("SPAN",{html:", "}));if(BX.type.isNotEmptyString(t[i]["CRM_PREFIX"])){a.appendChild(BX.create("SPAN",{props:{className:"feed-add-post-destination-prefix"},html:t[i]["CRM_PREFIX"]+":&nbsp;"}))}if(BX.type.isNotEmptyString(t[i]["URL"])){a.appendChild(BX.create("A",{props:{className:"feed-add-post-destination-new"+(BX.type.isNotEmptyString(t[i]["IS_EXTRANET"])&&t[i]["IS_EXTRANET"]=="Y"?" feed-post-user-name-extranet":""),href:t[i]["URL"]},html:t[i]["TITLE"]}))}else{a.appendChild(BX.create("SPAN",{props:{className:"feed-add-post-destination-new"+(BX.type.isNotEmptyString(t[i]["IS_EXTRANET"])&&t[i]["IS_EXTRANET"]=="Y"?" feed-post-user-name-extranet":"")},html:t[i]["TITLE"]}))}}}if(typeof e.data["hiddenDestinationsCount"]!="undefined"&&parseInt(e.data["hiddenDestinationsCount"])>0){e.data["hiddenDestinationsCount"]=parseInt(e.data["hiddenDestinationsCount"]);var o=e.data["hiddenDestinationsCount"]%100>10&&e.data["hiddenDestinationsCount"]%100<20?5:e.data["hiddenDestinationsCount"]%10;a.appendChild(BX.create("SPAN",{html:"&nbsp;"+BX.message("sonetLDestinationHidden"+o).replace("#COUNT#",e.data["hiddenDestinationsCount"])}))}}}),(function(e){}))}function __logSetFollow(e){return BX.Livefeed.FeedInstance.changeFollow({logId:e})}function __logRefreshEntry(e){var t=e.node!==undefined?BX(e.node):false;var n=e.logId!==undefined?parseInt(e.logId):0;if(!t||n<=0||BX.message("sonetLEPath")===undefined){return}BX.ajax({url:BX.message("sonetLEPath").replace("#log_id#",n),method:"POST",dataType:"json",data:{log_id:n,action:"get_entry"},onsuccess:function(e){if(e["ENTRY_HTML"]!==undefined){BX.cleanNode(t);t.innerHTML=e["ENTRY_HTML"];var n=BX.processHTML(t.innerHTML,true);var a=n.SCRIPT;BX.ajax.processScripts(a,true)}},onfailure:function(e){}});return false}window.__logEditComment=function(e,t,n){BX.ajax.runAction("socialnetwork.api.livefeed.comment.getsource",{data:{params:{postId:n,commentId:t}}}).then((function(t){var a=t.data;var s={messageBBCode:a.message,messageFields:{arFiles:BX.type.isNotEmptyObject(a.UF.UF_SONET_COM_FILE)?a.UF.UF_SONET_COM_FILE.VALUE:[]}};if(BX.type.isNotEmptyObject(a.UF.UF_SONET_COM_DOC)&&BX.type.isNotEmptyString(a.UF.UF_SONET_COM_DOC.USER_TYPE_ID)){if(a.UF.UF_SONET_COM_DOC.USER_TYPE_ID==="webdav_element"){s.messageFields.arDocs=a.UF.UF_SONET_COM_DOC.VALUE}else if(a.UF.UF_SONET_COM_DOC.USER_TYPE_ID==="disk_file"){s.messageFields.arDFiles=a.UF.UF_SONET_COM_DOC.VALUE}}window.UC[window.SLEC.formKey].entitiesCorrespondence[e+"-"+a.sourceId]=[n,a.id];BX.onCustomEvent(window,"OnUCAfterRecordEdit",[e,a.sourceId,s,"EDIT"])}),(function(){}))};function __logTaskAnalytics(e,t){const n={tool:"tasks",category:"task_operations",event:e,type:"task",c_section:"feed",c_element:t};BX.UI.Analytics.sendData(n)}(function(){BX.SocialnetworkLogEntry={};BX.SocialnetworkLogEntry.registerViewAreaList=function(e){if(typeof e=="undefined"||typeof e.containerId=="undefined"||typeof e.className=="undefined"){return}if(BX(e.containerId)){var t=BX.findChildren(BX(e.containerId),{tag:"div",className:e.className},true),n=null;for(var a=0,s=t.length;a<s;a++){if(t[a].id.length>0){n=null;if(BX.type.isNotEmptyString(e.fullContentClassName)){n=BX.findChild(t[a],{className:e.fullContentClassName})}BX.UserContentView.registerViewArea(t[a].id,n?n:null)}}}}})();
3303/* End */
3304;
3305; /* Start:"a:4:{s:4:"full";s:98:"/local/templates/voenchast/components/bitrix/main.post.form/.default/script.min.js?166624702462609";s:6:"source";s:78:"/local/templates/voenchast/components/bitrix/main.post.form/.default/script.js";s:3:"min";s:82:"/local/templates/voenchast/components/bitrix/main.post.form/.default/script.min.js";s:3:"map";s:82:"/local/templates/voenchast/components/bitrix/main.post.form/.default/script.map.js";}"*/
3306(function(){if(window["LHEPostForm"])return;var e={controller:{},handler:{}};BX.addCustomEvent(window,"BFileDLoadFormControllerWasBound",function(t){e.controller[t.id]=true});BX.addCustomEvent(window,"WDLoadFormControllerInit",function(t){e.controller[t.CID]=t});BX.addCustomEvent(window,"WDLoadFormControllerWasBound",function(t){e.controller[t.CID]=true});BX.addCustomEvent(window,"DiskDLoadFormControllerInit",function(t){e.controller[t.CID]=t});BX.addCustomEvent(window,"DiskLoadFormControllerWasBound",function(t){e.controller[t.CID]=true});BX.addCustomEvent(window,"OnEditorInitedBefore",function(t){if(e.handler[t.id]){t.__lhe_flags=["OnEditorInitedBefore"];if(e.handler[t.id]["params"]&&e.handler[t.id]["params"]["LHEJsObjName"])window[e.handler[t.id].params["LHEJsObjName"]]=t;e.handler[t.id].OnEditorInitedBefore(t)}});var t=function(t){if(e.handler[t.id]&&e.handler[t.id].editorIsLoaded!==true){e.handler[t.id].editorIsLoaded=true;e.handler[t.id].exec();BX.onCustomEvent(e.handler[t.id],"OnEditorIsLoaded",[e.handler[t.id],t])}};BX.addCustomEvent(window,"OnCreateIframeAfter",t);BX.addCustomEvent(window,"OnEditorInitedAfter",function(i,n){if(e.handler[i.id]){i.__lhe_flags.push("O
3306nEditorInitedAfter");e.handler[i.id].OnEditorInitedAfter(i);if(e.handler[i.id].editorIsLoaded!==true&&n&&i.sandbox&&i.sandbox.inited)t.apply(i,[i])}});BX.util.object_search=function(e,t){for(var i in t){if(t.hasOwnProperty(i)){if(t[i]==e)return true;else if(typeof t[i]=="object"&&t[i]!==null){var n=BX.util.object_search_key(e,t[i]);if(n!==false)return n}}}return false};var i=function(e,t,i){i=i&&i.length>0?i:[];if(typeof t=="object"&&t.length>0){var n;while((n=t.pop())&&n&&t.length>0){i.push(n)}t=n}i.push(t);this.exist=true;this.bxTag=e;this.tag=t;this.tags=i;this.regexp=new RegExp("\\[("+i.join("|")+")=((?:\\s|\\S)*?)(?:\\s*?WIDTH=(\\d+)\\s*?HEIGHT=(\\d+))?\\]","ig");this.code="["+t+"=#ID##ADDITIONAL#]";this.wysiwyg='<span style="color: #2067B0; border-bottom: 1px dashed #2067B0; margin:0 2px;" id="#ID#"#ADDITIONAL#>#NAME#</span>'},n=function(t,i,n){this.CID=this.id=i;this.parser=t.parser["disk_file"]||null;this.params=n;this.node=BX("diskuf-selectdialog-"+i);this.handler=e.controller[i];this.manager=t;this.eventNode=this.manager.eventNode;this.parserName="disk_file";this.prefixNode="disk-edit-attach";this.prefixHTMLNode="disk-attach-";this.props={valueEditClassName:"wd-inline-file",securityCID:"disk-upload-cid"};this.storage="disk";this.fileToAttach={};this.xmlToAttach={};this.events={onInit:"DiskDLoadFormControllerInit",onShow:"DiskLoadFormController",onBound:"DiskLoadFormControllerWasBound"}};n.prototype={parser:false,eventNode:null,values:{},initialized:false,functionsToExec:[],exec:function(e,t){if(typeof e=="function")this.functionsToExec.push([e,t]);if(this.handler&&this.handler!==true){var i;while((i=this.functionsToExec.shift())&&i)i[0].apply(this,i[1])}},init:function(){if(this.initialized!==true){this.values={};this.functionsToExec=[];this.initialized=true;this.bindMainEvents(this.manager);if(this.parser!==null){this.bindEvents(this.manager);return this.initValues()}}return false},initValues:function(){var e=BX.findChildren(this.node,{className:this.props.valueEditClassName},true);if(e&&e.length>0){this.exec(this.runCheckText);return true}return false},bindMainEvents:function(t){var i=null;BX.addCustomEvent(t.eventNode,"onReinitializeBefore",BX.proxy(this.clean,this));BX.addCustomEvent(t.eventNode,"onShowControllers",BX.proxy(function(e){i=e;BX.onCustomEvent(t.eventNode,this.events.onShow,[e])},this));if(!e.controller[this.id]){var o=BX.delegate(function(e){if(e["UID"]==this.id||e["id"]==this.id){if(i==="show"||i==="hide"){BX.onCustomEvent(t.eventNode,this.events.onShow,[i]);i=null}BX.removeCustomEvent(window,this.events.onBound,o)}},this);BX.addCustomEvent(window,this.events.onBound,o)}if(BX["DD"]&&this.storage=="disk"){var s=BX.delegate(function(e){if((e["UID"]==this.id||e["id"]==this.id)&&this.manager["dropZoneExists"]!==true){BX.removeCustomEvent(window,this.events.onBound,s);this.manager["dropZoneExists"]=true;var i=this.eventNode,o=this.id;n.dndCatcher=n.dndCatcher||{};n.dndCatcher[o]={"catch":true,files:[],dropZone:null,dropZoneMicro:null,initdrag:BX.delegate(function(){n.dndCatcher[o].dropZone=new BX.DD.dropFiles(t.eventNode);BX.addCustomEvent(t.eventNode,"OnImageDataUriHandle",BX.delegate(function(e,t){if(BX["UploaderUtils"]){var i=BX.UploaderUtils.dataURLToBlob(t.src);if(i&&i.size>0&&i.type.indexOf("image/")==0){i.name=i.name||t.title||"image."+i.type.substr(6);i.referrerToEditor=t;if(n.dndCatcher[o]["catch"]===true)n.dndCatcher[o]["drop"]([i]);else if(this.handler&&this.handler["addFile"])this.handler.addFile(i);BX.onCustomEvent(e,"OnImageDataUriCaught",[t])}}},this));BX.addCustomEvent(n.dndCatcher[o].dropZone,"dropFiles",n.dndCatcher[o]["drop"]);BX.addCustomEvent(n.dndCatcher[o].dropZone,"dragEnter",n.dndCatcher[o]["dragover"]);BX.addCustomEvent(n.dndCatcher[o].dropZone,"dragLeave",n.dndCatcher[o]["dragleave"]);if(BX("micro"+t.__divId)){n.dndCatcher[o].dropZoneMicro=new BX.DD.dropFiles(BX("micro"+t.__divId));BX.addCustomEvent(n.dndCatcher[o].dropZoneMicro,"dragEnter",function(){BX.onCustomEvent(t.eventNode,"OnShowLHE",["justShow"])})}BX.unbind(document,"dragover",n.dndCatcher[o]["initdrag"]);BX.onCustomEvent(t.eventNode,"onDropZoneExists",[])},this),dragover:BX.delegate(function(){BX.addClass(t.eventNode,"feed-add-post-dnd-over");BX.onCustomEvent(t.eventNode,"dragover",[])},this),dragleave:BX.delegate(function(){BX.removeClass(t.eventNode,"feed-add-post-dnd-over");BX.onCustomEvent(t.eventNode,"dragleave",[])},this),dragenterwindow:BX.delegate(function(){BX.addClass(t.eventNode,"feed-add-post-dnd-ready");if(BX("micro"+t.__divId)){BX.addClass(BX("micro"+t.__divId),"feed-add-post-micro-dnd-ready")}BX.onCustomEvent(t.eventNode,"dragenterwindow",[])},this),dragleavewindow:BX.delegate(function(e){BX.removeClass(t.eventNode,"feed-add-post-dnd-ready");if(BX("micro"+t.__divId)){BX.removeClass(BX("micro"+t.__divId),"feed-add-post-micro-dnd-ready")}BX.onCustomEvent(t.eventNode,"dragleavewindow",[])},this),drop:BX.delegate(function(e){BX.onCustomEvent(t.eventNode,"drop",[]);BX.onCustomEvent(window,"dragWindowLeave");BX.onCustomEvent(window,"__dragWindowLeave");var i=0;if(e&&e.length>0){if(n.dndCatcher[o]["catch"]===true){n.dndCatcher[o].files=e;i=1}else{i=2}BX.onCustomEvent(t.eventNode,this.events.onShow,["show"]);BX.removeClass(t.eventNode,"feed-add-post-dnd-ready feed-add-post-dnd-over")}return i},this)};BX.ready(function(){n.dndCatcher[o]["initdrag"]()});BX.addCustomEvent(i,"OnIframeDrop",BX.delegate(function(e){BX.PreventDefault(e);if(e["dataTransfer"]&&e["dataTransfer"]["files"]){if(n.dndCatcher[o].drop(e["dataTransfer"]["files"])===2){this.handler.agent.onChange(e["dataTransfer"]["files"])}}},this));BX.addCustomEvent(i,"OnIframeDragOver",n.dndCatcher[o].dragover);BX.addCustomEvent(i,"OnIframeDragLeave",n.dndCatcher[o].dragleave);if(!window["bxMpfDndCatcher"]){window["bxMpfDndCatcher"]=true;var a=false,r=function(){if(a===false){a=true;BX.bind(document,"dragleave",l);BX.bind(document,"dragover",l);BX.bind(document,"mouseout",d);BX.onCustomEvent(window,"dragWindowEnter")}},d=function(e){BX.unbind(document,"dragleave",l);BX.unbind(document,"dragover",l);BX.unbind(document,"mouseout",d);a=false;BX.onCustomEvent(window,"dragWindowLeave")},l=function(e){if(h>0){clearTimeout(h);h=0}BX.fixEventPageXY(e);var t=true;if(e.pageX>0&&e.pageY>0){var i=BX.GetWindowSize();if(e.pageY<i.scrollHeight&&e.pageX<i.scrollWidth){var n=e.pageY-i.scrollTop,o=e.pageX-i.scrollLeft;if(0<n&&n<i.innerHeight-20&&0<o&&o<i.innerWidth-20){t=false}}}if(t){d(e)}else{h=setTimeout(function(){l({type:"intervalLimit"})},100)}},h=0;BX.bind(document,"dragenter",function(e){if(window["bxMpfDndCatcher"]>0){clearTimeout(window["bxMpfDndCatcher"])}var t=true;if(e&&e["dataTransfer"]&&e["dataTransfer"]["types"]){for(var i=0;i<e["dataTransfer"]["types"].length;i++){if(e["dataTransfer"]["types"][i]=="Files"){t=true;break}}}if(t){r()}});BX.addCustomEvent(window,"__dragWindowLeave",d);BX.bind(document,"dragover",function(e){return BX.PreventDefault(e)});BX.bind(document,"drop",function(e){d(e);return BX.PreventDefault(e)})}BX.addCustomEvent(window,"dragWindowEnter",n.dndCatcher[o].dragenterwindow);BX.addCustomEvent(window,"dragWindowLeave",n.dndCatcher[o].dragleavewindow);
3306this.__initCatcher=BX.delegate(function(e,i){if(e==this.id){BX.removeCustomEvent(t.eventNode,"onControllerInitialized",this.__initCatcher);i.agent.initDropZone(t.eventNode);if(n.dndCatcher[e].files.length>0){i.agent.onChange(n.dndCatcher[e].files);n.dndCatcher[e].files=[]}n.dndCatcher[e]["catch"]=false;this.__initCatcher=null}},this);BX.addCustomEvent(t.eventNode,"onControllerInitialized",this.__initCatcher)}},this);BX.addCustomEvent(window,this.events.onBound,s);if(e.controller[this.id])s(e.controller[this.id])}},bindEvents:function(e){this._catchHandler=BX.delegate(function(t){BX.removeCustomEvent(this.eventNode,this.events.onInit,this._catchHandler);this.handler=t;var i=BX.findChild(BX(e.formID),{attr:{id:this.props.securityCID}},true,false);if(i)i.value=this.handler.CID;this.exec();var n=BX.delegate(function(){BX.onCustomEvent(e.eventNode,"onUploadsHasBeenChanged",arguments)},this);BX.addCustomEvent(this.handler.agent,"onFileIsInited",n);BX.addCustomEvent(this.handler.agent,"ChangeFileInput",n);BX.onCustomEvent(e.eventNode,"onControllerInitialized",[this.id,t])},this);if(typeof this.handler!="object"||!this.handler)BX.addCustomEvent(e.eventNode,this.events.onInit,this._catchHandler);else this._catchHandler(this.handler);BX.addCustomEvent(e.eventNode,"OnFileUploadSuccess",BX.delegate(function(e,t,i){if(this.id==t.CID||this.id==t.id){i=i||{};i.usePostfix=true;this.addFile(e,i,t)}},this));BX.addCustomEvent(e.eventNode,"OnFileUploadFailed",BX.delegate(function(e,t,i){if(this.id==t.CID||this.id==t.id){this.failFile(e,i,t)}},this));BX.addCustomEvent(e.eventNode,"OnFileUploadRemove",BX.delegate(function(e,t){if(this.id==t.CID||this.id==t.id){this.deleteFile(e,{usePostfix:true},t)}},this));BX.addCustomEvent(this,"onFileIsInText",BX.proxy(function(e,t){this.adjustFile(this.checkFile(e),t)},this))},addFile:function(e,t,i){var n=this.checkFile(e.element_id,e,t);if(n){setTimeout(BX.proxy(function(){this.bindFile(n);this.adjustFile(n,false)},this),100);BX.onCustomEvent(this.eventNode,"onFileIsAdded",[n,this,i,t])}else{this.failFile(this,t,i)}return true},failFile:function(e,t,i){BX.onCustomEvent(this.eventNode,"onFileIsFailed",[this,i,t])},checkFile:function(e,t){e=""+(typeof e=="object"?e.id:e);if(typeof t=="object"&&t!==null&&e&&t.element_name&&BX(t.place)){var i={id:e,name:t.element_name,url:t.element_url,type:"isnotimage/xyz",isImage:false,place:BX(t.place,true),xmlID:BX(t.place,true).getAttribute("bx-attach-xml-id"),fileID:BX(t.place,true).getAttribute("bx-attach-file-id")},n;if(/(\.png|\.jpg|\.jpeg|\.gif|\.bmp)$/i.test(t.element_name)&&(n=BX.findChild(i.place,{className:"files-preview",tagName:"IMG"},true,false))&&n){i.type="image/xyz";i.lowsrc=n.src;i.element_url=i.src=n.src.replace(/\Wwidth=(\d+)/,"").replace(/\Wheight=(\d+)/,"");i.isImage=true;i.width=parseInt(n.getAttribute("data-bx-full-width")||n.getAttribute("data-bx-width"));i.height=parseInt(n.getAttribute("data-bx-full-height")||n.getAttribute("data-bx-height"))}if(i.xmlID)this.xmlToAttach[i.xmlID+""]=e;if(i.fileID)this.fileToAttach[i.fileID+""]=e;this.values[e]=i}return this.values[e]||false},bindFile:function(e){var t=e.place;if(typeof e=="object"&&t&&!t.hasAttribute("bx-file-is-bound")){var i=BX.findChild(t,{className:"f-wrap"},true,false),n=BX.findChild(t,{className:"files-preview"},true,false);if(i){BX.bind(i,"click",BX.delegate(function(){this.insertFile(e.id)},this));i.style.cursor="pointer";i.title=BX.message("MPF_FILE")}if(n){BX.bind(n,"click",BX.delegate(function(){this.insertFile(e.id)},this))}}},adjustFile:function(e,t){var i=e.place;if(t===true||t===false){if(!e.info)e.info=BX.findChild(e.place,{className:"files-info"},true,false);i=e.info;if(BX.type.isDomNode(i)){var n="check-in-text-"+e.id,o=BX(n),s=t===false?{attrs:{"bx-file-is-in-text":"N"},props:{className:"insert-btn"},html:'<span class="insert-btn-text">'+BX.message("MPF_FILE_INSERT_IN_TEXT")+"</span>"}:{attrs:{"bx-file-is-in-text":"Y"},props:{className:"insert-text"},html:'<span class="insert-btn-text">'+BX.message("MPF_FILE_IN_TEXT")+"</span>"};if(!o){s.attrs.id=n;s.events={click:BX.proxy(function(){this.insertFile(e.id)},this)};i.appendChild(BX.create("SPAN",s))}else{BX.adjust(o,s)}}}},insertFile:function(e){BX.onCustomEvent(this.eventNode,"onFileIsInserted",[this.checkFile(e),this])},deleteFile:function(e,t){e=this.checkFile(e,t);if(e){BX.onCustomEvent(this.eventNode,"onFileIsDeleted",[e,this]);this.values[e.id].place=null;delete this.values[e.id].place;this.values[e.id]=null;delete this.values[e.id];e=null;return true}return false},reinitValues:function(e,t){var i,n,o={};while((i=t.pop())&&i){n=BX(this.prefixHTMLNode+i);n=n?n.tagName=="A"?n:BX.findChild(n,{tagName:"IMG"},true):null;if(n){o["E"+i]={type:"file",id:i,name:n.getAttribute("data-bx-title"),size:n.getAttribute("data-bx-size"),sizeInt:n.getAttribute("data-bx-size"),width:n.getAttribute("data-bx-width"),height:n.getAttribute("data-bx-height"),storage:"disk",previewUrl:n.tagName=="A"?"":n.getAttribute("data-bx-src"),fileId:n.getAttribute("bx-attach-file-id")};if(n.hasAttribute("bx-attach-xml-id"))o["E"+i]["xmlId"]=n.getAttribute("bx-attach-xml-id")}}this.handler.selectFile({},{},o);this.runCheckText()},runCheckText:function(){if(!this._checkText)this._checkText=BX.delegate(this.checkText,this);this.manager.exec(this._checkText)},checkText:function(){var e,t=this.manager.getContent(),i=[],n,o;if(t!=""){e=t;for(o in this.xmlToAttach){if(this.xmlToAttach.hasOwnProperty(o)){t=t.replace(new RegExp("\\&\\#91\\;DOCUMENT ID=("+o+")([WIDTHHEIGHT=0-9 ]*)\\&\\#93\\;","gim"),"["+this.parser["tag"]+"="+this.xmlToAttach[o]+"$2]").replace(new RegExp("\\[DOCUMENT ID=("+o+")([WIDTHHEIGHT=0-9 ]*)\\]","gim"),"["+this.parser["tag"]+"="+this.xmlToAttach[o]+"$2]")}}for(o in this.fileToAttach){if(this.fileToAttach.hasOwnProperty(o)){t=t.replace(new RegExp("\\&\\#91\\;"+this.parser["tag"]+"=("+o+")([WIDTHHEIGHT=0-9 ]*)\\&\\#93\\;","gim"),"["+this.parser["tag"]+"="+this.fileToAttach[o]+"$2]").replace(new RegExp("\\["+this.parser["tag"]+"=("+o+")([WIDTHHEIGHT=0-9 ]*)\\]","gim"),"["+this.parser["tag"]+"="+this.fileToAttach[o]+"$2]")}}n=new RegExp("(?:\\&\\#91\\;)("+this.parser["tags"].join("|")+")=([a-z=0-9 ]+)(?:\\&\\#93\\;)","gim");if(n.test(t)){for(o in this.values){if(this.values.hasOwnProperty(o)){i.push(o)}}if(i.length>0){n=new RegExp("(?:\\&\\#91\\;|\\[)("+this.parser["tags"].join("|")+")=("+i.join("|")+")([WIDTHHEIGHT=0-9 ]*)(?:\\&\\#93\\;|\\])","gim");if(n.test(t))t=t.replace(n,BX.delegate(function(e,t,i,n){return"["+t+"="+i+n+"]"},this))}}if(e!=t)BX.onCustomEvent(this.eventNode,"onFileIsDetected",[t,this])}return t},clean:function(){if(this.handler&&this.handler.values){var e,t,i,n=BX(this.manager.formID);while((e=this.handler.values.pop())&&e){BX.remove(e)}if(this.handler.params&&this.handler.params.controlName){t=BX.findChildren(n,{tagName:"INPUT",attribute:{name:this.handler.params.controlName}},true)}if(t){for(i=0;i<t.length;i++){BX.remove(t[i])}}}},reinit:function(e,t){var i=[],n,o;for(n in t){if(t.hasOwnProperty(n)){if(t[n]["USER_TYPE_ID"]==this.parserName&&t[n]["VALUE"]){for(o in t[n]["VALUE"]){if(t[n]["VALUE"].hasOwnProperty(o)){i.push(t[n]["VALUE"][o])}}}}}if(i.length>0){this.exec(this.reinitValues,[e,i]);return true}return false}};var o=function(e,t,i){o.superclass.constructor.apply(this,arguments);this.parser=e.parser["webdav_element"]||null;this.node=BX("wduf-selectdialog-"+t);this.manager=e;this.parserName="webdav_element";this.prefixNode="wd-doc";this.prefixHTMLNode="wdif-doc-";this.storage="webdav";this.events={onInit:"WDLoadFormControllerInit",onShow:"WDLoadFormController",onBound:"WDLoadFormControllerWasBound"}};BX.extend(o,n);o.prototype.reinitValues=function(e,t){var i,n,o={};this.waitAnswerFromServer=[];while((i=t.pop())&&i){n=BX(this.prefixHTMLNode+i);n=n?n.tagName=="A"?n:BX.findChild(n,{tagName:"IMG"},true):null;if(n){o["E"+i]={type:"file",id:i,name:n.getAttribute("alt"),storage:"webdav",size:n.getAttribute("data-bx-size"),sizeInt:1,ext:"",link:n.getAttribute("data-bx-document")};if(n.hasAttribute("bx-attach-xml-id"))o["E"+i]["xmlId"]=n.getAttribute("bx-attach-xml-id");this.waitAnswerFromServer.push(i)}}if(this.waitAnswerFromServer.length>0){if(!this._defferCheckText)this._defferCheckText=BX.delegate(this.defferCheckText,this);BX.addCustomEvent(this.eventNode,"OnFileUploadSuccess",this._defferCheckText);this.handler.WDFD_SelectFile({},{},o)}};o.prototype.defferCheckText=function(e){var t=BX.util.array_search(e.element_id,this.waitAnswerFromServer);if(t>=0){this.runCheckText();this.waitAnswerFromServer=BX.util.deleteFromArray(this.waitAnswerFromServer,t)}if(this.waitAnswerFromServer.length<=0)BX.removeCustomEvent(this.eventNode,"OnFileUploadSuccess",this._defferCheckText)};var s=function(e,t,i){s.superclass.constructor.apply(this,arguments);this.parser=e.parser["file"]?e.parser["file"]:e.parser["postimage"]["exist"]?e.parser["postimage"]:null;this.postfix=i["postfix"]||"";this.node=BX("file-selectdialog-"+t);this.parserName="file";this.prefixNode="wd-doc";this.prefixHTMLNode="file-doc-";this.props={valueEditClassName:"file-inline-file",securityCID:"upload-cid"};this.storage="bfile";this.events={onInit:"BFileDLoadFormControllerInit",onShow:"BFileDLoadFormController",onBound:"BFileDLoadFormControllerWasBound"}};BX.extend(s,n);s.prototype.initValues=function(e){var t;if(e!==true){t=BX.findChildren(this.node,{className:this.props.valueEditClassName},true);if(t&&t.length>1){this.exec(this.initValues,[true]);return true}return false}t=this.handler.agent.values||[];var i,n,o,s,a={},r="/bitrix/components/bitrix/main.file.input/file.php?mfi_mode=down&cid="+this.handler.CID+"&sessid="+BX.bitrix_sessid();for(var d=0;d<t.length;d++){s=parseInt(t[d].getAttribute("id").replace(this.prefixNode,""));if(a["id"+s])continue;a["id"+s]="Y";if(s>0){n=BX.findChild(t[d],{className:"f-wrap"},true,false);
3306if(!n)continue;o={element_id:s,element_name:n.innerHTML,parser:this.parser.bxTag,storage:"bfile",element_url:r+"&fileID="+s};i=this.addFile(o,{usePostfix:true,hasPreview:false})}}this.runCheckText();return true};s.prototype.checkFile=function(e,t,i){e=""+(typeof e=="object"?e.id:e);e=e+(i&&i["usePostfix"]===true?this.postfix:"");if(typeof t=="object"&&t!==null&&e&&t.element_name&&BX(this.prefixNode+t.element_id,true)){var n={id:e,name:t.element_name,url:t.element_url,type:"isnotimage/xyz",isImage:false,place:BX(this.prefixNode+t.element_id,true)},o;if((t["element_type"]&&t["element_type"].indexOf("image/")===0||/(\.png|\.jpg|\.jpeg|\.gif|\.bmp)$/i.test(t.element_name))&&((o=BX.findChild(n.place,{tagName:"IMG"},true,false))&&o||i&&i["hasPreview"]===false)){n.type="image/xyz";n.src=t["element_thumbnail"]||t["element_url"];n.isImage=true;n.hasPreview=false;n.lowsrc="";n.width="";n.height="";if(BX(o)){n.hasPreview=true;n.lowsrc=t["element_thumbnail"]||o["src"];n.width=parseInt(o.getAttribute("data-bx-full-width"));n.height=parseInt(o.getAttribute("data-bx-full-height"))}}else if(this.parser.bxTag=="postimage"){return false}this.values[e]=n}return this.values[e]||false};s.prototype.bindFile=function(e){var t=e&&e["place"]?e["place"]:null;if(typeof e=="object"&&t&&!t.hasAttribute("bx-file-is-bound")){if(e.isImage&&e.hasPreview){var i=BX.findChild(t,{className:"feed-add-img-title"},true,false),n=BX.findChild(t,{className:"feed-add-img-wrap"},true,false);if(n){BX.bind(n,"click",BX.proxy(function(){this.insertFile(e)},this));n.style.cursor="pointer";n.title=BX.message("MPF_IMAGE")}if(i){BX.bind(i,"click",BX.delegate(function(){this.insertFile(e)},this));i.style.cursor="pointer";i.title=BX.message("MPF_IMAGE")}}else s.superclass.bindFile.apply(this,arguments)}};s.prototype.clean=function(){s.superclass.clean.apply(this,arguments);if(this["handler"]&&this.handler["agent"]&&this.handler.agent["inputName"]){var e,t,i=BX(this.manager.formID);e=BX.findChildren(i,{tagName:"INPUT",attribute:{name:this.handler.agent.inputName+"[]"}},true);if(e){for(t=0;t<e.length;t++){BX.remove(e[t])}}}};var a=function(t,i){this.params=i;this.formID=t;this.showPinButton=!!BX("lhe_button_editor_"+this.formID);if(this.showPinButton){this.params.showPanelEditor=!!this.params.pinEditorPanel}this.oEditorId=i["LHEJsObjId"];this.__divId=i["LHEJsObjName"]||i["LHEJsObjId"];e.handler[this.oEditorId]=this;this.oEditor=a.getEditor(this.oEditorId);this.urlPreview=this.initUrlPreview(i);this.eventNode=BX("div"+this.__divId);BX.addCustomEvent(this.eventNode,"OnShowLHE",BX.delegate(this.OnShowLHE,this));BX.addCustomEvent(this.eventNode,"OnButtonClick",BX.delegate(this.OnButtonClick,this));BX.addCustomEvent(this.eventNode,"OnAfterShowLHE",function(e,t){if(t.oEditor&&t.oEditor["AllowBeforeUnloadHandler"])t.oEditor.AllowBeforeUnloadHandler();if(t.monitoringWakeUp===true)t.monitoringStart()});BX.addCustomEvent(this.eventNode,"OnAfterHideLHE",function(e,t){t.monitoringWakeUp=t.monitoringStop();if(t.oEditor&&t.oEditor["DenyBeforeUnloadHandler"])t.oEditor.DenyBeforeUnloadHandler()});this.initParsers(i);this.initFiles(t,i);BX.ready(BX.delegate(function(){if(BX("lhe_button_submit_"+t,true)){BX.bind(BX("lhe_button_submit_"+t,true),"mousedown",function(){BX.addClass(this,"feed-add-button-press")});BX.bind(BX("lhe_button_submit_"+t,true),"mouseup",function(){BX.removeClass(this,"feed-add-button-press")});BX.bind(BX("lhe_button_submit_"+t,true),"click",BX.proxy(function(e){BX.onCustomEvent(this.eventNode,"OnButtonClick",["submit"]);return BX.PreventDefault(e)},this))}if(BX("lhe_button_cancel_"+t,true)){BX.bind(BX("lhe_button_cancel_"+t,true),"mousedown",function(){BX.addClass(this,"feed-add-button-press")});BX.bind(BX("lhe_button_cancel_"+t,true),"mouseup",function(){BX.removeClass(this,"feed-add-button-press")});BX.bind(BX("lhe_button_cancel_"+t,true),"click",BX.proxy(function(e){BX.onCustomEvent(this.eventNode,"OnButtonClick",["cancel"]);return BX.PreventDefault(e)},this))}},this));this.inited=true;BX.addCustomEvent(BX(this.formID),"onAutoSavePrepare",function(e){e.FORM.setAttribute("bx-lhe-autosave-prepared","Y")});BX.onCustomEvent(this,"onInitialized",[this,t,i,this.parsers]);BX.onCustomEvent(this.eventNode,"onInitialized",[this,t,i,this.parsers]);if(this.oEditor&&this.oEditor.inited&&!this.oEditor["__lhe_flags"]){BX.onCustomEvent(this.oEditor,"OnEditorInitedBefore",[this.oEditor]);BX.onCustomEvent(this.oEditor,"OnEditorInitedAfter",[this.oEditor,true])}};a.prototype={editorIsLoaded:false,arFiles:{},parser:{},controllers:{},exec:function(e,t){this.functionsToExec=this.functionsToExec||[];
3306if(typeof e=="function")this.functionsToExec.push([e,t]);if(this.editorIsLoaded===true){var i;while((i=this.functionsToExec.shift())&&i)i[0].apply(this,i[1])}},initParsers:function(e){this.parser={postimage:{exist:false,bxTag:"postimage",tag:"IMG ID",tags:["IMG ID"],regexp:/\[(IMG ID)=((?:\s|\S)*?)(?:\s*?WIDTH=(\d+)\s*?HEIGHT=(\d+))?\]/gi,code:"[IMG ID=#ID##ADDITIONAL#]",wysiwyg:'<img id="#ID#" src="'+'#SRC#" lowsrc="'+'#LOWSRC#" title=""#ADDITIONAL# />'}};var t=e["parsers"]?e["parsers"]:{};for(var n in t){if(t.hasOwnProperty(n)&&/[a-z]/gi.test(n+"")){this.parser[n]=new i(n,t[n])}}if(BX.util.object_search("UploadImage",t)){this.parser["postimage"]["exist"]=true}if(typeof e["arSize"]=="object"){var o="";if(e["arSize"]["width"])o+="max-width:"+e["arSize"]["width"]+"px;";if(e["arSize"]["height"])o+="max-height:"+e["arSize"]["height"]+"px;";if(o!=="")this.parser["postimage"]["wysiwyg"]=this.parser["postimage"]["wysiwyg"].replace("#ADDITIONAL#",'style="'+o+'" #ADDITIONAL#')}},initFiles:function(e,t){this.arFiles={};this.controllers={common:{postfix:"",storage:"bfile",parser:"postimage",node:window,obj:null,init:false}};if(!t["CID"]||typeof t["CID"]!=="object")return;BX.addCustomEvent(this.eventNode,"onFileIsAdded",BX.delegate(this.OnFileUploadSuccess,this));BX.addCustomEvent(this.eventNode,"onFileIsFailed",BX.delegate(this.OnFileUploadFailed,this));BX.addCustomEvent(this.eventNode,"onFileIsDeleted",BX.delegate(this.OnFileUploadRemove,this));BX.addCustomEvent(this.eventNode,"onFileIsDetected",BX.delegate(this.setContent,this));BX.addCustomEvent(this.eventNode,"onFileIsInserted",BX.delegate(this.insertFile,this));var i,a,r;for(a in t["CID"]){if(t["CID"].hasOwnProperty(a)){i=t["CID"][a]["parser"];if(i=="disk_file")this.controllers[a]=new n(this,a,t["CID"][a]);else if(i=="webdav_element")this.controllers[a]=new o(this,a,t["CID"][a]);else if(i=="file")this.controllers[a]=new s(this,a,t["CID"][a]);if(this.controllers[a]&&this.controllers[a].init()&&!r)r=true}}BX.ready(BX.delegate(function(){BX.bind(BX("bx-b-uploadfile-"+e),"click",BX.proxy(this.controllerInit,this));if(r)this.controllerInit("show")},this))},controllerInit:function(e){this.controllerInitStatus=e=="show"||e=="hide"?e:this.controllerInitStatus=="show"?"hide":"show";BX.onCustomEvent(this.eventNode,"onShowControllers",[this.controllerInitStatus])},initUrlPreview:function(){if(this.params["urlPreviewId"]&&window["BXUrlPreview"]&&BX(this.params["urlPreviewId"])){return new BXUrlPreview(BX(this.params["urlPreviewId"]))}return null},getContent:function(){return this.oEditor?this.oEditor.GetContent():""},setContent:function(e){if(this.oEditor)this.oEditor.SetContent(e)},OnFileUploadSuccess:function(e,t,i,n){if(this.controllers[t.id]){var o=t.parser.bxTag+e.id;this.arFiles[o]=this.arFiles[o]||[];this.arFiles[o].push(t.id);if(n&&n["referrerToEditor"]){var s=this.getFileToInsert(e,t);BX.onCustomEvent(n["referrerToEditor"],"OnImageDataUriCaughtUploaded",[s]);BX.onCustomEvent(this.oEditor,"OnImageDataUriCaughtUploaded",[n["referrerToEditor"],e,s])}else if(i===true&&e.isImage&&this.insertImageAfterUpload){if(!this._insertFile)this._insertFile=BX.delegate(this.insertFile,this);this.exec(this._insertFile,arguments)}}},OnFileUploadFailed:function(e,t,i){if(i&&i["referrerToEditor"]){BX.onCustomEvent(i["referrerToEditor"],"OnImageDataUriCaughtFailed",[]);BX.onCustomEvent(this.editor,"OnImageDataUriCaughtFailed",[i["referrerToEditor"]])}},OnFileUploadRemove:function(e,t){if(this.controllers[t.id]){var i=t.parser.bxTag+e.id;if(this.arFiles[i]){var n=BX.util.array_search(t.id,this.arFiles[i]);this.arFiles[i]=BX.util.deleteFromArray(this.arFiles[i],n);if(!this.arFiles[i]||this.arFiles[i].length<=0){this.arFiles[i]=null;delete this.arFiles[i];if(!this._deleteFile)this._deleteFile=BX.delegate(this.deleteFile,this);this.exec(this._deleteFile,arguments)}}}},showPanelEditor:function(e,t){if(e==undefined)e=!this.oEditor.toolbar.IsShown();this.params.showPanelEditor=e;var i=BX("lhe_button_editor_"+this.formID),n=BX("panel-close"+this.__divId);if(n){this.oEditor.dom.cont.appendChild(n)}if(e){this.oEditor.dom.toolbarCont.style.opacity="inherit";this.oEditor.toolbar.Show();if(i)BX.addClass(i,"feed-add-post-form-btn-active");if(n)n.style.display=""}else{this.oEditor.toolbar.Hide();if(i)BX.removeClass(i,"feed-add-post-form-btn-active");if(n)n.style.display="none"}if(t!==false)BX.userOptions.save("main.post.form","postEdit","showBBCode",e?"Y":"N")}
3306,monitoring:{interval:null,text:"",savedText:"",files:[],savedFiles:[]},monitoringStart:function(){if(this.monitoring.interval===null){if(!this._monitoringStart){this._monitoringStart=BX.delegate(this.checkFilesInText,this);BX.addCustomEvent(this.oEditor,"OnContentChanged",BX.proxy(function(e){this.monitoring.text=e},this))}this.monitoring.interval=setInterval(this._monitoringStart,1e3)}},monitoringStop:function(){var e=this.monitoring.interval!==null;if(this.monitoring.interval!==null)clearInterval(this.monitoring.interval);this.monitoring.interval=null;return e},monitoringSetStatus:function(e,t,i){if(this.arFiles[e+t]){var n;for(var o=0;o<this.arFiles[e+t].length;o++){this.monitoring.files.push(e+t);n=this.arFiles[e+t][o];BX.onCustomEvent(this.controllers[n],"onFileIsInText",[t,i])}}},checkFilesInText:function(){if(this.monitoring.text!==this.monitoring.savedText){this.monitoring.savedText=this.monitoring.text;this.monitoring.files=[];var e=this.monitoring.savedText,t,i=function(e,t){return function(i,n,o){e.monitoring.files.push([t,o].join("/"))}};for(t in this.parser){if(this.parser.hasOwnProperty(t)){if(!this.parser[t]["checkFilesInText"]){this.parser[t]["checkFilesInText"]=i(this,t)}e.replace(this.parser[t]["regexp"],this.parser[t]["checkFilesInText"])}}if(this.monitoring.savedFiles.join(",")!=this.monitoring.files.join(",")){var n=this.monitoring.files.join("|")+"|",o;for(t=0;t<this.monitoring.savedFiles.length;t++){o=this.monitoring.savedFiles[t];if(n.indexOf(o+"|")>=0)n=n.replace(o+"|","");else{o=o.split("/");this.monitoringSetStatus(o[0],o[1],false)}}n=n.substring(0,n.length-1).split("|");for(t=0;t<n.length;t++){o=o=n[t].split("/");this.monitoringSetStatus(o[0],o[1],true)}}this.monitoring.savedFiles=this.monitoring.files;if(this.monitoring.savedFiles.length<=0)this.monitoringStop()}},checkFile:function(e,t){var i=false;if(typeof e=="string"){var n=typeof t=="string"?t:t.parser;if(!!this.arFiles[n+e]){var o=this.arFiles[n+e][0];t=this.controllers[o];i={file:t.values[e],controller:t}}}else if(this.controllers[t.id]){i={file:e,controller:t}}return i},insertFile:function(e,t){var i=this.oEditor;if(i&&e){var n=i.GetViewMode(),o=this.getFileToInsert(e,t);if(n=="wysiwyg"){i.InsertHtml(o.replacement);setTimeout(BX.delegate(i.AutoResizeSceleton,i),500);setTimeout(BX.delegate(i.AutoResizeSceleton,i),1e3)}else if(n=="code"&&i.bbCode){i.textareaView.Focus();i.textareaView.WrapWith(false,false,o.replacement)}o["callback"]()}},getFileToInsert:function(e,t){var i=this.oEditor;if(i&&e){var n=e["id"],o="",s=t.parser,a=i.GetViewMode(),r=this.parser[s.bxTag][a];if(e["isImage"]){r=a=="wysiwyg"?this.parser["postimage"][a]:r;if(e.width>0&&e.height>0&&i.sEditorMode=="html"){o=' style="width:'+e.width+"px;height:"+e.height+'px;" onload="this.style=\' \'"'}}if(a=="wysiwyg"){r=r.replace("#ID#",i.SetBxTag(false,{tag:s.bxTag,params:{value:n}})).replace("#SRC#",e.src).replace("#URL#",e.url).replace("#LOWSRC#",e.lowsrc||"").replace("#NAME#",e.name).replace("#ADDITIONAL#",o)+"<span>&nbsp;</span>"}else if(a=="code"&&i.bbCode){r=r.replace("#ID#",n).replace("#ADDITIONAL#","")}return{replacement:r,callback:BX.proxy(function(){this.monitoringSetStatus(t.parser.bxTag,e.id,true);this.monitoringStart()},this)}}return{replacement:"",callback:BX.DoNothing}},deleteFile:function(e,t){var i=this.oEditor,n=t.parser,o=e.id,s=i.GetContent();if(n&&s.indexOf("="+o)>=0){if(i.GetViewMode()=="wysiwyg"){var a=i.GetIframeDoc(),r,d;for(r in i["bxTags"]){if(i["bxTags"].hasOwnProperty(r)){if(typeof i.bxTags[r]=="object"&&i.bxTags[r]["params"]&&i.bxTags[r]["params"]["value"]==e.id){d=a.getElementById(r);if(d)d.parentNode.removeChild(d)}}}i.SaveContent()}else{s=s.replace(n.regexp,function(t,i,n){return n==e.id?"":t});i.SetContent(s);i.Focus()}this.monitoringSetStatus(n.bxTag,e.id,false)}},reinit:function(e,t){BX.onCustomEvent(this.eventNode,"onReinitializeBefore",[this,e,t]);this.arFiles={};delete this.monitoringWakeUp;this.monitoringStop();this.oEditor.CheckAndReInit(e||"");BX.onCustomEvent(this.eventNode,"onReinitialize",[this,e,t]);var i,n=false;for(i in this.controllers){if(this.controllers.hasOwnProperty(i)){if(this.controllers[i]["init"]&&this.controllers[i].reinit(e,t))n=true}}this.controllerInit(n?"show":"hide");if(this.params["~height"]){this.oEditor.SetConfigHeight(this.params["~height"]);this.oEditor.ResizeSceleton()}if(this.urlPreview){this.urlPreview.detachUrlPreview();var o;for(var s in t){if(t.hasOwnProperty(s)&&t[s].hasOwnProperty("USER_TYPE_ID")&&t[s]["USER_TYPE_ID"]==="url_preview"){o=t[s]["VALUE"]}}if(o)this.urlPreview.attachUrlPreview({id:o})}},Parse:function(e,t,i){var n=this.parser[e],o=this;if(n){t=t.replace(n.regexp,function(t,s,a,r,d){var l=o.checkFile(a,e);
3307
3308if(l&&(l=l.file)&&l){var h="",f=l.isImage?o.parser.postimage.wysiwyg:n.wysiwyg;o.monitoringStart();if(l.isImage){r=parseInt(r);d=parseInt(d);h=r&&d?' width="'+r+'" height="'+d+'"':"";if(h===""&&l["width"]>0&&l["height"]>0){h=' style="width:'+l["width"]+"px;height:"+l["height"]+'px;" onload="this.style=\' \'"'}}return f.replace("#ID#",i.SetBxTag(false,{tag:e,params:{value:a}})).replace("#NAME#",l.name).replace("#SRC#",l.src).replace("#LOWSRC#",l.lowsrc).replace("#ADDITIONAL#",h).replace("#WIDTH#",parseInt(r)).replace("#HEIGHT#",parseInt(d))}return t})}return t},Unparse:function(e,t){var i="",n=e.tag;if(this.parser[n]){var o=parseInt(t.node.hasAttribute("width")?t.node.getAttribute("width"):0),s=parseInt(t.node.hasAttribute("height")?t.node.getAttribute("height"):0),a="";if(o>0&&s>0){a=" WIDTH="+o+" HEIGHT="+s}i=this.parser[n]["code"].replace("#ID#",e.params.value).replace("#ADDITIONAL#",a).replace("#WIDTH#",o).replace("#HEIGHT#",s)}return i},OnShowLHE:function(e,t,i){var n=this.__divId;e=e===false?false:e==="hide"?"hide":e==="justShow"?"justShow":true;this.oEditor=this.oEditor||a.getEditor(this.oEditorId);if(!this.oEditor)return;this.oEditor.Init();var o=BX("micro"+n),s=this.eventNode;if(o){o.style.display=e===true||e==="justShow"?"none":"block"}if(e=="hide"){BX.onCustomEvent(this.eventNode,"OnBeforeHideLHE",[e,this]);if(this.eventNode.style.display=="none"){BX.onCustomEvent(this.eventNode,"OnAfterHideLHE",[e,this])}else{new BX["easing"]({duration:200,start:{opacity:100,height:this.eventNode.scrollHeight},finish:{opacity:0,height:20},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:function(e){s.style.height=e.height+"px";s.style.opacity=e.opacity/100},complete:BX.proxy(function(){this.eventNode.style.cssText="";this.eventNode.style.display="none";BX.onCustomEvent(s,"OnAfterHideLHE",[e,this])},this)}).animate()}}else if(e){BX.onCustomEvent(this.eventNode,"OnBeforeShowLHE",[e,this]);if(e=="justShow"){this.eventNode.style.display="block";BX.onCustomEvent(this.eventNode,"OnAfterShowLHE",[e,this]);if(i!==false)this.oEditor.Focus()}else if(this.eventNode.style.display=="block"){BX.onCustomEvent(this.eventNode,"OnAfterShowLHE",[e,this]);if(i!==false)this.oEditor.Focus()}else{BX.adjust(this.eventNode,{style:{display:"block",overflow:"hidden",height:"20px",opacity:.1}});new BX["easing"]({duration:200,start:{opacity:10,height:20},finish:{opacity:100,height:s.scrollHeight},transition:BX["easing"].makeEaseOut(BX.easing.transitions.quad),step:function(e){s.style.height=e.height+"px";s.style.opacity=e.opacity/100},complete:BX.proxy(function(){BX.onCustomEvent(s,"OnAfterShowLHE",[e,this]);this.oEditor.Focus();this.eventNode.style.cssText=""},this)}).animate()}}else{BX.onCustomEvent(this.eventNode,"OnBeforeHideLHE",[e,this]);this.eventNode.style.display="none";BX.onCustomEvent(this.eventNode,"OnAfterHideLHE",[e,this])}},OnButtonClick:function(e){if(e!="cancel"){BX.onCustomEvent(this.eventNode,"OnClickSubmit",[this])}else{BX.onCustomEvent(this.eventNode,"OnClickCancel",[this]);BX.onCustomEvent(this.eventNode,"OnShowLHE",["hide"])}},OnEditorInitedBefore:function(e){var t=this;this.oEditor=e;e.formID=this.formID;if(this.params)this.params["~height"]=e.config["height"];BX.addCustomEvent(e,"OnCtrlEnter",function(){e.SaveContent();if(t.params&&t.params["ctrlEnterHandler"]&&typeof window[t.params["ctrlEnterHandler"]]=="function")window[t.params["ctrlEnterHandler"]]();else BX.submit(BX(t.formID))});var i=this.params.parsers?this.params.parsers:[];if(BX.util.object_search("Spoiler",i)){e.AddButton({id:"spoiler",name:BX.message("spoilerText"),iconClassName:"spoiler",disabledForTextarea:false,src:BX.message("MPF_TEMPLATE_FOLDER")+"/images/lhespoiler.png",toolbarSort:205,handler:function(){var e=this,t=false;if(!e.editor.bbCode||!e.editor.synchro.IsFocusedOnTextarea()){t=e.editor.action.actions.formatBlock.exec("formatBlock","blockquote","bx-spoiler",false,{bxTagParams:{tag:"spoiler"}})}
3308else{t=e.editor.action.actions.formatBbCode.exec("quote",{tag:"SPOILER"})}return t}});e.AddParser({name:"spoiler",obj:{Parse:function(e,t,i){if(/\[(cut|spoiler)(([^\]])*)\]/gi.test(t)){t=t.replace(/[\001-\006]/gi,"").replace(/\[cut(((?:=)[^\]]*)|)\]/gi,"�$1�").replace(/\[\/cut]/gi,"�").replace(/\[spoiler([^\]]*)\]/gi,"�$1�").replace(/\[\/spoiler]/gi,"�");var n=/(?:\001([^\001]*)\001)([^\001-\004]+)\002/gi,o=/(?:\003([^\003]*)\003)([^\001-\004]+)\004/gi,s=function(e,t){e=e.replace(/^(="|='|=)/gi,"").replace(/("|')?$/gi,"");return'<blockquote class="bx-spoiler" id="'+i.SetBxTag(false,{tag:"spoiler"})+'" title="'+e+'">'+t+"</blockquote>"},a=function(e,t,i){return s(t,i)};while(t.match(n)||t.match(o)){t=t.replace(n,a).replace(o,a)}}t=t.replace(/\001([^\001]*)\001/gi,"[cut$1]").replace(/\003([^\003]*)\003/gi,"[spoiler$1]").replace(/\002/gi,"[/cut]").replace(/\004/gi,"[/spoiler]");return t},UnParse:function(t,i){if(t.tag=="spoiler"){var n="",o;for(o=0;o<i.node.childNodes.length;o++){n+=e.bbParser.GetNodeHtml(i.node.childNodes[o])}n=BX.util.trim(n);if(n!="")return"[SPOILER"+(i.node.hasAttribute("title")?"="+i.node.getAttribute("title"):"")+"]"+n+"[/SPOILER]"}return""}}})}if(BX.util.object_search("MentionUser",i)){e.AddParser({name:"postuser",obj:{Parse:function(t,i){i=i.replace(/\[USER\s*=\s*(\d+)\]((?:\s|\S)*?)\[\/USER\]/gi,function(t,i,n){n=BX.util.trim(n);if(n=="")return"";return'<span id="'+e.SetBxTag(false,{tag:"postuser",params:{value:parseInt(i)}})+'" class="bxhtmled-metion">'+n+"</span>"});return i},UnParse:function(t,i){if(t.tag=="postuser"){var n="",o;for(o=0;o<i.node.childNodes.length;o++){n+=e.bbParser.GetNodeHtml(i.node.childNodes[o])}n=BX.util.trim(n);if(n!="")return"[USER="+t.params.value+"]"+n+"[/USER]"}return""}}})}var n=function(i,n){return t.Parse(i,n,e)},o=function(e,i){return t.Unparse(e,i)};for(var s in this.parser){if(this.parser.hasOwnProperty(s)){e.AddParser({name:s,obj:{Parse:n,UnParse:o}})}}if(this.showPinButton){this.pinEditorPanel=this.params&&this.params.pinEditorPanel===true;var a="toolbar_pin";var r=function(e,i){r.superclass.constructor.apply(this,arguments);this.id=a;this.title=BX.message("MPF_PIN_EDITOR_PANNEL");this.className+=" "+(t.pinEditorPanel?"bxhtmled-button-toolbar-pined":"bxhtmled-button-toolbar-pin");this.Create();if(i)i.appendChild(this.GetCont())};BX.extend(r,window.BXHtmlEditor.Button);r.prototype.OnClick=function(){BX.removeClass(this.pCont,"bxhtmled-button-toolbar-pined");BX.removeClass(this.pCont,"bxhtmled-button-toolbar-pin");if(t.pinEditorPanel){t.pinEditorPanel=false;BX.addClass(this.pCont,"bxhtmled-button-toolbar-pin")}else{t.pinEditorPanel=true;BX.addClass(this.pCont,"bxhtmled-button-toolbar-pined")}BX.userOptions.save("main.post.form","postEdit","pinEditorPanel",t.pinEditorPanel?"Y":"N")};window.BXHtmlEditor.Controls[a]=r;BX.addCustomEvent(e,"GetControlsMap",function(e){e.push({id:a,compact:true,hidden:false,sort:500,checkWidth:true,offsetWidth:32,wrap:"right"})})}},OnEditorInitedAfter:function(e){BX.addCustomEvent(e,"OnIframeDrop",BX.proxy(function(){BX.onCustomEvent(this.eventNode,"OnIframeDrop",arguments)},this));BX.addCustomEvent(e,"OnIframeDragOver",BX.proxy(function(){BX.onCustomEvent(this.eventNode,"OnIframeDragOver",arguments)},this));BX.addCustomEvent(e,"OnIframeDragLeave",BX.proxy(function(){BX.onCustomEvent(this.eventNode,"OnIframeDragLeave",arguments)},this));BX.addCustomEvent(e,"OnImageDataUriHandle",BX.proxy(function(){BX.onCustomEvent(this.eventNode,"OnImageDataUriHandle",arguments)},this));BX.addCustomEvent(e,"OnAfterUrlConvert",this.OnAfterUrlConvert.bind(this));BX.addCustomEvent(e,"OnBeforeCommandExec",this.OnBeforeCommandExec.bind(this));e.contextMenu.items["postimage"]=e.contextMenu.items["postdocument"]=e.contextMenu.items["postfile"]=[{TEXT:BX.message("BXEdDelFromText"),bbMode:true,ACTION:function(){var t=e.contextMenu.GetTargetItem("postimage");if(!t)t=e.contextMenu.GetTargetItem("postdocument");if(!t)t=e.contextMenu.GetTargetItem("postfile");if(t&&t.element){e.selection.RemoveNode(t.element)}e.contextMenu.Hide()}}];if(!this.params["lazyLoad"]){BX.onCustomEvent(this.eventNode,"OnShowLHE",["justShow",e,false])}if(e.toolbar.controls&&e.toolbar.controls.FontSelector){e.toolbar.controls.FontSelector.SetWidth(45)}BX.addCustomEvent(BX(this.formID),"onAutoSavePrepare",function(t){var i=t;setTimeout(function(){BX.addCustomEvent(e,"OnContentChanged",BX.proxy(function(e){this["mpfTextContent"]=e;this.Init()},i))},1500)});BX.addCustomEvent(BX(this.formID),"onAutoSave",BX.proxy(function(e,t){if(BX.type.isNotEmptyString(e["mpfTextContent"]))t["text"+this.formID]=e["mpfTextContent"]},this));BX.addCustomEvent(BX(this.formID),"onAutoSaveRestore",BX.proxy(function(t,i){if(i["text"+this.formID]&&/[^\s]+/gi.test(i["text"+this.formID])){e.CheckAndReInit(i["text"+this.formID])}},this));if(BX(this.formID)&&BX(this.formID).hasAttribute("bx-lhe-autosave-prepared")&&BX(this.formID).BXAUTOSAVE){BX(this.formID).removeAttribute("bx-lhe-autosave-prepared");setTimeout(BX.proxy(function(){BX(this.formID).BXAUTOSAVE.Prepare()},this),100)}var t=this.formID,i=this.params;this.showPanelEditor(i.showPanelEditor,false);
3308if(!e.mainPostFormCustomized){e.mainPostFormCustomized=true;BX.addCustomEvent(e,"OnIframeKeydown",function(i){if(window.onKeyDownHandler){window.onKeyDownHandler(i,e,t)}});BX.addCustomEvent(e,"OnIframeKeyup",function(i){if(window.onKeyUpHandler){window.onKeyUpHandler(i,e,t)}});if(window["BXfpdStopMent"+t]){BX.addCustomEvent(e,"OnIframeClick",function(){window["BXfpdStopMent"+t]()})}if(e&&e.textareaView.GetCursorPosition){BX.addCustomEvent(e,"OnTextareaKeyup",function(i){if(window.onTextareaKeyUpHandler){window.onTextareaKeyUpHandler(i,e,t)}});BX.addCustomEvent(e,"OnTextareaKeydown",function(i){if(window.onTextareaKeyDownHandler){window.onTextareaKeyDownHandler(i,e,t)}})}}},OnAfterUrlConvert:function(e){if(this.urlPreview){this.urlPreview.attachUrlPreview({url:e})}},OnBeforeCommandExec:function(e,t,i,n){if(this.urlPreview&&t=="createLink"&&BX.type.isPlainObject(n)&&n.hasOwnProperty("href")){this.urlPreview.attachUrlPreview({url:n.href})}}};a.getEditor=function(e){return window["BXHtmlEditor"]?window["BXHtmlEditor"].Get(typeof e=="object"?e.id:e):null};a.getHandler=function(t){return e.handler[typeof t=="object"?t.id:t]};a.unsetHandler=function(t){var i=typeof t=="object"?t.id:t;if(!e.handler[i])return;if(e.handler[i].oEditor)e.handler[i].oEditor.Destroy();e.handler[i]=null};a.reinitData=function(e,t,i){var n=a.getHandler(e);if(n)n.exec(n.reinit,[t,i]);return false};a.reinitDataBefore=function(e){var t=a.getHandler(e);if(t&&t["eventNode"])BX.onCustomEvent(t.eventNode,"onReinitializeBefore",[t])};window.LHEPostForm=a;window.BXPostFormTags=function(e,t){this.popup=null;this.formID=e;this.buttonID=t;this.sharpButton=null;this.addNewLink=null;this.tagsArea=null;this.hiddenField=null;this.popupContent=null;BX.ready(BX.proxy(this.init,this))};window.BXPostFormTags.prototype.init=function(){this.sharpButton=BX(this.buttonID);this.addNewLink=BX("post-tags-add-new-"+this.formID);this.tagsArea=BX("post-tags-block-"+this.formID);this.tagsContainer=BX("post-tags-container-"+this.formID);this.hiddenField=BX("post-tags-hidden-"+this.formID);this.popupContent=BX("post-tags-popup-content-"+this.formID);this.popupInput=BX.findChild(this.popupContent,{tag:"input"});var e=BX.findChildren(this.tagsContainer,{className:"feed-add-post-del-but"},true);for(var t=0,i=e.length;t<i;t++){BX.bind(e[t],"click",BX.proxy(this.onTagDelete,{obj:this,tagBox:e[t].parentNode,tagValue:e[t].parentNode.getAttribute("data-tag")}))}BX.bind(this.sharpButton,"click",BX.proxy(this.onButtonClick,this));BX.bind(this.addNewLink,"click",BX.proxy(this.onAddNewClick,this))};window.BXPostFormTags.prototype.onTagDelete=function(){BX.remove(this.tagBox);this.obj.hiddenField.value=this.obj.hiddenField.value.replace(this.tagValue+",","").replace("  "," ")};window.BXPostFormTags.prototype.show=function(){if(this.popup===null){this.popup=new BX.PopupWindow("bx-post-tag-popup",this.addNewLink,{content:this.popupContent,lightShadow:false,offsetTop:8,offsetLeft:10,autoHide:true,angle:true,closeByEsc:true,zIndex:-840,buttons:[new BX.PopupWindowButton({text:BX.message("TAG_ADD"),events:{click:BX.proxy(this.onTagAdd,this)}})]});BX.bind(this.popupInput,"keydown",BX.proxy(this.onKeyPress,this));BX.bind(this.popupInput,"keyup",BX.proxy(this.onKeyPress,this))}this.popup.show();BX.focus(this.popupInput)};window.BXPostFormTags.prototype.addTag=function(e){var t=BX.type.isNotEmptyString(e)?e.split(","):this.popupInput.value.split(",");var i=[];for(var n=0;n<t.length;n++){var o=BX.util.trim(t[n]);if(o.length>0){var s=this.hiddenField.value.split(",");if(!BX.util.in_array(o,s)){var a;var r=BX.create("span",{children:[a=BX.create("span",{attrs:{"class":"feed-add-post-del-but"}})],attrs:{"class":"feed-add-post-tags"}});r.insertBefore(document.createTextNode(o),a);this.tagsContainer.insertBefore(r,this.addNewLink);BX.bind(a,"click",BX.proxy(this.onTagDelete,{obj:this,tagBox:r,tagValue:o}));this.hiddenField.value+=o+",";i.push(o)}}}return i};window.BXPostFormTags.prototype.onTagAdd=function(){this.addTag();this.popupInput.value="";this.popup.close()};window.BXPostFormTags.prototype.onAddNewClick=function(e){e=e||window.event;this.show();BX.PreventDefault(e)};window.BXPostFormTags.prototype.onButtonClick=function(e){e=e||window.event;BX.show(this.tagsArea);this.show();BX.PreventDefault(e)};window.BXPostFormTags.prototype.onKeyPress=function(e){e=e||window.event;var t=e.keyCode?e.keyCode:e.which?e.which:null;if(t==13){setTimeout(BX.proxy(this.onTagAdd,this),0)}};window.BXPostFormImportant=function(e,t,i){if(i){this.formID=e;this.buttonID=t;this.inputName=i;this.fireButton=null;this.activeBlock=null;this.hiddenField=null;BX.ready(BX.proxy(this.init,this))}return false};window.BXPostFormImportant.prototype.init=function(){this.fireButton=BX(this.buttonID);this.activeBlock=BX(this.buttonID+"-active");var e=BX(this.formID);if(e){this.hiddenField=e[this.inputName];if(this.hiddenField&&this.hiddenField.value==1){this.showActive()}}BX.bind(this.fireButton,"click",BX.proxy(function(e){e=e||window.event;this.showActive();BX.PreventDefault(e)},this));BX.bind(this.activeBlock,"click",BX.proxy(function(e){e=e||window.event;this.hideActive();BX.PreventDefault(e)},this))};window.BXPostFormImportant.prototype.showActive=function(e){BX.hide(this.fireButton);BX.show(this.activeBlock,"inline-block");if(this.hiddenField){this.hiddenField.value=1}return false};window.BXPostFormImportant.prototype.hideActive=function(e){BX.hide(this.activeBlock);BX.show(this.fireButton,"inline-block");if(this.hiddenField){this.hiddenField.value=0}return false};var r=null;
3308window.MPFbuttonShowWait=function(e){if(e&&!BX.type.isElementNode(e))e=null;e=e||this;e=e?e.tagName=="A"?e:e.parentNode:e;if(e){BX.addClass(e,"feed-add-button-load");r=e;BX.defer(function(){e.disabled=true})()}};window.MPFbuttonCloseWait=function(e){if(e&&!BX.type.isElementNode(e))e=null;e=e||r||this;if(e){e.disabled=false;BX.removeClass(e,"feed-add-button-load");r=null}};window.__mpf_wd_getinfofromnode=function(e,t){var i=BX.findChild(BX((e["prefixNode"]||"wd-doc")+e.element_id),{className:"files-preview",tagName:"IMG"},true,false);if(i){e.lowsrc=i.src;e.element_url=i.src.replace(/\Wwidth=(\d+)/,"").replace(/\Wheight\=(\d+)/,"");e.width=parseInt(i.getAttribute("data-bx-full-width"));e.height=parseInt(i.getAttribute("data-bx-full-height"))}else if(t.urlGet){e.element_url=t.urlGet.replace("#element_id#",e.element_id).replace("#ELEMENT_ID#",e.element_id).replace("#element_name#",e.element_name).replace("#ELEMENT_NAME#",e.element_name)}};var d={listen:false,plus:false,text:"",bSearch:false};window.BXfpdSelectCallback=function(e,t,i,n){BX.SocNetLogDestination.BXfpSelectCallback({item:e,type:t,bUndeleted:n,containerInput:BX("feed-add-post-destination-item"),valueInput:BX("feed-add-post-destination-input"),formName:window.BXSocNetLogDestinationFormName,tagInputName:"bx-destination-tag",tagLink1:BX.message("BX_FPD_LINK_1"),tagLink2:BX.message("BX_FPD_LINK_2")})};window.onKeyDownHandler=function(e,t,i){var n=e.keyCode;if(!window["BXfpdStopMent"+i])return true;if(n==107||(e.shiftKey||e.modifiers>3)&&BX.util.in_array(n,[187,50,107,43,61])||e.altKey&&BX.util.in_array(n,[76])){setTimeout(function(){var e=t.selection.GetRange(),n=t.GetIframeDoc(),o=e?e.endContainer.textContent:"",s=o?o.slice(e.endOffset-1,e.endOffset):"",a=o?o.slice(e.endOffset-2,e.endOffset-1):"";if((s=="@"||s=="+")&&(!a||BX.util.in_array(a,["+","@",",","("])||a.length==1&&BX.util.trim(a)==="")){d.listen=true;d.listenFlag=true;d.text="";d.leaveContent=true;e.setStart(e.endContainer,e.endOffset-1);e.setEnd(e.endContainer,e.endOffset);t.selection.SetSelection(e);var r=BX.create("SPAN",{props:{id:"bx-mention-node"}},n);t.selection.Surround(r,e);e.setStart(r,1);e.setEnd(r,1);t.selection.SetSelection(e);if(!BX.SocNetLogDestination.isOpenDialog()){BX.SocNetLogDestination.openDialog(window["BXSocNetLogDestinationFormNameMent"+i],{bindNode:l(r,t)})}}},10)}if(d.listen){var o=d.bSearch?"search":BX.SocNetLogDestination.obTabSelected[window["BXSocNetLogDestinationFormNameMent"+i]];if(n==t.KEY_CODES["enter"]){BX.SocNetLogDestination.selectCurrentItem(o,window["BXSocNetLogDestinationFormNameMent"+i]);t.iframeKeyDownPreventDefault=true;BX.PreventDefault(e)}else if(n==t.KEY_CODES["left"]){BX.SocNetLogDestination.moveCurrentItem(o,window["BXSocNetLogDestinationFormNameMent"+i],"left");t.iframeKeyDownPreventDefault=true;BX.PreventDefault(e)}else if(n==t.KEY_CODES["right"]){BX.SocNetLogDestination.moveCurrentItem(o,window["BXSocNetLogDestinationFormNameMent"+i],"right");t.iframeKeyDownPreventDefault=true;BX.PreventDefault(e)}else if(n==t.KEY_CODES["up"]){BX.SocNetLogDestination.moveCurrentItem(o,window["BXSocNetLogDestinationFormNameMent"+i],"up");t.iframeKeyDownPreventDefault=true;BX.PreventDefault(e)}else if(n==t.KEY_CODES["down"]){BX.SocNetLogDestination.moveCurrentItem(o,window["BXSocNetLogDestinationFormNameMent"+i],"down");t.iframeKeyDownPreventDefault=true;BX.PreventDefault(e)}}if(!d.listen&&d.listenFlag&&n===t.KEY_CODES["enter"]){var s=t.selection.GetRange();if(s.collapsed){var a=s.endContainer,r=t.GetIframeDoc();if(a){if(a.className!=="bxhtmled-metion"){a=BX.findParent(a,function(e){return e.className=="bxhtmled-metion"},r.body)}if(a&&a.className=="bxhtmled-metion"){t.selection.SetAfter(a)}}}}};window.onKeyUpHandler=function(e,t,i){var n=e.keyCode,o,s,a;if(!window["BXfpdStopMent"+i])return true;if(d.listen===true){if(n==t.KEY_CODES["escape"]){window["BXfpdStopMent"+i]()}else if(n!==t.KEY_CODES["enter"]&&n!==t.KEY_CODES["left"]&&n!==t.KEY_CODES["right"]&&n!==t.KEY_CODES["up"]&&n!==t.KEY_CODES["down"]){o=t.GetIframeDoc();var r=o.getElementById("bx-mention-node");if(r){a=BX.util.trim(t.util.GetTextContent(r));var h=a;a=a.replace(/^[\+@]*/,"");d.bSearch=a.length>0;BX.SocNetLogDestination.search(a,true,window["BXSocNetLogDestinationFormNameMent"+i],BX.message("MPF_NAME_TEMPLATE"),{bindNode:l(r,t)});if(d.leaveContent&&d._lastText&&h===""){window["BXfpdStopMent"+i]()}else if(d.leaveContent&&d.lastText&&h!==""&&a===""){d.bSearch=false;window["BXfpdStopMent"+i]();BX.SocNetLogDestination.openDialog(window["BXSocNetLogDestinationFormNameMent"+i],{bindNode:l(r,t)})}d.lastText=a;d._lastText=h}else{window["BXfpdStopMent"+i]()}}}else{if(!e.shiftKey&&(n===t.KEY_CODES["space"]||n===t.KEY_CODES["escape"]||n===188||n===190)){s=t.selection.GetRange();if(s.collapsed){var f=s.endContainer;o=t.GetIframeDoc();if(f){if(f.className!=="bxhtmled-metion"){f=BX.findParent(f,function(e){return e.className=="bxhtmled-metion"},o.body)}if(f&&f.className=="bxhtmled-metion"){a=t.util.GetTextContent(f);var u=a.match(/[\s\.\,]$/);if(u||n===t.KEY_CODES["escape"]){f.innerHTML=a.replace(/[\s\.\,]$/,"");var c=BX.create("SPAN",{html:u||t.INVISIBLE_SPACE},o);t.util.InsertAfter(c,f);t.selection.SetAfter(c)}}}}}}};
3308window.onTextareaKeyDownHandler=function(e,t,i){var n=e.keyCode;if(d.listen&&n==t.KEY_CODES["enter"]){BX.SocNetLogDestination.selectFirstSearchItem(window["BXSocNetLogDestinationFormNameMent"+i]);t.textareaKeyDownPreventDefault=true;BX.PreventDefault(e)}};window.onTextareaKeyUpHandler=function(e,t,i){var n,o,s=e.keyCode;if(d.listen===true){if(s==27){window["BXfpdStopMent"+i]()}else if(s!==13){o=t.textareaView.GetValue(false);n=t.textareaView.GetCursorPosition();if(o.indexOf("+")!==-1||o.indexOf("@")!==-1){var a=o.substr(0,n),r=Math.max(a.lastIndexOf("+"),a.lastIndexOf("@"));if(r>=0){var l=a.substr(r),h=l;l=l.replace(/^[\+@]*/,"");if(BX.SocNetLogDestination&&!BX.SocNetLogDestination.isOpenDialog()){BX.SocNetLogDestination.openDialog(window["BXSocNetLogDestinationFormNameMent"+i])}d.bSearch=l.length>0;if(BX.SocNetLogDestination)BX.SocNetLogDestination.search(l,true,window["BXSocNetLogDestinationFormNameMent"+i],BX.message("MPF_NAME_TEMPLATE"));if(d.leaveContent&&d._lastText&&h===""){window["BXfpdStopMent"+i]()}else if(d.leaveContent&&d.lastText&&h!==""&&l===""){window["BXfpdStopMent"+i]();if(BX.SocNetLogDestination)BX.SocNetLogDestination.openDialog(window["BXSocNetLogDestinationFormNameMent"+i])}d.lastText=l;d._lastText=h}}}}else{if(s==16){var f=this;this.shiftPressed=true;if(this.shiftTimeout)this.shiftTimeout=clearTimeout(this.shiftTimeout);this.shiftTimeout=setTimeout(function(){f.shiftPressed=false},100)}if(s==107||(e.shiftKey||e.modifiers>3||this.shiftPressed)&&BX.util.in_array(s,[187,50,107,43,61])){n=t.textareaView.element.selectionStart;if(n>0){o=t.textareaView.element.value;var u=o.substr(n-1,1);if(u&&(u==="+"||u==="@")){d.listen=true;d.listenFlag=true;d.text="";d.textarea=true;if(!BX.SocNetLogDestination.isOpenDialog()){BX.SocNetLogDestination.openDialog(window["BXSocNetLogDestinationFormNameMent"+i])}}}}}};var l=function(e,t){var i=BX.pos(e),n=BX.pos(t.dom.areaCont),o=BX.GetWindowScrollPos(t.GetIframeDoc()),s=n.top+i.bottom-o.scrollTop+2,a=n.left+i.right-o.scrollLeft;return{top:s,left:a}};window.BxInsertMention=function(e){var t=e.item,i=e.type,n=e.formID,o=e.editorId,s=e.bNeedComa,r=a.getEditor(o),l;if(i=="users"&&t&&t.entityId>0&&r){if(r.GetViewMode()=="wysiwyg"){var h=r.GetIframeDoc(),f=r.selection.GetRange(),u=h.getElementById("bx-mention-node"),c=BX.create("SPAN",{props:{className:"bxhtmled-metion"},text:BX.util.htmlspecialcharsback(t.name)},h);l=BX.create("SPAN",{html:s?",&nbsp;":"&nbsp;"},h);r.SetBxTag(c,{tag:"postuser",params:{value:t.entityId}});if(u){r.util.ReplaceNode(u,c)}else{r.selection.InsertNode(c,f)}if(c&&c.parentNode){var p=BX.findParent(c,{className:"bxhtmled-metion"},h.body);if(p){r.util.InsertAfter(c,p)}}if(c&&c.parentNode){r.util.InsertAfter(l,c);r.selection.SetAfter(l)}}else if(r.GetViewMode()=="code"&&r.bbCode){r.textareaView.Focus();var m=r.textareaView.GetValue(false),g=r.textareaView.GetCursorPosition(),B=m.substr(0,g),v=Math.max(B.lastIndexOf("+"),B.lastIndexOf("@"));if(v>=0&&g>v){r.textareaView.SetValue(m.substr(0,v)+m.substr(g));r.textareaView.element.setSelectionRange(v,v)}r.textareaView.WrapWith(false,false,"[USER="+t.entityId+"]"+t.name+"[/USER]"+(s?", ":" "))}delete BX.SocNetLogDestination.obItemsSelected[window["BXSocNetLogDestinationFormNameMent"+n]][t.id];window["BXfpdStopMent"+n]();d["text"]="";if(r.GetViewMode()=="wysiwyg"){r.Focus();r.selection.SetAfter(l)}}};window.MPFMentionInit=function(e,t){if(!t["items"]["departmentRelation"]){t["items"]["departmentRelation"]=BX.SocNetLogDestination.buildDepartmentRelation(t["items"]["department"])}window["departmentRelation"]=t["items"]["departmentRelation"];if(t["initDestination"]===true){window.BXSocNetLogDestinationFormName="destination"+(""+(new Date).getTime()).substr(6);window.BXSocNetLogDestinationDisableBackspace=null;BX.SocNetLogDestination.init({name:window.BXSocNetLogDestinationFormName,searchInput:BX("feed-add-post-destination-input"),extranetUser:t["extranetUser"],bindMainPopup:{node:BX("feed-add-post-destination-container"),offsetTop:"5px",offsetLeft:"15px"},bindSearchPopup:{node:BX("feed-add-post-destination-container"),offsetTop:"5px",offsetLeft:"15px"},callback:{select:window["BXfpdSelectCallback"],unSelect:BX.delegate(BX.SocNetLogDestination.BXfpUnSelectCallback,{formName:window.BXSocNetLogDestinationFormName,inputContainerName:"feed-add-post-destination-item",inputName:"feed-add-post-destination-input",tagInputName:"bx-destination-tag",tagLink1:BX.message("BX_FPD_LINK_1"),tagLink2:BX.message("BX_FPD_LINK_2")}),openDialog:BX.delegate(BX.SocNetLogDestination.BXfpOpenDialogCallback,{inputBoxName:"feed-add-post-destination-input-box",inputName:"feed-add-post-destination-input",tagInputName:"bx-destination-tag"}),closeDialog:BX.delegate(BX.SocNetLogDestination.BXfpCloseDialogCallback,{inputBoxName:"feed-add-post-destination-input-box",inputName:"feed-add-post-destination-input",tagInputName:"bx-destination-tag"}),openSearch:BX.delegate(BX.SocNetLogDestination.BXfpOpenDialogCallback,{inputBoxName:"feed-add-post-destination-input-box",inputName:"feed-add-post-destination-input",tagInputName:"bx-destination-tag"}),closeSearch:BX.delegate(BX.SocNetLogDestination.BXfpCloseSearchCallback,{inputBoxName:"feed-add-post-destination-input-box",inputName:"feed-add-post-destination-input",tagInputName:"bx-destination-tag"})},items:t["items"],itemsLast:t["itemsLast"],itemsSelected:t["itemsSelected"],isCrmFeed:t["isCrmFeed"],useClientDatabase:!!t["useClientDatabase"],destSort:t["destSort"],allowAddUser:t["allowAddUser"],allowAddCrmContact:t["allowAddCrmContact"],allowSearchCrmEmailUsers:typeof t["allowSearchCrmEmailUsers"]!="undefined"?!!t["allowSearchCrmEmailUsers"]:false,userNameTemplate:typeof t["userNameTemplate"]!="undefined"?t["userNameTemplate"]:""});BX.bind(BX("feed-add-post-destination-input"),"keyup",BX.delegate(BX.SocNetLogDestination.BXfpSearch,{formName:window.BXSocNetLogDestinationFormName,inputName:"feed-add-post-destination-input",tagInputName:"bx-destination-tag"}));BX.bind(BX("feed-add-post-destination-input"),"keydown",BX.delegate(BX.SocNetLogDestination.BXfpSearchBefore,{formName:window.BXSocNetLogDestinationFormName,inputName:"feed-add-post-destination-input"}));BX.bind(BX("bx-destination-tag"),"focus",function(e){BX.SocNetLogDestination.openDialog(window.BXSocNetLogDestinationFormName,{bByFocusEvent:true});return BX.PreventDefault(e)});BX.bind(BX("feed-add-post-destination-container"),"click",function(e){BX.SocNetLogDestination.openDialog(window.BXSocNetLogDestinationFormName);return BX.PreventDefault(e)});if(t["itemsHidden"]){for(var i in t["itemsHidden"]){if(t["itemsHidden"].hasOwnProperty(i)){window.BXfpdSelectCallback({id:"SG"+t["itemsHidden"][i]["ID"],name:t["itemsHidden"][i]["NAME"]},"sonetgroups","",true)}}}BX.SocNetLogDestination.BXfpSetLinkName({formName:window.BXSocNetLogDestinationFormName,tagInputName:"bx-destination-tag",tagLink1:BX.message("BX_FPD_LINK_1"),tagLink2:BX.message("BX_FPD_LINK_2")})}window["BXfpdSelectCallbackMent"+e]=function(i,n,o){window.BxInsertMention({item:i,type:n,formID:e,editorId:t["editorId"]})};window["BXfpdStopMent"+e]=function(){BX.SocNetLogDestination.closeDialog();BX.SocNetLogDestination.closeSearch();clearTimeout(BX.SocNetLogDestination.searchTimeout);BX.SocNetLogDestination.searchOnSuccessHandle=false};window["BXfpdOnDialogOpen"+e]=function(){d.listen=true;d.listenFlag=true};window["BXfpdOnDialogClose"+e]=function(){d.listen=false;setTimeout(function(){d.listenFlag=false;if(!d.listen){var e=a.getEditor(t.editorId);if(e){var i=e.GetIframeDoc(),n=i.getElementById("bx-mention-node");if(n){e.selection.SetAfter(n);if(d.leaveContent){e.util.ReplaceWithOwnChildren(n)}else{BX.remove(n)}}e.Focus()}}},100)};window["BXSocNetLogDestinationFormNameMent"+e]="mention"+(""+(new Date).getTime()).substr(5);window["BXSocNetLogDestinationDisableBackspace"]=null;var n=BX("bx-b-mention-"+e);
3308if(typeof t["items"]["extranetRoot"]!="undefined"){t["items"]["departmentExtranet"]=BX.clone(t["items"]["department"]);for(var o in t["items"]["extranetRoot"]){if(t["items"]["extranetRoot"].hasOwnProperty(o)){t["items"]["departmentExtranet"][o]=t["items"]["extranetRoot"][o]}}t["items"]["departmentRelationExtranet"]=BX.SocNetLogDestination.buildDepartmentRelation(t["items"]["departmentExtranet"])}BX.SocNetLogDestination.init({name:window["BXSocNetLogDestinationFormNameMent"+e],searchInput:n,extranetUser:t["extranetUser"],bindMainPopup:{node:n,offsetTop:"1px",offsetLeft:"12px"},bindSearchPopup:{node:n,offsetTop:"1px",offsetLeft:"12px"},callback:{select:window["BXfpdSelectCallbackMent"+e],openDialog:window["BXfpdOnDialogOpen"+e],closeDialog:window["BXfpdOnDialogClose"+e],openSearch:window["BXfpdOnDialogOpen"+e],closeSearch:window["BXfpdOnDialogClose"+e]},items:{users:t["items"]["mentionUsers"],groups:{},sonetgroups:{},department:typeof t["items"]["departmentExtranet"]!="undefined"?t["items"]["departmentExtranet"]:t["items"]["department"],departmentRelation:typeof t["items"]["departmentRelationExtranet"]!="undefined"?t["items"]["departmentRelationExtranet"]:t["items"]["departmentRelation"]},itemsLast:{users:t["itemsLast"]["mentionUsers"],sonetgroups:{},department:{},groups:{}},itemsSelected:t["itemsSelected"],destSort:typeof t["mentionDestSort"]!="undefined"&&t["mentionDestSort"]?t["mentionDestSort"]:{},departmentSelectDisable:true,obWindowClass:"bx-lm-mention",obWindowCloseIcon:false,useClientDatabase:!!t["useClientDatabase"],userNameTemplate:typeof t["userNameTemplate"]!="undefined"?t["userNameTemplate"]:""});BX.ready(function(){var i=BX("bx-b-mention-"+e);if(BX.browser.IsIE()&&!BX.browser.IsIE9()){i.style.width="1px";i.style.marginRight="0"}BX.bind(i,"mousedown",function(n){if(d.listen!==true){var o=a.getEditor(t.editorId),s=o.GetIframeDoc();if(o.GetViewMode()=="wysiwyg"&&s){d.listen=true;d.listenFlag=true;d.text="";d.leaveContent=false;var r=o.selection.GetRange(),l=s.getElementById("bx-mention-node");if(l){BX.remove(l)}o.InsertHtml('<span id="bx-mention-node">'+o.INVISIBLE_SPACE+"</span>",r);setTimeout(function(){if(!BX.SocNetLogDestination.isOpenDialog()){BX.SocNetLogDestination.openDialog(window["BXSocNetLogDestinationFormNameMent"+e],{bindNode:i})}var t=s.getElementById("bx-mention-node");if(t){r.setStart(t,0);if(t.firstChild&&t.firstChild.nodeType==3&&t.firstChild.nodeValue.length>0){r.setEnd(t,1)}else{r.setEnd(t,0)}o.selection.SetSelection(r)}o.Focus()},100)}else if(o.GetViewMode()=="code"){d.listen=true;d.listenFlag=true;d.text="";d.leaveContent=false;setTimeout(function(){if(!BX.SocNetLogDestination.isOpenDialog()){BX.SocNetLogDestination.openDialog(window["BXSocNetLogDestinationFormNameMent"+e],{bindNode:i})}},100)}BX.onCustomEvent(i,"mentionClick")}})})}})();
3309/* End */
3310;; /* /local/js/group.left.sidebar.js?1666247023123*/
3311; /* /local/templates/voenchast/components/vamba/socialnetwork.log.ex/vch_blogs/script.min.js?166624702327916*/
3312; /* /bitrix/components/bitrix/socialnetwork.log.entry/templates/.default/scripts.min.js?17591933949338*/
3313; /* /local/templates/voenchast/components/bitrix/main.post.form/.default/script.min.js?166624702462609*/
3314; /* /local/templates/voenchast/components/vamba/socialnetwork.log.ex/.default/script.min.js?166624702327916*/
3315; /* /local/templates/voenchast/components/bitrix/socialnetwork.blog.post.edit/user_blog/script.min.js?166624702423897*/
3316; /* /local/templates/voenchast/components/bitrix/main.post.form/edit_post/script.js?166624702492358*/
3317; /* /bitrix/components/bitrix/main.field.file/templates/main.edit/script.min.js?17702092095000*/
3318; /* /bitrix/components/bitrix/system.field.edit/script.min.js?1666247061814*/
3319; /* /bitrix/components/bitrix/search.tags.input/templates/.default/script.min.js?17591936018379*/
3320; /* /bitrix/components/bitrix/voting.uf/templates/.default/script.min.js?175919340611246*/
3321; /* /bitrix/components/bitrix/voting.vote.edit/templates/.default/script.min.js?166624707312569*/
3322; /* /local/templates/voenchast/components/bitrix/socialnetwork.blog.post/with_hidden_comments/script.min.js?166624702418229*/
3323; /* /bitrix/components/bitrix/socialnetwork.admin.set/templates/.default/script.js?16662470722527*/
3324; /* /local/templates/voenchast/components/bitrix/socialnetwork.log.ex/.default/script.min.js?166624702427916*/
3325; /* /bitrix/components/bitrix/socialnetwork.log.filter/templates/.default/script.min.js?175919381411034*/
3326; /* /local/components/UW/socialnetwork.blog.post.comment.custom/templates/.default/script.min.js?17865159524172*/
3327; /* /local/templates/voenchast/components/bitrix/main.post.list/.default/script.min.js?166624702433924*/
3328; /* /bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_form.min.js?166624706912332*/
3329; /* /bitrix/components/bitrix/main.post.list/templates/.default/scripts_for_im.min.js?16662470698220*/
3330; /* /local/templates/voenchast/components/vamba/socialnetwork.log.ex/user_blog/script.min.js?166624702327916*/
3331
3332//# sourceMappingURL=page_live_feed_v2.map.js

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.