@daypilot/daypilot-lite-angular 3.0.0-sandbox.338
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +202 -0
- package/NOTICE.txt +1 -0
- package/README.md +21 -0
- package/daypilot-daypilot-lite-angular.d.ts +5 -0
- package/esm2020/daypilot-daypilot-lite-angular.mjs +5 -0
- package/esm2020/lib/core/daypilot-core.mjs +1896 -0
- package/esm2020/lib/daypilot-calendar.component.mjs +104 -0
- package/esm2020/lib/daypilot-month.component.mjs +84 -0
- package/esm2020/lib/daypilot-navigator.component.mjs +127 -0
- package/esm2020/lib/daypilot.module.mjs +32 -0
- package/esm2020/lib/util.mjs +49 -0
- package/esm2020/public-api.mjs +9 -0
- package/fesm2015/daypilot-daypilot-lite-angular.mjs +3499 -0
- package/fesm2015/daypilot-daypilot-lite-angular.mjs.map +1 -0
- package/fesm2020/daypilot-daypilot-lite-angular.mjs +2288 -0
- package/fesm2020/daypilot-daypilot-lite-angular.mjs.map +1 -0
- package/lib/core/daypilot-core.d.ts +614 -0
- package/lib/daypilot-calendar.component.d.ts +25 -0
- package/lib/daypilot-month.component.d.ts +22 -0
- package/lib/daypilot-navigator.component.d.ts +29 -0
- package/lib/daypilot.module.d.ts +9 -0
- package/lib/util.d.ts +6 -0
- package/package.json +46 -0
- package/public-api.d.ts +5 -0
|
@@ -0,0 +1,2288 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, Output, Input, NgModule } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
//@ts-nocheck
|
|
5
|
+
/*
|
|
6
|
+
Copyright © 2021 Annpoint, s.r.o.
|
|
7
|
+
|
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
you may not use this file except in compliance with the License.
|
|
10
|
+
You may obtain a copy of the License at
|
|
11
|
+
|
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
|
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
See the License for the specific language governing permissions and
|
|
18
|
+
limitations under the License.
|
|
19
|
+
|
|
20
|
+
-------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
NOTE: Requires the following acknowledgement (see also NOTICE):
|
|
23
|
+
This software includes DayPilot (https://www.daypilot.org).
|
|
24
|
+
*/
|
|
25
|
+
var DayPilot;
|
|
26
|
+
(function (DayPilot) {
|
|
27
|
+
class CalendarPropsAndEvents {
|
|
28
|
+
}
|
|
29
|
+
DayPilot.CalendarPropsAndEvents = CalendarPropsAndEvents;
|
|
30
|
+
class CalendarConfig extends CalendarPropsAndEvents {
|
|
31
|
+
}
|
|
32
|
+
DayPilot.CalendarConfig = CalendarConfig;
|
|
33
|
+
class Calendar extends CalendarPropsAndEvents {
|
|
34
|
+
}
|
|
35
|
+
DayPilot.Calendar = Calendar;
|
|
36
|
+
class MonthPropsAndEvents {
|
|
37
|
+
}
|
|
38
|
+
DayPilot.MonthPropsAndEvents = MonthPropsAndEvents;
|
|
39
|
+
class MonthConfig extends MonthPropsAndEvents {
|
|
40
|
+
}
|
|
41
|
+
DayPilot.MonthConfig = MonthConfig;
|
|
42
|
+
class Month extends MonthPropsAndEvents {
|
|
43
|
+
}
|
|
44
|
+
DayPilot.Month = Month;
|
|
45
|
+
class NavigatorPropsAndEvents {
|
|
46
|
+
}
|
|
47
|
+
DayPilot.NavigatorPropsAndEvents = NavigatorPropsAndEvents;
|
|
48
|
+
class NavigatorConfig extends NavigatorPropsAndEvents {
|
|
49
|
+
}
|
|
50
|
+
DayPilot.NavigatorConfig = NavigatorConfig;
|
|
51
|
+
class Navigator extends NavigatorPropsAndEvents {
|
|
52
|
+
}
|
|
53
|
+
DayPilot.Navigator = Navigator;
|
|
54
|
+
class Locale {
|
|
55
|
+
}
|
|
56
|
+
DayPilot.Locale = Locale;
|
|
57
|
+
class Date {
|
|
58
|
+
}
|
|
59
|
+
DayPilot.Date = Date;
|
|
60
|
+
class DayPilotDateCache {
|
|
61
|
+
}
|
|
62
|
+
DayPilot.DayPilotDateCache = DayPilotDateCache;
|
|
63
|
+
class Util {
|
|
64
|
+
}
|
|
65
|
+
DayPilot.Util = Util;
|
|
66
|
+
class Duration {
|
|
67
|
+
}
|
|
68
|
+
DayPilot.Duration = Duration;
|
|
69
|
+
class Event {
|
|
70
|
+
}
|
|
71
|
+
DayPilot.Event = Event;
|
|
72
|
+
class Selection {
|
|
73
|
+
}
|
|
74
|
+
DayPilot.Selection = Selection;
|
|
75
|
+
// modal
|
|
76
|
+
class ModalPropsAndEvents {
|
|
77
|
+
}
|
|
78
|
+
DayPilot.ModalPropsAndEvents = ModalPropsAndEvents;
|
|
79
|
+
class ModalConfig extends ModalPropsAndEvents {
|
|
80
|
+
}
|
|
81
|
+
DayPilot.ModalConfig = ModalConfig;
|
|
82
|
+
class Modal extends ModalPropsAndEvents {
|
|
83
|
+
}
|
|
84
|
+
DayPilot.Modal = Modal;
|
|
85
|
+
class ModalAlertConfig extends ModalConfig {
|
|
86
|
+
}
|
|
87
|
+
DayPilot.ModalAlertConfig = ModalAlertConfig;
|
|
88
|
+
class ModalConfirmConfig extends ModalConfig {
|
|
89
|
+
}
|
|
90
|
+
DayPilot.ModalConfirmConfig = ModalConfirmConfig;
|
|
91
|
+
class ModalPromptConfig extends ModalConfig {
|
|
92
|
+
}
|
|
93
|
+
DayPilot.ModalPromptConfig = ModalPromptConfig;
|
|
94
|
+
class ModalFormConfig extends ModalConfig {
|
|
95
|
+
}
|
|
96
|
+
DayPilot.ModalFormConfig = ModalFormConfig;
|
|
97
|
+
})(DayPilot || (DayPilot = {}));
|
|
98
|
+
/*
|
|
99
|
+
DayPilot Lite
|
|
100
|
+
Copyright (c) 2005 - 2021 Annpoint s.r.o.
|
|
101
|
+
http://www.daypilot.org/
|
|
102
|
+
Licensed under Apache Software License 2.0
|
|
103
|
+
Version: 2021.4.338-lite
|
|
104
|
+
*/
|
|
105
|
+
if ("undefined" == typeof DayPilot)
|
|
106
|
+
var DayPilot = {};
|
|
107
|
+
!function () {
|
|
108
|
+
function e(e) { var t = DayPilot.Date.Cache.Ticks; if (t[e])
|
|
109
|
+
return DayPilot.Stats.cacheHitsTicks += 1, t[e]; var a, r = new Date(e), o = r.getUTCMilliseconds(); a = 0 === o ? "" : o < 10 ? ".00" + o : o < 100 ? ".0" + o : "." + o; var n = r.getUTCSeconds(); n < 10 && (n = "0" + n); var i = r.getUTCMinutes(); i < 10 && (i = "0" + i); var d = r.getUTCHours(); d < 10 && (d = "0" + d); var s = r.getUTCDate(); s < 10 && (s = "0" + s); var l = r.getUTCMonth() + 1; l < 10 && (l = "0" + l); var u = r.getUTCFullYear(); if (u <= 0)
|
|
110
|
+
throw "The minimum year supported is 1."; u < 10 ? u = "000" + u : u < 100 ? u = "00" + u : u < 1e3 && (u = "0" + u); var c = u + "-" + l + "-" + s + "T" + d + ":" + i + ":" + n + a; return t[e] = c, c; }
|
|
111
|
+
if ("undefined" == typeof DayPilot.$) {
|
|
112
|
+
"undefined" == typeof DayPilot.Global && (DayPilot.Global = {}), DayPilot.$ = function (e) { return document.getElementById(e); }, DayPilot.isKhtml = navigator && navigator.userAgent && navigator.userAgent.indexOf("KHTML") !== -1, DayPilot.isIE = navigator && navigator.userAgent && navigator.userAgent.indexOf("MSIE") !== -1, DayPilot.mo2 = function (e, t) { if (t = t || window.event, "undefined" != typeof t.offsetX) {
|
|
113
|
+
var a = { x: t.offsetX + 1, y: t.offsetY + 1 };
|
|
114
|
+
if (!e)
|
|
115
|
+
return a;
|
|
116
|
+
for (var r = t.srcElement; r && r !== e;)
|
|
117
|
+
"SPAN" !== r.tagName && (a.x += r.offsetLeft, r.offsetTop > 0 && (a.y += r.offsetTop - r.scrollTop)), r = r.offsetParent;
|
|
118
|
+
return r ? a : null;
|
|
119
|
+
} if ("undefined" != typeof t.layerX) {
|
|
120
|
+
var a = { x: t.layerX, y: t.layerY, src: t.target };
|
|
121
|
+
if (!e)
|
|
122
|
+
return a;
|
|
123
|
+
for (var r = t.target; r && "absolute" !== r.style.position && "relative" !== r.style.position;)
|
|
124
|
+
r = r.parentNode, DayPilot.isKhtml && (a.y += r.scrollTop);
|
|
125
|
+
for (; r && r !== e;)
|
|
126
|
+
a.x += r.offsetLeft, a.y += r.offsetTop - r.scrollTop, r = r.offsetParent;
|
|
127
|
+
return r ? a : null;
|
|
128
|
+
} return null; }, DayPilot.mo3 = function (e, t, a) { if (t = t || window.event, "undefined" != typeof t.pageX) {
|
|
129
|
+
var r = DayPilot.abs(e, a);
|
|
130
|
+
return { x: t.pageX - r.x, y: t.pageY - r.y };
|
|
131
|
+
} return DayPilot.mo2(e, t); }, DayPilot.browser = {}, DayPilot.browser.ie9 = function () { var e = document.createElement("div"); return e.innerHTML = "<!--[if IE 9]><i></i><![endif]-->", 1 === e.getElementsByTagName("i").length; }(), DayPilot.browser.ielt9 = function () { var e = document.createElement("div"); return e.innerHTML = "<!--[if lt IE 9]><i></i><![endif]-->", 1 === e.getElementsByTagName("i").length; }(), DayPilot.abs = function (e, t) { if (!e)
|
|
132
|
+
return null; var a = { x: e.offsetLeft, y: e.offsetTop, w: e.clientWidth, h: e.clientHeight, toString: function () { return "x:" + this.x + " y:" + this.y + " w:" + this.w + " h:" + this.h; } }; if (e.getBoundingClientRect) {
|
|
133
|
+
var r = e.getBoundingClientRect();
|
|
134
|
+
a.x = r.left, a.y = r.top;
|
|
135
|
+
var o = DayPilot.doc();
|
|
136
|
+
a.x -= o.clientLeft || 0, a.y -= o.clientTop || 0;
|
|
137
|
+
var n = DayPilot.pageOffset();
|
|
138
|
+
if (a.x += n.x, a.y += n.y, t) {
|
|
139
|
+
var i = DayPilot.absOffsetBased(e, !1), t = DayPilot.absOffsetBased(e, !0);
|
|
140
|
+
a.x += t.x - i.x, a.y += t.y - i.y, a.w = t.w, a.h = t.h;
|
|
141
|
+
}
|
|
142
|
+
return a;
|
|
143
|
+
} return DayPilot.absOffsetBased(e, t); }, DayPilot.absOffsetBased = function (e, t) { for (var a = { x: e.offsetLeft, y: e.offsetTop, w: e.clientWidth, h: e.clientHeight, toString: function () { return "x:" + this.x + " y:" + this.y + " w:" + this.w + " h:" + this.h; } }; e.offsetParent;)
|
|
144
|
+
e = e.offsetParent, a.x -= e.scrollLeft, a.y -= e.scrollTop, t && (a.x < 0 && (a.w += a.x, a.x = 0), a.y < 0 && (a.h += a.y, a.y = 0), e.scrollLeft > 0 && a.x + a.w > e.clientWidth && (a.w -= a.x + a.w - e.clientWidth), e.scrollTop && a.y + a.h > e.clientHeight && (a.h -= a.y + a.h - e.clientHeight)), a.x += e.offsetLeft, a.y += e.offsetTop; var r = DayPilot.pageOffset(); return a.x += r.x, a.y += r.y, a; }, DayPilot.isArray = function (e) { return "[object Array]" === Object.prototype.toString.call(e); }, DayPilot.sheet = function () { var e = document.createElement("style"); e.setAttribute("type", "text/css"), e.styleSheet || e.appendChild(document.createTextNode("")), (document.head || document.getElementsByTagName("head")[0]).appendChild(e); var t = !!e.styleSheet, a = {}; return a.rules = [], a.commit = function () { t && (e.styleSheet.cssText = this.rules.join("\n")); }, a.add = function (a, r, o) { return t ? void this.rules.push(a + "{" + r + "}") : void (e.sheet.insertRule ? ("undefined" == typeof o && (o = e.sheet.cssRules.length), e.sheet.insertRule(a + "{" + r + "}", o)) : e.sheet.addRule && e.sheet.addRule(a, r, o)); }, a; }, function () { if (!DayPilot.Global.defaultCss) {
|
|
145
|
+
var e = DayPilot.sheet();
|
|
146
|
+
e.add(".calendar_default_main", "border: 1px solid #c0c0c0; font-family: -apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif; font-size: 13px;"), e.add(".calendar_default_main *, .calendar_default_main *:before, .calendar_default_main *:after", "box-sizing: content-box;"), e.add(".calendar_default_rowheader_inner,.calendar_default_cornerright_inner,.calendar_default_corner_inner,.calendar_default_colheader_inner,.calendar_default_alldayheader_inner", "color: #333;background: #f3f3f3;"), e.add(".calendar_default_cornerright_inner", "position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;\tborder-bottom: 1px solid #c0c0c0;"), e.add(".calendar_default_direction_rtl .calendar_default_cornerright_inner", "border-right: 1px solid #c0c0c0;"), e.add(".calendar_default_rowheader_inner", "font-size: 16pt;text-align: right; position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0; padding: 3px;"), e.add(".calendar_default_direction_rtl .calendar_default_rowheader_inner", "border-right: none;"), e.add(".calendar_default_corner_inner", "position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"), e.add(".calendar_default_direction_rtl .calendar_default_corner_inner", "border-right: none;"), e.add(".calendar_default_rowheader_minutes", "font-size:10px;vertical-align: super;padding-left: 2px;padding-right: 2px;"), e.add(".calendar_default_colheader_inner", "position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0; display: flex; align-items: center; justify-content: center; font-size: 13px;"), e.add(".calendar_default_cell_inner", "position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #ddd;border-bottom: 1px solid #ddd; background: #f9f9f9;"), e.add(".calendar_default_cell_business .calendar_default_cell_inner", "background: #fff"), e.add(".calendar_default_alldayheader_inner", "text-align: center;position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"), e.add(".calendar_default_message", "opacity: 0.9; padding: 10px; color: #ffffff;background: #ffa216;"), e.add(".calendar_default_alldayevent_inner,.calendar_default_event_inner", "color: #666; border: 1px solid #999;"), e.add(".calendar_default_event_bar", "top: 0px;bottom: 0px;left: 0px;width: 4px;background-color: #9dc8e8;"), e.add(".calendar_default_event_bar_inner", "position: absolute;width: 4px;background-color: #1066a8;"), e.add(".calendar_default_alldayevent_inner,.calendar_default_event_inner", 'background: #fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'), e.add(".calendar_default_selected .calendar_default_event_inner", "background: #ddd;"), e.add(".calendar_default_alldayevent_inner", "position: absolute;top: 2px;bottom: 2px;left: 2px;right: 2px;overflow:hidden;padding: 2px;margin-right: 1px; font-size: 13px;"), e.add(".calendar_default_event_withheader .calendar_default_event_inner", "padding-top: 15px;"), e.add(".calendar_default_event", "cursor: default;"), e.add(".calendar_default_event_inner", "position: absolute;overflow: hidden;top: 0px;bottom: 0px;left: 0px;right: 0px;padding: 2px 2px 2px 6px; font-size: 13px;"), e.add(".calendar_default_shadow_inner", "position:absolute;top:0px;left:0px;right:0px;bottom:0px;background-color: #666666; opacity: 0.5;"), e.add(".calendar_default_event_delete", "background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAI5JREFUKFNtkLERgCAMRbmzdK8s4gAUlhYOYEHJEJYOYOEwDmGBPxC4kOPfvePy84MGR0RJ2N1A8H3N6DATwSQ57m2ql8NBG+AEM7D+UW+wjdfUPgerYNgB5gOLRHqhcasg84C2QxPMtrUhSqQIhg7ypy9VM2EUZPI/4rQ7rGxqo9sadTegw+UdjeDLAKUfhbaQUVPIfJYAAAAASUVORK5CYII=) center center no-repeat; opacity: 0.6; cursor: pointer;"), e.add(".calendar_default_event_delete:hover", "opacity: 1;-ms-filter: none;"), e.add(".calendar_default_scroll_up", "background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAB3RJTUUH2wESDiYcrhwCiQAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAARnQU1BAACxjwv8YQUAAACcSURBVHjaY2AgF9wWsTW6yGMlhi7OhC7AyMDQzMnBXIpFHAFuCtuaMTP+P8nA8P/b1x//FfW/HHuF1UQmxv+NUP1c3OxMVVhNvCVi683E8H8LXOY/w9+fTH81tF8fv4NiIpBRj+YoZtZ/LDUoJmKYhsVUpv0MDiyMDP96sIYV0FS2/8z9ICaLlOhvS4b/jC//MzC8xBG0vJeF7GQBlK0xdiUzCtsAAAAASUVORK5CYII=);"), e.add(".calendar_default_scroll_down", "background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAALiMAAC4jAXilP3YAAACqSURBVChTY7wpam3L9J+xmQEP+PGPKZZxP4MDi4zI78uMDIwa2NT+Z2DYovrmiC+TI8OBP/8ZmEqwGvif4e8vxr+FIDkmEKH25vBWBgbG0+iK/zEwLtF+ffwOXCGI8Y+BoRFFIdC030x/WmBiYBNhpgLdswNJ8RSYaSgmgk39z1gPUfj/29ef/9rwhQTDHRHbrbdEbLvRFcGthkkAra/9/uMvhkK8piNLAgCRpTnNn4AEmAAAAABJRU5ErkJggg==);"), e.add(".calendar_default_now", "background-color: red;"), e.add(".calendar_default_now:before", "content: ''; top: -5px; border-width: 5px; border-color: transparent transparent transparent red; border-style: solid; width: 0px; height:0px; position: absolute; -moz-transform: scale(.9999);"), e.add(".calendar_default_shadow_forbidden .calendar_default_shadow_inner", "background-color: red;"), e.add(".calendar_default_shadow_top", 'box-sizing: border-box; padding:2px;border:1px solid #ccc;background:#fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'), e.add(".calendar_default_shadow_bottom", 'box-sizing: border-box; padding:2px;border:1px solid #ccc;background:#fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'), e.add(".calendar_default_crosshair_vertical, .calendar_default_crosshair_horizontal, .calendar_default_crosshair_left, .calendar_default_crosshair_top", "background-color: gray; opacity: 0.2;"), e.add(".calendar_default_loading", "background-color: orange; color: white; padding: 2px;"), e.add(".calendar_default_scroll", "background-color: #f3f3f3;"), e.add(".scheduler_default_selected .scheduler_default_event_inner", "background: #ddd;"), e.add(".scheduler_default_main", "border: 1px solid #c0c0c0;font-family: -apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif; font-size: 13px;"), e.add(".scheduler_default_timeheader", "cursor: default;color: #333;"), e.add(".scheduler_default_message", "opacity: 0.9;filter: alpha(opacity=90);padding: 10px; color: #ffffff;background: #ffa216;"), e.add(".scheduler_default_timeheadergroup,.scheduler_default_timeheadercol", "color: #333;background: #f3f3f3;"), e.add(".scheduler_default_rowheader,.scheduler_default_corner", "color: #333;background: #f3f3f3;"), e.add(".scheduler_default_rowheader_inner", "position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;border-right: 1px solid #eee;padding: 2px;"), e.add(".scheduler_default_timeheadergroup, .scheduler_default_timeheadercol", "text-align: center;"), e.add(".scheduler_default_timeheadergroup_inner", "position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;"), e.add(".scheduler_default_timeheadercol_inner", "position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;border-right: 1px solid #c0c0c0;"), e.add(".scheduler_default_divider", "background-color: #c0c0c0;"), e.add(".scheduler_default_divider_horizontal", "background-color: #c0c0c0;"), e.add(".scheduler_default_matrix_vertical_line", "background-color: #eee;"), e.add(".scheduler_default_matrix_vertical_break", "background-color: #000;"), e.add(".scheduler_default_matrix_horizontal_line", "background-color: #eee;"), e.add(".scheduler_default_resourcedivider", "background-color: #c0c0c0;"), e.add(".scheduler_default_shadow_inner", "background-color: #666666;opacity: 0.5;filter: alpha(opacity=50);height: 100%;xborder-radius: 5px;"), e.add(".scheduler_default_event", "color:#666; font-size: 13px;"), e.add(".scheduler_default_event_inner", "position:absolute;top:0px;left:0px;right:0px;bottom:0px;padding:5px 2px 2px 2px;overflow:hidden;border:1px solid #ccc;"), e.add(".scheduler_default_event_bar", "top:0px;left:0px;right:0px;height:4px;background-color:#9dc8e8;"), e.add(".scheduler_default_event_bar_inner", "position:absolute;height:4px;background-color:#1066a8;"), e.add(".scheduler_default_event_inner", 'background:#fff;background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#eeeeee));background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee);background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee);background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee);background: -o-linear-gradient(top, #ffffff 0%, #eeeeee);background: linear-gradient(top, #ffffff 0%, #eeeeee);filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#eeeeee");'), e.add(".scheduler_default_event_float_inner", "padding:6px 2px 2px 8px;"), e.add(".scheduler_default_event_float_inner:after", 'content:"";border-color: transparent #666 transparent transparent;border-style:solid;border-width:5px;width:0;height:0;position:absolute;top:8px;left:-4px;'), e.add(".scheduler_default_columnheader_inner", "font-weight: bold;"), e.add(".scheduler_default_columnheader_splitter", "background-color: #666;opacity: 0.5;filter: alpha(opacity=50);"), e.add(".scheduler_default_columnheader_cell_inner", "padding: 2px;"), e.add(".scheduler_default_cell", "background-color: #f9f9f9;"), e.add(".scheduler_default_cell.scheduler_default_cell_business", "background-color: #fff;"), e.add(".navigator_default_main", "border-left: 1px solid #c0c0c0;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;background-color: white;color: #000000; box-sizing: content-box;"), e.add(".navigator_default_main *, .navigator_default_main *:before, .navigator_default_main *:after", "box-sizing: content-box;"), e.add(".navigator_default_month", "font-family: -apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif; font-size: 12px;"), e.add(".navigator_default_day", "color: black;"), e.add(".navigator_default_weekend", "background-color: #f0f0f0;"), e.add(".navigator_default_dayheader", "color: black;"), e.add(".navigator_default_line", "border-bottom: 1px solid #c0c0c0;"), e.add(".navigator_default_dayother", "color: gray;"), e.add(".navigator_default_todaybox", "border: 1px solid red;"), e.add(".navigator_default_title, .navigator_default_titleleft, .navigator_default_titleright", "border-top: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;color: #333;background: #f3f3f3;"), e.add(".navigator_default_busy", "font-weight: bold;"), e.add(".navigator_default_cell", "text-align: center;"), e.add(".navigator_default_select .navigator_default_cell_box", "background-color: #FFE794; opacity: 0.5;"), e.add(".navigator_default_title", "text-align: center;"), e.add(".navigator_default_titleleft, .navigator_default_titleright", "text-align: center;"), e.add(".navigator_default_dayheader", "text-align: center;"), e.add(".navigator_default_weeknumber", "text-align: center;"), e.add(".navigator_default_cell_text", "cursor: pointer;"), e.add(".month_default_main", "border: 1px solid #c0c0c0;font-family: -apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif; font-size: 13px;color: #333;"), e.add(".month_default_main *, .month_default_main *:before, .month_default_main *:after", "box-sizing: content-box;"), e.add(".month_default_cell_inner", "border-right: 1px solid #ddd;border-bottom: 1px solid #ddd;position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;background-color: #f9f9f9;"), e.add(".month_default_cell_business .month_default_cell_inner", "background-color: #fff;"), e.add(".month_default_cell_header", "text-align: right; padding: 4px; box-sizing: border-box;"), e.add(".month_default_header_inner", "position: absolute;top: 0px;left: 0px;bottom: 0px;right: 0px;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;cursor: default;color: #333;background: #f3f3f3; overflow:hidden; display: flex; align-items: center; justify-content: center;"), e.add(".month_default_message", "padding: 10px;opacity: 0.9; color: #ffffff;background: #ffa216;"), e.add(".month_default_event_inner", "position: absolute;top: 0px;bottom: 0px;left: 1px;right: 1px;overflow:hidden;padding: 2px;padding-left: 5px;color: #333;background: #fff;background: linear-gradient(to bottom, #ffffff 0%, #eeeeee);border: 1px solid #999;border-radius: 0px;display: flex; align-items: center; font-size: 13px;"), e.add(".month_default_event_continueright .month_default_event_inner", "border-top-right-radius: 0px;border-bottom-right-radius: 0px;border-right-style: dotted;"), e.add(".month_default_event_continueleft .month_default_event_inner", "border-top-left-radius: 0px;border-bottom-left-radius: 0px;border-left-style: dotted;"), e.add(".month_default_selected .month_default_event_inner", "background: #ddd;"), e.add(".month_default_shadow_inner", "background-color: #666666;opacity: 0.5;height: 100%;"), e.add(".month_default_event_delete", "background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAI5JREFUKFNtkLERgCAMRbmzdK8s4gAUlhYOYEHJEJYOYOEwDmGBPxC4kOPfvePy84MGR0RJ2N1A8H3N6DATwSQ57m2ql8NBG+AEM7D+UW+wjdfUPgerYNgB5gOLRHqhcasg84C2QxPMtrUhSqQIhg7ypy9VM2EUZPI/4rQ7rGxqo9sadTegw+UdjeDLAKUfhbaQUVPIfJYAAAAASUVORK5CYII=) center center no-repeat; opacity: 0.6; cursor: pointer;"), e.add(".month_default_event_delete:hover", "opacity: 1;-ms-filter: none;"), e.add(".month_default_event_timeleft", "color: #ccc; font-size: 8pt"), e.add(".month_default_event_timeright", "color: #ccc; font-size: 8pt; text-align: right;"), e.add(".month_default_loading", "background-color: orange; color: white; padding: 2px;"), e.commit(), DayPilot.Global.defaultCss = !0;
|
|
147
|
+
} }(), DayPilot.doc = function () { var e = document.documentElement; return e && e.clientHeight ? e : document.body; }, DayPilot.guid = function () { var e = function () { return (65536 * (1 + Math.random()) | 0).toString(16).substring(1); }; return "" + e() + e() + "-" + e() + "-" + e() + "-" + e() + "-" + e() + e() + e(); }, DayPilot.pageOffset = function () { if ("undefined" != typeof pageXOffset)
|
|
148
|
+
return { x: pageXOffset, y: pageYOffset }; var e = DayPilot.doc(); return { x: e.scrollLeft, y: e.scrollTop }; }, DayPilot.indexOf = function (e, t) { if (!e || !e.length)
|
|
149
|
+
return -1; for (var a = 0; a < e.length; a++)
|
|
150
|
+
if (e[a] === t)
|
|
151
|
+
return a; return -1; }, DayPilot.mc = function (e) { return e.pageX || e.pageY ? { x: e.pageX, y: e.pageY } : { x: e.clientX + document.documentElement.scrollLeft, y: e.clientY + document.documentElement.scrollTop }; }, DayPilot.Stats = {}, DayPilot.Stats.eventObjects = 0, DayPilot.Stats.dateObjects = 0, DayPilot.Stats.cacheHitsCtor = 0, DayPilot.Stats.cacheHitsParsing = 0, DayPilot.Stats.cacheHitsTicks = 0, DayPilot.Stats.print = function () { console.log("DayPilot.Stats.eventObjects: " + DayPilot.Stats.eventObjects), console.log("DayPilot.Stats.dateObjects: " + DayPilot.Stats.dateObjects), console.log("DayPilot.Stats.cacheHitsCtor: " + DayPilot.Stats.cacheHitsCtor), console.log("DayPilot.Stats.cacheHitsParsing: " + DayPilot.Stats.cacheHitsParsing), console.log("DayPilot.Stats.cacheHitsTicks: " + DayPilot.Stats.cacheHitsTicks), console.log("DayPilot.Date.Cache.Ctor keys: " + Object.keys(DayPilot.Date.Cache.Ctor).length), console.log("DayPilot.Date.Cache.Parsing keys: " + Object.keys(DayPilot.Date.Cache.Parsing).length); }, DayPilot.re = function (e, t, a) { e.addEventListener ? e.addEventListener(t, a, !1) : e.attachEvent && e.attachEvent("on" + t, a); }, DayPilot.pu = function (e) { var t, a, r, o = e.attributes; if (o)
|
|
152
|
+
for (a = o.length, t = 0; t < a; t += 1)
|
|
153
|
+
o[t] && (r = o[t].name, "function" == typeof e[r] && (e[r] = null)); if (o = e.childNodes)
|
|
154
|
+
for (a = o.length, t = 0; t < a; t += 1) {
|
|
155
|
+
DayPilot.pu(e.childNodes[t]);
|
|
156
|
+
} }, DayPilot.de = function (e) { if (e)
|
|
157
|
+
if (DayPilot.isArray(e))
|
|
158
|
+
for (var t = 0; t < e.length; t++)
|
|
159
|
+
DayPilot.de(e[t]);
|
|
160
|
+
else
|
|
161
|
+
e.parentNode && e.parentNode.removeChild(e); }, DayPilot.sw = function (e) { return e ? e.offsetWidth - e.clientWidth : 0; }, DayPilot.am = function () { return "undefined" == typeof angular ? null : (DayPilot.am.cached || (DayPilot.am.cached = angular.module("daypilot", [])), DayPilot.am.cached); }, DayPilot.Selection = function (e, t, a, r) { this.type = "selection", this.start = e.isDayPilotDate ? e : new DayPilot.Date(e), this.end = t.isDayPilotDate ? t : new DayPilot.Date(t), this.resource = a, this.root = r, this.toJSON = function (e) { var t = {}; return t.start = this.start, t.end = this.end, t.resource = this.resource, t; }; }, DayPilot.request = function (e, t, a, r) { var o = DayPilot.createXmlHttp(); o && (o.open("POST", e, !0), o.setRequestHeader("Content-type", "text/plain"), o.onreadystatechange = function () { if (4 === o.readyState)
|
|
162
|
+
return 200 !== o.status && 304 !== o.status ? void (r ? r(o) : window.console && console.log("HTTP error " + o.status)) : void t(o); }, 4 !== o.readyState && ("object" == typeof a && (a = JSON.stringify(a)), o.send(a))); }, DayPilot.ajax = function (e) { if (!e)
|
|
163
|
+
throw new DayPilot.Exception("Parameter object required."); if ("string" != typeof e.url)
|
|
164
|
+
throw new DayPilot.Exception("The parameter object must have 'url' property."); var t = DayPilot.createXmlHttp(); if (!t)
|
|
165
|
+
throw new DayPilot.Exception("Unable to create XMLHttpRequest object"); var a = "object" == typeof e.data, r = e.data, o = e.method || (e.data ? "POST" : "GET"), n = e.success || function () { }, i = e.error || function () { }, d = e.url, s = e.contentType || (a ? "application/json" : "text/plain"), l = e.headers || {}; t.open(o, d, !0), t.setRequestHeader("Content-type", s), DayPilot.Util.ownPropsAsArray(l).forEach(function (e) { t.setRequestHeader(e.key, e.val); }), t.onreadystatechange = function () { if (4 === t.readyState)
|
|
166
|
+
if (200 === t.status || 201 === t.status || 204 === t.status || 304 === t.status) {
|
|
167
|
+
var e = {};
|
|
168
|
+
e.request = t, t.responseText && (e.data = JSON.parse(t.responseText)), n(e);
|
|
169
|
+
}
|
|
170
|
+
else if (i) {
|
|
171
|
+
var e = {};
|
|
172
|
+
e.request = t, i(e);
|
|
173
|
+
}
|
|
174
|
+
else
|
|
175
|
+
window.console && console.log("HTTP error " + t.status); }, 4 !== t.readyState && (a && (r = JSON.stringify(r)), t.send(r)); }, DayPilot.createXmlHttp = function () { return new XMLHttpRequest; }, DayPilot.Http = {}, DayPilot.Http.ajax = function (e) { DayPilot.ajax(e); }, DayPilot.Util = {}, DayPilot.Util.addClass = function (e, t) { if (e) {
|
|
176
|
+
if (!e.className)
|
|
177
|
+
return void (e.className = t);
|
|
178
|
+
new RegExp("(^|\\s)" + t + "($|\\s)").test(e.className) || (e.className = e.className + " " + t);
|
|
179
|
+
} }, DayPilot.Util.removeClass = function (e, t) { if (e) {
|
|
180
|
+
var a = new RegExp("(^|\\s)" + t + "($|\\s)");
|
|
181
|
+
e.className = e.className.replace(a, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
|
|
182
|
+
} }, DayPilot.Util.ownPropsAsArray = function (e) { var t = []; if (!e)
|
|
183
|
+
return t; for (var a in e)
|
|
184
|
+
if (e.hasOwnProperty(a)) {
|
|
185
|
+
var r = {};
|
|
186
|
+
r.key = a, r.val = e[a], t.push(r);
|
|
187
|
+
} return t; }, DayPilot.Util.replaceCharAt = function (e, t, a) { return e.substr(0, t) + a + e.substr(t + a.length); }, DayPilot.Util.isNullOrUndefined = function (e) { return null === e || "undefined" == typeof e; }, DayPilot.Exception = function (e) { return new Error(e); }, DayPilot.Locale = function (e, t) { if (this.id = e, this.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], this.dayNamesShort = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], this.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], this.datePattern = "M/d/yyyy", this.timePattern = "H:mm", this.dateTimePattern = "M/d/yyyy H:mm", this.timeFormat = "Clock12Hours", this.weekStarts = 0, t)
|
|
188
|
+
for (var a in t)
|
|
189
|
+
this[a] = t[a]; }, DayPilot.Locale.all = {}, DayPilot.Locale.find = function (e) { if (!e)
|
|
190
|
+
return null; var t = e.toLowerCase(); return t.length > 2 && (t = DayPilot.Util.replaceCharAt(t, 2, "-")), DayPilot.Locale.all[t]; }, DayPilot.Locale.register = function (e) { DayPilot.Locale.all[e.id] = e; }, DayPilot.Locale.register(new DayPilot.Locale("ca-es", { "dayNames": ["diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte"], "dayNamesShort": ["dg", "dl", "dt", "dc", "dj", "dv", "ds"], "monthNames": ["gener", "febrer", "març", "abril", "maig", "juny", "juliol", "agost", "setembre", "octubre", "novembre", "desembre", ""], "monthNamesShort": ["gen.", "febr.", "març", "abr.", "maig", "juny", "jul.", "ag.", "set.", "oct.", "nov.", "des.", ""], "timePattern": "H:mm", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("cs-cz", { "dayNames": ["neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota"], "dayNamesShort": ["ne", "po", "út", "st", "čt", "pá", "so"], "monthNames": ["leden", "únor", "březen", "duben", "květen", "červen", "červenec", "srpen", "září", "říjen", "listopad", "prosinec", ""], "monthNamesShort": ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", ""], "timePattern": "H:mm", "datePattern": "d. M. yyyy", "dateTimePattern": "d. M. yyyy H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("da-dk", { "dayNames": ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], "dayNamesShort": ["sø", "ma", "ti", "on", "to", "fr", "lø"], "monthNames": ["januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december", ""], "monthNamesShort": ["jan", "feb", "mar", "apr", "maj", "jun", "jul", "aug", "sep", "okt", "nov", "dec", ""], "timePattern": "HH:mm", "datePattern": "dd-MM-yyyy", "dateTimePattern": "dd-MM-yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("de-at", { "dayNames": ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], "dayNamesShort": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], "monthNames": ["Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""], "monthNamesShort": ["Jän", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""], "timePattern": "HH:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("de-ch", { "dayNames": ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], "dayNamesShort": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], "monthNames": ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""], "monthNamesShort": ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""], "timePattern": "HH:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("de-de", { "dayNames": ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], "dayNamesShort": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], "monthNames": ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""], "monthNamesShort": ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""], "timePattern": "HH:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("de-lu", { "dayNames": ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], "dayNamesShort": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], "monthNames": ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""], "monthNamesShort": ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""], "timePattern": "HH:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("en-au", { "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], "dayNamesShort": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""], "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""], "timePattern": "h:mm tt", "datePattern": "d/MM/yyyy", "dateTimePattern": "d/MM/yyyy h:mm tt", "timeFormat": "Clock12Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("en-ca", { "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], "dayNamesShort": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""], "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""], "timePattern": "h:mm tt", "datePattern": "yyyy-MM-dd", "dateTimePattern": "yyyy-MM-dd h:mm tt", "timeFormat": "Clock12Hours", "weekStarts": 0 })), DayPilot.Locale.register(new DayPilot.Locale("en-gb", { "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], "dayNamesShort": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""], "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""], "timePattern": "HH:mm", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("en-us", { "dayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], "dayNamesShort": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], "monthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""], "monthNamesShort": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""], "timePattern": "h:mm tt", "datePattern": "M/d/yyyy", "dateTimePattern": "M/d/yyyy h:mm tt", "timeFormat": "Clock12Hours", "weekStarts": 0 })), DayPilot.Locale.register(new DayPilot.Locale("es-es", { "dayNames": ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], "dayNamesShort": ["D", "L", "M", "X", "J", "V", "S"], "monthNames": ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre", ""], "monthNamesShort": ["ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sep.", "oct.", "nov.", "dic.", ""], "timePattern": "H:mm", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("es-mx", { "dayNames": ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], "dayNamesShort": ["do.", "lu.", "ma.", "mi.", "ju.", "vi.", "sá."], "monthNames": ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre", ""], "monthNamesShort": ["ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sep.", "oct.", "nov.", "dic.", ""], "timePattern": "hh:mm tt", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy hh:mm tt", "timeFormat": "Clock12Hours", "weekStarts": 0 })), DayPilot.Locale.register(new DayPilot.Locale("eu-es", { "dayNames": ["igandea", "astelehena", "asteartea", "asteazkena", "osteguna", "ostirala", "larunbata"], "dayNamesShort": ["ig", "al", "as", "az", "og", "or", "lr"], "monthNames": ["urtarrila", "otsaila", "martxoa", "apirila", "maiatza", "ekaina", "uztaila", "abuztua", "iraila", "urria", "azaroa", "abendua", ""], "monthNamesShort": ["urt.", "ots.", "mar.", "api.", "mai.", "eka.", "uzt.", "abu.", "ira.", "urr.", "aza.", "abe.", ""],
|
|
191
|
+
"timePattern": "H:mm", "datePattern": "yyyy/MM/dd", "dateTimePattern": "yyyy/MM/dd H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("fi-fi", { "dayNames": ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"], "dayNamesShort": ["su", "ma", "ti", "ke", "to", "pe", "la"], "monthNames": ["tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kesäkuu", "heinäkuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu", ""], "monthNamesShort": ["tammi", "helmi", "maalis", "huhti", "touko", "kesä", "heinä", "elo", "syys", "loka", "marras", "joulu", ""], "timePattern": "H:mm", "datePattern": "d.M.yyyy", "dateTimePattern": "d.M.yyyy H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("fr-be", { "dayNames": ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], "dayNamesShort": ["di", "lu", "ma", "me", "je", "ve", "sa"], "monthNames": ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", ""], "monthNamesShort": ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", ""], "timePattern": "HH:mm", "datePattern": "dd-MM-yy", "dateTimePattern": "dd-MM-yy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("fr-ch", { "dayNames": ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], "dayNamesShort": ["di", "lu", "ma", "me", "je", "ve", "sa"], "monthNames": ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", ""], "monthNamesShort": ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", ""], "timePattern": "HH:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("fr-fr", { "dayNames": ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], "dayNamesShort": ["di", "lu", "ma", "me", "je", "ve", "sa"], "monthNames": ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", ""], "monthNamesShort": ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", ""], "timePattern": "HH:mm", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("fr-lu", { "dayNames": ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], "dayNamesShort": ["di", "lu", "ma", "me", "je", "ve", "sa"], "monthNames": ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre", ""], "monthNamesShort": ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc.", ""], "timePattern": "HH:mm", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("gl-es", { "dayNames": ["domingo", "luns", "martes", "mércores", "xoves", "venres", "sábado"], "dayNamesShort": ["do", "lu", "ma", "mé", "xo", "ve", "sá"], "monthNames": ["xaneiro", "febreiro", "marzo", "abril", "maio", "xuño", "xullo", "agosto", "setembro", "outubro", "novembro", "decembro", ""], "monthNamesShort": ["xan", "feb", "mar", "abr", "maio", "xuño", "xul", "ago", "set", "out", "nov", "dec", ""], "timePattern": "H:mm", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("it-it", { "dayNames": ["domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato"], "dayNamesShort": ["do", "lu", "ma", "me", "gi", "ve", "sa"], "monthNames": ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre", ""], "monthNamesShort": ["gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic", ""], "timePattern": "HH:mm", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("it-ch", { "dayNames": ["domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato"], "dayNamesShort": ["do", "lu", "ma", "me", "gi", "ve", "sa"], "monthNames": ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre", ""], "monthNamesShort": ["gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic", ""], "timePattern": "HH:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("ja-jp", { "dayNames": ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], "dayNamesShort": ["日", "月", "火", "水", "木", "金", "土"], "monthNames": ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", ""], "monthNamesShort": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", ""], "timePattern": "H:mm", "datePattern": "yyyy/MM/dd", "dateTimePattern": "yyyy/MM/dd H:mm", "timeFormat": "Clock24Hours", "weekStarts": 0 })), DayPilot.Locale.register(new DayPilot.Locale("nb-no", { "dayNames": ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], "dayNamesShort": ["sø", "ma", "ti", "on", "to", "fr", "lø"], "monthNames": ["januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember", ""], "monthNamesShort": ["jan", "feb", "mar", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "des", ""], "timePattern": "HH:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("nl-nl", { "dayNames": ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"], "dayNamesShort": ["zo", "ma", "di", "wo", "do", "vr", "za"], "monthNames": ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december", ""], "monthNamesShort": ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec", ""], "timePattern": "HH:mm", "datePattern": "d-M-yyyy", "dateTimePattern": "d-M-yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("nl-be", { "dayNames": ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"], "dayNamesShort": ["zo", "ma", "di", "wo", "do", "vr", "za"], "monthNames": ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december", ""], "monthNamesShort": ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec", ""], "timePattern": "H:mm", "datePattern": "d/MM/yyyy", "dateTimePattern": "d/MM/yyyy H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("nn-no", { "dayNames": ["søndag", "måndag", "tysdag", "onsdag", "torsdag", "fredag", "laurdag"], "dayNamesShort": ["sø", "må", "ty", "on", "to", "fr", "la"], "monthNames": ["januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember", ""], "monthNamesShort": ["jan", "feb", "mar", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "des", ""], "timePattern": "HH:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("pt-br", { "dayNames": ["domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado"], "dayNamesShort": ["D", "S", "T", "Q", "Q", "S", "S"], "monthNames": ["janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro", ""], "monthNamesShort": ["jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez", ""], "timePattern": "HH:mm", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 0 })), DayPilot.Locale.register(new DayPilot.Locale("pl-pl", { "dayNames": ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"], "dayNamesShort": ["N", "Pn", "Wt", "Śr", "Cz", "Pt", "So"], "monthNames": ["styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień", ""], "monthNamesShort": ["sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru", ""], "timePattern": "HH:mm", "datePattern": "yyyy-MM-dd", "dateTimePattern": "yyyy-MM-dd HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("pt-pt", { "dayNames": ["domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado"], "dayNamesShort": ["D", "S", "T", "Q", "Q", "S", "S"], "monthNames": ["janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro", ""], "monthNamesShort": ["jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez", ""], "timePattern": "HH:mm", "datePattern": "dd/MM/yyyy", "dateTimePattern": "dd/MM/yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 0 })), DayPilot.Locale.register(new DayPilot.Locale("ro-ro", { "dayNames": ["duminică", "luni", "marți", "miercuri", "joi", "vineri", "sâmbătă"], "dayNamesShort": ["D", "L", "Ma", "Mi", "J", "V", "S"], "monthNames": ["ianuarie", "februarie", "martie", "aprilie", "mai", "iunie", "iulie", "august", "septembrie", "octombrie", "noiembrie", "decembrie", ""], "monthNamesShort": ["ian.", "feb.", "mar.", "apr.", "mai.", "iun.", "iul.", "aug.", "sep.", "oct.", "nov.", "dec.", ""], "timePattern": "H:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("ru-ru", { "dayNames": ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"], "dayNamesShort": ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"], "monthNames": ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь", ""], "monthNamesShort": ["янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек", ""], "timePattern": "H:mm", "datePattern": "dd.MM.yyyy", "dateTimePattern": "dd.MM.yyyy H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("sk-sk", { "dayNames": ["nedeľa", "pondelok", "utorok", "streda", "štvrtok", "piatok", "sobota"], "dayNamesShort": ["ne", "po", "ut", "st", "št", "pi", "so"], "monthNames": ["január", "február", "marec", "apríl", "máj", "jún", "júl", "august", "september", "október", "november", "december", ""], "monthNamesShort": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", ""], "timePattern": "H:mm", "datePattern": "d.M.yyyy", "dateTimePattern": "d.M.yyyy H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("sv-se", { "dayNames": ["söndag", "måndag", "tisdag", "onsdag", "torsdag", "fredag", "lördag"], "dayNamesShort": ["sö", "må", "ti", "on", "to", "fr", "lö"], "monthNames": ["januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december", ""], "monthNamesShort": ["jan", "feb", "mar", "apr", "maj", "jun", "jul", "aug", "sep", "okt", "nov", "dec", ""], "timePattern": "HH:mm", "datePattern": "yyyy-MM-dd", "dateTimePattern": "yyyy-MM-dd HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("tr-tr", { "dayNames": ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"], "dayNamesShort": ["Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct"], "monthNames": ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık", ""], "monthNamesShort": ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara", ""], "timePattern": "HH:mm", "datePattern": "d.M.yyyy", "dateTimePattern": "d.M.yyyy HH:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.register(new DayPilot.Locale("zh-cn", { "dayNames": ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], "dayNamesShort": ["日", "一", "二", "三", "四", "五", "六"], "monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", ""], "monthNamesShort": ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", ""], "timePattern": "H:mm", "datePattern": "yyyy/M/d", "dateTimePattern": "yyyy/M/d H:mm", "timeFormat": "Clock24Hours", "weekStarts": 1 })), DayPilot.Locale.US = DayPilot.Locale.find("en-us"), DayPilot.Duration = function (e) { var t = this, a = 864e5, r = 36e5, o = 6e4, n = 1e3; if (2 === arguments.length) {
|
|
192
|
+
var i = arguments[0], d = arguments[1];
|
|
193
|
+
if (!(i instanceof DayPilot.Date) && "string" != typeof i)
|
|
194
|
+
throw "DayPilot.Duration(): Invalid start argument, DayPilot.Date expected";
|
|
195
|
+
if (!(d instanceof DayPilot.Date) && "string" != typeof d)
|
|
196
|
+
throw "DayPilot.Duration(): Invalid end argument, DayPilot.Date expected";
|
|
197
|
+
"string" == typeof i && (i = new DayPilot.Date(i)), "string" == typeof d && (d = new DayPilot.Date(d)), e = d.getTime() - i.getTime();
|
|
198
|
+
} return this.ticks = e, DayPilot.Date.Cache.DurationCtor["" + e] ? DayPilot.Date.Cache.DurationCtor["" + e] : (DayPilot.Date.Cache.DurationCtor["" + e] = this, this.toString = function (e) { if (!e)
|
|
199
|
+
return t.days() + "." + t.hours() + ":" + t.minutes() + ":" + t.seconds() + "." + t.milliseconds(); var a = t.minutes(); a = (a < 10 ? "0" : "") + a; var r = e; return r = r.replace("mm", a), r = r.replace("m", t.minutes()), r = r.replace("H", t.hours()), r = r.replace("h", t.hours()), r = r.replace("d", t.days()), r = r.replace("s", t.seconds()); }, this.totalHours = function () { return t.ticks / r; }, this.totalDays = function () { return t.ticks / a; }, this.totalMinutes = function () { return t.ticks / o; }, this.totalSeconds = function () { return t.ticks / n; }, this.days = function () { return Math.floor(t.totalDays()); }, this.hours = function () { var e = t.ticks - t.days() * a; return Math.floor(e / r); }, this.minutes = function () { var e = t.ticks - Math.floor(t.totalHours()) * r; return Math.floor(e / o); }, this.seconds = function () { var e = t.ticks - Math.floor(t.totalMinutes()) * o; return Math.floor(e / n); }, void (this.milliseconds = function () { return t.ticks % n; })); }, DayPilot.Duration.weeks = function (e) { return new DayPilot.Duration(1e3 * e * 60 * 60 * 24 * 7); }, DayPilot.Duration.days = function (e) { return new DayPilot.Duration(1e3 * e * 60 * 60 * 24); }, DayPilot.Duration.hours = function (e) { return new DayPilot.Duration(1e3 * e * 60 * 60); }, DayPilot.Duration.minutes = function (e) { return new DayPilot.Duration(1e3 * e * 60); }, DayPilot.Duration.seconds = function (e) { return new DayPilot.Duration(1e3 * e); }, DayPilot.TimeSpan = function () { throw "Please use DayPilot.Duration class instead of DayPilot.TimeSpan."; };
|
|
200
|
+
try {
|
|
201
|
+
DayPilot.TimeSpan.prototype = Object.create(DayPilot.Duration.prototype);
|
|
202
|
+
}
|
|
203
|
+
catch (e) { }
|
|
204
|
+
DayPilot.Date = function (t, a) { if (t instanceof DayPilot.Date)
|
|
205
|
+
return t; var r; DayPilot.Util.isNullOrUndefined(t) && (r = DayPilot.DateUtil.fromLocal().getTime(), t = r); var o = DayPilot.Date.Cache.Ctor; if (o[t])
|
|
206
|
+
return DayPilot.Stats.cacheHitsCtor += 1, o[t]; var n = !1; if ("string" == typeof t)
|
|
207
|
+
r = DayPilot.DateUtil.fromStringSortable(t, a).getTime(), n = !0;
|
|
208
|
+
else if ("number" == typeof t) {
|
|
209
|
+
if (isNaN(t))
|
|
210
|
+
throw "Cannot create DayPilot.Date from NaN";
|
|
211
|
+
r = t;
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
if (!(t instanceof Date))
|
|
215
|
+
throw "Unrecognized parameter: use Date, number or string in ISO 8601 format";
|
|
216
|
+
r = a ? DayPilot.DateUtil.fromLocal(t).getTime() : t.getTime();
|
|
217
|
+
} var i = e(r); return o[i] ? o[i] : (o[i] = this, o[r] = this, n && i !== t && DayPilot.DateUtil.hasTzSpec(t) && (o[t] = this), Object.defineProperty && !DayPilot.browser.ielt9 ? (Object.defineProperty(this, "ticks", { get: function () { return r; } }), Object.defineProperty(this, "value", { "value": i, "writable": !1, "enumerable": !0 })) : (this.ticks = r, this.value = i), DayPilot.Date.Config.legacyShowD && (this.d = new Date(r)), void (DayPilot.Stats.dateObjects += 1)); }, DayPilot.Date.Config = {}, DayPilot.Date.Config.legacyShowD = !1, DayPilot.Date.Cache = {}, DayPilot.Date.Cache.Parsing = {}, DayPilot.Date.Cache.Ctor = {}, DayPilot.Date.Cache.Ticks = {}, DayPilot.Date.Cache.DurationCtor = {}, DayPilot.Date.Cache.clear = function () { DayPilot.Date.Cache.Parsing = {}, DayPilot.Date.Cache.Ctor = {}, DayPilot.Date.Cache.Ticks = {}, DayPilot.Date.Cache.DurationCtor = {}; }, DayPilot.Date.prototype.addDays = function (e) { return e ? new DayPilot.Date(this.ticks + 24 * e * 60 * 60 * 1e3) : this; }, DayPilot.Date.prototype.addHours = function (e) { return e ? this.addTime(60 * e * 60 * 1e3) : this; }, DayPilot.Date.prototype.addMilliseconds = function (e) { return e ? this.addTime(e) : this; }, DayPilot.Date.prototype.addMinutes = function (e) { return e ? this.addTime(60 * e * 1e3) : this; }, DayPilot.Date.prototype.addMonths = function (e) { if (!e)
|
|
218
|
+
return this; var t = new Date(this.ticks), a = t.getUTCFullYear(), r = t.getUTCMonth() + 1; if (e > 0) {
|
|
219
|
+
for (; e >= 12;)
|
|
220
|
+
e -= 12, a++;
|
|
221
|
+
e > 12 - r ? (a++, r = e - (12 - r)) : r += e;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
for (; e <= -12;)
|
|
225
|
+
e += 12, a--;
|
|
226
|
+
r + e <= 0 ? (a--, r = 12 + r + e) : r += e;
|
|
227
|
+
} var o = new Date(t.getTime()); o.setUTCDate(1), o.setUTCFullYear(a), o.setUTCMonth(r - 1); var n = new DayPilot.Date(o).daysInMonth(); return o.setUTCDate(Math.min(n, t.getUTCDate())), new DayPilot.Date(o); }, DayPilot.Date.prototype.addSeconds = function (e) { return e ? this.addTime(1e3 * e) : this; }, DayPilot.Date.prototype.addTime = function (e) { return e ? (e instanceof DayPilot.Duration && (e = e.ticks), new DayPilot.Date(this.ticks + e)) : this; }, DayPilot.Date.prototype.addYears = function (e) { var t = new Date(this.ticks), a = new Date(this.ticks), r = this.getYear() + e, o = this.getMonth(); a.setUTCDate(1), a.setUTCFullYear(r), a.setUTCMonth(o); var n = new DayPilot.Date(a).daysInMonth(); return a.setUTCDate(Math.min(n, t.getUTCDate())), new DayPilot.Date(a); }, DayPilot.Date.prototype.dayOfWeek = function () { return new Date(this.ticks).getUTCDay(); }, DayPilot.Date.prototype.getDayOfWeek = function () { return new Date(this.ticks).getUTCDay(); }, DayPilot.Date.prototype.getDayOfYear = function () { var e = this.firstDayOfYear(); return DayPilot.DateUtil.daysDiff(e, this) + 1; }, DayPilot.Date.prototype.daysInMonth = function () { var e = new Date(this.ticks), t = e.getUTCMonth() + 1, a = e.getUTCFullYear(), r = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; return 2 !== t ? r[t - 1] : a % 4 !== 0 ? r[1] : a % 100 === 0 && a % 400 !== 0 ? r[1] : r[1] + 1; }, DayPilot.Date.prototype.daysInYear = function () { var e = this.getYear(); return e % 4 !== 0 ? 365 : e % 100 === 0 && e % 400 !== 0 ? 365 : 366; }, DayPilot.Date.prototype.dayOfYear = function () { return Math.ceil((this.getDatePart().getTime() - this.firstDayOfYear().getTime()) / 864e5) + 1; }, DayPilot.Date.prototype.equals = function (e) { if (null === e)
|
|
228
|
+
return !1; if (e instanceof DayPilot.Date)
|
|
229
|
+
return this === e; throw "The parameter must be a DayPilot.Date object (DayPilot.Date.equals())"; }, DayPilot.Date.prototype.firstDayOfMonth = function () { var e = new Date; return e.setUTCFullYear(this.getYear(), this.getMonth(), 1), e.setUTCHours(0), e.setUTCMinutes(0), e.setUTCSeconds(0), e.setUTCMilliseconds(0), new DayPilot.Date(e); }, DayPilot.Date.prototype.firstDayOfYear = function () { var e = this.getYear(), t = new Date; return t.setUTCFullYear(e, 0, 1), t.setUTCHours(0), t.setUTCMinutes(0), t.setUTCSeconds(0), t.setUTCMilliseconds(0), new DayPilot.Date(t); }, DayPilot.Date.prototype.firstDayOfWeek = function (e) { var t = this; if (e instanceof DayPilot.Locale)
|
|
230
|
+
e = e.weekStarts;
|
|
231
|
+
else if ("string" == typeof e && DayPilot.Locale.find(e)) {
|
|
232
|
+
var a = DayPilot.Locale.find(e);
|
|
233
|
+
e = a.weekStarts;
|
|
234
|
+
}
|
|
235
|
+
else
|
|
236
|
+
e = e || 0; for (var r = t.dayOfWeek(); r !== e;)
|
|
237
|
+
t = t.addDays(-1), r = t.dayOfWeek(); return new DayPilot.Date(t); }, DayPilot.Date.prototype.getDay = function () { return new Date(this.ticks).getUTCDate(); }, DayPilot.Date.prototype.getDatePart = function () { var e = new Date(this.ticks); return e.setUTCHours(0), e.setUTCMinutes(0), e.setUTCSeconds(0), e.setUTCMilliseconds(0), new DayPilot.Date(e); }, DayPilot.Date.prototype.getYear = function () { return new Date(this.ticks).getUTCFullYear(); }, DayPilot.Date.prototype.getHours = function () { return new Date(this.ticks).getUTCHours(); }, DayPilot.Date.prototype.getMilliseconds = function () { return new Date(this.ticks).getUTCMilliseconds(); }, DayPilot.Date.prototype.getMinutes = function () { return new Date(this.ticks).getUTCMinutes(); }, DayPilot.Date.prototype.getMonth = function () { return new Date(this.ticks).getUTCMonth(); }, DayPilot.Date.prototype.getSeconds = function () { return new Date(this.ticks).getUTCSeconds(); }, DayPilot.Date.prototype.getTotalTicks = function () { return this.getTime(); }, DayPilot.Date.prototype.getTime = function () { return this.ticks; }, DayPilot.Date.prototype.getTimePart = function () { var e = this.getDatePart(); return DayPilot.DateUtil.diff(this, e); }, DayPilot.Date.prototype.lastDayOfMonth = function () { var e = new Date(this.firstDayOfMonth().getTime()), t = this.daysInMonth(); return e.setUTCDate(t), new DayPilot.Date(e); }, DayPilot.Date.prototype.weekNumber = function () { var e = this.firstDayOfYear(), t = (this.getTime() - e.getTime()) / 864e5; return Math.ceil((t + e.dayOfWeek() + 1) / 7); }, DayPilot.Date.prototype.weekNumberISO = function () { var e = !1, t = this.dayOfYear(), a = this.firstDayOfYear().dayOfWeek(), r = this.firstDayOfYear().addYears(1).addDays(-1).dayOfWeek(); 0 === a && (a = 7), 0 === r && (r = 7); var o = 8 - a; 4 !== a && 4 !== r || (e = !0); var n = Math.ceil((t - o) / 7), i = n; return o >= 4 && (i += 1), i > 52 && !e && (i = 1), 0 === i && (i = this.firstDayOfYear().addDays(-1).weekNumberISO()), i; }, DayPilot.Date.prototype.toDateLocal = function () { var e = new Date(this.ticks), t = new Date; return t.setFullYear(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate()), t.setHours(e.getUTCHours()), t.setMinutes(e.getUTCMinutes()), t.setSeconds(e.getUTCSeconds()), t.setMilliseconds(e.getUTCMilliseconds()), t; }, DayPilot.Date.prototype.toDate = function () { return new Date(this.ticks); }, DayPilot.Date.prototype.toJSON = function () { return this.value; }, DayPilot.Date.prototype.toString = function (e, a) { return e ? new t(e, a).print(this) : this.toStringSortable(); }, DayPilot.Date.prototype.toStringSortable = function () { return e(this.ticks); }, DayPilot.Date.parse = function (e, a, r) { return new t(a, r).parse(e); };
|
|
238
|
+
DayPilot.Date.today = function () { return new DayPilot.Date(DayPilot.DateUtil.localToday(), !0); }, DayPilot.Date.fromYearMonthDay = function (e, t, a) { t = t || 1, a = a || 1; var r = new Date(0); return r.setUTCFullYear(e), r.setUTCMonth(t - 1), r.setUTCDate(a), new DayPilot.Date(r); }, DayPilot.DateUtil = {}, DayPilot.DateUtil.fromStringSortable = function (e, t) { if (!e)
|
|
239
|
+
throw "Can't create DayPilot.Date from an empty string"; var a = e.length, r = 10 === a, o = 19 === a, n = a > 19; if (!r && !o && !n)
|
|
240
|
+
throw "Invalid string format (use '2010-01-01' or '2010-01-01T00:00:00'): " + e; if (DayPilot.Date.Cache.Parsing[e] && !t)
|
|
241
|
+
return DayPilot.Stats.cacheHitsParsing += 1, DayPilot.Date.Cache.Parsing[e]; var i = e.substring(0, 4), d = e.substring(5, 7), s = e.substring(8, 10), l = new Date(0); if (l.setUTCFullYear(i, d - 1, s), r)
|
|
242
|
+
return DayPilot.Date.Cache.Parsing[e] = l, l; var u = e.substring(11, 13), c = e.substring(14, 16), f = e.substring(17, 19); if (l.setUTCHours(u), l.setUTCMinutes(c), l.setUTCSeconds(f), o)
|
|
243
|
+
return DayPilot.Date.Cache.Parsing[e] = l, l; var m = e[19], y = 0; if ("." === m) {
|
|
244
|
+
var h = parseInt(e.substring(20, 23));
|
|
245
|
+
l.setUTCMilliseconds(h), y = DayPilot.DateUtil.getTzOffsetMinutes(e.substring(23));
|
|
246
|
+
}
|
|
247
|
+
else
|
|
248
|
+
y = DayPilot.DateUtil.getTzOffsetMinutes(e.substring(19)); var g = new DayPilot.Date(l); return t || (g = g.addMinutes(-y)), l = g.toDate(), DayPilot.Date.Cache.Parsing[e] = l, l; }, DayPilot.DateUtil.getTzOffsetMinutes = function (e) { if (DayPilot.Util.isNullOrUndefined(e) || "" === e)
|
|
249
|
+
return 0; if ("Z" === e)
|
|
250
|
+
return 0; var t = e[0], a = parseInt(e.substring(1, 3)), r = parseInt(e.substring(4)), o = 60 * a + r; if ("-" === t)
|
|
251
|
+
return -o; if ("+" === t)
|
|
252
|
+
return o; throw "Invalid timezone spec: " + e; }, DayPilot.DateUtil.hasTzSpec = function (e) { return !!e.indexOf("+") || !!e.indexOf("-"); }, DayPilot.DateUtil.daysDiff = function (e, t) { if (e && t || function () { throw "two parameters required"; }(), e = new DayPilot.Date(e), t = new DayPilot.Date(t), e.getTime() > t.getTime())
|
|
253
|
+
return null; for (var a = 0, r = e.getDatePart(), o = t.getDatePart(); r < o;)
|
|
254
|
+
r = r.addDays(1), a++; return a; }, DayPilot.DateUtil.daysSpan = function (e, t) { if (e && t || function () { throw "two parameters required"; }(), e = new DayPilot.Date(e), t = new DayPilot.Date(t), e === t)
|
|
255
|
+
return 0; var a = DayPilot.DateUtil.daysDiff(e, t); return t == t.getDatePart() && a--, a; }, DayPilot.DateUtil.diff = function (e, t) { if (!(e && t && e.getTime && t.getTime))
|
|
256
|
+
throw "Both compared objects must be Date objects (DayPilot.Date.diff)."; return e.getTime() - t.getTime(); }, DayPilot.DateUtil.fromLocal = function (e) { e || (e = new Date); var t = new Date; return t.setUTCFullYear(e.getFullYear(), e.getMonth(), e.getDate()), t.setUTCHours(e.getHours()), t.setUTCMinutes(e.getMinutes()), t.setUTCSeconds(e.getSeconds()), t.setUTCMilliseconds(e.getMilliseconds()), t; }, DayPilot.DateUtil.localToday = function () { var e = new Date; return e.setHours(0), e.setMinutes(0), e.setSeconds(0), e.setMilliseconds(0), e; }, DayPilot.DateUtil.hours = function (e, t) { var a = e.getUTCMinutes(); a < 10 && (a = "0" + a); var r = e.getUTCHours(); if (t) {
|
|
257
|
+
var o = r < 12, r = r % 12;
|
|
258
|
+
0 === r && (r = 12);
|
|
259
|
+
return r + ":" + a + " " + (o ? "AM" : "PM");
|
|
260
|
+
} return r + ":" + a; }, DayPilot.DateUtil.max = function (e, t) { return e.getTime() > t.getTime() ? e : t; }, DayPilot.DateUtil.min = function (e, t) { return e.getTime() < t.getTime() ? e : t; };
|
|
261
|
+
var t = function (e, t) { "string" == typeof t && (t = DayPilot.Locale.find(t)); var t = t || DayPilot.Locale.US, a = [{ "seq": "yyyy", "expr": "[0-9]{4,4}", "str": function (e) { return e.getYear(); } }, { "seq": "yy", "expr": "[0-9]{2,2}", "str": function (e) { return e.getYear() % 100; } }, { "seq": "mm", "expr": "[0-9]{2,2}", "str": function (e) { var t = e.getMinutes(); return t < 10 ? "0" + t : t; } }, { "seq": "m", "expr": "[0-9]{1,2}", "str": function (e) { return e.getMinutes(); } }, { "seq": "HH", "expr": "[0-9]{2,2}", "str": function (e) { var t = e.getHours(); return t < 10 ? "0" + t : t; } }, { "seq": "H", "expr": "[0-9]{1,2}", "str": function (e) { return e.getHours(); } }, { "seq": "hh", "expr": "[0-9]{2,2}", "str": function (e) { var t = e.getHours(), t = t % 12; 0 === t && (t = 12); var a = t; return a < 10 ? "0" + a : a; } }, { "seq": "h", "expr": "[0-9]{1,2}", "str": function (e) { var t = e.getHours(), t = t % 12; return 0 === t && (t = 12), t; } }, { "seq": "ss", "expr": "[0-9]{2,2}", "str": function (e) { var t = e.getSeconds(); return t < 10 ? "0" + t : t; } }, { "seq": "s", "expr": "[0-9]{1,2}", "str": function (e) { return e.getSeconds(); } }, { "seq": "MMMM", "expr": "[^\\s0-9]*", "str": function (e) { return t.monthNames[e.getMonth()]; }, "transform": function (e) { var a = DayPilot.indexOf(t.monthNames, e, equalsIgnoreCase); return a < 0 ? null : a + 1; } }, { "seq": "MMM", "expr": "[^\\s0-9]*", "str": function (e) { return t.monthNamesShort[e.getMonth()]; }, "transform": function (e) { var a = DayPilot.indexOf(t.monthNamesShort, e, equalsIgnoreCase); return a < 0 ? null : a + 1; } }, { "seq": "MM", "expr": "[0-9]{2,2}", "str": function (e) { var t = e.getMonth() + 1; return t < 10 ? "0" + t : t; } }, { "seq": "M", "expr": "[0-9]{1,2}", "str": function (e) { return e.getMonth() + 1; } }, { "seq": "dddd", "expr": "[^\\s0-9]*", "str": function (e) { return t.dayNames[e.getDayOfWeek()]; } }, { "seq": "ddd", "expr": "[^\\s0-9]*", "str": function (e) { return t.dayNamesShort[e.getDayOfWeek()]; } }, { "seq": "dd", "expr": "[0-9]{2,2}", "str": function (e) { var t = e.getDay(); return t < 10 ? "0" + t : t; } }, { "seq": "%d", "expr": "[0-9]{1,2}", "str": function (e) { return e.getDay(); } }, { "seq": "d", "expr": "[0-9]{1,2}", "str": function (e) { return e.getDay(); } }, { "seq": "tt", "expr": "(AM|PM|am|pm)", "str": function (e) { return e.getHours() < 12 ? "AM" : "PM"; }, "transform": function (e) { return e.toUpperCase(); } }], r = function (e) { return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); }; this.init = function () { this.year = this.findSequence("yyyy"), this.month = this.findSequence("MMMM") || this.findSequence("MMM") || this.findSequence("MM") || this.findSequence("M"), this.day = this.findSequence("dd") || this.findSequence("d"), this.hours = this.findSequence("HH") || this.findSequence("H"), this.minutes = this.findSequence("mm") || this.findSequence("m"), this.seconds = this.findSequence("ss") || this.findSequence("s"), this.ampm = this.findSequence("tt"), this.hours12 = this.findSequence("hh") || this.findSequence("h"); }, this.findSequence = function (t) { function o(e) { return parseInt(e); } return e.indexOf(t) === -1 ? null : { "findValue": function (n) { for (var i = r(e), d = null, s = 0; s < a.length; s++) {
|
|
262
|
+
var l = (a[s].length, t === a[s].seq), u = a[s].expr;
|
|
263
|
+
l && (u = "(" + u + ")", d = a[s].transform), i = i.replace(a[s].seq, u);
|
|
264
|
+
} i = "^" + i + "$"; try {
|
|
265
|
+
var c = new RegExp(i), f = c.exec(n);
|
|
266
|
+
return f ? (d = d || o)(f[1]) : null;
|
|
267
|
+
}
|
|
268
|
+
catch (e) {
|
|
269
|
+
throw "unable to create regex from: " + i;
|
|
270
|
+
} } }; }, this.print = function (t) { for (var r = function (e) { for (var t = 0; t < a.length; t++)
|
|
271
|
+
if (a[t] && a[t].seq === e)
|
|
272
|
+
return a[t]; return null; }, o = e.length <= 0, n = 0, i = []; !o;) {
|
|
273
|
+
var d = e.substring(n), s = /%?(.)\1*/.exec(d);
|
|
274
|
+
if (s && s.length > 0) {
|
|
275
|
+
var l = s[0], u = r(l);
|
|
276
|
+
u ? i.push(u) : i.push(l), n += l.length, o = e.length <= n;
|
|
277
|
+
}
|
|
278
|
+
else
|
|
279
|
+
o = !0;
|
|
280
|
+
} for (var c = 0; c < i.length; c++) {
|
|
281
|
+
var f = i[c];
|
|
282
|
+
"string" != typeof f && (i[c] = f.str(t));
|
|
283
|
+
} return i.join(""); }, this.parse = function (e) { var t = this.year.findValue(e); if (!t)
|
|
284
|
+
return null; var a = this.month.findValue(e); if (DayPilot.Util.isNullOrUndefined(a))
|
|
285
|
+
return null; if (a > 12 || a < 1)
|
|
286
|
+
return null; var r = this.day.findValue(e), o = DayPilot.Date.fromYearMonthDay(t, a).daysInMonth(); if (r < 1 || r > o)
|
|
287
|
+
return null; var n = this.hours ? this.hours.findValue(e) : 0, i = this.minutes ? this.minutes.findValue(e) : 0, d = this.seconds ? this.seconds.findValue(e) : 0, s = this.ampm ? this.ampm.findValue(e) : null; if (this.ampm && this.hours12) {
|
|
288
|
+
var l = this.hours12.findValue(e);
|
|
289
|
+
if (l < 1 || l > 12)
|
|
290
|
+
return null;
|
|
291
|
+
n = "PM" === s ? 12 === l ? 12 : l + 12 : 12 === l ? 0 : l;
|
|
292
|
+
} if (n < 0 || n > 23)
|
|
293
|
+
return null; if (i < 0 || i > 59)
|
|
294
|
+
return null; if (d < 0 || d > 59)
|
|
295
|
+
return null; var u = new Date; return u.setUTCFullYear(t, a - 1, r), u.setUTCHours(n), u.setUTCMinutes(i), u.setUTCSeconds(d), u.setUTCMilliseconds(0), new DayPilot.Date(u); }, this.init(); };
|
|
296
|
+
DayPilot.Event = function (e, t, a) { var r = this; this.calendar = t, this.data = e ? e : {}, this.part = a ? a : {}, "undefined" == typeof this.data.id && (this.data.id = this.data.value); var o = {}, n = ["id", "text", "start", "end"]; this.isEvent = !0, this.temp = function () { if (o.dirty)
|
|
297
|
+
return o; for (var e = 0; e < n.length; e++)
|
|
298
|
+
o[n[e]] = r.data[n[e]]; return o.dirty = !0, o; }, this.copy = function () { for (var e = {}, t = 0; t < n.length; t++)
|
|
299
|
+
e[n[t]] = r.data[n[t]]; return e; }, this.commit = function () { if (o.dirty) {
|
|
300
|
+
for (var e = 0; e < n.length; e++)
|
|
301
|
+
r.data[n[e]] = o[n[e]];
|
|
302
|
+
o.dirty = !1;
|
|
303
|
+
} }, this.dirty = function () { return o.dirty; }, this.id = function (e) { return "undefined" == typeof e ? r.data.id : void (this.temp().id = e); }, this.value = function (e) { return "undefined" == typeof e ? r.id() : void r.id(e); }, this.text = function (e) { return "undefined" == typeof e ? r.data.text : (this.temp().text = e, void this.client.innerHTML(e)); }, this.start = function (e) { return "undefined" == typeof e ? new DayPilot.Date(r.data.start) : void (this.temp().start = new DayPilot.Date(e)); }, this.end = function (e) { return "undefined" == typeof e ? new DayPilot.Date(r.data.end) : void (this.temp().end = new DayPilot.Date(e)); }, this.partStart = function () { return new DayPilot.Date(this.part.start); }, this.partEnd = function () { return new DayPilot.Date(this.part.end); }, this.tag = function (e) { var t = r.data.tag; if (!t)
|
|
304
|
+
return null; if ("undefined" == typeof e)
|
|
305
|
+
return r.data.tag; for (var a = r.calendar.tagFields, o = -1, n = 0; n < a.length; n++)
|
|
306
|
+
e === a[n] && (o = n); if (o === -1)
|
|
307
|
+
throw "Field name not found."; return t[o]; }, this.client = {}, this.client.innerHTML = function (e) { return "undefined" == typeof e ? r.cache && "undefined" != typeof r.cache.html ? r.cache.html : "undefined" != typeof r.data.html ? r.data.html : r.data.text : void (r.data.html = e); }, this.client.html = this.client.innerHTML, this.client.header = function (e) { return "undefined" == typeof e ? r.data.header : void (r.data.header = e); }, this.client.cssClass = function (e) { return "undefined" == typeof e ? r.data.cssClass : void (r.data.cssClass = e); }, this.client.toolTip = function (e) { return "undefined" == typeof e ? r.cache && "undefined" != typeof r.cache.toolTip ? r.cache.toolTip : "undefined" != typeof r.data.toolTip ? r.data.toolTip : r.data.text : void (r.data.toolTip = e); }, this.client.barVisible = function (e) { return "undefined" == typeof e ? r.cache && "undefined" != typeof r.cache.barHidden ? !r.cache.barHidden : r.calendar.durationBarVisible && !r.data.barHidden : void (r.data.barHidden = !e); }, this.client.backColor = function (e) { return "undefined" == typeof e ? r.cache && "undefined" != typeof r.cache.backColor ? r.cache.backColor : "undefined" != typeof r.data.backColor ? r.data.backColor : r.calendar.eventBackColor : void (r.data.backColor = e); }, this.client.borderColor = function (e) { return "undefined" == typeof e ? r.cache && "undefined" != typeof r.cache.borderColor ? r.cache.borderColor : "undefined" != typeof r.data.borderColor ? r.data.borderColor : r.calendar.eventBorderColor : void (r.data.borderColor = e); }, this.client.moveEnabled = function (e) { return "undefined" == typeof e ? "Disabled" !== r.calendar.eventMoveHandling && !r.data.moveDisabled : void (r.data.moveDisabled = !e); }, this.client.resizeEnabled = function (e) { return "undefined" == typeof e ? "Disabled" !== r.calendar.eventResizeHandling && !r.data.resizeDisabled : void (r.data.resizeDisabled = !e); }, this.client.clickEnabled = function (e) { return "undefined" == typeof e ? "Disabled" !== r.calendar.eventClickHandling && !r.data.clickDisabled : void (r.data.clickDisabled = !e); }, this.toJSON = function (e) { var t = {}; if (t.value = this.id(), t.id = this.id(), t.text = this.text(), t.start = this.start(), t.end = this.end(), t.tag = {}, r.calendar && r.calendar.tagFields)
|
|
308
|
+
for (var a = r.calendar.tagFields, o = 0; o < a.length; o++)
|
|
309
|
+
t.tag[a[o]] = this.tag(a[o]); return t; }; };
|
|
310
|
+
}
|
|
311
|
+
}(), DayPilot.JSON = {}, function () {
|
|
312
|
+
function e(e) { return e < 10 ? "0" + e : e; }
|
|
313
|
+
function t(e) { return i.lastIndex = 0, i.test(e) ? '"' + e.replace(i, function (e) { var t = d[e]; return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4); }) + '"' : '"' + e + '"'; }
|
|
314
|
+
function a(e, i) {
|
|
315
|
+
var d, s, l, u, c, f = r, m = i[e];
|
|
316
|
+
switch (m && "object" == typeof m && "function" == typeof m.toJSON2 ? m = m.toJSON2(e) : m && "object" == typeof m && "function" == typeof m.toJSON && !m.ignoreToJSON && (m = m.toJSON(e)),
|
|
317
|
+
"function" == typeof n && (m = n.call(i, e, m)), typeof m) {
|
|
318
|
+
case "string": return t(m);
|
|
319
|
+
case "number": return isFinite(m) ? String(m) : "null";
|
|
320
|
+
case "boolean":
|
|
321
|
+
case "null": return String(m);
|
|
322
|
+
case "object":
|
|
323
|
+
if (!m)
|
|
324
|
+
return "null";
|
|
325
|
+
if (r += o, c = [], "number" == typeof m.length && !m.propertyIsEnumerable("length")) {
|
|
326
|
+
for (u = m.length, d = 0; d < u; d += 1)
|
|
327
|
+
c[d] = a(d, m) || "null";
|
|
328
|
+
return l = 0 === c.length ? "[]" : r ? "[\n" + r + c.join(",\n" + r) + "\n" + f + "]" : "[" + c.join(",") + "]", r = f, l;
|
|
329
|
+
}
|
|
330
|
+
if (n && "object" == typeof n)
|
|
331
|
+
for (u = n.length, d = 0; d < u; d += 1)
|
|
332
|
+
s = n[d], "string" == typeof s && (l = a(s, m), l && c.push(t(s) + (r ? ": " : ":") + l));
|
|
333
|
+
else
|
|
334
|
+
for (s in m)
|
|
335
|
+
Object.hasOwnProperty.call(m, s) && (l = a(s, m), l && c.push(t(s) + (r ? ": " : ":") + l));
|
|
336
|
+
return l = 0 === c.length ? "{}" : r ? "{\n" + r + c.join(",\n" + r) + "\n" + f + "}" : "{" + c.join(",") + "}", r = f, l;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
"function" != typeof Date.prototype.toJSON2 && (Date.prototype.toJSON2 = function (t) { return this.getUTCFullYear() + "-" + e(this.getUTCMonth() + 1) + "-" + e(this.getUTCDate()) + "T" + e(this.getUTCHours()) + ":" + e(this.getUTCMinutes()) + ":" + e(this.getUTCSeconds()); }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (e) { return this.valueOf(); });
|
|
340
|
+
var r, o, n, i = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, d = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" };
|
|
341
|
+
"function" != typeof DayPilot.JSON.stringify && (DayPilot.JSON.stringify = function (e, t, i) { var d; if (r = "", o = "", "number" == typeof i)
|
|
342
|
+
for (d = 0; d < i; d += 1)
|
|
343
|
+
o += " ";
|
|
344
|
+
else
|
|
345
|
+
"string" == typeof i && (o = i); if (n = t, t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
|
|
346
|
+
throw new Error("JSON.stringify"); return a("", { "": e }); });
|
|
347
|
+
}();
|
|
348
|
+
if ("undefined" == typeof DayPilot)
|
|
349
|
+
var DayPilot = {};
|
|
350
|
+
"undefined" == typeof DayPilot.Global && (DayPilot.Global = {}), function () {
|
|
351
|
+
var e = function () { };
|
|
352
|
+
if ("undefined" == typeof DayPilot.Calendar || !DayPilot.Calendar.events) {
|
|
353
|
+
var t = {};
|
|
354
|
+
t.selectedCells = [], t.topSelectedCell = null, t.bottomSelectedCell = null, t.selecting = !1, t.column = null, t.firstSelected = null, t.firstMousePos = null, t.originalMouse = null, t.originalHeight = null, t.originalTop = null, t.resizing = null, t.globalHandlers = !1, t.moving = null, t.register = function (e) { t.registered || (t.registered = []); for (var i = t.registered, n = 0; n < i.length; n++)
|
|
355
|
+
if (i[n] === e)
|
|
356
|
+
return; i.push(e); }, t.unregister = function (e) { var i = t.registered; if (i) {
|
|
357
|
+
var n = DayPilot.indexOf(i, e);
|
|
358
|
+
n !== -1 && i.splice(n, 1);
|
|
359
|
+
} }, t.getCellsAbove = function (e) { for (var i = [], n = t.getColumn(e), s = e.parentNode, l = null; s && l !== t.firstSelected;)
|
|
360
|
+
for (l = s.getElementsByTagName("td")[n], i.push(l), s = s.previousSibling; s && "TR" !== s.tagName;)
|
|
361
|
+
s = s.previousSibling; return i; }, t.getCellsBelow = function (e) { for (var i = [], n = t.getColumn(e), s = e.parentNode, l = null; s && l !== t.firstSelected;)
|
|
362
|
+
for (l = s.getElementsByTagName("td")[n], i.push(l), s = s.nextSibling; s && "TR" !== s.tagName;)
|
|
363
|
+
s = s.nextSibling; return i; }, t.getColumn = function (e) { for (var t = 0; e.previousSibling;)
|
|
364
|
+
e = e.previousSibling, "TD" === e.tagName && t++; return t; }, t.gUnload = function (e) { if (t.registered)
|
|
365
|
+
for (var i = t.registered, n = 0; n < i.length; n++) {
|
|
366
|
+
var s = i[n];
|
|
367
|
+
s.dispose(), t.unregister(s);
|
|
368
|
+
} }, t.gMouseUp = function (i) { if (t.resizing) {
|
|
369
|
+
if (!t.resizingShadow)
|
|
370
|
+
return t.resizing.style.cursor = "default", document.body.style.cursor = "default", void (t.resizing = null);
|
|
371
|
+
var n = t.resizing.event, s = t.resizingShadow.clientHeight + 4, l = t.resizingShadow.offsetTop, a = t.resizing.dpBorder;
|
|
372
|
+
t.deleteShadow(t.resizingShadow), t.resizingShadow = null, t.resizing.style.cursor = "default", n.calendar.nav.top.style.cursor = "auto", t.resizing.onclick = null, t.resizing = null, n.calendar.a(n, s, l, a);
|
|
373
|
+
}
|
|
374
|
+
else if (t.moving) {
|
|
375
|
+
if (!t.movingShadow)
|
|
376
|
+
return t.moving = null, void (document.body.style.cursor = "default");
|
|
377
|
+
var l = t.movingShadow.offsetTop;
|
|
378
|
+
t.deleteShadow(t.movingShadow);
|
|
379
|
+
var n = t.moving.event, o = t.movingShadow.column;
|
|
380
|
+
t.moving = null, t.movingShadow = null, n.calendar.nav.top.style.cursor = "auto";
|
|
381
|
+
var r = i || window.event;
|
|
382
|
+
n.calendar.b(n, o, l, r);
|
|
383
|
+
}
|
|
384
|
+
else if (t.selecting && null !== t.topSelectedCell) {
|
|
385
|
+
var h = t.selecting.calendar;
|
|
386
|
+
t.selecting = !1;
|
|
387
|
+
var c = h.getSelection();
|
|
388
|
+
h.c(c.start, c.end), "Hold" !== h.timeRangeSelectedHandling && "HoldForever" !== h.timeRangeSelectedHandling && e();
|
|
389
|
+
}
|
|
390
|
+
else
|
|
391
|
+
t.selecting = !1; }, t.deleteShadow = function (e) { e && e.parentNode && e.parentNode.removeChild(e); }, t.moveShadow = function (e) { var i = t.movingShadow, n = i.parentNode; n.style.display = "none", i.parentNode.removeChild(i), e.firstChild.appendChild(i), i.style.left = "0px", n.style.display = "", i.style.width = t.movingShadow.parentNode.offsetWidth + 1 + "px"; }, t.Calendar = function (e, i) {
|
|
392
|
+
var n = !1;
|
|
393
|
+
if (this instanceof t.Calendar && !this.d && (n = !0, this.d = !0), !n)
|
|
394
|
+
throw "DayPilot.Calendar() is a constructor and must be called as 'var c = new DayPilot.Calendar(id);'";
|
|
395
|
+
var s = this;
|
|
396
|
+
this.uniqueID = null, this.v = "2021.4.338-lite", this.id = e, this.clientName = e, this.cache = {}, this.cache.pixels = {}, this.elements = {}, this.elements.events = [], this.elements.selection = [], this.nav = {}, this.afterRender = function () { }, this.fasterDispose = !0, this.angularAutoApply = !1, this.api = 2, this.businessBeginsHour = 9, this.businessEndsHour = 18, this.cellHeight = 30, this.columnMarginRight = 5, this.f = !0, this.days = 1, this.durationBarVisible = !0, this.eventHeaderHeight = 14, this.eventHeaderVisible = !0, this.eventsLoadMethod = "GET", this.headerHeight = 30, this.height = 300, this.heightSpec = "BusinessHours", this.hideUntilInit = !0, this.hourWidth = 60, this.initScrollPos = "Auto", this.loadingLabelText = "Loading...", this.loadingLabelVisible = !0, this.loadingLabelBackColor = "ff0000", this.loadingLabelFontColor = "#ffffff", this.loadingLabelFontFamily = "Tahoma, Arial, Helvetica, sans-serif", this.loadingLabelFontSize = "10pt", this.locale = "en-us", this.showToolTip = !0, this.startDate = (new DayPilot.Date).getDatePart(), this.cssClassPrefix = "calendar_default", this.theme = null, this.timeFormat = "Auto", this.viewType = "Days", this.visible = !0, this.timeRangeSelectedHandling = "Enabled", this.eventClickHandling = "Enabled", this.eventResizeHandling = "Update", this.eventMoveHandling = "Update", this.eventDeleteHandling = "Disabled", this.onBeforeEventRender = null, this.onEventClick = null, this.onEventClicked = null, this.onEventDelete = null, this.onEventDeleted = null, this.onEventMove = null, this.onEventMoved = null, this.onEventResize = null, this.onEventResized = null, this.onTimeRangeSelect = null, this.onTimeRangeSelected = null, this.clearSelection = function () { t.topSelectedCell = null, t.bottomSelectedCell = null, this.g(); }, this.g = function () { DayPilot.de(s.elements.selection), s.elements.selection = [], s.nav.activeSelection = null; }, this.h = navigator && navigator.userAgent && navigator.userAgent.indexOf("MSIE") !== -1, this.i = navigator && navigator.userAgent && navigator.userAgent.indexOf("Firefox") !== -1, this.j = function () { if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
|
|
397
|
+
return new Number(RegExp.$1) >= 10.5;
|
|
398
|
+
} return !1; }(), this.k = function () { if (/AppleWebKit[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
|
|
399
|
+
return new Number(RegExp.$1) >= 522;
|
|
400
|
+
} return !1; }(), this.cleanSelection = this.clearSelection, this.l = function (e, t, i) { var n = {}; n.action = e, n.parameters = i, n.data = t, n.header = this.m(); var l = "JSON" + DayPilot.JSON.stringify(n); __doPostBack(s.uniqueID, l); }, this.n = function (e, t, i) { this.callbackTimeout && window.clearTimeout(this.callbackTimeout), this.callbackTimeout = window.setTimeout(function () { s.loadingStart(); }, 100); var n = {}; n.action = e, n.parameters = i, n.data = t, n.header = this.m(); var l = "JSON" + DayPilot.JSON.stringify(n); this.backendUrl ? DayPilot.request(this.backendUrl, this.o, l, this.ajaxError) : "function" == typeof WebForm_DoCallback && WebForm_DoCallback(this.uniqueID, l, this.p, this.clientName, this.onCallbackError, !0); }, this.onCallbackError = function (e, t) { alert("Error!\r\nResult: " + e + "\r\nContext:" + t); }, this.dispose = function () { var e = s; e.q(), e.nav.scroll.root = null, DayPilot.pu(e.nav.loading), e.r(), e.s(), e.nav.select = null, e.nav.cornerRight = null, e.nav.scrollable = null, e.nav.zoom = null, e.nav.loading = null, e.nav.header = null, e.nav.hourTable = null, e.nav.scrolltop = null, e.nav.scroll = null, e.nav.main = null, e.nav.message = null, e.nav.messageClose = null, e.nav.top = null, t.unregister(e); }, this.t = function () { this.nav.top.dispose = this.dispose; }, this.o = function (e) { s.p(e.responseText); }, this.m = function () { var e = {}; return e.control = "dpc", e.id = this.id, e.v = this.v, e.days = s.days, e.startDate = s.startDate, e.heightSpec = s.heightSpec, e.businessBeginsHour = s.businessBeginsHour, e.businessEndsHour = s.businessEndsHour, e.hashes = s.hashes, e.timeFormat = s.timeFormat, e.viewType = s.viewType, e.locale = s.locale, e; }, this.u = function (e, t) { for (var i = e.parentNode; i && "TD" !== i.tagName;)
|
|
401
|
+
i = i.parentNode; var n = document.createElement("div"); n.setAttribute("unselectable", "on"), n.style.position = "absolute", n.style.width = e.offsetWidth + "px", n.style.height = e.offsetHeight + "px", n.style.left = e.offsetLeft + "px", n.style.top = e.offsetTop + "px", n.style.boxSizing = "border-box", n.style.zIndex = 101, n.className = s.w("_shadow"); var l = document.createElement("div"); return l.className = s.w("_shadow_inner"), n.appendChild(l), i.firstChild.appendChild(n), n; }, this.z = {}, this.z.locale = function () { var e = DayPilot.Locale.find(s.locale); return e ? e : DayPilot.Locale.US; }, this.z.timeFormat = function () { return "Auto" !== s.timeFormat ? s.timeFormat : this.locale().timeFormat; };
|
|
402
|
+
var l = this.z;
|
|
403
|
+
this.p = function (e, t) { if (e && 0 === e.indexOf("$$$")) {
|
|
404
|
+
if (!window.console)
|
|
405
|
+
throw "Error received from the server side: " + e;
|
|
406
|
+
return void console.log("Error received from the server side: " + e);
|
|
407
|
+
} var e = JSON.parse(e); if (e.CallBackRedirect)
|
|
408
|
+
return void (document.location.href = e.CallBackRedirect); if ("None" === e.UpdateType)
|
|
409
|
+
return s.loadingStop(), void s.A(); if (s.q(), "Full" === e.UpdateType && (s.columns = e.Columns, s.days = e.Days, s.startDate = new DayPilot.Date(e.StartDate), s.heightSpec = e.HeightSpec ? e.HeightSpec : s.heightSpec, s.businessBeginsHour = e.BusinessBeginsHour ? e.BusinessBeginsHour : s.businessBeginsHour, s.businessEndsHour = e.BusinessEndsHour ? e.BusinessEndsHour : s.businessEndsHour, s.headerDateFormat = e.HeaderDateFormat ? e.HeaderDateFormat : s.headerDateFormat, s.viewType = e.ViewType, s.backColor = e.BackColor ? e.BackColor : s.backColor, s.eventHeaderVisible = e.EventHeaderVisible ? e.EventHeaderVisible : s.eventHeaderVisible, s.timeFormat = e.TimeFormat ? e.TimeFormat : s.timeFormat, s.locale = e.Locale ? e.Locale : s.locale, s.B()), e.Hashes)
|
|
410
|
+
for (var i in e.Hashes)
|
|
411
|
+
s.hashes[i] = e.Hashes[i]; s.events.list = e.Events, s.C(), s.D(), "Full" === e.UpdateType && (s.E(), s.F(), s.G(), s.H()), s.A(), s.I(), s.clearSelection(), s.afterRender(e.CallBackData, !0), s.loadingStop(); }, this.J = function () { return 24; }, this.K = function () { return this.businessBeginsHour > this.businessEndsHour ? 24 - this.businessBeginsHour + this.businessEndsHour : this.businessEndsHour - this.businessBeginsHour; }, this.L = function () { return 48; }, this.M = function () { return 2 === s.api; }, this.eventClickCallBack = function (e, t) { this.n("EventClick", t, e); }, this.eventClickPostBack = function (e, t) { this.l("EventClick", t, e); }, this.N = function (e) { var t = this, i = t.event; if (s.M()) {
|
|
412
|
+
var n = {};
|
|
413
|
+
if (n.e = i, n.originalEvent = e, n.meta = e.metaKey, n.ctrl = e.ctrlKey, n.control = s, n.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof s.onEventClick && (s.O.apply(function () { s.onEventClick(n); }), n.preventDefault.value))
|
|
414
|
+
return;
|
|
415
|
+
switch (s.eventClickHandling) {
|
|
416
|
+
case "CallBack":
|
|
417
|
+
s.eventClickCallBack(i);
|
|
418
|
+
break;
|
|
419
|
+
case "PostBack": s.eventClickPostBack(i);
|
|
420
|
+
}
|
|
421
|
+
"function" == typeof s.onEventClicked && s.O.apply(function () { s.onEventClicked(n); });
|
|
422
|
+
}
|
|
423
|
+
else
|
|
424
|
+
switch (s.eventClickHandling) {
|
|
425
|
+
case "PostBack":
|
|
426
|
+
s.eventClickPostBack(i);
|
|
427
|
+
break;
|
|
428
|
+
case "CallBack":
|
|
429
|
+
s.eventClickCallBack(i);
|
|
430
|
+
break;
|
|
431
|
+
case "JavaScript": s.onEventClick(i);
|
|
432
|
+
} }, this.eventDeleteCallBack = function (e, t) { this.n("EventDelete", t, e); }, this.eventDeletePostBack = function (e, t) { this.l("EventDelete", t, e); }, this.P = function (e) { if (s.M()) {
|
|
433
|
+
var t = {};
|
|
434
|
+
if (t.e = e, t.control = s, t.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof s.onEventDelete && (s.O.apply(function () { s.onEventDelete(t); }), t.preventDefault.value))
|
|
435
|
+
return;
|
|
436
|
+
switch (s.eventDeleteHandling) {
|
|
437
|
+
case "CallBack":
|
|
438
|
+
s.eventDeleteCallBack(e);
|
|
439
|
+
break;
|
|
440
|
+
case "PostBack":
|
|
441
|
+
s.eventDeletePostBack(e);
|
|
442
|
+
break;
|
|
443
|
+
case "Update": s.events.remove(e);
|
|
444
|
+
}
|
|
445
|
+
"function" == typeof s.onEventDeleted && s.O.apply(function () { s.onEventDeleted(t); });
|
|
446
|
+
}
|
|
447
|
+
else
|
|
448
|
+
switch (s.eventDeleteHandling) {
|
|
449
|
+
case "PostBack":
|
|
450
|
+
s.eventDeletePostBack(e);
|
|
451
|
+
break;
|
|
452
|
+
case "CallBack":
|
|
453
|
+
s.eventDeleteCallBack(e);
|
|
454
|
+
break;
|
|
455
|
+
case "JavaScript": s.onEventDelete(e);
|
|
456
|
+
} }, this.eventResizeCallBack = function (e, t, i, n) { if (!t)
|
|
457
|
+
throw "newStart is null"; if (!i)
|
|
458
|
+
throw "newEnd is null"; var s = {}; s.e = e, s.newStart = t, s.newEnd = i, this.n("EventResize", n, s); }, this.eventResizePostBack = function (e, t, i, n) { if (!t)
|
|
459
|
+
throw "newStart is null"; if (!i)
|
|
460
|
+
throw "newEnd is null"; var s = {}; s.e = e, s.newStart = t, s.newEnd = i, this.l("EventResize", n, s); }, this.a = function (e, t, i, n) { var l = 1, a = new Date, o = new Date, r = e.start(), h = e.end(); if ("top" === n) {
|
|
461
|
+
var c = r.getDatePart(), d = Math.floor((i - l) / s.cellHeight), u = 30 * d, v = 60 * u * 1e3;
|
|
462
|
+
a = c.addTime(v), o = e.end();
|
|
463
|
+
}
|
|
464
|
+
else if ("bottom" === n) {
|
|
465
|
+
var c = h.getDatePart(), d = Math.floor((i + t - l) / s.cellHeight), u = 30 * d, v = 60 * u * 1e3;
|
|
466
|
+
a = r, o = c.addTime(v);
|
|
467
|
+
} if (s.M()) {
|
|
468
|
+
var p = {};
|
|
469
|
+
if (p.e = e, p.control = s, p.newStart = a, p.newEnd = o, p.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof s.onEventResize && (s.O.apply(function () { s.onEventResize(p); }), p.preventDefault.value))
|
|
470
|
+
return;
|
|
471
|
+
switch (s.eventResizeHandling) {
|
|
472
|
+
case "PostBack":
|
|
473
|
+
s.eventResizePostBack(e, a, o);
|
|
474
|
+
break;
|
|
475
|
+
case "CallBack":
|
|
476
|
+
s.eventResizeCallBack(e, a, o);
|
|
477
|
+
break;
|
|
478
|
+
case "Update": e.start(a), e.end(o), s.events.update(e);
|
|
479
|
+
}
|
|
480
|
+
"function" == typeof s.onEventResized && s.O.apply(function () { s.onEventResized(p); });
|
|
481
|
+
}
|
|
482
|
+
else
|
|
483
|
+
switch (s.eventResizeHandling) {
|
|
484
|
+
case "PostBack":
|
|
485
|
+
s.eventResizePostBack(e, a, o);
|
|
486
|
+
break;
|
|
487
|
+
case "CallBack":
|
|
488
|
+
s.eventResizeCallBack(e, a, o);
|
|
489
|
+
break;
|
|
490
|
+
case "JavaScript": s.onEventResize(e, a, o);
|
|
491
|
+
} }, this.eventMovePostBack = function (e, t, i, n, s) { if (!t)
|
|
492
|
+
throw "newStart is null"; if (!i)
|
|
493
|
+
throw "newEnd is null"; var l = {}; l.e = e, l.newStart = t, l.newEnd = i, this.l("EventMove", s, l); }, this.eventMoveCallBack = function (e, t, i, n, s) { if (!t)
|
|
494
|
+
throw "newStart is null"; if (!i)
|
|
495
|
+
throw "newEnd is null"; var l = {}; l.e = e, l.newStart = t, l.newEnd = i, this.n("EventMove", s, l); }, this.b = function (e, t, i, n) { var l = 1, a = Math.floor((i - l) / s.cellHeight), o = 30 * a * 60 * 1e3, r = e.start(), h = e.end(), c = new Date; r instanceof DayPilot.Date && (r = r.toDate()), c.setTime(Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate())); var d = r.getTime() - (c.getTime() + 3600 * r.getUTCHours() * 1e3 + 30 * Math.floor(r.getUTCMinutes() / 30) * 60 * 1e3), u = h.getTime() - r.getTime(), v = this.columns[t], p = v.Start.getTime(), f = new Date; f.setTime(p + o + d); var g = new DayPilot.Date(f), m = g.addTime(u); if (s.M()) {
|
|
496
|
+
var y = {};
|
|
497
|
+
if (y.e = e, y.newStart = g, y.newEnd = m, y.ctrl = n.ctrlKey, y.shift = n.shiftKey, y.control = s, y.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof s.onEventMove && (s.O.apply(function () { s.onEventMove(y); }), y.preventDefault.value))
|
|
498
|
+
return;
|
|
499
|
+
switch (s.eventMoveHandling) {
|
|
500
|
+
case "PostBack":
|
|
501
|
+
s.eventMovePostBack(e, g, m, v.Value);
|
|
502
|
+
break;
|
|
503
|
+
case "CallBack":
|
|
504
|
+
s.eventMoveCallBack(e, g, m, v.Value);
|
|
505
|
+
break;
|
|
506
|
+
case "Update": e.start(g), e.end(m), s.events.update(e);
|
|
507
|
+
}
|
|
508
|
+
"function" == typeof s.onEventMoved && s.O.apply(function () { s.onEventMoved(y); });
|
|
509
|
+
}
|
|
510
|
+
else
|
|
511
|
+
switch (s.eventMoveHandling) {
|
|
512
|
+
case "PostBack":
|
|
513
|
+
s.eventMovePostBack(e, g, m, v.Value);
|
|
514
|
+
break;
|
|
515
|
+
case "CallBack":
|
|
516
|
+
s.eventMoveCallBack(e, g, m, v.Value);
|
|
517
|
+
break;
|
|
518
|
+
case "JavaScript": s.onEventMove(e, g, m, v.Value, !1);
|
|
519
|
+
} }, this.timeRangeSelectedPostBack = function (e, t, i, n) { var s = {}; s.start = e, s.end = t, this.l("TimeRangeSelected", n, s); }, this.timeRangeSelectedCallBack = function (e, t, i, n) { var s = {}; s.start = e, s.end = t, this.n("TimeRangeSelected", n, s); }, this.c = function (e, t) { if (e = new DayPilot.Date(e), t = new DayPilot.Date(t), this.M()) {
|
|
520
|
+
var i = {};
|
|
521
|
+
if (i.start = e, i.end = t, i.control = s, i.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof s.onTimeRangeSelect && (s.O.apply(function () { s.onTimeRangeSelect(i); }), i.preventDefault.value))
|
|
522
|
+
return;
|
|
523
|
+
switch (s.timeRangeSelectedHandling) {
|
|
524
|
+
case "PostBack":
|
|
525
|
+
s.timeRangeSelectedPostBack(e, t);
|
|
526
|
+
break;
|
|
527
|
+
case "CallBack": s.timeRangeSelectedCallBack(e, t);
|
|
528
|
+
}
|
|
529
|
+
"function" == typeof s.onTimeRangeSelected && s.O.apply(function () { s.onTimeRangeSelected(i); });
|
|
530
|
+
}
|
|
531
|
+
else
|
|
532
|
+
switch (s.timeRangeSelectedHandling) {
|
|
533
|
+
case "PostBack":
|
|
534
|
+
s.timeRangeSelectedPostBack(e, t);
|
|
535
|
+
break;
|
|
536
|
+
case "CallBack":
|
|
537
|
+
s.timeRangeSelectedCallBack(e, t);
|
|
538
|
+
break;
|
|
539
|
+
case "JavaScript": s.onTimeRangeSelected(e, t);
|
|
540
|
+
} }, this.Q = function (e) { if (!t.selecting && "Disabled" !== s.timeRangeSelectedHandling) {
|
|
541
|
+
var i = window.event ? window.event.button : e.which;
|
|
542
|
+
if (1 === i || 0 === i)
|
|
543
|
+
return t.firstMousePos = DayPilot.mc(e || window.event), t.selecting = {}, t.selecting.calendar = s, t.selectedCells && (s.clearSelection(), t.selectedCells = []), t.column = t.getColumn(this), t.selectedCells.push(this), t.firstSelected = this, t.topSelectedCell = this, t.bottomSelectedCell = this, s.R(), !1;
|
|
544
|
+
} }, this.R = function () { this.getSelection(); !function () { return; }(), function () { var e = t.topSelectedCell, i = t.bottomSelectedCell, n = function () { if (e.data)
|
|
545
|
+
return e.data.x; for (var t = e.parentNode.cells, i = 0; i < t.length; i++)
|
|
546
|
+
if (t[i] === e)
|
|
547
|
+
return i; return -1; }(), l = s.columns[n]; if (l) {
|
|
548
|
+
var a = l.Start, o = s.getPixels(e.start, a).boxTop, r = s.getPixels(i.end, a).boxBottom, h = r - o, c = function () { if (s.nav.activeSelection)
|
|
549
|
+
return s.nav.activeSelection; var e = document.createElement("div"); e.setAttribute("unselectable", "on"), e.style.position = "absolute", e.style.left = "0px", e.style.width = "100%"; var t = document.createElement("div"); return t.setAttribute("unselectable", "on"), t.className = s.w("_shadow_inner"), e.appendChild(t), s.nav.events.rows[0].cells[n].selection.appendChild(e), s.elements.selection.push(e), s.nav.activeSelection = e, e; }();
|
|
550
|
+
c.className = s.w("_shadow"), c.firstChild.innerHTML = "", c.style.top = o + "px", c.style.height = h + "px";
|
|
551
|
+
} }(); }, this.S = function (e) { if ("undefined" != typeof t && t.selecting) {
|
|
552
|
+
var i = DayPilot.mc(e || window.event);
|
|
553
|
+
t.getColumn(this) === t.column && (s.clearSelection(), i.y < t.firstMousePos.y ? (t.selectedCells = t.getCellsBelow(this), t.topSelectedCell = t.selectedCells[0], t.bottomSelectedCell = t.firstSelected) : (t.selectedCells = t.getCellsAbove(this), t.topSelectedCell = t.firstSelected, t.bottomSelectedCell = t.selectedCells[0]), s.R());
|
|
554
|
+
} }, this.getSelection = function () { var e = t.topSelectedCell.start, i = t.bottomSelectedCell.end; return new DayPilot.Selection(e, i, null, s); }, this.T = function (e) { }, this.U = function (e) { if (e < 0)
|
|
555
|
+
return null; for (var t = 0, i = s.nav.events.rows[0].cells, n = 0; n < i.length; n++) {
|
|
556
|
+
if (t += i[n].offsetWidth, e < t)
|
|
557
|
+
return n;
|
|
558
|
+
} return null; }, this.V = {}, this.V.getCellCoords = function () { var e = {}; if (e.x = 0, e.y = 0, !s.coords)
|
|
559
|
+
return null; e.x = s.U(s.coords.x); var t = 0, i = Math.floor((s.coords.y - t) / s.cellHeight); return e.y = i, e.x < 0 ? null : e; }, this.B = function () { this.columns = this.W(); for (var e = 0; e < this.columns.length; e++)
|
|
560
|
+
this.X(this.columns[e]); }, this.X = function (e) { e.Start = new DayPilot.Date(e.Start), e.putIntoBlock = function (e) { for (var t = 0; t < this.blocks.length; t++) {
|
|
561
|
+
var i = this.blocks[t];
|
|
562
|
+
if (i.overlapsWith(e.part.top, e.part.height))
|
|
563
|
+
return i.events.push(e), i.min = Math.min(i.min, e.part.top), i.max = Math.max(i.max, e.part.top + e.part.height), t;
|
|
564
|
+
} var i = []; return i.lines = [], i.events = [], i.overlapsWith = function (e, t) { return !(e + t - 1 < this.min || e > this.max - 1); }, i.putIntoLine = function (e) { for (var t = 0; t < this.lines.length; t++) {
|
|
565
|
+
var i = this.lines[t];
|
|
566
|
+
if (i.isFree(e.part.top, e.part.height))
|
|
567
|
+
return i.push(e), t;
|
|
568
|
+
} var i = []; return i.isFree = function (e, t) { for (var i = e + t - 1, n = this.length, s = 0; s < n; s++) {
|
|
569
|
+
var l = this[s];
|
|
570
|
+
if (!(i < l.part.top || e > l.part.top + l.part.height - 1))
|
|
571
|
+
return !1;
|
|
572
|
+
} return !0; }, i.push(e), this.lines.push(i), this.lines.length - 1; }, i.events.push(e), i.min = e.part.top, i.max = e.part.top + e.part.height, this.blocks.push(i), this.blocks.length - 1; }, e.putIntoLine = function (e) { for (var t = 0; t < this.lines.length; t++) {
|
|
573
|
+
var i = this.lines[t];
|
|
574
|
+
if (i.isFree(e.part.top, e.part.height))
|
|
575
|
+
return i.push(e), t;
|
|
576
|
+
} var i = []; return i.isFree = function (e, t) { for (var i = e + t - 1, n = this.length, s = 0; s < n; s++) {
|
|
577
|
+
var l = this[s];
|
|
578
|
+
if (!(i < l.part.top || e > l.part.top + l.part.height - 1))
|
|
579
|
+
return !1;
|
|
580
|
+
} return !0; }, i.push(e), this.lines.push(i), this.lines.length - 1; }; }, this.W = function () { var e = [], t = this.startDate.getDatePart(), i = this.days; switch (this.viewType) {
|
|
581
|
+
case "Day":
|
|
582
|
+
i = 1;
|
|
583
|
+
break;
|
|
584
|
+
case "Week":
|
|
585
|
+
i = 7, t = t.firstDayOfWeek(l.locale().weekStarts);
|
|
586
|
+
break;
|
|
587
|
+
case "WorkWeek": i = 5, t = t.firstDayOfWeek(1);
|
|
588
|
+
} for (var n = 0; n < i; n++) {
|
|
589
|
+
var a = s.headerDateFormat ? s.headerDateFormat : l.locale().datePattern, o = {};
|
|
590
|
+
o.Start = t.addDays(n), o.Name = o.Start.toString(a, l.locale()), o.InnerHTML = o.Name, e.push(o);
|
|
591
|
+
} return e; }, this.visibleStart = function () { return this.columns[0].Start; }, this.visibleEnd = function () { var e = this.columns.length - 1; return this.columns[e].Start.addDays(1); }, this.w = function (e) { var t = this.theme || this.cssClassPrefix; return t ? t + e : ""; }, this.q = function () { if (this.elements.events)
|
|
592
|
+
for (var e = 0; e < this.elements.events.length; e++) {
|
|
593
|
+
var t = this.elements.events[e], i = t.event;
|
|
594
|
+
if (i && (i.calendar = null), t.onclick = null, t.onclickSave = null, t.onmouseover = null, t.onmouseout = null, t.onmousemove = null, t.onmousedown = null, t.firstChild && t.firstChild.firstChild && t.firstChild.firstChild.tagName && "IMG" === t.firstChild.firstChild.tagName.toUpperCase()) {
|
|
595
|
+
var n = t.firstChild.firstChild;
|
|
596
|
+
n.onmousedown = null, n.onmousemove = null, n.onclick = null;
|
|
597
|
+
}
|
|
598
|
+
t.helper = null, t.data = null, t.event = null, DayPilot.de(t);
|
|
599
|
+
} this.elements.events = []; }, this.Y = function (e) { var i = e.cache || e.data, n = this.nav.events, l = document.createElement("div"); l.style.position = "absolute", l.style.left = e.part.left + "%", l.style.top = e.part.top + "px", l.style.width = e.part.width + "%", l.style.height = Math.max(e.part.height, 2) + "px", l.style.overflow = "hidden", l.data = e, l.event = e, l.unselectable = "on", l.style.MozUserSelect = "none", l.style.KhtmlUserSelect = "none", l.className = this.w("_event"), i.cssClass && DayPilot.Util.addClass(l, i.cssClass), l.isFirst = e.part.start.getTime() === e.start().getTime(), l.isLast = e.part.end.getTime() === e.end().getTime(), l.onclick = this.N, l.onmouseout = function (e) { l.deleteIcon && (l.deleteIcon.style.display = "none"); }, l.onmousemove = function (e) { var i = s.eventHeaderVisible ? s.eventHeaderHeight : 10; if ("undefined" != typeof t) {
|
|
600
|
+
var n = DayPilot.mo3(l, e);
|
|
601
|
+
if (n && !t.resizing && !t.moving) {
|
|
602
|
+
l.deleteIcon && (l.deleteIcon.style.display = "");
|
|
603
|
+
var a = this.isLast;
|
|
604
|
+
n.y <= i && "Disabled" !== s.eventResizeHandling ? (this.style.cursor = "n-resize", this.dpBorder = "top") : this.offsetHeight - n.y <= 5 && "Disabled" !== s.eventResizeHandling ? a ? (this.style.cursor = "s-resize", this.dpBorder = "bottom") : this.style.cursor = "not-allowed" : t.resizing || t.moving || ("Disabled" !== s.eventClickHandling ? this.style.cursor = "pointer" : this.style.cursor = "default");
|
|
605
|
+
}
|
|
606
|
+
} }, l.onmousedown = function (e) { e = e || window.event; var i = e.which || e.button; if ("n-resize" !== this.style.cursor && "s-resize" !== this.style.cursor || 1 !== i) {
|
|
607
|
+
if (1 === i && "Disabled" !== s.eventMoveHandling) {
|
|
608
|
+
t.moving = this, t.moving.event = this.event;
|
|
609
|
+
var n = t.moving.helper = {};
|
|
610
|
+
n.oldColumn = s.columns[this.data.part.dayIndex].Value, t.originalMouse = DayPilot.mc(e), t.originalTop = this.offsetTop;
|
|
611
|
+
var l = DayPilot.mo3(this, e);
|
|
612
|
+
l ? t.moveOffsetY = l.y : t.moveOffsetY = 0, s.nav.top.style.cursor = "move";
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
else
|
|
616
|
+
t.resizing = this, t.originalMouse = DayPilot.mc(e), t.originalHeight = this.offsetHeight, t.originalTop = this.offsetTop, s.nav.top.style.cursor = this.style.cursor; return !1; }; var a = document.createElement("div"); if (a.setAttribute("unselectable", "on"), a.className = s.w("_event_inner"), a.innerHTML = e.client.html(), i.borderColor && (a.style.borderColor = i.borderColor), i.backColor && (a.style.background = i.backColor, (DayPilot.browser.ie9 || DayPilot.browser.ielt9) && (a.style.filter = "")), i.fontColor && (a.style.color = i.fontColor), l.appendChild(a), e.client.barVisible()) {
|
|
617
|
+
var o = e.part.height - 2, r = 100 * e.part.barTop / o, h = Math.ceil(100 * e.part.barHeight / o), c = document.createElement("div");
|
|
618
|
+
c.setAttribute("unselectable", "on"), c.className = this.w("_event_bar"), c.style.position = "absolute", i.barBackColor && (c.style.backgroundColor = i.barBackColor);
|
|
619
|
+
var d = document.createElement("div");
|
|
620
|
+
d.setAttribute("unselectable", "on"), d.className = this.w("_event_bar_inner"), d.style.top = r + "%", 0 < h && h <= 1 ? d.style.height = "1px" : d.style.height = h + "%", i.barColor && (d.style.backgroundColor = i.barColor), c.appendChild(d), l.appendChild(c);
|
|
621
|
+
} if ("Disabled" !== s.eventDeleteHandling) {
|
|
622
|
+
var u = document.createElement("div");
|
|
623
|
+
u.style.position = "absolute", u.style.right = "2px", u.style.top = "2px", u.style.width = "17px", u.style.height = "17px", u.className = s.w("_event_delete"), u.onclick = function (e) { var t = this.parentNode.event; t && s.P(t); }, u.style.display = "none", l.deleteIcon = u, l.appendChild(u);
|
|
624
|
+
} if (n.rows[0].cells[e.part.dayIndex]) {
|
|
625
|
+
n.rows[0].cells[e.part.dayIndex].firstChild.appendChild(l), s.Z(l);
|
|
626
|
+
} s.elements.events.push(l); }, this.Z = function (e) { for (var t = e && e.childNodes ? e.childNodes.length : 0, i = 0; i < t; i++)
|
|
627
|
+
try {
|
|
628
|
+
var n = e.childNodes[i];
|
|
629
|
+
1 === n.nodeType && (n.unselectable = "on", this.Z(n));
|
|
630
|
+
}
|
|
631
|
+
catch (e) { } }, this.I = function () { for (var e = 0; e < this.columns.length; e++) {
|
|
632
|
+
var t = this.columns[e];
|
|
633
|
+
if (t.blocks)
|
|
634
|
+
for (var i = 0; i < t.blocks.length; i++)
|
|
635
|
+
for (var n = t.blocks[i], s = 0; s < n.lines.length; s++)
|
|
636
|
+
for (var l = n.lines[s], a = 0; a < l.length; a++) {
|
|
637
|
+
var o = l[a];
|
|
638
|
+
o.part.width = 100 / n.lines.length, o.part.left = o.part.width * s;
|
|
639
|
+
var r = s === n.lines.length - 1;
|
|
640
|
+
r || (o.part.width = 1.5 * o.part.width), this.Y(o);
|
|
641
|
+
}
|
|
642
|
+
} }, this.$ = function () { this.nav.top.innerHTML = "", this.f ? DayPilot.Util.addClass(this.nav.top, this.w("_main")) : (this.nav.top.style.lineHeight = "1.2", this.nav.top.style.textAlign = "left"), this.nav.top.style.MozUserSelect = "none", this.nav.top.style.KhtmlUserSelect = "none", this.nav.top.style.position = "relative", this.nav.top.style.width = this.width ? this.width : "100%", this.hideUntilInit && (this.nav.top.style.visibility = "hidden"), this.visible || (this.nav.top.style.display = "none"), this.nav.scroll = document.createElement("div"), this.nav.scroll.style.height = this._() + "px", "BusinessHours" === this.heightSpec ? this.nav.scroll.style.overflow = "auto" : this.nav.scroll.style.overflow = "hidden", this.nav.scroll.style.position = "relative", !this.f; var e = this.aa(); this.nav.top.appendChild(e), this.nav.scroll.style.zoom = 1; var t = this.ba(); this.nav.scrollable = t.firstChild, this.nav.scroll.appendChild(t), this.nav.top.appendChild(this.nav.scroll), this.nav.scrollLayer = document.createElement("div"), this.nav.scrollLayer.style.position = "absolute", this.nav.scrollLayer.style.top = "0px", this.nav.scrollLayer.style.left = "0px", this.nav.top.appendChild(this.nav.scrollLayer), this.nav.loading = document.createElement("div"), this.nav.loading.style.position = "absolute", this.nav.loading.style.top = "0px", this.nav.loading.style.left = this.hourWidth + 5 + "px", this.nav.loading.style.backgroundColor = this.loadingLabelBackColor, this.nav.loading.style.fontSize = this.loadingLabelFontSize, this.nav.loading.style.fontFamily = this.loadingLabelFontFamily, this.nav.loading.style.color = this.loadingLabelFontColor, this.nav.loading.style.padding = "2px", this.nav.loading.innerHTML = this.loadingLabelText, this.nav.loading.style.display = "none", this.nav.top.appendChild(this.nav.loading); }, this.G = function () { this.fasterDispose || DayPilot.pu(this.nav.hourTable), this.nav.scrollable.rows[0].cells[0].innerHTML = "", this.nav.hourTable = this.ca(), this.nav.scrollable.rows[0].cells[0].appendChild(this.nav.hourTable); }, this.ba = function () { var e = document.createElement("div"); e.style.zoom = 1, e.style.position = "relative"; var t = document.createElement("table"); t.cellSpacing = "0", t.cellPadding = "0", t.border = "0", t.style.border = "0px none", t.style.width = "100%", t.style.position = "absolute"; var i, n = t.insertRow(-1); if (i = n.insertCell(-1), i.valign = "top", i.style.padding = "0px", i.style.border = "0px none", this.nav.hourTable = this.ca(), i.appendChild(this.nav.hourTable), i = n.insertCell(-1), i.valign = "top", i.width = "100%", i.style.padding = "0px", i.style.border = "0px none", this.f) {
|
|
643
|
+
var s = document.createElement("div");
|
|
644
|
+
s.style.position = "relative", i.appendChild(s), s.appendChild(this.da()), s.appendChild(this.ea());
|
|
645
|
+
}
|
|
646
|
+
else
|
|
647
|
+
i.appendChild(this.da()); return e.appendChild(t), this.nav.zoom = e, e; }, this.da = function () { var e = document.createElement("table"); return e.cellPadding = "0", e.cellSpacing = "0", e.border = "0", e.style.width = "100%", e.style.border = "0px none", e.style.tableLayout = "fixed", this.f || (e.style.borderLeft = "1px solid " + this.borderColor), this.nav.main = e, this.nav.events = e, e; }, this.ea = function () { var e = document.createElement("table"); e.style.top = "0px", e.cellPadding = "0", e.cellSpacing = "0", e.border = "0", e.style.position = "absolute", e.style.width = "100%", e.style.border = "0px none", e.style.tableLayout = "fixed", this.nav.events = e; for (var t = this.columns, i = t.length, n = e.insertRow(-1), l = 0; l < i; l++) {
|
|
648
|
+
var a = n.insertCell(-1);
|
|
649
|
+
a.style.padding = "0px", a.style.border = "0px none", a.style.height = "0px", a.style.overflow = "visible", s.rtl || (a.style.textAlign = "left");
|
|
650
|
+
var o = document.createElement("div");
|
|
651
|
+
o.style.marginRight = s.columnMarginRight + "px", o.style.position = "relative", o.style.height = "1px", this.f || (o.style.fontSize = "1px", o.style.lineHeight = "1.2"), o.style.marginTop = "-1px";
|
|
652
|
+
var r = document.createElement("div");
|
|
653
|
+
a.selection = r, a.appendChild(o), a.appendChild(r);
|
|
654
|
+
} return e; }, this.ca = function () { var e = document.createElement("table"); if (e.cellSpacing = "0", e.cellPadding = "0", e.border = "0", e.style.border = "0px none", e.style.width = this.hourWidth + "px", e.oncontextmenu = function () { return !1; }, this.f ? 0 : 1) {
|
|
655
|
+
var t = e.insertRow(-1);
|
|
656
|
+
t.style.height = "1px", t.style.backgroundColor = "white";
|
|
657
|
+
var i = t.insertCell(-1);
|
|
658
|
+
i.style.padding = "0px", i.style.border = "0px none";
|
|
659
|
+
} for (var n = 24, s = 0; s < n; s++)
|
|
660
|
+
this.fa(e, s); return e; }, this.fa = function (e, t) { var i = 2 * this.cellHeight, n = e.insertRow(-1); n.style.height = i + "px"; var s = n.insertCell(-1); s.valign = "bottom", s.unselectable = "on", !this.f, s.style.cursor = "default", s.style.padding = "0px", s.style.border = "0px none"; var a = document.createElement("div"); a.style.position = "relative", this.f && (a.className = this.w("_rowheader")), a.style.width = this.hourWidth + "px", a.style.height = i + "px", a.style.overflow = "hidden", a.unselectable = "on"; var o = document.createElement("div"); this.f && (o.className = this.w("_rowheader_inner")), o.unselectable = "on"; var r = document.createElement("div"); r.unselectable = "on"; var h = this.startDate.addHours(t), c = h.getHours(), d = c < 12, u = l.timeFormat(); "Clock12Hours" === u && (c %= 12, 0 === c && (c = 12)), r.innerHTML = c; var v = document.createElement("span"); v.unselectable = "on", this.f ? v.className = this.w("_rowheader_minutes") : (v.style.fontSize = "10px", v.style.verticalAlign = "super"); var p; p = "Clock12Hours" === u ? d ? "AM" : "PM" : "00", this.f ? v.innerHTML = p : v.innerHTML = " " + p, r.appendChild(v), o.appendChild(r), a.appendChild(o), s.appendChild(a); }, this._ = function () { switch (this.heightSpec) {
|
|
661
|
+
case "Full": return 48 * this.cellHeight;
|
|
662
|
+
case "BusinessHours":
|
|
663
|
+
var e = this.K();
|
|
664
|
+
return e * this.cellHeight * 2;
|
|
665
|
+
case "BusinessHoursNoScroll":
|
|
666
|
+
var e = this.K();
|
|
667
|
+
return e * this.cellHeight * 2;
|
|
668
|
+
default: throw "DayPilot.Calendar: Unexpected 'heightSpec' value.";
|
|
669
|
+
} }, this.ga = function () { var e = s.nav.corner ? s.nav.corner.parentNode : null; if (e) {
|
|
670
|
+
e.innerHTML = "";
|
|
671
|
+
var t = this.ha();
|
|
672
|
+
e.appendChild(t), s.nav.corner = t;
|
|
673
|
+
} }, this.aa = function () { var e = document.createElement("div"); this.f || (e.style.borderLeft = "1px solid " + this.borderColor, e.style.borderRight = "1px solid " + this.borderColor), e.style.overflow = "auto"; var t = document.createElement("table"); t.cellPadding = "0", t.cellSpacing = "0", t.border = "0", t.style.width = "100%", t.style.borderCollapse = "separate", t.style.border = "0px none"; var i = t.insertRow(-1), n = i.insertCell(-1); n.style.padding = "0px", n.style.border = "0px none"; var s = this.ha(); n.appendChild(s), this.nav.corner = s, n = i.insertCell(-1), n.style.width = "100%", !this.f, n.valign = "top", n.style.position = "relative", n.style.padding = "0px", n.style.border = "0px none", this.nav.header = document.createElement("table"), this.nav.header.cellPadding = "0", this.nav.header.cellSpacing = "0", this.nav.header.border = "0", this.nav.header.width = "100%", this.nav.header.style.tableLayout = "fixed", this.f || (this.nav.header.style.borderBottom = "0px none #000000", this.nav.header.style.borderRight = "0px none #000000", this.nav.header.style.borderLeft = "1px solid " + this.borderColor, this.nav.header.style.borderTop = "1px solid " + this.borderColor), this.nav.header.oncontextmenu = function () { return !1; }; var l = "hidden" !== this.nav.scroll.style.overflow; if (this.f || l && (this.nav.header.style.borderRight = "1px solid " + this.borderColor), n.appendChild(this.nav.header), l) {
|
|
674
|
+
n = i.insertCell(-1), n.unselectable = "on", !this.f;
|
|
675
|
+
var a = document.createElement("div");
|
|
676
|
+
if (a.unselectable = "on", a.style.position = "relative", a.style.width = "16px", this.f) {
|
|
677
|
+
a.style.height = this.headerHeight + "px", a.className = this.w("_cornerright");
|
|
678
|
+
var o = document.createElement("div");
|
|
679
|
+
o.className = this.w("_cornerright_inner"), a.appendChild(o);
|
|
680
|
+
}
|
|
681
|
+
else
|
|
682
|
+
;
|
|
683
|
+
n.appendChild(a), this.nav.cornerRight = a;
|
|
684
|
+
} return e.appendChild(t), e; }, this.ha = function () { var e = document.createElement("div"); e.style.position = "relative", this.f && (e.className = this.w("_corner")), e.style.width = this.hourWidth + "px", e.style.height = this.headerHeight + "px", e.oncontextmenu = function () { return !1; }; var t = document.createElement("div"); return t.unselectable = "on", this.f && (t.className = this.w("_corner_inner")), e.appendChild(t), e; }, this.r = function () { var e = this.nav.main; e.root = null, e.onmouseup = null; for (var t = 0; t < e.rows.length; t++)
|
|
685
|
+
for (var i = e.rows[t], n = 0; n < i.cells.length; n++) {
|
|
686
|
+
var s = i.cells[n];
|
|
687
|
+
s.root = null, s.onmousedown = null, s.onmousemove = null, s.onmouseout = null, s.onmouseup = null;
|
|
688
|
+
} this.fasterDispose || DayPilot.pu(e); }, this.F = function () {
|
|
689
|
+
var e = this.nav.main, i = 18e5, n = this.L(), l = s.columns;
|
|
690
|
+
for (e && this.r(); e && e.rows && e.rows.length > 0;)
|
|
691
|
+
this.fasterDispose || DayPilot.pu(e.rows[0]), e.deleteRow(0);
|
|
692
|
+
this.tableCreated = !0;
|
|
693
|
+
var a = l.length;
|
|
694
|
+
if (this.f) {
|
|
695
|
+
for (var o = this.nav.events; o && o.rows && o.rows.length > 0;)
|
|
696
|
+
this.fasterDispose || DayPilot.pu(o.rows[0]), o.deleteRow(0);
|
|
697
|
+
for (var a = l.length, r = o.insertRow(-1), h = 0; h < a; h++) {
|
|
698
|
+
var c = r.insertCell(-1);
|
|
699
|
+
c.style.padding = "0px", c.style.border = "0px none", c.style.height = "0px", c.style.overflow = "visible", s.rtl || (c.style.textAlign = "left");
|
|
700
|
+
var d = document.createElement("div");
|
|
701
|
+
d.style.marginRight = s.columnMarginRight + "px", d.style.position = "relative", d.style.height = "1px", this.f || (d.style.fontSize = "1px", d.style.lineHeight = "1.2"), d.style.marginTop = "-1px";
|
|
702
|
+
var u = document.createElement("div");
|
|
703
|
+
u.style.position = "relative", c.selection = u, c.appendChild(d), c.appendChild(u);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
if (!this.f) {
|
|
707
|
+
var r = e.insertRow(-1);
|
|
708
|
+
r.style.backgroundColor = "white";
|
|
709
|
+
for (var h = 0; h < a; h++) {
|
|
710
|
+
var c = r.insertCell(-1);
|
|
711
|
+
c.style.padding = "0px", c.style.border = "0px none", c.style.height = "1px", c.style.overflow = "visible", c.style.width = 100 / l.length + "%";
|
|
712
|
+
var d = document.createElement("div");
|
|
713
|
+
d.style.display = "block", d.style.marginRight = s.columnMarginRight + "px", d.style.position = "relative", d.style.height = "1px", d.style.fontSize = "1px", d.style.lineHeight = "1.2", d.style.marginTop = "-1px", c.appendChild(d);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
for (var v = 0; v < n; v++) {
|
|
717
|
+
var r = (this.f ? 0 : 1, e.insertRow(-1));
|
|
718
|
+
r.style.MozUserSelect = "none", r.style.KhtmlUserSelect = "none";
|
|
719
|
+
for (var h = 0; h < a; h++) {
|
|
720
|
+
var p = this.columns[h], c = r.insertCell(-1);
|
|
721
|
+
if (c.start = p.Start.addTime(v * i), c.end = c.start.addTime(i),
|
|
722
|
+
c.onmousedown = this.Q, c.onmouseup = function () { return !1; }, c.onclick = function () { return !1; }, c.root = this, c.style.padding = "0px", c.style.border = "0px none", c.style.verticalAlign = "top", !this.f, c.style.height = s.cellHeight + "px", c.style.overflow = "hidden", c.unselectable = "on", this.f) {
|
|
723
|
+
var d = document.createElement("div");
|
|
724
|
+
d.unselectable = "on", d.style.height = s.cellHeight + "px", d.style.position = "relative", d.className = this.w("_cell");
|
|
725
|
+
this.ia(c.start, c.end) && this.f && DayPilot.Util.addClass(d, s.w("_cell_business"));
|
|
726
|
+
var f = document.createElement("div");
|
|
727
|
+
f.setAttribute("unselectable", "on"), f.className = this.w("_cell_inner"), d.appendChild(f), c.appendChild(d);
|
|
728
|
+
}
|
|
729
|
+
else
|
|
730
|
+
;
|
|
731
|
+
c.appendChild(d);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
e.onmouseup = this.T, e.root = this, s.nav.scrollable.onmousemove = function (e) { e = e || window.event; var i = s.nav.scrollable; s.coords = DayPilot.mo3(i, e); var n = DayPilot.mc(e); if (t.resizing) {
|
|
735
|
+
t.resizingShadow || (t.resizingShadow = s.u(t.resizing, !1, s.shadow));
|
|
736
|
+
var l = s.cellHeight, a = 1, o = n.y - t.originalMouse.y;
|
|
737
|
+
if ("bottom" === t.resizing.dpBorder) {
|
|
738
|
+
var r = Math.floor((t.originalHeight + t.originalTop + o + l / 2) / l) * l - t.originalTop + a;
|
|
739
|
+
r < l && (r = l);
|
|
740
|
+
var h = s.nav.main.clientHeight;
|
|
741
|
+
t.originalTop + r > h && (r = h - t.originalTop), t.resizingShadow.style.height = r + "px";
|
|
742
|
+
}
|
|
743
|
+
else if ("top" === t.resizing.dpBorder) {
|
|
744
|
+
var c = Math.floor((t.originalTop + o - a + l / 2) / l) * l + a;
|
|
745
|
+
c < a && (c = a), c > t.originalTop + t.originalHeight - l && (c = t.originalTop + t.originalHeight - l);
|
|
746
|
+
var r = t.originalHeight - (c - t.originalTop);
|
|
747
|
+
r < l ? r = l : t.resizingShadow.style.top = c + "px", t.resizingShadow.style.height = r + "px";
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
else if (t.moving) {
|
|
751
|
+
if (t.movingShadow || (t.movingShadow = s.u(t.moving, !s.h, s.shadow), t.movingShadow.style.width = t.movingShadow.parentNode.offsetWidth + 1 + "px"), !s.coords)
|
|
752
|
+
return;
|
|
753
|
+
var l = s.cellHeight, a = 1, d = t.moveOffsetY;
|
|
754
|
+
d || (d = l / 2);
|
|
755
|
+
var c = Math.floor((s.coords.y - d - a + l / 2) / l) * l + a;
|
|
756
|
+
c < a && (c = a);
|
|
757
|
+
var u = s.nav.events, h = s.nav.main.clientHeight, v = parseInt(t.movingShadow.style.height);
|
|
758
|
+
c + v > h && (c = h - v), t.movingShadow.parentNode.style.display = "none", t.movingShadow.style.top = c + "px", t.movingShadow.parentNode.style.display = "";
|
|
759
|
+
var p = u.clientWidth / u.rows[0].cells.length, f = Math.floor((s.coords.x - 45) / p);
|
|
760
|
+
f < 0 && (f = 0), f < u.rows[0].cells.length && f >= 0 && t.movingShadow.column !== f && (t.movingShadow.column = f, t.moveShadow(u.rows[0].cells[f]));
|
|
761
|
+
}
|
|
762
|
+
else if (t.selecting) {
|
|
763
|
+
var n = DayPilot.mc(e || window.event), g = s.V.getCellCoords(), m = t.column, y = s.nav.main.rows[g.y].cells[m];
|
|
764
|
+
n.y < t.firstMousePos.y ? (t.selectedCells = t.getCellsBelow(y), t.topSelectedCell = t.selectedCells[0], t.bottomSelectedCell = t.firstSelected) : (t.selectedCells = t.getCellsAbove(y), t.topSelectedCell = t.firstSelected, t.bottomSelectedCell = t.selectedCells[0]), s.R();
|
|
765
|
+
} }, s.nav.scrollable.style.display = "";
|
|
766
|
+
}, this.ia = function (e, t) { return this.businessBeginsHour < this.businessEndsHour ? !(e.getHours() < this.businessBeginsHour || e.getHours() >= this.businessEndsHour || 6 === e.getDayOfWeek() || 0 === e.getDayOfWeek()) : e.getHours() >= this.businessBeginsHour || e.getHours() < this.businessEndsHour; }, this.s = function () { var e = this.nav.header; if (e && e.rows)
|
|
767
|
+
for (var t = 0; t < e.rows.length; t++)
|
|
768
|
+
for (var i = e.rows[t], n = 0; n < i.cells.length; n++) {
|
|
769
|
+
var s = i.cells[n];
|
|
770
|
+
s.onclick = null, s.onmousemove = null, s.onmouseout = null;
|
|
771
|
+
} this.fasterDispose || DayPilot.pu(e); }, this.ja = function (e) { for (var t = e ? this.nav.header.insertRow(-1) : this.nav.header.rows[0], i = this.columns, n = i.length, l = 0; l < n; l++) {
|
|
772
|
+
var a = i[l], o = e ? t.insertCell(-1) : t.cells[l];
|
|
773
|
+
o.data = a, o.style.overflow = "hidden", o.style.padding = "0px", o.style.border = "0px none", o.style.height = this.headerHeight + "px";
|
|
774
|
+
var r = e ? document.createElement("div") : o.firstChild;
|
|
775
|
+
if (e) {
|
|
776
|
+
r.unselectable = "on", r.style.MozUserSelect = "none", r.style.backgroundColor = a.BackColor, r.style.cursor = "default", r.style.position = "relative", this.f && (r.className = s.w("_colheader")), r.style.height = this.headerHeight + "px";
|
|
777
|
+
var h = document.createElement("div");
|
|
778
|
+
this.f ? h.className = s.w("_colheader_inner") : (h.style.position = "absolute", h.style.left = "0px", h.style.width = "100%", h.style.padding = "2px", r.style.textAlign = "center"), h.unselectable = "on", r.appendChild(h), o.appendChild(r);
|
|
779
|
+
}
|
|
780
|
+
var h = r.firstChild;
|
|
781
|
+
h.innerHTML = a.InnerHTML;
|
|
782
|
+
} }, this.ka = function () { return this.width && this.width.indexOf("px") !== -1 ? "Pixel" : "Percentage"; }, this.E = function () { var e = this.nav.header, t = !0, i = this.columns; for (i.length; this.headerCreated && e && e.rows && e.rows.length > 0;)
|
|
783
|
+
this.fasterDispose || DayPilot.pu(e.rows[0]), e.deleteRow(0); this.headerCreated = !0; this.ja(t); }, this.loadingStart = function () { this.loadingLabelVisible && (this.nav.loading.innerHTML = this.loadingLabelText, this.nav.loading.style.top = this.headerHeight + 5 + "px", this.nav.loading.style.display = ""); }, this.commandCallBack = function (e, t) { var i = {}; i.command = e, this.n("Command", t, i); }, this.loadingStop = function (e) { this.callbackTimeout && window.clearTimeout(this.callbackTimeout), this.nav.loading.style.display = "none"; }, this.la = function () { var e = this.nav.scroll; e.onscroll || (e.onscroll = function () { s.ma(); }); var t = "undefined" != typeof this.na.scrollpos ? this.na.scrollpos : this.initScrollPos; t && ("Auto" === t && (t = "BusinessHours" === this.heightSpec ? 2 * this.cellHeight * this.businessBeginsHour : 0), e.root = this, 0 === e.scrollTop && (e.scrollTop = t)); }, this.callbackError = function (e, t) { alert("Error!\r\nResult: " + e + "\r\nContext:" + t); }, this.oa = function () { var e = DayPilot.sw(this.nav.scroll), t = this.nav.cornerRight; t && e > 0 && (this.f ? t.style.width = e + "px" : t.style.width = e - 3 + "px"); }, this.pa = function () { t.globalHandlers || (t.globalHandlers = !0, DayPilot.re(document, "mouseup", t.gMouseUp), DayPilot.re(window, "unload", t.gUnload)); }, this.events = {}, this.events.add = function (e) { var t = null; if (e instanceof DayPilot.Event)
|
|
784
|
+
t = e.data;
|
|
785
|
+
else {
|
|
786
|
+
if ("object" != typeof e)
|
|
787
|
+
throw "DayPilot.Calendar.events.add() expects an object or DayPilot.Event instance.";
|
|
788
|
+
t = e;
|
|
789
|
+
} s.events.list || (s.events.list = []), s.events.list.push(t), s.update(), s.O.notify(); }, this.events.find = function (e) { for (var t = 0; t < s.events.list.length; t++) {
|
|
790
|
+
var i = s.events.list[t];
|
|
791
|
+
if (i.id === e)
|
|
792
|
+
return new DayPilot.Event(i, s);
|
|
793
|
+
} return null; }, this.events.update = function (e) { if (e instanceof DayPilot.Event)
|
|
794
|
+
e.commit();
|
|
795
|
+
else if ("object" == typeof e) {
|
|
796
|
+
var t = s.events.find(e.id);
|
|
797
|
+
if (t) {
|
|
798
|
+
var i = DayPilot.indexOf(s.events.list, t.data);
|
|
799
|
+
s.events.list.splice(i, 1, e);
|
|
800
|
+
}
|
|
801
|
+
} s.update(), s.O.notify(); }, this.events.remove = function (e) { var t; if (e instanceof DayPilot.Event)
|
|
802
|
+
t = e.data;
|
|
803
|
+
else if ("object" == typeof e) {
|
|
804
|
+
var i = s.events.find(e.id);
|
|
805
|
+
i && (t = i.data);
|
|
806
|
+
}
|
|
807
|
+
else if ("string" == typeof e || "number" == typeof e) {
|
|
808
|
+
var i = s.events.find(e);
|
|
809
|
+
i && (t = i.data);
|
|
810
|
+
} var n = DayPilot.indexOf(s.events.list, t); s.events.list.splice(n, 1), s.update(), s.O.notify(); }, this.events.load = function (e, t, i) { var n = function (e) { var t = {}; t.exception = e.exception, t.request = e.request, "function" == typeof i && i(t); }, l = function (e) { var i, l = e.request; try {
|
|
811
|
+
i = JSON.parse(l.responseText);
|
|
812
|
+
}
|
|
813
|
+
catch (e) {
|
|
814
|
+
var a = {};
|
|
815
|
+
return a.exception = e, void n(a);
|
|
816
|
+
} if (DayPilot.isArray(i)) {
|
|
817
|
+
var o = {};
|
|
818
|
+
if (o.preventDefault = function () { this.preventDefault.value = !0; }, o.data = i, "function" == typeof t && t(o), o.preventDefault.value)
|
|
819
|
+
return;
|
|
820
|
+
s.events.list = i, s.qa && s.update();
|
|
821
|
+
} }; if (s.eventsLoadMethod && "POST" === s.eventsLoadMethod.toUpperCase())
|
|
822
|
+
DayPilot.Http.ajax({ "method": "POST", "data": { "start": s.visibleStart().toString(), "end": s.visibleEnd().toString() }, "url": e, "success": l, "error": n });
|
|
823
|
+
else {
|
|
824
|
+
var a = e, o = "start=" + s.visibleStart().toString() + "&end=" + s.visibleEnd().toString();
|
|
825
|
+
a += a.indexOf("?") > -1 ? "&" + o : "?" + o, DayPilot.Http.ajax({ "method": "GET", "url": a, "success": l, "error": n });
|
|
826
|
+
} }, this.update = function (e) { s.ra(), s.sa(e), s.ta(), s.q(), s.nav.top.style.cursor = "auto"; s.B(), s.E(), s.F(), s.G(), s.H(), s.ga(), s.ua(), s.C(), s.D(), s.A(), s.I(), s.clearSelection(), this.visible ? this.show() : this.hide(); }, this.va = null, this.sa = function (e) { if (e) {
|
|
827
|
+
var t = { "events": { "preInit": function () { var e = this.data; e && (DayPilot.isArray(e.list) ? s.events.list = e.list : s.events.list = e); } } };
|
|
828
|
+
this.va = t;
|
|
829
|
+
for (var i in e)
|
|
830
|
+
if (t[i]) {
|
|
831
|
+
var n = t[i];
|
|
832
|
+
n.data = e[i], n.preInit && n.preInit();
|
|
833
|
+
}
|
|
834
|
+
else
|
|
835
|
+
s[i] = e[i];
|
|
836
|
+
} }, this.wa = function () { var e = this.va; for (var t in e) {
|
|
837
|
+
var i = e[t];
|
|
838
|
+
i.postInit && i.postInit();
|
|
839
|
+
} }, this.xa = function () { if (this.id && this.id.tagName)
|
|
840
|
+
this.nav.top = this.id;
|
|
841
|
+
else {
|
|
842
|
+
if ("string" != typeof this.id)
|
|
843
|
+
throw "DayPilot.Calendar() constructor requires the target element or its ID as a parameter";
|
|
844
|
+
if (this.nav.top = document.getElementById(this.id), !this.nav.top)
|
|
845
|
+
throw "DayPilot.Calendar: The placeholder element not found: '" + e + "'.";
|
|
846
|
+
} }, this.ya = {}, this.ya.events = [], this.za = function (e) { var t = this.ya.events, i = this.events.list[e], n = {}; for (var s in i)
|
|
847
|
+
n[s] = i[s]; if ("function" == typeof this.onBeforeEventRender) {
|
|
848
|
+
var l = {};
|
|
849
|
+
l.data = n, this.onBeforeEventRender(l);
|
|
850
|
+
} t[e] = n; }, this.C = function () { var e = this.events.list; if (s.ya.events = [], e) {
|
|
851
|
+
var t = e.length, i = 864e5;
|
|
852
|
+
this.cache.pixels = {};
|
|
853
|
+
var n = [];
|
|
854
|
+
this.scrollLabels = [], this.minStart = 1e4, this.maxEnd = 0;
|
|
855
|
+
for (var l = 0; l < t; l++) {
|
|
856
|
+
var a = e[l];
|
|
857
|
+
a.start = new DayPilot.Date(a.start), a.end = new DayPilot.Date(a.end);
|
|
858
|
+
}
|
|
859
|
+
if ("function" == typeof this.onBeforeEventRender)
|
|
860
|
+
for (var l = 0; l < t; l++)
|
|
861
|
+
this.za(l);
|
|
862
|
+
for (var l = 0; l < this.columns.length; l++) {
|
|
863
|
+
var o = {};
|
|
864
|
+
o.minEnd = 1e6, o.maxStart = -1, this.scrollLabels.push(o);
|
|
865
|
+
var r = this.columns[l];
|
|
866
|
+
r.events = [], r.lines = [], r.blocks = [];
|
|
867
|
+
for (var h = new DayPilot.Date(r.Start), c = h.getTime(), d = h.addTime(i), u = d.getTime(), v = 0; v < t; v++)
|
|
868
|
+
if (!n[v]) {
|
|
869
|
+
var a = e[v], p = a.start, f = a.end, g = p.getTime(), m = f.getTime();
|
|
870
|
+
if (!(m < g)) {
|
|
871
|
+
var y = !(m <= c || g >= u);
|
|
872
|
+
if (y) {
|
|
873
|
+
var b = new DayPilot.Event(a, s);
|
|
874
|
+
b.part.dayIndex = l, b.part.start = c < g ? a.start : h, b.part.end = u > m ? a.end : d;
|
|
875
|
+
var w = this.getPixels(b.part.start, r.Start), C = this.getPixels(b.part.end, r.Start), S = w.top, D = C.top;
|
|
876
|
+
if (S === D && (w.cut || C.cut))
|
|
877
|
+
continue;
|
|
878
|
+
var x = C.boxBottom;
|
|
879
|
+
b.part.top = Math.floor(S / this.cellHeight) * this.cellHeight + 1, b.part.height = Math.max(Math.ceil(x / this.cellHeight) * this.cellHeight - b.part.top, this.cellHeight - 1) + 1, b.part.barTop = Math.max(S - b.part.top - 1, 0), b.part.barHeight = Math.max(D - S - 2, 1);
|
|
880
|
+
var p = b.part.top, f = b.part.top + b.part.height;
|
|
881
|
+
p > o.maxStart && (o.maxStart = p), f < o.minEnd && (o.minEnd = f), p < this.minStart && (this.minStart = p), f > this.maxEnd && (this.maxEnd = f), r.events.push(b), "function" == typeof this.onBeforeEventRender && (b.cache = this.ya.events[v]), b.part.start.getTime() === g && b.part.end.getTime() === m && (n[v] = !0);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
for (var l = 0; l < this.columns.length; l++) {
|
|
887
|
+
var r = this.columns[l];
|
|
888
|
+
r.events.sort(this.Aa);
|
|
889
|
+
for (var v = 0; v < r.events.length; v++) {
|
|
890
|
+
var a = r.events[v];
|
|
891
|
+
r.putIntoBlock(a);
|
|
892
|
+
}
|
|
893
|
+
for (var v = 0; v < r.blocks.length; v++) {
|
|
894
|
+
var k = r.blocks[v];
|
|
895
|
+
k.events.sort(this.Aa);
|
|
896
|
+
for (var H = 0; H < k.events.length; H++) {
|
|
897
|
+
var a = k.events[H];
|
|
898
|
+
k.putIntoLine(a);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
} }, this.Aa = function (e, t) { if (!(e && t && e.start && t.start))
|
|
903
|
+
return 0; var i = e.start().getTime() - t.start().getTime(); return 0 !== i ? i : t.end().getTime() - e.end().getTime(); }, this.debug = function (e, t) { this.debuggingEnabled && (s.debugMessages || (s.debugMessages = []), s.debugMessages.push(e), "undefined" != typeof console && console.log(e)); }, this.getPixels = function (e, t) { t || (t = this.startDate); var i = t.getTime(), n = e.getTime(), s = this.cache.pixels[n + "_" + i]; if (s)
|
|
904
|
+
return s; i = t.getTime(); var l = 18e5, a = n - i, o = a % l, r = a - o, h = r + l; 0 === o && (h = r); var c = {}; return c.cut = !1, c.top = this.Ba(a), c.boxTop = this.Ba(r), c.boxBottom = this.Ba(h), this.cache.pixels[n + "_" + i] = c, c; }, this.Ba = function (e) { return Math.floor(this.cellHeight * e / 18e5); }, this.ta = function () { this.startDate = new DayPilot.Date(this.startDate).getDatePart(); }, this.D = function () { this.nav.corner && (this.nav.corner.style.height = this.headerHeight + "px"); }, this.H = function () { var e = this._(); this.nav.scroll && e > 0 && (this.nav.scroll.style.height = e + "px"); }, this.O = {}, this.O.scope = null, this.O.notify = function () { s.O.scope && s.O.scope["$apply"](); }, this.O.apply = function (e) { e(); }, this.ma = function () { var e = s.nav.scroll.scrollTop, t = e / (2 * s.cellHeight); s.na.scrollHour = t; }, this.ua = function () { var e = 0; s.na.scrollHour ? e = 2 * s.cellHeight * s.na.scrollHour : "Auto" === s.initScrollPos && (e = "BusinessHours" === this.heightSpec ? 2 * this.cellHeight * this.businessBeginsHour : 0), s.nav.scroll.scrollTop = e; }, this.Ca = function () { return !(!this.backendUrl && "function" != typeof WebForm_DoCallback) && ("undefined" == typeof s.events.list || !s.events.list); }, this.A = function () { "hidden" === this.nav.top.style.visibility && (this.nav.top.style.visibility = "visible"); }, this.show = function () { s.visible = !0, s.nav.top.style.display = ""; }, this.hide = function () { s.visible = !1, s.nav.top.style.display = "none"; }, this.Da = function () { this.ta(), this.B(), this.$(), this.E(), this.F(), this.oa(), this.la(), this.pa(), t.register(this), this.Ea(), this.n("Init"); }, this.na = {}, this.Fa = function () { this.na.themes = [], this.na.themes.push(this.theme || this.cssClassPrefix); }, this.Ga = function () { for (var e = this.na.themes, t = 0; t < e.length; t++) {
|
|
905
|
+
var i = e[t];
|
|
906
|
+
DayPilot.Util.removeClass(this.nav.top, i + "_main");
|
|
907
|
+
} this.na.themes = []; }, this.Ha = function () { if (this.afterRender(null, !1), "function" == typeof this.onAfterRender) {
|
|
908
|
+
var e = {};
|
|
909
|
+
e.isCallBack = !1, this.onAfterRender(e);
|
|
910
|
+
} }, this.Ia = function () { if ("function" == typeof this.onInit && !this.Ja) {
|
|
911
|
+
this.Ja = !0;
|
|
912
|
+
var e = {};
|
|
913
|
+
this.onInit(e);
|
|
914
|
+
} }, this.ra = function () { s.f || (s.f = !0, window.console && window.console.log && window.console.log("DayPilot: cssOnly = false mode is not supported anymore.")); }, this.Ka = function () { var e = s.nav.top; return e.offsetWidth > 0 && e.offsetHeight > 0; }, this.Ea = function () { var e = s.Ka; e() || (s.La = setInterval(function () { e() && (s.la(), s.oa(), clearInterval(s.La)); }, 100)); }, this.init = function () { this.xa(); var e = this.Ca(); return this.ra(), this.Fa(), e ? void this.Da() : (this.ta(), this.B(), this.C(), this.$(), this.E(), this.F(), this.A(), this.oa(), this.la(), this.pa(), t.register(this), this.events && (this.D(), this.I()), this.Ha(), this.Ia(), this.Ea(), this.qa = !0, this); }, this.Init = this.init, this.sa(i);
|
|
915
|
+
}, t.Cell = function (e, t, i) { this.start = e, this.end = t, this.column = function () { }; }, t.Column = function (e, t, i) { this.value = e, this.name = t, this.date = new DayPilot.Date(i); }, DayPilot.Calendar = t.Calendar, "undefined" != typeof jQuery && !function (e) { e.fn.daypilotCalendar = function (e) { var t = null, i = this.each(function () { if (!this.daypilot) {
|
|
916
|
+
var i = new DayPilot.Calendar(this.id);
|
|
917
|
+
this.daypilot = i;
|
|
918
|
+
for (name in e)
|
|
919
|
+
i[name] = e[name];
|
|
920
|
+
i.init(), t || (t = i);
|
|
921
|
+
} }); return 1 === this.length ? t : i; }; }(jQuery), function () { var e = DayPilot.am(); e && e.directive("daypilotCalendar", ["$parse", function (e) { return { "restrict": "E", "template": "<div></div>", "replace": !0, "link": function (t, i, n) { var s = new DayPilot.Calendar(i[0]); s.O.scope = t, s.init(); var l = n["id"]; l && (t[l] = s); var a = n["publishAs"]; if (a) {
|
|
922
|
+
(0, e(a).assign)(t, s);
|
|
923
|
+
} for (var o in n)
|
|
924
|
+
0 === o.indexOf("on") && !function (i) { s[i] = function (s) { var l = e(n[i]); t["$apply"](function () { l(t, { "args": s }); }); }; }(o); var r = t["$watch"], h = n["config"] || n["daypilotConfig"], c = n["events"] || n["daypilotEvents"]; r.call(t, h, function (e) { for (var t in e)
|
|
925
|
+
s[t] = e[t]; s.update(), s.Ia(); }, !0), r.call(t, c, function (e) { s.events.list = e, s.update(); }, !0); } }; }]); }();
|
|
926
|
+
}
|
|
927
|
+
}();
|
|
928
|
+
if ("undefined" == typeof DayPilot)
|
|
929
|
+
var DayPilot = {};
|
|
930
|
+
!function () { "undefined" != typeof DayPilot.DatePicker && DayPilot.DatePicker.close || (DayPilot.DatePicker = function (t) { this.v = "2021.4.338-lite"; var e = "navigator_" + (new Date).getTime(), i = this; this.prepare = function () { if (this.locale = "en-us", this.target = null, this.resetTarget = !0, this.pattern = this.a.locale().datePattern, this.cssClassPrefix = "navigator_default", this.theme = null, this.patterns = [], t)
|
|
931
|
+
for (var e in t)
|
|
932
|
+
this[e] = t[e]; this.init(); }, this.init = function () { this.date = new DayPilot.Date(this.date); var t = this.b(); this.resetTarget && !t && this.c(this.date), DayPilot.re(document, "mousedown", function () { i.close(); }); }, this.close = function () { this.d && (this.navigator && this.navigator.dispose(), this.div.innerHTML = "", this.div && this.div.parentNode === document.body && document.body.removeChild(this.div)); }, this.b = function () { var t = this.e(); if (!t)
|
|
933
|
+
return this.date; var e = null; if (e = "INPUT" === t.tagName ? t.value : t.innerText, !e)
|
|
934
|
+
return null; for (var a = DayPilot.Date.parse(e, i.pattern), n = 0; n < i.patterns.length; n++) {
|
|
935
|
+
if (a)
|
|
936
|
+
return a;
|
|
937
|
+
a = DayPilot.Date.parse(e, i.patterns[n]);
|
|
938
|
+
} return a; }, this.c = function (t) { var e = this.e(); if (e) {
|
|
939
|
+
var a = t.toString(i.pattern, i.locale);
|
|
940
|
+
"INPUT" === e.tagName ? e.value = a : e.innerHTML = a;
|
|
941
|
+
} }, this.a = {}, this.a.locale = function () { return DayPilot.Locale.find(i.locale); }, this.e = function () { var t = this.target; return t && t.nodeType && 1 === t.nodeType ? t : document.getElementById(t); }, this.show = function () { var t = this.e(), a = this.navigator, a = new DayPilot.Navigator(e); a.api = 2, a.f = !0, a.theme = i.theme || i.cssClassPrefix, a.weekStarts = "Auto", a.locale = i.locale, a.timeRangeSelectedHandling = "JavaScript", a.onTimeRangeSelected = function (t) { i.date = t.start; var e = t.start, a = e.toString(i.pattern, i.locale), t = {}; t.start = e, t.date = e, t.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof i.onTimeRangeSelect && (i.onTimeRangeSelect(t), t.preventDefault.value) || (i.c(a), i.close(), "function" == typeof i.onTimeRangeSelected && i.onTimeRangeSelected(t)); }, this.navigator = a; var n = DayPilot.abs(t), o = t.offsetHeight, r = document.createElement("div"); r.style.position = "absolute", r.style.left = n.x + "px", r.style.top = n.y + o + "px"; var s = document.createElement("div"); s.id = e, r.appendChild(s), DayPilot.re(r, "mousedown", function (t) { var t = t || window.event; t.cancelBubble = !0, t.stopPropagation && t.stopPropagation(); }), document.body.appendChild(r), this.div = r; var l = i.b() || (new DayPilot.Date).getDatePart(); a.startDate = l, a.selectionDay = l, a.init(), this.d = !0; }, this.prepare(); }); }();
|
|
942
|
+
"undefined" == typeof DayPilot && (DayPilot = {}), function (DayPilot) {
|
|
943
|
+
"use strict";
|
|
944
|
+
function e(t, i, a) { var n = i.indexOf("."); if (n === -1)
|
|
945
|
+
return void ("__proto__" !== i && "constructor" !== i && (t[i] = a)); var o = i.substring(0, n); if ("__proto__" !== o && "constructor" !== o) {
|
|
946
|
+
var l = i.substring(n + 1), d = t[o];
|
|
947
|
+
"object" == typeof d && null !== d || (t[o] = {}, d = t[o]), e(d, l, a);
|
|
948
|
+
} }
|
|
949
|
+
function t(e, i, a) { i = i || {}, a = a || ""; for (var n in e) {
|
|
950
|
+
var o = e[n];
|
|
951
|
+
"object" == typeof o ? "[object Array]" === Object.prototype.toString.call(o) ? i[a + n] = o : o && o.toJSON ? i[a + n] = o.toJSON() : t(o, i, a + n + ".") : i[a + n] = o;
|
|
952
|
+
} return i; }
|
|
953
|
+
if (!DayPilot.ModalStatic) {
|
|
954
|
+
DayPilot.ModalStatic = {}, DayPilot.ModalStatic.list = [], DayPilot.ModalStatic.hide = function () { if (this.list.length > 0) {
|
|
955
|
+
var e = this.list.pop();
|
|
956
|
+
e && e.hide();
|
|
957
|
+
} }, DayPilot.ModalStatic.remove = function (e) { for (var t = DayPilot.ModalStatic.list, i = 0; i < t.length; i++)
|
|
958
|
+
if (t[i] === e)
|
|
959
|
+
return void t.splice(i, 1); }, DayPilot.ModalStatic.close = function (e) { DayPilot.ModalStatic.result(e), DayPilot.ModalStatic.hide(); }, DayPilot.ModalStatic.result = function (e) { var t = DayPilot.ModalStatic.list; t.length > 0 && (t[t.length - 1].result = e); }, DayPilot.ModalStatic.displayed = function (e) { for (var t = DayPilot.ModalStatic.list, i = 0; i < t.length; i++)
|
|
960
|
+
if (t[i] === e)
|
|
961
|
+
return !0; return !1; }, DayPilot.ModalStatic.stretch = function () { if (this.list.length > 0) {
|
|
962
|
+
var e = this.list[this.list.length - 1];
|
|
963
|
+
e && e.stretch();
|
|
964
|
+
} }, DayPilot.ModalStatic.last = function () { var e = DayPilot.ModalStatic.list; return e.length > 0 ? e[e.length - 1] : null; };
|
|
965
|
+
var i = function () { var e = document.createElement("style"); e.setAttribute("type", "text/css"), e.styleSheet || e.appendChild(document.createTextNode("")), (document.head || document.getElementsByTagName("head")[0]).appendChild(e); var t = !!e.styleSheet, i = {}; return i.rules = [], i.commit = function () { try {
|
|
966
|
+
t && (e.styleSheet.cssText = this.rules.join("\n"));
|
|
967
|
+
}
|
|
968
|
+
catch (e) { } }, i.add = function (i, a, n) { if (t)
|
|
969
|
+
return void this.rules.push(i + "{" + a + "}"); if (e.sheet.insertRule)
|
|
970
|
+
"undefined" == typeof n && (n = e.sheet.cssRules.length), e.sheet.insertRule(i + "{" + a + "}", n);
|
|
971
|
+
else {
|
|
972
|
+
if (!e.sheet.addRule)
|
|
973
|
+
throw "No CSS registration method found";
|
|
974
|
+
e.sheet.addRule(i, a, n);
|
|
975
|
+
} }, i; }, a = new i;
|
|
976
|
+
a.add(".modal_default_main", "border: 10px solid #ccc; max-width: 90%;"), a.add(".modal_default_main:focus", "outline: none;"), a.add(".modal_default_content", "padding: 10px 0px;"), a.add(".modal_default_inner", "padding: 20px;"), a.add(".modal_default_input", "padding: 10px 0px;"), a.add(".modal_default_buttons", "margin-top: 10px;"), a.add(".modal_default_buttons", "padding: 10px 0px;"), a.add(".modal_default_form_item", "padding: 10px 0px; position: relative;"), a.add(".modal_default_form_item_level1", "border-left: 2px solid #ccc; margin-left: 10px; padding-left: 20px;"), a.add(".modal_default_form_item.modal_default_form_title", "font-size: 1.5rem; font-weight: bold;"), a.add(".modal_default_form_item input[type=text]", "width: 100%; box-sizing: border-box;"), a.add(".modal_default_form_item textarea", "width: 100%; height: 200px; box-sizing: border-box;"), a.add(".modal_default_form_item input[type=select]", "width: 100%; box-sizing: border-box;"), a.add(".modal_default_form_item label", "display: block;"), a.add(".modal_default_form_item select", "width: 100%; box-sizing: border-box;"), a.add(".modal_default_form_item_label", "margin: 2px 0px;"), a.add(".modal_default_form_item_image img", "max-width: 100%; height: auto;"), a.add(".modal_default_form_item_invalid", ""), a.add(".modal_default_form_item_invalid_message", "position: absolute; right: 0px; top: 9px; background-color: red; color: #ffffff; padding: 2px; border-radius: 2px;"), a.add(".modal_default_background", "opacity: 0.5; background-color: #000;"), a.add(".modal_default_ok", "padding: 3px; width: 80px;"), a.add(".modal_default_cancel", "padding: 3px; width: 80px;"), a.add(".modal_default_form_item_date", "position: relative;"), a.add(".modal_default_form_item_date:after", "content: ''; position: absolute; right: 7px; top: 50%; margin-top: 3px; width: 10px; height: 15px; background-image:url(" + "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB3aWR0aD0iMTAiCiAgIGhlaWdodD0iMTUiCj4KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLDUpIj4KICAgIDxyZWN0CiAgICAgICBzdHlsZT0iZmlsbDojY2NjY2NjO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxLjM4MDM3MzM2O3N0cm9rZS1saW5lY2FwOmJ1dHQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiCiAgICAgICBpZD0icmVjdDE5MjgiCiAgICAgICB3aWR0aD0iOS45MTUzMDYxIgogICAgICAgaGVpZ2h0PSIxMS4zNjkzNyIKICAgICAgIHg9IjAuMTE3MTg3NSIKICAgICAgIHk9Ii0zLjAwOTk5NTciCiAgICAgICByeT0iMS4zMTE4NTA1IiAvPgogICAgPHJlY3QKICAgICAgIHN0eWxlPSJmaWxsOiNjY2NjY2M7ZmlsbC1vcGFjaXR5OjE7c3Ryb2tlOm5vbmU7c3Ryb2tlLXdpZHRoOjEuNTk4MTQwMTI7c3Ryb2tlLWxpbmVjYXA6YnV0dDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6NDtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLW9wYWNpdHk6MSIKICAgICAgIGlkPSJyZWN0MTkzMCIKICAgICAgIHdpZHRoPSIxLjUzNDQxMzYiCiAgICAgICBoZWlnaHQ9IjIuMjE5ODI1IgogICAgICAgeD0iMi4xNTU4NDgzIgogICAgICAgeT0iLTQuMzkzNzAwMSIKICAgICAgIHJ5PSIwLjY3MTc4OTE3IiAvPgogICAgPHJlY3QKICAgICAgIHJ5PSIwLjI5NjAxNDciCiAgICAgICB5PSItMS4xNjU4NDY2IgogICAgICAgeD0iMS41MjM5NTA2IgogICAgICAgaGVpZ2h0PSIxLjgyOTkwOTEiCiAgICAgICB3aWR0aD0iMS44MzQyMjUxIgogICAgICAgaWQ9InJlY3QxOTQ4IgogICAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZjtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS40MjE4OTE5MztzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo0O3N0cm9rZS1kYXNoYXJyYXk6bm9uZTtzdHJva2Utb3BhY2l0eToxIiAvPgogICAgPHJlY3QKICAgICAgIHJ5PSIwLjY3MTc4OTE3IgogICAgICAgeT0iLTQuMzkzNzAwMSIKICAgICAgIHg9IjYuNDUyNzIzNSIKICAgICAgIGhlaWdodD0iMi4yMTk4MjUiCiAgICAgICB3aWR0aD0iMS41MzQ0MTM2IgogICAgICAgaWQ9InJlY3QyMDAzIgogICAgICAgc3R5bGU9ImZpbGw6I2NjY2NjYztmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS41OTgxNDAxMjtzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo0O3N0cm9rZS1kYXNoYXJyYXk6bm9uZTtzdHJva2Utb3BhY2l0eToxIiAvPgogICAgPHJlY3QKICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7ZmlsbC1vcGFjaXR5OjE7c3Ryb2tlOm5vbmU7c3Ryb2tlLXdpZHRoOjEuNDIxODkxOTM7c3Ryb2tlLWxpbmVjYXA6YnV0dDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6NDtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLW9wYWNpdHk6MSIKICAgICAgIGlkPSJyZWN0MjAwNSIKICAgICAgIHdpZHRoPSIxLjgzNDIyNTEiCiAgICAgICBoZWlnaHQ9IjEuODI5OTA5MSIKICAgICAgIHg9IjQuMjE5MjYzMSIKICAgICAgIHk9Ii0xLjE2NTg0NjYiCiAgICAgICByeT0iMC4yOTYwMTQ3IiAvPgogICAgPHJlY3QKICAgICAgIHJ5PSIwLjI5NjAxNDciCiAgICAgICB5PSItMS4xNjU4NDY2IgogICAgICAgeD0iNi45OTI3MDA2IgogICAgICAgaGVpZ2h0PSIxLjgyOTkwOTEiCiAgICAgICB3aWR0aD0iMS44MzQyMjUxIgogICAgICAgaWQ9InJlY3QyMDA3IgogICAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZjtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS40MjE4OTE5MztzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo0O3N0cm9rZS1kYXNoYXJyYXk6bm9uZTtzdHJva2Utb3BhY2l0eToxIiAvPgogICAgPHJlY3QKICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7ZmlsbC1vcGFjaXR5OjE7c3Ryb2tlOm5vbmU7c3Ryb2tlLXdpZHRoOjEuNDIxODkxOTM7c3Ryb2tlLWxpbmVjYXA6YnV0dDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6NDtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLW9wYWNpdHk6MSIKICAgICAgIGlkPSJyZWN0MjAxMyIKICAgICAgIHdpZHRoPSIxLjgzNDIyNTEiCiAgICAgICBoZWlnaHQ9IjEuODI5OTA5MSIKICAgICAgIHg9IjEuNTIzOTUwNiIKICAgICAgIHk9IjEuODAyOTAzNCIKICAgICAgIHJ5PSIwLjI5NjAxNDciIC8+CiAgICA8cmVjdAogICAgICAgcnk9IjAuMjk2MDE0NyIKICAgICAgIHk9IjEuODAyOTAzNCIKICAgICAgIHg9IjQuMjE5MjYzMSIKICAgICAgIGhlaWdodD0iMS44Mjk5MDkxIgogICAgICAgd2lkdGg9IjEuODM0MjI1MSIKICAgICAgIGlkPSJyZWN0MjAxNSIKICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7ZmlsbC1vcGFjaXR5OjE7c3Ryb2tlOm5vbmU7c3Ryb2tlLXdpZHRoOjEuNDIxODkxOTM7c3Ryb2tlLWxpbmVjYXA6YnV0dDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6NDtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLW9wYWNpdHk6MSIgLz4KICAgIDxyZWN0CiAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxLjQyMTg5MTkzO3N0cm9rZS1saW5lY2FwOmJ1dHQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiCiAgICAgICBpZD0icmVjdDIwMTciCiAgICAgICB3aWR0aD0iMS44MzQyMjUxIgogICAgICAgaGVpZ2h0PSIxLjgyOTkwOTEiCiAgICAgICB4PSI2Ljk5MjcwMDYiCiAgICAgICB5PSIxLjgwMjkwMzQiCiAgICAgICByeT0iMC4yOTYwMTQ3IiAvPgogICAgPHJlY3QKICAgICAgIHJ5PSIwLjI5NjAxNDciCiAgICAgICB5PSI0LjczMjU5MDciCiAgICAgICB4PSIxLjU2MzAxMzEiCiAgICAgICBoZWlnaHQ9IjEuODI5OTA5MSIKICAgICAgIHdpZHRoPSIxLjgzNDIyNTEiCiAgICAgICBpZD0icmVjdDIwMTkiCiAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxLjQyMTg5MTkzO3N0cm9rZS1saW5lY2FwOmJ1dHQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiIC8+CiAgICA8cmVjdAogICAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZjtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS40MjE4OTE5MztzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo0O3N0cm9rZS1kYXNoYXJyYXk6bm9uZTtzdHJva2Utb3BhY2l0eToxIgogICAgICAgaWQ9InJlY3QyMDIxIgogICAgICAgd2lkdGg9IjEuODM0MjI1MSIKICAgICAgIGhlaWdodD0iMS44Mjk5MDkxIgogICAgICAgeD0iNC4yNTgzMjU2IgogICAgICAgeT0iNC43MzI1OTA3IgogICAgICAgcnk9IjAuMjk2MDE0NyIgLz4KICAgIDxyZWN0CiAgICAgICByeT0iMC4yOTYwMTQ3IgogICAgICAgeT0iNC43MzI1OTA3IgogICAgICAgeD0iNy4wMzE3NjMxIgogICAgICAgaGVpZ2h0PSIxLjgyOTkwOTEiCiAgICAgICB3aWR0aD0iMS44MzQyMjUxIgogICAgICAgaWQ9InJlY3QyMDIzIgogICAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZjtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MS40MjE4OTE5MztzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo0O3N0cm9rZS1kYXNoYXJyYXk6bm9uZTtzdHJva2Utb3BhY2l0eToxIiAvPgogIDwvZz4KPC9zdmc+Cg==" + ")"), navigator.userAgent.indexOf("Edge") !== -1 && a.add(".modal_default_form_item_date input::-ms-clear", "display: none;"), a.add(".modal_default_form_item_scrollable_scroll", "width: 100%; height: 200px; box-sizing: border-box; border: 1px solid #ccc; overflow-y: auto;"), a.add(".modal_default_form_item_scrollable_scroll_content", "padding: 5px;"), a.add(".modal_default_form_item_searchable", "position: relative;"), a.add(".modal_default_form_item_searchable_icon", ""), a.add(".modal_default_form_item_searchable_icon:after", "content:''; position: absolute; right: 5px; top: 50%; margin-top: -8px; width: 10px; height: 15px; background-image:url(" + "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB3aWR0aD0iMTAiCiAgIGhlaWdodD0iMTUiCj4KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLDUpIj4KICAgIDxwYXRoCiAgICAgICBpZD0icGF0aDMxNzMiCiAgICAgICBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojOTk5OTk5O3N0cm9rZS13aWR0aDoxLjg1MTk2ODUzO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo0O3N0cm9rZS1kYXNoYXJyYXk6bm9uZSIKICAgICAgIGQ9Ik0gMC45NTQxNDgzOCwwLjY4MTYwMzEgNS4wMzkwNjI1LDUuNDExNTM4NiA5LjEyMzk3NjYsMC42ODE2MDMxIgogICAgICAgIC8+CiAgPC9nPgo8L3N2Zz4K" + ");"), a.add(".modal_default_form_item_searchable_list", "box-sizing: border-box; border: 1px solid #999; max-height: 150px; overflow-y: auto;"), a.add(".modal_default_form_item_searchable_list_item", "background: white; padding: 2px; cursor: default;"), a.add(".modal_default_form_item_searchable_list_item_highlight", "background: #ccc;"), a.add(".modal_default_form_item_tabular_main", "margin-top: 10px;"), a.add(".modal_default_form_item_tabular_table", "display: table; width: 100%; xbackground-color: #fff; border-collapse: collapse;"), a.add(".modal_default_form_item_tabular_tbody", "display: table-row-group;"), a.add(".modal_default_form_item_tabular_row", "display: table-row;"), a.add(".modal_default_form_item_tabular_row.modal_default_form_item_tabular_header", ""), a.add(".modal_default_form_item_tabular_cell.modal_default_form_item_tabular_rowaction", "padding: 0px; width: 23px;"), a.add(".modal_default_form_item_tabular_cell", "display: table-cell; border: 0px; padding: 2px 2px 2px 0px; cursor: default; vertical-align: bottom;"), a.add(".modal_default_form_item_tabular_header .modal_default_form_item_tabular_cell", "padding-left: 0px; padding-bottom: 0px;"), a.add(".modal_default_form_item_tabular_table input[type=text], .modal_default_form_item_tabular_table input[type=number]", "width:100%; box-sizing: border-box;"), a.add(".modal_default_form_item_tabular_table select", "width:100%; height:100%; box-sizing: border-box;"), a.add(".modal_default_form_item_tabular_plus", "display: inline-block; background-color: #ccc; color: white; width: 20px; height: 20px; border-radius: 10px; box-sizing: border-box; position: relative; margin-left: 3px; margin-top: 3px; cursor: pointer;"), a.add(".modal_default_form_item_tabular_plus:after", "content: ''; position: absolute; left: 5px; top: 5px; width: 10px; height: 10px; background-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMTAnIGhlaWdodD0nMTAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PHBhdGggZD0nTSA1LjAgMC41IEwgNS4wIDkuNSBNIDAuNSA1LjAgTCA5LjUgNS4wJyBzdHlsZT0nZmlsbDpub25lO3N0cm9rZTojZmZmZmZmO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbGluZWNhcDpidXR0JyAvPjwvc3ZnPg==\")"), a.add(".modal_default_form_item_tabular_delete", "display: inline-block; background-color: #ccc; color: white; width: 20px; height: 20px; border-radius: 10px; box-sizing: border-box; position: relative; margin-left: 3px; margin-top: 3px; cursor: pointer;"), a.add(".modal_default_form_item_tabular_delete:after", "content: ''; position: absolute; left: 5px; top: 5px; width: 10px; height: 10px; background-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMTAnIGhlaWdodD0nMTAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PHBhdGggZD0nTSAwLjUgMC41IEwgOS41IDkuNSBNIDAuNSA5LjUgTCA5LjUgMC41JyBzdHlsZT0nZmlsbDpub25lO3N0cm9rZTojZmZmZmZmO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbGluZWNhcDpidXR0JyAvPjwvc3ZnPg==\")"), a.add(".modal_default_form_item_tabular_disabled .modal_default_form_item_tabular_plus", "display: none;"), a.add(".modal_default_form_item_tabular_plus_max.modal_default_form_item_tabular_plus", "display: none;"), a.add(".modal_default_form_item_tabular_disabled .modal_default_form_item_tabular_delete", "visibility: hidden;"), a.add(".modal_default_form_item_tabular_empty", "height: 1px; margin: 5px 23px 5px 0px; background-color: #ccc;"), a.add(".modal_default_form_item_tabular_spacer .modal_default_form_item_tabular_cell", "padding: 0px;"), a.add(".modal_min_main", "border: 1px solid #ccc; max-width: 90%;"), a.add(".modal_min_background", "opacity: 0.5; background-color: #000;"), a.add(".modal_min_ok", "padding: 3px 10px;"), a.add(".modal_min_cancel", "padding: 3px 10px;"), a.add(".navigator_modal_main", "border-left: 1px solid #c0c0c0;border-right: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;background-color: white;color: #000000; box-sizing: content-box;"), a.add(".navigator_modal_main *, .navigator_modal_main *:before, .navigator_modal_main *:after", "box-sizing: content-box;"), a.add(".navigator_modal_month", "font-size: 11px;"), a.add(".navigator_modal_day", "color: black;"), a.add(".navigator_modal_weekend", "background-color: #f0f0f0;"), a.add(".navigator_modal_dayheader", "color: black;"), a.add(".navigator_modal_line", "border-bottom: 1px solid #c0c0c0;"), a.add(".navigator_modal_dayother", "color: gray;"), a.add(".navigator_modal_todaybox", "border: 1px solid red;"), a.add(".navigator_modal_title, .navigator_modal_titleleft, .navigator_modal_titleright", "border-top: 1px solid #c0c0c0;border-bottom: 1px solid #c0c0c0;color: #333;background: #f3f3f3;"), a.add(".navigator_modal_busy", "font-weight: bold;"), a.add(".navigator_modal_cell", "text-align: center;"), a.add(".navigator_modal_select .navigator_modal_cell_box", "background-color: #FFE794; opacity: 0.5;"), a.add(".navigator_modal_title", "text-align: center;"), a.add(".navigator_modal_titleleft, .navigator_modal_titleright", "text-align: center;"), a.add(".navigator_modal_dayheader", "text-align: center;"), a.add(".navigator_modal_weeknumber", "text-align: center;"), a.add(".navigator_modal_cell_text", "cursor: pointer;"), a.commit(), DayPilot.Modal = function (e) { this.autoFocus = !0, this.focus = null, this.autoStretch = !0, this.autoStretchFirstLoadOnly = !1, this.className = null, this.theme = "modal_default", this.disposeOnClose = !0, this.dragDrop = !0, this.loadingHtml = null, this.maxHeight = null, this.scrollWithPage = !0, this.useIframe = !0, this.zIndex = 99999, this.left = null, this.width = 600, this.top = 20, this.height = 200, this.locale = null, this.closed = null, this.onClose = null, this.onClosed = null, this.onShow = null; var t = this; this.id = "_" + (new Date).getTime() + "n" + 10 * Math.random(), this.a = !1, this.b = null, this.c = null, this.showHtml = function (e) { if (DayPilot.ModalStatic.displayed(this))
|
|
977
|
+
throw "This modal dialog is already displayed."; if (this.div || this.d(), this.e(), this.useIframe) {
|
|
978
|
+
var t = function (e, t) { return function () { e.setInnerHTML(e.id + "iframe", t); }; };
|
|
979
|
+
window.setTimeout(t(this, e), 0);
|
|
980
|
+
}
|
|
981
|
+
else
|
|
982
|
+
e.nodeType ? this.div.appendChild(e) : this.div.innerHTML = e; this.e(), this.f(), this.g(); }, this.showUrl = function (e) { if (DayPilot.ModalStatic.displayed(this))
|
|
983
|
+
throw "This modal dialog is already displayed."; if (this.useIframe) {
|
|
984
|
+
this.div || this.d();
|
|
985
|
+
var i = this.loadingHtml;
|
|
986
|
+
i && (this.iframe.src = "about:blank", this.setInnerHTML(this.id + "iframe", i)), this.re(this.iframe, "load", this.h), this.iframe.src = e, this.e(), this.f(), this.g();
|
|
987
|
+
}
|
|
988
|
+
else
|
|
989
|
+
t.i({ "url": e, "success": function (e) { var i = e.request.responseText; t.showHtml(i); }, "error": function (e) { t.showHtml("Error loading the modal dialog"); } }); }, this.g = function () { if ("function" == typeof t.onShow) {
|
|
990
|
+
var e = {};
|
|
991
|
+
e.root = t.j(), e.modal = t, t.onShow(e);
|
|
992
|
+
} }, this.j = function () { return t.iframe ? t.iframe.contentWindow.document : t.div; }, this.i = function (e) { var t = new XMLHttpRequest; if (t) {
|
|
993
|
+
var i = e.method || "GET", a = e.success || function () { }, n = e.error || function () { }, o = e.data, l = e.url;
|
|
994
|
+
t.open(i, l, !0), t.setRequestHeader("Content-type", "text/plain"), t.onreadystatechange = function () { if (4 === t.readyState)
|
|
995
|
+
if (200 === t.status || 304 === t.status) {
|
|
996
|
+
var e = {};
|
|
997
|
+
e.request = t, a(e);
|
|
998
|
+
}
|
|
999
|
+
else if (n) {
|
|
1000
|
+
var e = {};
|
|
1001
|
+
e.request = t, n(e);
|
|
1002
|
+
}
|
|
1003
|
+
else
|
|
1004
|
+
window.console && console.log("HTTP error " + t.status); }, 4 !== t.readyState && ("object" == typeof o && (o = JSON.stringify(o)), t.send(o));
|
|
1005
|
+
} }, this.e = function () { delete this.result; var e = window, i = document, a = e.pageYOffset ? e.pageYOffset : i.documentElement && i.documentElement.scrollTop ? i.documentElement.scrollTop : i.body.scrollTop; this.theme && (this.hideDiv.className = this.theme + "_background"), this.zIndex && (this.hideDiv.style.zIndex = this.zIndex), this.hideDiv.style.display = "", window.setTimeout(function () { t.hideDiv && (t.hideDiv.onclick = function () { t.hide({ "backgroundClick": !0 }); }); }, 500), this.theme ? this.div.className = this.theme + "_main" : this.div.className = "", this.className && (this.div.className += " " + this.className), this.left ? this.div.style.left = this.left + "px" : this.div.style.marginLeft = "-" + Math.floor(this.width / 2) + "px", this.div.style.position = "absolute", this.div.style.boxSizing = "content-box", this.div.style.top = a + this.top + "px", this.div.style.width = this.width + "px", this.zIndex && (this.div.style.zIndex = this.zIndex), this.height && (this.useIframe || !this.autoStretch ? this.div.style.height = this.height + "px" : this.div.style.height = ""), this.useIframe && this.height && (this.iframe.style.height = this.height + "px"), this.div.style.display = "", this.l(), DayPilot.ModalStatic.remove(this), DayPilot.ModalStatic.list.push(this); }, this.h = function () { t.iframe.contentWindow.modal = t, t.autoStretch && t.stretch(); }, this.stretch = function () { var e = function () { return t.k().y; }, i = function () { return t.k().x; }; if (this.useIframe) {
|
|
1006
|
+
for (var a = i() - 40, n = this.width; n < a && this.m(); n += 10)
|
|
1007
|
+
this.div.style.width = n + "px", this.div.style.marginLeft = "-" + Math.floor(n / 2) + "px";
|
|
1008
|
+
for (var o = this.maxHeight || e() - 2 * this.top, l = this.height; l < o && this.n(); l += 10)
|
|
1009
|
+
this.iframe.style.height = l + "px", this.div.style.height = l + "px";
|
|
1010
|
+
this.autoStretchFirstLoadOnly && this.ue(this.iframe, "load", this.h);
|
|
1011
|
+
}
|
|
1012
|
+
else
|
|
1013
|
+
this.div.style.height = ""; }, this.m = function () { for (var e = this.iframe.contentWindow.document, t = "BackCompat" === e.compatMode ? e.body : e.documentElement, i = t.scrollWidth, a = e.body.children, n = 0; n < a.length; n++) {
|
|
1014
|
+
var o = a[n].offsetLeft + a[n].offsetWidth;
|
|
1015
|
+
i = Math.max(i, o);
|
|
1016
|
+
} return i > t.clientWidth; }, this.n = function () { for (var e = this.iframe.contentWindow.document, t = "BackCompat" === e.compatMode ? e.body : e.documentElement, i = t.scrollHeight, a = e.body.children, n = 0; n < a.length; n++) {
|
|
1017
|
+
var o = a[n].offsetTop + a[n].offsetHeight;
|
|
1018
|
+
i = Math.max(i, o);
|
|
1019
|
+
} return i > t.clientHeight; }, this.k = function () { var e = document; if ("CSS1Compat" === e.compatMode && e.documentElement && e.documentElement.clientWidth) {
|
|
1020
|
+
var t = e.documentElement.clientWidth, i = e.documentElement.clientHeight;
|
|
1021
|
+
return { x: t, y: i };
|
|
1022
|
+
} var t = e.body.clientWidth, i = e.body.clientHeight; return { x: t, y: i }; }, this.f = function () { this.a || (this.re(window, "resize", this.o), this.re(window, "scroll", this.p), this.dragDrop && (this.re(document, "mousemove", this.q), this.re(document, "mouseup", this.r)), this.a = !0); }, this.s = function () { this.ue(window, "resize", this.o), this.ue(window, "scroll", this.p), this.dragDrop && (this.ue(document, "mousemove", this.q), this.ue(document, "mouseup", this.r)), this.a = !1; }, this.t = function (e) { e.target === t.div && (e.preventDefault(), t.div.style.cursor = "move", t.u(), t.c = t.mc(e || window.event), t.b = { x: t.div.offsetLeft, y: t.div.offsetTop }); }, this.q = function (e) { if (t.c) {
|
|
1023
|
+
var e = e || window.event, i = t.mc(e), a = i.x - t.c.x, n = i.y - t.c.y;
|
|
1024
|
+
t.div.style.marginLeft = "0px", t.div.style.top = t.b.y + n + "px", t.div.style.left = t.b.x + a + "px";
|
|
1025
|
+
} }, this.r = function (e) { t.c && (t.v(), t.div.style.cursor = null, t.c = null); }, this.u = function () { if (this.useIframe) {
|
|
1026
|
+
var e = document.createElement("div");
|
|
1027
|
+
e.style.backgroundColor = "#ffffff", e.style.filter = "alpha(opacity=80)", e.style.opacity = "0.80", e.style.width = "100%", e.style.height = this.height + "px", e.style.position = "absolute", e.style.left = "0px", e.style.top = "0px", this.div.appendChild(e), this.mask = e;
|
|
1028
|
+
} }, this.v = function () { this.useIframe && (this.div.removeChild(this.mask), this.mask = null); }, this.o = function () { t.w(), t.l(); }, this.p = function () { t.w(); }, this.l = function () { if (!t.left && t.div) {
|
|
1029
|
+
var e = t.div.offsetWidth;
|
|
1030
|
+
t.div.style.marginLeft = "-" + Math.floor(e / 2) + "px";
|
|
1031
|
+
} }, this.w = function () { if (t.hideDiv && t.div && "none" !== t.hideDiv.style.display && "none" !== t.div.style.display) {
|
|
1032
|
+
var e = t.z.scrollY();
|
|
1033
|
+
t.scrollWithPage || (t.div.style.top = e + t.top + "px");
|
|
1034
|
+
} }, this.z = {}, this.z.container = function () { return t.container || document.body; }, this.z.scrollY = function () { var e = t.z.container(); return e === document.body ? window.pageYOffset ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop : e.scrollTop; }, this.re = function (e, t, i) { e.addEventListener ? e.addEventListener(t, i, !1) : e.attachEvent && e.attachEvent("on" + t, i); }, this.ue = function (e, t, i) { e.removeEventListener ? e.removeEventListener(t, i, !1) : e.detachEvent && e.detachEvent("on" + t, i); }, this.mc = function (e) { return e.pageX || e.pageY ? { x: e.pageX, y: e.pageY } : { x: e.clientX + document.documentElement.scrollLeft, y: e.clientY + document.documentElement.scrollTop }; }, this.abs = function (e) { for (var t = { x: e.offsetLeft, y: e.offsetTop }; e.offsetParent;)
|
|
1035
|
+
e = e.offsetParent, t.x += e.offsetLeft, t.y += e.offsetTop; return t; }, this.d = function () { var e = t.z.container(), i = e === document.body, a = i ? "fixed" : "absolute", n = document.createElement("div"); n.id = this.id + "hide", n.style.position = a, n.style.left = "0px", n.style.top = "0px", n.style.right = "0px", n.style.bottom = "0px", n.oncontextmenu = function () { return !1; }, n.onmousedown = function () { return !1; }, e.appendChild(n); var o = document.createElement("div"); o.id = this.id + "popup", o.style.position = a, o.style.left = "50%", o.style.top = "0px", o.style.backgroundColor = "white", o.style.width = "50px", o.style.height = "50px", this.dragDrop && (o.onmousedown = this.t), o.addEventListener("keydown", function (e) { e.stopPropagation(); }); var l = null; this.useIframe && (l = document.createElement("iframe"), l.id = this.id + "iframe", l.name = this.id + "iframe", l.frameBorder = "0", l.style.width = "100%", l.style.height = "50px", o.appendChild(l)), e.appendChild(o), this.div = o, this.iframe = l, this.hideDiv = n; }, this.setInnerHTML = function (e, i) { var a = window.frames[e], n = a.contentWindow || a.document || a.contentDocument; n.document && (n = n.document), null == n.body && n.write("<body></body>"), i.nodeType ? n.body.appendChild(i) : n.body.innerHTML = i, t.autoStretch && (t.autoStretchFirstLoadOnly && t.A || (t.stretch(), t.A = !0)); }, this.close = function (e) { this.result = e, this.hide(); }, this.closeSerialized = function () { for (var e = t.j(), i = e.querySelectorAll("input, textarea, select"), a = {}, n = 0; n < i.length; n++) {
|
|
1036
|
+
var o = i[n], l = o.name;
|
|
1037
|
+
if (l) {
|
|
1038
|
+
var d = o.value;
|
|
1039
|
+
a[l] = d;
|
|
1040
|
+
}
|
|
1041
|
+
} t.close(a); }, this.hide = function (e) { e = e || {}; var i = {}; i.backgroundClick = !!e.backgroundClick, i.result = this.result, i.canceled = "undefined" == typeof this.result, i.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof this.onClose && (this.onClose(i), i.preventDefault.value) || (this.div && (this.div.style.display = "none", this.hideDiv.style.display = "none", this.useIframe || (this.div.innerHTML = null)), window.focus(), DayPilot.ModalStatic.remove(this), "function" == typeof this.onClosed ? this.onClosed(i) : this.closed && this.closed(), delete this.result, this.disposeOnClose && (t.s(), t.B(t.div), t.B(t.hideDiv), t.div = null, t.hideDiv = null, t.iframe = null)); }, this.B = function (e) { e && e.parentNode && e.parentNode.removeChild(e); }, this.C = function () { if (e)
|
|
1042
|
+
for (var t in e)
|
|
1043
|
+
this[t] = e[t]; }, this.C(); }, DayPilot.Modal.alert = function (e, t) { t = t || {}, t.height = t.height || 40, t.useIframe = !1; var i = t.okText || "OK"; t.cancelText || "Cancel"; return DayPilot.getPromise(function (a, n) { t.onClosed = function (e) { a(e); }; var o = new DayPilot.Modal(t), l = document.createElement("div"); l.className = o.theme + "_inner"; var d = document.createElement("div"); d.className = o.theme + "_content", d.innerHTML = e; var r = document.createElement("div"); r.className = o.theme + "_buttons"; var s = document.createElement("button"); s.innerText = i, s.className = o.theme + "_ok", s.onclick = function (e) { DayPilot.ModalStatic.close("OK"); }, r.appendChild(s), l.appendChild(d), l.appendChild(r), o.showHtml(l), o.autoFocus && s.focus(); }); }, DayPilot.Modal.confirm = function (e, t) { t = t || {}, t.height = t.height || 40, t.useIframe = !1; var i = t.okText || "OK", a = t.cancelText || "Cancel"; return DayPilot.getPromise(function (n, o) { t.onClosed = function (e) { n(e); }; var l = new DayPilot.Modal(t), d = document.createElement("div"); d.className = l.theme + "_inner"; var r = document.createElement("div"); r.className = l.theme + "_content", r.innerHTML = e; var s = document.createElement("div"); s.className = l.theme + "_buttons"; var c = document.createElement("button"); c.innerText = i, c.className = l.theme + "_ok", c.onclick = function (e) { DayPilot.ModalStatic.close("OK"); }; var u = document.createTextNode(" "), m = document.createElement("button"); m.innerText = a, m.className = l.theme + "_cancel", m.onclick = function (e) { DayPilot.ModalStatic.close(); }, s.appendChild(c), s.appendChild(u), s.appendChild(m), d.appendChild(r), d.appendChild(s), l.showHtml(d), l.autoFocus && c.focus(); }); }, DayPilot.Modal.prompt = function (e, t, i) { "object" == typeof t && (i = t, t = ""), i = i || {}, i.height = i.height || 40, i.useIframe = !1; var a = i.okText || "OK", n = i.cancelText || "Cancel", o = t || ""; return DayPilot.getPromise(function (t, l) { i.onClosed = function (e) { t(e); }; var d = new DayPilot.Modal(i), r = document.createElement("div"); r.className = d.theme + "_inner"; var s = document.createElement("div"); s.className = d.theme + "_content", s.innerHTML = e; var c = document.createElement("div"); c.className = d.theme + "_input"; var u = document.createElement("input"); u.value = o, u.style.width = "100%", u.onkeydown = function (e) { var t = !1; switch (e.keyCode) {
|
|
1044
|
+
case 13:
|
|
1045
|
+
d.close(this.value);
|
|
1046
|
+
break;
|
|
1047
|
+
case 27:
|
|
1048
|
+
d.close();
|
|
1049
|
+
break;
|
|
1050
|
+
default: t = !0;
|
|
1051
|
+
} t || (e.preventDefault(), e.stopPropagation()); }, c.appendChild(u); var m = document.createElement("div"); m.className = d.theme + "_buttons"; var h = document.createElement("button"); h.innerText = a, h.className = d.theme + "_ok", h.onclick = function (e) { d.close(u.value); }; var p = document.createTextNode(" "), f = document.createElement("button"); f.innerText = n, f.className = d.theme + "_cancel", f.onclick = function (e) { d.close(); }, m.appendChild(h), m.appendChild(p), m.appendChild(f), r.appendChild(s), r.appendChild(c), r.appendChild(m), d.showHtml(r), d.autoFocus && u.focus(); }); };
|
|
1052
|
+
var n = function (e) { return "[object Array]" === Object.prototype.toString.call(e); };
|
|
1053
|
+
DayPilot.Modal.form = function (t, i, a) { if (1 === arguments.length) {
|
|
1054
|
+
var l = t;
|
|
1055
|
+
if (n(l))
|
|
1056
|
+
i = {};
|
|
1057
|
+
else {
|
|
1058
|
+
if ("object" != typeof l)
|
|
1059
|
+
throw "Invalid DayPilot.Modal.form() parameter";
|
|
1060
|
+
i = t, t = [];
|
|
1061
|
+
for (var d in i) {
|
|
1062
|
+
var r = {};
|
|
1063
|
+
r.name = d, r.id = d, t.push(r);
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
} var s = {}; for (var d in a)
|
|
1067
|
+
s[d] = a[d]; s.height = s.height || 40, s.useIframe = !1; var c = s.okText || "OK", u = s.cancelText || "Cancel"; return DayPilot.getPromise(function (a, n) { s.onClosed = function (t) { if (t.result) {
|
|
1068
|
+
var n = JSON.parse(JSON.stringify(i));
|
|
1069
|
+
for (var o in t.result)
|
|
1070
|
+
e(n, o, t.result[o]);
|
|
1071
|
+
t.result = n;
|
|
1072
|
+
} a(t); }; var l = new DayPilot.Modal(s), d = document.createElement("div"); d.className = l.theme + "_inner"; var r = document.createElement("div"); r.className = l.theme + "_input"; var m = new o({ theme: l.theme, form: t, data: i, zIndex: l.zIndex, locale: l.locale, plugins: l.plugins, onKey: function (e) { switch (e.key) {
|
|
1073
|
+
case "Enter":
|
|
1074
|
+
m.validate() && l.close(m.serialize());
|
|
1075
|
+
break;
|
|
1076
|
+
case "Escape": l.close();
|
|
1077
|
+
} }, onChange: function (e) { "function" == typeof l.onChange && l.onChange(e); } }), h = m.create(); r.append(h); var p = document.createElement("div"); p.className = l.theme + "_buttons"; var f = document.createElement("button"); f.innerText = c, f.className = l.theme + "_ok", s.okDisabled && (f.disabled = !0), f.onclick = function (e) { m.validate() && l.close(m.serialize()); }; var v = document.createTextNode(" "), g = document.createElement("button"); if (g.innerText = u, g.className = l.theme + "_cancel", g.onclick = function (e) { l.close(); }, g.onmousedown = function (e) { m.canceling = !0; }, p.appendChild(f), p.appendChild(v), p.appendChild(g), d.appendChild(r), d.appendChild(p), l.showHtml(d), l.div.setAttribute("tabindex", "-1"), l.div.addEventListener("keydown", function (e) { switch (e.keyCode) {
|
|
1078
|
+
case 27:
|
|
1079
|
+
l.close();
|
|
1080
|
+
break;
|
|
1081
|
+
case 13: m.validate() && l.close(m.serialize());
|
|
1082
|
+
} }), l.focus) {
|
|
1083
|
+
var b = null;
|
|
1084
|
+
if ("object" == typeof l.focus) {
|
|
1085
|
+
var y = l.focus.id, I = l.focus.value;
|
|
1086
|
+
b = m.findViewById(y, I);
|
|
1087
|
+
}
|
|
1088
|
+
else
|
|
1089
|
+
"string" == typeof l.focus && (b = m.findViewById(l.focus));
|
|
1090
|
+
b && b.focus();
|
|
1091
|
+
}
|
|
1092
|
+
else {
|
|
1093
|
+
var _ = m.firstFocusable();
|
|
1094
|
+
l.autoFocus && _ ? _.focus() : l.div.focus();
|
|
1095
|
+
} }); }, DayPilot.Modal.close = function (e) { var t = DayPilot.Modal.opener(); t && t.close(e); }, DayPilot.Modal.stretch = function (e) { var t = DayPilot.Modal.opener(); if (!t)
|
|
1096
|
+
throw "Unable to find the opener DayPilot.Modal instance."; t.stretch(); }, DayPilot.Modal.closeSerialized = function () { var e = DayPilot.Modal.opener() || DayPilot.ModalStatic.last(); e && e.closeSerialized(); }, DayPilot.Modal.opener = function () { return "undefined" != typeof DayPilot && "undefined" != typeof DayPilot.ModalStatic && DayPilot.ModalStatic.list.length > 0 ? DayPilot.ModalStatic.list[DayPilot.ModalStatic.list.length - 1] : parent && parent.DayPilot && parent.DayPilot.ModalStatic && parent.DayPilot.ModalStatic.list[parent.DayPilot.ModalStatic.list.length - 1]; }, DayPilot.Modal.Experimental = {}, DayPilot.Modal.Experimental.Form = o, "undefined" == typeof DayPilot.getPromise && (DayPilot.getPromise = function (e) { return "undefined" != typeof Promise ? new Promise(e) : (DayPilot.Promise = function (e) { var t = this; this.then = function (t, i) { return t = t || function () { }, i = i || function () { }, e(t, i), DayPilot.getPromise(e); }, this["catch"] = function (i) { return t.then(null, i), DayPilot.getPromise(e); }; }, new DayPilot.Promise(e)); });
|
|
1097
|
+
var o = function (e) { this.form = [], this.data = {}, this.theme = "form_default", this.zIndex = 99999, this.locale = "en-us", this.plugins = {}, this.onKey = null, this.D = [], this.E = null, this.canceling = !1, this.F = [], this.G = [], this.H = null, e = e || {}; for (var t in e)
|
|
1098
|
+
this[t] = e[t]; };
|
|
1099
|
+
o.prototype.create = function () { return this.load(), this.render(), this.H; }, o.prototype.render = function () { var e = this; this.H = document.createElement("div"), this.D.forEach(function (t) { e.createView(t); }), this.applyState(); }, o.prototype.createView = function (e) { var t = this.theme, i = this, a = document.createElement("div"); if (a.className = t + "_form_item " + t + "_form_item_level" + e.level, e.interactive || "title" !== e.type ? a.className += " " + t + "_form_item_" + e.type : a.className += " " + t + "_form_title", e.data.cssClass && (a.className += " " + e.data.cssClass), !e.isValue) {
|
|
1100
|
+
var n = document.createElement("div");
|
|
1101
|
+
n.className = t + "_form_item_label", n.innerText = e.text, a.appendChild(n);
|
|
1102
|
+
} var o = this.createInteractive(e); o.onInput = function (e) { if (e = e || {}, i.I(o, { "debounce": !e.immediate }), "function" == typeof i.onChange) {
|
|
1103
|
+
var t = {};
|
|
1104
|
+
t.result = i.serialize(), i.onChange(t);
|
|
1105
|
+
} }, o.onBlur = function () { i.canceling || i.I(o); }, o.apply(e), o.H = a, o.row = e, o.element && a.appendChild(o.element), this.G.push(o), this.H.appendChild(a); }, o.prototype.validate = function () { var e = this, t = !0; return this.G.forEach(function (i) { var a = e.I(i); t = t && a; }), t; }, o.prototype.I = function (e, t) {
|
|
1106
|
+
function i() {
|
|
1107
|
+
e.J && (e.J.remove(), e.J = null), e.H.classList.add(u);
|
|
1108
|
+
var t = document.createElement("div");
|
|
1109
|
+
t.classList.add(m), t.innerText = c.message, e.J = t, e.H.appendChild(t);
|
|
1110
|
+
}
|
|
1111
|
+
t = t || {};
|
|
1112
|
+
var a = t.debounce, n = t.silent, o = e.row, l = !0, d = "function" == typeof o.data.onValidate ? o.data.onValidate : null, r = "function" == typeof o.data.validate ? o.data.validate : null, s = d || r;
|
|
1113
|
+
if (s) {
|
|
1114
|
+
var c = {};
|
|
1115
|
+
c.valid = !0, c.value = e.save()[o.field], c.message = "Error", c.values = this.serialize(), c.result = this.serialize(), s(c);
|
|
1116
|
+
var u = this.theme + "_form_item_invalid", m = this.theme + "_form_item_invalid_message";
|
|
1117
|
+
if (c.valid)
|
|
1118
|
+
clearTimeout(this.F[o.field]), e.J && (e.J.remove(), e.J = null), e.H.classList.remove(u);
|
|
1119
|
+
else if (!n)
|
|
1120
|
+
if (a) {
|
|
1121
|
+
var h = 1e3;
|
|
1122
|
+
clearTimeout(this.F[o.field]), this.F[o.field] = setTimeout(function () { i(); }, h);
|
|
1123
|
+
}
|
|
1124
|
+
else
|
|
1125
|
+
i();
|
|
1126
|
+
l = c.valid;
|
|
1127
|
+
}
|
|
1128
|
+
return l;
|
|
1129
|
+
}, o.prototype.load = function () { var e = this; this.form.forEach(function (t) { e.processFormItem(t, 0); }); var i; try {
|
|
1130
|
+
var a = JSON.stringify(this.data);
|
|
1131
|
+
i = t(JSON.parse(a));
|
|
1132
|
+
}
|
|
1133
|
+
catch (e) {
|
|
1134
|
+
throw new Error("The 'data' object is not serializable (it may contain circular dependencies): " + e);
|
|
1135
|
+
} for (var n in i)
|
|
1136
|
+
this.setValue(n, i[n]); }, o.prototype.setValue = function (e, t) { this.D.forEach(function (i) { i.applyValue(e, t); }); }, o.prototype.updateDependentState = function () { var e = this, t = [!0]; (this.E ? this.E : this.D).forEach(function (i) { var a = e.updateState(i, { enabled: t[i.level] && !i.data.disabled }); a.isValue && (t[a.level + 1] = a.enabled && a.checked); }); }, o.prototype.processFormItem = function (e, t) { var i = this, a = this.getFieldType(e), n = []; if ("radio" === a) {
|
|
1137
|
+
if (e.name) {
|
|
1138
|
+
var o = new l;
|
|
1139
|
+
o.field = e.id, o.data = e, o.level = t, o.type = "label", o.interactive = !1, o.text = e.name, i.D.push(o), n.push(o);
|
|
1140
|
+
}
|
|
1141
|
+
e.options.forEach(function (o) { var d = new l; d.field = e.id, d.data = o, d.level = t, d.type = a, d.isValue = !0, d.text = o.name, d.resolved = o.id, i.D.push(d), n.push(d), o.children && o.children.forEach(function (e) { var a = i.processFormItem(e, t + 1); n = n.concat(a); }); });
|
|
1142
|
+
}
|
|
1143
|
+
else if ("title" === a) {
|
|
1144
|
+
var o = new l;
|
|
1145
|
+
o.field = e.id, o.data = e, o.level = t, o.type = a, o.interactive = !1, o.text = e.name, i.D.push(o), n.push(o);
|
|
1146
|
+
}
|
|
1147
|
+
else if ("image" === a) {
|
|
1148
|
+
var o = new l;
|
|
1149
|
+
o.isValue = !0, o.field = e.id, o.data = e, o.level = t, o.type = a, o.interactive = !1, o.text = null, i.D.push(o), n.push(o);
|
|
1150
|
+
}
|
|
1151
|
+
else if ("html" === a) {
|
|
1152
|
+
var o = new l;
|
|
1153
|
+
o.isValue = !0, o.field = e.id, o.data = e, o.level = t, o.type = a, o.interactive = !1, o.text = null, i.D.push(o), n.push(o);
|
|
1154
|
+
}
|
|
1155
|
+
else if ("scrollable" === a) {
|
|
1156
|
+
var o = new l;
|
|
1157
|
+
o.isValue = !0, o.field = e.id, o.data = e, o.level = t, o.type = a, o.interactive = !1, o.text = null, i.D.push(o), n.push(o);
|
|
1158
|
+
}
|
|
1159
|
+
else {
|
|
1160
|
+
var o = new l;
|
|
1161
|
+
o.field = e.id, o.data = e, o.level = t, o.type = a, o.text = e.name, o.children = [], i.D.push(o), n.push(o);
|
|
1162
|
+
} return "checkbox" === a && (o.isValue = !0, o.resolved = !0, e.children && e.children.forEach(function (e) { var a = i.processFormItem(e, t + 1); n = n.concat(a); })), n; }, o.prototype.doOnKey = function (e) { if ("function" == typeof this.onKey) {
|
|
1163
|
+
var t = { key: e };
|
|
1164
|
+
this.onKey(t);
|
|
1165
|
+
} }, o.prototype.createInteractive = function (e) { var t = this, i = { "label": function () { return new d; }, "title": function () { return new d; }, "image": function () { var t = new d, i = document.createElement("img"); return i.src = e.data.image, t.element = i, t; }, "html": function () { var t = new d, i = document.createElement("div"); return "string" == typeof e.data.text ? i.innerText = e.data.text : "string" == typeof e.data.html && (i.innerHTML = e.data.html), t.element = i, t; }, "scrollable": function () { var i = new d, a = document.createElement("div"); a.className = t.theme + "_form_item_scrollable_scroll", e.data.height && (a.style.height = e.data.height + "px"); var n = document.createElement("div"); return n.className = t.theme + "_form_item_scrollable_scroll_content", "string" == typeof e.data.text ? n.innerText = e.data.text : "string" == typeof e.data.html && (n.innerHTML = e.data.html), a.appendChild(n), i.element = a, i; }, "text": function () { var i = new d; i.apply = function (e) { i.row = e; var t = i.element; t.value = e.value, t.disabled = !e.enabled; }; var a = document.createElement("input"); return a.name = e.field, a.type = "text", a.autocomplete = "off", a.onkeydown = function (e) { var i = !1; switch (e.keyCode) {
|
|
1166
|
+
case 13:
|
|
1167
|
+
t.doOnKey("Enter");
|
|
1168
|
+
break;
|
|
1169
|
+
case 27:
|
|
1170
|
+
t.doOnKey("Escape");
|
|
1171
|
+
break;
|
|
1172
|
+
default: i = !0;
|
|
1173
|
+
} i || (e.preventDefault(), e.stopPropagation()); }, a.oninput = function (e) { i.onInput(); }, a.onblur = function (e) { i.onBlur(); }, i.element = a, i.canFocus = function () { return !i.element.disabled; }, i.focus = function () { i.element.focus(), i.element.setSelectionRange(0, i.element.value.length); }, i.save = function () { var t = {}; return t[e.field] = a.value, t; }, i; }, "textarea": function () { var i = new d; i.apply = function (e) { i.row = e; var t = i.element; t.value = e.value, t.disabled = !e.enabled; }; var a = document.createElement("textarea"); return a.name = e.field, e.data.height && (a.style.height = e.data.height + "px"), a.onkeydown = function (e) { var i = !1; switch (e.keyCode) {
|
|
1174
|
+
case 13:
|
|
1175
|
+
(e.ctrlKey || e.metaKey) && t.doOnKey("Enter"), i = !1;
|
|
1176
|
+
break;
|
|
1177
|
+
case 27:
|
|
1178
|
+
t.doOnKey("Escape");
|
|
1179
|
+
break;
|
|
1180
|
+
default: i = !0;
|
|
1181
|
+
} i || e.stopPropagation(); }, a.oninput = function (e) { i.onInput(); }, a.onblur = function (e) { i.onBlur(); }, i.element = a, i.canFocus = function () { return !i.element.disabled; }, i.focus = function () { i.element.focus(), i.element.setSelectionRange(0, 0); }, i.save = function () { var t = {}; return t[e.field] = a.value, t; }, i; }, "date": function () { var i = new d; i.apply = function (e) { i.row = e; var a = i.element, n = i.picker; e.data.dateFormat && (n.pattern = e.data.dateFormat); var o = e.data.locale || t.locale; o && (n.locale = o), a.disabled = !e.enabled, n.date = new DayPilot.Date(e.value); var l = new DayPilot.Date(e.value).toString(e.data.dateFormat || n.pattern, n.locale); a.value = l; }; var a = document.createElement("input"); a.name = e.field; var n = new DayPilot.DatePicker({ target: a, theme: "navigator_modal", zIndex: t.zIndex + 1, resetTarget: !1, targetAlignment: "left", onTimeRangeSelect: function (e) { i.onInput({ "immediate": !0 }); } }); return a.picker = n, a.className = t.theme + "_input_date", a.type = "text", a.onkeydown = function (e) { var i = !1; switch (e.keyCode) {
|
|
1182
|
+
case 13:
|
|
1183
|
+
n.visible ? n.close() : t.doOnKey("Enter");
|
|
1184
|
+
break;
|
|
1185
|
+
case 27:
|
|
1186
|
+
n.visible ? n.close() : t.doOnKey("Escape");
|
|
1187
|
+
break;
|
|
1188
|
+
case 9:
|
|
1189
|
+
n.close(), i = !0;
|
|
1190
|
+
break;
|
|
1191
|
+
default: i = !0;
|
|
1192
|
+
} i || (e.preventDefault(), e.stopPropagation()); }, a.onfocus = function () { n.show(); }, a.onclick = function () { n.show(); }, a.oninput = function (e) { i.onInput(); }, a.onblur = function (e) { i.onBlur(); }, i.element = a, i.picker = n, i.canFocus = function () { return !i.element.disabled; }, i.focus = function () { i.element.focus(); }, i.save = function () { var t = n.date ? n.date.toString() : null, i = {}; return i[e.field] = t, i; }, i; }, "select": function () { var t = new d; t.apply = function (e) { t.row = e; var i = t.element; i.value = e.value, i.disabled = !e.enabled; }; var i = document.createElement("select"); return i.name = e.field, e.data.options && e.data.options.forEach && e.data.options.forEach(function (e) { var t = document.createElement("option"); t.innerText = e.name || e.id, t.value = e.id, t.K = e.id, i.appendChild(t); }), i.onchange = function (e) { t.onInput({ "immediate": !0 }); }, i.onblur = function (e) { t.onBlur(); }, t.element = i, t.canFocus = function () { return !t.element.disabled; }, t.focus = function () { t.element.focus(); }, t.save = function () { var t = null, a = i.options[i.selectedIndex]; a && "undefined" != typeof a.K && (t = a.K); var n = {}; return n[e.field] = t, n; }, t; }, "searchable": function () { var i = new d; i.apply = function (e) { i.row = e; var t = i.searchable; t.disabled = !e.enabled, t.select(e.value); }; var a = new r({ data: e.data.options || [], name: e.field, theme: t.theme + "_form_item_searchable", listZIndex: t.zIndex + 1, onSelect: function (e) { e.ui && i.onInput({ "immediate": !0 }); } }), n = a.create(); return i.element = n, i.searchable = a, i.canFocus = function () { return !i.searchable.disabled; }, i.focus = function () { i.searchable.focus(); }, i.save = function () { var t = a.selected && a.selected.id, i = {}; return i[e.field] = t, i; }, i; }, "radio": function () { var i = new d; i.apply = function (e) { i.row = e; var t = i.radio; t.checked = e.checked, t.disabled = !e.enabled; }; var a = document.createElement("label"), n = document.createElement("input"); n.type = "radio", n.name = e.field, n.K = e.resolved, n.onchange = function (e) { var a = i.row; t.findRowsByField(a.field).forEach(function (e) { t.updateState(e, { checked: !1 }); }), t.updateState(a, { checked: !0 }), t.applyState(), i.onInput({ "immediate": !0 }); }, n.onblur = function (e) { i.onBlur(); }, a.appendChild(n); var o = document.createTextNode(e.text); return a.append(o), i.element = a, i.radio = n, i.canFocus = function () { return !1; }, i.focus = function () { i.radio.focus(); }, i.save = function () { if (!n.checked)
|
|
1193
|
+
return {}; var t = n.K, i = {}; return i[e.field] = t, i; }, i; }, "checkbox": function () { var i = new d; i.apply = function (e) { i.row = e; var t = i.checkbox; t.checked = e.checked, t.disabled = !e.enabled; }; var a = document.createElement("label"), n = document.createElement("input"); n.type = "checkbox", n.name = e.field, n.K = e.resolved, n.onchange = function (e) { var a = i.row; t.updateState(a, { checked: this.checked }), t.applyState(), i.onInput({ "immediate": !0 }); }, n.onblur = function (e) { i.onBlur(); }, a.appendChild(n); var o = document.createTextNode(e.text); return a.append(o), i.element = a, i.checkbox = n, i.canFocus = function () { return !1; }, i.focus = function () { i.checkbox.focus(); }, i.save = function () { var t = n.checked, i = {}; return i[e.field] = t, i; }, i; }, "table": function () { var i = new d; i.apply = function (e) { i.row = e; var t = i.table; t.disabled = !e.enabled, t.load(e.value || []); }; var a = new s({ name: e.field, form: t, theme: t.theme + "_form_item_tabular", item: e.data, onInput: function (e) { i.onInput(); } }), n = a.create(); return i.element = n, i.table = a, i.canFocus = function () { return !1; }, i.focus = function () { i.table.focus(); }, i.save = function () { var t = a.save(), i = {}; return i[e.field] = t, i; }, i; } }; return t.plugins && t.plugins[e.type] ? t.plugins[e.type](e) : i[e.type](); }, o.prototype.findRowsByField = function (e) { return this.D.filter(function (t) { return t.field === e; }); }, o.prototype.findViewById = function (e, t) { return this.G.find(function (i) { return i.row.field === e && ("radio" !== i.row.type || i.row.resolved === t); }); }, o.prototype.firstFocusable = function () { return this.G.find(function (e) { return e.canFocus && e.canFocus(); }); }, o.prototype.updateState = function (e, t) { var i = this.E ? this.E : this.D, a = i.indexOf(e); return this.E = i.map(function (i) { if (i !== e)
|
|
1194
|
+
return i; if (e.propsEqual(t))
|
|
1195
|
+
return e; var a = e.clone(); for (var n in t)
|
|
1196
|
+
a[n] = t[n]; return a; }), this.E[a]; }, o.prototype.updateInteractive = function (e) { var t = this.E.indexOf(e); this.G[t].apply(e); }, o.prototype.applyState = function () { var e = this; if (this.updateDependentState(), this.E) {
|
|
1197
|
+
this.E.filter(function (t, i) { return e.D[i] !== t; }).forEach(function (t) { e.updateInteractive(t); }), this.D = this.E, this.E = null;
|
|
1198
|
+
} }, o.prototype.getFieldType = function (e) { return ["text", "date", "select", "searchable", "radio", "checkbox", "table", "title", "image", "html", "textarea", "scrollable"].indexOf(e.type) !== -1 ? e.type : e.type && this.plugins && this.plugins[e.type] ? e.type : e.image ? "image" : e.html || e.text ? "html" : e.id ? e.options ? "searchable" : e.dateFormat ? "date" : e.columns ? "table" : "text" : "title"; }, o.prototype.serialize = function () { var e = {}; return this.G.forEach(function (t) { var i = t.save(); for (var a in i)
|
|
1199
|
+
e[a] = i[a]; }), e; };
|
|
1200
|
+
var l = function () { this.id = this.guid(), this.field = null, this.data = null, this.type = null, this.level = 0, this.enabled = !0, this.value = null, this.text = null, this.interactive = !0, this.isValue = !1, this.checked = !1, this.resolved = null; };
|
|
1201
|
+
l.prototype.clone = function () { var e = new l; for (var t in this)
|
|
1202
|
+
"id" !== t && (e[t] = this[t]); return e; }, l.prototype.propsEqual = function (e) { for (var t in e)
|
|
1203
|
+
if (this[t] !== e[t])
|
|
1204
|
+
return !1; return !0; }, l.prototype.guid = function () { var e = function () { return (65536 * (1 + Math.random()) | 0).toString(16).substring(1); }; return "" + e() + e() + "-" + e() + "-" + e() + "-" + e() + "-" + e() + e() + e(); }, l.prototype.applyValue = function (e, t) { this.field === e && (this.value = t, this.isValue && t === this.resolved && (this.checked = !0)); };
|
|
1205
|
+
var d = function () { this.element = null, this.canFocus = function () { return !1; }, this.apply = function (e) { }, this.focus = function () { }, this.save = function () { return {}; }; }, r = function (e) { this.data = [], this.name = null, this.theme = "searchable_default", this.L = !1, this.listZIndex = 1e5, this.onSelect = null, this.M = null, this.N = null, this.O = !1, this.P = null, this.Q = null, this.R = [], this.S = null, e = e || {}; var t = this, i = { "selected": { post: function (e) { "object" == typeof e && e.id ? t.M = e : "string" != typeof e && "number" != typeof e || t.select(e); } } }; Object.defineProperty(this, "selected", { get: function () { return this.M; } }), Object.defineProperty(this, "disabled", { get: function () { return this.L; }, set: function (e) { this.L = e, this.P && (this.P.disabled = e, e && this.T()); } }); for (var a in e)
|
|
1206
|
+
i[a] || (this[a] = e[a]); for (var a in e)
|
|
1207
|
+
i[a] && i[a].post(e[a]); };
|
|
1208
|
+
r.prototype.select = function (e) { return this.M = this.data.find(function (t) { return t.id === e; }), this.U(!1), this; }, r.prototype.create = function () { function e() { m.style.display = "", m.style.top = p.offsetHeight + "px", m.style.left = "0px", m.style.width = p.offsetWidth + "px", m.innerHTML = "", m.addEventListener("mousedown", function (e) { e.preventDefault(); }), r.N = null, r.R = []; var e = null; r.data.forEach(function (i) { var n = i.name || i.id; if (n.toLowerCase().indexOf(p.value.toLowerCase()) !== -1) {
|
|
1209
|
+
var o = document.createElement("div");
|
|
1210
|
+
o.className = r.theme + "_list_item", o.innerText = n, o.item = i, i === r.M && (r.N = o), e || (e = o), o.addEventListener("mousedown", function (e) { a(o), e.preventDefault(); }), o.addEventListener("mousemove", function (e) { r.N !== o && (r.N = o, t({ dontScroll: !0 })); }), m.appendChild(o), r.R.push(o);
|
|
1211
|
+
} }), r.N || (r.N = e), t(); } function t(e) { e = e || {}; var t = !e.dontScroll; document.querySelectorAll("." + r.theme + "_list_item_highlight").forEach(function (e) { e.className = e.className.replace(r.theme + "_list_item_highlight", ""); }), r.N && (r.N.className += " " + r.theme + "_list_item_highlight", t && !i(r.N, m) && r.N.scrollIntoView()); } function i(e, t) { var i = e.getBoundingClientRect(), a = t.getBoundingClientRect(); return i.top >= a.top && i.bottom <= a.bottom; } function a(e) { var t = e.item; r.M = t, r.U(!0), o(), l(); } function n() { r.T(); } function o() { r.V(); } function l() { r.O = !0, p.setAttribute("readonly", "readonly"), p.focus(); } function d() { r.O = !1, p.removeAttribute("readonly"), p.value = "", e(); } var r = this, s = this, c = document.createElement("div"); c.className = this.theme + "_main", c.style.position = "relative"; var u = document.createElement("div"); u.className = this.theme + "_icon", u.style.position = "absolute", u.style.right = "0", u.style.top = "0", u.style.bottom = "0", u.style.width = "20px", u.addEventListener("mousedown", function (e) { e.preventDefault(), r.O ? (r.focus(), d()) : (n(), l()); }); var m = document.createElement("div"); m.className = this.theme + "_list", m.style.display = "none", m.style.position = "absolute", m.style.zIndex = this.listZIndex; var h = document.createElement("input"); h.type = "hidden", h.name = this.name, h.searchable = s, this.S = h; var p = document.createElement("input"); return p.type = "text", p.className = this.theme + "_input", p.disabled = this.L, p.addEventListener("click", function (e) { d(); }), p.addEventListener("focus", function (t) { p.value = "", e(); }), p.addEventListener("input", function (t) { e(); }), p.addEventListener("blur", function (e) { p.removeAttribute("readonly"), n(); }), p.addEventListener("keydown", function (e) { if (r.O) {
|
|
1212
|
+
if ("Enter" === e.key)
|
|
1213
|
+
return;
|
|
1214
|
+
if ("Esc" === e.key || "Escape" === e.key)
|
|
1215
|
+
return;
|
|
1216
|
+
d();
|
|
1217
|
+
} if ("ArrowDown" === e.key) {
|
|
1218
|
+
var i = s.R.indexOf(s.N);
|
|
1219
|
+
i + 1 < s.R.length && (s.N = s.R[i + 1]), t();
|
|
1220
|
+
}
|
|
1221
|
+
else if ("ArrowUp" === e.key) {
|
|
1222
|
+
var i = s.R.indexOf(s.N);
|
|
1223
|
+
i - 1 >= 0 && (s.N = s.R[i - 1]), t();
|
|
1224
|
+
}
|
|
1225
|
+
else
|
|
1226
|
+
"Enter" === e.key ? r.N ? (e.stopPropagation(), a(r.N)) : (e.stopPropagation(), n(), l()) : "Esc" !== e.key && "Escape" !== e.key || (e.stopPropagation(), n(), l()); }), this.P = p, this.Q = m, this.M || (this.M = this.data[0], this.M && (p.value = this.M.name)), c.appendChild(p), c.appendChild(u), c.appendChild(h), c.appendChild(m), c; }, r.prototype.T = function () { this.V(), this.M ? this.P.value = this.M.name : (this.P.value = "", this.U(!0)); }, r.prototype.focus = function () { this.O = !0, this.P.setAttribute("readonly", "readonly"), this.P.focus(), this.T(); }, r.prototype.V = function () { this.Q.style.display = "none"; }, r.prototype.U = function (e) { if (this.S.value = this.selected ? this.selected.id : null, this.M ? this.P.value = this.M.name : this.P.value = "", "function" == typeof this.onSelect) {
|
|
1227
|
+
var t = { control: this, ui: e };
|
|
1228
|
+
this.onSelect(t);
|
|
1229
|
+
} };
|
|
1230
|
+
var s = function (e) { this.form = null, this.item = null, this.data = null, this.name = null, this.theme = "edit_table_default", this.onInput = null, this.nav = {}, this.W = null, this.D = [], e = e || {}; for (var t in e)
|
|
1231
|
+
this[t] = e[t]; };
|
|
1232
|
+
s.prototype.create = function () { var e = this, t = document.createElement("div"); t.className = this.theme + "_main", t.style.position = "relative"; var i = document.createElement("input"); i.type = "hidden", i.name = e.name, i.table = this, t.appendChild(i); var a = document.createElement("div"); a.className = this.theme + "_table"; var n = this.X(); a.appendChild(n); var o = e.Y({}); o.spacer = !0; var l = this.Z(o); l.classList.add(e.theme + "_spacer"), a.appendChild(l); var d = document.createElement("div"); d.className = e.theme + "_tbody", a.appendChild(d), t.appendChild(a); var r = document.createElement("div"); t.appendChild(r), this.nav.body = d, this.nav.table = a, this.nav.main = t, this.nav.after = r; var s = document.createElement("div"), c = document.createElement("span"); return c.className = this.theme + "_plus", c.addEventListener("click", function (t) { if (!e.disabled) {
|
|
1233
|
+
var i = e.item.onNewRow, a = {};
|
|
1234
|
+
if ("function" == typeof i) {
|
|
1235
|
+
var n = {};
|
|
1236
|
+
n.result = e.form.serialize(), n.value = {}, i(n), a = n.value;
|
|
1237
|
+
}
|
|
1238
|
+
var o = e.Y(a);
|
|
1239
|
+
e.D.push(o), e.$(), e._();
|
|
1240
|
+
} }), this.nav.plus = c, s.appendChild(c), t.appendChild(s), t; }, s.prototype.X = function () { var e = this, t = document.createElement("div"); return t.classList.add(this.theme + "_row"), t.classList.add(this.theme + "_header"), this.item.columns.forEach(function (i) { var a = document.createElement("div"); a.classList.add(e.theme + "_cell"), a.innerText = i.name, t.appendChild(a); }), t; }, s.prototype.aa = function () { var e = this.item.max || 0; return !!(e && this.D.length >= e); }, s.prototype.save = function () { var e = this, t = []; return e.D.forEach(function (e) { var i = {}; e.cells.forEach(function (e) { i[e.id] = e.value; }), t.push(i); }), t; }, s.prototype.load = function (e) { if ("[object Array]" !== Object.prototype.toString.call(e))
|
|
1241
|
+
throw new Error("Array expected"); this.data = e, this.ba(), this.$(); }, s.prototype.ca = function () { this.disabled ? this.nav.main.classList.add(this.theme + "_disabled") : this.nav.main.classList.remove(this.theme + "_disabled"), this.aa() ? this.nav.plus.classList.add(this.theme + "_plus_max") : this.nav.plus.classList.remove(this.theme + "_plus_max"); }, s.prototype.ba = function () { var e = this; this.D = [], this.data.forEach(function (t) { var i = e.Y(t); e.D.push(i); }); }, s.prototype.da = function (e) { var t = this, i = t.D.indexOf(e); t.D.splice(i, 1); }, s.prototype.Y = function (e) { var t = this, i = {}; return i.data = e, i.cells = [], t.item.columns.forEach(function (a) { var n = a.id, o = e[n], l = t.ea(a); if ("undefined" == typeof o)
|
|
1242
|
+
if ("text" === l)
|
|
1243
|
+
o = "";
|
|
1244
|
+
else if ("number" === l)
|
|
1245
|
+
o = 0;
|
|
1246
|
+
else if ("select" === l) {
|
|
1247
|
+
var d = a.options;
|
|
1248
|
+
o = d && d[0].id;
|
|
1249
|
+
} var r = {}; r.id = n, r.value = o, r.type = l, r.data = a, i.cells.push(r); }), i; }, s.prototype.ea = function (e) { var t = e.type; return t || (t = e.options ? "select" : "text"), t; }, s.prototype.$ = function () { var e = this; if (this.nav.body.innerHTML = "", this.nav.after.innerHTML = "", this.D.forEach(function (t) { var i = e.Z(t); e.nav.body.appendChild(i); }), 0 === this.D.length) {
|
|
1250
|
+
var t = e.fa();
|
|
1251
|
+
e.nav.after.appendChild(t);
|
|
1252
|
+
} this.ca(); }, s.prototype.fa = function () { var e = document.createElement("div"); return e.className = this.theme + "_empty", e; }, s.prototype.Z = function (e) { var t = this, i = document.createElement("div"); i.className = t.theme + "_row", e.cells.forEach(function (a) { var n = document.createElement("div"); n.className = t.theme + "_cell"; var o = t.ga(a); if (e.spacer) {
|
|
1253
|
+
var l = document.createElement("div");
|
|
1254
|
+
l.style.height = "0px", l.style.overflow = "hidden", l.appendChild(o), n.appendChild(l);
|
|
1255
|
+
}
|
|
1256
|
+
else
|
|
1257
|
+
n.appendChild(o); i.appendChild(n); }); var a = document.createElement("div"); a.classList.add(t.theme + "_cell"), a.classList.add(t.theme + "_rowaction"); var n = document.createElement("span"); return n.className = this.theme + "_delete", n.addEventListener("click", function (i) { t.disabled || (t.da(e), t.$(), t._()); }), e.spacer || a.appendChild(n), i.appendChild(a), i; }, s.prototype._ = function () { var e = this; if ("function" == typeof e.onInput) {
|
|
1258
|
+
var t = {};
|
|
1259
|
+
e.onInput(t);
|
|
1260
|
+
} }, s.prototype.ga = function (e) { var t = this, i = e.type; if ("text" === i || "number" === i) {
|
|
1261
|
+
var a = document.createElement("input");
|
|
1262
|
+
return a.type = i, t.disabled && (a.disabled = !0), e.value && (a.value = e.value), a.addEventListener("keyup", function (a) { "number" === i ? e.value = Number(this.value) : e.value = this.value, t._(); }), a;
|
|
1263
|
+
} if ("select" === i) {
|
|
1264
|
+
var n = document.createElement("select");
|
|
1265
|
+
return t.disabled && (n.disabled = !0), e.data.options.forEach(function (t) { var i = document.createElement("option"); i.innerText = t.name, i.value = t.id, i.K = t.id, n.appendChild(i), e.value === t.id && i.setAttribute("selected", !0); }), n.addEventListener("change", function (i) { var a = n.options[n.selectedIndex]; a && "undefined" != typeof a.K && (e.value = a.K), t._(); }), n;
|
|
1266
|
+
} throw new Error("Unsupported item type: " + i); }, s.prototype.focus = function () { };
|
|
1267
|
+
}
|
|
1268
|
+
}(DayPilot);
|
|
1269
|
+
if ("undefined" == typeof DayPilot)
|
|
1270
|
+
var DayPilot = {};
|
|
1271
|
+
"undefined" == typeof DayPilot.Global && (DayPilot.Global = {}), function () { if ("undefined" == typeof DayPilot.Month || !DayPilot.Month.events) {
|
|
1272
|
+
var t = {};
|
|
1273
|
+
t.Month = function (e, i) { this.v = "2021.4.338-lite", this.nav = {}; var n = this; this.id = e, this.isMonth = !0, this.api = 2, this.backendUrl = null, this.cellHeaderHeight = 24, this.cellHeight = 100, this.cssClassPrefix = "month_default", this.eventHeight = 30, this.eventsLoadMethod = "GET", this.a = !0, this.headerHeight = 30, this.hideUntilInit = !0, this.lineSpace = 1, this.locale = "en-us", this.showToolTip = !0, this.startDate = new DayPilot.Date, this.theme = null, this.visible = !0, this.weekStarts = 1, this.width = "100%", this.afterRender = function () { }, this.eventClickHandling = "Enabled", this.eventMoveHandling = "Update", this.eventResizeHandling = "Update", this.timeRangeSelectedHandling = "Enabled", this.onEventClick = null, this.onEventClicked = null, this.onEventMove = null, this.onEventMoved = null, this.onEventResize = null, this.onEventResized = null, this.onTimeRangeSelect = null, this.onTimeRangeSelected = null, this.cellEvents = [], this.elements = {}, this.elements.events = [], this.cache = {}, this.b = function (t, e) { var t = JSON.parse(t); return t.CallBackRedirect ? void (document.location.href = t.CallBackRedirect) : "None" === t.UpdateType ? void n.fireAfterRenderDetached(t.CallBackData, !0) : (n.events.list = t.Events, "Full" === t.UpdateType && (n.startDate = t.StartDate, n.timeFormat = t.TimeFormat ? t.TimeFormat : n.timeFormat, "undefined" != typeof t.WeekStarts && (n.weekStarts = t.WeekStarts), n.hashes = t.Hashes), n.c(), n.d(), n.f(), "Full" === t.UpdateType && (n.g(), n.h()), n.i(), n.show(), n.j(), void n.fireAfterRenderDetached(t.CallBackData, !0)); }, this.fireAfterRenderDetached = function (t, e) { var i = function (t, e) { return function () { n.afterRender && n.afterRender(t, e); }; }; window.setTimeout(i(t, e), 0); }, this.lineHeight = function () { return this.eventHeight + this.lineSpace; }, this.events = {}, this.events.add = function (t) { t.calendar = n, n.events.list || (n.events.list = []), n.events.list.push(t.data), n.update(), n.k.notify(); }, this.events.update = function (t) { t.commit(), n.update(), n.k.notify(); }, this.events.remove = function (t) { var e = DayPilot.indexOf(n.events.list, t.data); n.events.list.splice(e, 1), n.update(), n.k.notify(); }, this.events.load = function (t, e, i) { var s = function (t) { var e = {}; e.exception = t.exception, e.request = t.request, "function" == typeof i && i(e); }, a = function (t) { var i, a = t.request; try {
|
|
1274
|
+
i = JSON.parse(a.responseText);
|
|
1275
|
+
}
|
|
1276
|
+
catch (t) {
|
|
1277
|
+
var l = {};
|
|
1278
|
+
return l.exception = t, void s(l);
|
|
1279
|
+
} if (DayPilot.isArray(i)) {
|
|
1280
|
+
var o = {};
|
|
1281
|
+
if (o.preventDefault = function () { this.preventDefault.value = !0; }, o.data = i, "function" == typeof e && e(o), o.preventDefault.value)
|
|
1282
|
+
return;
|
|
1283
|
+
n.events.list = i, n.l && n.update();
|
|
1284
|
+
} }; if (n.eventsLoadMethod && "POST" === n.eventsLoadMethod.toUpperCase())
|
|
1285
|
+
DayPilot.Http.ajax({ "method": "POST", "data": { "start": n.visibleStart().toString(), "end": n.visibleEnd().toString() }, "url": t, "success": a, "error": s });
|
|
1286
|
+
else {
|
|
1287
|
+
var l = t, o = "start=" + n.visibleStart().toString() + "&end=" + n.visibleEnd().toString();
|
|
1288
|
+
l += l.indexOf("?") > -1 ? "&" + o : "?" + o, DayPilot.Http.ajax({ "method": "GET", "url": l, "success": a, "error": s });
|
|
1289
|
+
} }, this.update = function (t) { if (this.cells) {
|
|
1290
|
+
this.m(), n.n(t), n.c(), n.d(), n.f(), n.g(), n.h(), n.i(), n.o(), n.j(), this.visible ? this.show() : this.hide();
|
|
1291
|
+
} }, this.p = null, this.n = function (t) { if (t) {
|
|
1292
|
+
var e = { "events": { "preInit": function () { var t = this.data; t && (DayPilot.isArray(t.list) ? n.events.list = t.list : n.events.list = t); } } };
|
|
1293
|
+
this.p = e;
|
|
1294
|
+
for (var i in t)
|
|
1295
|
+
if (e[i]) {
|
|
1296
|
+
var s = e[i];
|
|
1297
|
+
s.data = t[i], s.preInit && s.preInit();
|
|
1298
|
+
}
|
|
1299
|
+
else
|
|
1300
|
+
n[i] = t[i];
|
|
1301
|
+
} }, this.q = function () { var t = this.p; for (var e in t) {
|
|
1302
|
+
var i = t[e];
|
|
1303
|
+
i.postInit && i.postInit();
|
|
1304
|
+
} }, this.r = {}, this.r.events = [], this.s = function (t) { var e = this.r.events, i = this.events.list[t], n = {}; for (var s in i)
|
|
1305
|
+
n[s] = i[s]; if ("function" == typeof this.onBeforeEventRender) {
|
|
1306
|
+
var a = {};
|
|
1307
|
+
a.data = n, this.onBeforeEventRender(a);
|
|
1308
|
+
} e[t] = n; }, this.f = function () { var t = this.events.list; if (t) {
|
|
1309
|
+
if ("function" == typeof this.onBeforeEventRender)
|
|
1310
|
+
for (var e = 0; e < t.length; e++)
|
|
1311
|
+
this.s(e);
|
|
1312
|
+
for (var i = 0; i < t.length; i++) {
|
|
1313
|
+
var n = t[i];
|
|
1314
|
+
if (n.start = new DayPilot.Date(n.start), n.end = new DayPilot.Date(n.end), !(n.start.getTime() > n.end.getTime()))
|
|
1315
|
+
for (var e = 0; e < this.rows.length; e++) {
|
|
1316
|
+
var s = this.rows[e], a = new DayPilot.Event(n, this);
|
|
1317
|
+
s.belongsHere(a) && (s.events.push(a), "function" == typeof this.onBeforeEventRender && (a.cache = this.r.events[i]));
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
for (var l = 0; l < this.rows.length; l++) {
|
|
1321
|
+
var s = this.rows[l];
|
|
1322
|
+
s.events.sort(this.t);
|
|
1323
|
+
for (var o = 0; o < this.rows[l].events.length; o++) {
|
|
1324
|
+
var r = s.events[o], h = s.getStartColumn(r), d = s.getWidth(r);
|
|
1325
|
+
s.putIntoLine(r, h, d, l);
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
} }, this.c = function () { for (var t = 0; t < this.elements.events.length; t++) {
|
|
1329
|
+
var e = this.elements.events[t];
|
|
1330
|
+
e.event = null, e.click = null, e.parentNode.removeChild(e);
|
|
1331
|
+
} this.elements.events = []; }, this.j = function () { this.u(); }, this.u = function () { this.elements.events = []; for (var t = 0; t < this.rows.length; t++)
|
|
1332
|
+
for (var e = this.rows[t], i = 0; i < e.lines.length; i++)
|
|
1333
|
+
for (var n = e.lines[i], s = 0; s < n.length; s++)
|
|
1334
|
+
this.w(n[s]); }, this.t = function (t, e) { if (!(t && e && t.start && e.start))
|
|
1335
|
+
return 0; var i = t.start().getTime() - e.start().getTime(); return 0 !== i ? i : e.end().getTime() - t.end().getTime(); }, this.drawShadow = function (e, i, n, s, a, l) { a || (a = 0); var o = s; this.shadow = {}, this.shadow.list = [], this.shadow.start = { x: e, y: i }, this.shadow.width = s; var r = 7 * i + e - a; r < 0 && (o += r, e = 0, i = 0); for (var h = a; h >= 7;)
|
|
1336
|
+
i--, h -= 7; if (h > e) {
|
|
1337
|
+
h > e + (7 - this.getColCount()) ? (i--, e = e + 7 - h) : (o = o - h + e, e = 0);
|
|
1338
|
+
}
|
|
1339
|
+
else
|
|
1340
|
+
e -= h; i < 0 && (i = 0, e = 0); var d = null; for (t.resizingEvent ? d = "w-resize" : t.movingEvent && (d = "move"), this.nav.top.style.cursor = d; o > 0 && i < this.rows.length;) {
|
|
1341
|
+
var c = Math.min(this.getColCount() - e, o), v = this.rows[i], u = this.getRowTop(i), f = v.getHeight(), p = document.createElement("div");
|
|
1342
|
+
p.setAttribute("unselectable", "on"), p.style.position = "absolute", p.style.left = this.getCellWidth() * e + "%", p.style.width = this.getCellWidth() * c + "%", p.style.top = u + "px", p.style.height = f + "px", p.style.cursor = d;
|
|
1343
|
+
var g = document.createElement("div");
|
|
1344
|
+
g.setAttribute("unselectable", "on"), p.appendChild(g), g.style.position = "absolute", g.style.top = "0px", g.style.right = "0px", g.style.left = "0px", g.style.bottom = "0px", g.style.backgroundColor = "#aaaaaa", g.style.opacity = .5, g.style.filter = "alpha(opacity=50)", this.nav.top.appendChild(p), this.shadow.list.push(p), o -= c + 7 - this.getColCount(), e = 0, i++;
|
|
1345
|
+
} }, this.clearShadow = function () { if (this.shadow) {
|
|
1346
|
+
for (var t = 0; t < this.shadow.list.length; t++)
|
|
1347
|
+
this.nav.top.removeChild(this.shadow.list[t]);
|
|
1348
|
+
this.shadow = null, this.nav.top.style.cursor = "";
|
|
1349
|
+
} }, this.getEventTop = function (t, e) { for (var i = this.headerHeight, n = 0; n < t; n++)
|
|
1350
|
+
i += this.rows[n].getHeight(); return i += this.cellHeaderHeight, i += e * this.lineHeight(); }, this.getDateFromCell = function (t, e) { return this.firstDate.addDays(7 * e + t); }, this.w = function (e) { var i = e.cache || e.data, s = e.part.row, a = e.part.line, l = e.part.colStart, o = e.part.colWidth, r = this.getCellWidth() * l, h = this.getCellWidth() * o, d = this.getEventTop(s, a), c = document.createElement("div"); c.setAttribute("unselectable", "on"), c.style.height = this.eventHeight + "px", c.className = this.z("_event"), i.cssClass && DayPilot.Util.addClass(c, i.cssClass), c.event = e, c.style.width = h + "%", c.style.position = "absolute", c.style.left = r + "%", c.style.top = d + "px", this.showToolTip && e.client.toolTip() && (c.title = e.client.toolTip()), c.onclick = n.A, c.onmousedown = function (i) { i = i || window.event; var r = i.which || i.button; if (i.cancelBubble = !0, i.stopPropagation && i.stopPropagation(), 1 === r)
|
|
1351
|
+
if (t.movingEvent = null, "w-resize" === this.style.cursor || "e-resize" === this.style.cursor) {
|
|
1352
|
+
var h = {};
|
|
1353
|
+
h.start = {}, h.start.x = l, h.start.y = s, h.event = c.event, h.width = DayPilot.DateUtil.daysSpan(h.event.start(), h.event.end()) + 1, h.direction = this.style.cursor, t.resizingEvent = h;
|
|
1354
|
+
}
|
|
1355
|
+
else if ("move" === this.style.cursor || "Disabled" !== n.eventMoveHandling) {
|
|
1356
|
+
n.clearShadow();
|
|
1357
|
+
var d = DayPilot.mo2(n.nav.top, i);
|
|
1358
|
+
if (!d)
|
|
1359
|
+
return;
|
|
1360
|
+
var v = n.getCellBelowPoint(d.x, d.y), u = DayPilot.DateUtil.daysDiff(e.start(), n.rows[s].start), f = 7 * v.y + v.x - (7 * s + l);
|
|
1361
|
+
u && (f += u);
|
|
1362
|
+
var p = {};
|
|
1363
|
+
p.start = {}, p.start.x = l, p.start.y = s, p.start.line = a, p.offset = n.eventMoveToPosition ? 0 : f, p.colWidth = o, p.event = c.event, p.coords = d, t.movingEvent = p;
|
|
1364
|
+
} }, c.onmousemove = function (i) { if ("undefined" != typeof t && !t.movingEvent && !t.resizingEvent) {
|
|
1365
|
+
var s = DayPilot.mo3(c, i);
|
|
1366
|
+
if (s) {
|
|
1367
|
+
var a = 6;
|
|
1368
|
+
s.x <= a && "Disabled" !== n.eventResizeHandling ? e.part.startsHere ? (c.style.cursor = "w-resize", c.dpBorder = "left") : c.style.cursor = "not-allowed" : c.clientWidth - s.x <= a && "Disabled" !== n.eventResizeHandling ? e.part.endsHere ? (c.style.cursor = "e-resize", c.dpBorder = "right") : c.style.cursor = "not-allowed" : c.style.cursor = "default";
|
|
1369
|
+
}
|
|
1370
|
+
} }, c.onmouseout = function (t) { c.style.cursor = ""; }; var v = document.createElement("div"); v.setAttribute("unselectable", "on"), v.className = this.z("_event_inner"), i.borderColor && (v.style.borderColor = i.borderColor), i.backColor && (v.style.background = i.backColor, (DayPilot.browser.ie9 || DayPilot.browser.ielt9) && (v.style.filter = "")), i.fontColor && (v.style.color = i.fontColor), v.innerHTML = e.client.html(), c.appendChild(v), this.elements.events.push(c), this.nav.events.appendChild(c); }, this.lastVisibleDayOfMonth = function () { return this.startDate.lastDayOfMonth(); }, this.d = function () { "string" == typeof this.startDate && (this.startDate = new DayPilot.Date(this.startDate)), this.startDate = this.startDate.firstDayOfMonth(), this.firstDate = this.startDate.firstDayOfWeek(this.getWeekStart()); var t, e = (this.startDate, this.lastVisibleDayOfMonth()), i = DayPilot.DateUtil.daysDiff(this.firstDate, e) + 1; t = Math.ceil(i / 7), this.days = 7 * t, this.rows = []; for (var s = 0; s < t; s++) {
|
|
1371
|
+
var a = {};
|
|
1372
|
+
a.start = this.firstDate.addDays(7 * s), a.end = a.start.addDays(this.getColCount()), a.events = [], a.lines = [], a.index = s, a.minHeight = this.cellHeight, a.calendar = this, a.belongsHere = function (t) { return t.end().getTime() === t.start().getTime() && t.start().getTime() === this.start.getTime() || !(t.end().getTime() <= this.start.getTime() || t.start().getTime() >= this.end.getTime()); }, a.getPartStart = function (t) { return DayPilot.DateUtil.max(this.start, t.start()); }, a.getPartEnd = function (t) { return DayPilot.DateUtil.min(this.end, t.end()); }, a.getStartColumn = function (t) { var e = this.getPartStart(t); return DayPilot.DateUtil.daysDiff(this.start, e); }, a.getWidth = function (t) { return DayPilot.DateUtil.daysSpan(this.getPartStart(t), this.getPartEnd(t)) + 1; }, a.putIntoLine = function (t, e, i, n) { for (var s = this, a = 0; a < this.lines.length; a++) {
|
|
1373
|
+
var l = this.lines[a];
|
|
1374
|
+
if (l.isFree(e, i))
|
|
1375
|
+
return l.addEvent(t, e, i, n, a), a;
|
|
1376
|
+
} var l = []; return l.isFree = function (t, e) { for (var i = !0, n = 0; n < this.length; n++)
|
|
1377
|
+
t + e - 1 < this[n].part.colStart || t > this[n].part.colStart + this[n].part.colWidth - 1 || (i = !1); return i; }, l.addEvent = function (t, e, i, n, a) { t.part.colStart = e, t.part.colWidth = i, t.part.row = n, t.part.line = a, t.part.startsHere = s.start.getTime() <= t.start().getTime(), t.part.endsHere = s.end.getTime() >= t.end().getTime(), this.push(t); }, l.addEvent(t, e, i, n, this.lines.length), this.lines.push(l), this.lines.length - 1; }, a.getStart = function () { for (var t = 0, e = 0; e < n.rows.length && e < this.index; e++)
|
|
1378
|
+
t += n.rows[e].getHeight(); }, a.getHeight = function () { return Math.max(this.lines.length * n.lineHeight() + n.cellHeaderHeight, this.calendar.cellHeight); }, this.rows.push(a);
|
|
1379
|
+
} this.endDate = this.firstDate.addDays(7 * t); }, this.visibleStart = function () { return n.firstDate; }, this.visibleEnd = function () { return n.endDate; }, this.getHeight = function () { for (var t = this.headerHeight, e = 0; e < this.rows.length; e++)
|
|
1380
|
+
t += this.rows[e].getHeight(); return t; }, this.getWidth = function (t, e) { return 7 * e.y + e.x - (7 * t.y + t.x) + 1; }, this.getMinCoords = function (t, e) { return 7 * t.y + t.x < 7 * e.y + e.x ? t : e; }, this.z = function (t) { var e = this.theme || this.cssClassPrefix; return e ? e + t : ""; }, this.B = function () { var e = this.nav.top; e.setAttribute("unselectable", "on"), e.style.MozUserSelect = "none", e.style.KhtmlUserSelect = "none", e.style.WebkitUserSelect = "none", e.style.position = "relative", this.width && (e.style.width = this.width), e.style.height = this.getHeight() + "px", e.onselectstart = function (t) { return !1; }, this.hideUntilInit && (e.style.visibility = "hidden"), this.visible || (e.style.display = "none"), e.className = this.z("_main"); var i = document.createElement("div"); this.nav.cells = i, i.style.position = "absolute", i.style.left = "0px", i.style.right = "0px", i.setAttribute("unselectable", "on"), e.appendChild(i); var s = document.createElement("div"); this.nav.events = s, s.style.position = "absolute", s.style.left = "0px", s.style.right = "0px", s.setAttribute("unselectable", "on"), e.appendChild(s), e.onmousemove = function (e) { if (t.resizingEvent) {
|
|
1381
|
+
var i = DayPilot.mo2(n.nav.top, e);
|
|
1382
|
+
if (!i)
|
|
1383
|
+
return;
|
|
1384
|
+
var s = n.getCellBelowPoint(i.x, i.y);
|
|
1385
|
+
n.clearShadow();
|
|
1386
|
+
var a, l, o = t.resizingEvent;
|
|
1387
|
+
o.start;
|
|
1388
|
+
if ("w-resize" === o.direction) {
|
|
1389
|
+
l = s;
|
|
1390
|
+
var r = o.event.end();
|
|
1391
|
+
r.getDatePart() === r && (r = r.addDays(-1));
|
|
1392
|
+
var h = n.getCellFromDate(r);
|
|
1393
|
+
a = n.getWidth(s, h);
|
|
1394
|
+
}
|
|
1395
|
+
else
|
|
1396
|
+
l = n.getCellFromDate(o.event.start()), a = n.getWidth(l, s);
|
|
1397
|
+
a < 1 && (a = 1), n.drawShadow(l.x, l.y, 0, a);
|
|
1398
|
+
}
|
|
1399
|
+
else if (t.movingEvent) {
|
|
1400
|
+
var i = DayPilot.mo2(n.nav.top, e);
|
|
1401
|
+
if (!i)
|
|
1402
|
+
return;
|
|
1403
|
+
if (i.x === t.movingEvent.coords.x && i.y === t.movingEvent.coords.y)
|
|
1404
|
+
return;
|
|
1405
|
+
var s = n.getCellBelowPoint(i.x, i.y);
|
|
1406
|
+
n.clearShadow();
|
|
1407
|
+
var d = t.movingEvent.event, c = t.movingEvent.offset, a = n.cellMode ? 1 : DayPilot.DateUtil.daysSpan(d.start(), d.end()) + 1;
|
|
1408
|
+
a < 1 && (a = 1), n.drawShadow(s.x, s.y, 0, a, c, d);
|
|
1409
|
+
}
|
|
1410
|
+
else if (t.timeRangeSelecting) {
|
|
1411
|
+
var i = DayPilot.mo2(n.nav.top, e);
|
|
1412
|
+
if (!i)
|
|
1413
|
+
return;
|
|
1414
|
+
var s = n.getCellBelowPoint(i.x, i.y);
|
|
1415
|
+
n.clearShadow();
|
|
1416
|
+
var l = t.timeRangeSelecting, v = 7 * l.y + l.x, u = 7 * s.y + s.x, a = Math.abs(u - v) + 1;
|
|
1417
|
+
a < 1 && (a = 1);
|
|
1418
|
+
var f = v < u ? l : s;
|
|
1419
|
+
t.timeRangeSelecting.from = { x: f.x, y: f.y }, t.timeRangeSelecting.width = a, t.timeRangeSelecting.moved = !0, n.drawShadow(f.x, f.y, 0, a, 0, null);
|
|
1420
|
+
} }; }, this.i = function () { this.nav.top.style.height = this.getHeight() + "px"; for (var t = 0; t < this.cells.length; t++)
|
|
1421
|
+
for (var e = 0; e < this.cells[t].length; e++)
|
|
1422
|
+
this.cells[t][e].style.top = this.getRowTop(e) + "px", this.cells[t][e].style.height = this.rows[e].getHeight() + "px"; }, this.getCellBelowPoint = function (t, e) { for (var i = Math.floor(this.nav.top.clientWidth / this.getColCount()), n = Math.min(Math.floor(t / i), this.getColCount() - 1), s = null, a = this.headerHeight, l = 0, o = 0; o < this.rows.length; o++) {
|
|
1423
|
+
var r = a;
|
|
1424
|
+
if (a += this.rows[o].getHeight(), e < a) {
|
|
1425
|
+
l = e - r, s = o;
|
|
1426
|
+
break;
|
|
1427
|
+
}
|
|
1428
|
+
} null === s && (s = this.rows.length - 1); var h = {}; return h.x = n, h.y = s, h.relativeY = l, h; }, this.getCellFromDate = function (t) { for (var e = DayPilot.DateUtil.daysDiff(this.firstDate, t), i = { x: 0, y: 0 }; e >= 7;)
|
|
1429
|
+
i.y++, e -= 7; return i.x = e, i; }, this.h = function () { var t = document.createElement("div"); t.oncontextmenu = function () { return !1; }, this.nav.cells.appendChild(t), this.cells = []; for (var e = 0; e < this.getColCount(); e++) {
|
|
1430
|
+
this.cells[e] = [];
|
|
1431
|
+
var i = document.createElement("div");
|
|
1432
|
+
i.setAttribute("unselectable", "on"), i.style.position = "absolute", i.style.left = this.getCellWidth() * e + "%", i.style.width = this.getCellWidth() + "%", i.style.top = "0px", i.style.height = this.headerHeight + "px";
|
|
1433
|
+
var n = e + this.getWeekStart();
|
|
1434
|
+
n > 6 && (n -= 7), this.a && (i.className = this.z("_header"));
|
|
1435
|
+
var a = document.createElement("div");
|
|
1436
|
+
a.setAttribute("unselectable", "on"), a.innerHTML = s.locale().dayNames[n], i.appendChild(a), a.style.position = "absolute", a.style.top = "0px", a.style.bottom = "0px", a.style.left = "0px", a.style.right = "0px", a.className = this.z("_header_inner"), a.innerHTML = s.locale().dayNames[n], t.appendChild(i);
|
|
1437
|
+
for (var l = 0; l < this.rows.length; l++)
|
|
1438
|
+
this.drawCell(e, l, t);
|
|
1439
|
+
} }, this.g = function () { for (var t = 0; t < this.cells.length; t++)
|
|
1440
|
+
for (var e = 0; e < this.cells[t].length; e++)
|
|
1441
|
+
this.cells[t][e].onclick = null; this.nav.cells.innerHTML = ""; }, this.C = function () { return 2 === n.api; }, this.drawCell = function (e, i, a) { var l = this.rows[i], o = this.firstDate.addDays(7 * i + e), r = (this.cellProperties ? this.cellProperties[i * this.getColCount() + e] : null, document.createElement("div")); if (r.setAttribute("unselectable", "on"), r.style.position = "absolute", r.style.cursor = "default", r.style.left = this.getCellWidth() * e + "%", r.style.width = this.getCellWidth() + "%", r.style.top = this.getRowTop(i) + "px", r.style.height = l.getHeight() + "px", this.a && (r.className = this.z("_cell"), !this.isWeekend(o))) {
|
|
1442
|
+
var h = this.z("_cell_business");
|
|
1443
|
+
DayPilot.Util.addClass(r, h);
|
|
1444
|
+
} var d = (this.startDate.addMonths(-1).getMonth(), this.startDate.addMonths(1).getMonth(), this.startDate.getMonth(), document.createElement("div")); d.setAttribute("unselectable", "on"), r.appendChild(d), d.style.position = "absolute", d.style.left = "0px", d.style.right = "0px", d.style.top = "0px", d.style.bottom = "0px", d.className = this.z("_cell_inner"), r.onmousedown = function (s) { "Disabled" !== n.timeRangeSelectedHandling && (n.clearShadow(), t.timeRangeSelecting = { "root": n, "x": e, "y": i, "from": { x: e, y: i }, "width": 1 }); }, r.onclick = function () { var t = function (t) { var e = new DayPilot.Date(t), i = e.addDays(1); n.D(e, i); }; if ("Disabled" !== n.timeRangeSelectedHandling)
|
|
1445
|
+
return void t(o); }; var c = document.createElement("div"); c.setAttribute("unselectable", "on"), c.style.height = this.cellHeaderHeight + "px", c.className = this.z("_cell_header"); var v = o.getDay(); 1 === v ? c.innerHTML = s.locale().monthNames[o.getMonth()] + " " + v : c.innerHTML = v, d.appendChild(c), this.cells[e][i] = r, a.appendChild(r); }, this.getWeekStart = function () { return s.locale().weekStarts; }, this.getColCount = function () { return 7; }, this.getCellWidth = function () { return 14.285; }, this.getRowTop = function (t) { for (var e = this.headerHeight, i = 0; i < t; i++)
|
|
1446
|
+
e += this.rows[i].getHeight(); return e; }, this.E = function (t, e, i) { var n = {}; n.action = t, n.parameters = i, n.data = e, n.header = this.F(); var s = "JSON" + DayPilot.JSON.stringify(n); this.backendUrl && DayPilot.request(this.backendUrl, this.G, s, this.ajaxError); }, this.G = function (t) { n.b(t.responseText); }, this.F = function () { var t = {}; return t.control = "dpm", t.id = this.id, t.v = this.v, t.visibleStart = new DayPilot.Date(this.firstDate), t.visibleEnd = t.visibleStart.addDays(this.days), t.startDate = n.startDate, t.timeFormat = this.timeFormat, t.weekStarts = this.weekStarts, t; }, this.eventClickCallBack = function (t, e) { this.E("EventClick", e, t); }, this.A = function (e) { t.movingEvent = null, t.resizingEvent = null; var i = this, e = e || window.event; e.ctrlKey; e.cancelBubble = !0, e.stopPropagation && e.stopPropagation(), n.eventClickSingle(i, e); }, this.eventClickSingle = function (t, e) { var i = t.event; if (i.client.clickEnabled())
|
|
1447
|
+
if (n.C()) {
|
|
1448
|
+
var s = {};
|
|
1449
|
+
if (s.e = i, s.control = n, s.div = t, s.originalEvent = e, s.meta = e.metaKey, s.ctrl = e.ctrlKey, s.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof n.onEventClick && (n.k.apply(function () { n.onEventClick(s); }), s.preventDefault.value))
|
|
1450
|
+
return;
|
|
1451
|
+
switch (n.eventClickHandling) {
|
|
1452
|
+
case "CallBack": n.eventClickCallBack(i);
|
|
1453
|
+
}
|
|
1454
|
+
"function" == typeof n.onEventClicked && n.k.apply(function () { n.onEventClicked(s); });
|
|
1455
|
+
}
|
|
1456
|
+
else
|
|
1457
|
+
switch (n.eventClickHandling) {
|
|
1458
|
+
case "CallBack":
|
|
1459
|
+
n.eventClickCallBack(i);
|
|
1460
|
+
break;
|
|
1461
|
+
case "JavaScript": n.onEventClick(i);
|
|
1462
|
+
} }, this.eventMoveCallBack = function (t, e, i, n, s) { if (!e)
|
|
1463
|
+
throw "newStart is null"; if (!i)
|
|
1464
|
+
throw "newEnd is null"; var a = {}; a.e = t, a.newStart = e, a.newEnd = i, a.position = s, this.E("EventMove", n, a); }, this.H = function (t, e, i, s, a, l) { var o = t.start().getTimePart(), r = t.end().getDatePart(); r !== t.end() && (r = r.addDays(1)); var h = DayPilot.DateUtil.diff(t.end(), r), d = this.getDateFromCell(e, i); d = d.addDays(-s); var c = DayPilot.DateUtil.daysSpan(t.start(), t.end()) + 1, v = d.addDays(c), u = d.addTime(o), f = v.addTime(h); if (n.C()) {
|
|
1465
|
+
var p = {};
|
|
1466
|
+
if (p.e = t, p.control = n, p.newStart = u, p.newEnd = f, p.ctrl = a.ctrlKey, p.shift = a.shiftKey, p.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof n.onEventMove && (n.k.apply(function () { n.onEventMove(p); }), p.preventDefault.value))
|
|
1467
|
+
return;
|
|
1468
|
+
switch (n.eventMoveHandling) {
|
|
1469
|
+
case "CallBack":
|
|
1470
|
+
n.eventMoveCallBack(t, u, f);
|
|
1471
|
+
break;
|
|
1472
|
+
case "Update": t.start(u), t.end(f), n.events.update(t);
|
|
1473
|
+
}
|
|
1474
|
+
"function" == typeof n.onEventMoved && n.k.apply(function () { n.onEventMoved(p); });
|
|
1475
|
+
}
|
|
1476
|
+
else
|
|
1477
|
+
switch (n.eventMoveHandling) {
|
|
1478
|
+
case "CallBack":
|
|
1479
|
+
n.eventMoveCallBack(t, u, f);
|
|
1480
|
+
break;
|
|
1481
|
+
case "JavaScript": n.onEventMove(t, u, f);
|
|
1482
|
+
} }, this.eventResizeCallBack = function (t, e, i, n) { if (!e)
|
|
1483
|
+
throw "newStart is null"; if (!i)
|
|
1484
|
+
throw "newEnd is null"; var s = {}; s.e = t, s.newStart = e, s.newEnd = i, this.E("EventResize", n, s); }, this.I = function (t, e, i) { var s = t.start().getTimePart(), a = t.end().getDatePart(); a !== t.end() && (a = a.addDays(1)); var l = DayPilot.DateUtil.diff(t.end(), a), o = this.getDateFromCell(e.x, e.y), r = o.addDays(i), h = o.addTime(s), d = r.addTime(l); if (n.C()) {
|
|
1485
|
+
var c = {};
|
|
1486
|
+
if (c.e = t, c.control = n, c.newStart = h, c.newEnd = d, c.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof n.onEventResize && (n.k.apply(function () { n.onEventResize(c); }), c.preventDefault.value))
|
|
1487
|
+
return;
|
|
1488
|
+
switch (n.eventResizeHandling) {
|
|
1489
|
+
case "CallBack":
|
|
1490
|
+
n.eventResizeCallBack(t, h, d);
|
|
1491
|
+
break;
|
|
1492
|
+
case "Update": t.start(h), t.end(d), n.events.update(t);
|
|
1493
|
+
}
|
|
1494
|
+
"function" == typeof n.onEventResized && n.k.apply(function () { n.onEventResized(c); });
|
|
1495
|
+
}
|
|
1496
|
+
else
|
|
1497
|
+
switch (n.eventResizeHandling) {
|
|
1498
|
+
case "CallBack":
|
|
1499
|
+
n.eventResizeCallBack(t, h, d);
|
|
1500
|
+
break;
|
|
1501
|
+
case "JavaScript": n.onEventResize(t, h, d);
|
|
1502
|
+
} }, this.timeRangeSelectedCallBack = function (t, e, i) { var n = {}; n.start = t, n.end = e, this.E("TimeRangeSelected", i, n); }, this.D = function (t, e) { if (this.C()) {
|
|
1503
|
+
var i = {};
|
|
1504
|
+
if (i.control = n, i.start = t, i.end = e, i.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof n.onTimeRangeSelect && (n.k.apply(function () { n.onTimeRangeSelect(i); }), i.preventDefault.value))
|
|
1505
|
+
return;
|
|
1506
|
+
switch (n.timeRangeSelectedHandling) {
|
|
1507
|
+
case "CallBack": n.timeRangeSelectedCallBack(t, e);
|
|
1508
|
+
}
|
|
1509
|
+
"function" == typeof n.onTimeRangeSelected && n.k.apply(function () { n.onTimeRangeSelected(i); });
|
|
1510
|
+
}
|
|
1511
|
+
else
|
|
1512
|
+
switch (n.timeRangeSelectedHandling) {
|
|
1513
|
+
case "CallBack":
|
|
1514
|
+
n.timeRangeSelectedCallBack(t, e);
|
|
1515
|
+
break;
|
|
1516
|
+
case "JavaScript": n.onTimeRangeSelected(t, e);
|
|
1517
|
+
} }, this.k = {}, this.k.scope = null, this.k.notify = function () { n.k.scope && n.k.scope["$apply"](); }, this.k.apply = function (t) { t(); }, this.clearSelection = function () { n.clearShadow(); }, this.commandCallBack = function (t, e) { var i = {}; i.command = t, this.E("Command", e, i); }, this.isWeekend = function (t) { return t = new DayPilot.Date(t), 0 === t.dayOfWeek() || 6 === t.dayOfWeek(); }, this.J = {}, this.J.locale = function () { var t = DayPilot.Locale.find(n.locale); return t ? t : DayPilot.Locale.US; }; var s = this.J; this.debug = function (t, e) { this.debuggingEnabled && (n.debugMessages || (n.debugMessages = []), n.debugMessages.push(t), "undefined" != typeof console && console.log(t)); }, this.dispose = function () { var t = n; t.nav.top && (t.c(), t.nav.top.removeAttribute("style"), t.nav.top.removeAttribute("class"), t.nav.top.innerHTML = "", t.nav.top.dp = null, t.nav.top.onmousemove = null, t.nav.top = null); }, this.K = function () { t.globalHandlers || (t.globalHandlers = !0, DayPilot.re(document, "mouseup", t.gMouseUp)); }, this.loadFromServer = function () { return !(!this.backendUrl && "function" != typeof WebForm_DoCallback) && ("undefined" == typeof n.events.list || !n.events.list); }, this.o = function () { "hidden" === this.nav.top.style.visibility && (this.nav.top.style.visibility = "visible"); }, this.show = function () { n.visible = !0, n.nav.top.style.display = ""; }, this.hide = function () { n.visible = !1, n.nav.top.style.display = "none"; }, this.L = function () { if (this.id && this.id.tagName)
|
|
1518
|
+
this.nav.top = this.id;
|
|
1519
|
+
else {
|
|
1520
|
+
if ("string" != typeof this.id)
|
|
1521
|
+
throw "DayPilot.Month() constructor requires the target element or its ID as a parameter";
|
|
1522
|
+
if (this.nav.top = document.getElementById(this.id), !this.nav.top)
|
|
1523
|
+
throw "DayPilot.Month: The placeholder element not found: '" + id + "'.";
|
|
1524
|
+
} }, this.m = function () { n.a || (n.a = !0, window.console && window.console.log && window.console.log("DayPilot: cssOnly = false mode is not supported anymore.")); }, this.M = function () { this.d(), this.B(), this.h(), this.K(), this.E("Init"); }, this.init = function () { this.L(); var t = this.loadFromServer(); return this.m(), t ? void this.M() : (this.d(), this.f(), this.B(), this.h(), this.o(), this.j(), this.K(), this.messageHTML && this.message(this.messageHTML), void this.fireAfterRenderDetached(null, !1)); }, this.Init = this.init, this.n(i); }, t.gMouseUp = function (e) { if (t.movingEvent) {
|
|
1525
|
+
var i = t.movingEvent;
|
|
1526
|
+
if (!i.event)
|
|
1527
|
+
return;
|
|
1528
|
+
if (!i.event.calendar)
|
|
1529
|
+
return;
|
|
1530
|
+
if (!i.event.calendar.shadow)
|
|
1531
|
+
return;
|
|
1532
|
+
if (!i.event.calendar.shadow.start)
|
|
1533
|
+
return;
|
|
1534
|
+
var n = t.movingEvent.event.calendar, s = t.movingEvent.event, a = n.shadow.start, l = n.shadow.position, o = t.movingEvent.offset;
|
|
1535
|
+
n.clearShadow(), t.movingEvent = null;
|
|
1536
|
+
var e = e || window.event;
|
|
1537
|
+
return n.H(s, a.x, a.y, o, e, l), e.cancelBubble = !0, e.stopPropagation && e.stopPropagation(), t.movingEvent = null, !1;
|
|
1538
|
+
} if (t.resizingEvent) {
|
|
1539
|
+
var i = t.resizingEvent;
|
|
1540
|
+
if (!i.event)
|
|
1541
|
+
return;
|
|
1542
|
+
if (!i.event.calendar)
|
|
1543
|
+
return;
|
|
1544
|
+
if (!i.event.calendar.shadow)
|
|
1545
|
+
return;
|
|
1546
|
+
if (!i.event.calendar.shadow.start)
|
|
1547
|
+
return;
|
|
1548
|
+
var n = t.resizingEvent.event.calendar, s = t.resizingEvent.event, a = n.shadow.start, r = n.shadow.width;
|
|
1549
|
+
return n.clearShadow(), t.resizingEvent = null, n.I(s, a, r), e.cancelBubble = !0, t.resizingEvent = null, !1;
|
|
1550
|
+
} if (t.timeRangeSelecting) {
|
|
1551
|
+
if (t.timeRangeSelecting.moved) {
|
|
1552
|
+
var h = t.timeRangeSelecting, n = h.root, a = new DayPilot.Date(n.getDateFromCell(h.from.x, h.from.y)), d = a.addDays(h.width);
|
|
1553
|
+
n.D(a, d), n.clearShadow();
|
|
1554
|
+
}
|
|
1555
|
+
t.timeRangeSelecting = null;
|
|
1556
|
+
} }, DayPilot.Month = t.Month, "undefined" != typeof jQuery && !function (t) { t.fn.daypilotMonth = function (t) { var e = null, i = this.each(function () { if (!this.daypilot) {
|
|
1557
|
+
var i = new DayPilot.Month(this.id);
|
|
1558
|
+
this.daypilot = i;
|
|
1559
|
+
for (name in t)
|
|
1560
|
+
i[name] = t[name];
|
|
1561
|
+
i.Init(), e || (e = i);
|
|
1562
|
+
} }); return 1 === this.length ? e : i; }; }(jQuery), function () { var t = DayPilot.am(); t && t.directive("daypilotMonth", ["$parse", function (t) { return { "restrict": "E", "template": "<div></div>", "replace": !0, "link": function (e, i, n) { var s = new DayPilot.Month(i[0]); s.k.scope = e, s.init(); var a = n["id"]; a && (e[a] = s); var l = n["publishAs"]; if (l) {
|
|
1563
|
+
(0, t(l).assign)(e, s);
|
|
1564
|
+
} for (var o in n)
|
|
1565
|
+
0 === o.indexOf("on") && !function (i) { s[i] = function (s) { var a = t(n[i]); e["$apply"](function () { a(e, { "args": s }); }); }; }(o); var r = e["$watch"], h = n["config"] || n["daypilotConfig"], d = n["events"] || n["daypilotEvents"]; r.call(e, h, function (t) { for (var e in t)
|
|
1566
|
+
s[e] = t[e]; s.update(); }, !0), r.call(e, d, function (t) { s.events.list = t, s.update(); }, !0); } }; }]); }(), "undefined" != typeof Sys && Sys.Application && Sys.Application.notifyScriptLoaded && Sys.Application.notifyScriptLoaded();
|
|
1567
|
+
} }();
|
|
1568
|
+
if ("undefined" == typeof DayPilot)
|
|
1569
|
+
var DayPilot = {};
|
|
1570
|
+
"undefined" == typeof DayPilot.Global && (DayPilot.Global = {}), function () { if ("undefined" == typeof DayPilot.Navigator || !DayPilot.Navigator.nav) {
|
|
1571
|
+
DayPilot.Navigator = function (t, e) { this.v = "2021.4.338-lite"; var i = this; this.id = t, this.api = 2, this.isNavigator = !0, this.autoFocusOnClick = !0, this.weekStarts = "Auto", this.selectMode = "day", this.titleHeight = 30, this.dayHeaderHeight = 30, this.bound = null, this.cellWidth = 30, this.cellHeight = 30, this.cssOnly = !0, this.cssClassPrefix = "navigator_default", this.freeHandSelectionEnabled = !1, this.selectionStart = (new DayPilot.Date).getDatePart(), this.selectionEnd = null, this.selectionDay = null, this.showMonths = 1, this.skipMonths = 1, this.command = "navigate", this.year = (new DayPilot.Date).getYear(), this.month = (new DayPilot.Date).getMonth() + 1, this.showWeekNumbers = !1, this.weekNumberAlgorithm = "Auto", this.rowsPerMonth = "Six", this.orientation = "Vertical", this.locale = "en-us", this.rtl = !1, this.visible = !0, this.timeRangeSelectedHandling = "Bind", this.visibleRangeChangedHandling = "Enabled", this.onVisibleRangeChange = null, this.onVisibleRangeChanged = null, this.onTimeRangeSelect = null, this.onTimeRangeSelected = null, this.nav = {}, this.a = {}, this.b = function () { this.root.dp = this, this.cssOnly ? this.root.className = this.c("_main") : this.root.className = this.c("main"), "Horizontal" === this.orientation ? (this.root.style.width = this.showMonths * (7 * a.cellWidth() + this.d()) + "px", this.root.style.height = 6 * this.cellHeight + this.titleHeight + this.dayHeaderHeight + "px") : this.root.style.width = 7 * a.cellWidth() + this.d() + "px", this.rtl && (this.root.style.direction = "rtl"), this.root.style.position = "relative", this.visible || (this.root.style.display = "none"); var t = document.createElement("input"); t.type = "hidden", t.name = i.id + "_state", t.id = t.name, this.root.appendChild(t), this.state = t, this.startDate ? this.startDate = new DayPilot.Date(this.startDate).firstDayOfMonth() : this.startDate = DayPilot.Date.fromYearMonthDay(this.year, this.month), this.calendars = [], this.selected = [], this.months = []; }, this.e = function () { return 2 === i.api; }, this.f = function () { this.root.innerHTML = ""; }, this.c = function (t) { var e = this.theme || this.cssClassPrefix; return e ? e + t : ""; }, this.g = function (t, e) { var i = this.cssOnly ? this.c("_" + e) : this.c(e); DayPilot.Util.addClass(t, i); }, this.h = function (t, e) { var i = this.cssOnly ? this.c("_" + e) : this.c(e); DayPilot.Util.removeClass(t, i); }, this.i = function (t, e) { var s = {}; s.cells = [], s.days = [], s.weeks = []; var n = this.startDate.addMonths(t), l = e.before, o = e.after, h = n.firstDayOfMonth(), r = h.firstDayOfWeek(a.weekStarts()), c = h.addMonths(1), d = DayPilot.DateUtil.daysDiff(r, c), u = "Auto" === this.rowsPerMonth ? Math.ceil(d / 7) : 6; s.rowCount = u; var f = (new DayPilot.Date).getDatePart(), y = 7 * a.cellWidth() + this.d(); s.width = y; var p = this.cellHeight * u + this.titleHeight + this.dayHeaderHeight; s.height = p; var v = document.createElement("div"); if (v.style.width = y + "px", v.style.height = p + "px", "Horizontal" === this.orientation)
|
|
1572
|
+
v.style.position = "absolute", v.style.left = y * t + "px", v.style.top = "0px", s.top = 0, s.left = y * t;
|
|
1573
|
+
else {
|
|
1574
|
+
v.style.position = "relative";
|
|
1575
|
+
var m = t > 0 ? i.months[t - 1].top + i.months[t - 1].height : 0;
|
|
1576
|
+
s.top = m, s.left = 0;
|
|
1577
|
+
} this.cssOnly ? v.className = this.c("_month") : v.className = this.c("month"), v.style.cursor = "default", v.style.MozUserSelect = "none", v.style.KhtmlUserSelect = "none", v.style.WebkitUserSelect = "none", v.month = s, this.root.appendChild(v); var g = this.titleHeight + this.dayHeaderHeight, b = document.createElement("div"); b.style.position = "absolute", b.style.left = "0px", b.style.right = "0px", b.style.top = "0px", b.style.width = a.cellWidth() + "px", b.style.height = this.titleHeight + "px", b.style.lineHeight = this.titleHeight + "px", b.setAttribute("unselectable", "on"), this.cssOnly ? b.className = this.c("_titleleft") : b.className = this.c("titleleft"), e.left && (b.style.cursor = "pointer", b.innerHTML = "<span><</span>", b.onclick = this.j), v.appendChild(b), this.tl = b; var D = document.createElement("div"); D.style.position = "absolute", D.style.left = a.cellWidth() + "px", D.style.top = "0px", D.style.width = 5 * a.cellWidth() + this.d() + "px", D.style.height = this.titleHeight + "px", D.style.lineHeight = this.titleHeight + "px", D.setAttribute("unselectable", "on"), this.cssOnly ? D.className = this.c("_title") : D.className = this.c("title"), D.innerHTML = a.locale().monthNames[n.getMonth()] + " " + n.getYear(), v.appendChild(D), this.ti = D; var x = document.createElement("div"); x.style.position = "absolute", x.style.left = 6 * a.cellWidth() + this.d() + "px", x.style.right = 6 * a.cellWidth() + this.d() + "px", x.style.top = "0px", x.style.width = a.cellWidth() + "px", x.style.height = this.titleHeight + "px", x.style.lineHeight = this.titleHeight + "px", x.setAttribute("unselectable", "on"), this.cssOnly ? x.className = this.c("_titleright") : x.className = this.c("titleright"), e.right && (x.style.cursor = "pointer", x.innerHTML = "<span>></span>", x.onclick = this.k), v.appendChild(x), this.tr = x; var w = this.d(); if (this.showWeekNumbers)
|
|
1578
|
+
for (var k = 0; k < u; k++) {
|
|
1579
|
+
var S = r.addDays(7 * k), C = null;
|
|
1580
|
+
switch (this.weekNumberAlgorithm) {
|
|
1581
|
+
case "Auto":
|
|
1582
|
+
C = 1 === a.weekStarts() ? S.weekNumberISO() : S.weekNumber();
|
|
1583
|
+
break;
|
|
1584
|
+
case "US":
|
|
1585
|
+
C = S.weekNumber();
|
|
1586
|
+
break;
|
|
1587
|
+
case "ISO8601":
|
|
1588
|
+
C = S.weekNumberISO();
|
|
1589
|
+
break;
|
|
1590
|
+
default: throw "Unknown weekNumberAlgorithm value.";
|
|
1591
|
+
}
|
|
1592
|
+
var H = document.createElement("div");
|
|
1593
|
+
H.style.position = "absolute", H.style.left = "0px", H.style.right = "0px", H.style.top = k * this.cellHeight + g + "px", H.style.width = a.cellWidth() + "px", H.style.height = this.cellHeight + "px", H.style.lineHeight = this.cellHeight + "px", H.setAttribute("unselectable", "on"), this.cssOnly ? H.className = this.c("_weeknumber") : H.className = this.c("weeknumber"), H.innerHTML = "<span>" + C + "</span>", v.appendChild(H), s.weeks.push(H);
|
|
1594
|
+
} for (var P = 0; P < 7; P++) {
|
|
1595
|
+
s.cells[P] = [];
|
|
1596
|
+
var H = document.createElement("div");
|
|
1597
|
+
H.style.position = "absolute", H.style.left = P * a.cellWidth() + w + "px", H.style.right = P * a.cellWidth() + w + "px", H.style.top = this.titleHeight + "px", H.style.width = a.cellWidth() + "px", H.style.height = this.dayHeaderHeight + "px", H.style.lineHeight = this.dayHeaderHeight + "px", H.setAttribute("unselectable", "on"), this.cssOnly ? H.className = this.c("_dayheader") : H.className = this.c("dayheader"), H.innerHTML = "<span>" + this.l(P) + "</span>", v.appendChild(H), s.days.push(H);
|
|
1598
|
+
for (var k = 0; k < u; k++) {
|
|
1599
|
+
var S = r.addDays(7 * k + P), M = this.m(S) && "none" !== this.n(), N = S.firstDayOfMonth() === n, O = S < n, E = S >= n.addMonths(1);
|
|
1600
|
+
if ("month" === this.n())
|
|
1601
|
+
M = M && N;
|
|
1602
|
+
else if ("day" === this.n())
|
|
1603
|
+
M = M && (N || l && O || o && E);
|
|
1604
|
+
else if ("week" === this.n()) {
|
|
1605
|
+
var W = S.firstDayOfMonth() === n;
|
|
1606
|
+
M = M && (W || l && O || o && E);
|
|
1607
|
+
}
|
|
1608
|
+
var T = document.createElement("div");
|
|
1609
|
+
s.cells[P][k] = T;
|
|
1610
|
+
var R = i.o(P, k), A = R.x, B = R.y;
|
|
1611
|
+
T.day = S, T.x = P, T.y = k, T.left = A, T.top = B, T.isCurrentMonth = N, T.isNextMonth = E, T.isPrevMonth = O, T.showBefore = l, T.showAfter = o, this.cssOnly ? T.className = this.c(N ? "_day" : "_dayother") : T.className = this.c(N ? "day" : "dayother"), i.g(T, "cell"), S.getTime() === f.getTime() && N && this.g(T, "today"), 0 !== S.dayOfWeek() && 6 !== S.dayOfWeek() || this.g(T, "weekend"), T.style.position = "absolute", T.style.left = A + "px", T.style.right = A + "px", T.style.top = B + "px", T.style.width = a.cellWidth() + "px", T.style.height = this.cellHeight + "px", T.style.lineHeight = this.cellHeight + "px";
|
|
1612
|
+
var _ = document.createElement("div");
|
|
1613
|
+
_.style.position = "absolute", this.cssOnly ? _.className = S.getTime() === f.getTime() && N ? this.c("_todaybox") : this.c("_daybox") : _.className = S.getTime() === f.getTime() && N ? this.c("todaybox") : this.c("daybox"), i.g(_, "cell_box"), _.style.left = "0px", _.style.top = "0px", _.style.right = "0px", _.style.bottom = "0px", T.appendChild(_);
|
|
1614
|
+
var U = null;
|
|
1615
|
+
if (this.cells && this.cells[S.toStringSortable()] && (U = this.cells[S.toStringSortable()]), "function" == typeof i.onBeforeCellRender) {
|
|
1616
|
+
var I = {};
|
|
1617
|
+
I.cell = U || {}, I.cell.day = S, I.cell.isCurrentMonth = N, I.cell.isToday = S.getTime() === f.getTime() && N, I.cell.isWeekend = 0 === S.dayOfWeek() || 6 === S.dayOfWeek(), U ? (I.cell.html = U.html || S.getDay(), I.cell.cssClass = U.css) : (I.cell.html = S.getDay(), I.cell.cssClass = null), i.onBeforeCellRender(I), U = I.cell;
|
|
1618
|
+
}
|
|
1619
|
+
if (U && DayPilot.Util.addClass(T, U.cssClass || U.css), N || l && O || o && E) {
|
|
1620
|
+
var L = document.createElement("div");
|
|
1621
|
+
L.innerHTML = S.getDay(), L.style.position = "absolute", L.style.left = "0px", L.style.top = "0px", L.style.right = "0px", L.style.bottom = "0px", i.g(L, "cell_text"), T.isClickable = !0, U && U.html && (L.innerHTML = U.html), T.appendChild(L);
|
|
1622
|
+
}
|
|
1623
|
+
T.setAttribute("unselectable", "on"), T.onclick = this.p, v.appendChild(T), M && (i.q(v, P, k), this.selected.push(T));
|
|
1624
|
+
}
|
|
1625
|
+
} var V = document.createElement("div"); V.style.position = "absolute", V.style.left = "0px", V.style.top = g - 2 + "px", V.style.width = 7 * a.cellWidth() + this.d() + "px", V.style.height = "1px", V.style.fontSize = "1px", V.style.lineHeight = "1px", this.cssOnly ? V.className = this.c("_line") : V.className = this.c("line"), v.appendChild(V), this.months.push(s); }, this.o = function (t, e) { var i = this.titleHeight + this.dayHeaderHeight, s = this.d(); return { "x": t * a.cellWidth() + s, "y": e * this.cellHeight + i }; }, this.q = function (t, e, s) { var n = t.month.cells[e][s]; i.g(n, "select"); }, this.r = function (t, e, s) { var n = t.month.cells[e][s]; i.h(n, "select"); }, this.d = function () { return this.showWeekNumbers ? a.cellWidth() : 0; }, this.s = function () { if (this.items)
|
|
1626
|
+
for (var t = 0; t < this.showMonths; t++)
|
|
1627
|
+
for (var e = 0; e < 7; e++)
|
|
1628
|
+
for (var i = 0; i < 6; i++) {
|
|
1629
|
+
var s = this.months[t].cells[e][i];
|
|
1630
|
+
s && (1 === this.items[s.day.toStringSortable()] ? this.g(s, "busy") : this.h(s, "busy"));
|
|
1631
|
+
} }, this.t = function () { var t = {}; t.startDate = i.startDate, t.selectionStart = i.selectionStart, t.selectionEnd = i.selectionEnd.addDays(1), i.state.value = JSON.stringify(t); }, this.n = function () { return (this.selectMode || "").toLowerCase(); }, this.u = function () { var t = this.selectionDay || this.selectionStart; t || (t = DayPilot.Date.today()); var t = new DayPilot.Date(t); switch (this.n()) {
|
|
1632
|
+
case "day":
|
|
1633
|
+
this.selectionStart = t, this.selectionDay = t, this.selectionEnd = t;
|
|
1634
|
+
break;
|
|
1635
|
+
case "week":
|
|
1636
|
+
this.selectionDay = t, this.selectionStart = t.firstDayOfWeek(a.weekStarts()), this.selectionEnd = this.selectionStart.addDays(6);
|
|
1637
|
+
break;
|
|
1638
|
+
case "month":
|
|
1639
|
+
this.selectionDay = t, this.selectionStart = t.firstDayOfMonth(), this.selectionEnd = this.selectionStart.lastDayOfMonth();
|
|
1640
|
+
break;
|
|
1641
|
+
case "none":
|
|
1642
|
+
this.selectionEnd = t;
|
|
1643
|
+
break;
|
|
1644
|
+
default: throw "Unknown selectMode value.";
|
|
1645
|
+
} }, this.w = null, this.select = function (t, e) { if (!this.z)
|
|
1646
|
+
return void (this.w = { "date": t, "options": e }); var i = !0, s = !0; "object" == typeof e ? (e.dontFocus && (i = !1), e.dontNotify && (s = !1)) : "boolean" == typeof e && (i = !e); var n = this.selectionStart, a = this.selectionEnd; this.selectionStart = new DayPilot.Date(t).getDatePart(), this.selectionDay = this.selectionStart; var l = !1; if (i) {
|
|
1647
|
+
var o = this.startDate;
|
|
1648
|
+
(this.selectionStart < this.A() || this.selectionStart >= this.B()) && (o = this.selectionStart.firstDayOfMonth()), o.toStringSortable() !== this.startDate.toStringSortable() && (l = !0), this.startDate = o;
|
|
1649
|
+
} this.u(), this.f(), this.b(), this.C(), this.s(), this.t(), !s || n.equals(this.selectionStart) && a.equals(this.selectionEnd) || this.D(), l && this.E(); }, this.update = function (t) { if (!i.z)
|
|
1650
|
+
throw new DayPilot.Exception("You are trying to update a DayPilot.Navigator instance that hasn't been initialized yet."); if (i.F)
|
|
1651
|
+
throw new DayPilot.Exception("You are trying to update a DayPilot.Navigator instance that has been disposed."); i.G(), i.H(t), i.I(); }, this.I = function () { i.cssOnly || (i.cssOnly = !0), this.f(), this.b(), this.u(), this.C(), this.J(), this.s(), this.t(), this.visible ? this.show() : this.hide(); }, this.G = function () { i.a = {}; }, this.K = null, this.H = function (t) { if (t) {
|
|
1652
|
+
var e = { "events": { "preInit": function () { var t = this.data; t && (DayPilot.isArray(t.list) ? i.events.list = t.list : i.events.list = t); } } };
|
|
1653
|
+
this.K = e;
|
|
1654
|
+
for (var s in t)
|
|
1655
|
+
if (e[s]) {
|
|
1656
|
+
var n = e[s];
|
|
1657
|
+
n.data = t[s], n.preInit && n.preInit();
|
|
1658
|
+
}
|
|
1659
|
+
else
|
|
1660
|
+
i[s] = t[s];
|
|
1661
|
+
} }, this.L = function () { var t = this.K; for (var e in t) {
|
|
1662
|
+
var i = t[e];
|
|
1663
|
+
i.postInit && i.postInit();
|
|
1664
|
+
} }, this.M = function (t, e, i) { var s = {}; s.action = t, s.parameters = i, s.data = e, s.header = this.N(); var n = "JSON" + JSON.stringify(s); this.backendUrl ? DayPilot.request(this.backendUrl, this.O, n, this.P) : WebForm_DoCallback(this.uniqueID, n, this.Q, null, this.callbackError, !0); }, this.P = function (t) { if ("function" == typeof i.onAjaxError) {
|
|
1665
|
+
var e = {};
|
|
1666
|
+
e.request = t, i.onAjaxError(e);
|
|
1667
|
+
}
|
|
1668
|
+
else
|
|
1669
|
+
"function" == typeof i.ajaxError && i.ajaxError(t); }, this.O = function (t) { i.Q(t.responseText); }, this.R = function (t, e, s) { var n = {}; n.action = t, n.parameters = s, n.data = e, n.header = this.N(); var a = "JSON" + JSON.stringify(n); __doPostBack(i.uniqueID, a); }, this.N = function () { var t = {}; return t.v = this.v, t.startDate = this.startDate, t.selectionStart = this.selectionStart, t.showMonths = this.showMonths, t; }, this.S = function (t, e) { "refresh" === t && this.E(); }, this.l = function (t) { var e = t + a.weekStarts(); return e > 6 && (e -= 7), a.locale().dayNamesShort[e]; }, this.m = function (t) { return null !== this.selectionStart && null !== this.selectionEnd && (this.selectionStart.getTime() <= t.getTime() && t.getTime() <= this.selectionEnd.getTime()); }, this.T = function (t) { for (var e = 0; e < i.months.length; e++) {
|
|
1670
|
+
var s = i.months[e];
|
|
1671
|
+
if (!s)
|
|
1672
|
+
return null;
|
|
1673
|
+
if (t.x < s.left || s.width < t.x)
|
|
1674
|
+
return null;
|
|
1675
|
+
i.months[e].height;
|
|
1676
|
+
if (s.top <= t.y && t.y < s.top + s.height)
|
|
1677
|
+
return e;
|
|
1678
|
+
} return null; }, this.U = function (t) { var e = DayPilot.mo3(i.nav.top, t), s = i.T(e); if (null === s)
|
|
1679
|
+
return null; var n = i.months[s], a = this.titleHeight + this.dayHeaderHeight; if (n.top <= e.y && e.y < n.top + a)
|
|
1680
|
+
return { "month": s, "x": 0, "y": 0, "coords": e, "header": !0 }; for (var l = 0; l < n.cells.length; l++)
|
|
1681
|
+
for (var o = 0; o < n.cells[l].length; o++) {
|
|
1682
|
+
var h = n.cells[l][o], r = h.top + n.top, c = h.left + n.left;
|
|
1683
|
+
if (c <= e.x && e.x < c + i.cellWidth && r <= e.y && e.y < r + i.cellHeight)
|
|
1684
|
+
return { "month": s, "x": l, "y": o, "coords": e };
|
|
1685
|
+
} return null; }, this.V = function (t) { if (i.freeHandSelectionEnabled) {
|
|
1686
|
+
var e = i.U(t);
|
|
1687
|
+
e && !e.header && (s.start = e), i.months[e.month].cells[e.x][e.y], t.preventDefault();
|
|
1688
|
+
} }, this.W = function (t) { if (s.start) {
|
|
1689
|
+
var e = i.U(t);
|
|
1690
|
+
if (s.end)
|
|
1691
|
+
s.end = e;
|
|
1692
|
+
else if (e) {
|
|
1693
|
+
var n = 3, a = DayPilot.distance(s.start.coords, e.coords);
|
|
1694
|
+
a > n && (s.end = e);
|
|
1695
|
+
}
|
|
1696
|
+
s.end && (s.clear(), s.draw());
|
|
1697
|
+
} }, this.X = {}; var s = this.X; s.start = null, s.drawCell = function (t) { var e = i.months[t.month], n = i.o(t.x, t.y), a = e.top + n.y, l = e.left + n.x, o = document.createElement("div"); o.style.position = "absolute", o.style.left = l + "px", o.style.top = a + "px", o.style.height = i.cellHeight + "px", o.style.width = i.cellWidth + "px", o.style.backgroundColor = "#ccc", o.style.opacity = .5, o.style.cursor = "default", i.nav.preselection.appendChild(o), s.cells.push(o); }, s.clear = function () { if (s.cells) {
|
|
1698
|
+
for (var t = 0; t < s.cells.length; t++)
|
|
1699
|
+
i.nav.preselection.removeChild(s.cells[t]);
|
|
1700
|
+
s.cells = [];
|
|
1701
|
+
} }, s.draw = function () { var t = s.ordered(), e = new n(t.start), a = t.end; if (a) {
|
|
1702
|
+
if (a === s.end && a.header && a.month > 0) {
|
|
1703
|
+
a.month -= 1;
|
|
1704
|
+
var l = i.months[a.month];
|
|
1705
|
+
a.x = 6, a.y = l.rowCount - 1;
|
|
1706
|
+
}
|
|
1707
|
+
for (s.cells = []; !e.is(a);) {
|
|
1708
|
+
s.drawCell(e);
|
|
1709
|
+
var o = new n(e).next();
|
|
1710
|
+
if (!o)
|
|
1711
|
+
return;
|
|
1712
|
+
e.month = o.month, e.x = o.x, e.y = o.y;
|
|
1713
|
+
}
|
|
1714
|
+
s.drawCell(e);
|
|
1715
|
+
} }, s.ordered = function () { var t = s.start, e = s.end, i = {}; return !e || new n(t).before(e) ? (i.start = t, i.end = e) : (i.start = e, i.end = t), i; }; var n = function (t, e, s) { if (t instanceof n)
|
|
1716
|
+
return t; if ("object" == typeof t) {
|
|
1717
|
+
var a = t;
|
|
1718
|
+
this.month = a.month, this.x = a.x, this.y = a.y;
|
|
1719
|
+
}
|
|
1720
|
+
else
|
|
1721
|
+
this.month = t, this.x = e, this.y = s; this.is = function (t) { return this.month === t.month && this.x === t.x && this.y === t.y; }, this.next = function () { var t = this; if (t.x < 6)
|
|
1722
|
+
return { "month": t.month, "x": t.x + 1, "y": t.y }; var e = i.months[t.month]; return t.y < e.rowCount - 1 ? { "month": t.month, "x": 0, "y": t.y + 1 } : t.month < i.months.length - 1 ? { "month": t.month + 1, "x": 0, "y": 0 } : null; }, this.visible = function () { var t = this.cell(); return !!t.isCurrentMonth || (!(!t.isPrevMonth || !t.showBefore) || !(!t.isNextMonth || !t.showAfter)); }, this.nextVisible = function () { for (var t = this; !t.visible();) {
|
|
1723
|
+
var e = t.next();
|
|
1724
|
+
if (!e)
|
|
1725
|
+
return null;
|
|
1726
|
+
t = new n(e);
|
|
1727
|
+
} return t; }, this.previous = function () { var t = this; if (t.x > 0)
|
|
1728
|
+
return { "month": t.month, "x": t.x - 1, "y": t.y }; i.months[t.month]; if (t.y > 0)
|
|
1729
|
+
return { "month": t.month, "x": 6, "y": t.y - 1 }; if (t.month > 0) {
|
|
1730
|
+
var e = i.months[t.month - 1];
|
|
1731
|
+
return { "month": t.month - 1, "x": 6, "y": e.rowCount - 1 };
|
|
1732
|
+
} return null; }, this.previousVisible = function () { for (var t = this; !t.visible();) {
|
|
1733
|
+
var e = t.previous();
|
|
1734
|
+
if (!e)
|
|
1735
|
+
return null;
|
|
1736
|
+
t = new n(e);
|
|
1737
|
+
} return t; }, this.cell = function () { return i.months[this.month].cells[this.x][this.y]; }, this.date = function () { return this.cell().day; }, this.before = function (t) { return this.date() < new n(t).date(); }; }; this.p = function (t) { var e = this.parentNode, s = this.parentNode.month, n = this.x, a = this.y, l = s.cells[n][a].day; if (s.cells[n][a].isClickable) {
|
|
1738
|
+
i.clearSelection(), i.selectionDay = l;
|
|
1739
|
+
var l = i.selectionDay;
|
|
1740
|
+
switch (i.n()) {
|
|
1741
|
+
case "none":
|
|
1742
|
+
i.selectionStart = l, i.selectionEnd = l;
|
|
1743
|
+
break;
|
|
1744
|
+
case "day":
|
|
1745
|
+
if (i.autoFocusOnClick) {
|
|
1746
|
+
var o = l;
|
|
1747
|
+
if (l < i.A() || l >= i.B())
|
|
1748
|
+
return void i.select(l);
|
|
1749
|
+
}
|
|
1750
|
+
var h = s.cells[n][a];
|
|
1751
|
+
i.q(e, n, a), i.selected.push(h), i.selectionStart = h.day, i.selectionEnd = h.day;
|
|
1752
|
+
break;
|
|
1753
|
+
case "week":
|
|
1754
|
+
if (i.autoFocusOnClick) {
|
|
1755
|
+
var o = s.cells[0][a].day, r = s.cells[6][a].day;
|
|
1756
|
+
if (o.firstDayOfMonth() === r.firstDayOfMonth() && (o < i.A() || r >= i.B()))
|
|
1757
|
+
return void i.select(l);
|
|
1758
|
+
}
|
|
1759
|
+
for (var c = 0; c < 7; c++)
|
|
1760
|
+
i.q(e, c, a), i.selected.push(s.cells[c][a]);
|
|
1761
|
+
i.selectionStart = s.cells[0][a].day, i.selectionEnd = s.cells[6][a].day;
|
|
1762
|
+
break;
|
|
1763
|
+
case "month":
|
|
1764
|
+
if (i.autoFocusOnClick) {
|
|
1765
|
+
var o = l;
|
|
1766
|
+
if (l < i.A() || l >= i.B())
|
|
1767
|
+
return void i.select(l);
|
|
1768
|
+
}
|
|
1769
|
+
for (var o = null, r = null, a = 0; a < 6; a++)
|
|
1770
|
+
for (var n = 0; n < 7; n++) {
|
|
1771
|
+
var h = s.cells[n][a];
|
|
1772
|
+
h && h.day.getYear() === l.getYear() && h.day.getMonth() === l.getMonth() && (i.q(e, n, a), i.selected.push(h), null === o && (o = h.day), r = h.day);
|
|
1773
|
+
}
|
|
1774
|
+
i.selectionStart = o, i.selectionEnd = r;
|
|
1775
|
+
break;
|
|
1776
|
+
default: throw "unknown selectMode";
|
|
1777
|
+
}
|
|
1778
|
+
i.t(), i.D();
|
|
1779
|
+
} }, this.D = function (t) { var e = i.selectionStart, s = i.selectionEnd.addDays(1), n = DayPilot.DateUtil.daysDiff(e, s), a = i.selectionDay; if (t = t || {}, i.e()) {
|
|
1780
|
+
var l = {};
|
|
1781
|
+
if (l.start = e, l.end = s, l.day = a, l.days = n, l.mode = t.mode || i.selectMode, l.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof i.onTimeRangeSelect && (i.onTimeRangeSelect(l), l.preventDefault.value))
|
|
1782
|
+
return;
|
|
1783
|
+
switch (i.timeRangeSelectedHandling) {
|
|
1784
|
+
case "Bind":
|
|
1785
|
+
if ("object" == typeof bound) {
|
|
1786
|
+
var o = {};
|
|
1787
|
+
o.start = e, o.end = s, o.days = n, o.day = a, bound.commandCallBack(i.command, o);
|
|
1788
|
+
}
|
|
1789
|
+
break;
|
|
1790
|
+
case "None": break;
|
|
1791
|
+
case "PostBack": i.timeRangeSelectedPostBack(e, s, a);
|
|
1792
|
+
}
|
|
1793
|
+
"function" == typeof i.onTimeRangeSelected && i.onTimeRangeSelected(l);
|
|
1794
|
+
}
|
|
1795
|
+
else
|
|
1796
|
+
switch (i.timeRangeSelectedHandling) {
|
|
1797
|
+
case "Bind":
|
|
1798
|
+
if ("object" == typeof bound) {
|
|
1799
|
+
var o = {};
|
|
1800
|
+
o.start = e, o.end = s, o.days = n, o.day = a, bound.commandCallBack(i.command, o);
|
|
1801
|
+
}
|
|
1802
|
+
break;
|
|
1803
|
+
case "JavaScript":
|
|
1804
|
+
i.onTimeRangeSelected(e, s, a);
|
|
1805
|
+
break;
|
|
1806
|
+
case "None": break;
|
|
1807
|
+
case "PostBack": i.timeRangeSelectedPostBack(e, s, a);
|
|
1808
|
+
} }, this.timeRangeSelectedPostBack = function (t, e, i, s) { var n = {}; n.start = t, n.end = e, n.day = s, this.R("TimeRangeSelected", i, n); }, this.k = function (t) { i.Y(i.skipMonths); }, this.j = function (t) { i.Y(-i.skipMonths); }, this.Y = function (t) { this.startDate = this.startDate.addMonths(t), this.f(), this.b(), this.C(), this.t(), this.E(), this.s(); }, this.A = function () { return i.startDate.firstDayOfMonth(); }, this.B = function () { return i.startDate.firstDayOfMonth().addMonths(this.showMonths); }, this.visibleStart = function () { return i.startDate.firstDayOfMonth().firstDayOfWeek(a.weekStarts()); }, this.visibleEnd = function () { return i.startDate.firstDayOfMonth().addMonths(this.showMonths - 1).firstDayOfWeek(a.weekStarts()).addDays(42); }, this.E = function () { var t = this.visibleStart(), e = this.visibleEnd(); if (i.e()) {
|
|
1809
|
+
var s = {};
|
|
1810
|
+
if (s.start = t, s.end = e, s.preventDefault = function () { this.preventDefault.value = !0; }, "function" == typeof i.onVisibleRangeChange && (i.onVisibleRangeChange(s), s.preventDefault.value))
|
|
1811
|
+
return;
|
|
1812
|
+
switch (this.visibleRangeChangedHandling) {
|
|
1813
|
+
case "CallBack":
|
|
1814
|
+
this.visibleRangeChangedCallBack(null);
|
|
1815
|
+
break;
|
|
1816
|
+
case "PostBack":
|
|
1817
|
+
this.visibleRangeChangedPostBack(null);
|
|
1818
|
+
break;
|
|
1819
|
+
case "Disabled":
|
|
1820
|
+
}
|
|
1821
|
+
"function" == typeof i.onVisibleRangeChanged && i.onVisibleRangeChanged(s);
|
|
1822
|
+
}
|
|
1823
|
+
else
|
|
1824
|
+
switch (this.visibleRangeChangedHandling) {
|
|
1825
|
+
case "CallBack":
|
|
1826
|
+
this.visibleRangeChangedCallBack(null);
|
|
1827
|
+
break;
|
|
1828
|
+
case "PostBack":
|
|
1829
|
+
this.visibleRangeChangedPostBack(null);
|
|
1830
|
+
break;
|
|
1831
|
+
case "JavaScript":
|
|
1832
|
+
this.onVisibleRangeChanged(t, e);
|
|
1833
|
+
break;
|
|
1834
|
+
case "Disabled":
|
|
1835
|
+
} }, this.visibleRangeChangedCallBack = function (t) { var e = {}; this.M("Visible", t, e); }, this.visibleRangeChangedPostBack = function (t) { var e = {}; this.R("Visible", t, e); }, this.Q = function (t, e) { var t = JSON.parse(t); i.items = t.Items, i.cells = t.Cells, i.cells ? i.update() : i.s(); }, this.C = function () { for (var t = 0; t < this.showMonths; t++) {
|
|
1836
|
+
var e = this.Z(t);
|
|
1837
|
+
this.i(t, e);
|
|
1838
|
+
} this.root.style.height = this.$() + "px", this.nav.preselection = document.createElement("div"), this.nav.preselection.style.position = "absolute", this.nav.preselection.style.left = "0px", this.nav.preselection.style.top = "0px", this.root.appendChild(this.nav.preselection); }, this.$ = function () { if ("Horizontal" === this.orientation) {
|
|
1839
|
+
for (var t = 0, e = 0; e < this.months.length; e++) {
|
|
1840
|
+
var i = this.months[e];
|
|
1841
|
+
i.height > t && (t = i.height);
|
|
1842
|
+
}
|
|
1843
|
+
return t;
|
|
1844
|
+
} for (var s = 0, e = 0; e < this.months.length; e++) {
|
|
1845
|
+
var i = this.months[e];
|
|
1846
|
+
s += i.height;
|
|
1847
|
+
} return s; }, this.Z = function (t) { if (this.internal.showLinks)
|
|
1848
|
+
return this.internal.showLinks; var e = {}; return e.left = 0 === t, e.right = 0 === t, e.before = 0 === t, e.after = t === this.showMonths - 1, "Horizontal" === this.orientation && (e.right = t === this.showMonths - 1), e; }, this._ = {}, this._.scope = null, this._.notify = function () { i._.scope && i._.scope["$apply"](); }, this.internal = {}, this.internal.initialized = function () { return i.z; }, this.aa = {}; var a = this.aa; a.locale = function () { return DayPilot.Locale.find(i.locale); }, a.weekStarts = function () { if ("Auto" === i.weekStarts) {
|
|
1849
|
+
var t = a.locale();
|
|
1850
|
+
return t ? t.weekStarts : 0;
|
|
1851
|
+
} return i.weekStarts; }, a.cellWidth = function () { if (i.a.cellWidth)
|
|
1852
|
+
return i.a.cellWidth; var t = i.ba("_cell_dimensions").width; return t || (t = i.cellWidth), i.a.cellWidth = t, t; }, this.clearSelection = function () { for (var t = 0; t < this.selected.length; t++) {
|
|
1853
|
+
var e = this.selected[t];
|
|
1854
|
+
i.r(e.parentNode, e.x, e.y);
|
|
1855
|
+
} this.selected = []; }, this.ca = function () { return !!this.backendUrl && ("undefined" == typeof i.items || !i.items); }, this.events = {}, this.J = function () { if (DayPilot.isArray(this.events.list)) {
|
|
1856
|
+
this.items = {};
|
|
1857
|
+
for (var t = 0; t < this.events.list.length; t++) {
|
|
1858
|
+
var e = this.events.list[t];
|
|
1859
|
+
if (!e.hidden) {
|
|
1860
|
+
var i = this.da(e);
|
|
1861
|
+
for (var s in i)
|
|
1862
|
+
this.items[s] = 1;
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
} }, this.ba = function (t) { var e = document.createElement("div"); e.style.position = "absolute", e.style.top = "-2000px", e.style.left = "-2000px", e.className = this.c(t); var s = i.root || document.body; s.appendChild(e); var n = e.offsetHeight, a = e.offsetWidth; s.removeChild(e); var l = {}; return l.height = n, l.width = a, l; }, this.da = function (t) { for (var e = new DayPilot.Date(t.start), i = new DayPilot.Date(t.end), s = {}, n = e.getDatePart(); n.getTime() < i.getTime();)
|
|
1866
|
+
s[n.toStringSortable()] = 1, n = n.addDays(1); return s; }, this.show = function () { i.visible = !0, i.root.style.display = ""; }, this.hide = function () { i.visible = !1, i.root.style.display = "none"; }, this.ea = function () { if (this.id && this.id.tagName)
|
|
1867
|
+
this.nav.top = this.id;
|
|
1868
|
+
else {
|
|
1869
|
+
if ("string" != typeof this.id)
|
|
1870
|
+
throw "DayPilot.Navigator() constructor requires the target element or its ID as a parameter";
|
|
1871
|
+
if (this.nav.top = document.getElementById(this.id), !this.nav.top)
|
|
1872
|
+
throw "DayPilot.Navigator: The placeholder element not found: '" + t + "'.";
|
|
1873
|
+
} this.root = this.nav.top; }, this.init = function () { if (this.ea(), !this.root.dp) {
|
|
1874
|
+
i.cssOnly || (i.cssOnly = !0, DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")), this.u(), this.b(), this.C(), this.J(), this.s(), this.fa(), this.ga(), this.ha();
|
|
1875
|
+
return this.ca() && this.E(), this.z = !0, this.L(), this.w && (this.select(this.w.date, this.w.options), this.w = null), this;
|
|
1876
|
+
} }, this.ga = function () { i.nav.top.onmousedown = this.V, i.nav.top.onmousemove = this.W; }, this.ha = function () { DayPilot.re(document, "mouseup", i.ia); }, this.ia = function (t) { if (s.start && s.end) {
|
|
1877
|
+
var e = DayPilot.mo3(i.nav.top, t);
|
|
1878
|
+
if (e.x === s.start.coords.x && e.y === s.start.coords.y)
|
|
1879
|
+
return s.start = null, void s.clear();
|
|
1880
|
+
s.clear();
|
|
1881
|
+
var a = s.ordered();
|
|
1882
|
+
a.start = new n(a.start).nextVisible(), a.end = new n(a.end).previousVisible(), i.selectionDay = new n(a.start).date(), i.selectionStart = i.selectionDay, i.selectionEnd = new n(a.end).date(), s.start = null, s.end = null, i.f(), i.b(), i.C(), i.s(), i.t();
|
|
1883
|
+
i.D({ "mode": "FreeHand" });
|
|
1884
|
+
} s.start = null, s.end = null; }, this.dispose = function () { var t = i; t.root && (t.root.removeAttribute("style"), t.root.removeAttribute("class"), t.root.dp = null, t.root.innerHTML = null, t.root = null); }, this.fa = function () { this.root.dispose = this.dispose; }, this.Init = this.init, this.H(e); }, "undefined" != typeof jQuery && !function (t) { t.fn.daypilotNavigator = function (t) { var e = null, i = this.each(function () { if (!this.daypilot) {
|
|
1885
|
+
var i = new DayPilot.Navigator(this.id);
|
|
1886
|
+
this.daypilot = i;
|
|
1887
|
+
for (var s in t)
|
|
1888
|
+
i[s] = t[s];
|
|
1889
|
+
i.Init(), e || (e = i);
|
|
1890
|
+
} }); return 1 === this.length ? e : i; }; }(jQuery), function () { var t = DayPilot.am(); t && t.directive("daypilotNavigator", ["$parse", function (t) { return { "restrict": "E", "template": "<div id='{{id}}'></div>", "compile": function (e, i) { return e.replaceWith(this["template"].replace("{{id}}", i["id"])), function (e, i, s) { var n = new DayPilot.Navigator(i[0]); n._.scope = e, n.init(); var a = s["id"]; a && (e[a] = n); var l = s["publishAs"]; if (l) {
|
|
1891
|
+
(0, t(l).assign)(e, n);
|
|
1892
|
+
} for (var o in s)
|
|
1893
|
+
if (0 === o.indexOf("on")) {
|
|
1894
|
+
var h = DayPilot.Util.shouldApply(o);
|
|
1895
|
+
h ? !function (i) { n[i] = function (n) { var a = t(s[i]); e["$apply"](function () { a(e, { "args": n }); }); }; }(o) : !function (i) { n[i] = function (n) { t(s[i])(e, { "args": n }); }; }(o);
|
|
1896
|
+
} var r = e["$watch"], c = s["config"] || s["daypilotConfig"], d = s["events"] || s["daypilotEvents"]; r.call(e, c, function (t, e) { for (var i in t)
|
|
1897
|
+
n[i] = t[i]; n.update(); }, !0), r.call(e, d, function (t) { n.events.list = t, n.J(), n.s(); }, !0); }; } }; }]); }(), "undefined" != typeof Sys && Sys.Application && Sys.Application.notifyScriptLoaded && Sys.Application.notifyScriptLoaded();
|
|
1898
|
+
} }();
|
|
1899
|
+
|
|
1900
|
+
function rand() {
|
|
1901
|
+
return ((1 + Math.random()) * 0x10000) | 0;
|
|
1902
|
+
}
|
|
1903
|
+
;
|
|
1904
|
+
function optHash(options) {
|
|
1905
|
+
return JSON.stringify(options);
|
|
1906
|
+
}
|
|
1907
|
+
;
|
|
1908
|
+
class EventDiff {
|
|
1909
|
+
constructor() {
|
|
1910
|
+
this.orig = { "hashes": {} };
|
|
1911
|
+
}
|
|
1912
|
+
diff(list) {
|
|
1913
|
+
const orig = this.orig;
|
|
1914
|
+
let result = {};
|
|
1915
|
+
// new hashes, new ids
|
|
1916
|
+
let hashes = {};
|
|
1917
|
+
list = list || [];
|
|
1918
|
+
for (let i = 0; i < list.length; i++) {
|
|
1919
|
+
let e = list[i];
|
|
1920
|
+
let id = e.id;
|
|
1921
|
+
if (!id) {
|
|
1922
|
+
throw "The 'id' property must be specified for event data object";
|
|
1923
|
+
}
|
|
1924
|
+
if (hashes.hasOwnProperty("" + id)) {
|
|
1925
|
+
throw "Duplicate event IDs are not allowed, id: " + id;
|
|
1926
|
+
}
|
|
1927
|
+
hashes["" + id] = JSON.stringify(e);
|
|
1928
|
+
}
|
|
1929
|
+
// array of new objects
|
|
1930
|
+
result.add = list.filter(function (item) {
|
|
1931
|
+
return !orig.hashes.hasOwnProperty(item.id);
|
|
1932
|
+
});
|
|
1933
|
+
// array of IDs
|
|
1934
|
+
result.remove = Object.getOwnPropertyNames(orig.hashes).filter(function (id) {
|
|
1935
|
+
return !hashes.hasOwnProperty(id);
|
|
1936
|
+
}).map(function (id) {
|
|
1937
|
+
return JSON.parse(orig.hashes[id]).id;
|
|
1938
|
+
}); // array of ids
|
|
1939
|
+
// array of new objects
|
|
1940
|
+
result.modify = list.filter(function (item) {
|
|
1941
|
+
return orig.hashes.hasOwnProperty(item.id) && orig.hashes[item.id] !== hashes[item.id];
|
|
1942
|
+
});
|
|
1943
|
+
result.changeCount = result.add.length + result.modify.length + result.remove.length;
|
|
1944
|
+
orig.hashes = hashes;
|
|
1945
|
+
return result;
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
class DayPilotCalendarComponent {
|
|
1950
|
+
constructor() {
|
|
1951
|
+
this.viewChange = new EventEmitter();
|
|
1952
|
+
this.events = [];
|
|
1953
|
+
this._requestUpdateFull = false;
|
|
1954
|
+
this._requestUpdateEvents = false;
|
|
1955
|
+
this._requestViewChange = false;
|
|
1956
|
+
this._hashOptions = "";
|
|
1957
|
+
this._hashEvents = "";
|
|
1958
|
+
this._id = "dp_" + new Date().getTime() + rand();
|
|
1959
|
+
}
|
|
1960
|
+
get id() {
|
|
1961
|
+
return this._id;
|
|
1962
|
+
}
|
|
1963
|
+
ngOnInit() {
|
|
1964
|
+
}
|
|
1965
|
+
ngOnDestroy() {
|
|
1966
|
+
this.dispose();
|
|
1967
|
+
}
|
|
1968
|
+
ngAfterViewInit() {
|
|
1969
|
+
this.dispose();
|
|
1970
|
+
let dp = new DayPilot.Calendar(this.id);
|
|
1971
|
+
this.control = dp;
|
|
1972
|
+
this.updateOptions();
|
|
1973
|
+
this.updateEvents();
|
|
1974
|
+
this._requestUpdateFull = false; // config just loaded and calling init(), no need to call update again
|
|
1975
|
+
this._requestUpdateEvents = false; // config just loaded and calling init(), no need to call update again
|
|
1976
|
+
dp.init();
|
|
1977
|
+
}
|
|
1978
|
+
ngDoCheck() {
|
|
1979
|
+
if (!this.control) {
|
|
1980
|
+
return;
|
|
1981
|
+
}
|
|
1982
|
+
this.updateOptions();
|
|
1983
|
+
this.updateEvents();
|
|
1984
|
+
if (this._requestUpdateFull) {
|
|
1985
|
+
this.control.update();
|
|
1986
|
+
this._requestUpdateFull = false;
|
|
1987
|
+
this._requestUpdateEvents = false;
|
|
1988
|
+
}
|
|
1989
|
+
else if (this._requestUpdateEvents) {
|
|
1990
|
+
this.control.update({ "events": this.events });
|
|
1991
|
+
this._requestUpdateEvents = false;
|
|
1992
|
+
}
|
|
1993
|
+
if (this._requestViewChange) {
|
|
1994
|
+
this._requestViewChange = false;
|
|
1995
|
+
let args = {};
|
|
1996
|
+
this.viewChange.emit(args);
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
dispose() {
|
|
2000
|
+
if (this.control) {
|
|
2001
|
+
this.control.dispose();
|
|
2002
|
+
//@ts-ignore
|
|
2003
|
+
this.control = null;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
updateOptions() {
|
|
2007
|
+
let hash = optHash(this.config);
|
|
2008
|
+
if (hash !== this._hashOptions) {
|
|
2009
|
+
let dp = this.control;
|
|
2010
|
+
for (let name in this.config) {
|
|
2011
|
+
dp[name] = this.config[name];
|
|
2012
|
+
}
|
|
2013
|
+
this._requestUpdateFull = true;
|
|
2014
|
+
this._requestViewChange = true;
|
|
2015
|
+
}
|
|
2016
|
+
this._hashOptions = hash;
|
|
2017
|
+
}
|
|
2018
|
+
updateEvents() {
|
|
2019
|
+
let hash = optHash(this.events);
|
|
2020
|
+
if (hash !== this._hashEvents) {
|
|
2021
|
+
let dp = this.control;
|
|
2022
|
+
if (dp) {
|
|
2023
|
+
dp.events.list = this.events;
|
|
2024
|
+
}
|
|
2025
|
+
this._requestUpdateEvents = true;
|
|
2026
|
+
}
|
|
2027
|
+
this._hashEvents = hash;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
DayPilotCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2031
|
+
DayPilotCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: DayPilotCalendarComponent, selector: "daypilot-calendar", inputs: { events: "events", config: "config" }, outputs: { viewChange: "viewChange" }, ngImport: i0, template: `
|
|
2032
|
+
<div id='{{id}}'></div>`, isInline: true, styles: [""] });
|
|
2033
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotCalendarComponent, decorators: [{
|
|
2034
|
+
type: Component,
|
|
2035
|
+
args: [{
|
|
2036
|
+
selector: 'daypilot-calendar',
|
|
2037
|
+
template: `
|
|
2038
|
+
<div id='{{id}}'></div>`,
|
|
2039
|
+
styles: [``]
|
|
2040
|
+
}]
|
|
2041
|
+
}], propDecorators: { viewChange: [{
|
|
2042
|
+
type: Output
|
|
2043
|
+
}], events: [{
|
|
2044
|
+
type: Input
|
|
2045
|
+
}], config: [{
|
|
2046
|
+
type: Input
|
|
2047
|
+
}] } });
|
|
2048
|
+
|
|
2049
|
+
class DayPilotMonthComponent {
|
|
2050
|
+
constructor() {
|
|
2051
|
+
this.events = [];
|
|
2052
|
+
this._requestUpdate = false;
|
|
2053
|
+
this._hashOptions = "";
|
|
2054
|
+
this._hashEvents = "";
|
|
2055
|
+
this._id = "dp_" + new Date().getTime() + rand();
|
|
2056
|
+
}
|
|
2057
|
+
get id() {
|
|
2058
|
+
return this._id;
|
|
2059
|
+
}
|
|
2060
|
+
ngOnInit() {
|
|
2061
|
+
}
|
|
2062
|
+
ngOnDestroy() {
|
|
2063
|
+
this.dispose();
|
|
2064
|
+
}
|
|
2065
|
+
ngAfterViewInit() {
|
|
2066
|
+
this.dispose();
|
|
2067
|
+
this.control = new DayPilot.Month(this.id);
|
|
2068
|
+
this.updateOptions();
|
|
2069
|
+
this.updateEvents();
|
|
2070
|
+
this._requestUpdate = false; // config just loaded and calling init(), no need to call update again
|
|
2071
|
+
this.control.init();
|
|
2072
|
+
}
|
|
2073
|
+
ngDoCheck() {
|
|
2074
|
+
if (!this.control) {
|
|
2075
|
+
return;
|
|
2076
|
+
}
|
|
2077
|
+
this.updateOptions();
|
|
2078
|
+
this.updateEvents();
|
|
2079
|
+
if (this._requestUpdate) {
|
|
2080
|
+
this.control.update();
|
|
2081
|
+
this._requestUpdate = false;
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
dispose() {
|
|
2085
|
+
if (this.control) {
|
|
2086
|
+
this.control.dispose();
|
|
2087
|
+
//@ts-ignore
|
|
2088
|
+
this.control = null;
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
updateOptions() {
|
|
2092
|
+
let hash = optHash(this.config);
|
|
2093
|
+
if (hash !== this._hashOptions) {
|
|
2094
|
+
let dp = this.control;
|
|
2095
|
+
for (let name in this.config) {
|
|
2096
|
+
dp[name] = this.config[name];
|
|
2097
|
+
}
|
|
2098
|
+
this._requestUpdate = true;
|
|
2099
|
+
}
|
|
2100
|
+
this._hashOptions = hash;
|
|
2101
|
+
}
|
|
2102
|
+
updateEvents() {
|
|
2103
|
+
let hash = optHash(this.events);
|
|
2104
|
+
if (hash !== this._hashEvents) {
|
|
2105
|
+
let dp = this.control;
|
|
2106
|
+
dp.events.list = this.events;
|
|
2107
|
+
this._requestUpdate = true;
|
|
2108
|
+
}
|
|
2109
|
+
this._hashEvents = hash;
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
DayPilotMonthComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotMonthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2113
|
+
DayPilotMonthComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: DayPilotMonthComponent, selector: "daypilot-month", inputs: { events: "events", config: "config" }, ngImport: i0, template: `
|
|
2114
|
+
<div id='{{id}}'></div>`, isInline: true, styles: [""] });
|
|
2115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotMonthComponent, decorators: [{
|
|
2116
|
+
type: Component,
|
|
2117
|
+
args: [{
|
|
2118
|
+
selector: 'daypilot-month',
|
|
2119
|
+
template: `
|
|
2120
|
+
<div id='{{id}}'></div>`,
|
|
2121
|
+
styles: [``]
|
|
2122
|
+
}]
|
|
2123
|
+
}], propDecorators: { events: [{
|
|
2124
|
+
type: Input
|
|
2125
|
+
}], config: [{
|
|
2126
|
+
type: Input
|
|
2127
|
+
}] } });
|
|
2128
|
+
|
|
2129
|
+
class DayPilotNavigatorComponent {
|
|
2130
|
+
constructor() {
|
|
2131
|
+
this.events = [];
|
|
2132
|
+
this.dateChange = new EventEmitter();
|
|
2133
|
+
this._requestUpdate = false;
|
|
2134
|
+
this._hashOptions = "";
|
|
2135
|
+
this._hashEvents = "";
|
|
2136
|
+
this._onTrs = null;
|
|
2137
|
+
this._dateSet = false;
|
|
2138
|
+
this._currentDate = null;
|
|
2139
|
+
this._date = DayPilot.Date.today();
|
|
2140
|
+
this._id = "dp_" + new Date().getTime() + rand();
|
|
2141
|
+
}
|
|
2142
|
+
get date() {
|
|
2143
|
+
return this._date;
|
|
2144
|
+
}
|
|
2145
|
+
// @Input() date: DayPilot.Date = DayPilot.Date.today();
|
|
2146
|
+
set date(value) {
|
|
2147
|
+
this._date = value;
|
|
2148
|
+
this._dateSet = true;
|
|
2149
|
+
}
|
|
2150
|
+
get id() {
|
|
2151
|
+
return this._id;
|
|
2152
|
+
}
|
|
2153
|
+
ngOnInit() {
|
|
2154
|
+
}
|
|
2155
|
+
ngOnDestroy() {
|
|
2156
|
+
this.dispose();
|
|
2157
|
+
}
|
|
2158
|
+
ngAfterViewInit() {
|
|
2159
|
+
this.dispose();
|
|
2160
|
+
this.control = new DayPilot.Navigator(this.id);
|
|
2161
|
+
let component = this;
|
|
2162
|
+
this.updateOptions();
|
|
2163
|
+
this.updateEvents();
|
|
2164
|
+
let dp = this.control;
|
|
2165
|
+
this.control.onTimeRangeSelected = function (args) {
|
|
2166
|
+
// emit event
|
|
2167
|
+
component.dateChange.emit(args.day);
|
|
2168
|
+
// call the original
|
|
2169
|
+
if (component._onTrs) {
|
|
2170
|
+
component._onTrs.call(dp, args);
|
|
2171
|
+
}
|
|
2172
|
+
};
|
|
2173
|
+
this._requestUpdate = false; // config just loaded and calling init(), no need to call update again
|
|
2174
|
+
this.control.init();
|
|
2175
|
+
if (this.control.selectionDay !== DayPilot.Date.today()) {
|
|
2176
|
+
component.dateChange.emit(this.control.selectionDay);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
ngDoCheck() {
|
|
2180
|
+
if (!this.control) {
|
|
2181
|
+
return;
|
|
2182
|
+
}
|
|
2183
|
+
this.updateOptions();
|
|
2184
|
+
this.updateEvents();
|
|
2185
|
+
if (this._requestUpdate) {
|
|
2186
|
+
this.control.update();
|
|
2187
|
+
this._requestUpdate = false;
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
dispose() {
|
|
2191
|
+
if (this.control) {
|
|
2192
|
+
this.control.dispose();
|
|
2193
|
+
//@ts-ignore
|
|
2194
|
+
this.control = null;
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
updateOptions() {
|
|
2198
|
+
let dp = this.control;
|
|
2199
|
+
let hash = optHash(this.config);
|
|
2200
|
+
if (hash !== this._hashOptions) {
|
|
2201
|
+
for (let name in this.config) {
|
|
2202
|
+
if (name === "selectionDay") {
|
|
2203
|
+
continue; // ignore
|
|
2204
|
+
}
|
|
2205
|
+
if (name === "onTimeRangeSelected") {
|
|
2206
|
+
this._onTrs = this.config.onTimeRangeSelected;
|
|
2207
|
+
}
|
|
2208
|
+
else {
|
|
2209
|
+
dp[name] = this.config[name];
|
|
2210
|
+
}
|
|
2211
|
+
this._requestUpdate = true;
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
if (this._dateSet && this.date) {
|
|
2215
|
+
this._dateSet = false;
|
|
2216
|
+
this._currentDate = dp.selectionDay;
|
|
2217
|
+
dp.select(this.date);
|
|
2218
|
+
}
|
|
2219
|
+
this._hashOptions = hash;
|
|
2220
|
+
}
|
|
2221
|
+
updateEvents() {
|
|
2222
|
+
let hash = optHash(this.events);
|
|
2223
|
+
if (hash !== this._hashEvents) {
|
|
2224
|
+
let dp = this.control;
|
|
2225
|
+
dp.events.list = this.events;
|
|
2226
|
+
this._requestUpdate = true;
|
|
2227
|
+
}
|
|
2228
|
+
this._hashEvents = hash;
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
DayPilotNavigatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotNavigatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2232
|
+
DayPilotNavigatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: DayPilotNavigatorComponent, selector: "daypilot-navigator", inputs: { events: "events", config: "config", date: "date" }, outputs: { dateChange: "dateChange" }, ngImport: i0, template: `
|
|
2233
|
+
<div id='{{id}}'></div>`, isInline: true, styles: [""] });
|
|
2234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotNavigatorComponent, decorators: [{
|
|
2235
|
+
type: Component,
|
|
2236
|
+
args: [{
|
|
2237
|
+
selector: 'daypilot-navigator',
|
|
2238
|
+
template: `
|
|
2239
|
+
<div id='{{id}}'></div>`,
|
|
2240
|
+
styles: [``]
|
|
2241
|
+
}]
|
|
2242
|
+
}], propDecorators: { events: [{
|
|
2243
|
+
type: Input
|
|
2244
|
+
}], config: [{
|
|
2245
|
+
type: Input
|
|
2246
|
+
}], dateChange: [{
|
|
2247
|
+
type: Output
|
|
2248
|
+
}], date: [{
|
|
2249
|
+
type: Input
|
|
2250
|
+
}] } });
|
|
2251
|
+
|
|
2252
|
+
const COMPONENTS = [
|
|
2253
|
+
DayPilotCalendarComponent,
|
|
2254
|
+
DayPilotMonthComponent,
|
|
2255
|
+
DayPilotNavigatorComponent
|
|
2256
|
+
];
|
|
2257
|
+
class DayPilotModule {
|
|
2258
|
+
}
|
|
2259
|
+
DayPilotModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2260
|
+
DayPilotModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotModule, declarations: [DayPilotCalendarComponent,
|
|
2261
|
+
DayPilotMonthComponent,
|
|
2262
|
+
DayPilotNavigatorComponent], exports: [DayPilotCalendarComponent,
|
|
2263
|
+
DayPilotMonthComponent,
|
|
2264
|
+
DayPilotNavigatorComponent] });
|
|
2265
|
+
DayPilotModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotModule, imports: [[]] });
|
|
2266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: DayPilotModule, decorators: [{
|
|
2267
|
+
type: NgModule,
|
|
2268
|
+
args: [{
|
|
2269
|
+
declarations: [
|
|
2270
|
+
...COMPONENTS
|
|
2271
|
+
],
|
|
2272
|
+
imports: [],
|
|
2273
|
+
exports: [
|
|
2274
|
+
...COMPONENTS
|
|
2275
|
+
]
|
|
2276
|
+
}]
|
|
2277
|
+
}] });
|
|
2278
|
+
|
|
2279
|
+
/*
|
|
2280
|
+
* Public API Surface of daypilot-lite-angular
|
|
2281
|
+
*/
|
|
2282
|
+
|
|
2283
|
+
/**
|
|
2284
|
+
* Generated bundle index. Do not edit.
|
|
2285
|
+
*/
|
|
2286
|
+
|
|
2287
|
+
export { DayPilot, DayPilotCalendarComponent, DayPilotModule, DayPilotMonthComponent, DayPilotNavigatorComponent };
|
|
2288
|
+
//# sourceMappingURL=daypilot-daypilot-lite-angular.mjs.map
|