MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / extend$h

Function extend$h

codebase/sources/dhtmlxscheduler.js:3754–3947  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

3752 };
3753 }
3754 function extend$h(scheduler2) {
3755 (function() {
3756 var htmlTags = new RegExp("<(?:.|\n)*?>", "gm");
3757 var extraSpaces = new RegExp(" +", "gm");
3758 function stripHTMLLite(htmlText) {
3759 return (htmlText + "").replace(htmlTags, " ").replace(extraSpaces, " ");
3760 }
3761 var singleQuotes = new RegExp("'", "gm");
3762 function escapeQuotes(text) {
3763 return (text + "").replace(singleQuotes, "&#39;");
3764 }
3765 scheduler2._waiAria = { getAttributeString: function(attr) {
3766 var attributes = [" "];
3767 for (var i2 in attr) {
3768 if (typeof attr[i2] != "function" && typeof attr[i2] != "object") {
3769 var text = escapeQuotes(stripHTMLLite(attr[i2]));
3770 attributes.push(i2 + "='" + text + "'");
3771 }
3772 }
3773 attributes.push(" ");
3774 return attributes.join(" ");
3775 }, setAttributes: function(div, values) {
3776 for (var i2 in values) {
3777 div.setAttribute(i2, stripHTMLLite(values[i2]));
3778 }
3779 return div;
3780 }, labelAttr: function(div, content) {
3781 return this.setAttributes(div, { "aria-label": content });
3782 }, label: function(label) {
3783 return scheduler2._waiAria.getAttributeString({ "aria-label": label });
3784 }, hourScaleAttr: function(div, content) {
3785 this.labelAttr(div, content);
3786 }, monthCellAttr: function(div, date) {
3787 this.labelAttr(div, scheduler2.templates.day_date(date));
3788 }, navBarDateAttr: function(div, content) {
3789 this.labelAttr(div, content);
3790 }, dayHeaderAttr: function(div, content) {
3791 this.labelAttr(div, content);
3792 }, dayColumnAttr: function(div, date) {
3793 this.dayHeaderAttr(div, scheduler2.templates.day_date(date));
3794 }, headerButtonsAttributes: function(div, label) {
3795 return this.setAttributes(div, { role: "button", "aria-label": label });
3796 }, headerToggleState: function(div, isActive) {
3797 return this.setAttributes(div, { "aria-pressed": isActive ? "true" : "false" });
3798 }, getHeaderCellAttr: function(dateString) {
3799 return scheduler2._waiAria.getAttributeString({ "aria-label": dateString });
3800 }, eventAttr: function(event2, div) {
3801 this._eventCommonAttr(event2, div);
3802 }, _eventCommonAttr: function(event2, div) {
3803 div.setAttribute("aria-label", stripHTMLLite(scheduler2.templates.event_text(event2.start_date, event2.end_date, event2)));
3804 if (scheduler2.config.readonly) {
3805 div.setAttribute("aria-readonly", true);
3806 }
3807 if (event2.$dataprocessor_class) {
3808 div.setAttribute("aria-busy", true);
3809 }
3810 div.setAttribute("aria-selected", scheduler2.getState().select_id == event2.id ? "true" : "false");
3811 }, setEventBarAttr: function(event2, div) {

Callers 1

factoryMethodFunction · 0.70

Calls 7

escapeQuotesFunction · 0.70
stripHTMLLiteFunction · 0.70
isDisabledFunction · 0.70
day_dateMethod · 0.65
event_textMethod · 0.65
getStateMethod · 0.65
uidMethod · 0.65

Tested by

no test coverage detected