MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / w

Function w

codebase/dhtmlxscheduler.js:77–79  ·  view source on GitHub ↗
(k)

Source from the content-addressed store, hash-verified

75<row height='`+E[0].offsetHeight+"'><![CDATA["+a(b.join("|"))+"]]></row>",t=E[0].offsetHeight}return N}function y(k){var N,m="";e.matrix&&e.matrix[e._mode]&&(e.matrix[e._mode].second_scale&&(N=k[1].childNodes),k=k[0].childNodes);for(var x=0;x<k.length;x++)m+=`
76<column><![CDATA[`+a(k[x].innerHTML)+"]]></column>";if(i=k[0].offsetWidth,N){var b=0,E=k[0].offsetWidth,S=1;for(x=0;x<N.length;x++)m+=`
77<column second_scale='`+S+"'><![CDATA["+a(N[x].innerHTML)+"]]></column>",(b+=N[x].offsetWidth)>=E&&(E+=k[S]?k[S].offsetWidth:0,S++),i=N[0].offsetWidth}return m}function w(k){var N="",m=e._rendered,x=e.matrix&&e.matrix[e._mode];if(e._mode=="agenda"||e._mode=="map")for(var b=0;b<m.length;b++)N+="<event><head><![CDATA["+a(m[b].childNodes[0].innerHTML)+"]]></head><body><![CDATA["+a(m[b].childNodes[2].innerHTML)+"]]></body></event>";else if(e._mode=="week_agenda")for(b=0;b<m.length;b++)N+="<event day='"+m[b].parentNode.getAttribute("day")+"'><body>"+a(m[b].innerHTML)+"</body></event>";else if(e._mode=="year")for(m=e.get_visible_events(),b=0;b<m.length;b++){var E=m[b].start_date;for(E.valueOf()<e._min_date.valueOf()&&(E=e._min_date);E<m[b].end_date;){var S=E.getMonth()+12*(E.getFullYear()-e._min_date.getFullYear())-e.week_starts._month,T=e.week_starts[S]+E.getDate()-1,A=k?l(e._get_year_cell(E),"color"):"",C=k?l(e._get_year_cell(E),"backgroundColor"):"";if(N+="<event day='"+T%7+"' week='"+Math.floor(T/7)+"' month='"+S+"' backgroundColor='"+C+"' color='"+A+"'></event>",(E=e.date.add(E,1,"day")).valueOf()>=e._max_date.valueOf())break}}else if(x&&x.render=="cell")for(m=e._els.dhx_cal_data[0].getElementsByTagName("TD"),b=0;b<m.length;b++)A=k?l(m[b],"color"):"",N+=`
78<event><body backgroundColor='`+(C=k?l(m[b],"backgroundColor"):"")+"' color='"+A+"'><![CDATA["+a(m[b].innerHTML)+"]]></body></event>";else for(b=0;b<m.length;b++){var $,H;if(e.matrix&&e.matrix[e._mode])$=o(m[b].style.left),H=o(m[b].offsetWidth)-1;else{var O=e.config.use_select_menu_space?0:26;$=_(m[b].style.left,O,!0),H=_(m[b].style.width,O)-1}if(!isNaN(1*H)){var R=d(m[b].style.top),P=d(m[b].style.height),j=m[b].className.split(" ")[0].replace("dhx_cal_","");if(j!=="dhx_tooltip_line"){var I=e.getEvent(m[b].getAttribute(e.config.event_attribute));if(I){T=I._sday;var U=I._sweek,B=I._length||0;if(e._mode=="month")P=parseInt(m[b].offsetHeight,10),R=parseInt(m[b].style.top,10)-e.xy.month_head_height,T=h(m[b],T),U=p(m[b],U);else if(e.matrix&&e.matrix[e._mode]){T=0,U=m[b].parentNode.parentNode.parentNode.rowIndex;var W=t;t=m[b].parentNode.offsetHeight,R=d(m[b].style.top),R-=.2*R,t=W}else{if(m[b].parentNode==e._els.dhx_cal_data[0])continue;var ve=e._els.dhx_cal_data[0].childNodes[0],Ba=parseFloat(ve.className.indexOf("dhx_scale_holder")!=-1?ve.style.left:0);$+=o(m[b].parentNode.style.left,Ba)}N+=`
79<event week='`+U+"' day='"+T+"' type='"+j+"' x='"+$+"' y='"+R+"' width='"+H+"' height='"+P+"' len='"+B+"'>",j=="event"?(N+="<header><![CDATA["+a(m[b].childNodes[1].innerHTML)+"]]></header>",A=k?l(m[b].childNodes[2],"color"):"",N+="<body backgroundColor='"+(C=k?l(m[b].childNodes[2],"backgroundColor"):"")+"' color='"+A+"'><![CDATA["+a(m[b].childNodes[2].innerHTML)+"]]></body>"):(A=k?l(m[b],"color"):"",N+="<body backgroundColor='"+(C=k?l(m[b],"backgroundColor"):"")+"' color='"+A+"'><![CDATA["+a(m[b].innerHTML)+"]]></body>"),N+="</event>"}}}}return N}function D(k,N,m,x,b,E){var S=!1;x=="fullcolor"&&(S=!0,x="color"),x=x||"color";var T="";if(k){var A=e._date,C=e._mode;N=e.date[m+"_start"](N),N=e.date["get_"+m+"_end"]?e.date["get_"+m+"_end"](N):e.date.add(N,1,m),T=c("pages",x,b,E);for(var $=new Date(k);+$<+N;$=this.date.add($,1,m))this.setCurrentView($,m),T+=v("page")+u().replace("","-")+w(S)+g("page");T+=g("pages"),this.setCurrentView(A,C)}else T=c("data",x,b,E)+u().replace("","-")+w(S)+g("data");return T}function M(k,N,m,x,b,E,S){(function(T,A){var C=e.uid(),$=document.createElement("div");$.style.display="none",document.body.appendChild($),$.innerHTML='<form id="'+C+'" method="post" target="_blank" action="'+A+'" accept-charset="utf-8" enctype="application/x-www-form-urlencoded"><input type="hidden" name="mycoolxmlbody"/> </form>',document.getElementById(C).firstChild.value=encodeURIComponent(T),document.getElementById(C).submit(),$.parentNode.removeChild($)})(typeof b=="object"?function(T){for(var A="<data>",C=0;C<T.length;C++)A+=T[C].source.getPDFData(T[C].start,T[C].end,T[C].view,T[C].mode,T[C].header,T[C].footer);return A+="</data>",A}(b):D.apply(this,[k,N,m,b,E,S]),x)}e.getPDFData=D,e.toPDF=function(k,N,m,x){return M.apply(this,[null,null,null,k,N,m,x])},e.toPDFRange=function(k,N,m,x,b,E,S){return typeof k=="string"&&(k=e.templates.api_date(k),N=e.templates.api_date(N)),M.apply(this,arguments)}},quick_info:function(e){e.config.icons_select=["icon_form","icon_delete"],e.config.details_on_create=!0,e.config.show_quick_info=!0,e.xy.menu_width=0;let i=null;function t(s){const a=s.getBoundingClientRect(),o=e.$container.getBoundingClientRect().bottom-a.bottom;o<0&&(s.style.top=`${parseFloat(s.style.top)+o}px`)}function n(s){let a=0,o=0,_=s;for(;_&&_!=e._obj;)a+=_.offsetLeft,o+=_.offsetTop-_.scrollTop,_=_.offsetParent;return _?{left:a,top:o,dx:a+s.offsetWidth/2>e._x/2?1:0,dy:o+s.offsetHeight/2>e._y/2?1:0,width:s.offsetWidth,height:s.offsetHeight}:0}e.attachEvent("onSchedulerReady",function(){const s=e.$container;s._$quickInfoHandler||(s._$quickInfoHandler=!0,e.event(s,"mousedown",function(a){const o=a.target.closest(`[${e.config.event_attribute}]`);o&&(i={id:o.getAttribute(e.config.event_attribute),position:n(o)})}),e.attachEvent("onDestroy",()=>{delete s._$quickInfoHandler}))}),e.attachEvent("onClick",function(s){if(e.config.show_quick_info)return e.showQuickInfo(s),!0}),function(){for(var s=["onEmptyClick","onViewChange","onLightbox","onBeforeEventDelete","onBeforeDrag"],a=function(){return e.hideQuickInfo(!0),!0},o=0;o<s.length;o++)e.attachEvent(s[o],a)}(),e.templates.quick_info_title=function(s,a,o){return o.text.substr(0,50)},e.templates.quick_info_content=function(s,a,o){return o.details||""},e.templates.quick_info_date=function(s,a,o){return e.isOneDayEvent(o)&&e.config.rtl?e.templates.day_date(s,a,o)+" "+e.templates.event_header(a,s,o):e.isOneDayEvent(o)?e.templates.day_date(s,a,o)+" "+e.templates.event_header(s,a,o):e.config.rtl?e.templates.week_date(a,s,o):e.templates.week_date(s,a,o)},e.showQuickInfo=function(s){if(s==this._quick_info_box_id||(this.hideQuickInfo(!0),this.callEvent("onBeforeQuickInfo",[s])===!1))return;let a;a=i&&i.id==s?i.position:this._get_event_counter_part(s),a&&(this._quick_info_box=this._init_quick_info(a),this._fill_quick_data(s),this._show_quick_info(a),this.callEvent("onQuickInfo",[s]))},function(){function s(a){a=a||"";var o,_=parseFloat(a),r=a.match(/m?s/);switch(r&&(r=r[0]),r){case"s":o=1e3*_;break;case"ms":o=_;break;default:o=0}return o}e.hideQuickInfo=function(a){var o=this._quick_info_box,_=this._quick_info_box_id;if(this._quick_info_box_id=0,o&&o.parentNode){var r=o.offsetWidth;if(e.config.quick_info_detached)return this.callEvent("onAfterQuickInfo",[_]),o.parentNode.removeChild(o);if(o.style.right=="auto"?o.style.left=-r+"px":o.style.right=-r+"px",a)o.parentNode.removeChild(o);else{var d;window.getComputedStyle?d=window.getComputedStyle(o,null):o.currentStyle&&(d=o.currentStyle);var l=s(d["transition-delay"])+s(d["transition-duration"]);setTimeout(function(){o.parentNode&&o.parentNode.removeChild(o)},l)}this.callEvent("onAfterQuickInfo",[_])}}}(),e.event(window,"keydown",function(s){s.keyCode==27&&e.hideQuickInfo()}),e._show_quick_info=function(s){var a=e._quick_info_box;e._obj.appendChild(a);var o=a.offsetWidth,_=a.offsetHeight;if(e.config.quick_info_detached){var r=s.left-s.dx*(o-s.width);e.getView()&&e.getView()._x_scroll&&(e.config.rtl?r+=e.getView()._x_scroll:r-=e.getView()._x_scroll),r+o>window.innerWidth&&(r=window.innerWidth-o),r=Math.max(0,r),a.style.left=r+"px",a.style.top=s.top-(s.dy?_:-s.height)+"px"}else{const d=e.$container.querySelector(".dhx_cal_data").offsetTop;a.style.top=d+20+"px",s.dx==1?(a.style.right="auto",a.style.left=-o+"px",setTimeout(function(){a.style.left="-10px"},1)):(a.style.left="auto",a.style.right=-o+"px",setTimeout(function(){a.style.right="-10px"},1)),a.className=a.className.replace(" dhx_qi_left","").replace(" dhx_qi_right","")+" dhx_qi_"+(s.dx==1?"left":"right")}a.ontransitionend=()=>{t(a),a.ontransitionend=null},setTimeout(()=>{t(a)},1)},e.attachEvent("onTemplatesReady",function(){if(e.hideQuickInfo(),this._quick_info_box){var s=this._quick_info_box;s.parentNode&&s.parentNode.removeChild(s),this._quick_info_box=null}}),e._quick_info_onscroll_handler=function(s){e.hideQuickInfo()},e._init_quick_info=function(){let s=this._quick_info_box=document.createElement("div");this._waiAria.quickInfoAttr(s),s.className="dhx_cal_quick_info",e.$testmode&&(s.className+=" dhx_no_animate"),e.config.rtl&&(s.className+=" dhx_quick_info_rtl");let a=`
80 <div class="dhx_cal_qi_tcontrols">
81 <a class="dhx_cal_qi_close_btn scheduler_icon close"></a>
82 </div>

Callers 3

DFunction · 0.70
kFunction · 0.70
dhtmlxscheduler.jsFile · 0.70

Calls 9

aFunction · 0.70
lFunction · 0.70
oFunction · 0.70
_Function · 0.70
dFunction · 0.70
hFunction · 0.70
pFunction · 0.70
addMethod · 0.65
getEventMethod · 0.65

Tested by

no test coverage detected