File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/calendar/install/js/calendar/new/calendar-view-list.min.js
Back
(function(e){var t=e.BXEventCalendarView;function a(){t.apply(this,arguments);this.name="list";this.filterMode=false;this.title=BX.message("EC_VIEW_LIST");this.hotkey="A";this.contClassName="calendar-list-view";this.loadDaysBefore=30;this.animateAmount=5;this.loadLimitPrevious=30;this.loadLimit=30;this.loadDaysAfter=60;this.SCROLL_DELTA_HEIGHT=200;this.todayCode=this.calendar.util.getDayCode(new Date);this.todayDate=new Date;this.DOM={};this.preBuild()}a.prototype=Object.create(t.prototype);a.prototype.constructor=a;a.prototype.preBuild=function(){this.viewCont=BX.create("DIV",{props:{className:this.contClassName},style:{display:"none"}});BX.addCustomEvent(this.calendar,"afterSetView",BX.delegate((function(e){if(e.viewName!==this.name&&this.filterMode){this.resetFilterMode()}}),this))};a.prototype.build=function(){this.titleCont=this.viewCont.appendChild(BX.create("DIV",{props:{className:"calendar-grid-month-row-days-week"}}));this.streamScrollWrap=this.viewCont.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-container calendar-custom-scroll"},style:{height:this.util.getViewHeight()+"px"},events:{scroll:BX.Runtime.debounce(this.scrollHandle,500,this)}}));this.streamContentWrap=this.streamScrollWrap.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-container-content"}}));this.topLoaderBlock=this.streamContentWrap.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-loader-block"}}));this.listWrap=this.streamContentWrap.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-container-list"}}));this.bottomLoaderBlock=this.streamContentWrap.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-loader-block"}}));this.centerLoaderWrap=this.streamScrollWrap.appendChild(BX.create("DIV",{props:{className:"calendar-center-loader-block"}}));this.filterLoaderWrap=this.streamScrollWrap.appendChild(BX.create("DIV",{props:{className:"calendar-search-main"},style:{height:this.util.getViewHeight()+"px",display:"none"}}));this.filterLoaderWrap.appendChild(BX.create("DIV",{props:{className:"calendar-search-empty"},html:'<div class="calendar-search-empty-name">'+BX.message("EC_NO_EVENTS")+"</div>"}))};a.prototype.setTitle=function(){var e=this.calendar.getViewRangeDate();t.prototype.setTitle.apply(this,[BX.date.format("f",e.getTime()/1e3)+", #GRAY_START#"+e.getFullYear()+"#GRAY_END#"])};a.prototype.show=function(e){e=e||{};if(!this.loaderCircle){this.loaderCircle=new BX.Loader({target:this.viewCont});this.loaderCircle.show()}t.prototype.show.apply(this,arguments);this.showNavigationCalendar();BX.remove(this.calendar.additionalInfoOuter);var a=parseInt(this.calendar.util.config.init_year),i=parseInt(this.calendar.util.config.init_month);this.displayedRange={start:new Date(a,i-2,1),end:new Date(a,i+2,1)};this.calendar.setDisplayedViewRange(this.displayedRange);if(e.displayEntries!==false){this.displayEntries({focusDate:this.todayDate})}this.nothingToLoadNext=false;this.nothingToLoadPrevious=false};a.prototype.displayEntries=function(e){e=e||{};this.entiesRequested=true;this.entries=this.entryController.getList({startDate:this.displayedRange.start,finishDate:this.displayedRange.end,viewRange:this.displayedRange,finishCallback:function(){if(this.entiesRequested!==false){this.displayEntries(e)}this.entiesRequested=false}.bind(this)});if(this.entries===false){if(this.loaderCircle){this.loaderCircle.hide()}return}if(this.calendar.util.isFilterEnabled()&&!this.calendar.search.isFilterEmpty()){this.calendar.search.applyFilter()}BX.cleanNode(this.listWrap);this.dateGroupIndex={};this.groups=[];this.groupsDayCodes=[];this.groupsIndex={};this.entryListIndex={};if(this.entries===false||!this.entries||!this.entries.length){return this.showEmptyBlock()}else if(this.noEntriesWrap){this.noEntriesWrap.style.display="none"}this.streamContentWrap.style.display="";this.entryParts=[];BX.cleanNode(this.centerLoaderWrap);this.centerLoaderWrap.appendChild(BX.adjust(this.calendar.util.getLoader(),{style:{height:"180px"}}));this.attachEntries(this.entries,!!e.animation,function(){this.focusOnDate(e.focusDate||this.getCurrentViewDate()||null)}.bind(this),e.focusDate);this.loaderCircle.hide()};a.prototype.displayResult=function(e){this.streamContentWrap.style.display="";if(this.filterLoaderWrap){this.filterLoaderWrap.style.display="none"}BX.addClass(this.streamContentWrap,"calendar-timeline-stream-search-result");BX.cleanNode(this.listWrap);this.dateGroupIndex={};this.entiesRequested=null;this.groups=[];this.groupsDayCodes=[];this.groupsIndex={};this.entryListIndex={};this.resultEntries=e;this.resultEntriesIndex={};e.forEach((function(e,t){this.resultEntriesIndex[e.uid]=t}),this);if(e===false||!e||!e.length){if(this.loaderCircle){this.loaderCircle.hide()}return this.showEmptyBlock()}else if(this.noEntriesWrap){this.noEntriesWrap.style.display="none"}this.streamContentWrap.style.display="";this.entryParts=[];this.attachEntries(e,"next");if(this.loaderCircle){this.loaderCircle.hide()}};a.prototype.attachEntries=function(e,t,a,i){if(!e&&!e.length){if(BX.type.isFunction(a)){a()}return}var s=this.entries.length-e.length,r=s,n,o,d,l,h,p,c;e.forEach((function(e){e.globalIndex=r++;p=this.calendar.util.getDayCode(e.from);c=this.calendar.util.getDayCode(e.to);d=0;this.entryParts.push({index:d,dayCode:p,from:e.from,entry:e});if(p!==c){l=new Date(e.from.getFullYear(),e.from.getMonth(),e.from.getDate()).getTime();n=new Date(e.from.getTime());h=new Date(e.to.getFullYear(),e.to.getMonth(),e.to.getDate()).getTime();while(l<=h){this.entryParts.push({index:++d,dayCode:this.calendar.util.getDayCode(n),from:n,entry:e});l+=this.calendar.util.dayLength;n=new Date(n.getTime()+this.calendar.util.dayLength)}e.lastPartIndex=d}}),this);var u=false;this.entryParts.sort((function(e,t){if(e.dayCode===t.dayCode){if(e.entry.isTask()!==t.entry.isTask()){if(e.entry.isTask())return 1;if(t.entry.isTask())return-1}if(e.entry.isFullDay()!==t.entry.isFullDay()){if(e.entry.isFullDay())return-1;if(t.entry.isFullDay())return 1}}if(e.index>0||t.index>0){return!u?e.index-t.index:t.index-e.index}return!u?e.entry.from.getTime()-t.entry.from.getTime():t.entry.from.getTime()-e.entry.from.getTime()}));this.focusDate=i||new Date;this.today=new Date;this.animationMode=t;this.currentDisplayedEntry=0;this.actuallyAnimatedEntryCount=0;this.displayEntry(this.entryParts[this.currentDisplayedEntry],t,a)};a.prototype.displayEntry=function(e,t,a){t=false;var i;var s=this.calendar.util.getDayCode(this.focusDate);if(e.from.getTime()>this.focusDate.getTime()&&!this.groups[this.groupsIndex[s]]&&!this.filterMode){this.createEntryGroupForDate(this.focusDate,t)}i=this.groups[this.groupsIndex[e.dayCode]];if(!i){this.createEntryGroupForDate(e.from,t);i=this.groups[this.groupsIndex[e.dayCode]]}if(i.emptyWarning){BX.remove(i.emptyWarning)}BX.cleanNode(this.centerLoaderWrap);var r=this.getUniqueId(e);if(this.actuallyAnimatedEntryCount>this.animateAmount){t=false;this.animationMode=false}var n=!this.entryListIndex[r];if(n){this.entryListIndex[r]=true;var o,d,l,h=e.entry;this.entriesIndex[h.uid]=h.globalIndex;if(h.isFullDay()){o=BX.message("EC_ALL_DAY")}else if(h.isLongWithTime()){if(e.index===0){o=this.calendar.util.formatTime(h.from)}else if(e.index===h.lastPartIndex){o=BX.message("EC_TILL_TIME").replace("#TIME#",this.calendar.util.formatTime(h.to))}else{o=BX.message("EC_ALL_DAY")}}else{o=this.calendar.util.formatTime(h.from.getHours(),h.from.getMinutes())+" – "+this.calendar.util.formatTime(h.to.getHours(),h.to.getMinutes())}d=i.content.appendChild(BX.create("DIV",{attrs:{"data-bx-calendar-entry":h.uid},props:{className:"calendar-timeline-stream-content-event"+(t?" calendar-timeline-stream-section-event-animate-"+t:"")}}));d.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-content-event-time"},html:'<span class="calendar-timeline-stream-content-event-time-link">'+o+"</span>"+(h.isRecursive()?'<span class="calendar-timeline-stream-content-event-recursive" title="'+(h.data["~RRULE_DESCRIPTION"]||"")+'">'+BX.message("EC_CALENDAR_REC_EVENT")+"</span>":"")}));var p=this.calendar.util.getTextLocation(h.location)||"";if(p){p='<span class="calendar-timeline-stream-content-event-location">('+BX.util.htmlspecialchars(p)+")</span>"}d.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-content-event-name"},html:'<span class="calendar-timeline-stream-content-event-color" style="background-color: '+h.color+'"></span><div class="calendar-timeline-stream-content-event-name-link"><span>'+BX.util.htmlspecialchars(h.name)+"</span></div>"+p}));if(parseInt(this.calendar.util.userId)!==parseInt(h.data.MEETING_HOST)&&parseInt(this.calendar.util.userId)===parseInt(h.data.CREATED_BY)&&h.data.MEETING_STATUS==="Q"){d.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-content-event-control"},children:[this.getDecisionButton("Y").getContainer(),this.getDecisionButton("N").getContainer()]}))}l=d.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-content-event-members"}}));if(h.isMeeting()&&h.getAttendees().length>0){this.showAttendees(l,h.getAttendees())}else if(h.isPersonal()){l.innerHTML=BX.message("EC_EVENT_IS_MINE")}e.DOM={}}if(this.currentDisplayedEntry<this.entryParts.length-1){this.currentDisplayedEntry++;this.displayEntry(this.entryParts[this.currentDisplayedEntry],t,a)}else if(this.currentDisplayedEntry==this.entryParts.length-1&&!this.filterMode){this.animationMode=false;if(!this.groups[this.groupsIndex[this.todayCode]]){this.createEntryGroupForDate(this.today,t)}this.groupsDayCodes.sort();if(BX.type.isFunction(a)){a()}}};a.prototype.showAttendees=function(e,t){var a,i,s=3,r=t.length,n=5,o=0;if(r>0){if(r>n){r=s}for(a=0;a<t.length;a++){i=t[a]||{};if(i.STATUS==="Y"||i.STATUS==="H"){o++;if(i.AVATAR!=="/bitrix/images/1.gif"){e.appendChild(BX.create("IMG",{attrs:{id:"simple_view_popup_"+i.ID,src:i.AVATAR||"","bx-tooltip-user-id":i.ID},props:{className:"calendar-member"}}))}else{var d=i.EMAIL_USER?"ui-icon-common-user-mail":"ui-icon-common-user";e.appendChild(BX.create("DIV",{props:{title:i.DISPLAY_NAME,className:"ui-icon "+d},html:"<i></i>"}))}}if(o>=r){break}}if(r<t.length){var l=e.appendChild(BX.create("SPAN",{attrs:{"data-bx-calendar-entry-attendees-control":t.length},props:{className:"calendar-member-more-count"},text:" "+BX.message("EC_ATTENDEES_ALL_COUNT").replace("#COUNT#",t.length),events:{click:BX.delegate((function(){this.showUserListPopup(l,t)}),this)}}))}}};a.prototype.showUserListPopup=function(e,t){if(this.userListPopup){this.userListPopup.close()}if(this.popup){this.popup.setAutoHide(false)}if(!t||!t.length){return}this.DOM.userListPopupWrap=BX.create("DIV",{props:{className:"calendar-user-list-popup-block"}});t.forEach((function(e){var t=this.DOM.userListPopupWrap.appendChild(BX.create("DIV",{props:{className:"calendar-slider-sidebar-user-container calendar-slider-sidebar-user-card"}}));t.appendChild(BX.create("DIV",{props:{className:"calendar-slider-sidebar-user-block-avatar"}})).appendChild(BX.create("DIV",{props:{className:"calendar-slider-sidebar-user-block-item"}})).appendChild(BX.create("IMG",{props:{width:34,height:34,src:e.AVATAR}}));t.appendChild(BX.create("DIV",{props:{className:"calendar-slider-sidebar-user-info"}})).appendChild(BX.create("A",{props:{href:e.URL?e.URL:"#",className:"calendar-slider-sidebar-user-info-name"},text:e.DISPLAY_NAME}))}),this);new BX.Calendar.Controls.AttendeesList(e,BX.Calendar.Controls.AttendeesList.sortAttendees(t)).showPopup()};a.prototype.appendDateGroup=function(e,t,a){var i,s,r,n,o,d,l=t.getDate(),h=t.getMonth()+1,p=t.getFullYear();if(!this.dateGroupIndex[p]){n=Infinity;o=p;for(i in this.dateGroupIndex){if(this.dateGroupIndex.hasOwnProperty(i)){if(Math.abs(p-i)<n){n=Math.abs(p-i);o=i}if(n==1){break}}}this.dateGroupIndex[p]={node:BX.create("DIV",{attrs:{"data-bx-calendar-list-year":p}}),monthIndex:{}};if(o==p){this.listWrap.appendChild(this.dateGroupIndex[p].node)}else{if(p-o>0){if(this.dateGroupIndex[o].node.nextSibling){BX.insertAfter(this.dateGroupIndex[p].node,this.dateGroupIndex[o].node)}else{this.listWrap.appendChild(this.dateGroupIndex[p].node)}}else{this.listWrap.insertBefore(this.dateGroupIndex[p].node,this.dateGroupIndex[o].node)}}}if(!this.dateGroupIndex[p].monthIndex[h]){n=Infinity;o=h;for(s in this.dateGroupIndex[p].monthIndex){if(this.dateGroupIndex[p].monthIndex.hasOwnProperty(s)){if(Math.abs(h-s)<n){n=Math.abs(h-s);o=s}if(n==1){break}}}this.dateGroupIndex[p].monthIndex[h]={node:BX.create("DIV",{attrs:{"data-bx-calendar-list-month":h}}),dayIndex:{}};if(o==h){this.dateGroupIndex[p].node.appendChild(this.dateGroupIndex[p].monthIndex[h].node)}else{if(h-o>0){if(this.dateGroupIndex[p].monthIndex[o].node.nextSibling){BX.insertAfter(this.dateGroupIndex[p].monthIndex[h].node,this.dateGroupIndex[p].monthIndex[o].node)}else{this.dateGroupIndex[p].node.appendChild(this.dateGroupIndex[p].monthIndex[h].node)}}else{this.dateGroupIndex[p].monthIndex[o].node.parentNode.insertBefore(this.dateGroupIndex[p].monthIndex[h].node,this.dateGroupIndex[p].monthIndex[o].node)}}}if(!this.dateGroupIndex[p].monthIndex[h].dayIndex[l]){n=Infinity;o=l;d=this.dateGroupIndex[p].monthIndex;for(r in d[h].dayIndex){if(d[h].dayIndex.hasOwnProperty(r)){if(Math.abs(l-r)<n){n=Math.abs(l-r);o=r}if(n==1){break}}}d[h].dayIndex[l]={node:BX.create("DIV",{props:{className:"calendar-timeline-stream-day"},attrs:{"data-bx-calendar-list-day":l}})};if(o==l){d[h].node.appendChild(d[h].dayIndex[l].node)}else{if(l-o>0){if(d[h].dayIndex[o].node.nextSibling){BX.insertAfter(d[h].dayIndex[l].node,d[h].dayIndex[o].node)}else{d[h].node.appendChild(d[h].dayIndex[l].node)}}else{d[h].node.insertBefore(d[h].dayIndex[l].node,d[h].dayIndex[o].node)}}}if(d[h].dayIndex[l].node){d[h].dayIndex[l].node.appendChild(e)}e.style.opacity="1"};a.prototype.hide=function(){t.prototype.hide.apply(this,arguments)};a.prototype.getAdjustedDate=function(e,t){if(!e){e=new Date}var a=this.calendar.getViewRangeDate(),i=false;if(e&&e.getTime){i=new Date(e.getTime())}return i};a.prototype.adjustViewRangeToDate=function(e,t){t=false;if(this.viewCont.style.display==="none"){var a=false;if(e&&e.getTime){a=new Date(e.getTime());a.setHours(0,0,0,0);this.currentDate=a;this.calendar.setViewRangeDate(a)}if(t!==false){this.fadeAnimation(this.getContainer(),100,BX.delegate((function(){this.show();this.getContainer().style.opacity=0;this.showAnimation(this.getContainer(),300)}),this))}else{this.show()}}else{var i=this.calendar.util.getDayCode(e);var s=BX.util.array_search(i,this.groupsDayCodes);if(s>=0&&this.groupsDayCodes[s]){this.focusOnDate(this.groupsDayCodes[s],true)}else{if(e.getTime()>=this.displayedRange.start.getTime()&&e.getTime()<=this.displayedRange.end.getTime()){if(!this.groups[this.groupsIndex[i]]){this.createEntryGroupForDate(e,false)}this.groupsDayCodes.sort();this.focusOnDate(e,true)}else{this.displayedRange={start:new Date(e.getTime()-BX.Calendar.Util.getDayLength()*10),end:new Date(e.getTime()+BX.Calendar.Util.getDayLength()*60)};this.calendar.setDisplayedViewRange(this.displayedRange);this.animationMode=false;this.displayEntries({animation:false,focusDate:e});this.nothingToLoadNext=false;this.nothingToLoadPrevious=false}}}return a};a.prototype.increaseViewRangeDate=function(){var e=BX.util.array_search(this.focusedDayCode,this.groupsDayCodes);if(e>=0&&this.groupsDayCodes[e+1]){this.focusOnDate(this.groupsDayCodes[e+1],true)}};a.prototype.decreaseViewRangeDate=function(){var e=BX.util.array_search(this.focusedDayCode,this.groupsDayCodes);if(e>0&&this.groupsDayCodes[e-1]){this.focusOnDate(this.groupsDayCodes[e-1],true)}};a.prototype.createEntryGroupForDate=function(e,t){var a=this.calendar.util.getDayCode(e),i=Math.round(e.getTime()/1e3)*1e3,s={dayCode:a,wrap:BX.create("DIV",{props:{className:"calendar-timeline-stream-section-wrap"}})};s.titleNode=s.wrap.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-section calendar-timeline-section-date-label"},html:'<div data-bx-calendar-date="'+i+'" class="calendar-timeline-stream-section-content"><div class="'+(a==this.todayCode?"calendar-timeline-stream-today-label":"calendar-timeline-stream-label")+'">'+this.calendar.util.formatDateUsable(e)+"</div></div>"}));s.groupNode=s.wrap.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-section"}}));s.content=s.groupNode.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-stream-section-content"}}));s.emptyWarning=s.content.appendChild(BX.create("DIV",{props:{className:"calendar-timeline-empty-section"},text:BX.message("EC_NO_EVENTS")}));this.groups.push(s);this.groupsIndex[a]=this.groups.length-1;this.groupsDayCodes.push(a);this.appendDateGroup(this.groups[this.groups.length-1].wrap,e,t)};a.prototype.focusOnDate=function(e,t){var a=false;if(BX.type.isDate(e)){a=this.calendar.util.getDayCode(e)}else if(BX.type.isString(e)){a=e}else{a=this.todayCode}BX.cleanNode(this.centerLoaderWrap);this.focusedDayCode=a;if(this.groupsIndex&&this.groups[this.groupsIndex[a]]){this.bottomLoaderBlock.style.height=this.SCROLL_DELTA_HEIGHT+Math.max(0,this.util.getViewHeight()+this.groups[this.groupsIndex[a]].wrap.offsetTop-this.bottomLoaderBlock.offsetTop)+"px";if(t&&this.streamScrollWrap){new BX.easing({duration:300,start:{scrollTop:this.streamScrollWrap.scrollTop},finish:{scrollTop:this.groups[this.groupsIndex[a]].wrap.offsetTop},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:BX.delegate((function(e){this.streamScrollWrap.scrollTop=e.scrollTop}),this),complete:BX.delegate((function(){this.streamScrollWrap.scrollTop=this.groups[this.groupsIndex[a]].wrap.offsetTop}),this)}).animate()}else{if(this.streamScrollWrap&&this.groupsIndex[a]!==undefined&&this.groups[this.groupsIndex[a]]){this.streamScrollWrap.scrollTop=this.groups[this.groupsIndex[a]].wrap.offsetTop}}}};a.prototype.getCurrentViewDate=function(){var e=document.querySelector(".calendar-timeline-stream-container");if(e){var t=e.scrollTop;var a=Infinity;var i;var s;for(var r=0;r<this.groups.length;r++){i=Math.abs(this.groups[r].wrap.offsetTop-t);if(a>i){a=i;s=this.groups[r]}}if(s){return s.dayCode}return null}};a.prototype.scrollHandle=function(){if(!this.filterMode){if(this.streamScrollWrap.scrollHeight-this.util.getViewHeight()-this.streamScrollWrap.scrollTop<this.SCROLL_DELTA_HEIGHT&&!this.nothingToLoadNext){this.loadMoreEntries({mode:"next"})}else if(this.streamScrollWrap.scrollTop<this.SCROLL_DELTA_HEIGHT&&!this.nothingToLoadPrevious){this.loadMoreEntries({mode:"previous"})}}};a.prototype.loadMoreEntries=function(e){if(this.currentLoadMode||this.filterMode){return}this.currentLoadMode=e.mode;if(e.mode=="next"){this.loader=this.bottomLoaderBlock.appendChild(BX.adjust(this.calendar.util.getLoader(),{style:{height:"180px"}}));this.displayedRange.start=new Date(this.displayedRange.start.getFullYear(),this.displayedRange.start.getMonth()+1,this.displayedRange.start.getDate());this.displayedRange.end=new Date(this.displayedRange.end.getFullYear(),this.displayedRange.end.getMonth()+1,this.displayedRange.end.getDate());this.calendar.setDisplayedViewRange(this.displayedRange);this.entryController.getList({startDate:this.displayedRange.start,finishDate:this.displayedRange.end,finishCallback:BX.proxy(this.loadMoreCallback,this)})}else{this.loader=this.topLoaderBlock.appendChild(BX.adjust(this.calendar.util.getLoader(),{style:{height:"180px"}}));this.displayedRange.start=new Date(this.displayedRange.start.getFullYear(),this.displayedRange.start.getMonth()-1,this.displayedRange.start.getDate());this.displayedRange.end=new Date(this.displayedRange.end.getFullYear(),this.displayedRange.end.getMonth()-1,this.displayedRange.end.getDate());this.calendar.setDisplayedViewRange(this.displayedRange);this.entryController.getList({startDate:this.displayedRange.start,finishDate:this.displayedRange.end,finishCallback:BX.proxy(this.loadMoreCallback,this)})}};a.prototype.loadMoreCallback=function(e){BX.remove(this.loader);this.displayedRange=this.calendar.entryController.getLoadedEntiesLimits();var t=this.entryController.getList({startDate:this.displayedRange.start,finishDate:this.displayedRange.end,finishCallback:BX.proxy(this.loadMoreCallback,this)});if(this.currentLoadMode=="next"&&e.data.finish)this.nothingToLoadNext=true;if(this.currentLoadMode=="previous"&&e.data.finish)this.nothingToLoadPrevious=true;if(!this.entries)this.entries=[];if(t&&t.length){this.entries=this.entries.concat(t);this.attachEntries(t,this.currentLoadMode=="next"?"next":false)}this.currentLoadMode=false};a.prototype.getUniqueId=function(e){return e.entry.uid+"|"+e.dayCode};a.prototype.handleClick=function(e){if(this.isActive()){if(!e)e={};var t,a,i,s;if(e.target&&e.target.getAttribute("data-bx-calendar-entry-attendees-control")){e.e.preventDefault()}else if(e.specialTarget&&e.e&&(a=e.specialTarget.getAttribute("data-bx-calendar-entry"))&&(i=e.e.target.parentElement.getAttribute("data-bx-decision-button"))){if(this.resultEntriesIndex&&this.resultEntriesIndex[a]!==undefined){s=this.resultEntries[this.resultEntriesIndex[a]]}else{s=this.entries[this.entriesIndex[a]]}if(s&&["Y","N"].includes(i)){BX.Calendar.EntryManager.setMeetingStatus(s,i)}}else if(e.specialTarget&&(a=e.specialTarget.getAttribute("data-bx-calendar-entry"))){this.handleEntryClick({uid:a,specialTarget:e.specialTarget,target:e.target,e:e.e})}else if(e.specialTarget&&(t=e.specialTarget.getAttribute("data-bx-calendar-show-all-events"))){}else if(!this.calendar.util.readOnlyMode()&&this.entryController.canDo(true,"add_event")&&(t=e.specialTarget&&e.specialTarget.getAttribute("data-bx-calendar-week-day"))){this.deselectEntry();this.showCompactEditFormForNewEntry({entry:this.buildTopNewEntryWrap({dayFrom:this.days[this.dayIndex[t]],holder:this.topEntryHolder})})}}};a.prototype.showEmptyBlock=function(e){if(BX.Type.isDomNode(this.noEntriesWrap)){BX.Dom.remove(this.noEntriesWrap)}this.noEntriesWrap=this.streamScrollWrap.appendChild(BX.create("DIV",{props:{className:"calendar-search-main"},style:{height:this.util.getViewHeight()+"px"}}));var t=this.noEntriesWrap.appendChild(BX.create("DIV",{props:{className:"calendar-search-empty"},html:'<div class="calendar-search-empty-name">'+BX.message("EC_NO_EVENTS")+"</div>"}));if(!this.calendar.util.readOnlyMode()){this.addButton=t.appendChild(BX.create("SPAN",{props:{className:"calendar-search-empty-link"},text:BX.message("EC_CREATE_EVENT"),events:{click:function(){BX.Calendar.EntryManager.openEditSlider({type:this.calendar.util.type,ownerId:this.calendar.util.ownerId,userId:parseInt(this.calendar.currentUser.id)})}.bind(this)}}))}this.streamContentWrap.style.display="none"};a.prototype.applyFilterMode=function(){this.filterMode=true;this.calendar.viewTitleContainer.style.display="none";this.calendar.navigationWrap.style.display="none";if(this.searchHead){BX.remove(this.searchHead)}this.searchHead=this.calendar.topBlock.appendChild(BX.create("DIV",{props:{className:"calendar-search-head"},html:'<div class="calendar-search-name">'+BX.message("EC_SEARCH_RESULT")+"</div>"}));if(this.resettFilterWrap){BX.remove(this.resettFilterWrap)}this.resettFilterWrap=this.searchHead.appendChild(BX.create("DIV",{props:{className:"calendar-search-cancel"},html:BX.message("EC_SEARCH_RESET_RESULT"),events:{click:BX.proxy(this.resetFilterMode,this)}}));if(this.streamScrollWrap){this.streamContentWrap.style.display="none"}if(this.loaderCircle){this.loaderCircle.show()}};a.prototype.resetFilterMode=function(e){this.filterMode=false;this.resultEntries=[];this.calendar.viewTitleContainer.style.display="";this.calendar.navigationWrap.style.display="";this.setTitle();if(this.searchHead){BX.remove(this.searchHead)}if(this.resettFilterWrap){BX.remove(this.resettFilterWrap)}this.streamContentWrap.style.display="";if(!e||e.resetSearchFilter!==false){this.calendar.search.resetFilter()}if(this.isActive()){this.displayEntries()}};a.prototype.handleEntryClick=function(e){if(this.filterMode&&this.resultEntriesIndex[e.uid]!==undefined){e.entry=this.resultEntries[this.resultEntriesIndex[e.uid]]}t.prototype.handleEntryClick.apply(this,arguments)};a.prototype.getDecisionButton=function(e){return new BX.UI.Button({text:BX.message("EC_DESIDE_BUT_"+e),round:true,size:BX.UI.Button.Size.EXTRA_SMALL,color:e==="Y"?BX.UI.Button.Color.LIGHT_BORDER:BX.UI.Button.Color.LIGHT,props:{"data-bx-decision-button":e}})};if(e.BXEventCalendar){e.BXEventCalendar.CalendarListView=a}else{BX.addCustomEvent(e,"onBXEventCalendarInit",(function(){e.BXEventCalendar.CalendarListView=a}))}})(window); //# sourceMappingURL=calendar-view-list.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings