AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.149.230.250
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/js/socialnetwork/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/js/socialnetwork/content_view.min.js
(function(){var t=window.BX;if(t.UserContentView){return}t.UserContentView={mobile:false,context:"",pathToUserProfile:"",inited:false,viewAreaSentList:[],viewAreaTimePeriodAvg:1500,viewAreaTimePeriodAvgMobile:50,sendViewAreaTimeout:5e3,failedSetTimeout:10*60*1e3,commentsContainerId:null,commentsClassName:"feed-com-text-inner",commentsFullContentClassName:"feed-com-text-inner-inner",currentPopupId:null,popupList:{},toSendList:[],ignoreCurrentUserLive:[],viewAreaReadList:{},observer:null,checkerMap:null,viewAreaMap:null,ajaxSent:false,failedAjaxCounter:0,failedAjaxLimit:10,preventRead:false,viewedContentKey:"viewedContentV2"};t.UserContentView.clear=function(){this.viewAreaMap=new WeakMap};t.UserContentView.init=function(e){if(this.inited){return}if((t.message("USER_ID")?parseInt(t.message("USER_ID")):0)<=0){return}if(t.type.isPlainObject(e)){if(t.type.isBoolean(e.mobile)){this.mobile=e.mobile}if(t.type.isNotEmptyString(e.context)){this.context=e.context}if(t.type.isNotEmptyString(e.commentsContainerId)){this.commentsContainerId=e.commentsContainerId}if(t.type.isNotEmptyString(e.commentsClassName)){this.commentsClassName=e.commentsClassName}if(t.type.isNotEmptyString(e.commentsFullContentClassName)){this.commentsFullContentClassName=e.commentsFullContentClassName}}var i={rootMargin:this.mobile?"0%":"-10% 0% -10% 0%",threshold:.1};this.observer=new IntersectionObserver(this.onIntersection.bind(this),i);this.checkerMap=new WeakMap;this.viewAreaMap=new WeakMap;this.viewAreaReadList={};this.inited=true;if(t.browser.SupportLocalStorage()){var n=t.localStorage.get(this.viewedContentKey);if(t.type.isArray(n)){this.viewAreaSentList=n}}t.addCustomEvent(window,"OnUCRecordHasDrawn",this.onUCRecordHasDrawn.bind(this));t.addCustomEvent(window,"OnUCListWasShown",this.OnUCListWasShown.bind(this));if(this.mobile){t.addCustomEvent("OnUCHasBeenInitialized",this.OnUCHasBeenInitializedMobile.bind(this));t.addCustomEvent("BX.UserContentView.onSetPreventNextPage",this.OnSetPreventNextPage.bind(this));this.sendViewAreaTimeout=1500}setTimeout(this.sendViewAreaData.bind(this),this.sendViewAreaTimeout)};t.UserContentView.getXmlId=function(t){return t.getAttribute("bx-content-view-xml-id")};t.UserContentView.getSaveValue=function(t){var e=t.getAttribute("bx-content-view-key-signed");return{signedKey:e?e:"",value:t.getAttribute("bx-content-view-save")!="N"?"Y":"N"}};t.UserContentView.getReadStatus=function(e){return t.type.isNotEmptyString(e)&&t(e)&&this.viewAreaReadList.hasOwnProperty(e)};t.UserContentView.setRead=function(e){var i=this.getXmlId(e);if(t.type.isNotEmptyString(i)&&!this.getReadStatus(i)){this.viewAreaReadList[i]=this.getSaveValue(e);var n={xmlId:i};t.onCustomEvent(window,"BX.UserContentView.onSetRead",[n]);if(typeof BXMobileApp!="undefined"&&t.type.isNotEmptyObject(BXMobileApp)){BXMobileApp.onCustomEvent("BX.UserContentView.onSetRead",n,true)}}};t.UserContentView.sendViewAreaData=function(){this.toSendList=[];for(var e in this.viewAreaReadList){if(!this.viewAreaReadList.hasOwnProperty(e)||t.util.in_array(e,this.viewAreaSentList)){continue}this.toSendList.push({xmlId:e,save:this.viewAreaReadList[e].value,signedKey:this.viewAreaReadList[e].signedKey})}if(this.failedAjaxCounter>=this.failedAjaxLimit){setTimeout(function(){this.failedAjaxCounter=0}.bind(this),this.failedSetTimeout)}else if(this.toSendList.length>0&&!this.ajaxSent){this.ajaxSent=true;var i=!!this.mobile?new MobileAjaxWrapper:t.ajax;i.runAction("socialnetwork.api.contentview.set",{data:{params:{viewXMLIdList:this.toSendList,context:this.context}}}).then(function(t){this.ajaxSent=false;this.failedAjaxCounter=0;this.success(t.data)}.bind(this),function(t){this.ajaxSent=false;this.failedAjaxCounter++}.bind(this))}setTimeout(this.sendViewAreaData.bind(this),this.sendViewAreaTimeout)};t.UserContentView.success=function(e){if(t.type.isNotEmptyString(e.SUCCESS)&&e.SUCCESS=="Y"){for(i=0,length=this.toSendList.length;i<length;i++){this.viewAreaSentList.push(this.toSendList[i].xmlId)}if(t.browser.SupportLocalStorage()){t.localStorage.set(this.viewedContentKey,this.viewAreaSentList,86400)}}};t.UserContentView.registerViewArea=function(e){if(t.type.isNotEmptyString(e)&&t(e)&&this.viewAreaMap&&!this.viewAreaMap.has(t(e))){this.observer.observe(t(e))}};t.UserContentView.onUCRecordHasDrawn=function(e,i,n){if(typeof n=="undefined"||typeof n.ACTION=="undefined"||typeof i=="undefined"){return}if(n.ACTION=="REPLY"){var s=function(){this.onUCRecordHasDrawnFunc(i)}.bind(this);var o=t.debounce(function(){t.unbind(document,"mousemove",o);s()}.bind(this),100,this);var r=function(){BXMobileApp.UI.Page.isVisible({callback:function(t){if(t&&t.status=="visible"){s()}else{setTimeout(r,50)}}})}.bind(this);if(this.mobile){setTimeout(r,50)}else{t.bind(document,"mousemove",o)}}};t.UserContentView.onUCRecordHasDrawnFunc=function(e){var i="record-"+e.join("-");if(t(i)){var n=t.findChild(t(i),{tag:"div",className:this.commentsClassName},true);if(n&&t.type.isNotEmptyString(n.id)){t.UserContentView.registerViewArea(n.id)}}};t.UserContentView.OnUCListWasShown=function(e,i,n){var s=t.findChildren(n,{tag:"div",className:this.commentsClassName},true);for(var o in s){if(!s.hasOwnProperty(o)){continue}if(t.type.isNotEmptyString(s[o].id)){this.registerViewArea(s[o].id)}}};t.UserContentView.OnUCHasBeenInitializedMobile=function(t,e){this.registerViewAreaList({containerId:this.commentsContainerId,className:this.commentsClassName,fullContentClassName:this.commentsFullContentClassName})};t.UserContentView.OnSetPreventNextPage=function(t){this.preventRead=!!t};t.UserContentView.registerViewAreaList=function(e){if(!t.type.isNotEmptyObject(e)||!t.type.isNotEmptyString(e.containerId)||!t.type.isNotEmptyString(e.className)||!t(e.containerId)){return}var i=t.findChildren(t(e.containerId),{tag:"div",className:e.className},true);for(var n in i){if(!i.hasOwnProperty(n)){continue}if(t.type.isNotEmptyString(i[n].id)){this.registerViewArea(i[n].id)}}};t.UserContentView.liveUpdate=function(e){if(t.type.isNotEmptyString(e.CONTENT_ID)&&t.util.in_array(e.CONTENT_ID,t.UserContentView.ignoreCurrentUserLive)&&typeof e.USER_ID!="undefined"&&parseInt(e.USER_ID)>0&&parseInt(e.USER_ID)==parseInt(t.message("USER_ID"))){return}var i=t("feed-post-contentview-cnt-"+e.CONTENT_ID);var n=t("feed-post-contentview-cnt-wrap-"+e.CONTENT_ID);if(i&&n){var s=t.create("SPAN",{props:{className:"feed-content-view-plus-one"},style:{width:n.clientWidth-8+"px",height:n.clientHeight-8+"px"},html:"1"});n.insertBefore(s,n.firstChild);setTimeout((function(){i.innerHTML=parseInt(i.innerHTML)+1}),500);setTimeout((function(){t.cleanNode(s,true)}),2e3)}};t.UserContentView.onIntersection=function(e){if(this.preventRead){return}e.forEach(function(e){if(e.isIntersecting){var i=this.getXmlId(e.target);if(!t.type.isNotEmptyString(i)||this.getReadStatus(i)){return}if(!this.checkerMap.has(e.target)){this.checkerMap.set(e.target,true)}setTimeout(function(){if(t.UserContentView.checkerMap.has(this)){t.UserContentView.setRead(this)}}.bind(e.target),this.mobile?this.viewAreaTimePeriodAvgMobile:this.viewAreaTimePeriodAvg)}else if(this.checkerMap.has(e.target)){this.checkerMap.delete(e.target)}}.bind(this))};t.UserContentView.Counter=function(){this.contentId=null;this.nodeId=null;this.node=null;this.popup=null;this.popupTimeoutId=null;this.popupContent=null;this.hiddenCountNode=null;this.popupContentPage=1;this.popupShownIdList=[];this.pathToUserProfile="";this.mouseLeaveTimeoutId=null;this.listXHR=null};t.UserContentView.Counter.prototype.init=function(e){this.contentId=e.contentId;this.nodeId=e.nodeId;if(this.nodeId){this.node=t(this.nodeId);this.popupContent=t.findChild(t("bx-contentview-cnt-popup-cont-"+this.contentId),{tagName:"span",className:"bx-contentview-popup"},true,false)}if(t.type.isNotEmptyString(e.pathToUserProfile)){this.pathToUserProfile=e.pathToUserProfile}if(t.type.isNotEmptyString(e.isSet)&&e.isSet=="Y"&&!t.util.in_array(this.contentId,t.UserContentView.ignoreCurrentUserLive)){t.UserContentView.ignoreCurrentUserLive.push(this.contentId)}if(typeof t.PULL!="undefined"){t.PULL.extendWatch("CONTENTVIEW"+this.contentId)}this.popupScroll();t.bind(this.node,"mouseover",function(){if(this.popup!==null&&this.popup.isShown()){return}clearTimeout(this.popupTimeoutId);this.popupContentPage=1;t.cleanNode(this.popupContent);this.popupContent.appendChild(t.create("SPAN",{props:{className:"bx-contentview-wait"}}));this.popupTimeoutId=setTimeout(function(){if(t.UserContentView.currentPopupId==this.contentId){return false}if(this.popupContentPage==1){this.list({page:1})}this.popupTimeoutId=setTimeout(function(){this.openPopup()}.bind(this),400)}.bind(this),400)}.bind(this));this.node.addEventListener("mouseout",function(){clearTimeout(this.popupTimeoutId)}.bind(this));this.node.addEventListener("click",function(){clearTimeout(this.popupTimeoutId);if(this.popupContentPage==1){this.list({page:1})}this.openPopup()}.bind(this))};t.UserContentView.Counter.prototype.list=function(e){if(this.listXHR){this.listXHR.abort()}var i=e.page;if(parseInt(this.node.innerHTML)==0){return false}if(i==null){i=this.popupContentPage}if(i==1){this.popupShownIdList=[]}t.ajax.runAction("socialnetwork.api.contentview.getlist",{data:{params:{contentId:this.contentId,pathToUserProfile:this.pathToUserProfile,page:i}},onrequeststart:function(t){this.listXHR=t}.bind(this)}).then(function(e){var n=e.data;if(!n||parseInt(n.itemsCount)<=0&&parseInt(n.hiddenCount)<=0){return false}if(i==1){this.popupContent.innerHTML=""}this.popupContentPage+=1;var s=null;for(var o in n.items){if(!n.items.hasOwnProperty(o)||t.util.in_array(n.items[o]["ID"],this.popupShownIdList)){continue}this.popupShownIdList.push(n.items[o]["ID"]);if(t.type.isNotEmptyString(n.items[o]["PHOTO_SRC"])){s=t.create("IMG",{attrs:{src:encodeURI(n.items[o]["PHOTO_SRC"])},props:{className:"bx-contentview-popup-avatar-img"}})}else{s=t.create("IMG",{attrs:{src:"/bitrix/images/main/blank.gif"},props:{className:"bx-contentview-popup-avatar-img bx-contentview-popup-avatar-img-default"}})}this.popupContent.appendChild(t.create("A",{attrs:{href:n.items[o]["URL"],target:"_blank",title:n.items[o]["DATE_VIEW_FORMATTED"]},props:{className:"bx-contentview-popup-img"+(!!n.items[o]["TYPE"]?" bx-contentview-popup-img-"+n.items[o]["TYPE"]:"")},children:[t.create("SPAN",{props:{className:"bx-contentview-popup-avatar-new"},children:[s,t.create("SPAN",{props:{className:"bx-contentview-popup-avatar-status-icon"}})]}),t.create("SPAN",{props:{className:"bx-contentview-popup-name-new"},html:n.items[o]["FULL_NAME"]})]}))}if(parseInt(n.hiddenCount)>0){t.cleanNode(this.hiddenCountNode,true);this.hiddenCountNode=t.create("SPAN",{props:{className:"bx-contentview-popup-name-new contentview-counter-hidden"},html:t.message("SONET_CONTENTVIEW_JS_HIDDEN_COUNT").replace("#CNT#",n.hiddenCount)});this.popupContent.appendChild(this.hiddenCountNode)}this.adjustWindow();this.popupScroll()}.bind(this),function(t){}.bind(this));return false};t.UserContentView.Counter.prototype.openPopup=function(){if(parseInt(this.node.innerHTML)==0){return false}if(this.popup==null){this.popup=new t.PopupWindow("contentview-popup-"+this.contentId,this.node,{lightShadow:true,offsetLeft:-22,autoHide:true,closeByEsc:true,zIndex:2005,bindOptions:{position:"top"},animationOptions:{show:{type:"opacity-transform"},close:{type:"opacity"}},events:{onPopupClose:function(){t.UserContentView.currentPopupId=null},onPopupDestroy:function(){}},content:t("bx-contentview-cnt-popup-cont-"+this.contentId),className:"popup-window-contentview"});t.UserContentView.popupList[this.contentId]=this.popup;t.bind(t("contentview-popup-"+this.contentId),"mouseout",function(){clearTimeout(this.popupTimeout);this.popupTimeout=setTimeout(function(){this.popup.close()}.bind(this),1e3)}.bind(this));t.bind(t("contentview-popup-"+this.contentId),"mouseover",function(){clearTimeout(this.popupTimeout);clearTimeout(this.mouseLeaveTimeoutId)}.bind(this));t.bind(this.node,"mouseleave",function(){this.mouseLeaveTimeoutId=setTimeout(function(){this.popup.close()}.bind(this),1e3)}.bind(this))}if(t.UserContentView.currentPopupId!=null){t.UserContentView.popupList[t.UserContentView.currentPopupId].close()}t.UserContentView.currentPopupId=this.contentId;this.popup.show();this.adjustWindow()};t.UserContentView.Counter.prototype.popupScroll=function(){t.bind(this.popupContent,"scroll",t.delegate((function(){var e=t.proxy_context;if(e.scrollTop>(e.scrollHeight-e.offsetHeight)/1.5){this.list({page:null});t.unbindAll(e)}}),this))};t.UserContentView.Counter.prototype.adjustWindow=function(){if(this.popup!=null){this.popup.bindOptions.forceBindPosition=true;this.popup.adjustPosition();this.popup.bindOptions.forceBindPosition=false}};t.addCustomEvent(window,"BX.UserContentView.onInitCall",t.UserContentView.init.bind(t.UserContentView));t.addCustomEvent(window,"BX.UserContentView.onRegisterViewAreaListCall",t.UserContentView.registerViewAreaList.bind(t.UserContentView));t.addCustomEvent(window,"BX.UserContentView.onClearCall",t.UserContentView.clear.bind(t.UserContentView));t.addCustomEvent("onPullEvent-contentview",(function(e,i){if(e==="add"){t.UserContentView.liveUpdate(i)}}))})();
//# sourceMappingURL=content_view.map.js

Anon7 - 2022
AnonSec Team