Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Isomorphic SmartClient
- * Version v11.1p_2017-08-06 (2017-08-06)
- * Copyright(c) 1998 and beyond Isomorphic Software, Inc. All rights reserved.
- * "SmartClient" is a trademark of Isomorphic Software, Inc.
- *
- * licensing@smartclient.com
- *
- * http://smartclient.com/license
- */
- if (window.isc && window.isc.module_Core && !window.isc.module_Calendar) {
- isc.module_Calendar = 1;
- isc._moduleStart = isc._Calendar_start = (isc.timestamp ? isc.timestamp() : new Date().getTime());
- if (isc._moduleEnd && (!isc.Log || (isc.Log && isc.Log.logIsDebugEnabled('loadTime')))) {
- isc._pTM = {
- message: 'Calendar load/parse time: ' + (isc._moduleStart - isc._moduleEnd) + 'ms',
- category: 'loadTime'
- };
- if (isc.Log && isc.Log.logDebug) isc.Log.logDebug(isc._pTM.message, 'loadTime');
- else if (isc._preLog) isc._preLog[isc._preLog.length] = isc._pTM;
- else isc._preLog = [isc._pTM]
- }
- isc.definingFramework = true;
- if (window.isc && isc.version != "v11.1p_2017-08-06/LGPL Development Only" && !isc.DevUtil) {
- isc.logWarn("SmartClient module version mismatch detected: This application is loading the core module from SmartClient version '" + isc.version + "' and additional modules from 'v11.1p_2017-08-06/LGPL Development Only'. Mixing resources from different SmartClient packages is not supported and may lead to unpredictable behavior. If you are deploying resources from a single package you may need to clear your browser cache, or restart your browser." + (isc.Browser.isSGWT ? " SmartGWT developers may also need to clear the gwt-unitCache and run a GWT Compile." : ""))
- }
- isc.ClassFactory.defineClass("CalendarView", "ListGrid");
- isc.A = isc.CalendarView.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.isCalendarView = true;
- isc.A.verticalEvents = true;
- isc.A.hiliteRowOnFocus = false;
- isc.A.canHover = true;
- isc.A.showHover = null;
- isc.A.hoverByCell = null;
- isc.A.canFreezeFields = false;
- isc.A.alternateFieldStyles = false;
- isc.A.canTabToHeader = false;
- isc.A.rangeCriteriaMode = null;
- isc.A.showLaneFields = null;
- isc.A.useEventCanvasPool = true;
- isc.A.eventCanvasPoolingMode = "data";
- isc.A.hoverDelay = 0;
- isc.A.eventDragTargetDefaults = {
- _constructor: "Canvas",
- border: "1px dashed red",
- width: 1,
- height: 1,
- snapToGrid: false,
- autoDraw: false,
- moveWithMouse: false,
- dragAppearance: "target",
- dragTarget: this,
- visibility: "hidden",
- keepInParentRect: true,
- hoverMoveWithMouse: true,
- showHover: true,
- hoverDelay: 0,
- hoverProps: {
- overflow: "visible",
- hoverMoveWithMouse: this.hoverMoveWithMouse
- },
- getHoverHTML: function() {
- var _1 = this.eventCanvas,
- _2 = _1.event,
- _3 = _1.$1245;
- if (!_3) return;
- var _4 = _3.$131e,
- _5 = _3.$131f,
- _6 = this.view.calendar.createEventObject(_2, _4, _5, _3.$130b, _3.$1298);
- return this.view.calendar.$140a(this.view, _6)
- },
- setView: function(_1) {
- this.view = _1
- },
- getEventPadding: function() {
- var _1 = this.eventCanvas.calendar;
- return _1.useDragPadding ? _1.getLanePadding(this.view) : 0
- },
- fillOverlapSlots: true,
- positionToEventCanvas: function(_1) {
- var _2 = this.eventCanvas,
- _3 = _2.calendar,
- _4 = this.view,
- _5 = _4.getEventLeft(_2.event) + this.getEventPadding(),
- _6 = _2.getTop(),
- _7 = (_4.$732 ? _4.$732(_2.event) : _2.getVisibleWidth()),
- _8 = _2.getVisibleHeight(),
- _9 = _2.$1245;
- if (this.fillOverlapSlots) {
- if (_4.isTimelineView()) {
- var _10 = _2.$1245.$8l;
- _6 = _4.body.getRowTop(_10);
- if (_2.isIndicatorCanvas) {
- _8 = _2.getVisibleHeight();
- _9.$142h = true
- } else if (!_9.$1297) {
- _8 = _4.getLaneHeight(_10)
- } else {
- _6 += _9.$1298.top;
- _8 = _9.$1298.height
- }
- } else {
- var _11 = _2.$1245.$644;
- _5 = _4.body.getColumnLeft(_11);
- if (_9.$1299) {
- if (!_9.$1297) {
- _7 = _4.getLaneWidth(_11)
- } else {
- _5 += _9.$1298.left;
- _7 = _9.$1298.width
- }
- } else {
- _7 = _4.body.getColumnWidth(_11)
- }
- }
- }
- if (this.$1244) {
- if (_4.isTimelineView()) {
- _6 = _4.body.getRowTop(_2.$1245.$8l)
- } else {
- _5 = _4.body.getColumnLeft(_2.$1245.$644)
- }
- }
- if (_5 < 0) _5 = 0;
- this.moveTo(_5, _6);
- this.resizeTo(_7, _8);
- if (_1) {
- if (!this.isDrawn()) this.draw();
- this.show();
- this.bringToFront()
- }
- if (_4.shouldShowDragHovers()) isc.Hover.show(this.getHoverHTML(), this.hoverProps)
- },
- moveToEvent: function() {},
- dragRepositionStart: function() {
- var _1 = this.eventCanvas,
- _2 = _1.event,
- _3 = _1.calendar,
- _4 = this.view,
- _5 = _4.body;
- if (!_3.canDragEvent(_2)) return false;
- this.$1246 = true;
- var _6 = _5.getEventRow(),
- _7 = _5.getRowTop(_6),
- _8 = _5.getRowHeight(_4.getRecord(_6), _6),
- _9 = _4.getEventLeft(_2) + 1,
- _10 = _5.getEventColumn(_9),
- _11 = _5.getColumnLeft(_10),
- _12 = _5.getColumnWidth(_10),
- _13 = _5.getOffsetX() - _1.getLeft(),
- _14 = _5.getOffsetY() - _1.getTop();
- var _15 = _4.isTimelineView();
- var _16 = _1.$1245 = {};
- _16.$126l = !_15;
- _16.$8l = _6;
- _16.$644 = _10;
- _16.$1249 = _8;
- _16.$1248 = _12;
- _16.$117y = _15 ? _4.$732(_2) : _16.$1248;
- _16.$126o = _15 ? _16.$1249 : _1.getVisibleHeight();
- _16.$936 = _6;
- _16.$937 = _10;
- _16.$116y = _13;
- _16.$1247 = _14;
- _16.$126p = Math.round(_16.$126o / _16.$1249);
- _16.$126q = _4.data.getLength() - _16.$126p;
- _16.$126r = _4.getRowTop(_16.$126q);
- _16.$126s = _15 ? _5.getScrollWidth() - _16.$117y : _5.getColumnLeft(_5.fields.length - 1);
- _16.$126t = _15 ? _5.getEventColumn(_16.$126s) : _5.fields.length - 1;
- _16.$131e = _3.getEventStartDate(_2);
- _16.$131f = _3.getEventEndDate(_2);
- _16.$142s = _16.$131e.duplicate();
- _16.$142t = _16.$131f.duplicate();
- _16.$1670 = _4.getDateFromPoint() || _16.$131e.duplicate();
- _16.$131h = _16.$1670.duplicate();
- _16.$1299 = _4.hasLanes() && !_1.isIndicatorCanvas && !_1.isZoneCanvas;
- if (_16.$1299) {
- var _17 = _4.getLane(_2[_3.laneNameField]),
- _18 = !_17 || !_17.sublanes ? null : _17.sublanes.find(_3.laneNameField, _2[_3.sublaneNameField]);
- _16.$130a = _17;
- _16.$130b = _17;
- _16.$1297 = _3.useSublanes && _17 && _17.sublanes && _17.sublanes.length > 0;
- _16.$130c = _18;
- _16.$1298 = _18;
- _16.$130d = !_3.canEditEventLane(_2, _4);
- _16.$130e = !_3.canEditEventSublane(_2, _4)
- }
- this.positionToEventCanvas(true);
- return isc.EH.STOP_BUBBLING
- },
- dragRepositionMove: function() {
- var _1 = this.eventCanvas,
- _2 = _1.$1245,
- _3 = _1.event,
- _4 = _1.calendar,
- _5 = this.view,
- _6 = _4.getSnapGapPixels(_5),
- _7 = _5.isTimelineView(),
- _8 = _5.body,
- _9 = this.getEventPadding(),
- _10 = _2.$142h != null ? _2.$142h : -1,
- _11 = -1,
- _12 = -1,
- _13 = -1;
- var _14 = _5.getDateFromPoint();
- if (!_14) return;
- var _15 = _5.getLaneFromPoint();
- if (_2.$1299 && !_15) return;
- if (_2.$131h && _2.$131h.getTime() == _14.getTime() && _2.$130b && _2.$130b == _15) return;
- if (_2.$1299) {
- var _16 = _15,
- _17 = _2.$1297 ? _5.getSublaneFromPoint() : null;
- if (!_16 || _5.isGroupNode(_16)) {
- _16 = _2.$130b;
- _17 = _2.$1298
- } else {
- if (_2.$130d) {
- _16 = _2.$130a;
- if (_2.$1297 && (_2.$130e || !_16.sublanes.contains(_17))) {
- _17 = _2.$130c
- }
- } else {
- if (_2.$1297) {
- if (_2.$130e) {
- var _18 = _16.sublanes ? _16.sublanes.find(_4.laneNameField, _2.$130c.name) : null;
- if (_18) {
- _17 = _18
- } else {
- _16 = _2.$130b;
- _17 = _2.$1298
- }
- } else {
- if (_16 != _2.$130b) {
- if (!_16.sublanes) {
- _16 = _2.$130b;
- _17 = _2.$1298
- }
- }
- }
- }
- }
- }
- if (_7) {
- var _19 = _5.getRecordIndex(_16);
- _10 = _5.getRowTop(_19);
- if (_17) _10 += _17.top;
- _13 = (_17 ? _17.height : _16.height);
- _2.$936 = _19
- } else {
- var _19 = _5.getLaneIndex(_16[_4.laneNameField]);
- _11 = _5.body.getColumnLeft(_19);
- _12 = _5.getLaneWidth(_16[_4.laneNameField]);
- if (_17) {
- _11 += _17.left;
- _12 = _17.width
- }
- _2.$937 = _19
- }
- }
- var _20 = _8.getEventRow(),
- _21 = Math.min(_2.$126q, (_20 < 0 ? 0 : _20)),
- _22 = _8.getRowTop(_21),
- _23 = _8.getOffsetY(),
- _24 = Math.floor((Math.floor((_23 - _22) / _6)) * _6),
- _25 = _7 ? _22 : Math.min(_2.$126r, _22 + _24),
- _26 = this.getVisibleHeight(),
- _27 = _26;
- var _28 = _14.getTime() - _2.$131h.getTime(),
- _29 = _28 < 0 ? -1 : _28 == 0 ? 0 : 1,
- _30 = Math.floor(Math.abs(_28) / _5.getTimePerSnapGap("ms"));
- var _31 = _4.addSnapGapsToDate(_2.$131e, _5, _30 * _29);
- var _32 = _4.addSnapGapsToDate(_2.$131f, _5, _30 * _29);
- var _33 = _31.duplicate();
- var _34 = _32.duplicate();
- if (_7) {
- if (_31.getTime() < _4.startDate.getTime()) {
- _33 = _4.startDate.duplicate()
- }
- if (_32.getTime() > _4.endDate.getTime()) {
- _34 = _4.endDate.duplicate()
- }
- }
- var _35 = Math.min(_2.$126t, _8.getEventColumn()),
- _36 = _8.getColumnLeft(_35),
- _37 = (_8.getOffsetX() - _2.$116y),
- _38 = Math.max(0, _37 - ((_37 - _36) % _6) + 1),
- _39 = _5.getDateFromPoint(_38, _25, null, true),
- _40 = Math.min(_2.$126s, (_7 ? _4.getDateLeftOffset(_39, _5) : _36)),
- _41 = _40 + (_7 ? (_2.$117y) : _1.getVisibleWidth());
- if (!_7) {
- if (_21 != _2.$936) {
- if (_21 < 0) {
- _21 = 0;
- _25 = 0
- } else {
- var _42 = _22 + _2.$126o;
- var _43 = _8.getEventRow(_22 + _2.$126o - _2.$1249);
- if (_43 < 0) {
- _21 = _2.$936;
- _25 = _8.getRowTop(_21)
- } else {
- _2.$936 = _21
- }
- }
- }
- }
- var _44 = _5.isTimelineView() ? (_10 >= 0 && _13 >= 0) : (_2.$1299 ? (_11 >= 0 && _12 >= 0) : false)
- if (!_44) {
- _2.$936 = _21
- }
- if (_35 != _2.$937) {
- if (_5.isDayView() || _5.isWeekView()) {
- if (_5.isDayView() && _4.showDayLanes && !_4.canEditEventLane(_3, _5)) {
- _35 = _2.$937;
- _40 = _2.$117z
- } else {
- if (_35 == -1) _2.$937 = 0;
- else if (_35 == -2) _2.$937 = _2.$937;
- else _2.$937 = _35;
- _40 = _8.getColumnLeft(_2.$937)
- }
- } else {
- _2.$937 = Math.max(1, _35)
- }
- }
- var _45 = Math.max(0, (_10 >= 0 ? _10 : _25)),
- _42 = Math.min(_5.body.getScrollHeight(), _45 + _2.$126o);
- if (!_5.isTimelineView()) {
- _31 = _5.getDateFromPoint(_40 + 1, _45 + 1);
- _32 = _5.getDateFromPoint(_41 - (!_5.isTimelineView() ? 1 : 0), _42);
- _33 = _31.duplicate();
- _34 = _32.duplicate()
- }
- if (_5.isDayView() || _5.isWeekView()) {
- if (_31.getDate() != _32.getDate()) {
- _32 = isc.DateUtil.getEndOf(_31, "d")
- }
- }
- var _46 = _32.duplicate();
- _46.setTime(_32.getTime() - 1);
- var _47 = true;
- var _48 = _4.createEventObject(_3, _31, _46, _16 && _16[_4.laneNameField], _17 && _17[_4.laneNameField]);
- _47 = _4.eventRepositionMove(_3, _48, this);
- if (_44) {
- if (_7) {
- _45 = _10;
- _2.$125b = _13;
- _40 = _5.getDateLeftOffset(_33);
- _41 = _5.getDateRightOffset(_34);
- _2.$117y = _41 - _40;
- this.resizeTo(_2.$117y, _13)
- } else {
- _40 = _11;
- _2.$131b = _12;
- this.resizeTo(_12, null)
- }
- _2.$1298 = _17;
- _2.$130b = _16
- } else {
- if (_45 + _27 > _5.body.getScrollHeight() - 1) {
- _27 = _5.body.getScrollHeight() - 1 - _45
- }
- _2.$125b = _27;
- this.resizeTo(null, _27)
- }
- _2.$125a = _45;
- _2.$117z = _40;
- _2.$131e = _31.duplicate();
- _2.$131f = _32.duplicate();
- _2.$131h = _14.duplicate();
- if (_47) {
- _2.$142s = _31.duplicate();
- _2.$142t = _32.duplicate();
- this.setDragCursor("default")
- } else {
- this.setDragCursor("not-allowed")
- }
- this.moveTo(_2.$117z, _2.$125a);
- if (_5.shouldShowDragHovers()) isc.Hover.show(this.getHoverHTML(), this.hoverProps);
- return isc.EH.STOP_BUBBLING
- },
- dragRepositionStop: function() {
- var _1 = this.eventCanvas,
- _2 = _1.$1245,
- _3 = _1.calendar,
- _4 = this.view,
- _5 = _4.body,
- _6 = _1.event;
- if (_4.shouldShowDragHovers()) isc.Hover.hide();
- this.hide();
- var _7 = (this.cursor != "default" && _3.eventUseLastValidDropDates != true);
- this.setDragCursor("default");
- if (_7) return;
- if (_1.isIndicatorCanvas) {
- var _8 = _3.indicators.find(_3.nameField, _6[_3.nameField]);
- _8[_3.startDateField] = _2.$142s;
- _1.calendarView.drawIndicators();
- _1.calendarView.drawZones();
- return isc.EH.STOP_BUBBLING
- }
- var _9 = _2.$1299 && _3.canEditEventLane(_6, _4),
- _10 = _2.$1299 && _3.canEditEventSublane(_6, _4),
- _11, _12;
- if (_4.isTimelineView()) {
- if (_9 || _10) {
- if (_9) _11 = _2.$130b[_3.laneNameField];
- if (_10 && _3.useSublanes && _2.$1298) {
- _12 = _2.$1298[_3.laneNameField]
- }
- }
- } else if (_4.isDayView() && _3.showDayLanes) {
- if (_9 || _10) {
- if (_9) _11 = _2.$130b[_3.laneNameField];
- if (_10 && _3.useSublanes && _2.$1298) {
- _12 = _2.$1298[_3.laneNameField]
- }
- } else return false
- }
- var _13 = [_2.$142s.duplicate(), _2.$142t.duplicate()];
- var _14 = _13[0].getTime() - _3.getEventStartDate(_6).getTime(),
- _15 = Math.floor(_14 / (1000 * 60)),
- _16 = {};
- if (_4.isTimelineView()) {
- if (_6[_3.leadingDateField] && _6[_3.trailingDateField]) {
- _13.add(_6[_3.leadingDateField].duplicate());
- _13[2].setMinutes(_13[2].getMinutes() + _15);
- _13.add(_6[_3.trailingDateField].duplicate());
- _13[3].setMinutes(_13[3].getMinutes() + _15);
- _16[_3.leadingDateField] = _13[2];
- _16[_3.trailingDateField] = _13[3]
- }
- }
- if (_11 == null) _11 = _6[_3.laneNameField];
- if (_3.adjustEventTimes) {
- var _17 = _3.adjustEventTimes(_6, _1, _13[0], _13[1], _11);
- if (_17) {
- _13[0] = _17[0].duplicate();
- _13[1] = _17[1].duplicate()
- }
- }
- if (_3.allowEventOverlap == false) {
- var _18 = _3.checkForOverlap(_4, _1, _6, _13[0], _13[1], _11);
- if (_18 == true) {
- if (_3.timelineEventOverlap) {
- _3.timelineEventOverlap(false, _6, _1, _13[0], _13[1], _11)
- }
- return false
- } else if (isc.isAn.Array(_18)) {
- _13[0] = _18[0].duplicate();
- _13[1] = _18[1].duplicate();
- if (_3.timelineEventOverlap) {
- _3.timelineEventOverlap(true, _6, _1, _13[0], _13[1], _11)
- }
- }
- }
- if (_3.isZeroLengthEvent(_6)) _13[1] = null;
- if (_13[0] != _2.$142s) _2.$142s = _13[0];
- if (_13[1] != _2.$142t) _2.$142t = _13[1];
- var _19 = _3.createEventObject(_6, _2.$142s, _2.$142t, _2.$130b && _2.$130b[_3.laneNameField], _2.$1298 && _2.$1298[_3.laneNameField]);
- var _20 = _3.eventRepositionStop(_6, _19, _16, this);
- this.$1246 = false;
- if (_20 != false) {
- if (_4.isTimelineView()) {
- if (_3.timelineEventMoved(_6, _2.$142s, _2.$142t, _11) == false) return false
- } else {
- if (_3.eventMoved(_2.$142s, _6, _11) == false) return false
- }
- _3.updateCalendarEvent(_6, _19)
- }
- delete _1.$1245;
- return isc.EH.STOP_BUBBLING
- },
- dragResizeStart: function() {
- var _1 = this.eventCanvas,
- _2 = _1.event,
- _3 = _1.calendar,
- _4 = this.view,
- _5 = _4.body;
- if (!_3.canResizeEvent(_1.event)) return false;
- this.$1244 = true;
- var _6 = _5.getEventRow(),
- _7 = _5.getRowTop(_6),
- _8 = _5.getRowHeight(_4.getRecord(_6), _6),
- _9 = _5.getEventColumn(),
- _10 = _5.getColumnLeft(_9),
- _11 = _5.getColumnWidth(_9),
- _12 = _5.getOffsetX() - _1.getLeft(),
- _13 = _5.getOffsetY() - _1.getTop(),
- _14 = _1.getVisibleWidth(),
- _15 = _4.hasLanes(),
- _16 = _4.isTimelineView(),
- _17 = _16 && (_12 < _14 / 2),
- _18 = _15 ? _4.getLaneFromPoint() : null,
- _19 = _18 && _3.useSublanes ? _3.getSublaneFromPoint() : null;
- var _20 = {
- $1299: _4.hasLanes(),
- $1297: _3.useSublanes,
- $117z: _16 ? _4.getDateLeftOffset(_3.getEventStartDate(_2)) : _10 + (_15 && _19 ? _19.left : 0),
- $1171: _1.getLeft() + _14,
- $125a: _16 ? _7 + (_19 ? _19.top : 0) : _1.getTop(),
- $125b: (_16 ? (_19 ? _19.height : _18.height) : _1.getVisibleHeight()),
- $131b: _16 ? _1.getVisibleWidth() : (_19 ? _19.width : (_18 && _4.getLaneWidth ? _4.getLaneWidth(_2[_3.laneNameField]) : _11)),
- $1172: _17,
- $131q: _16 && !_17,
- $131g: !_16,
- $131e: _3.getEventStartDate(_1.event),
- $131f: _3.getEventEndDate(_1.event),
- $130b: _18,
- $1298: _19
- };
- if (_20.$125a == -1) {
- _20.$125a = 0;
- _20.$125b -= _5.getScrollTop()
- }
- _1.$1245 = _20;
- this.positionToEventCanvas(true);
- _20.$1827 = false;
- return isc.EH.STOP_BUBBLING
- },
- dragResizeMove: function() {
- var _1 = this.eventCanvas,
- _2 = _1.$1245,
- _3 = _1.event,
- _4 = _1.calendar,
- _5 = this.view,
- _6 = _2.$125a,
- _7 = _2.$117z,
- _8 = _2.$125b,
- _9 = _2.$131b,
- _10 = _2.$131e,
- _11 = _2.$131f,
- _12 = isc.DateUtil;
- var _13 = _5.getDateFromPoint();
- if (_2.$131g) {
- _11 = _4.addSnapGapsToDate(_13, _5, 1);
- if (_11.getDate() != _10.getDate()) {
- _11 = isc.DateUtil.getEndOf(_10, "d")
- }
- var _14 = _5.getDateTopOffset(_11);
- _8 = _14 - _6
- } else if (_2.$1172) {
- if (!_13) _13 = _5.startDate.duplicate();
- _10 = _13;
- var _15 = _7 + _9;
- if (_3[_4.durationField] != null) {
- var _16 = _11.getTime() - _10.getTime(),
- _17 = _3[_4.durationUnitField],
- _18 = _12.getTimeUnitMilliseconds(_17);
- if (_16 % _18 != 0) {
- var _19 = Math.round(_12.convertPeriodUnit(_16, "ms", _17)),
- _10 = _12.dateAdd(_11.duplicate(), _17, _19 * -1)
- }
- }
- _7 = _5.getDateLeftOffset(_10);
- _9 = (_15 - _7)
- } else {
- if (!_13) _13 = _5.endDate.duplicate();
- else _13 = _4.addSnapGapsToDate(_13.duplicate(), _5, 1);
- _11 = _13.duplicate();
- var _20 = _4.getVisibleEndDate(_5);
- if (_11.getTime() > _20.getTime()) {
- _11.setTime(_20.getTime())
- }
- if (_3[_4.durationField] != null) {
- var _16 = _11.getTime() - _10.getTime(),
- _17 = _3[_4.durationUnitField],
- _18 = _12.getTimeUnitMilliseconds(_17);
- if (_16 % _18 != 0) {
- var _19 = Math.round(_12.convertPeriodUnit(_16, "ms", _17)),
- _11 = _12.dateAdd(_10.duplicate(), _17, _19)
- }
- }
- var _7 = _5.getDateLeftOffset(_10),
- _15 = _5.getDateLeftOffset(_11);
- _9 = _15 - _7
- }
- if (_11.getTime() <= _10.getTime() || _9 <= 0 || _8 <= 0) {
- return isc.EH.STOP_BUBBLING
- }
- var _21 = _4.createEventObject(_3, _10, _11)
- var _22 = _4.eventResizeMove(_3, _21, _5, _2);
- _2.$131e = _10;
- _2.$131f = _11;
- _2.$125a = _6;
- _2.$117z = _7;
- _2.$131b = _9;
- _2.$125b = _8;
- this.resizeTo(_2.$131b, _2.$125b);
- this.moveTo(_2.$117z, _2.$125a);
- if (_22 != false) {
- _2.$1827 = false;
- _2.$142s = _10.duplicate();
- _2.$142t = _11.duplicate();
- this.setDragCursor("default")
- } else {
- _2.$1827 = true;
- this.setDragCursor("not-allowed")
- }
- if (_5.shouldShowDragHovers()) isc.Hover.show(this.getHoverHTML(), this.hoverProps);
- return isc.EH.STOP_BUBBLING
- },
- setDragCursor: function(_1) {
- var _2 = this.getCurrentCursor();
- if (_2 == _1) return;
- this.setCursor(_1);
- this.view.setCursor(_1);
- if (this.view.body) this.view.body.setCursor(_1);
- if (this.view.frozenBody) this.view.frozenBody.setCursor(_1);
- isc.EH.lastEvent.target.setCursor(_1)
- },
- dragResizeStop: function() {
- var _1 = this.eventCanvas,
- _2 = _1.$1245,
- _3 = _1.calendar,
- _4 = this.view,
- _5 = _1.event,
- _6 = _2.$142s,
- _7 = _2.$142t;
- if (_2.$1827 && !_3.eventUseLastValidDropDates) {
- _6 = null;
- _7 = null
- }
- this.setDragCursor("default");
- if (_4.shouldShowDragHovers()) isc.Hover.hide();
- this.hide();
- if ((_2.$1172 && !_6) || (_2.$131q && !_7)) {
- this.$1244 = false;
- return isc.EH.STOP_BUBBLING
- }
- var _8 = _3.createEventObject(_5, _6);
- if (_5[_3.durationField] != null) {
- var _9 = _7.getTime() - _6.getTime();
- var _10 = Math.round(isc.DateUtil.convertPeriodUnit(_9, "ms", _5[_3.durationUnitField]));
- _8[_3.durationField] = _10;
- _7 = _2.$142t = _3.getEventEndDate(_8)
- }
- _8[_3.endDateField] = _7;
- var _11 = _3.eventResizeStop(_5, _8, null, this);
- if (_11 != false) {
- if (_4.isTimelineView()) {
- if (_3.timelineEventResized(_5, _6, _7) == false) return false
- } else {
- if (_3.eventResized(_7, _5) == false) return false
- }
- _3.updateCalendarEvent(_5, _8)
- }
- this.$1244 = false;
- return isc.EH.STOP_BUBBLING
- }
- };
- isc.A.$171d = "center";
- isc.B.push(isc.A.mouseUp = function isc_CalendarView_mouseUp() {
- return isc.EH.STOP_BUBBLING
- }, isc.A.mouseDown = function isc_CalendarView_mouseDown() {
- return isc.EH.STOP_BUBBLING
- }, isc.A.initWidget = function isc_CalendarView_initWidget() {
- this.$27q = {};
- this.$1743 = [];
- this.$1725 = [];
- var _1 = this.calendar;
- var _2 = this.showHover;
- if (_2 == null) _2 = _1.showViewHovers;
- this.setShowHover(_2);
- this.Super("initWidget", arguments);
- if (this.installLocalHandlers) this.installLocalHandlers()
- }, isc.A.setEventData = function isc_CalendarView_setEventData(_1) {
- this.$1743 = _1
- }, isc.A.getEventData = function isc_CalendarView_getEventData() {
- if (!this.$1743) this.$1743 = [];
- return this.$1743
- }, isc.A.addEventData = function isc_CalendarView_addEventData(_1) {
- var _2 = this.getEventData();
- if (!_2.contains(_1)) {
- _2.add(_1);
- return true
- }
- return false
- }, isc.A.removeEventData = function isc_CalendarView_removeEventData(_1) {
- this.getEventData().remove(_1)
- }, isc.A.viewMouseMove = function isc_CalendarView_viewMouseMove(_1, _2, _3, _4, _5) {
- if (!this.showRollOver || !this.isTimelineView()) return true;
- if (!this.isDrawn() || !this.isVisible()) return;
- if (!this.body || !this.body.isDrawn() || !this.body.isVisible()) return;
- var _6 = isc.EH.lastEvent,
- _7 = this.body.containsPoint(_6.x, _6.y, true),
- _8 = !_7 && this.frozenBody && this.frozenBody.containsPoint(_6.x, _6.y, true);
- if (_8 || _7) {
- var _9 = _7 ? this.body : this.frozenBody;
- var _10 = this.$1744 = {};
- _10.x = _9.getOffsetX();
- _10.y = _9.getOffsetY();
- _10.rowNum = _9.getEventRow(_10.y);
- _10.colNum = _9.getEventColumn(_10.x);
- if (_7) {}
- if (this.showRollOver && this.body.lastOverRow != _10.rowNum && this.hasLanes()) {
- if (_10.rowNum < 0) this.updateLaneRollover(null);
- else this.updateLaneRollover(_10.rowNum)
- }
- if (this.mouseDataChanged) this.mouseDataChanged(this.$1744)
- }
- }, isc.A.viewDragMove = function isc_CalendarView_viewDragMove(_1) {
- this.logInfo("In viewDragMove");
- this.viewMouseMove()
- }, isc.A.getMouseData = function isc_CalendarView_getMouseData() {
- return this.$1744
- }, isc.A.getFieldTitle = function isc_CalendarView_getFieldTitle(_1) {
- var _2 = this.calendar,
- _3 = this.Super("getFieldTitle", arguments),
- _4 = this.getUnderlyingField(_1);
- if (_4) {
- var _5 = _4.date,
- _6 = _5 ? _5.getDay() : _4.$654;
- if (_6 != null) {
- if (_2.getDateHeaderTitle) {
- _3 = _2.getDateHeaderTitle(_5, _6, _3, this) || _3
- }
- }
- }
- return _3
- }, isc.A.getMinimumSnapGapTime = function isc_CalendarView_getMinimumSnapGapTime(_1) {
- var _2 = this.$27q,
- _3 = _2.minimumSnapGapMillis;
- if (!_3) {
- var _4 = [1, 5, 10, 15, 20, 30, 60, 120, 180, 240, 360, 480, 720, 1440];
- var _5 = isc.DateUtil.convertPeriodUnit(_2.millisPerPixel, "ms", "mn");
- for (var i = 0; i < _4.length; i++) {
- if (_5 <= _4[i]) {
- _5 = _4[i];
- break
- }
- }
- _3 = isc.DateUtil.convertPeriodUnit(_5, "mn", "ms")
- }
- if (!_1) _1 = "mn";
- return Math.floor(isc.DateUtil.convertPeriodUnit(_3, "ms", _1))
- }, isc.A.getTimePerCell = function isc_CalendarView_getTimePerCell(_1) {
- var _2 = this.calendar,
- _3 = this.$27q,
- _4 = _3.millisPerCell;
- if (!_4) {
- _4 = isc.DateUtil.convertPeriodUnit(_2.minutesPerRow, "mn", "ms")
- }
- if (!_1) _1 = "mn";
- return Math.floor(isc.DateUtil.convertPeriodUnit(_4, "ms", _1))
- }, isc.A.getTimePerSnapGap = function isc_CalendarView_getTimePerSnapGap(_1) {
- var _2 = this.calendar,
- _3 = this.$27q,
- _4 = _3.millisPerSnapGap;
- if (!_4) {
- if (_3.calendarEventSnapGap == null) {
- _4 = this.getTimePerCell("ms")
- } else if (_3.calendarEventSnapGap == 0) {
- _4 = this.getMinimumSnapGapTime("ms")
- } else {
- _4 = isc.DateUtil.convertPeriodUnit(_3.calendarEventSnapGap, "mn", "ms")
- }
- _3.millisPerSnapGap = _4
- }
- if (!_1) _1 = "mn";
- return isc.DateUtil.convertPeriodUnit(_4, "ms", _1)
- }, isc.A.getTimePerPixel = function isc_CalendarView_getTimePerPixel(_1) {
- var _2 = this.calendar,
- _3 = this.$27q;
- var _4 = Math.floor(this.getTimePerCell("ms") / this.getRowHeight(this.getRecord(0), 0));
- if (!_1) _1 = "mn";
- return isc.DateUtil.convertPeriodUnit(_4, "ms", _1)
- }, isc.A.getSnapGapPixels = function isc_CalendarView_getSnapGapPixels(_1, _2) {
- var _3 = this.getTimePerCell() / this.getTimePerSnapGap();
- return this.getRowHeight(this.getRecord(_1), _1) / _3
- }, isc.A.getDateLabelText = function isc_CalendarView_getDateLabelText(_1, _2) {
- return null
- }, isc.A.setShowHover = function isc_CalendarView_setShowHover(_1) {
- if (this.showViewHovers == false) return;
- this.showHover = _1;
- this.canHover = _1
- }, isc.A.shouldShowEventHovers = function isc_CalendarView_shouldShowEventHovers() {
- if (this.showHover == false || this.calendar.showViewHovers == false) return false;
- if (this.showEventHovers != null) return this.showEventHovers;
- return this.calendar.showEventHovers
- }, isc.A.shouldShowHeaderHovers = function isc_CalendarView_shouldShowHeaderHovers() {
- if (this.showHover == false || this.calendar.showViewHovers == false) return false;
- if (this.showHeaderHovers != null) return this.showHeaderHovers;
- return this.calendar.showHeaderHovers
- }, isc.A.shouldShowLaneFieldHovers = function isc_CalendarView_shouldShowLaneFieldHovers() {
- if (this.showHover == false) return false;
- if (this.showLaneFieldHovers != null) return this.showLaneFieldHovers;
- return this.calendar.showLaneFieldHovers
- }, isc.A.shouldShowCellHovers = function isc_CalendarView_shouldShowCellHovers() {
- if (this.showHover == false) return false;
- if (this.showCellHovers != null) return this.showCellHovers;
- return this.calendar.showCellHovers
- }, isc.A.shouldShowDragHovers = function isc_CalendarView_shouldShowDragHovers() {
- if (this.showHover == false) return false;
- if (this.showDragHovers != null) return this.showDragHovers;
- return this.calendar.showDragHovers
- }, isc.A.shouldShowZoneHovers = function isc_CalendarView_shouldShowZoneHovers() {
- if (this.shouldShowCellHovers()) return false;
- if (this.showZoneHovers != null) return this.showZoneHovers;
- return this.calendar.showZoneHovers
- }, isc.A.isSelectedView = function isc_CalendarView_isSelectedView() {
- return this.calendar.getCurrentViewName() == this.viewName
- }, isc.A.isTimelineView = function isc_CalendarView_isTimelineView() {
- return this.viewName == "timeline"
- }, isc.A.isDayView = function isc_CalendarView_isDayView() {
- return this.viewName == "day"
- }, isc.A.isWeekView = function isc_CalendarView_isWeekView() {
- return this.viewName == "week"
- }, isc.A.isMonthView = function isc_CalendarView_isMonthView() {
- return this.viewName == "month"
- }, isc.A.updateLaneRollover = function isc_CalendarView_updateLaneRollover(_1) {
- if (!this.isTimelineView()) return;
- this.clearLastHilite();
- if (_1 == null) return;
- this.body.lastOverRow = _1;
- this.body.updateRollOver(_1)
- }, isc.A.rebuild = function isc_CalendarView_rebuild(_1) {
- if (_1 == null) _1 = true;
- if (this.$152e) this.$152e(_1);
- else if (this.rebuildFields) this.rebuildFields();
- else this.refreshEvents()
- }, isc.A.initCacheValues = function isc_CalendarView_initCacheValues() {
- var _1 = this.calendar;
- this.$27q = {
- firstDayOfWeek: this.firstDayOfWeek,
- rangeStartDate: _1.getPeriodStartDate(this),
- rangeEndDate: _1.getPeriodEndDate(this),
- calendarEventSnapGap: _1.eventSnapGap
- };
- this.$27q.rangeStartMillis = this.$27q.rangeStartDate.getTime();
- this.$27q.rangeEndMillis = this.$27q.rangeEndDate.getTime();
- this.updateSnapProperties();
- return this.$27q
- }, isc.A.updateSnapProperties = function isc_CalendarView_updateSnapProperties() {
- delete this.$27q.millisPerCell;
- delete this.$27q.millisPerSnapGap;
- delete this.$27q.millisPerPixel;
- delete this.$27q.snapGapPixels;
- this.$27q.millisPerCell = this.getTimePerCell("ms");
- this.$27q.millisPerPixel = this.getTimePerPixel("ms");
- this.$27q.minimumSnapGapMillis = this.getMinimumSnapGapTime("ms");
- this.$27q.millisPerSnapGap = this.getTimePerSnapGap("ms")
- }, isc.A.getLaneIndex = function isc_CalendarView_getLaneIndex(_1) {
- return null
- }, isc.A.getLane = function isc_CalendarView_getLane(_1) {
- return null
- }, isc.A.getLaneFromPoint = function isc_CalendarView_getLaneFromPoint(_1, _2) {
- return null
- }, isc.A.getSublane = function isc_CalendarView_getSublane(_1, _2) {
- if (!this.hasSublanes()) return null;
- var _3 = this.getLane(_1),
- _4 = _3 && _3.sublanes ? isc.isAn.Object(_2) ? _2 : _3.sublanes.find(this.calendar.laneNameField, _2) : null;
- return _4
- }, isc.A.getSublaneFromPoint = function isc_CalendarView_getSublaneFromPoint(_1, _2) {
- return null
- }, isc.A.hasLanes = function isc_CalendarView_hasLanes() {
- return this.isTimelineView() || (this.isDayView() && this.calendar.showDayLanes)
- }, isc.A.hasSublanes = function isc_CalendarView_hasSublanes() {
- return this.calendar.useSublanes && this.hasLanes()
- }, isc.A.useLanePadding = function isc_CalendarView_useLanePadding() {
- if (this.isTimelineView()) return true;
- if (this.hasLanes()) {
- return this.calendar.eventOverlap ? false : true
- }
- return false
- }, isc.A.getCellCSSText = function isc_CalendarView_getCellCSSText(_1, _2, _3) {
- var _4 = this.calendar.$116j(this, _1, _2, _3);
- return _4
- }, isc.A.getEventCanvasStyle = function isc_CalendarView_getEventCanvasStyle(_1) {
- if (this.hasLanes()) {
- var _2 = this.calendar,
- _3 = _2.laneNameField,
- _4 = _2.sublaneNameField,
- _5 = _2.eventStyleNameField,
- _6 = this.getLane(_1[_3]),
- _7 = _6 && _2.useSublanes ? this.getSublane(_6[_3], _1[_4]) : null;
- return (_7 && _7.eventStyleName) || (_6 && _6.eventStyleName) || this.eventStyleName
- }
- return this.eventStyleName
- }, isc.A.getDateFromPoint = function isc_CalendarView_getDateFromPoint() {
- return this.getCellDate()
- }, isc.A.mouseMove = function isc_CalendarView_mouseMove() {
- var _1 = this.calendar,
- _2 = this.$131h,
- _3 = isc.EH.lastEvent.target,
- _4 = (_3 != this.body ? this.frozenBody && this.frozenBody.lastMouseOverRow : this.body && this.body.lastMouseOverRow),
- _5 = (_3 != this.body ? this.frozenBody && this.frozenBody.lastMouseOverCol : (this.body && this.body.lastMouseOverCol) + (this.frozenFields ? this.frozenFields.length : 0)),
- _6 = this.getDateFromPoint();
- this.$140b = _3;
- _1.$140c(this, _3, _6 ? _6.duplicate() : null, _2, _4, _5);
- this.$131h = _6;
- if (this.$53r) {
- if (this.isTimelineView()) this.cellOver()
- }
- return true
- });
- isc.evalBoundary;
- isc.B.push(isc.A.getHoverHTML = function isc_CalendarView_getHoverHTML() {
- var _1 = this.getEventRow(),
- _2 = this.getEventColumn(),
- _3 = this.getRecord(_1);
- var _4 = this.calendar.$140d(this, _3, _1, _2);
- return _4
- }, isc.A.getPrintHTML = function isc_CalendarView_getPrintHTML(_1, _2) {
- if (this.isMonthView()) return this.Super("getPrintHTML", arguments);
- if (_2) {
- this.delayCall("asyncGetPrintHTML", [_1, _2]);
- return null
- } else {
- return this.asyncGetPrintHTML(_1, _2)
- }
- }, isc.A.asyncGetPrintHTML = function isc_CalendarView_asyncGetPrintHTML(_1, _2) {
- this.$158l = true;
- this.refreshVisibleEvents(null, true, "asyncGetPrintHTML");
- _1 = isc.addProperties({}, _1);
- this.body.printChildrenAbsolutelyPositioned = true;
- var _3 = this.calendar,
- _4 = this.isTimelineView(),
- _5 = this.isWeekView(),
- _6 = this.isDayView(),
- _7 = this.isMonthView();
- if (_7) return;
- var _8 = this.getFields(),
- _9 = this.getData(),
- _10 = isc.StringBuffer.create(),
- _11 = 0,
- _12 = [];
- for (var i = 0; i < _8.length; i++) {
- var _14 = _8[i];
- var _15 = this.getFieldHeaderButton(_14.masterIndex);
- var _16 = _15 ? _15.width || _15.getVisibleWidth() : null;
- if (_16 == null) _16 = this.getFieldWidth(_14);
- _12.add(_16)
- }
- _11 = _12.sum();
- var _17 = "<TR",
- _18 = "</TR>",
- _19 = ">",
- _20 = " HEIGHT=",
- _21 = " VALIGN=";
- var _22 = 40;
- _10.append("<div style='position:relative;'>");
- _10.append("<TABLE cellpadding='0' cellspacing='0' WIDTH=", _11, " style='", "border: 1px solid grey;'>");
- _10.append("<THEAD>");
- if (this.showHeader) {
- _10.append(this.getPrintHeaders(0, this.fields.length, _12))
- }
- _10.append("</THEAD>");
- _22 += this.getHeaderHeight();
- _10.append("<TBODY>");
- for (var i = 0; i < _9.length; i++) {
- var _23 = this.getRowHeight(_9[i], i);
- _10.append(_17, _20, _23, _19);
- for (var j = 0; j < _8.length; j++) {
- var _25 = this.getCellValue(_9[i], i, j);
- _10.append("<TD class='", this.getCellStyle(_9[i], i, j), "' ", "style='width:", _12[j] - 1, "px; min-width:", _12[j] - 1 + "px;", "border-width: 0px 1px 1px 0px; ", "border-bottom: 1px solid #ABABAB; border-right: 1px solid #ABABAB; ", "border-top: none; border-left: none;", this.getCellCSSText(_9[i], i, j), "'>");
- _10.append(this.getCellValue(_9[i], i, j) || " ");
- _10.append("</TD>")
- }
- _10.append(_18)
- }
- _10.append("</TBODY>");
- _10.append("</TABLE>");
- var _26 = this.body.children;
- for (var i = 0, _27 = _26.length; i < _27; i++) {
- var _28 = _26[i],
- _29 = _28.isEventCanvas || _28.isZoneCanvas || _28.isIndicatorCanvas;
- if (!_29) continue;
- if (!_28.isDrawn() || !_28.isVisible()) continue;
- if (_28.isZoneCanvas) _1.i = 0;
- else if (_28.isIndicatorCanvas) _1.i = _27;
- else _1.i = i;
- var _30 = _28.getPrintHTML(_1);
- _10.append(_30)
- }
- _10.append("</div>");
- var _16 = _10.release(false);
- if (_2) {
- this.fireCallback(_2, "HTML", [_16])
- }
- delete this.$158l;
- return _16
- }, isc.A.getPrintHeaders = function isc_CalendarView_getPrintHeaders(_1, _2, _3) {
- var _4 = (this.isRTL() ? isc.Canvas.LEFT : isc.Canvas.RIGHT),
- _5 = this.headerBaseStyle,
- _6 = this.getHeaderHeight(),
- _7;
- if (this.headerSpans) {
- var _8 = [],
- _9 = 1;
- for (var i = _1; i < _2; i++) {
- var _11 = this.getField(i);
- _8[i] = [_11];
- var _12 = this.spanMap[_11.name];
- while (_12 != null) {
- _8[i].add(_12);
- _12 = _12.parentSpan
- }
- _9 = Math.max(_8[i].length, _9)
- }
- _7 = [];
- for (var i = _9 - 1; i >= 0; i--) {
- _7[_7.length] = "<TR HEIGHT=23>";
- var _13 = null,
- _14 = null;
- for (var _15 = _1; _15 < _2; _15++) {
- var _16 = 1,
- _17 = 1;
- var _18 = (i == 0);
- var _19 = _8[_15][i];
- if (_19 == "spanned") {
- continue
- }
- var _20, _21 = _15,
- _22 = [];
- _17 = 0;
- while (_21 < _2) {
- var _23 = null,
- _24 = false;
- for (var _25 = 0;
- (i - _25) >= 0; _25++) {
- _23 = _8[_21][i - _25];
- if (_23 != null) {
- if (_19 == null) {
- _19 = _23;
- _20 = _25;
- if (i - _25 == 0) {
- _18 = true
- }
- }
- if (_19 == _23) {
- _22[_17] = _25;
- _20 = Math.min(_25, _20)
- } else {
- _24 = true
- }
- break
- }
- }
- if (_24) {
- break
- }
- _21++;
- _17++
- }
- if (_20 != null) {
- _16 = _20 + 1
- }
- for (var _26 = 0; _26 < _22.length; _26++) {
- var _27 = _8[_26 + _15],
- _25 = _22[_26];
- for (var _28 = 0; _28 <= _25; _28++) {
- if (_26 == 0 && _28 == 0) {
- _27[i - _28] = _19
- } else if (_28 <= _20) {
- _27[i - _28] = "spanned"
- } else {
- _27[i - _28] = null
- }
- }
- }
- if (_19 == null) {
- this.logWarn("Error in getPrintHeaders() - unable to generate print header HTML from this component's specified headerSpans")
- }
- var _29 = "center",
- _30;
- if (_18) {
- _29 = _19.align || _4;
- _30 = this.getHeaderButtonTitle(_19.masterIndex)
- } else {
- _30 = _19.title
- }
- var _31 = _7.length;
- _7[_7.length] = "<TD class='";
- _7[_7.length] = _5;
- _7[_7.length] = "' align='";
- _7[_7.length] = "center";
- _7[_7.length] = "' rowSpan='";
- _7[_7.length] = _16;
- _7[_7.length] = "' colSpan='";
- _7[_7.length] = _17;
- _7[_7.length] = "' ";
- _7[_7.length] = "style='margin: 0px; padding: 0px; width:" + _3[_19.masterIndex] + "px; height:23px; border-width: 0px 1px 1px 0px;' ";
- _7[_7.length] = ">";
- _7[_7.length] = _30;
- _7[_7.length] = "</TD>"
- }
- _7[_7.length] = "</TR>"
- }
- } else {
- _7 = ["<TR HEIGHT=23>"];
- var _32 = ["<TD CLASS='", _5, "' ALIGN="].join(""),
- _33 = this.frozenBody ? this.frozenBody.fields.length : 0;
- if (this.frozenBody) {
- for (var _34 = 0; _34 < _33; _34++) {
- var _11 = this.frozenBody.fields[_34];
- if (!_11) continue;
- var _29 = _11.align || _4;
- var _35 = _3[_34];
- _7.addList([_32, _29, " style='width:" + _35 + "px; padding:0px; margin:0px;'>", this.getHeaderButtonTitle(_11.masterIndex), "</TD>"])
- }
- }
- for (var _34 = 0; _34 < (_2 - _33); _34++) {
- var _11 = this.body.fields[_34];
- if (!_11) continue;
- var _29 = _11.align || _4;
- var _35 = _3[_34 + _33];
- _7.addList([_32, _29, " style='width:" + _35 + "px;'>", this.getHeaderButtonTitle(_11.masterIndex), "</TD>"])
- }
- _7[_7.length] = "</TR>"
- }
- return _7.join(isc.emptyString)
- }, isc.A.scrolled = function isc_CalendarView_scrolled() {
- if (this.renderEventsOnDemand && this.refreshVisibleEvents) {
- delete this.$27q.viewportStartMillis;
- delete this.$27q.viewportEndMillis;
- var _1 = this;
- if (this.$57s) isc.Timer.clear(this.$57s);
- this.$57s = isc.Timer.setTimeout(function() {
- this.$57s = null;
- _1.refreshVisibleEvents(null, null, "scrolled")
- })
- }
- }, isc.A.resized = function isc_CalendarView_resized(_1, _2, _3) {
- this.Super('resized', arguments);
- if (this.renderEventsOnDemand && !this.$81r && this.isDrawn()) {
- this.refreshVisibleEvents(null, null, "resized");
- this.logInfo("Calendar " + this.viewName + " view resized - reason is '" + (_3 || "no reason") + " -- w/h is " + this.body.getVisibleWidth() + "/" + this.body.getVisibleHeight(), "calendar")
- }
- }, isc.A.forceDataSort = function isc_CalendarView_forceDataSort(_1, _2) {
- var _3 = this.calendar,
- _4 = [];
- if (this.isTimelineView() || (this.isDayView() && _3.showDayLanes)) {
- _4.add({
- property: _3.laneNameField,
- direction: "ascending"
- })
- }
- if (_3.overlapSortSpecifiers) {
- _4.addList(_3.overlapSortSpecifiers)
- } else {
- _4.add({
- property: _3.startDateField,
- direction: "ascending"
- })
- }
- if (_2 || !_1) {
- if (!_1) _1 = this.getEventData()
- }
- _1.setSort(_4)
- }, isc.A.findEventsInRange = function isc_CalendarView_findEventsInRange(_1, _2, _3, _4) {
- var _5 = this.calendar,
- _6 = {},
- _7 = _3 != null && (this.isTimelineView() || (this.isDayView() && _5.showDayLanes));
- _6[_5.startDateField] = _1;
- _6[_5.endDateField] = _2;
- if (_7) _6[_5.laneNameField] = _3;
- var _8 = this.findOverlappingEvents(_6, _6, [_6], _7, _4, true);
- return _8
- }, isc.A.findOverlappingEvents = function isc_CalendarView_findOverlappingEvents(_1, _2, _3, _4, _5, _6) {
- var _7 = this.calendar,
- _8 = _5 != null;
- var _9 = _8 ? _5 : this.getEventData();
- if (!_8) this.forceDataSort(_9, _6);
- var _10 = [],
- _11 = _9.getLength(),
- _12 = _7.getEventStartDate(_2),
- _13 = _7.getEventEndDate(_2);
- var _14 = {};
- var _15 = _4 ? _1[_7.laneNameField] : null,
- _16 = 0;
- if (_15) _16 = _9.findIndex(_7.laneNameField, _15);
- if (_16 < 0) return _10;
- var _17 = this.isTimelineView();
- for (var i = _16; i < _11; i++) {
- var _19 = _9.get(i);
- if (!_19) {
- isc.logWarn('findOverlappingEvents: potentially invalid index: ' + i);
- break
- }
- if (_4 && _19[_7.laneNameField] != _15) break;
- var _20 = false;
- if (_3 && _3.length > 0) {
- for (var j = 0; j < _3.length; j++) {
- if (_7.eventsAreSame(_19, _3[j])) {
- _20 = true;
- break
- }
- }
- if (_20) continue
- }
- if (_17) {
- if (_19[_7.leadingDateField] && _19[_7.trailingDateField]) {
- _14[_7.leadingDateField] = _2[_7.leadingDateField];
- _14[_7.trailingDateField] = _2[_7.trailingDateField];
- if (_14[_7.trailingDateField].getTime() > this.endDate.getTime()) {
- _14[_7.trailingDateField].setTime(this.endDate.getTime() - 1)
- }
- } else {
- _14[_7.startDateField] = _12;
- _14[_7.endDateField] = _13;
- if (_14[_7.endDateField].getTime() > this.endDate.getTime()) {
- _14[_7.endDateField].setTime(this.endDate.getTime() - 1)
- }
- }
- } else {
- var _22 = isc.DateUtil.getStartOf(_13, "d").getTime(),
- _23 = isc.DateUtil.getEndOf(_12, "d").getTime(),
- _24 = _7.getEventStartDate(_19),
- _25 = _24.getTime(),
- _26 = _7.getEventEndDate(_19),
- _27 = _26.getTime();
- if (_25 > _23 || _27 < _22) continue;
- if (_25 < _22 && _27 > _23) {
- if (this.isWeekView()) continue;
- _25 = _22
- }
- _14[_7.startDateField] = _12;
- _14[_7.endDateField] = _13;
- if (_14[_7.endDateField].getTime() > _23) {
- _14[_7.endDateField].setTime(_23)
- }
- }
- _14[_7.laneNameField] = _19[_7.laneNameField];
- if (this.eventsOverlap(_14, _19, _4)) {
- _10.add(_19)
- }
- }
- return _10
- }, isc.A.eventsOverlap = function isc_CalendarView_eventsOverlap(_1, _2, _3) {
- var a = _1,
- _5 = a["_" + this.viewName] || {},
- b = _2,
- _7 = b["_" + this.viewName] || {},
- _8 = this.calendar,
- _9 = _8.startDateField,
- _10 = _8.endDateField;
- if (_3 && a[_8.laneNameField] != b[_8.laneNameField]) return false;
- if (this.isTimelineView()) {
- if (a[_8.leadingDateField] && b[_8.leadingDateField]) _9 = _8.leadingDateField;
- if (a[_8.trailingDateField] && b[_8.trailingDateField]) _10 = _8.trailingDateField
- }
- var _11 = a[_9],
- _12 = a[_10] || _8.getEventEndDate(a),
- _13 = _11.duplicate(),
- _14 = _12.duplicate(),
- _15 = b[_9],
- _16 = b[_10] || _8.getEventEndDate(b),
- _17 = _15.duplicate(),
- _18 = _16.duplicate();
- if (this.isTimelineView()) {
- if (_15.getTime() > this.endDate.getTime()) return false;
- if (_16.getTime() < this.startDate.getTime()) return false;
- if (_17.getTime() < _14.getTime() && _18.getTime() > _13.getTime()) return true;
- var _19 = Math.round(_8.getSnapGapPixels(this));
- _13 = _5.snapStartLeftOffset || this.getDateLeftOffset(_11);
- _14 = Math.max((_5.snapEndLeftOffset || this.getDateRightOffset(_12)), (_13 + _19));
- _17 = _7.snapStartLeftOffset || this.getDateLeftOffset(_15);
- _18 = Math.max((_7.snapEndLeftOffset || this.getDateRightOffset(_16)), (_17 + _19))
- }
- if (_8.equalDatesOverlap && _8.allowEventOverlap) {
- if ((_13 < _17 && _14 >= _18 && _13 <= _18) || (_13 <= _18 && _14 > _18) || (_13 <= _17 && _14 >= _18) || (_13 >= _17 && _14 <= _18)) {
- return true
- } else {
- return false
- }
- } else {
- if (_17 < _14 && _18 > _13) return true;
- return false
- }
- }, isc.A.updateEventRange = function isc_CalendarView_updateEventRange(_1, _2) {
- if (!isc.isAn.Object(_2)) _2 = this.overlapRanges.ranges[_2];
- var _3 = _2.events;
- _3.remove(_1);
- this.updateOverlapRanges(_3)
- }, isc.A.updateOverlapRanges = function isc_CalendarView_updateOverlapRanges(_1) {
- var _2 = this.calendar,
- _3 = _1 || this.getEventData(),
- _4 = this.overlapRanges || [],
- _5 = _3.getLength(),
- _6 = this.isTimelineView(),
- _7 = _6 || (this.isDayView() && _2.showDayLanes),
- _8 = !_6,
- _9 = [],
- _10 = this.startDate,
- _11 = this.endDate;
- if (isc.isA.ResultSet(_3)) {
- _3 = _3.allRows
- }
- _3.setProperty("$122k", false);
- _3.setProperty("$646", null);
- _3.setProperty("$126u", null);
- var _12 = _7 && _2.lanes ? isc.getKeys(_2.getLaneMap()) : [];
- _3.setSort([{
- property: _2.laneNameField,
- direction: "ascending"
- }, {
- property: _2.startDateField,
- direction: "ascending"
- }, {
- property: _2.endDateField,
- direction: "descending"
- }]);
- for (var i = 0; i < _5; i++) {
- var _14 = _3.get(i);
- var _15 = {
- events: [_14]
- };
- _15[_2.startDateField] = _2.getEventStartDate(_14);
- _15[_2.endDateField] = _2.getEventEndDate(_14);
- _15[_2.laneNameField] = _15.lane = _7 ? _14[_2.laneNameField] : null;
- var _16 = true;
- for (var j = 0; j < _4.length; j++) {
- if (_15[_2.laneNameField] != _4[j][_2.laneNameField]) continue;
- if (this.eventsOverlap(_15, _4[j], _7)) {
- this.mergeOverlapRanges(_15, _4[j]);
- _16 = false
- }
- if (!_16) break
- }
- if (_16) {
- _4.add(_15);
- if (!_9.contains(_15)) _9.add(_15)
- }
- }
- for (i = 0; i < _4.length; i++) {
- var _18 = _4[i];
- _18.id = "range_" + i + "_lane_" + _18.lane;
- _18.events.setProperty("overlapRangeId", _18.id);
- if (!_6) _18.colNum = this.getColFromDate(_18[_2.startDateField], _18[_2.laneNameField])
- }
- this.overlapRanges = _4;
- return _9
- }, isc.A.getTouchedOverlapRanges = function isc_CalendarView_getTouchedOverlapRanges(_1, _2, _3) {
- if (!this.overlapRanges) this.overlapRanges = [];
- var _4 = true,
- _5 = this.calendar,
- _6 = this.overlapRanges,
- r = {},
- _8 = [];
- r[_5.startDateField] = _1;
- r[_5.endDateField] = _2;
- r[_5.laneNameField] = _3;
- for (var k = 0; k < _6.length; k++) {
- var _10 = _6[k];
- if (_3 != null && _10[_5.laneNameField] != _3) continue;
- var _11 = this.eventsOverlap(r, _10, true);
- if (_11) {
- _8.add(_10)
- }
- }
- return _8
- }, isc.A.mergeOverlapRanges = function isc_CalendarView_mergeOverlapRanges(_1, _2) {
- if (!isc.isAn.Array(_1)) _1 = [_1];
- var _3 = this.calendar,
- _4 = _3.startDateField,
- _5 = _3.endDateField,
- b = _2;
- for (var i = 0; i < _1.length; i++) {
- var a = _1[i];
- if (a[_4] < b[_4]) b[_4] = a[_4];
- if (a[_5] > b[_5]) b[_5] = a[_5];
- if (a.totalSlots > b.totalSlots) b.totalSlots = a.totalSlots;
- b.events.addList(a.events);
- b.events = b.events.getUniqueItems()
- }
- }, isc.A.getEventLaneIndex = function isc_CalendarView_getEventLaneIndex(_1) {
- return this.getLaneIndex(_1[this.calendar.laneNameField])
- }, isc.A.getEventLane = function isc_CalendarView_getEventLane(_1) {
- return this.getLane(_1[this.calendar.laneNameField])
- }, isc.A.hasOverlapRanges = function isc_CalendarView_hasOverlapRanges() {
- return this.overlapRanges != null && this.overlapRanges.length > 0
- }, isc.A.getLaneOverlapRanges = function isc_CalendarView_getLaneOverlapRanges(_1) {
- if (!this.hasOverlapRanges()) return;
- var _2 = this.calendar,
- _3 = [];
- this.overlapRanges.map(function(_4) {
- if (_4[_2.laneNameField] == _1) _3.add(_4)
- });
- return _3
- }, isc.A.getDayOverlapRanges = function isc_CalendarView_getDayOverlapRanges(_1) {
- if (!this.hasOverlapRanges()) return;
- var _2 = this.getColFromDate(_1);
- if (_2 >= 0) return this.getColOverlapRanges(_2)
- }, isc.A.getColOverlapRanges = function isc_CalendarView_getColOverlapRanges(_1) {
- if (!this.hasOverlapRanges()) return;
- var _2 = this.overlapRanges.findAll("colNum", _1);
- return _2
- }, isc.A.removeOverlapRanges = function isc_CalendarView_removeOverlapRanges(_1) {
- if (!this.hasOverlapRanges() || !_1) return;
- _1.map(function(_2) {
- _2.events.setProperty("overlapRangeId", null)
- });
- this.overlapRanges.removeList(_1)
- }, isc.A.getEventOverlapRange = function isc_CalendarView_getEventOverlapRange(_1) {
- if (!this.hasOverlapRanges()) return;
- return this.overlapRanges.find("id", _1.overlapRangeId);
- }, isc.A.getDateOverlapRange = function isc_CalendarView_getDateOverlapRange(_1, _2) {
- if (!this.hasOverlapRanges()) return;
- var _3 = this.calendar,
- _4 = _1.getTime();
- var _5 = this.overlapRanges.map(function(_6) {
- if (_4 >= _6[_3.startDateField].getTime() && _4 <= _6[_3.endDateField].getTime() && (!_2 || _2 == _6[_3.laneNameField])) {
- return _6
- }
- });
- if (_5) _5.removeEmpty();
- return _5 && _5.length && _5[0] ? _5[0] : null
- }, isc.A.retagLaneEvents = function isc_CalendarView_retagLaneEvents(_1) {
- if (!this.hasLanes()) return;
- var _2 = this.getLane(_1);
- if (this.isTimelineView()) {
- this.retagRowEvents(_2, true)
- } else {
- this.retagColumnEvents(_2, true)
- }
- }, isc.A.retagDayEvents = function isc_CalendarView_retagDayEvents(_1) {
- if (this.isTimelineView()) return;
- var _2 = this.getColFromDate(_1);
- this.retagColumnEvents(_2, false)
- }, isc.A.retagColumnEvents = function isc_CalendarView_retagColumnEvents(_1, _2) {
- if (this.isTimelineView()) return;
- var _3;
- if (isc.isA.Number(_1)) {
- _3 = this.body.getField(_1)
- } else {
- _3 = _1;
- _1 = this.body.getFieldNum(_3)
- }
- this.removeOverlapRanges(this.getColOverlapRanges(_1));
- var _4 = this.getDateFromCol(_1);
- if (!_4) return;
- var _5 = _4,
- _6 = isc.DateUtil.getEndOf(_4, "d");
- var _7 = this.findEventsInRange(_5, _6, (_2 ? _3.name : null));
- this.renderEvents(_7, _2)
- }, isc.A.retagRowEvents = function isc_CalendarView_retagRowEvents(_1) {
- if (!this.isTimelineView()) return;
- var _2 = this.calendar,
- _3;
- if (isc.isA.Number(_1)) {
- _3 = this.getRecord(_1)
- } else {
- _3 = _1;
- _1 = this.isGrouped ? this.getGroupedRecordIndex() : this.getRecordIndex(_3)
- }
- var _4 = _3[_2.laneNameField];
- this.removeOverlapRanges(this.getLaneOverlapRanges(_4));
- var _5 = this.startDate,
- _6 = this.endDate;
- var _7 = this.findEventsInRange(_5, _6, _4);
- this.renderEvents(_7, true)
- }, isc.A.retagOverlapRange = function isc_CalendarView_retagOverlapRange(_1, _2, _3) {
- var _4 = this.calendar,
- _5 = this.getTouchedOverlapRanges(_1, _2, _3),
- _6 = _5 ? _5[0] : null,
- _7 = _1.duplicate(),
- _8 = _2.duplicate();
- if (_6) {
- _5.removeAt(0);
- this.mergeOverlapRanges(_5, _6);
- _7 = _6[_4.startDateField];
- _8 = _6[_4.endDateField];
- this.removeOverlapRanges(_5);
- this.removeOverlapRanges([_6]);
- var _9 = this.findEventsInRange(_7, _8, _3, _6.events);
- this.renderEvents(_9, (_3 != null))
- } else {
- var _9 = this.findEventsInRange(_7, _8, _3, this.getEventData());
- this.renderEvents(_9, (_3 != null))
- }
- }, isc.A.sortForRender = function isc_CalendarView_sortForRender(_1) {
- var _2 = this.calendar,
- _3 = [];
- if (this.isTimelineView() || (this.isDayView() && _2.showDayLanes)) {
- _3.add({
- property: _2.laneNameField,
- direction: "ascending"
- })
- }
- if (_2.overlapSortSpecifiers) {
- _3.addList(_2.overlapSortSpecifiers)
- } else {
- _3.addList([{
- property: "$126u",
- direction: "ascending"
- }, {
- property: _2.startDateField,
- direction: "ascending"
- }])
- }
- _1.setSort(_3)
- }, isc.A.renderEvents = function isc_CalendarView_renderEvents(_1, _2) {
- if (!_1 || _1.length == 0) return;
- this.tagDataForOverlap(_1, _2);
- this.sortForRender(_1);
- var _3 = this.calendar,
- _4 = this.isTimelineView(),
- _5 = _2 ? (_4 ? this.body.getVisibleRows() : this.body.getVisibleColumns()) : [],
- _6 = this;
- for (var i = 0; i < _1.length; i++) {
- var _8 = _1.get(i),
- _9 = _8.$646,
- _10 = _2 ? _6.getLaneIndex(_8[_3.laneNameField]) : null;
- if (!_2 || (_10 >= _5[0] && _10 <= _5[1])) {
- var _11 = this.getCurrentEventCanvas(_8);
- if (_11) {
- if (_11.setEvent) _11.setEvent(_8);
- else _11.event = _8;
- _6.sizeEventCanvas(_11, false)
- } else {
- this.addEvent(_8)
- }
- }
- }
- }, isc.A.sizeEventCanvas = function isc_CalendarView_sizeEventCanvas(_1, _2) {
- if (!_1 || !_1.event || Array.isLoading(_1.event)) return;
- var _3 = this.calendar;
- if (_3 == null) return;
- var _4 = _1.event,
- _5 = this.isTimelineView(),
- _6 = this.isWeekView(),
- _7 = this.hasLanes(),
- _8 = _3.getEventStartDate(_4),
- _9 = _3.getEventEndDate(_4);
- if (_2) _1.hide();
- var _10, _11, _12, _13, _14 = _7 ? this.getLaneIndex(_4[_3.laneNameField]) : null,
- _15 = _7 ? this.getLane(_4[_3.laneNameField]) : null,
- _16 = _3.getLanePadding(this);;
- if (_5) {
- if (!_15) return;
- _13 = this.getLaneHeight(_15);
- _12 = Math.round(this.$732(_4));
- var _17 = Math.round(_3.getSnapGapPixels(this));
- if (_3.isDurationEvent(_4) && _3.getEventDuration(_4) == 0) {
- _17 = _3.zeroLengthEventSize + (_16 * 2)
- }
- _12 = Math.max(_12, _17);
- _11 = this.getDateLeftOffset(_8);
- _10 = this.getRowTop(_14);
- if (_16 > 0) {
- _10 += _16;
- _11 += _16;
- _12 -= (_16 * 2);
- _13 -= (_16 * 2);
- if (_17 > (_16 * 2)) _17 -= (_16 * 2)
- }
- if (_3.eventsOverlapGridLines) {
- _11 -= 1;
- _12 += 1;
- _10 -= 1;
- _13 += 1
- }
- if (this.eventDragGap > 0) {
- _12 = Math.max(this.eventDragGap, _12 - this.eventDragGap)
- }
- _12 = Math.max(_12, _17)
- } else {
- if (_1.$172y) {
- delete _1.$172y.$184b;
- delete _1.$172y.$963
- }
- var _18;
- if (this.isDayView()) {
- if (_3.showDayLanes) _18 = _14;
- else _18 = 0
- } else {
- _18 = this.getColFromDate(_8)
- }
- _11 = this.body.getColumnLeft(_18);
- _12 = this.body.getColumnWidth(_18);
- var _19 = this.body.getRowHeight(this.getRecord(1), 1),
- _20 = _9.getHours() == 0 && _9.getDate() != _8.getDate() ? 24 : _9.getHours(),
- _21 = false,
- _22 = this.getTimePerCell(),
- _23 = _3.getRowsPerHour(this);
- if (_9.getDate() > _8.getDate()) {
- _21 = true;
- _20 = 24
- }
- _10 = this.getRowTop(_8.getHours() * _23);
- _13 = (_20 - _8.getHours()) * (_19 * _23);
- _13 -= 1;
- if (_3.showDayLanes) {
- if (_16 > 0) {
- _10 += _16;
- _11 += _16;
- _12 -= (_16 * 2);
- _13 -= (_16 * 2)
- }
- }
- var _24 = _8.getMinutes();
- if (_24 > 0) {
- var _25 = _3.getMinutePixels(_24, _19, this);
- _13 -= _25;
- _10 += _25
- }
- if (_9.getMinutes() > 0 && !_21) {
- _13 += _3.getMinutePixels(_9.getMinutes(), _19, this)
- }
- if (_3.eventsOverlapGridLines) {
- _11 -= 1;
- _12 += 1;
- _10 -= 1;
- _13 += 1
- }
- }
- if (_3.useSublanes && _15 && _15.sublanes) {
- this.sizeEventCanvasToSublane(_1, _15, _11, _10, _12, _13)
- } else {
- this.adjustDimensionsForOverlap(_1, _11, _10, _12, _13)
- }
- if (_1.setDescriptionText) {
- if (_3.showEventDescriptions != false) {
- _1.setDescriptionText(_4[_3.descriptionField])
- } else {
- _1.setDescriptionText(_4[_3.nameField])
- }
- } else {
- _1.markForRedraw()
- }
- if (_5 && _4 != null) {
- if (_4[_3.leadingDateField] && _4[_3.trailingDateField]) {
- if (_1.$645) this.addLeadingAndTrailingLines(_1);
- else this.delayCall("addLeadingAndTrailingLines", [_1])
- }
- }
- }, isc.A.adjustDimensionsForOverlap = function isc_CalendarView_adjustDimensionsForOverlap(_1, _2, _3, _4, _5) {
- var _6 = this.calendar,
- _7 = _1.event.$646,
- _8 = this.isTimelineView(),
- _9 = this.useLanePadding(),
- _10 = _9 ? _6.getLanePadding(this) : 0,
- _11 = _9 ? Math.floor(_10 / 2) : 0,
- _12 = _9 && _7 ? (_7.totalSlots - 1) * _10 : 0;
- if (_7.slotNum == null) {
- _7.slotNum = 1
- }
- if (_7 && _7.totalSlots > 0) {
- var _13;
- if (_8) {
- _13 = Math.floor((_5 - _12) / _7.totalSlots);
- _5 = _13;
- if (_7.slotCount) {
- _5 *= _7.slotCount;
- _5 += (_7.slotCount - 1) * _10
- }
- if (_7.totalSlots != 1) {
- if (_7.slotNum == _7.totalSlots) _5 -= _11
- }
- _3 = _3 + Math.floor((_13 * (_7.slotNum - 1)));
- if (_7.slotNum > 1) _3 += (_10 * (_7.slotNum - 1))
- } else {
- _13 = Math.floor((_4 - _12) / _7.totalSlots);
- _4 = _13;
- if (_7.slotCount) {
- _4 *= _7.slotCount;
- _4 += (_7.slotCount - 1) * _10
- }
- if (_7.totalSlots != 1) {
- if (_7.slotNum == _7.totalSlots) _4 -= _11
- }
- _2 = _2 + Math.floor((_13 * (_7.slotNum - 1)));
- if (!_6.eventOverlap && _7.slotNum > 1) _2 += (_10 * (_7.slotNum - 1));
- if (_6.eventOverlap && _7.$64m != false) {
- if (_7.slotNum > 1) {
- _2 -= Math.floor(_13 * (_6.eventOverlapPercent / 100));
- _4 += Math.floor(_13 * (_6.eventOverlapPercent / 100))
- }
- }
- var _14 = !_7 ? true : (_7.slotNum == _7.totalSlots || (_7.slotNum + _7.slotCount) - 1 == _7.totalSlots);
- if (_14) {
- _4 -= _6.eventDragGap || 1
- }
- }
- } else {
- if (_8) {} else {
- _4 -= _6.eventDragGap || 1
- }
- }
- if (_6.eventsOverlapGridLines) {
- if (_8) {
- if (_7 && _7.totalSlots > 1) _5 += 1
- } else {
- _5 += 1;
- if (_7 && _7.slotNum > 0 && !_6.eventOverlap) {
- _4 += 1
- }
- }
- }
- _1.renderEvent(_3, _2, _4, _5)
- }, isc.A.sizeEventCanvasToSublane = function isc_CalendarView_sizeEventCanvasToSublane(_1, _2, _3, _4, _5, _6) {
- var _7 = this.calendar,
- _8 = _1.event,
- _9 = _2.sublanes,
- _10 = _9.findIndex("name", _8[this.calendar.sublaneNameField]),
- _11 = this.isTimelineView(),
- _12 = _9.length,
- _13 = _7.getLanePadding(this),
- _14 = 0;
- if (_10 < 0) return;
- for (var i = 0; i <= _10; i++) {
- if (i == _10) {
- if (_11) {
- _4 += _14;
- _6 = _9[i].height - _13
- } else {
- _3 += _14;
- _5 = _9[i].width - _13;
- if (_3 + _5 + 1 < this.body.getScrollWidth()) _5 += 1;
- if (_4 + _6 + 1 < this.body.getScrollHeight()) _6 += 1
- }
- break
- }
- if (_11) _14 += _9[i].height;
- else _14 += _9[i].width
- }
- if (_10 > 0 && _13 > 0) {
- if (_11) _6 -= Math.floor(_13 / _9.length);
- else _5 -= Math.floor(_13 / _9.length)
- }
- _1.renderEvent(_4, _3, _5, _6)
- }, isc.A.getOverlapSlot = function isc_CalendarView_getOverlapSlot(_1, _2) {
- var _3 = {
- slotNum: _1,
- events: [],
- snapGaps: []
- };
- for (var i = 0; i < _2; i++) _3.snapGaps[i] = 0;
- return _3
- }, isc.A.getSnapData = function isc_CalendarView_getSnapData(_1, _2, _3, _4, _5, _6) {
- var _7 = this.calendar,
- _8 = this.getTimePerSnapGap("mn"),
- _9 = this.getSnapGapPixels(0),
- _10 = {};
- if (_3 != null) {
- var d = (isc.isA.Date(_3) ? _3.duplicate() : new Date(_3));
- if (!_6) d.setTime(d.getTime() + 1);
- _10.startY = this.getDateTopOffset(d, _5);
- var _12 = isc.DateUtil.dateAdd(d.duplicate(), "mn", _8);
- if (d.getDate() == _12.getDate()) {
- _10.endY = this.getDateTopOffset(d, _5)
- } else {
- _10.endY = this.body.getScrollHeight()
- }
- _10.index = Math.floor(_10.startY / _9);
- _10[_7.startDateField] = this.getDateFromPoint(null, _10.startY);
- _10[_7.endDateField] = this.getDateFromPoint(null, _10.endY)
- }
- return _10
- }, isc.A.tagDataForOverlap = function isc_CalendarView_tagDataForOverlap(_1, _2) {
- _1 = _1 || this.getEventData();
- if (_1.getLength() == 0) return;
- var _3 = this.calendar,
- _4 = [],
- _5 = 0,
- _6 = 0,
- _7 = 0,
- _8 = this.isTimelineView();
- if (_3.eventAutoArrange == false) return;
- this.forceDataSort(_1);
- var _9 = _1.get(0),
- _10 = _9[_3.laneNameField];
- var _11 = [];
- _1.setProperty("$646", null);
- _1.setProperty("$126u", null);
- var _12 = this.isTimelineView() || (this.isDayView() && _3.showDayLanes);
- var _13 = this.updateOverlapRanges(_1);
- var _14 = [];
- if (_12) {
- _14.add({
- property: _3.laneNameField,
- direction: "ascending"
- })
- }
- if (_3.overlapSortSpecifiers) {
- _14.addList(_3.overlapSortSpecifiers)
- } else {
- _14.add({
- property: "eventLength",
- direction: "descending"
- });
- _14.add({
- property: _3.startDateField,
- direction: "ascending"
- });
- _14.add({
- property: _3.endDateField,
- direction: "ascending"
- })
- }
- var _15 = false;
- if (_15) {
- this.logWarn("tagDataForOverlap: about to loop over " + _13.length + " overlap ranges")
- }
- for (var j = 0; j < _13.length; j++) {
- var _17 = _13[j];
- if (_15) {
- this.logWarn("range: " + isc.echoFull(_17) + "")
- }
- var _18 = this.getSnapData(null, null, _17[_3.startDateField], null, _17[_3.laneNameField]),
- _19 = _18 ? _18.index : 0,
- _20 = this.getSnapData(null, null, _17[_3.endDateField], null, _17[_3.laneNameField], true),
- _21 = _20 ? _20.index : this.$1725.length - 1,
- _22 = (_21 - _19) + 1,
- _23 = [],
- _24 = 1;
- _23[0] = this.getOverlapSlot(0, _22);
- var _25 = _17.events;
- _25.setSort(_14);
- for (var _26 = 0; _26 < _25.length; _26++) {
- var _27 = _25[_26];
- _27.$646 = {};
- var _28 = _27.$646;
- var _29 = _3.getEventStartDate(_27),
- _30 = _3.getEventEndDate(_27);
- _28.eventStartSnap = this.getSnapData(null, null, _29.getTime() + 1, null, _27[_3.laneNameField]);
- _28.eventEndSnap = this.getSnapData(null, null, _30.getTime() - 1, null, _27[_3.laneNameField]);
- var _31 = (_28.eventStartSnap ? _28.eventStartSnap.index : _28.nextValidSnap.index) - _19;
- var _32 = (_28.eventEndSnap ? _28.eventEndSnap.index : _28.lastValidSnap.index) - _19;
- var _33 = false;
- var _34 = null;
- for (var _35 = 0; _35 < _24; _35++) {
- var _36 = _23[_35].snapGaps.slice(_31, _32 + 1);
- var _37 = _36.sum() > 0;
- if (!_37) {
- _33 = true;
- _23[_35].snapGaps.fill(1, _31, _32 + 1);
- _23[_35].events.add(_27);
- _27.$646.slotNum = _35
- if (_15) {
- this.logWarn("event " + _27.name + " occupying slot " + _35)
- }
- break
- }
- }
- if (!_33) {
- _23[_24] = this.getOverlapSlot(_24, _22);
- _23[_24].snapGaps.fill(1, _31, _32 + 1);
- _23[_24].events.add(_27);
- _27.$646.slotNum = _24
- if (_15) {
- this.logWarn("event " + _27.name + " added to new slot index " + _24)
- }
- _24++
- }
- }
- for (var i = 0; i < _23.length; i++) {
- var _34 = _23[i];
- for (var _39 = 0; _39 < _34.events.length; _39++) {
- var _27 = _34.events[_39];
- var _28 = _27.$646;
- _28.totalSlots = _24;
- var _31 = (_28.eventStartSnap ? _28.eventStartSnap.index : _19) - _19;
- var _32 = (_28.eventEndSnap ? _28.eventEndSnap.index : _19) - _19;
- var _33 = false;
- for (var _40 = i + 1; _40 < _23.length; _40++) {
- var _36 = _23[_40].snapGaps.slice(_31, _32 + 1);
- var _37 = _36.sum() > 0;
- if (_37) {
- _28.slotCount = _40 - _28.slotNum;
- _33 = true;
- break
- }
- }
- if (!_33) {
- _28.slotCount = _24 - _28.slotNum
- }
- _28.slotNum++;
- _27.$126u = _28.slotNum
- }
- }
- _17.slotList = _23;
- if (_15) {
- this.logWarn("***** slotList *****\n" + isc.echoFull(_23))
- }
- }
- }, isc.A.getVisibleDateRange = function isc_CalendarView_getVisibleDateRange(_1) {
- var _2 = this.calendar;
- if (_1) {
- return [_2.getVisibleStartDate(this), _2.getVisibleEndDate(this)]
- } else if (this.$27q.viewportStartMillis) {
- return [new Date(this.$27q.viewportStartMillis), new Date(this.$27q.viewportEndMillis)]
- }
- if (!this.renderEventsOnDemand) {
- if (this.isTimelineView()) {
- return [this.startDate.duplicate(), this.endDate.duplicate()]
- } else if (this.isWeekView()) {
- return [_2.chosenWeekStart, _2.chosenWeekEnd]
- } else if (this.isDayView()) {
- return [_2.chosenDateStart, _2.chosenDateEnd]
- } else if (this.isMonthView()) {
- return [isc.DateUtil.getStartOf(_2.chosenDate, "M"), isc.DateUtil.getEndOf(_2.chosenDate, "M")]
- }
- }
- if (this.isTimelineView()) {}
- var _3 = this.body.getScrollLeft(),
- _4 = _3 + this.body.getVisibleWidth(),
- _5 = this.body.getEventColumn(_3 + 1),
- _6 = this.body.getEventColumn(_4),
- _7 = this.body.getScrollTop(),
- _8 = _7 + this.body.getVisibleHeight(),
- _9 = this.body.getEventRow(_7 + 1),
- _10 = this.body.getEventRow(_8);
- if (_10 < 0 || isNaN(_10)) _10 = this.data.getLength() - 1;
- if (_6 < 0 || isNaN(_6)) {
- if (this.isTimelineView()) {
- _6 = this.$116z
- } else {
- _6 = this.body.fields.length - 1
- }
- }
- _6 = Math.min(_6, this.body.fields.length - 1);
- _10 = Math.min(_10, this.data.length - 1);
- var _11 = this.getCellDate(_9, _5) || this.startDate,
- _12 = (this.getCellEndDate ? this.getCellEndDate(_10, _6) : this.getCellDate(_10, _6)) || this.endDate;
- this.$27q.viewportStartMillis = _11.getTime();
- this.$27q.viewportEndMillis = _12.getTime();
- return [_11, _12]
- });
- isc.evalBoundary;
- isc.B.push(isc.A.getVisibleRowRange = function isc_CalendarView_getVisibleRowRange() {
- if (!this.renderEventsOnDemand) {
- return [0, this.data.getLength()]
- }
- return this.getVisibleRows()
- }, isc.A.getVisibleColumnRange = function isc_CalendarView_getVisibleColumnRange() {
- if (!this.renderEventsOnDemand) {
- return [0, this.fields.getLength()]
- }
- return this.body.getVisibleColumns()
- }, isc.A.refreshVisibleEvents = function isc_CalendarView_refreshVisibleEvents(_1, _2, _3) {
- if (!this.isDrawn() || !this.body || !this.body.isDrawn()) return;
- if (this.hasLanes() && (!this.lanes || this.lanes.length == 0)) return;
- if (!this.$128q) {
- this.refreshEvents();
- return
- }
- _1 = _1 || this.getVisibleEvents(_2);
- this.sortForRender(_1);
- var _4 = _1.getLength();
- var _5 = this.useEventCanvasPool ? this.$128q.duplicate() : [],
- _6 = [];
- this.logDebug('refreshing visible events', 'calendar');
- for (var i = 0; i < _4; i++) {
- var _8 = _1.get(i),
- _9 = this.$128q.contains(_8);
- _8.$174a = 2000 + i;
- if (_9) {
- _5.remove(_8);
- if (this.isGrouped || this.useEventCanvasPool) {
- var _10 = this.getCurrentEventCanvas(_8);
- this.sizeEventCanvas(_10, true)
- }
- continue
- }
- _6.add(_8)
- }
- if (this.isGrouped || (this.useEventCanvasPool && this.eventCanvasPoolingMode == "viewport")) {
- for (var i = 0; i < _5.length; i++) {
- var _10 = this.getCurrentEventCanvas(_5[i]);
- if (_10) this.clearEventCanvas(_10)
- }
- }
- if (_6.length > 0) {
- var _11 = _6.length;
- for (var i = 0; i < _11; i++) {
- var _8 = _6[i];
- if (!this.$128q.contains(_8)) this.$128q.add(_8);
- this.addEvent(_8, false)
- }
- }
- if (!this.$158l) {
- this.drawZones();
- this.drawIndicators()
- }
- var _12 = this.calendar;
- if (_12.eventsRendered && isc.isA.Function(_12.eventsRendered))
- _12.eventsRendered()
- }, isc.A.getVisibleEvents = function isc_CalendarView_getVisibleEvents(_1) {
- var _2 = this.calendar;
- if (!this.renderEventsOnDemand) return this.getEventData();
- var _3 = this.isTimelineView(),
- _4 = _2.showDayLanes && this.isDayView(),
- _5 = this.getVisibleDateRange(_1),
- _6 = (_3 || _4),
- _7 = _6 ? (_3 ? this.getVisibleRowRange() : this.getVisibleColumnRange()) : null;
- var _8 = this.getEventData(),
- _9 = _5[0].getTime(),
- _10 = _5[1].getTime(),
- _11 = _8.getLength(),
- _12 = [],
- _13 = this.isWeekView(),
- _14 = this.isGrouped ? this.data.getOpenList() : null;
- for (var i = 0; i < _11; i++) {
- var _16 = _8.get(i);
- if (!_16) {
- isc.logWarn('getVisibleEvents: potentially invalid index: ' + i);
- break
- }
- if (isc.isA.String(_16)) return [];
- if (_2.shouldShowEvent(_16, this) == false) continue;
- if (_2.shouldShowLane(this.getLane(_16.lane), this) == false) continue;
- var _17 = _2.getEventLeadingDate(_16) || _2.getEventStartDate(_16);
- if (!_17) {
- if (_16.loadingMarker) {
- this.logWarn(this.viewName + ".getVisibleEvents() encountered a place-holder for a loading record, rather than a valid record. Can't continue: " + isc.echoFull(this.getStackTrace()));
- break
- }
- this.logWarn(this.viewName + ".getVisibleEvents() - event has no start-date: " + isc.echoFull(_16));
- continue
- }
- var _18 = _2.getEventTrailingDate(_16) || _2.getEventEndDate(_16),
- _19 = _18.getTime();
- if (_19 <= _9) continue;
- if (_17.getTime() >= _10) continue;
- if (_13) {
- if (_18.getDate() != _17.getDate()) {
- _18 = isc.DateUtil.getEndOf(_17.duplicate(), "d")
- }
- if (_18.getHours() < _5[0].getHours()) continue;
- if (_17.getHours() > _5[1].getHours()) continue
- }
- var _20 = {};
- if (_6) {
- if (this.isGrouped) {
- var _21 = _14.findIndex(_2.laneNameField, _16[_2.laneNameField]);
- if (_21 < 0) continue
- } else {
- if (_1 != true) {
- var _22 = this.getEventLaneIndex(_16);
- if (_22 == null || _22 < _7[0] || _22 > _7[1])
- continue
- }
- }
- _20[_2.laneNameField] = _16[_2.laneNameField]
- }
- if (_3) {
- if (_16[_2.leadingDateField] && _16[_2.trailingDateField]) {
- _20[_2.leadingDateField] = _5[0];
- _20[_2.trailingDateField] = _5[1]
- } else {
- _20[_2.startDateField] = _5[0];
- _20[_2.endDateField] = _5[1]
- }
- } else {
- _20[_2.startDateField] = _5[0];
- _20[_2.endDateField] = _5[1]
- }
- if (this.eventsOverlap(_20, _16, _6)) {
- _12.add(_16)
- }
- }
- return _12
- }, isc.A.clearEventCanvas = function isc_CalendarView_clearEventCanvas(_1, _2) {
- if (_1) {
- if (!isc.isAn.Array(_1)) _1 = [_1];
- var _3 = _1.length;
- while (--_3 >= 0) {
- var _4 = _1[_3];
- if (_4.hide) _4.hide();
- if (_4.clear) _4.clear();
- if (this.$129c) this.$129c.remove(_4);
- if (this.$128q) this.$128q.remove(_4.event);
- if (this.useEventCanvasPool && !_2) {
- this.poolEventCanvas(_4)
- } else {
- _4.destroy();
- _4 = null
- }
- }
- }
- }, isc.A.clearEvents = function isc_CalendarView_clearEvents(_1, _2) {
- var _3 = this.$128h;
- if (!this.body || !this.body.children || !_3) return;
- if (!_1) _1 = 0;
- if (_2 == null) _2 = !this.useEventCanvasPool;
- var _4 = this.$129c,
- _5 = _4.length;
- while (--_5 >= 0) {
- if (_4[_5]) {
- if (_4[_5].$128k) {
- this.clearEventCanvas(_4[_5], _2)
- }
- }
- }
- _4.removeEmpty()
- }, isc.A.areSame = function isc_CalendarView_areSame(_1, _2) {
- if (!_1 || !_2) return false;
- var _3 = this.calendar;
- if (_3.dataSource) {
- var _4 = _3.getEventPKs(),
- _5 = true;
- for (var i = 0, _7 = _4.length; i < _7; i++) {
- if (_1[_4[i]] != _2[_4[i]]) {
- _5 = false;
- break
- }
- }
- return _5
- } else {
- return (_1 === _2)
- }
- }, isc.A.getEventCanvasConstructor = function isc_CalendarView_getEventCanvasConstructor(_1) {
- return this.eventCanvasConstructor
- }, isc.A.getCurrentEventCanvas = function isc_CalendarView_getCurrentEventCanvas(_1) {
- var _2 = this.calendar.getEventCanvasID(this, _1);
- var _3 = window[_2];
- return _3
- }, isc.A.poolEventCanvas = function isc_CalendarView_poolEventCanvas(_1) {
- if (!this.$128h) this.$128h = [];
- if (this.body) {
- if (_1.event) {
- this.calendar.setEventCanvasID(this, _1.event, null);
- _1.event = null
- }
- _1.$128k = true;
- if (this.$129c) this.$129c.remove(_1);
- if (!this.$128h.contains(_1)) this.$128h.add(_1);
- return true
- } else return false
- }, isc.A.getPooledEventCanvas = function isc_CalendarView_getPooledEventCanvas(_1) {
- if (!this.$128h) this.$128h = [];
- if (!this.body) return;
- var _2 = this.$128h,
- _3 = this.calendar,
- _4;
- if (_2.length > 0) {
- var _5 = _2.findIndex("event", _1);
- if (_5 < 0) _5 = _2.findIndex("$128k", true);
- if (_5 < 0) return null;
- _4 = _2[_5];
- _4.$128k = false;
- _3.setEventCanvasID(this, _1, _4.ID);
- _2.remove(_4)
- }
- return _4
- }, isc.A.addEvent = function isc_CalendarView_addEvent(_1, _2) {
- if (!this.$129c) this.$129c = [];
- if (!this.$128h) this.$128h = [];
- this.clearSelection();
- this.addEventData(_1);
- var _3 = this.calendar,
- _4 = _3.$129r(_1, this),
- _5 = false;
- if (_4.isDrawn()) _4.hide();
- if (!this.$129c.contains(_4)) this.$129c.add(_4);
- _4.$53i = this.isWeekView();
- if (this.isDayView() && _3.showDayLanes) {
- var _6 = _1[_3.laneNameField],
- _7 = this.lanes.find("name", _6);
- if (!_7) _5 = true
- }
- var _8 = _3.canEditEvent(_1);
- _4.setDragProperties(_8, _8, this.eventDragTarget);
- if (!_5 && this.body && this.body.isDrawn()) {
- if (_2) {
- if (this.body) this.body.addChild(_4, null, false);
- this.retagOverlapRange(_3.getEventStartDate(_1), _3.getEventEndDate(_1), _1[_3.laneNameField])
- } else {
- if (this.body) this.body.addChild(_4, null, false);
- this.sizeEventCanvas(_4);
- _4.bringToFront()
- }
- }
- }, isc.A.removeEvent = function isc_CalendarView_removeEvent(_1) {
- var _2 = this.getCurrentEventCanvas(_1);
- if (_2) {
- this.clearEventCanvas(_2, !this.useEventCanvasPool);
- this.removeEventData(_1);
- return true
- } else {
- return false
- }
- }, isc.A.clearZones = function isc_CalendarView_clearZones() {
- var _1 = (this.$131c || []),
- _2 = this.body && this.body.children;
- for (var i = 0; i < _1.length; i++) {
- if (_1[i]) {
- if (_2 && _2.contains(_1[i])) this.body.removeChild(_1[i]);
- if (_1[i].destroy) _1[i].destroy();
- _1[i] = null
- }
- }
- this.$131c = []
- }, isc.A.drawZones = function isc_CalendarView_drawZones() {
- if (this.$131c) this.clearZones();
- if (!this.calendar.showZones) return;
- var _1 = this.calendar,
- _2 = _1.zones || [],
- _3 = this.$131c = [];
- if (this.isGrouped) {
- this.logInfo("Zones are not currently supported in grouped Calendar views.");
- return
- }
- if (!_2 || _2.length <= 0) return;
- var _4 = [],
- _5 = this.getVisibleDateRange(),
- _6 = _5[0].getTime(),
- _7 = _5[1].getTime();
- for (var i = 0; i < _2.length; i++) {
- var _9 = _2[i];
- if (_9[_1.startDateField].getTime() < _7 && _9[_1.endDateField].getTime() > _6) {
- _4.add(_9)
- }
- _9.styleName = _1.getZoneCanvasStyle(_9, this)
- }
- for (var i = 0; i < _4.length; i++) {
- var _9 = _4[i],
- _10 = _1.getZoneCanvas(_9, this),
- _11 = this.getDateLeftOffset(_9[_1.startDateField]),
- _12 = this.getDateLeftOffset(_9[_1.endDateField]),
- _13 = this.data.getProperty("height").sum();
- this.body.addChild(_10)
- _10.renderEvent(0, _11, _12 - _11, _13, true);
- _3.add(_10)
- }
- }, isc.A.clearIndicators = function isc_CalendarView_clearIndicators() {
- var _1 = (this.$131d || []),
- _2 = this.body && this.body.children;
- for (var i = 0; i < _1.length; i++) {
- if (_1[i]) {
- if (_2 && _2.contains(_1[i])) this.body.removeChild(_1[i]);
- if (_1[i].destroy) _1[i].destroy();
- _1[i] = null
- }
- }
- this.$131d = []
- }, isc.A.drawIndicators = function isc_CalendarView_drawIndicators() {
- if (this.$131d) this.clearIndicators();
- if (!this.calendar.showIndicators) return;
- var _1 = this.calendar,
- _2 = _1.indicators || [],
- _3 = this.$131d = [];
- if (this.isGrouped) {
- this.logInfo("Indicators are not currently supported in grouped Calendar views.");
- return
- }
- if (!_2 || _2.length <= 0) return;
- var _4 = [],
- _5 = this.getVisibleDateRange(),
- _6 = _5[0].getTime(),
- _7 = _5[1].getTime();
- for (var i = 0; i < _2.length; i++) {
- var _9 = _2[i];
- delete _9.endDate;
- _9.duration = 0;
- _9.durationUnit = "minute";
- var _10 = _1.getEventStartDate(_9).getTime();
- if (_10 >= _6 && _10 < _7) {
- _4.add(_9)
- }
- };
- for (var i = 0; i < _4.length; i++) {
- var _9 = _4[i],
- _11 = _1.getIndicatorCanvas(_9, this),
- _12 = this.getDateLeftOffset(_9[_1.startDateField]),
- _13 = this.data.getProperty("height").sum();
- this.body.addChild(_11)
- _11.renderEvent(0, _12, _1.zeroLengthEventSize, _13, !_1.showIndicatorsInFront);
- _3.add(_11)
- }
- }, isc.A.$1739 = function isc_CalendarView__refreshEvents() {
- if (!this.isDrawn()) {
- this.$128r = true;
- return
- }
- if (this.calendar.shouldIncludeRangeCriteria(this)) {
- this.$116v();
- return
- }
- this.refreshEvents()
- }, isc.A.refreshEvents = function isc_CalendarView_refreshEvents() {
- if (this.$132n) return;
- this.$129s = true;
- if (!this.$129c) this.$129c = [];
- if (!this.$128q) this.$128q = [];
- var _1 = this.calendar;
- if (!this.body || !_1.hasData()) return;
- this.$132n = true;
- this.clearZones();
- this.clearIndicators();
- var _2 = this.$129c;
- if (_2.length > 0) {
- _2.setProperty("$128k", true);
- this.clearEvents(0, !this.useEventCanvasPool)
- }
- this.$128q = [];
- this.$129c = [];
- if (!this.isTimelineView()) this.initCacheValues();
- var _3 = _1.getVisibleStartDate(this),
- _4 = _3.getTime(),
- _5 = _1.getVisibleEndDate(this),
- _6 = _5.getTime();
- this.overlapRanges = [];
- var _7 = _1.data.getLength();
- var _8 = _1.data.getRange(0, _7);
- var _9 = [];
- var _10 = this.hasLanes() && _1.lanes;
- while (--_7 >= 0) {
- var _11 = _8.get(_7);
- if (!_11) continue;
- if (!isc.isA.String(_11)) {
- if (_1.shouldShowEvent(_11, this) == false) continue;
- if (_10 && _11[_1.laneNameField] && !_10.find("name", _11[_1.laneNameField])) {
- continue
- }
- var _12 = _1.getEventStartDate(_11);
- if (!_12) {
- if (_11.loadingMarker) {
- this.logWarn(this.viewName + ".refreshEvents() encountered a place-holder for a loading record, rather than a valid record. Can't continue: " + isc.echoFull(this.getStackTrace()));
- break
- }
- this.logWarn(this.viewName + ".refreshEvents() - event has no start-date: " + isc.echoFull(_11));
- continue
- }
- var _13 = _1.getEventLeadingDate(_11) || _12,
- _14 = _13.getTime(),
- _15 = _1.getEventTrailingDate(_11) || _1.getEventEndDate(_11),
- _16 = _15.getTime();
- if ((_14 >= _4 && _14 < _6) || (_16 > _4 && _16 <= _6) || (_14 <= _4 && _16 >= _6)) {
- _11.eventLength = (_15 - _13);
- if (_11[_1.durationField] != null) {
- _11.isDuration = true;
- _11.isZeroDuration = _11[_1.durationField] == 0
- }
- _9.add(_11)
- }
- }
- };
- if (_10) {
- var _17 = _1.lanes.length,
- _18 = [],
- _19 = false;
- for (var i = 0; i < _17; i++) {
- var _21 = _10[i];
- if (this.isGroupNode(_21)) continue;
- if (_1.shouldShowLane(_21)) {
- _18.add(_21);
- _19 = true
- }
- }
- if (!_19 && _18.length == 0) _19 = true;
- if (_19 && (!this.lanes || this.lanes.length != _18.length)) {
- this.setLanes(_18, true);
- this.redraw()
- }
- }
- this.setEventData(_9);
- this.tagDataForOverlap();
- this.refreshVisibleEvents(null, null, "refreshEvents");
- if (this.$123r) {
- this.body.scrollTo(null, this.$123r);
- delete this.$123r
- }
- delete this.$123s;
- delete this.$132n
- }, isc.A.$116v = function isc_CalendarView__refreshData() {
- var _1 = this.calendar;
- if (_1.dataSource && isc.ResultSet && isc.isA.ResultSet(_1.data)) {
- _1.$53e = true;
- _1.invalidateCache();
- _1.fetchData(_1.getCriteria())
- } else {
- _1.dataChanged()
- }
- }, isc.A.getFrozenLength = function isc_CalendarView_getFrozenLength() {
- if (this.frozenBody && this.frozenBody.fields) return this.frozenBody.fields.length;
- return 0
- }, isc.A.getCellAlign = function isc_CalendarView_getCellAlign(_1, _2, _3) {
- if (this.isMonthView()) return;
- var _4 = this.calendar,
- _5 = this.fields[_3],
- _6 = _1 ? _1.cellAlign : null,
- _7 = null;
- if (_5) {
- if (_5.frozen) {
- return _5.cellAlign || _6 || this.labelColumnAlign
- }
- var _8 = this.getFrozenLength();
- if (_4.getDateCellAlign) {
- var _9 = this.getCellDate(_2, _3 - _8);
- if (_9) _7 = _4.getDateCellAlign(_9, _2, _3 - _8, this)
- }
- _5 = this.body.fields[_3 - _8];
- if (_7 || _5.cellAlign || _6) {
- return _7 || _5.cellAlign || _6
- }
- }
- return this.Super("getCellAlign", arguments)
- }, isc.A.getCellVAlign = function isc_CalendarView_getCellVAlign(_1, _2, _3) {
- if (this.isMonthView()) return;
- var _4 = this.calendar,
- _5 = this.fields[_3],
- _6 = _1 ? _1.cellVAlign : null,
- _7 = null;
- if (_5) {
- if (_5.frozen) {
- return _5.cellVAlign || _6 || this.labelColumnVAlign || this.$171d
- }
- var _8 = this.getFrozenLength();
- if (_4.getDateCellVAlign) {
- var _9 = this.getCellDate(_2, _3 - _8);
- if (_9) _7 = _4.getDateCellVAlign(_9, _2, _3 - _8, this)
- }
- _5 = this.body.fields[_3 - _8];
- if (_7 || _6 || _5.cellVAlign) {
- return _7 || _6 || _5.cellVAlign
- }
- }
- return _6 || this.$171d
- }, isc.A.getCellValue = function isc_CalendarView_getCellValue(_1, _2, _3) {
- if (!this.calendar.getDateHTML) return this.Super("getCellValue", arguments);
- if (this.isMonthView()) return this.Super("getCellValue", arguments);
- var _4 = this.calendar,
- _5 = this.getFrozenLength();
- if (_3 - _5 >= 0) {
- var _6 = this.getCellDate(_2, _3 - _5);
- if (_6) {
- var _7 = _4.getDateHTML(_6, _2, _3 - _5, this);
- if (_7) return _7
- }
- }
- return this.Super("getCellValue", arguments)
- }, isc.A.destroyEvents = function isc_CalendarView_destroyEvents() {
- if (!this.body || !this.body.children) return;
- var _1 = this.body.children.length;
- while (--_1 >= 0) {
- var _2 = this.body.children[_1];
- if (_2) {
- this.body.removeChild(_2);
- _2.destroy();
- _2 = null
- }
- }
- this.$128q = null;
- this.$129c = null;
- this.$128h = null
- }, isc.A.destroy = function isc_CalendarView_destroy() {
- if (this.removeLocalHandlers) this.removeLocalHandlers();
- this.calendar = null;
- this.destroyEvents(true);
- if (this.clearZones) this.clearZones();
- if (this.clearIndicators) this.clearIndicators();
- this.Super("destroy", arguments)
- });
- isc.B._maxIndex = isc.C + 108;
- isc.ClassFactory.defineClass("DaySchedule", "CalendarView");
- isc.DaySchedule.changeDefaults("bodyProperties", {
- snapToCells: false,
- suppressVSnapOffset: true,
- suppressHSnapOffset: true,
- childrenSnapToGrid: false
- });
- isc.A = isc.DaySchedule.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.autoDraw = false;
- isc.A.canSort = false;
- isc.A.canResizeFields = false;
- isc.A.canReorderFields = false;
- isc.A.showHeader = false;
- isc.A.showHeaderContextMenu = false;
- isc.A.showAllRecords = true;
- isc.A.fixedRecordHeights = true;
- isc.A.labelColumnWidth = 60;
- isc.A.labelColumnAlign = "right";
- isc.A.showLabelColumn = true;
- isc.A.labelColumnPosition = "left";
- isc.A.labelColumnBaseStyle = "labelColumn";
- isc.A.showRollOver = true;
- isc.A.useCellRollOvers = true;
- isc.A.canAutoFitFields = false;
- isc.A.canSelectCells = true;
- isc.B.push(isc.A.getDateLabelText = function isc_DaySchedule_getDateLabelText(_1, _2) {
- if (this.isWeekView()) {
- return "<b>" + isc.DateUtil.getFormattedDateRangeString(_1, _2) + "</b>"
- }
- return "<b>" + isc.DateUtil.getFormattedDateRangeString(_1) + "</b>"
- }, isc.A.initWidget = function isc_DaySchedule_initWidget() {
- this.fields = [];
- var _1 = this.calendar;
- if (_1.showDayLanes && this.isDayView() && _1.alternateLaneStyles) {
- this.alternateFieldStyles = true;
- this.alternateFieldFrequency = _1.alternateFieldFrequency
- }
- if (_1.labelColumnWidth && _1.labelColumnWidth != this.labelColumnWidth) {
- this.labelColumnWidth = _1.labelColumnWidth
- }
- this.renderEventsOnDemand = _1.renderEventsOnDemand;
- this.eventDragGap = _1.eventDragGap;
- this.fields = [];
- this.Super("initWidget");
- if (isc.isAn.Array(_1.data)) {
- this.$128r = true;
- this.$53e = true
- }
- this.rebuildFields();
- this.addAutoChild("eventDragTarget");
- this.body.addChild(this.eventDragTarget);
- this.dragTarget = this.eventDragTarget
- }, isc.A.getFirstDateColumn = function isc_DaySchedule_getFirstDateColumn() {
- return this.frozenBody ? this.frozenBody.fields.length : 0
- }, isc.A.reorderFields = function isc_DaySchedule_reorderFields(_1, _2, _3) {
- this.Super("reorderFields", arguments);
- this.refreshEvents()
- }, isc.A.rebuildFields = function isc_DaySchedule_rebuildFields() {
- this.initCacheValues();
- var _1 = this.calendar,
- _2 = [],
- _3 = {
- autoFitWidth: true,
- minWidth: this.labelColumnWidth,
- width: this.labelColumnWidth,
- name: "label",
- frozen: true,
- isLabelField: true,
- title: " ",
- cellAlign: "right",
- calendar: _1,
- formatCellValue: function(_29, _30, _31, _32, _33) {
- var _1 = _33.calendar;
- var _4 = isc.DateUtil.getLogicalTimeOnly(_30.time);
- var _5 = (_4.getHours() * 60) + _4.getMinutes();
- if (_5 % _1.rowTitleFrequency == 0) {
- var _6 = Math.floor(_5 / 60);
- var _7 = _5 % 60;
- var _8 = isc.Time.parseInput(_6 + ":" + _7);
- return isc.Time.toTime(_8, _33.creator.timeFormatter, true)
- } else {
- return ""
- }
- }
- };
- if (this.showLabelColumn && this.labelColumnPosition == "left") {
- _2.add(_3)
- }
- if (this.hasLanes()) {
- var _9 = this.lanes = this.lanes || _1.lanes.duplicate() || [];
- _2[0].frozen = true;
- var d = _1.chosenDate.duplicate(),
- _11 = isc.DaySchedule.$126v(_1, this, d),
- _12 = isc.DateUtil.createLogicalDate(d.getFullYear(), d.getMonth(), d.getDate()),
- _13 = {
- date: _12,
- align: "center",
- canReorder: _1.canReorderLanes
- };
- for (var i = 0; i < _9.length; i++) {
- var _15 = _9[i],
- _16 = _15.name || _15[_1.laneNameField],
- p = isc.addProperties({}, _13, {
- name: _16
- });
- p[_1.laneNameField] = _16;
- if (_15.sublanes) {
- var _18 = this.getLaneWidth(_15),
- _19 = _15.sublanes.length,
- _20 = Math.floor(_18 / _19),
- _21 = 0;
- for (var j = 0; j < _19; j++) {
- var _23 = _15.sublanes[j];
- _23[_1.laneNameField] = _23.name;
- _23.left = _21;
- if (_23.width == null) _23.width = _20;
- _21 += _23.width
- }
- _15.width = _15.sublanes.getProperty("width").sum()
- }
- _2.add(isc.addProperties(p, _15))
- }
- _11.setProperty(_16, "");
- this.setShowHeader(true);
- if (_1.canReorderLanes) this.canReorderFields = _1.canReorderLanes;
- if (_1.minLaneWidth != null) this.minFieldWidth = _1.minLaneWidth;
- this.data = _11
- } else {
- var _24 = _1.chosenDate;
- _2[0].frozen = true;
- _2.add({
- name: "day1",
- align: "center",
- date: _1.chosenDate,
- width: "*",
- autoFitWidth: false
- });
- if (this.isWeekView()) {
- var _25 = 8;
- for (var i = 2; i < _25; i++) {
- _2.add({
- name: "day" + i,
- align: "center",
- width: "*",
- autoFitWidth: false
- })
- }
- this.setShowHeader(true);
- if (!_1.showWeekends) {
- var _26 = this.showLabelColumn && this.labelColumnPosition == "left" ? 1 : 0;
- var _27 = _1.getWeekendDays();
- for (var i = _26; i < _2.length; i++) {
- var _28 = ((i - _26) + _1.firstDayOfWeek) % 7;
- if (_27.contains(_28)) {
- _2[i].showIf = "return false;"
- }
- }
- }
- _24 = this.chosenWeekStart
- } else {
- this.setShowHeader(false)
- }
- this.data = isc.DaySchedule.$126v(_1, this, _24)
- }
- if (this.showLabelColumn && this.labelColumnPosition == "right") {
- _2.add(_3)
- }
- this.setFields(_2)
- }, isc.A.getDateFromPoint = function isc_DaySchedule_getDateFromPoint(_1, _2, _3, _4) {
- var _5 = this.calendar;
- if (_4) {}
- if (_1 == null && _2 == null) {
- _2 = this.body.getOffsetY();
- _1 = this.body.getOffsetX()
- }
- var _6 = this.body.getEventRow(_2);
- if (_6 == -1) _6 = 0;
- else if (_6 == -2) _6 = this.getTotalRows() - 1;
- var _7 = this.body.getRowHeight(this.getRecord(_6), _6),
- _8 = this.body.getRowTop(_6),
- _9 = this.body.getEventColumn(_1),
- _10 = (_9 < 0);
- if (_9 == -1) _9 = 0;
- else if (_9 == -2) _9 = this.body.fields.length - 1;
- var _11 = this.getCellDate(_6, _9);
- if (!_11) return null;
- var _12 = this.getTimePerCell(),
- _13 = _5.getRowsPerHour(this),
- _14 = _2 - _8,
- _15 = _5.getSnapGapPixels(this),
- _16 = _14 - (_14 % _15),
- _17 = Math.round(_12 / (_7 / _15)),
- _18 = _16 / _15,
- _19 = _17 * _18;
- _11.setMinutes(_11.getMinutes() + _19);
- return _11
- }, isc.A.getCellDate = function isc_DaySchedule_getCellDate(_1, _2) {
- if (!this.body || !this.body.fields || !this.$129f || !this.body.fields[_2]) {
- return null
- }
- if (_1 < 0) _1 = this.data.getLength() - 1;
- var _3 = this.isDayView() ? "day1" : this.body.fields[_2][this.fieldIdProperty];
- if (!_3.startsWith("day")) return;
- var _4 = this.$129f[_1];
- return _4 && _4[_3] ? _4[_3].duplicate() : null
- }, isc.A.getEventLeft = function isc_DaySchedule_getEventLeft(_1) {
- var _2 = this.getColFromDate(this.calendar.getEventStartDate(_1), _1[this.calendar.laneNameField]);
- return this.body.getColumnLeft(_2)
- }, isc.A.getEventRight = function isc_DaySchedule_getEventRight(_1) {
- var _2 = this.getColFromDate(this.calendar.getEventEndDate(_1), _1[this.calendar.laneNameField]);
- return this.body.getColumnLeft(_2) + this.body.getColumnWidth(_2)
- }, isc.A.getDateLeftOffset = function isc_DaySchedule_getDateLeftOffset(_1) {
- for (var i = 0; i < this.fields.length; i++) {
- var f = this.fields[i];
- if (f.$66a != null && f.$659 != null && f.$658 != null) {
- var _4 = isc.DateUtil.createLogicalDate(f.$66a, f.$659, f.$658);
- if (isc.DateUtil.compareLogicalDates(_1, _4) == 0) {
- return this.getColumnLeft(this.getFieldNum(f))
- }
- }
- }
- return 0
- }, isc.A.getDateTopOffset = function isc_DaySchedule_getDateTopOffset(_1, _2) {
- if (!_1) return null;
- var _3 = this.calendar,
- _4 = _3.getSnapGapPixels(this),
- _5 = _1.getTime(),
- _6 = this.getColFromDate(_1, _2),
- _7 = this.data.length;
- for (var i = 0; i <= _7; i++) {
- var _9 = this.getCellDate(i, _6),
- _10 = _9.getTime();
- if (_10 >= _5) {
- var _11 = i - (i == 0 ? 0 : 1),
- _12 = this.getRowTop(_11),
- _13 = this.getRowHeight(this.getRecord(_11), _11);
- if (_13 / _4 != 1) {
- var _14 = _10 - _5,
- _15 = this.getTimePerCell() - Math.floor(_14 / 1000 / 60),
- _16 = _3.getSnapGapMinutes(this),
- _17 = Math.floor((_15 / _16) * _4);
- _12 += _17
- } else {
- _12 += _13
- }
- return _12
- }
- }
- return this.body.getScrollHeight() - 1
- }, isc.A.setLanes = function isc_DaySchedule_setLanes(_1) {
- this.lanes = _1.duplicate();
- this.rebuildFields();
- this.refreshEvents()
- }, isc.A.getLane = function isc_DaySchedule_getLane(_1) {
- var _2 = isc.isA.Number(_1) ? _1 : -1;
- if (_2 == -1) {
- if (isc.isAn.Object(_1)) _2 = this.body.fields.indexOf(_1);
- else if (isc.isA.String(_1)) _2 = this.getLaneIndex(_1)
- }
- if (_2 >= 0) return this.body.fields[_2]
- }, isc.A.getLaneIndex = function isc_DaySchedule_getLaneIndex(_1) {
- if (!this.isDayView() || !this.calendar.showDayLanes) return;
- var _2 = this.body.fields,
- _3 = -1;
- if (isc.isAn.Object(_1)) _3 = _2.indexOf(_1)
- else if (isc.isA.String(_1)) {
- _3 = _2.findIndex("name", _1);
- if (_3 < 0) _3 = _2.findIndex(this.calendar.laneNameField, _1)
- }
- return _3
- }, isc.A.getLaneWidth = function isc_DaySchedule_getLaneWidth(_1) {
- var _2 = null;
- if (isc.isA.String(_1)) _1 = this.getLane(_1);
- if (_1) {
- if (_1.width) _2 = _1.width;
- else {
- var _3 = this.calendar.laneNameField,
- _4 = this.body.fields.findIndex(_3, _1[_3]);
- _2 = _4 >= 0 ? this.body.getColumnWidth(_4) : null
- }
- }
- return _2
- }, isc.A.getLaneFromPoint = function isc_DaySchedule_getLaneFromPoint(_1, _2) {
- if (!this.hasLanes()) return null;
- if (_1 == null) _1 = this.body.getOffsetX();
- var _3 = this.body.getEventColumn(_1),
- _4 = this.body.fields[_3];
- return !this.isGroupNode(_4) ? _4 : null
- }, isc.A.getSublaneFromPoint = function isc_DaySchedule_getSublaneFromPoint(_1, _2) {
- if (!this.hasSublanes()) return null;
- if (_1 == null) _1 = this.body.getOffsetX();
- var _3 = this.body.getEventColumn(_1),
- _4 = this.body.fields[_3],
- _5 = _4 ? _4.sublanes : null;
- if (!_5) return null;
- var _6 = this.body.getColumnLeft(_3),
- _7 = _1 - _6,
- _8 = this.getLaneWidth(_4),
- _9 = _5.length,
- _10 = 0;
- for (var i = 0; i < _9; i++) {
- if (_10 + _5[i].width > _7) {
- return _5[i]
- }
- _10 += _5[i].width
- }
- return null
- }, isc.A.draw = function isc_DaySchedule_draw(_1, _2, _3, _4) {
- this.invokeSuper(isc.DaySchedule, "draw", _1, _2, _3, _4);
- this.logDebug('draw', 'calendar');
- this.body.addChild(this.eventDragTarget);
- this.eventDragTarget.setView(this);
- if (this.$128r) {
- delete this.$128r;
- this.refreshEvents()
- }
- this.setSnapGap();
- if (this.calendar.scrollToWorkday) this.scrollToWorkdayStart()
- }, isc.A.setSnapGap = function isc_DaySchedule_setSnapGap() {
- var _1 = this.calendar.getSnapGapPixels(this);
- this.body.snapVGap = Math.round((_1 / this.getTimePerCell()) *
- this.body.getRowSize(0));
- this.body.snapHGap = null
- }, isc.A.scrollToWorkdayStart = function isc_DaySchedule_scrollToWorkdayStart() {
- var _1 = this.calendar;
- if (this.$166u) return;
- if (_1.scrollToWorkday && !this.hasLanes()) {
- var _2 = this.calcRowHeight();
- if (_2 != _1.rowHeight) {
- this.$166u = true;
- _1.setRowHeight(_2, true);
- delete this.$166u
- }
- }
- this.updateSnapProperties();
- var _3 = this.getWorkdayRange(),
- _4 = _3.start;
- var _5 = this.getTimePerCell(),
- _6 = _1.getRowsPerHour(this),
- _7 = _4.getHours() * _6,
- _8 = _4.getMinutes(),
- _9 = _8 % _5,
- _10 = Math.floor((_8 - _9) / _5);
- _7 += _10;
- if (_9 > 0) _7++;
- var _11 = _1.rowHeight * _7;
- this.body.delayCall("scrollTo", [0, _11])
- }, isc.A.getWorkdayRange = function isc_DaySchedule_getWorkdayRange() {
- var _1 = this.body.fields,
- _2 = {
- start: isc.Time.parseInput("23:59"),
- end: isc.Time.parseInput("00:01")
- },
- _3 = this.calendar,
- _4 = _3.chosenDate,
- _5;
- if (this.isWeekView()) {
- for (var i = 0; i < _1.length; i++) {
- _4 = this.getDateFromCol(i);
- if (isc.isA.Date(_4)) {
- _5 = isc.Time.parseInput(_3.getWorkdayStart(_4));
- if (isc.DateUtil.compareDates(_2.start, _5) < 0) {
- _2.start = _5
- }
- _5 = isc.Time.parseInput(_3.getWorkdayEnd(_4));
- if (isc.DateUtil.compareDates(_2.end, _5) > 0) {
- _2.end = _5
- }
- }
- }
- } else if (_3.showDayLanes) {
- for (var i = 0; i < _1.length; i++) {
- var _7 = _1[i],
- _8 = _7[_3.laneNameField];
- if (isc.isA.Date(_4)) {
- _5 = isc.Time.parseInput(_3.getWorkdayStart(_4, _8));
- if (isc.DateUtil.compareDates(_2.start, _5) < 0) {
- _2.start = _5
- }
- _5 = isc.Time.parseInput(_3.getWorkdayEnd(_4, _8));
- if (isc.DateUtil.compareDates(_2.end, _5) > 0) {
- _2.end = _5
- }
- }
- }
- } else {
- _2.start = isc.Time.parseInput(_3.getWorkdayStart(_3.chosenDate));
- _2.end = isc.Time.parseInput(_3.getWorkdayEnd(_3.chosenDate))
- }
- return _2
- }, isc.A.calcRowHeight = function isc_DaySchedule_calcRowHeight() {
- var _1 = this.getWorkdayRange(),
- _2 = _1.end.getHours() - _1.start.getHours(),
- _3 = this.calendar.rowHeight;
- if (_2 <= 0) return _3;
- var _4 = Math.ceil(this.body.getViewportHeight() /
- (_2 * this.calendar.getRowsPerHour(this))) - 1;
- return _4 < _3 ? _3 : _4
- }, isc.A.getRowHeight = function isc_DaySchedule_getRowHeight(_1, _2) {
- return this.calendar.rowHeight
- }, isc.A.getDayFromCol = function isc_DaySchedule_getDayFromCol(_1) {
- if (_1 < 0) return null;
- var _2 = this.body.fields.get(_1).$654;
- return _2
- }, isc.A.getDateFromCol = function isc_DaySchedule_getDateFromCol(_1) {
- if (_1 < 0) return null;
- var _2 = this.getCellDate(0, _1);
- return _2
- }, isc.A.getColFromDate = function isc_DaySchedule_getColFromDate(_1, _2) {
- for (var i = 0; i < this.body.fields.length; i++) {
- var _4 = this.body.fields.get(i);
- if (!_4.date) continue;
- if (isc.DateUtil.compareLogicalDates(_1, _4.date) == 0) {
- if (this.calendar.showDayLanes && _2) {
- if (_4.lane == _2) return i
- } else return i
- }
- }
- return null
- }, isc.A.isLabelCol = function isc_DaySchedule_isLabelCol(_1) {
- var _2 = this.frozenFields ? this.frozenFields.length : 0;
- if (_1 < _2) return true;
- var _3 = this.getCellDate(1, _1 - _2);
- return _3 == null
- }, isc.A.cellDisabled = function isc_DaySchedule_cellDisabled(_1, _2) {
- var _3 = this.getFieldBody(_2);
- if (!_3 || _3 == this.frozenBody) return false;
- var _4 = this.getLocalFieldNum(_2),
- _5 = this.getCellDate(_1, _4);
- if (this.$142y) {
- var _6 = this.$142y;
- for (var i = 0; i < _6.length; i++) {
- if (_6[i].rowNum == _1 && _6[i].colNum == _4) {
- return true
- }
- }
- }
- return this.calendar.shouldDisableDate(_5, this)
- }, isc.A.refreshStyle = function isc_DaySchedule_refreshStyle() {
- if (!this.body) return;
- if (this.isWeekView() || this.calendar.showDayLanes) {
- this.markForRedraw();
- return
- }
- for (var i = 0; i < this.data.length; i++) {
- this.body.refreshCellStyle(i, 1)
- }
- }, isc.A.headerClick = function isc_DaySchedule_headerClick(_1, _2) {
- var _3 = this.calendar;
- if (this.isLabelCol(_1)) return true;
- if (_3.showDayLanes && !this.isWeekView()) return true;
- var _4 = this.getField(_1);
- _3.dateChooser.dateClick(_4.$66a, _4.$659, _4.$658);
- _3.selectTab(0);
- return true
- }, isc.A.cellMouseDown = function isc_DaySchedule_cellMouseDown(_1, _2, _3) {
- if (this.isLabelCol(_3) || this.cellDisabled(_2, _3)) return true;
- var _4 = this.calendar;
- var _5 = this.getCellDate(this.body.getEventRow(), this.body.getEventColumn());
- if (_4.backgroundMouseDown && _4.backgroundMouseDown(_5) == false) return;
- if (!_4.canCreateEvents) return true;
- this.clearSelection();
- this.$53q = {};
- this.$53q.colNum = _3;
- this.$53q.startRowNum = _2;
- this.$53q.endRowNum = _2;
- this.$53r = true;
- this.refreshCellStyle(_2, _3)
- }, isc.A.cellOver = function isc_DaySchedule_cellOver(_1, _2, _3) {
- if (this.calendar.canDragCreateEvents == false) return;
- if (this.$53r && this.$53q) {
- var _4;
- if (this.$53q.startRowNum < this.$53q.endRowNum) {
- if (_2 > this.$53q.endRowNum) {
- _4 = _2
- } else {
- _4 = this.$53q.endRowNum
- }
- this.$53q.endRowNum = _2
- } else {
- if (_2 < this.$53q.endRowNum) {
- _4 = _2
- } else {
- _4 = this.$53q.endRowNum
- }
- this.$53q.endRowNum = _2
- }
- var _5 = 6,
- _6 = this.$53q.colNum,
- _7 = this.getTotalRows();
- for (var i = _4 - _5; i < _4 + _5; i++) {
- if (i >= 0 && i < _7) this.refreshCellStyle(i, _6)
- }
- }
- }, isc.A.cellMouseUp = function isc_DaySchedule_cellMouseUp(_1, _2, _3) {
- if (!this.$53q) return true;
- this.$53r = false;
- var _4, _5, _6;
- if (this.$53q.startRowNum > this.$53q.endRowNum) {
- _4 = this.$53q.endRowNum;
- _5 = this.$53q.startRowNum
- } else {
- _5 = this.$53q.endRowNum;
- _4 = this.$53q.startRowNum
- }
- _6 = _5 - _4 + 1;
- var _7 = this.calendar,
- _8 = _7.getCellDate(_4, _3, this),
- _9 = _7.getCellDate(_4 + _6, _3, this);
- if (_6 == 1 && _7.backgroundClick) {
- if (_7.backgroundClick(_8, _9) == false) {
- this.clearSelection();
- return
- }
- }
- if (_7.backgroundMouseUp) {
- if (_7.backgroundMouseUp(_8, _9) == false) {
- this.clearSelection();
- return
- }
- }
- var _10, _11;
- if (_7.showDayLanes && _7.dayViewSelected()) {
- _10 = this.getLaneFromPoint();
- _11 = _10 ? this.getSublaneFromPoint() : null
- }
- var _12 = _7.createEventObject(null, _8, _9, _10 && _10[_7.laneNameField], _11 && _11[_7.laneNameField]);
- _7.showEventDialog(_12, true);
- return isc.EH.STOP_BUBBLING
- }, isc.A.getCellStyle = function isc_DaySchedule_getCellStyle(_1, _2, _3) {
- var _4 = this.calendar,
- _5 = this.getBaseStyle(_1, _2, _3);
- if (this.isLabelCol(_3)) return _5;
- if (this.cellDisabled(_2, _3)) return _5 + "Disabled";
- if (this.$53q && this.$53q.colNum == _3) {
- var _6 = this.$53q.startRowNum,
- _7 = this.$53q.endRowNum;
- if (_2 >= _6 && _2 <= _7 || _2 >= _7 && _2 <= _6) {
- if (_5 == _4.workdayBaseStyle) return _5 + "Selected";
- return _4.selectedCellStyle
- }
- }
- if (!this.isWeekView() && this.alternateRecordStyles && _2 % 2 != 0) {
- if (_5 == _4.workdayBaseStyle) return _5;
- return _5 + "Dark"
- }
- if (_4.dayViewSelected() && _4.showDayLanes && this.alternateFieldStyles && _3 % 2 != 0) {
- if (_5 == _4.workdayBaseStyle) return _5;
- return _5 + "Dark"
- }
- return _5
- }, isc.A.getBaseStyle = function isc_DaySchedule_getBaseStyle(_1, _2, _3) {
- var _4 = this.calendar,
- _5 = _4.getCellDate(_2, _3, this),
- _6 = _5 && _4.getDateStyle ? _4.getDateStyle(_5, _2, _3, this) : null,
- _7 = this.isWeekView();
- if (_6) {
- return _6
- }
- if (this.isLabelCol(_3)) return this.labelColumnBaseStyle;
- if (!_4.showWorkday) return this.baseStyle;
- var _8 = this.getFieldBody(_3),
- _9 = _3;
- if (_8 == this.body) _9 = this.getLocalFieldNum(_3);
- var _10 = _7 ? this.getDayFromCol(_9) : _4.chosenDate.getDay();
- var _11 = _7 ? this.getDateFromCol(_9) : _4.chosenDate.duplicate(),
- _12 = _11.duplicate(),
- _13 = _5 ? _5.duplicate() : null,
- _14 = _4.showDayLanes ? this.body.getField(_9)[_4.laneNameField] : null;
- if (_13) {
- var _15 = isc.Time.parseInput(_4.getWorkdayStart(_13, _14)),
- _16 = isc.Time.parseInput(_4.getWorkdayEnd(_13, _14));
- _11.setHours(_15.getHours(), _15.getMinutes(), 0, 0);
- _12.setHours(_16.getHours(), _16.getMinutes(), 0, 0);
- var _17 = _4.dateIsWorkday(_13, _14);
- _13 = _13.getTime();
- if (_17 && _11.getTime() <= _13 && _13 < _12.getTime()) {
- return _4.workdayBaseStyle
- } else {
- return this.baseStyle
- }
- } else {
- return this.baseStyle
- }
- }, isc.A.clearSelection = function isc_DaySchedule_clearSelection() {
- if (this.$53q) {
- var _1, _2, _3 = this.$53q.colNum;
- if (this.$53q.startRowNum < this.$53q.endRowNum) {
- _1 = this.$53q.startRowNum;
- _2 = this.$53q.endRowNum
- } else {
- _1 = this.$53q.endRowNum;
- _2 = this.$53q.startRowNum
- }
- this.$53q = null;
- for (var i = _1; i < _2 + 1; i++) {
- this.refreshCellStyle(i, _3)
- }
- }
- }, isc.A.destroyEvents = function isc_DaySchedule_destroyEvents() {
- if (!this.body || !this.body.children) return;
- var _1 = this.body.children.length;
- while (--_1 >= 0) {
- var _2 = this.body.children[_1];
- if (_2) {
- this.body.removeChild(_2);
- _2.destroy();
- _2 = null
- }
- }
- this.$128q = null;
- this.$129c = null;
- this.$128h = null
- }, isc.A.destroy = function isc_DaySchedule_destroy() {
- this.calendar = null;
- this.destroyEvents(true);
- if (this.clearZones) this.clearZones();
- if (this.clearIndicators) this.clearIndicators();
- this.Super("destroy", arguments)
- }, isc.A.updateEventWindow = function isc_DaySchedule_updateEventWindow(_1) {
- if (!this.body || !this.body.children) return;
- var _2 = this.body.children,
- _3 = this.calendar;
- for (var i = 0; i < _2.length; i++) {
- if (_2[i] && _2[i].isEventCanvas && this.areSame(_2[i].event, _1)) {
- _2[i].event = _1;
- this.sizeEventCanvas(_2[i]);
- if (_2[i].setDescriptionText)
- _2[i].setDescriptionText(_1[_3.descriptionField]);
- return true
- }
- }
- return false
- });
- isc.B._maxIndex = isc.C + 39;
- isc.ClassFactory.defineClass("WeekSchedule", "DaySchedule");
- isc.ClassFactory.defineClass("MonthSchedule", "CalendarView");
- isc.ClassFactory.defineClass("MonthScheduleBody", "GridBody");
- isc.MonthSchedule.changeDefaults("headerButtonProperties", {
- showRollOver: false,
- showDown: false,
- cursor: "default"
- });
- isc.MonthSchedule.changeDefaults("bodyProperties", {
- redrawOnResize: true,
- fixedRowHeights: false
- });
- isc.A = isc.MonthSchedule.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.autoDraw = false;
- isc.A.leaveScrollbarGap = false;
- isc.A.showAllRecords = true;
- isc.A.showHeader = true;
- isc.A.showHeaderContextMenu = false;
- isc.A.canSort = false;
- isc.A.canResizeFields = false;
- isc.A.canReorderFields = false;
- isc.A.canAutoFitFields = false;
- isc.A.canHover = true;
- isc.A.showHover = true;
- isc.A.hoverWrap = false;
- isc.A.showRollOver = true;
- isc.A.useCellRollOvers = true;
- isc.A.hoverByCell = true;
- isc.A.showViewHovers = false;
- isc.A.canSelectCells = true;
- isc.A.dayHeaderHeight = 20;
- isc.A.alternateRecordStyles = false;
- isc.A.$160h = "date";
- isc.A.cellHeight = 1;
- isc.A.enforceVClipping = true;
- isc.B.push(isc.A.getDateLabelText = function isc_MonthSchedule_getDateLabelText(_1, _2) {
- return "<b>" + _1.getShortMonthName() + " " + _1.getFullYear() + "</b>"
- }, isc.A.initWidget = function isc_MonthSchedule_initWidget() {
- var _1 = this.calendar;
- if (_1.data) this.data = this.getDayArray();
- this.fields = [{
- name: "day1",
- align: "center"
- }, {
- name: "day2",
- align: "center"
- }, {
- name: "day3",
- align: "center"
- }, {
- name: "day4",
- align: "center"
- }, {
- name: "day5",
- align: "center"
- }, {
- name: "day6",
- align: "center"
- }, {
- name: "day7",
- align: "center"
- }];
- this.firstDayOfWeek = _1.firstDayOfWeek;
- var _2 = isc.DateUtil.getShortDayNames();
- var _3 = _1.getWeekendDays();
- for (var i = 0; i < 7; i++) {
- var _5 = (i + this.firstDayOfWeek) % 7;
- this.fields[i].title = _2[_5];
- this.fields[i].$654 = _5;
- this.fields[i].$66b = i + 1;
- if (!_1.showWeekends && _3.contains(_5)) {
- this.fields[i].showIf = "return false;"
- }
- }
- this.minimumDayHeight = _1.minimumDayHeight;
- this.Super("initWidget");
- this.selectChosenDateCells()
- }, isc.A.canSelectCell = function isc_MonthSchedule_canSelectCell(_1, _2) {
- return !this.calendar.shouldDisableDate(this.calendar.getCellDate(_1, _2, this))
- }, isc.A.getCalendar = function isc_MonthSchedule_getCalendar() {
- return this.calendar
- }, isc.A.getTimePerCell = function isc_MonthSchedule_getTimePerCell(_1) {
- return isc.DateUtil.convertPeriodUnit(1, "d", "mn")
- }, isc.A.getTimePerSnapGap = function isc_MonthSchedule_getTimePerSnapGap(_1) {
- return isc.DateUtil.convertPeriodUnit(1, "d", "mn")
- }, isc.A.getDayArray = function isc_MonthSchedule_getDayArray() {
- var _1 = [],
- _2, _3, _4 = new Date(this.calendar.year, this.calendar.month, 1),
- _5 = this.calendar;
- while (_4.getDay() != _5.firstDayOfWeek) {
- this.incrementDate(_4, -1)
- }
- if (!_5.showWeekends) {
- var _6 = _5.getWeekendDays();
- var _7 = _4.duplicate();
- var _8 = true;
- for (var i = 0; i <= 7 - _6.length; i++) {
- if (_7.getMonth() == _5.month) {
- _8 = false;
- break
- }
- this.incrementDate(_7, 1)
- }
- if (_8) this.incrementDate(_4, 7)
- }
- _3 = new Date(_5.year, _5.month, _4.getDate() + 40);
- _2 = _5.$53g(_4, _3, this);
- _2.sortByProperty("name", true, function(_10, _11, _12) {
- return _10[_12.startDateField].getTime()
- }, _5);
- this.$53t = 0;
- for (var i = 0; i < 6; i++) {
- if (_5.showDayHeaders) _1.add(this.getHeaderRowObject(_4));
- _1.add(this.getEventRowObject(_4, _2));
- this.incrementDate(_4, 7);
- if (_4.getMonth() != _5.month) break
- }
- return _1
- }, isc.A.getHeaderRowObject = function isc_MonthSchedule_getHeaderRowObject(_1) {
- var _2 = {};
- var _3 = _1.duplicate();
- for (var i = 0; i < 7; i++) {
- _2["day" + (i + 1)] = _3.getDate();
- _2["date" + (i + 1)] = _3.duplicate();
- this.incrementDate(_3, 1)
- }
- return _2
- }, isc.A.getCellDate = function isc_MonthSchedule_getCellDate(_1, _2) {
- if (_1 == null && _2 == null) {
- _1 = this.getEventRow();
- _2 = this.getEventColumn()
- }
- if (_1 < 0 || _2 < 0) return null;
- var _3 = this.body.fields.get(_2).$66b,
- _4 = this.getRecord(_1),
- _5 = [this.$160h, _3].join(""),
- _6 = _4[_5];
- return _6
- }, isc.A.getCellEndDate = function isc_MonthSchedule_getCellEndDate(_1, _2) {
- var _3 = this.getCellDate(_1, _2);
- if (!_3) return null;
- return isc.DateUtil.getEndOf(_3, "d")
- }, isc.A.incrementDate = function isc_MonthSchedule_incrementDate(_1, _2) {
- var _3 = _1.getDate();
- _1.setDate(_3 + _2);
- if (_1.getDate() == (_3 + _2) - 1) {
- _1.setHours(_1.getHours() + 1);
- _1.setDate(_3 + _2)
- }
- return _1
- }, isc.A.getEventRowObject = function isc_MonthSchedule_getEventRowObject(_1, _2) {
- var _3 = {};
- var _4 = _1.duplicate();
- for (var i = 0; i < 7; i++) {
- var _6 = [];
- while (this.$53t < _2.length) {
- var _7 = _2[this.$53t];
- if (_7[this.calendar.startDateField].getMonth() != _4.getMonth() || _7[this.calendar.startDateField].getDate() != _4.getDate()) {
- break
- } else {
- _6.add(_7);
- this.$53t += 1
- }
- }
- _3["day" + (i + 1)] = _4.getDate();
- _3["date" + (i + 1)] = _4.duplicate();
- _3["event" + (i + 1)] = _6;
- this.incrementDate(_4, 1)
- }
- return _3
- }, isc.A.getEvents = function isc_MonthSchedule_getEvents(_1, _2) {
- var _3 = this.getFieldBody(_2);
- if (!_3 || _3 == this.frozenBody) return false;
- var _4 = this.getLocalFieldNum(_2);
- var _5 = this.getDayFromCol(_4);
- var _6 = this.fields.get(_4).$66b;
- var _7 = this.data[_1]["event" + _6];
- return _7
- }, isc.A.getEventCell = function isc_MonthSchedule_getEventCell(_1) {
- var _2 = this.data;
- for (var _3 = 0; _3 < this.fields.length; _3++) {
- var _4 = this.fields[_3].$66b,
- _5 = "event" + _4;
- for (var _6 = 0; _6 < _2.length; _6++) {
- var _7 = _2.get(_6)[_5];
- if (_7 != null && _7.contains(_1)) {
- return [_6, _3]
- }
- }
- }
- }, isc.A.getDayFromCol = function isc_MonthSchedule_getDayFromCol(_1) {
- var _2 = this.body.fields.get(_1).$654;
- return _2
- }, isc.A.getDateCells = function isc_MonthSchedule_getDateCells(_1) {
- for (var i = 0; i < this.data.length; i++) {
- var _3 = this.data[i];
- for (var _4 in _3) {
- if (_4.startsWith("date") && isc.DateUtil.compareLogicalDates(_1, _3[_4]) == 0) {
- var _5 = [];
- if (this.calendar.showDayHeaders)
- _5.add([i + 1, new Number(_4.substring(4, 5)) - 1]);
- _5.add([i, new Number(_4.substring(4, 5)) - 1])
- return _5
- }
- }
- }
- return null
- }, isc.A.cellDisabled = function isc_MonthSchedule_cellDisabled(_1, _2) {
- var _3 = this.getFieldBody(_2);
- if (!_3 || _3 == this.frozenBody) return false;
- var _4 = this.getLocalFieldNum(_2),
- _5 = this.getCellDate(_1, _4);
- return this.calendar.shouldDisableDate(_5, this)
- }, isc.A.refreshEvents = function isc_MonthSchedule_refreshEvents() {
- var _1 = this.calendar;
- if (!_1.hasData()) return;
- this.logDebug('refreshEvents: month', 'calendar');
- this.year = _1.year;
- this.month = _1.month;
- this.setData(this.getDayArray());
- this.selectChosenDateCells();
- if (_1.eventsRendered && isc.isA.Function(_1.eventsRendered))
- _1.eventsRendered()
- }, isc.A.rowIsHeader = function isc_MonthSchedule_rowIsHeader(_1) {
- var _2 = this.calendar;
- if (!_2.showDayHeaders || (_2.showDayHeaders && _1 % 2 == 1)) return false;
- else return true
- }, isc.A.formatCellValue = function isc_MonthSchedule_formatCellValue(_1, _2, _3, _4) {
- if (!_2) return;
- var _5 = this.calendar,
- _6 = this.fields.get(_4).$66b,
- _7 = _2["event" + _6],
- _8 = _2["date" + _6],
- _9 = _8.getMonth() != _5.month;
- if (this.rowIsHeader(_3)) {
- if (!_5.showOtherDays && _9) {
- return ""
- } else {
- return _5.getDayHeaderHTML(_8, _7, _5, _3, _4)
- }
- } else {
- if (!_5.showOtherDays && _9) {
- return ""
- } else {
- return _5.getDayBodyHTML(_8, _7, _5, _3, _4)
- }
- }
- }, isc.A.getRowHeight = function isc_MonthSchedule_getRowHeight(_1, _2) {
- var _3 = this.calendar,
- _4 = _3.showDayHeaders,
- _5 = this.dayHeaderHeight;
- if (isc.Canvas.$177z) {
- _5 += isc.Canvas.$177z
- }
- if (this.rowIsHeader(_2)) {
- return _5
- } else {
- var _6 = this.data.length,
- _7 = _4 ? _6 / 2 : 0,
- _8 = _7 * _5,
- _9 = this.body.getVisibleHeight() - _8,
- _10 = _4 ? this.minimumDayHeight - _5 : null,
- _11 = _6 - _7;
- if (_9 / _11 <= _10) {
- return _10
- } else {
- if (_2 == this.data.length - 1) {
- return Math.floor(_9 / _11) - 1
- }
- return Math.round(_9 / _11)
- }
- }
- }, isc.A.getCellAlign = function isc_MonthSchedule_getCellAlign(_1, _2, _3) {
- if (this.rowIsHeader(_2)) return "right";
- else return "left"
- }, isc.A.getCellVAlign = function isc_MonthSchedule_getCellVAlign(_1, _2, _3) {
- if (!this.rowIsHeader(_2)) return "top";
- else return "center"
- }, isc.A.cellHoverHTML = function isc_MonthSchedule_cellHoverHTML(_1, _2, _3) {
- var _4 = this.fields.get(_3).$66b;
- var _5 = _1["date" + _4];
- var _6 = _1["event" + _4];
- if (!this.rowIsHeader(_2) && _6 != null) {
- var _7 = this.calendar;
- return _7.getMonthViewHoverHTML(_5, _6)
- }
- }, isc.A.getBaseStyle = function isc_MonthSchedule_getBaseStyle(_1, _2, _3) {
- var _4 = this.calendar,
- _5 = this.fields.get(_3).$66b;
- var _6;
- if (this.rowIsHeader(_2)) {
- if ((_2 == 0 && _1["day" + _5] > 7) || (_2 == this.data.length - 2 && _1["day" + _5] < 7)) {
- if (!_4.showOtherDays) return _4.otherDayBlankStyle;
- else _6 = _4.otherDayHeaderBaseStyle
- } else _6 = _4.dayHeaderBaseStyle
- } else {
- var _7 = this.cellDisabled(_2, _3),
- _8 = _4.showDayHeaders ? 1 : 0,
- _9 = this.data.length - 1;
- if ((_2 == _8 && this.data[_8]["day" + _5] > 7) || (_2 == _9 && this.data[_9]["day" + _5] < 7)) {
- if (!_4.showOtherDays) return _4.otherDayBlankStyle;
- else _6 = _7 ? _4.otherDayBodyBaseStyle + "Disabled" : _4.otherDayBodyBaseStyle
- } else _6 = _7 ? _4.dayBodyBaseStyle + "Disabled" : _4.dayBodyBaseStyle
- }
- return _6
- }, isc.A.selectChosenDateCells = function isc_MonthSchedule_selectChosenDateCells() {
- var _1 = this.calendar;
- if (_1.selectChosenDate) {
- this.getCellSelection().deselectAll();
- var _2 = isc.Calendar.$1833(_1.chosenDate),
- _3 = this.getDateCells(_2);
- this.getCellSelection().selectCellList(_3)
- }
- }, isc.A.cellClick = function isc_MonthSchedule_cellClick(_1, _2, _3) {
- var _4 = this.calendar,
- _5, _6, _7 = this.fields.get(_3).$66b,
- _8 = _1["date" + _7],
- _9 = _1["event" + _7],
- _10 = _4.month != _8.getMonth(),
- _11 = false;
- _4.setChosenDate(isc.DateUtil.createDatetime(_8.getFullYear(), _8.getMonth(), _8.getDate(), 12, 0, 0));
- if (this.rowIsHeader(_2)) {
- if (!(!_4.showOtherDays && _10)) {
- _11 = _4.dayHeaderClick(_8, _9, _4, _2, _3)
- }
- if (_11) {
- _4.selectTab(0)
- }
- } else {
- if (_10) return;
- if (!this.cellDisabled(_2, _3) && !(!_4.showOtherDays && _10)) {
- _11 = _4.dayBodyClick(_8, _9, _4, _2, _3);
- if (_11 && _4.canCreateEvents) {
- var _12 = _4.getCellDate(_2, _3, this),
- _13 = _4.getCellDate(_2, _3 + 1, this);
- var _14 = _4.createEventObject(null, _12, _13);
- _4.showEventDialog(_14, true)
- }
- }
- }
- }, isc.A.draw = function isc_MonthSchedule_draw() {
- this.Super("draw", arguments);
- if (this.$128r) {
- delete this.$128r;
- this.refreshEvents()
- }
- });
- isc.B._maxIndex = isc.C + 28;
- isc.ClassFactory.defineClass("TimelineView", "CalendarView");
- isc.TimelineView.changeDefaults("bodyProperties", {
- snapToCells: false,
- suppressVSnapOffset: true,
- suppressHSnapOffset: true,
- childrenSnapToGrid: false
- });
- isc.A = isc.TimelineView.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.canSort = false;
- isc.A.canResizeFields = false;
- isc.A.canAutoFitFields = false;
- isc.A.canReorderFields = false;
- isc.A.showHeaderContextMenu = false;
- isc.A.showAllRecords = true;
- isc.A.alternateRecordStyles = false;
- isc.A.showRollOver = false;
- isc.A.useCellRollOvers = false;
- isc.A.canSelectCells = false;
- isc.A.selectionType = "multiple";
- isc.A.laneNameField = "lane";
- isc.A.columnWidth = 60;
- isc.A.laneHeight = 60;
- isc.A.labelColumnWidth = 75;
- isc.A.labelColumnBaseStyle = "labelColumn";
- isc.A.labelColumnAlign = "left";
- isc.A.eventPageSize = 30;
- isc.A.trailIconSize = 16;
- isc.A.leadIconSize = 16;
- isc.A.scrollToToday = false;
- isc.A.lineImage = "[SKINIMG]Stretchbar/hsplit_over_stretch.gif";
- isc.A.trailingEndPointImage = "[SKINIMG]actions/prev.png";
- isc.A.leadingEndPointImage = "[SKINIMG]actions/next.png";
- isc.A.headerSpanHeight = 24;
- isc.A.headerProperties = {
- inherentWidth: false
- };
- isc.A.verticalEvents = false;
- isc.A.animateFolders = false;
- isc.A.includeRangeCriteria = true;
- isc.A.unitSnapGapsPerCell = {
- minute: 1,
- hour: 15,
- day: 60,
- week: 1440,
- month: 1440,
- year: 1440 * 30
- };
- isc.A.dragSelectCanvasDefaults = {
- _constructor: "Canvas",
- styleName: "calendarCellSelected",
- opacity: 60,
- width: 1,
- height: 1,
- disabled: true,
- visibility: "hidden",
- autoDraw: false,
- resizeNow: function(_1) {
- var _2 = this.creator,
- _3 = _2.calendar,
- p = isc.addProperties({}, this.props, _1);
- if (p.top == null) {
- p.top = _2.getRowTop(_2.getLaneIndex(p.lane));
- if (p.sublane) p.top += p.sublane.top
- }
- if (p.height == null) {
- p.height = p.sublane ? p.sublane.height : _2.getLaneHeight(p.lane[_3.laneNameField])
- }
- var _5 = p.startSnap.startLeftOffset,
- _6 = p.endSnap.endLeftOffset,
- _7 = Math.abs(_6 - _5);
- this.props = p;
- this.moveTo(_5, p.top);
- this.resizeTo(_7, p.height);
- if (!this.isDrawn()) this.draw();
- if (!this.isVisible()) {
- this.show()
- }
- if (_2.shouldShowDragHovers()) isc.Hover.show(this.getHoverHTML())
- },
- hoverMoveWithMouse: true,
- showHover: true,
- hoverDelay: 0,
- hoverProps: {
- overflow: "visible",
- hoverMoveWithMouse: this.hoverMoveWithMouse
- },
- getHoverHTML: function() {
- var _1 = this.creator,
- _2 = this.props,
- _3 = _2.startSnap.startDate,
- _4 = _2.endSnap.endDate;
- var _5 = _1.calendar.createEventObject({}, _3, _4, _2.lane, _2.sublane);
- return _1.calendar.$140a(_1, _5)
- }
- };
- isc.A.groupRowHeight = 30;
- isc.A.rangeCriteriaMode = "view";
- isc.A.maximumTimelineColumns = 400;
- isc.B.push(isc.A.getTimePerCell = function isc_TimelineView_getTimePerCell(_1) {
- var _2 = this.calendar,
- _3 = this.$27q,
- _4 = _3.millisPerCell;
- if (!_4) {
- _4 = isc.DateUtil.convertPeriodUnit(1 * _3.unitsPerColumn, _3.granularity, "ms")
- }
- if (!_1) _1 = "mn";
- return Math.floor(isc.DateUtil.convertPeriodUnit(_4, "ms", _1))
- }, isc.A.getTimePerSnapGap = function isc_TimelineView_getTimePerSnapGap(_1) {
- var _2 = this.calendar,
- _3 = this.$27q,
- _4 = _3.millisPerSnapGap;
- if (!_4) {
- if (_3.calendarEventSnapGap == null) {
- _4 = this.getTimePerCell("ms")
- } else if (_3.calendarEventSnapGap == 0) {
- if (_3.unitsPerColumn > 1) {
- _4 = isc.DateUtil.convertPeriodUnit(1, _3.innerHeaderUnit || _3.granularity, "ms")
- } else {
- _4 = isc.DateUtil.convertPeriodUnit(this.unitSnapGapsPerCell[_3.granularity], "mn", "ms");
- _4 = Math.max(_4, _3.minimumSnapGapMillis)
- }
- } else {
- _4 = isc.DateUtil.convertPeriodUnit(_3.calendarEventSnapGap, "mn", "ms");
- var _5 = _3.minimumSnapGapMillis;
- if (_4 < _5) {
- this.logWarn("Invalid eventSnapGap - " + ((_4 / 1000) / 60) + " minutes - altered to the lowest sensible time that can be represented by the column-widths in the current view: " + ((_5 / 1000) / 60) + " minutes.");
- _4 = _5
- } else {
- var _6 = _3.millisPerCell;
- if (_4 > _6) {}
- }
- }
- _3.calendarEventSnapGap = isc.DateUtil.convertPeriodUnit(_4, "ms", "mn")
- }
- if (!_1) _1 = "mn";
- return isc.DateUtil.convertPeriodUnit(_4, "ms", _1)
- }, isc.A.getHeaderButtonWidth = function isc_TimelineView_getHeaderButtonWidth(_1) {
- return this.columnWidth
- }, isc.A.getTimePerPixel = function isc_TimelineView_getTimePerPixel(_1) {
- var _2 = this.calendar,
- _3 = this.$27q,
- _4 = _3.millisPerPixel;
- if (!_4) {
- _4 = this.getTimePerCell("ms") / this.getHeaderButtonWidth()
- }
- if (!_1) _1 = "mn";
- return isc.DateUtil.convertPeriodUnit(_4, "ms", _1)
- }, isc.A.getSnapGapPixels = function isc_TimelineView_getSnapGapPixels(_1, _2) {
- var _3 = this.getTimePerCell() / this.getTimePerSnapGap();
- return this.getHeaderButtonWidth() / _3
- }, isc.A.getDateLabelText = function isc_TimelineView_getDateLabelText(_1, _2) {
- return "<b>" + this.formatDateForDisplay(_1) + " - " + this.formatDateForDisplay(_2) + "</b>"
- }, isc.A.initWidget = function isc_TimelineView_initWidget() {
- this.fields = [];
- var c = this.calendar;
- if (c.alternateLaneStyles) {
- this.alternateRecordStyles = c.alternateLaneStyles
- }
- if (c.showLaneRollOver != null) {
- this.showRollOver = c.showLaneRollOver;
- this.useCellRollOvers = false
- }
- if (c.canGroupLanes != null) {
- this.canGroupBy = c.canGroupLanes;
- if (this.canGroupBy) this.groupByField = c.laneGroupByField;
- if (c.laneGroupStartOpen != null) this.groupStartOpen = c.laneGroupStartOpen
- }
- if (c.canReorderLanes) {
- this.canReorderRecords = c.canReorderLanes
- }
- this.firstDayOfWeek = c.firstDayOfWeek;
- if (c.laneNameField) this.laneNameField = c.laneNameField;
- if (c.renderEventsOnDemand) this.renderEventsOnDemand = c.renderEventsOnDemand;
- if (c.startDate) this.startDate = c.startDate.duplicate();
- if (c.endDate) this.endDate = c.endDate.duplicate();
- if (c.labelColumnWidth && c.labelColumnWidth != this.labelColumnWidth) {
- this.labelColumnWidth = c.labelColumnWidth
- }
- if (c.eventDragGap != null) this.eventDragGap = c.eventDragGap;
- this.$963 = this.headerHeight;
- this.cellHeight = this.laneHeight;
- if (c.headerLevels) {
- this.headerLevels = isc.shallowClone(c.headerLevels)
- }
- var _2 = this.headerLevels && this.headerLevels.length > 0 ? this.headerLevels[this.headerLevels.length - 1] : null;
- if (_2) {
- this.timelineGranularity = _2.unit;
- c.timelineGranularity = _2.unit
- } else {
- this.timelineGranularity = c.timelineGranularity
- }
- var _3 = isc.DateUtil.getTimeUnitKey(this.timelineGranularity);
- if (!this.startDate) {
- this.startDate = c.startDate = isc.DateUtil.getAbsoluteDate("-0" + _3, c.chosenDate)
- }
- if (!this.endDate) {
- this.endDate = c.endDate = isc.DateUtil.getAbsoluteDate("+" + c.defaultTimelineColumnSpan + _3, this.startDate)
- } else if (isc.DateUtil.compareDates(this.startDate, this.endDate) == -1) {
- var s = this.startDate;
- this.startDate = c.startDate = this.endDate.duplicate();
- this.endDate = c.endDate = s;
- this.logWarn("Timeline startDate is later than endDate - switching the values.")
- }
- this.initCacheValues();
- this.fields = this.calcFields();
- this.Super("initWidget");
- this.$152e(!c.autoFetchData);
- this.addAutoChild("eventDragTarget");
- this.initCacheValues()
- }, isc.A.installLocalHandlers = function isc_TimelineView_installLocalHandlers() {
- if (this.calendar.showLaneRollOver) {
- this.viewMouseMoveEventId = isc.Page.setEvent("mouseMove", this.getID() + ".viewMouseMove()");
- this.viewDragMoveEventId = isc.Page.setEvent("dragMove", this.getID() + ".viewDragMove()");
- this.viewDragRepositionMoveEventId = isc.Page.setEvent("dragRepositionMove", this.getID() + ".viewDragMove()");
- this.$1745 = true
- }
- }, isc.A.removeLocalHandlers = function isc_TimelineView_removeLocalHandlers() {
- if (this.$1745) {
- isc.Page.clearEvent("mouseMove", this.viewMouseMoveEventId);
- isc.Page.clearEvent("dragMove", this.viewDragMoveEventId);
- isc.Page.clearEvent("dragRepositionMove", this.viewDragRepositionMoveEventId);
- delete this.$1745
- }
- }, isc.A.initCacheValues = function isc_TimelineView_initCacheValues() {
- var _1 = this.calendar;
- this.$27q = {
- alternateLaneStyles: this.alternateRecordStyles,
- firstDayOfWeek: this.firstDayOfWeek,
- granularity: this.timelineGranularity,
- unitsPerColumn: this.timelineUnitsPerColumn || 1,
- rangeStartDate: this.startDate,
- rangeEndDate: this.endDate,
- calendarEventSnapGap: _1.eventSnapGap
- };
- this.$27q.rangeStartMillis = this.$27q.rangeStartDate.getTime();
- this.$27q.rangeEndMillis = this.$27q.rangeEndDate.getTime();
- this.updateSnapProperties();
- return this.$27q
- }, isc.A.updateSnapProperties = function isc_TimelineView_updateSnapProperties() {
- if (this.fieldHeaderLevel) this.$27q.innerHeaderUnit = this.fieldHeaderLevel.unit;
- this.Super("updateSnapProperties", arguments)
- }, isc.A.getDragSelectCanvas = function isc_TimelineView_getDragSelectCanvas(_1) {
- if (!this.body) return null;
- if (!this.dragSelectCanvas) {
- this.dragSelectCanvas = this.createAutoChild("dragSelectCanvas", {
- eventProxy: this.body
- });
- this.body.addChild(this.dragSelectCanvas)
- }
- return this.dragSelectCanvas
- }, isc.A.cellMouseDown = function isc_TimelineView_cellMouseDown(_1, _2, _3) {
- if ((_1 && _1.$52e) || this.isLabelCol(_3)) {
- return true
- }
- var _4 = this.calendar;
- if (_4.canDragCreateEvents == false && this.canDragScroll) {
- this.$50p = true;
- this.$171u = this.body.getScrollLeft();
- this.$171v = this.$171w = this.getOffsetX();
- this.$53r = true;
- return false
- }
- var _5 = this.getMouseData() || {
- x: this.body.getOffsetX(),
- y: this.body.getOffsetY()
- },
- _6 = this.getSnapData(_5.x, _5.y),
- _7 = _6 && _6.startDate;
- if (_4.shouldDisableDate(_7, this)) {
- return false
- }
- if (_4.backgroundMouseDown && _4.backgroundMouseDown(_7) == false) return;
- if (!_4.canCreateEvents || _4.canDragCreateEvents == false) return true;
- this.clearSelection();
- var _8 = this.getDragSelectCanvas(),
- _9 = _6.endDate,
- _10 = this.getLaneFromPoint(),
- _11 = this.getSublaneFromPoint();
- var p = {
- top: null,
- height: null
- };
- p.lane = _10;
- p.sublane = _11;
- p.draggingLeftEdge = false;
- p.startSnap = _6;
- p.endSnap = _6;
- _8.resizeNow(p);
- this.$53r = true;
- return false
- }, isc.A.cellOver = function isc_TimelineView_cellOver(_1, _2, _3) {
- _3 -= 1;
- this.$152f = _2;
- if (this.$50p) {
- var _4 = this.body.getScrollLeft(),
- _5 = this.getOffsetX(),
- _6 = this.$171w - _5;
- this.$171w = _5;
- var _7 = Math.max(0, this.$171u + _6);
- this.body.scrollBy(_6)
- } else if (this.$53r) {
- var _8 = this.getDragSelectCanvas(),
- _9 = _8.props,
- _10 = this.getMouseData() || {
- x: this.body.getOffsetX(),
- y: this.body.getOffsetY()
- },
- _11 = this.getSnapData(_10.x, _10.y);
- if (_11.index < _9.startSnap.index) {
- if (_9.draggingLeftEdge) _9.startSnap = _11;
- else {
- _9.endSnap = _9.startSnap;
- _9.startSnap = _11;
- _9.draggingLeftEdge = true
- }
- } else if (_11.index > _9.endSnap.index) {
- if (!_9.draggingLeftEdge) _9.endSnap = _11;
- else {
- _9.startSnap = _9.endSnap;
- _9.endSnap = _11;
- _9.draggingLeftEdge = false
- }
- } else {
- if (_9.draggingLeftEdge) _9.startSnap = _11;
- else _9.endSnap = _11
- }
- _8.resizeNow(_9)
- }
- return this.Super("cellOver", arguments)
- }, isc.A.cellMouseUp = function isc_TimelineView_cellMouseUp(_1, _2, _3) {
- if (!this.$53r) return;
- this.$53r = false;
- if (this.shouldShowDragHovers()) isc.Hover.hide();
- if (this.$50p) {
- this.$171v = null;
- this.$171u = null;
- this.$50p = false;
- return isc.EH.STOP_BUBBLING
- }
- var _4 = this.calendar,
- _5 = this.getDragSelectCanvas(),
- _6 = _5.props,
- _7 = _6.startSnap.startDate,
- _8 = _6.endSnap.endDate;
- if (_4.backgroundClick) {
- if (_4.backgroundClick(_7, _8) == false) {
- this.clearSelection();
- return
- }
- }
- if (_4.backgroundMouseUp) {
- if (_4.backgroundMouseUp(_7, _8) == false) {
- this.clearSelection();
- return
- }
- }
- if (_4.shouldDisableDate(isc.DateUtil.dateAdd(_8.duplicate(), "ms", -1), this)) {
- this.clearSelection();
- return false
- }
- var _9 = _4.createEventObject(null, _7, _8, _6.lane && _6.lane[_4.laneNameField], _6.sublane && _6.sublane[_4.laneNameField]);
- _4.showEventDialog(_9, true);
- return isc.EH.STOP_BUBBLING
- }, isc.A.clearSelection = function isc_TimelineView_clearSelection() {
- var _1 = this.getDragSelectCanvas();
- if (_1) _1.hide()
- }, isc.A.getCellDate = function isc_TimelineView_getCellDate(_1, _2) {
- if (!this.body) return null;
- var _3 = this.body.getField(_2);
- if (!_3 || !_3.date) return null;
- return _3.date
- }, isc.A.getCellEndDate = function isc_TimelineView_getCellEndDate(_1, _2) {
- if (!this.body) return null;
- var _3 = this.body.getField(_2);
- if (!_3 || !_3.endDate) return null;
- return _3.endDate
- }, isc.A.recordDrop = function isc_TimelineView_recordDrop(_1, _2, _3, _4) {
- this.Super("recordDrop", arguments);
- this.$116v();
- this.markForRedraw()
- }, isc.A.getFirstDateColumn = function isc_TimelineView_getFirstDateColumn() {
- return this.frozenBody ? this.frozenBody.fields.length : 0
- }, isc.A.setFields = function isc_TimelineView_setFields() {
- this.Super("setFields", arguments)
- }, isc.A.updateOverlapRanges = function isc_TimelineView_updateOverlapRanges(_1) {
- var _2 = this.calendar,
- _3 = _1 || this.getEventData(),
- _4 = _3.getLength(),
- _5 = this.overlapRanges || [],
- _6 = [],
- _7 = this.startDate,
- _8 = this.endDate;
- if (isc.isA.ResultSet(_3)) {
- _3 = _3.allRows
- }
- _3.setProperty("$122k", false);
- _3.setProperty("$646", null);
- _3.setProperty("$126u", null);
- _3.setSort([{
- property: _2.laneNameField,
- direction: "ascending"
- }, {
- property: _2.startDateField,
- direction: "ascending"
- }, {
- property: _2.endDateField,
- direction: "descending"
- }]);
- for (var i = 0; i < _4; i++) {
- var _10 = _3.get(i);
- var _11 = {
- events: [_10]
- };
- _11[_2.startDateField] = _2.getEventStartDate(_10);
- _11[_2.endDateField] = _2.getEventEndDate(_10);
- _11[_2.laneNameField] = _11.lane = _10[_2.laneNameField];
- var _12 = true;
- for (var j = 0; j < _5.length; j++) {
- if (_11[_2.laneNameField] != _5[j][_2.laneNameField]) continue;
- if (this.eventsOverlap(_11, _5[j], true)) {
- this.mergeOverlapRanges(_11, _5[j]);
- _12 = false
- }
- if (!_12) break
- }
- if (_12) {
- _5.add(_11);
- if (!_6.contains(_11)) _6.add(_11)
- }
- }
- for (i = 0; i < _5.length; i++) {
- var _14 = _5[i];
- _14.id = "range_" + i + "_lane_" + _14.lane;
- _14.events.setProperty("overlapRangeId", _14.id)
- }
- this.overlapRanges = _5;
- return _6
- }, isc.A.getOverlapSlot = function isc_TimelineView_getOverlapSlot(_1, _2) {
- var _3 = {
- slotNum: _1,
- events: [],
- snapGaps: []
- };
- for (var i = 0; i < _2; i++) _3.snapGaps[i] = 0;
- return _3
- }, isc.A.tagDataForOverlap = function isc_TimelineView_tagDataForOverlap(_1, _2) {
- _1 = _1 || this.getEventData();
- if (_1.getLength() == 0) return;
- var _3 = false;
- var _4 = this.calendar;
- if (_4.eventAutoArrange == false) return;
- this.forceDataSort(_1);
- var _5 = this.isTimelineView() || (this.isDayView() && _4.showDayLanes);
- var _6 = this.updateOverlapRanges(_1);
- var _7 = [];
- if (_5) {
- _7.add({
- property: _4.laneNameField,
- direction: "ascending"
- })
- }
- if (_4.overlapSortSpecifiers) {
- _7.addList(_4.overlapSortSpecifiers)
- } else {
- _7.add({
- property: "eventLength",
- direction: "descending"
- });
- _7.add({
- property: _4.startDateField,
- direction: "ascending"
- });
- _7.add({
- property: _4.endDateField,
- direction: "ascending"
- })
- }
- if (_3) {
- this.logWarn("tagDataForOverlap: about to loop over " + _6.length + " overlap ranges")
- }
- for (var j = 0; j < _6.length; j++) {
- var _9 = _6[j];
- if (_3) {
- this.logWarn("range: " + isc.echoFull(_9) + "")
- }
- var _10 = this.getSnapData(null, null, _9[_4.startDateField]),
- _11 = _10 ? _10.index : 0,
- _12 = this.getSnapData(null, null, _9[_4.endDateField]),
- _13 = _12 ? _12.index : this.$1725.length - 1,
- _14 = (_13 - _11) + 1,
- _15 = [],
- _16 = 1;
- _15[0] = this.getOverlapSlot(0, _14);
- var _17 = _9.events;
- _17.setSort(_7);
- for (var _18 = 0; _18 < _17.length; _18++) {
- var _19 = _17[_18];
- _19.$646 = {};
- var _20 = _19.$646;
- var _21 = _4.getEventStartDate(_19),
- _22 = _4.getEventEndDate(_19);
- _20.eventStartSnap = this.getSnapData(null, null, _21.getTime() + 1, true);
- _20.eventEndSnap = this.getSnapData(null, null, _22.getTime() - 1, true);
- var _23 = (_20.eventStartSnap ? _20.eventStartSnap.index : _20.nextValidSnap.index) - _11;
- var _24 = (_20.eventEndSnap ? _20.eventEndSnap.index : _20.lastValidSnap.index) - _11;
- var _25 = false;
- var _26 = null;
- for (var _27 = 0; _27 < _16; _27++) {
- var _28 = _15[_27].snapGaps.slice(_23, _24 + 1);
- var _29 = _28.sum() > 0;
- if (!_29) {
- _25 = true;
- _15[_27].snapGaps.fill(1, _23, _24 + 1);
- _15[_27].events.add(_19);
- _19.$646.slotNum = _27
- if (_3) {
- this.logWarn("event " + _19.name + " occupying slot " + _27)
- }
- break
- }
- }
- if (!_25) {
- _15[_16] = this.getOverlapSlot(_16, _14);
- _15[_16].snapGaps.fill(1, _23, _24 + 1);
- _15[_16].events.add(_19);
- _19.$646.slotNum = _16
- if (_3) {
- this.logWarn("event " + _19.name + " added to new slot index " + _16)
- }
- _16++
- }
- }
- for (var i = 0; i < _15.length; i++) {
- var _26 = _15[i];
- for (var _31 = 0; _31 < _26.events.length; _31++) {
- var _19 = _26.events[_31];
- var _20 = _19.$646;
- _20.totalSlots = _16;
- var _23 = (_20.eventStartSnap ? _20.eventStartSnap.index : _11) - _11;
- var _24 = (_20.eventEndSnap ? _20.eventEndSnap.index : _11) - _11;
- var _25 = false;
- for (var _32 = i + 1; _32 < _15.length; _32++) {
- var _28 = _15[_32].snapGaps.slice(_23, _24 + 1);
- var _29 = _28.sum() > 0;
- if (_29) {
- _20.slotCount = _32 - _20.slotNum;
- _25 = true;
- break
- }
- }
- if (!_25) {
- _20.slotCount = _16 - _20.slotNum
- }
- _20.slotNum++;
- _19.$126u = _20.slotNum
- }
- }
- _9.slotList = _15;
- if (_3) {
- this.logWarn("***** slotList *****\n" + isc.echoFull(_15))
- }
- }
- }, isc.A.getSnapData = function isc_TimelineView_getSnapData(_1, _2, _3, _4) {
- var _5 = this.$1725,
- _6 = _5.length,
- _7 = (_3 != null),
- _8 = null;
- if (_7) {
- if (isc.isA.Number(_3)) _8 = _3;
- else if (_3.getTime) _8 = _3.getTime()
- } else {
- if (_1 == null) _1 = this.body.getOffsetX()
- }
- if (_4) {
- if (_8 != null) {
- if (_8 < _5[0].startMillis) return _5[0];
- if (_8 > _5[_5.length - 1].endMillis) return _5[_5.length - 1]
- }
- }
- for (var i = 0; i < _6; i++) {
- var _10 = _5[i];
- if (_7) {
- if (_10.startMillis <= _8 && _10.endMillis >= _8) {
- return _10
- }
- } else {
- if (_10.startHidden && _10.endHidden) continue;
- if (_1 >= _10.startLeftOffset && _1 <= _10.endLeftOffset) return _10
- }
- }
- return null
- }, isc.A.buildSnapGapList = function isc_TimelineView_buildSnapGapList(_1) {
- if (!this.body) return;
- var _2 = this.calendar,
- _3 = this.frozenBody ? this.body.fields : this.getFields(),
- _4 = _2.getSnapGapPixels(this),
- _5 = this.getTimePerPixel("ms"),
- _6 = this.getTimePerSnapGap("ms"),
- _7 = this.getTimePerSnapGap("mn"),
- _8 = this.$27q.rangeStartDate,
- _9 = this.$27q.rangeStartMillis,
- _10 = this.$27q.rangeEndMillis,
- _11 = this.$27q.rangeEndDate,
- _12 = this.$27q.rangeStartDate.duplicate(),
- _13 = _9,
- i = 0,
- _15 = [],
- _16 = false,
- _17 = null,
- _18 = 0,
- _19;
- while (_13 < _10) {
- var _20 = _13 + _6;
- if (_20 == _19) {
- this.logWarn("snapGaps " + i + " and " + (i + 1) + " have identical times")
- } else if (_20 >= _10) {
- _20 = _10;
- _16 = true
- }
- if (_7 == 1440) {
- _12.setDate(_12.getDate() + 1);
- _20 = _12.getTime()
- } else {
- _12.setTime(_20 - 1)
- }
- _19 = _20;
- _19--;
- var _21 = {
- index: i++,
- startMillis: _13,
- endMillis: _19,
- startDate: new Date(_13),
- endDate: new Date(_19)
- };
- _21.startField = this.getFieldContainingDate(_13 + 1, true);
- if (_21.startField) {
- _21.startCol = _3.indexOf(_21.startField)
- } else {
- _21.startHidden = true
- }
- if (_21.startField) {
- if (_21.startCol == _17) {
- _18++
- } else {
- _17 = _21.startCol;
- _18 = 0
- }
- _21.fieldSnapIndex = _18;
- var _22 = _2.getMinutePixels(Math.floor((_13 - _21.startField.date.getTime()) / 1000 / 60), null, this);
- _21.startLeftOffset = _21.startField.startLeftOffset + _22
- }
- _21.endField = this.getFieldContainingDate(_19, true);
- if (!_21.endField) {
- _21.endField = this.getFieldContainingDate(_19, false)
- }
- if (_21.endField) {
- _21.endCol = _3.indexOf(_21.endField)
- } else {
- _21.endHidden = true
- }
- if (_21.endField) {
- var _23 = _2.getMinutePixels(Math.floor((_21.endField.endDate.getTime() - _19) / 1000 / 60), null, this);
- _21.endLeftOffset = _21.endField.endLeftOffset - _23
- }
- _21.startDate = new Date(_13);
- _21.endDate = new Date(_19);
- _15.add(_21);
- if (_16) break;
- _13 = _19 + 1
- }
- var _24;
- var _25;
- var _26;
- for (var i = 0; i < _15.length; i++) {
- var _21 = _15[i];
- if (_21.startHidden) {
- if (_25 == null) _25 = i
- } else {
- if (_25 != null) {
- for (var j = _25; j < i; j++) {
- _15[j].nextValidSnap = _21
- }
- _25 = null
- }
- }
- if (_21.endHidden) {
- _21.lastValidSnap = _15[_26]
- } else {
- _26 = i
- }
- _24 = _21
- }
- this.$1725 = _15
- }, isc.A.$1731 = function isc_TimelineView__rebuildFields() {
- this.$171x = true;
- var _1 = this.calcFields();
- if (this.isDrawn()) {
- this.body.removeChild(this.eventDragTarget);
- this.setFields(_1);
- this.body.addChild(this.eventDragTarget)
- } else this.fields = _1
- }, isc.A.$152e = function isc_TimelineView__rebuild(_1) {
- if (this.$129c && this.$129c.length > 0) {
- this.$129c.setProperty("$128k", true);
- this.clearEvents()
- }
- this.setShowHover(this.calendar.showViewHovers);
- this.$1731();
- var _2 = this.lanes || this.calendar.lanes || [];
- this.setLanes(_2.duplicate(), true);
- this.$730();
- if (_1) {
- this.$116v()
- } else {
- this.refreshEvents()
- }
- }, isc.A.refreshEvents = function isc_TimelineView_refreshEvents() {
- this.buildSnapGapList("refreshEvents");
- return this.Super("refreshEvents", arguments)
- }, isc.A.setLanes = function isc_TimelineView_setLanes(_1, _2) {
- var _3 = this.calendar,
- _4 = _3.laneNameField;
- this.lanes = _1.duplicate();
- var _5 = _1.length;
- for (var i = 0; i < _5; i++) {
- var _7 = _1[i];
- if (!_7[_4]) _7[_4] = _7.name;
- if (_7.sublanes) {
- var _8 = this.getLaneHeight(_7),
- _9 = _7.sublanes.length,
- _10 = Math.floor(_8 / _9),
- _11 = 0;
- for (var j = 0; j < _9; j++) {
- var _13 = _7.sublanes[j];
- _13[_4] = _13.name;
- _13.top = _11;
- if (_13.height == null) _13.height = _10;
- _11 += _13.height
- }
- _7.height = _7.sublanes.getProperty("height").sum()
- } else {
- _7.height = this.getLaneHeight(_7)
- }
- }
- this.setData(_1);
- if (this.isDrawn()) this.redraw();
- if (!_2) {
- delete _3.$53e;
- this.$116v()
- }
- }, isc.A.getLaneIndex = function isc_TimelineView_getLaneIndex(_1) {
- var _2;
- if (isc.isAn.Object(_1)) _2 = _1;
- else if (this.data) {
- _2 = this.data.find("name", _1) || this.data.find(this.calendar.laneNameField, _1)
- } else return -1;
- var _3 = this.getRecordIndex(_2);
- return _3
- }, isc.A.getLane = function isc_TimelineView_getLane(_1) {
- var _2 = this.getLaneIndex(_1);
- if (_2 >= 0) return this.getRecord(_2)
- }, isc.A.getLaneFromPoint = function isc_TimelineView_getLaneFromPoint(_1, _2) {
- if (_2 == null) _2 = this.body.getOffsetY();
- var _3 = this.getEventRow(_2),
- _4 = this.getRecord(_3);
- return !this.isGroupNode(_4) ? _4 : null
- }, isc.A.getSublaneFromPoint = function isc_TimelineView_getSublaneFromPoint(_1, _2) {
- if (_2 == null) _2 = this.body.getOffsetY();
- var _3 = this.getEventRow(_2),
- _4 = this.getRecord(_3),
- _5 = _4 ? _4.sublanes : null;
- if (!_5) return null;
- var _6 = this.getRowTop(_3),
- _7 = _2 - _6,
- _8 = this.getLaneHeight(_4),
- _9 = _5.length,
- _10 = 0;
- for (var i = 0; i < _9; i++) {
- if (_10 + _5[i].height >= _7) {
- return _5[i]
- }
- _10 += _5[i].height
- }
- return null
- }, isc.A.$730 = function isc_TimelineView__scrubDateRange() {
- var _1 = this.calendar.timelineGranularity;
- if (_1 == "month") {
- this.startDate.setDate(1)
- } else if (_1 == "week") {
- this.startDate = isc.DateUtil.getStartOf(this.startDate, "w", true, this.calendar.firstDayOfWeek)
- } else if (_1 == "day") {
- this.startDate.setHours(0);
- this.startDate.setMinutes(0);
- this.startDate.setSeconds(0);
- this.startDate.setMilliseconds(0)
- } else if (_1 == "hour") {
- this.startDate.setMinutes(0);
- this.startDate.setSeconds(0);
- this.startDate.setMilliseconds(0)
- } else if (_1 == "minute") {
- this.startDate.setSeconds(0);
- this.startDate.setMilliseconds(0)
- }
- }, isc.A.scrollTimelineTo = function isc_TimelineView_scrollTimelineTo(_1) {
- this.bodies[1].scrollTo(_1)
- }, isc.A.setLaneHeight = function isc_TimelineView_setLaneHeight(_1) {
- this.laneHeight = _1;
- this.setCellHeight(_1);
- this.refreshEvents()
- }, isc.A.getRowHeight = function isc_TimelineView_getRowHeight(_1, _2) {
- var _3 = null;
- if (_1) {
- if (this.isGroupNode(_1)) _3 = this.groupRowHeight;
- else _3 = _1.height
- }
- return _3 || this.Super("getRowHeight", arguments)
- }, isc.A.setInnerColumnWidth = function isc_TimelineView_setInnerColumnWidth(_1) {
- this.columnWidth = _1;
- this.$152e(true)
- }, isc.A.setTimelineRange = function isc_TimelineView_setTimelineRange(_1, _2, _3, _4, _5, _6, _7) {
- var _8 = this.calendar;
- if (_3) _8.timelineGranularity = _3;
- else _3 = _8.timelineGranularity;
- this.timelineGranularity = _3;
- if (_5) _8.timelineUnitsPerColumn = _5;
- else _5 = _8.timelineUnitsPerColumn;
- this.timelineUnitsPerColumn = _5;
- var _9 = _4 || this.$178u || _8.defaultTimelineColumnSpan,
- _10 = false,
- _11 = (_3 || _8.timelineGranularity).toLowerCase(),
- _12 = isc.DateUtil.getTimeUnitKey(_11);;
- if (_6) {
- _8.headerLevels = _6
- }
- _1 = _1 || this.startDate;
- _1 = isc.DateUtil.getStartOf(_1, _12);
- if (!_2) {
- if (_1.getTime() == this.startDate.getTime() && this.endDate) _2 = this.endDate;
- else _2 = isc.DateUtil.getAbsoluteDate("+" + (_9 * _5) + _12, _1)
- }
- var _13 = this.rangeCriteriaMode || _8.rangeCriteriaMode;
- if (_13 && _13 != "none") _10 = true;
- if (_1.logicalDate) _1 = isc.DateUtil.getStartOf(_1.duplicate(), _12, false, this.firstDayOfWeek);
- if (_2.logicalDate) _2 = isc.DateUtil.getEndOf(_2.duplicate(), _12, false, this.firstDayOfWeek);
- if (isc.DateUtil.compareLogicalDates(_1, _2) == 0) {
- if (_8.showWeekends == false && _8.dateIsWeekend(_1)) {
- _8.showWeekends = true;
- this.logWarn("showWeekends was automatically switched on because the dates provided for the timeline spanned less than one day and the day is a weekend.")
- }
- }
- this.startDate = _1.duplicate();
- this.endDate = _2.duplicate();
- _8.startDate = _1.duplicate();
- _8.endDate = _2.duplicate();
- this.initCacheValues();
- _8.dateChooser.setData(this.startDate);
- if (!_7) _8.setChosenDate(this.startDate, true);
- if (_8.autoFetchData && _8.$1737) _10 = false;
- this.$152e(_10)
- }, isc.A.addUnits = function isc_TimelineView_addUnits(_1, _2, _3) {
- _3 = _3 || this.calendar.timelineGranularity;
- if (_3 == "century") {
- _1.setFullYear(_1.getFullYear() + (_2 * 100))
- } else if (_3 == "decade") {
- _1.setFullYear(_1.getFullYear() + (_2 * 10))
- } else if (_3 == "year") {
- _1.setFullYear(_1.getFullYear() + _2)
- } else if (_3 == "quarter") {
- _1.setMonth(_1.getMonth() + (_2 * 3))
- } else if (_3 == "month") {
- _1.setMonth(_1.getMonth() + _2)
- } else if (_3 == "week") {
- _1.setDate(_1.getDate() + (_2 * 7))
- } else if (_3 == "day") {
- _1.setDate(_1.getDate() + _2)
- } else if (_3 == "hour") {
- _1.setHours(_1.getHours() + _2)
- } else if (_3 == "minute") {
- _1.setMinutes(_1.getMinutes() + _2)
- } else if (_3 == "second") {
- _1.setSeconds(_1.getSeconds() + _2)
- } else if (_3 == "millisecond") {
- _1.setMilliseconds(_1.getMilliseconds() + _2)
- }
- return _1
- }, isc.A.getColFromDate = function isc_TimelineView_getColFromDate(_1) {
- var _2 = this.frozenBody ? this.body.fields : this.getFields(),
- _3 = (_1 && _1.getTime) ? _1.getTime() : _1;
- if (_1) {
- for (var i = 0; i < _2.length; i++) {
- var _5 = _2[i],
- _6 = _5 && _5.date ? _5.date.getTime() : null,
- _7 = _5 && _5.endDate ? _5.endDate.getTime() : null;
- if (!_6 || !_7) continue;
- if (_6 >= _3) {
- return i - 1
- }
- }
- }
- return null
- }, isc.A.getFieldContainingDate = function isc_TimelineView_getFieldContainingDate(_1, _2) {
- var _3 = this.frozenBody ? this.body.fields : this.getFields(),
- _4 = (_1 && _1.getTime) ? _1.getTime() : _1;
- if (_4) {
- if (_4 < this.startDate.getTime()) return _3[0];
- if (_4 >= this.endDate.getTime()) {
- return _2 ? null : _3[_3.length - 1]
- }
- for (var i = 0; i < _3.length; i++) {
- var _6 = _3[i],
- _7 = _6 && _6.date ? _6.date.getTime() : null,
- _8 = _6 && _6.endDate ? _6.endDate.getTime() : null;
- if (_4 >= _7 && _4 <= _8) {
- return _6
- }
- }
- }
- return null
- }, isc.A.calcFields = function isc_TimelineView_calcFields() {
- var _1 = [],
- _2 = this.calendar;
- var _3 = {
- hoverDelay: this.hoverDelay + 1,
- hoverMoveWithMouse: true,
- canHover: this.shouldShowHeaderHovers(),
- showHover: this.shouldShowHeaderHovers(),
- mouseMove: function() {
- var _4 = this.grid,
- _5 = _4.getEventRow(),
- _6 = _5 < 0;
- if (_4.shouldShowHeaderHovers()) {
- isc.Hover.show(this.getHoverHTML());
- return isc.EH.STOP_BUBBLING
- }
- },
- getHoverHTML: function() {
- var _4 = this.grid;
- return _4.calendar.$140e(_4, _4.fieldHeaderLevel, this, this.date, this.endDate)
- }
- };
- if (this.showLaneFields != false) {
- if (_2.laneFields) {
- var _7 = _2.laneFields;
- _7.setProperty("frozen", true);
- _7.setProperty("isLaneField", true);
- for (var i = 0; i < _7.length; i++) {
- var _9 = _7[i];
- if (_9.minWidth == null) _9.minWidth = this.labelColumnWidth;
- if (_9.width == null) _9.width = _9.minWidth || this.labelColumnWidth;
- _1.add(_9)
- }
- } else {
- var _10 = isc.addProperties({
- autoFitWidth: true,
- width: this.labelColumnWidth,
- minWidth: this.labelColumnWidth,
- name: "title",
- title: " ",
- showTitle: false,
- frozen: true,
- isLaneField: true
- }, _3);
- _1.add(_10)
- }
- }
- if (!_2.headerLevels && !this.headerLevels) {
- _2.headerLevels = [{
- unit: _2.timelineGranularity
- }]
- }
- if (_2.headerLevels) {
- this.headerLevels = isc.shallowClone(_2.headerLevels)
- }
- if (this.headerLevels) {
- this.fieldHeaderLevel = this.headerLevels[this.headerLevels.length - 1];
- this.headerLevels.remove(this.fieldHeaderLevel);
- _2.timelineGranularity = this.fieldHeaderLevel.unit;
- this.$27q.innerHeaderLevel = this.fieldHeaderLevel;
- this.$27q.granularity = _2.timelineGranularity;
- this.updateSnapProperties()
- }
- this.adjustTimelineForHeaders();
- var _11 = this.startDate.duplicate(),
- _12 = this.endDate.duplicate(),
- _13 = _2.timelineUnitsPerColumn,
- _14 = 0,
- _15 = this.fieldHeaderLevel,
- _16 = _15 && _15.titles ? _15.titles : [];
- if (_15.headerWidth) this.columnWidth = _15.headerWidth;
- var _17 = _12.getTime(),
- _18 = this.getHeaderButtonWidth(),
- _19 = 0,
- _20 = _19 + _18,
- _21 = this.getTimePerCell("d"),
- _22 = _21 > 1,
- _23;
- this.$178u = 0;
- while (_11.getTime() <= _17) {
- var _24 = _11.duplicate(),
- _25 = _22 || _2.shouldShowDate(_11, this);
- _24 = isc.DateUtil.getStartOf(_24.duplicate(), _2.timelineGranularity);
- if (_24.getTime() >= _17) break;
- this.$178u++;
- _23 = isc.DateUtil.getEndOf(this.addUnits(_11.duplicate(), _13), _2.timelineGranularity);
- var _26 = null;
- if (_23.getTime() > _17) {
- _23.setTime(_17)
- }
- if (_25) {
- var _27 = this.getInnerFieldTitle(_15, _14, _11);
- _26 = isc.addProperties({}, {
- name: "f" + _14,
- headerLevel: _15,
- title: _27,
- width: _15.headerWidth || this.getHeaderButtonWidth(),
- cellAlign: _15.cellAlign,
- cellVAlign: _15.cellVAlign,
- date: _24.duplicate(),
- logicalDate: isc.DateUtil.getLogicalDateOnly(_24),
- logicalTime: isc.DateUtil.getLogicalTimeOnly(_24),
- canGroup: false,
- canSort: false,
- canFreeze: false,
- canFocus: false,
- startLeftOffset: _19,
- endLeftOffset: _20
- }, _3, this.getFieldProperties(_24))
- }
- _11 = _23.duplicate();
- if (_25) {
- _26.endDate = _11.duplicate();
- _26.endDate.setTime(_26.endDate.getTime() - 1);
- _26.logicalEndDate = isc.DateUtil.getLogicalDateOnly(_11);
- _26.logicalEndTime = isc.DateUtil.getLogicalTimeOnly(_11), _1.add(_26);
- _14++;
- _19 += _18;
- _20 += _18
- }
- if (_1.length >= this.maximumTimelineColumns) {
- this.endDate = _11.duplicate();
- this.logWarn("Date-range too large - limiting to " + this.maximumTimelineColumns + " columns.");
- break
- }
- }
- this.$178u--;
- for (var i = 0, _28 = _1.length; i < _28; i++) {
- var _29 = _1[i];
- isc.addProperties(_29, _3);
- _29.headerLevel = this.fieldHeaderLevel
- }
- this.buildHeaderSpans(_1, this.headerLevels, this.startDate, this.endDate);
- this.$116z = _14 - 1;
- this.buildSnapGapList("calcFields");
- return _1
- });
- isc.evalBoundary;
- isc.B.push(isc.A.redraw = function isc_TimelineView_redraw() {
- this.Super("redraw", arguments);
- if (!this.animateFolders && this.$129z) {
- delete this.$129z;
- this.refreshVisibleEvents(null, null, "redraw")
- }
- }, isc.A.toggleFolder = function isc_TimelineView_toggleFolder(_1) {
- this.Super("toggleFolder", arguments);
- if (!this.animateFolders) {
- this.$129z = true;
- this.markForRedraw()
- }
- }, isc.A.rowAnimationComplete = function isc_TimelineView_rowAnimationComplete(_1, _2) {
- this.Super("rowAnimationComplete", arguments);
- if (!this.$64v) {
- delete this.body.$8s;
- this.refreshVisibleEvents()
- }
- }, isc.A.adjustTimelineForHeaders = function isc_TimelineView_adjustTimelineForHeaders() {
- var _1 = this.calendar,
- _2 = this.fieldHeaderLevel ? this.fieldHeaderLevel.unit : _1.timelineGranularity,
- _3 = _1.startDate,
- _4 = new Date(_1.endDate.getTime() - 1);
- var _5 = isc.DateUtil.getTimeUnitKey(_2);
- _1.startDate = this.startDate = isc.DateUtil.getStartOf(_3, _5, false, _1.firstDayOfWeek);
- _1.endDate = this.endDate = isc.DateUtil.getEndOf(_4, _5, false, _1.firstDayOfWeek)
- }, isc.A.buildHeaderSpans = function isc_TimelineView_buildHeaderSpans(_1, _2, _3, _4) {
- var _5 = _3.duplicate(),
- c = this.calendar,
- _7 = [],
- _8 = [];
- if (_2 && _2.length > 0) {
- _8 = this.getHeaderSpans(_3, _4, _2, 0, _1);
- this.headerHeight = this.$963 + (_2.length * this.headerSpanHeight)
- }
- if (_8 && _8.length > 0) {
- this.setHeaderSpans(_8, true)
- }
- }, isc.A.getHeaderSpans = function isc_TimelineView_getHeaderSpans(_1, _2, _3, _4, _5) {
- var _6 = _1.duplicate(),
- c = this.calendar,
- _8 = _3[_4],
- _9 = _8.unit,
- _10 = _4 > 0 ? _3[_4 - 1].unit : _9,
- _11 = c.timelineUnitsPerColumn,
- _12 = _8.titles || [],
- _13 = [],
- _14 = 0;
- if (_4 > 0) {
- if (isc.DateUtil.compareTimeUnits(_9, _10) > 0) {
- isc.logWarn("The order of the specified HeaderLevels is incorrect - '" + _9 + "' is of a larger granularity than '" + _10 + "'")
- }
- }
- var _15 = isc.DateUtil;
- var _16 = true;
- while (_6 <= _2) {
- _15.dateAdd(_6, "mn", 1, 1);
- if (_16) {
- _16 = false;
- var _17 = isc.DateUtil.getEndOf(_6.duplicate(), isc.DateUtil.getTimeUnitKey(_9), false, c.firstDayOfWeek)
- } else {
- var _17 = this.addUnits(_6.duplicate(), _11, _9)
- }
- var _18 = {
- unit: _9,
- hoverDelay: this.hoverDelay + 1,
- hoverMoveWithMouse: true,
- canHover: this.shouldShowHeaderHovers(),
- showHover: this.shouldShowHeaderHovers(),
- canFocus: false,
- headerLevel: _8,
- mouseMove: function() {
- var _19 = this.creator;
- if (_19.shouldShowHeaderHovers()) {
- if (isc.Hover.lastHoverTarget != _19) _19.startHover();
- else _19.updateHover();
- return isc.EH.STOP_BUBBLING
- }
- },
- getHoverHTML: function() {
- var _19 = this.creator;
- return _19.calendar.$140e(_19, this.headerLevel, this, this.startDate, this.endDate)
- }
- };
- _18[c.startDateField] = _6.duplicate();
- _18[c.endDateField] = _17.duplicate();
- this.setSpanDates(_18, _6.duplicate());
- _17 = _18.endDate;
- var _20 = this.getHeaderLevelTitle(_8, _14, _6, _17);
- _18.title = _20;
- _18.fields = [];
- for (var i = 0; i < _5.length; i++) {
- var _22 = _5[i];
- if (_22.isLaneField || _22.date < _18.startDate) continue;
- if (_22.date >= _18.endDate) break;
- _22.headerLevel = _3[_4];
- _18.fields.add(_22.name)
- }
- if (_4 < _3.length - 1) {
- _18.spans = this.getHeaderSpans(_18.startDate, _18.endDate, _3, _4 + 1, _5);
- if (_18.spans && _18.spans.length > 0) _18.fields = null;
- if (_8.titles && _8.titles.length != _18.spans.length) {
- isc.logWarn("The titles array provided for the " + _8.unit + " levelHeader has a length mismatch: expected " + _18.spans.length + " but " + _8.titles.length + " are present. Some titles may be auto-generated according to TimeUnit.")
- }
- }
- _13.add(isc.clone(_18));
- _6 = _17.duplicate();
- _14++
- }
- return _13
- }, isc.A.getHeaderLevelTitle = function isc_TimelineView_getHeaderLevelTitle(_1, _2, _3, _4) {
- var _5 = _1.unit,
- _6 = _1.titles ? _1.titles[_2] : null;
- if (!_6) {
- if (_5 == "century" || _5 == "decade") {
- _6 = _3.getFullYear() + " - " + _3.getFullYear()
- } else if (_5 == "year") {
- _6 = _3.getFullYear()
- } else if (_5 == "quarter") {
- _6 = _3.getShortMonthName() + " - " + _4.getShortMonthName()
- } else if (_5 == "month") {
- _6 = _3.getShortMonthName()
- } else if (_5 == "week") {
- var _7 = isc.DateUtil.getStartOf(_3.duplicate(), "W", null, this.calendar.firstDayOfWeek);
- _7.setDate(_7.getDate() + (_7.firstWeekIncludesDay - this.calendar.firstDayOfWeek));
- _6 = this.calendar.weekPrefix + " " + _7.getWeek(this.calendar.firstDayOfWeek)
- } else if (_5 == "day") {
- _6 = _3.getShortDayName()
- } else {
- if (_5 == "hour") _6 = _3.getHours();
- if (_5 == "minute") _6 = _3.getMinutes();
- if (_5 == "second") _6 = _3.getSeconds();
- if (_5 == "millisecond") _6 = _3.getMilliseconds();
- if (_5 == "hour") _6 = _3.getHours()
- }
- _6 = "" + _6;
- if (isc.isA.Function(_1.titleFormatter)) {
- _6 = _1.titleFormatter(_1, _3, _4, _6, this.calendar)
- }
- }
- return _6
- }, isc.A.setSpanDates = function isc_TimelineView_setSpanDates(_1, _2) {
- var _3 = isc.DateUtil.getTimeUnitKey(_1.unit);
- _1.startDate = isc.DateUtil.getStartOf(_2, _3, null, this.calendar.firstDayOfWeek);
- _1.endDate = isc.DateUtil.getEndOf(_1.startDate, _3, null, this.calendar.firstDayOfWeek)
- }, isc.A.getFieldProperties = function isc_TimelineView_getFieldProperties(_1) {
- return null
- }, isc.A.getInnerFieldTitle = function isc_TimelineView_getInnerFieldTitle(_1, _2, _3, _4) {
- var _5 = _1.unit,
- _6 = _1.titles ? _1.titles[_2] : null;
- if (!_6) {
- if (_5 == "year") {
- _6 = _3.getFullYear()
- } else if (_5 == "month") {
- _6 = _3.getShortMonthName()
- } else if (_5 == "week") {
- var _7 = isc.DateUtil.getStartOf(_3.duplicate(), "W", null, this.calendar.firstDayOfWeek);
- _7.setDate(_7.getDate() + (_7.firstWeekIncludesDay - this.calendar.firstDayOfWeek));
- _6 = this.calendar.weekPrefix + " " + _7.getWeek(this.calendar.firstDayOfWeek)
- } else if (_5 == "day") {
- _6 = (_3.getMonth() + 1) + "/" + _3.getDate()
- } else {
- var _8 = _3.getMinutes().toString();
- if (_8.length == 1) _8 = "0" + _8;
- _6 = _3.getHours() + ":" + _8
- }
- if (isc.isA.Function(_1.titleFormatter)) {
- _6 = _1.titleFormatter(_1, _3, _4, _6, this.calendar)
- }
- }
- return _6
- }, isc.A.draw = function isc_TimelineView_draw(_1, _2, _3, _4) {
- this.invokeSuper(isc.TimelineView, "draw", _1, _2, _3, _4);
- this.body.snapHGap = this.getHeaderButtonWidth();
- if (this.scrollToToday != false) {
- var _5 = new Date();
- _5.setDate(_5.getDate() - this.scrollToToday);
- var _6 = this.calendar.getDayDiff(this.startDate, _5);
- var _7 = _6 * this.getHeaderButtonWidth();
- this.bodies[1].scrollTo(_7, 0)
- }
- this.logDebug('draw', 'calendar');
- this.body.addChild(this.eventDragTarget);
- this.eventDragTarget.setView(this)
- }, isc.A.formatDateForDisplay = function isc_TimelineView_formatDateForDisplay(_1) {
- return _1.getShortMonthName() + " " + _1.getDate() + ", " + _1.getFullYear()
- }, isc.A.getLabelColCount = function isc_TimelineView_getLabelColCount() {
- if (this.calendar.laneFields) {
- return this.calendar.laneFields.length
- } else {
- return 1
- }
- }, isc.A.isLabelCol = function isc_TimelineView_isLabelCol(_1) {
- var _2 = this.getField(_1);
- return _2 && _2.frozen
- }, isc.A.showField = function isc_TimelineView_showField() {
- this.Super("showField", arguments);
- this.refreshEvents()
- }, isc.A.hideField = function isc_TimelineView_hideField() {
- this.Super("hideField", arguments);
- this.refreshEvents()
- }, isc.A.getCellStyle = function isc_TimelineView_getCellStyle(_1, _2, _3) {
- if (_1.$52e) return this.Super("getCellStyle", arguments);
- var _4 = this.getBaseStyle(_1, _2, _3);
- if (_3 == null) return _4;
- var _5 = !this.isLabelCol(_3);
- if (_5) {
- var _6 = _3 - (this.frozenBody ? this.frozenBody.fields.length : 0);
- var _7 = this.getCellDate(_2, _6);
- if (_7 && this.calendar.shouldDisableDate(_7, this)) {
- _4 += "Disabled"
- }
- }
- if (!this.$158l && this.calendar.showLaneRollOver) {
- var _8 = this.getFieldBody(_3),
- _9 = _8.lastOverRow;
- if (_2 != null && _9 != null && _2 == _9) _4 += "Over"
- }
- if (this.alternateRecordStyles && _2 % 2 != 0) _4 += "Dark";
- return _4
- }, isc.A.getBaseStyle = function isc_TimelineView_getBaseStyle(_1, _2, _3) {
- var _4 = this.calendar;
- if (_1.$52e) return this.groupNodeBaseStyle;
- else if (this.isLabelCol(_3)) return this.labelColumnBaseStyle;
- else {
- var _5 = _4.getCellDate(_2, _3, this),
- _6 = _5 && _4.getDateStyle ? _4.getDateStyle(_5, _2, _3, this) : null;
- return _6 || this.baseStyle
- }
- }, isc.A.slideRange = function isc_TimelineView_slideRange(_1) {
- var c = this.calendar,
- _3 = c.timelineGranularity.toLowerCase(),
- _4 = isc.DateUtil.getTimeUnitKey(_3),
- _5 = c.timelineUnitsPerColumn || 1,
- _6 = this.startDate.duplicate(),
- _7 = this.endDate.duplicate(),
- _8 = _1 ? 1 : -1,
- _9 = c.columnsPerPage || (this.getFields().length - this.getLabelColCount());
- _6 = isc.DateUtil.dateAdd(_6, _4, _9 * _5, _8, false);
- _6 = isc.DateUtil.getStartOf(_6, _4, false, c.firstDayOfWeek);
- _7 = isc.DateUtil.dateAdd(_7, _4, _9 * _5, _8, false);
- _7 = isc.DateUtil.getEndOf(_7, _4, false, c.firstDayOfWeek);
- this.setTimelineRange(_6, _7, _3, null, _5, null, false)
- }, isc.A.nextOrPrev = function isc_TimelineView_nextOrPrev(_1) {
- this.slideRange(_1)
- }, isc.A.compareDates = function isc_TimelineView_compareDates(_1, _2, _3) {
- if (_1.getFullYear() < _2.getFullYear()) {
- return 1
- } else if (_1.getFullYear() > _2.getFullYear()) {
- return -1
- }
- if (_1.getMonth() < _2.getMonth()) {
- return 1
- } else if (_1.getMonth() > _2.getMonth()) {
- return -1
- }
- if (_1.getDate() < _2.getDate()) {
- return 1
- } else if (_1.getDate() > _2.getDate()) {
- return -1
- }
- return 0
- }, isc.A.getDateFromPoint = function isc_TimelineView_getDateFromPoint(_1, _2, _3, _4) {
- var _5 = this.calendar;
- if (_1 == null && _2 == null) {
- _1 = this.body.getOffsetX()
- }
- var _6 = this.getSnapData(_1, null, null, true);
- if (_6) {
- if (_6.nextValidSnap) {
- return _6.nextValidSnap.startDate.duplicate()
- } else if (_6.lastValidSnap) {
- return _6.lastValidSnap.endDate.duplicate()
- }
- return _6.startDate.duplicate()
- }
- if (_1 < 0 || _2 < 0) return null;
- var _7 = this.body.getEventColumn(_1);
- if (_7 == -2) _7 = this.body.fields.length - 1;
- if (_7 == -1) return null;
- if (_4 == null) _4 = true;
- var _8 = Math.max(_5.getSnapGapPixels(this), 1);
- if (_4) {
- var r = _1 % _8;
- if (r) _1 -= r
- }
- var _10 = this.body.fields[_7].date,
- _11 = this.body.getColumnLeft(_7),
- _12 = _1 - _11,
- _13 = Math.floor(_12 / _8);
- if (_13) _10 = _5.addSnapGapsToDate(_10.duplicate(), this, _13);
- return _10
- }, isc.A.$732 = function isc_TimelineView__getEventBreadth(_1, _2) {
- var _3 = _1 && _1["_" + this.viewName];
- if (_3) {
- if (_2 && _3.exactBreadth) return _3.exactBreadth;
- if (!_2 && _3.snapBreadth) return _3.snapBreadth
- }
- var _4 = this.calendar,
- _5 = _4.getEventStartDate(_1).getTime(),
- _6 = _4.getEventEndDate(_1).getTime(),
- _7 = this.$27q.rangeStartMillis || _4.getVisibleStartDate(this).getTime(),
- _8 = this.$27q.rangeEndMillis || _4.getVisibleEndDate(this).getTime();
- var _9 = this.getDateLeftOffset(_5, null, _2),
- _10 = this.getDateRightOffset(_6 - 1, _2),
- _11 = _10 - _9;
- if (_3) {
- if (_2) _3.exactBreadth = _11;
- else _3.snapBreadth = _11
- }
- return _11
- }, isc.A.getDateRightOffset = function isc_TimelineView_getDateRightOffset(_1, _2) {
- if (!_1) return 0;
- var _3 = this.getSnapData(null, null, _1, true);
- if (_3) {
- if (_3.lastValidSnap) {
- return _3.lastValidSnap.endLeftOffset
- }
- return _3.endLeftOffset
- }
- }, isc.A.getDateLeftOffset = function isc_TimelineView_getDateLeftOffset(_1, _2, _3) {
- if (!_1) return 0;
- var _4 = this.getSnapData(null, null, _1, true);
- if (_4) {
- if (_4.nextValidSnap) {
- return _4.nextValidSnap.startLeftOffset
- } else if (_4.lastValidSnap) {
- return _4.lastValidSnap.endLeftOffset
- }
- return _4.startLeftOffset
- }
- var _5 = this.calendar.getVisibleStartDate(this).getTime();
- var _6 = this.calendar.getVisibleEndDate(this).getTime();
- var _7 = isc.isA.Number(_1) ? _1 : _1.getTime();
- if (_7 <= _5) _7 = _5 + 1;
- if (_7 >= _6) _7 = _6;
- var _8 = this.calendar,
- _9 = _8.getSnapGapPixels(this),
- _10 = _8.getSnapGapMinutes(this);
- var _11 = this.body.fields,
- _12 = _11.getLength(),
- _13 = Math.floor(_7 / 60000),
- _14 = this.body.getColumnWidth(0),
- _15 = this.getTimePerCell("mn");
- for (var i = 0; i < _12; i++) {
- var _17 = _11[i];
- var _18 = _17.date.getTime(),
- _19 = _17.endDate.getTime(),
- _20 = Math.floor(_17.date.getTime() / 60000),
- _21 = Math.floor(_17.endDate.getTime() / 60000);
- if (_13 == _21) {
- return this.body.getColumnLeft(i) + _14
- } else if (_13 < _21) {
- if (_13 == _20) {
- return this.body.getColumnLeft(i)
- } else if (_13 > _20) {
- var _22 = (_14 * i),
- _23 = _13 - _20,
- _24 = Math.floor(_23 / _10),
- _25 = _23 % _10;
- if (_2) {
- if (_25 > 0 || _23 < _10) _24++
- }
- var _26 = _22 + Math.round((_24 * _9));
- if (_3) _26 += Math.round(_8.getMinutePixels(_25, null, this));
- return _26
- } else {
- return (_14 * i)
- }
- }
- }
- return -1
- }, isc.A.getEventLeft = function isc_TimelineView_getEventLeft(_1) {
- return this.getDateLeftOffset(this.calendar.getEventStartDate(_1))
- }, isc.A.getEventRight = function isc_TimelineView_getEventRight(_1) {
- return this.getDateRightOffset(this.calendar.getEventEndDate(_1))
- }, isc.A.getLaneHeight = function isc_TimelineView_getLaneHeight(_1) {
- if (_1 == null) return;
- if (isc.isA.Number(_1)) _1 = this.getRecord(_1);
- else if (isc.isA.String(_1)) _1 = this.getLane(_1);
- return (_1 && _1.height) || this.cellHeight
- }, isc.A.getSublaneHeight = function isc_TimelineView_getSublaneHeight(_1, _2) {
- if (!isc.isAn.Object(_1)) {
- if (!_2 || !_2.sublanes) return null;
- if (isc.isA.Number(_1)) _1 = _2.sublanes[_1];
- else if (isc.isA.String(_1)) {
- _1 = _2.sublanes.find(this.calendar.laneNameField, _1)
- }
- }
- return _1 ? _1.height : null
- }, isc.A.addLeadingAndTrailingLines = function isc_TimelineView_addLeadingAndTrailingLines(_1) {
- var _2, _3, _4, _5;
- if (_1.$645) {
- _2 = _1.$645[0];
- _3 = _1.$645[1];
- _4 = _1.$645[2];
- _5 = _1.$645[3]
- } else {
- _2 = this.$65r();
- _3 = this.$65s(_1, "lead");
- _4 = this.$65r();
- _5 = this.$65s(_1, "trail")
- }
- var _6 = this.$65t(_3, _2);
- var _7 = this.$65t(_5, _4);
- if (!_1.$645) {
- this.body.addChild(_2);
- this.body.addChild(_3);
- this.body.addChild(_4);
- this.body.addChild(_5);
- _1.$645 = [_2, _3, _4, _5]
- }
- }, isc.A.$65t = function isc_TimelineView__positionIcon(_1, _2) {
- var _3 = this.calendar,
- _4 = _1.eventCanvas,
- _5 = _4.event,
- _6 = _1.type,
- _7 = this.getHeaderButtonWidth(),
- _8 = _4.getVisibleHeight(),
- _9 = _4.getTop(),
- _10 = _4.getLeft();
- var _11, _12, _13 = true;
- if (_6 == "trail") {
- if (this.compareDates(_5[_3.trailingDateField], this.endDate) < 0) {
- _11 = _3.getDayDiff(this.endDate, _5[_3.startDateField]);
- if (_11 < 1) _11 = 1;
- _12 = _11 * _7;
- _13 = false
- } else {
- _11 = _3.getDayDiff(_5[_3.trailingDateField], _5[_3.startDateField]);
- _12 = (_11 * _7) - (Math.round(_7 / 2))
- }
- } else {
- if (this.compareDates(this.startDate, _5[_3.leadingDateField]) < 0) {
- _11 = _3.getDayDiff(this.startDate, _3.getEventStartDate(_5));
- if (_11 < 1) _11 = 1;
- _12 = _11 * _7;
- _13 = false
- } else {
- _11 = _3.getDayDiff(_5[_3.leadingDateField], _3.getEventStartDate(_5));
- _12 = (_11 * _7) - (Math.round(_7 / 2))
- }
- }
- var _14 = (_6 == "trail" ? _10 + _7 : _10 - _12);
- _2.moveTo(_14, _9 + (Math.round(_8 / _3.getRowsPerHour(this))));
- _2.setWidth(_12);
- var _15 = 0;
- if (_5.$646 && _5.$646.slotNum > 0) {
- _15 = (_5.$646.slotNum - 1) * _8
- }
- var _16 = (_6 == "trail" ? this.trailIconSize : this.leadIconSize);
- var _17;
- if (_13 == false) _17 = -50;
- else if (_6 == "trail") _17 = _10 + _7 + _12 - Math.round(_16 / 2);
- else _17 = _10 - _12 - Math.round(_16 / 2);
- _1.moveTo(_17, _9 + Math.round(_8 / 2) - Math.round(_16 / 2));
- _1.$647 = Math.round(_8 / 2) - Math.round(_16 / 2) + _15;
- _1.$648 = Math.round(_7 / 2) - Math.round(_16 / 2);
- _1.$65f = _3.getDayDiff(_3.getEventStartDate(_5), this.startDate);
- return _13
- }, isc.A.$65s = function isc_TimelineView__makeIcon(_1, _2) {
- var _3 = (_2 == "trail" ? this.trailIconSize : this.leadIconSize);
- var _4 = isc.Img.create({
- eventCanvas: _1,
- type: _2,
- autoDraw: false,
- _redrawWithParent: false,
- src: (_2 == "trail" ? this.trailingEndPointImage : this.leadingEndPointImage),
- width: _3,
- height: _3,
- canDragReposition: (this.calendar.canEditEvents == true),
- dragRepositionStart: function() {
- this.$1245.$8l = this.parentElement.getEventRow();
- this.$1245.$644 = this.parentElement.getEventColumn();
- this.parentElement.VSnapOrigin = this.$647;
- this.parentElement.HSnapOrigin = this.$648
- },
- dragRepositionStop: function() {
- var _5 = this.$65f,
- _6 = this.$1245.$644,
- _7 = this.parentElement.getEventColumn(),
- _8 = _7 - _6,
- _9 = this.eventCanvas.event,
- _10 = this.eventCanvas.calendar,
- _11 = this.type == "trail" ? _7 - _5 : _5 - _7;
- if (_11 < 1) return false;
- var _12 = {};
- var _13 = this.type == "trail" ? _10.trailingDateField : _10.leadingDateField;
- var _14 = _9[_13].duplicate();
- _14.setDate(_14.getDate() + _8);
- _12[_13] = _14;
- _10.updateEvent(_9, _10.getEventStartDate(_9), _10.getEventEndDate(_9), _9[_10.nameField], _9[_10.descriptionField], _12, true);
- return true
- }
- });
- return _4
- }, isc.A.$65r = function isc_TimelineView__makeLine() {
- var _1 = isc.Canvas.create({
- autoDraw: false,
- _redrawWithParent: false,
- height: 2,
- overflow: "hidden",
- styleName: "eventLine"
- });
- return _1
- }, isc.A.updateEventWindow = function isc_TimelineView_updateEventWindow(_1) {
- if (!this.body || !this.body.children) return;
- var _2 = this.calendar,
- _3 = _1[_2.laneNameField];
- var _4 = this.tagDataForOverlap(_2.data.getRange(0, _2.data.getLength()), _3);
- if (this.renderEventsOnDemand) {
- this.refreshVisibleEvents(null, null, "updateEventWindow")
- } else {
- for (var i = 0; i < _4.length; i++) {
- var _6 = _4.get(i),
- _7 = this.getCurrentEventCanvas(this, _6);
- _7.event = _6;
- this.sizeEventCanvas(_7)
- }
- }
- }, isc.A.getEventCanvasConstructor = function isc_TimelineView_getEventCanvasConstructor(_1) {
- if (this.eventCanvasConstructor) return this.eventCanvasConstructor;
- if (this.calendar.eventCanvasConstructor == "EventWindow") return "TimelineWindow";
- return null
- });
- isc.B._maxIndex = isc.C + 79;
- isc.A = isc.DaySchedule;
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.B.push(isc.A.$126v = function isc_c_DaySchedule__getEventScaffolding(_1, _2, _3) {
- var _4 = _2.getTimePerCell(),
- _5 = (60 / _4) * 24,
- _6 = [],
- _7 = {
- label: "",
- day1: "",
- day2: "",
- day3: "",
- day4: "",
- day5: "",
- day6: "",
- day7: ""
- },
- _8 = _3 || new Date(),
- _9 = new Date(_8.getFullYear(), _8.getMonth(), _8.getDate(), 0, 0, 0, 0),
- _10 = [],
- _11 = _2.isDayView();
- if (_11) isc.DaySchedule.$129g(_1, _2, _9.duplicate());
- for (var i = 0; i < _5; i++) {
- var _13 = _9.duplicate();
- _6.add(isc.addProperties({}, _7, {
- time: _13
- }));
- _9 = isc.DateUtil.dateAdd(_9, "mn", _4, 1)
- }
- return _6
- }, isc.A.$129g = function isc_c_DaySchedule__getCellDates(_1, _2, _3) {
- _3 = _3 || new Date();
- var _4 = _2.getTimePerCell(),
- _5 = _3.duplicate(),
- _6 = new Date(_5.getFullYear(), _5.getMonth(), _5.getDate(), 0, 0, 0, 0),
- _7 = (60 / _4) * 24,
- _8 = _2.isDayView() ? 1 : 7,
- _9 = [];
- _2.$142y = null;
- for (var j = 0; j < _8; j++) {
- var _11 = _6.duplicate(),
- _12 = _11.duplicate();
- for (var i = 0; i <= _7; i++) {
- if (!_9[i]) _9[i] = {};
- _9[i]["day" + (j + 1)] = _12;
- var _14 = _4 * (i + 1);
- var _15 = isc.DateUtil.dateAdd(_11.duplicate(), "mn", _14, 1);
- var _16 = isc.DateUtil.getLogicalTimeOnly(_15, true);
- var _16 = isc.DateUtil.getLogicalTimeOnly(_11, true);
- _16.setTime(_16.getTime() + (_14 * 60000));
- var _17 = _12.getDate(),
- _18 = _15.getDate(),
- _19 = _16.getHours(),
- _20 = _16.getMinutes(),
- _21 = _15.getHours(),
- _22 = _15.getMinutes();
- if (_2.calendar.ignoreDST) {
- _12 = _15.duplicate()
- } else {
- if (_19 != _21 || _20 != _22) {
- if (!_2.$142y) _2.$142y = [];
- _2.$142y.add({
- rowNum: i + 1,
- colNum: j
- })
- } else {
- _12 = _15.duplicate()
- }
- }
- }
- _6 = isc.DateUtil.dateAdd(_6.duplicate(), "d", 1)
- }
- _2.$129f = _9;
- return _9
- });
- isc.B._maxIndex = isc.C + 2;
- isc.ClassFactory.defineClass("Calendar", "Canvas", "DataBoundComponent");
- isc.A = isc.Calendar.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.defaultWidth = "100%";
- isc.A.defaultHeight = "100%";
- isc.A.year = new Date().getFullYear();
- isc.A.month = new Date().getMonth();
- isc.A.baseStyle = "calendar";
- isc.A.dayHeaderBaseStyle = "calMonthDayHeader";
- isc.A.dayBodyBaseStyle = "calMonthDayBody";
- isc.A.otherDayHeaderBaseStyle = "calMonthOtherDayHeader";
- isc.A.otherDayBodyBaseStyle = "calMonthOtherDayBody";
- isc.A.otherDayBlankStyle = "calMonthOtherDayBlank";
- isc.A.minimumDayHeight = 80;
- isc.A.selectedCellStyle = "calendarCellSelected";
- isc.A.eventStyleName = "eventWindow";
- isc.A.calMonthEventLinkStyle = "calMonthEventLink";
- isc.A.workdayBaseStyle = "calendarWorkday";
- isc.A.workdayStart = "9:00am";
- isc.A.workdayEnd = "5:00pm";
- isc.A.showWorkday = false;
- isc.A.workdays = [1, 2, 3, 4, 5];
- isc.A.scrollToWorkday = false;
- isc.A.minutesPerRow = 30;
- isc.A.rowTitleFrequency = 60;
- isc.A.nameField = "name";
- isc.A.descriptionField = "description";
- isc.A.startDateField = "startDate";
- isc.A.endDateField = "endDate";
- isc.A.durationField = "duration";
- isc.A.durationUnitField = "durationUnit";
- isc.A.laneNameField = "lane";
- isc.A.sublaneNameField = "sublane";
- isc.A.leadingDateField = "leadingDate";
- isc.A.trailingDateField = "trailingDate";
- isc.A.labelColumnWidth = 60;
- isc.A.eventWindowStyleField = "eventWindowStyle";
- isc.A.eventStyleNameField = "styleName";
- isc.A.canEditField = "canEdit";
- isc.A.canEditLaneField = "canEditLane";
- isc.A.canEditSublaneField = "canEditSublane";
- isc.A.canRemoveField = "canRemove";
- isc.A.canDragEventField = "canDrag";
- isc.A.canResizeEventField = "canResize";
- isc.A.durationUnitOptions = ["minute", "hour", "day", "week"];
- isc.A.laneEventPadding = 0;
- isc.A.eventDragGap = 10;
- isc.A.weekEventBorderOverlap = false;
- isc.A.showQuickEventDialog = true;
- isc.A.canCreateEvents = true;
- isc.A.canEditEvents = true;
- isc.A.canRemoveEvents = true;
- isc.A.canDragEvents = null;
- isc.A.canResizeEvents = true;
- isc.A.showDateChooser = false;
- isc.A.disableWeekends = true;
- isc.A.showWeekends = true;
- isc.A.showDayHeaders = true;
- isc.A.showOtherDays = true;
- isc.A.selectChosenDate = true;
- isc.A.eventAutoArrange = true;
- isc.A.eventOverlap = true;
- isc.A.eventOverlapPercent = 10;
- isc.A.minimalUI = null;
- isc.A.canDragCreateEvents = null;
- isc.A.alternateLaneFrequency = 1;
- isc.A.showTimelineView = false;
- isc.A.renderEventsOnDemand = true;
- isc.A.timelineGranularity = "day";
- isc.A.timelineUnitsPerColumn = 1;
- isc.A.canResizeTimelineEvents = false;
- isc.A.defaultTimelineColumnSpan = 20;
- isc.A.weekPrefix = "Week";
- isc.A.hoverDelay = 0;
- isc.A.laneGroupStartOpen = "first";
- isc.A.showEventDescriptions = true;
- isc.A.showEventHeaders = true;
- isc.A.eventHeaderWrap = true;
- isc.A.eventHeaderHeight = 14;
- isc.A.allowEventOverlap = true;
- isc.A.sizeEventsToGrid = true;
- isc.A.dayViewTitle = "Day";
- isc.A.weekViewTitle = "Week";
- isc.A.monthViewTitle = "Month";
- isc.A.timelineViewTitle = "Timeline";
- isc.A.eventNameFieldTitle = "Event Name";
- isc.A.eventStartDateFieldTitle = "From";
- isc.A.eventEndDateFieldTitle = "To";
- isc.A.eventDescriptionFieldTitle = "Description";
- isc.A.eventLaneFieldTitle = "Lane";
- isc.A.eventSublaneFieldTitle = "Sublane";
- isc.A.eventDurationFieldTitle = "Duration";
- isc.A.eventDurationUnitFieldTitle = " ";
- isc.A.saveButtonTitle = "Save Event";
- isc.A.detailsButtonTitle = "Edit Details";
- isc.A.removeButtonTitle = "Remove Event";
- isc.A.cancelButtonTitle = "Cancel";
- isc.A.monthButtonTitle = "< ${monthName}";
- isc.A.monthMoreEventsLinkTitle = "+ ${eventCount} more...";
- isc.A.backButtonTitle = "Back";
- isc.A.previousButtonHoverText = "Previous";
- isc.A.nextButtonHoverText = "Next";
- isc.A.addEventButtonHoverText = "Add an event";
- isc.A.datePickerHoverText = "Choose a date";
- isc.A.invalidDateMessage = "From must be before To";
- isc.A.dayViewConstructor = "DaySchedule";
- isc.A.weekViewConstructor = "WeekSchedule";
- isc.A.monthViewConstructor = "MonthSchedule";
- isc.A.timelineViewConstructor = "TimelineView";
- isc.A.mainViewDefaults = {
- _constructor: isc.TabSet,
- defaultWidth: "80%",
- defaultHeight: "100%",
- tabBarAlign: "right",
- selectedTab: 1
- };
- isc.A.dateChooserConstructor = "DateChooser";
- isc.A.dateChooserDefaults = {
- visibility: "hidden"
- };
- isc.A.eventDialogConstructor = "Window";
- isc.A.eventDialogDefaults = {
- showHeaderIcon: false,
- showMinimizeButton: false,
- showMaximumButton: false,
- canDragReposition: true,
- overflow: "visible",
- bodyProperties: {
- overflow: "visible"
- },
- keepInParentRect: true,
- maxWidth: 400,
- height: 100,
- visibility: "hidden"
- };
- isc.A.eventEditorLayoutConstructor = "Window";
- isc.A.eventEditorLayoutDefaults = {
- showHeaderIcon: false,
- showShadow: false,
- showMinimizeButton: false,
- showMaximumButton: false,
- canDragReposition: false,
- visibility: "hidden"
- };
- isc.A.eventEditorConstructor = "DynamicForm";
- isc.A.eventEditorDefaults = {
- padding: 4,
- numCols: 5,
- colWidths: [80, 40, 40, "*", "*"],
- showInlineErrors: false,
- width: 460,
- titleWidth: 80,
- wrapItemTitles: false,
- visiibililty: "hidden"
- };
- isc.A.eventEditorButtonLayoutConstructor = "HLayout";
- isc.A.eventEditorButtonLayoutDefaults = {
- width: "100%",
- height: "100%",
- membersMargin: 5,
- layoutMargin: 10
- };
- isc.A.saveButtonConstructor = "IButton";
- isc.A.saveButtonDefaults = {
- autoFit: true,
- click: function() {
- this.calendar.addEventOrUpdateEventFields()
- }
- };
- isc.A.removeButtonConstructor = "IButton";
- isc.A.removeButtonDefaults = {
- autoFit: true,
- click: function() {
- var _1 = this.calendar;
- if (_1.eventRemoveClick(_1.eventEditorLayout.event, _1.getCurrentViewName()) != false) {
- _1.removeEvent(_1.eventEditorLayout.event)
- }
- _1.eventEditorLayout.hide()
- }
- };
- isc.A.cancelButtonConstructor = "IButton";
- isc.A.cancelButtonDefaults = {
- autoFit: true,
- click: function() {
- this.calendar.eventEditorLayout.hide()
- }
- };
- isc.A.addEventButtonConstructor = "ImgButton";
- isc.A.addEventButtonDefaults = {
- title: "",
- src: "[SKINIMG]actions/add.png",
- showRollOver: false,
- showDown: false,
- showFocused: false,
- width: 16,
- height: 16
- };
- isc.A.datePickerButtonConstructor = "ImgButton";
- isc.A.datePickerButtonDefaults = {
- title: "",
- src: "[SKIN]/controls/date_control.gif",
- width: 16,
- height: 16,
- showRollOver: false,
- showFocused: false
- };
- isc.A.showControlsBar = true;
- isc.A.controlsBarConstructor = "HLayout";
- isc.A.controlsBarDefaults = {
- defaultLayoutAlign: "center",
- layoutAlign: "center",
- width: 1,
- height: 1,
- overflow: "visible",
- membersMargin: 5
- };
- isc.A.monthButtonConstructor = "NavigationButton";
- isc.A.monthButtonDefaults = {
- click: function() {
- var _1 = this.creator,
- _2 = _1.getCurrentViewName();
- if (_2 != "month") {
- this.previousViewName = _2;
- this.creator.setCurrentViewName("month");
- _1.updateMonthButton()
- } else {
- this.creator.setCurrentViewName(this.previousViewName);
- delete this.previousViewName;
- _1.updateMonthButton()
- }
- }
- };
- isc.A.previousButtonConstructor = "ImgButton";
- isc.A.previousButtonDefaults = {
- title: "",
- src: "[SKINIMG]actions/back.png",
- showFocused: false,
- width: 16,
- height: 16,
- click: function() {
- this.creator.previous()
- },
- showRollOver: false,
- showDown: false
- };
- isc.A.nextButtonConstructor = "ImgButton";
- isc.A.nextButtonDefaults = {
- title: "",
- src: "[SKINIMG]actions/forward.png",
- showFocused: false,
- width: 16,
- height: 16,
- click: function() {
- this.creator.next()
- },
- showRollOver: false,
- showDown: false
- };
- isc.A.dateLabelConstructor = "Label";
- isc.A.dateLabelDefaults = {
- wrap: false,
- width: 5,
- contents: "-"
- };
- isc.A.DAY = "day";
- isc.A.WEEK = "week";
- isc.A.MONTH = "month";
- isc.A.TIMELINE = "timeline";
- isc.A.rowHeight = isc.ListGrid.getInstanceProperty("cellHeight");
- isc.A.$1716 = null;
- isc.A.zeroLengthEventSize = 2;
- isc.A.$1290 = "mn";
- isc.A.dateFormatter = null;
- isc.A.timeFormatter = "toShortPaddedTime";
- isc.A.showIndicatorsInFront = true;
- isc.A.showCellHovers = false;
- isc.A.showHeaderHovers = false;
- isc.A.showViewHovers = true;
- isc.A.showEventHovers = true;
- isc.A.showZoneHovers = true;
- isc.A.showLaneFieldHovers = false;
- isc.A.showDragHovers = false;
- isc.A.eventCanvasConstructor = "EventCanvas";
- isc.A.eventCanvasContextMenuConstructor = "Menu";
- isc.A.eventCanvasContextMenuStyle = "eventWindowContextMenu";
- isc.A.eventCanvasContextMenuDefaults = {};
- isc.A.useEventCanvasRolloverControls = true;
- isc.A.eventCanvasGripperConstructor = "Img";
- isc.A.eventCanvasGripperDefaults = {
- width: 11,
- height: 10,
- padding: 0,
- margin: 0,
- overflow: "visible",
- imageType: "center",
- autoDraw: false,
- visibility: "hidden",
- showDown: false,
- showOver: false,
- showRollOver: false,
- canDrag: true,
- layoutAlign: "center",
- cursor: "move"
- };
- isc.A.eventCanvasGripperIcon = "[SKIN]/Calendar/gripper.png";
- isc.A.eventCanvasLabelConstructor = "Label";
- isc.A.eventCanvasLabelDefaults = {
- height: 1,
- width: 1,
- autoSize: true,
- wrap: false,
- overflow: "visible",
- autoDraw: false,
- visibility: "hidden",
- padding: 2,
- minWidth: 40,
- maxWidth: 150,
- showOver: false,
- showDown: false,
- showRollOver: true,
- layoutAlign: "center",
- click: function() {},
- isEventCanvasLabel: true
- };
- isc.A.eventCanvasButtonLayoutConstructor = "HLayout";
- isc.A.eventCanvasButtonLayoutDefaults = {
- width: 1,
- height: 1,
- overflow: "visible",
- autoDraw: false,
- snapTo: "TR",
- membersMargin: 1,
- layoutTopMargin: 3,
- layoutRightMargin: 3,
- mouseOver: function() {
- return isc.EH.STOP_BUBBLING
- }
- };
- isc.A.eventCanvasCloseButtonConstructor = "ImgButton";
- isc.A.eventCanvasCloseButtonDefaults = {
- width: 11,
- height: 10,
- autoDraw: false,
- showDown: false,
- showRollOver: true,
- layoutAlign: "center",
- src: "[SKIN]/headerIcons/close.png",
- styleName: "eventCanvasCloseButton",
- click: function() {
- var _1 = this.eventCanvas;
- this.creator.$174b(_1);
- return false
- }
- };
- isc.A.eventCanvasContextButtonConstructor = "ImgButton";
- isc.A.eventCanvasContextButtonDefaults = {
- width: 11,
- height: 10,
- autoDraw: false,
- showDown: false,
- showRollOver: true,
- layoutAlign: "left",
- src: "[SKIN]/headerIcons/arrow_down.png",
- click: function() {
- this.creator.$1700(this.eventCanvas);
- return false
- }
- };
- isc.A.eventCanvasVResizerConstructor = "Img";
- isc.A.eventCanvasVResizerDefaults = {
- width: 12,
- height: 6,
- overflow: "hidden",
- src: "[SKIN]/Window/v_resizer.png",
- autoDraw: false,
- canDragResize: true
- };
- isc.A.eventCanvasHResizerConstructor = "Img";
- isc.A.eventCanvasHResizerDefaults = {
- width: 6,
- height: 12,
- overflow: "hidden",
- src: "[SKIN]/Window/h_resizer.png",
- autoDraw: false,
- canDragResize: true
- };
- isc.A.zoneStyleName = "zoneCanvas";
- isc.A.zoneCanvasConstructor = "ZoneCanvas";
- isc.A.zoneTitleOrientation = "bottom";
- isc.A.indicatorStyleName = "indicatorCanvas";
- isc.A.indicatorCanvasConstructor = "IndicatorCanvas";
- isc.A.eventsOverlapGridLines = true;
- isc.A.includeRangeCriteria = false;
- isc.A.$81i = /^\d{4}.\d\d?.\d\d?$/;
- isc.A.$81j = /^\d\d?.\d\d.\d{4}?$/;
- isc.A.newEventEditorWindowTitle = "New Event";
- isc.A.monthMoreEventsMenuConstructor = "Menu";
- isc.A.monthMoreEventsMenuDefaults = {
- autoDraw: false,
- visibility: "hidden",
- keepInParentRect: true
- };
- isc.B.push(isc.A.getMinutesPerRow = function isc_Calendar_getMinutesPerRow(_1) {
- _1 = _1 || this.getSelectedView();
- if (_1 && _1.verticalEvents) return _1.getTimePerCell("mn");
- return null
- }, isc.A.getMinutesPerCol = function isc_Calendar_getMinutesPerCol(_1) {
- _1 = _1 || this.getSelectedView();
- if (_1 && !_1.verticalEvents) return _1.getTimePerCell("mn");
- return null
- }, isc.A.getSnapGapMinutes = function isc_Calendar_getSnapGapMinutes(_1, _2, _3) {
- _1 = _1 || this.getSelectedView();
- if (_1) return _1.getTimePerSnapGap("mn")
- }, isc.A.getSnapGapPixels = function isc_Calendar_getSnapGapPixels(_1, _2, _3) {
- _1 = _1 || this.getSelectedView();
- if (_1.$171x || _1.$27q.snapGapPixels == null) {
- if (_2 == null) _2 = 0;
- if (_3 == null) _3 = 0;
- var _4 = _1 && _1.verticalEvents == false,
- _5 = this.getSnapGapMinutes(_1, _2, _3),
- _6 = _1.getTimePerCell(),
- _7;
- if (_1 && _1.body) {
- _7 = _4 ? _1.body.getColumnWidth(_3) : _1.getRowHeight(_1.getRecord(_2), _2)
- } else {
- if (_4) {
- var _8 = _1 && _1.fieldHeaderLevel;
- _7 = (_8 && _8.headerWidth) || (_1 && _1.columnWidth)
- } else _7 = this.rowHeight
- }
- var _9 = _7 / ((_6 / _5));
- delete _1.$171x;
- _1.$27q.snapGapPixels = Math.max(_9, 1)
- }
- return _1.$27q.snapGapPixels
- }, isc.A.addSnapGapsToDate = function isc_Calendar_addSnapGapsToDate(_1, _2, _3) {
- if (!_1) return null;
- if (_3 == 0) return _1.duplicate();
- _2 = _2 || this.getSelectedView();
- if (_3 == null) _3 = 1;
- var _4 = this.getSnapGapMinutes(_2),
- _5 = (_4 * _3) * 60000,
- _6 = _1.duplicate();
- if (_4 == 1440) _6.setDate(_6.getDate() + _3);
- else _6.setTime(_6.getTime() + _5);
- return _6
- }, isc.A.getRowsPerHour = function isc_Calendar_getRowsPerHour(_1) {
- return Math.floor(60 / _1.getTimePerCell("mn"))
- }, isc.A.getRowFromDate = function isc_Calendar_getRowFromDate(_1, _2) {
- var _3 = _1.getTimePerCell("mn"),
- _4 = this.getRowsPerHour(_1),
- _5 = Math.floor(_2.getMinutes() / _3),
- _6 = (_2.getMinutes() % _3 == 0 ? 0 : 1),
- _7 = (_2.getHours() * _4) + _5 + _6;
- return _7
- }, isc.A.getMinutePixels = function isc_Calendar_getMinutePixels(_1, _2, _3) {
- _3 = _3 || this.getSelectedView();
- if (_3.isTimelineView()) {
- var _4 = _3.getTimePerCell() / _3.columnWidth;
- return Math.round(_1 / _4)
- } else if (_3.isDayView() || _3.isWeekView()) {
- var _5 = (_2 != null ? _2 : _3.getRowHeight(_3.getRecord(0), 0)) *
- this.getRowsPerHour(_3);
- return Math.round((_5 / 60) * _1)
- }
- }, isc.A.scrollToTime = function isc_Calendar_scrollToTime(_1, _2) {
- if (!this.isDrawn()) {
- this.$187g = _1;
- return
- }
- _2 = _2 || this.getSelectedView();
- _1 = isc.Time.parseInput(_1);
- if (isc.isA.Date(_1)) {
- var _3 = this.getRowFromDate(_2, _1);
- var _4 = _2.getRowHeight(_2.getRecord(0), 0) * _3;
- _2.body.scrollTo(0, _4);
- _2.redraw()
- }
- }, isc.A.moveToEvent = function isc_Calendar_moveToEvent(_1, _2) {
- _2 = _2 || this.getSelectedView();
- this.setChosenDate(this.getEventStartDate(_1))
- }, isc.A.getDurationUnitMap = function isc_Calendar_getDurationUnitMap() {
- var _1 = this.durationUnitOptions,
- _2 = isc.DateUtil,
- _3 = {};
- for (var i = 0; i < _1.length; i++) {
- _3[_2.getTimeUnitKey(_1[i])] = _2.getTimeUnitTitle(_1[i]) + "s"
- }
- return _3
- }, isc.A.setHeaderLevels = function isc_Calendar_setHeaderLevels(_1) {
- this.headerLevels = _1;
- if (this.timelineView) this.timelineView.rebuild(true)
- }, isc.A.dateIsWeekend = function isc_Calendar_dateIsWeekend(_1) {
- return this.getWeekendDays().contains(_1.getDay())
- }, isc.A.getWeekendDays = function isc_Calendar_getWeekendDays() {
- return this.weekendDays
- }, isc.A.shouldDisableDate = function isc_Calendar_shouldDisableDate(_1, _2, _3) {
- if (!_1) return false;
- _2 = _2 || this.getSelectedView();
- if (this.disableWeekends && !_3 && this.dateIsWeekend(_1)) {
- return true
- }
- return false
- }, isc.A.shouldShowDate = function isc_Calendar_shouldShowDate(_1, _2) {
- _2 = _2 || this.getSelectedView();
- if (_2.isTimelineView()) {
- if (!this.showWeekends && this.dateIsWeekend(_1)) return false
- }
- return true
- }, isc.A.shouldShowLane = function isc_Calendar_shouldShowLane(_1, _2) {
- _2 = _2 || this.getSelectedView();
- if (this.hideUnusedLanes && this.getLaneEvents(_1).length == 0) {
- return false
- }
- return true
- }, isc.A.shouldShowEvent = function isc_Calendar_shouldShowEvent(_1, _2) {
- return true
- }, isc.A.getWorkdayStart = function isc_Calendar_getWorkdayStart(_1, _2) {
- return this.workdayStart
- }, isc.A.getWorkdayEnd = function isc_Calendar_getWorkdayEnd(_1, _2) {
- return this.workdayEnd
- }, isc.A.getVisibleStartDate = function isc_Calendar_getVisibleStartDate(_1) {
- _1 = _1 || this.getSelectedView();
- if (!_1 || isc.isAn.emptyString(_1)) return null;
- if (_1.isMonthView() || (_1.body && _1.bodies.length > 1)) return _1.getCellDate(0, 0);
- return _1.startDate
- }, isc.A.getVisibleEndDate = function isc_Calendar_getVisibleEndDate(_1) {
- _1 = _1 || this.getSelectedView();
- if (!_1 || isc.isAn.emptyString(_1)) return null;
- if (!_1.body || (_1.bodies.length == 1 && !_1.isMonthView())) return _1.endDate;
- var _2 = _1.getData().length - 1,
- _3 = _1.body.fields.length - 1;
- if (_1.getCellEndDate) return _1.getCellEndDate(_2, _3);
- return _1.getCellDate(_2, _3)
- }, isc.A.getPeriodStartDate = function isc_Calendar_getPeriodStartDate(_1) {
- _1 = _1 || this.getSelectedView();
- if (_1.isDayView()) {
- return this.chosenDateStart.duplicate()
- } else if (_1.isWeekView()) {
- return this.chosenWeekStart.duplicate()
- } else if (_1.isMonthView()) {
- return isc.DateUtil.getStartOf(this.chosenDate, isc.DateUtil.getTimeUnitKey("month"))
- } else if (_1.isTimelineView()) {
- return this.getVisibleStartDate(_1)
- }
- }, isc.A.getPeriodEndDate = function isc_Calendar_getPeriodEndDate(_1) {
- _1 = _1 || this.getSelectedView();
- if (_1.isDayView()) {
- return this.chosenDateEnd.duplicate()
- } else if (_1.isWeekView()) {
- return this.chosenWeekEnd.duplicate()
- } else if (_1.isMonthView()) {
- return isc.DateUtil.getEndOf(this.chosenDate, isc.DateUtil.getTimeUnitKey("month"))
- } else if (_1.isTimelineView()) {
- return this.getVisibleEndDate(_1)
- }
- }, isc.A.groupLanesBy = function isc_Calendar_groupLanesBy(_1) {
- if (this.timelineView) {
- this.timelineView.groupBy(_1)
- }
- }, isc.A.setLanes = function isc_Calendar_setLanes(_1) {
- if (!_1) {
- return
- }
- this.lanes = _1;
- if (this.timelineView) {
- this.timelineView.setLanes(this.lanes)
- }
- if (this.showDayLanes && this.dayView) {
- this.dayView.setLanes(this.lanes)
- }
- }, isc.A.addLane = function isc_Calendar_addLane(_1, _2) {
- var _3;
- if (this.timelineViewSelected()) {
- _3 = this.timelineView
- } else if (this.dayViewSelected() && this.showDayLanes) {
- _3 = this.dayView
- }
- if (!_3) {
- return
- }
- if (!this.lanes) this.lanes = [];
- if (_2 == null) _2 = this.lanes.length;
- this.lanes.add(_1, _2);
- _3.setLanes(this.lanes)
- }, isc.A.removeLane = function isc_Calendar_removeLane(_1) {
- var _2;
- if (this.timelineViewSelected()) _2 = this.timelineView;
- else if (this.dayViewSelected() && this.showDayLanes) _2 = this.dayView;
- if (!_2 || !this.lanes) return;
- if (isc.isA.String(_1)) _1 = this.lanes.find("name", _1);
- else if (isc.isAn.Object(_1)) _1 = this.lanes.find("name", _1.name);
- if (_1) {
- this.lanes.remove(_1);
- _2.setLanes(this.lanes)
- }
- }, isc.A.setShowDayLanes = function isc_Calendar_setShowDayLanes(_1) {
- if (this.showDayLanes == _1) return;
- this.showDayLanes = _1;
- if (this.dayView) {
- this.dayView.$123r = this.dayView.body.getScrollTop();
- this.dayView.rebuildFields();
- if (this.dayViewSelected()) {
- this.dayView.refreshEvents()
- } else {
- this.dayView.$123s = true
- }
- }
- }, isc.A.initWidget = function isc_Calendar_initWidget() {
- if (!this.chosenDate) {
- if (this.startDate) this.chosenDate = this.startDate.duplicate();
- else this.chosenDate = new Date()
- }
- var _1 = isc.Calendar.$1833(this.chosenDate);
- this.year = _1.getFullYear();
- this.month = _1.getMonth();
- if (this.firstDayOfWeek == null)
- this.firstDayOfWeek = Number(isc.DateChooser.getInstanceProperty("firstDayOfWeek"));
- if (!this.weekendDays) this.weekendDays = isc.DateUtil.getWeekendDays();
- if (this.laneGroupByField && !isc.isAn.Array(this.laneGroupByField)) {
- this.laneGroupByField = [this.laneGroupByField]
- }
- if (this.timelineSnapGap != null) {
- this.snapGap = this.timelineSnapGap;
- delete this.timelineSnapGap
- }
- if (this.timelineStartDate != null) {
- this.startDate = this.timelineStartDate.duplicate();
- delete this.timelineStartDate
- }
- if (this.timelineEndDate != null) {
- this.endDate = this.timelineEndDate.duplicate();
- delete this.timelineEndDate
- }
- if (this.timelineLabelFields != null) {
- this.laneFields = this.timelineLabelFields;
- this.timelineLabelFields = null
- }
- if (this.eventTypeData != null) {
- this.lanes = isc.clone(this.eventTypeData);
- this.eventTypeData = null
- }
- if (this.eventTypeField != null) {
- this.laneNameField = this.eventTypeField;
- delete this.eventTypeField
- }
- if (this.showDescription != null) {
- this.showEventDescriptions = this.showDescription;
- delete this.showDescription
- }
- if (this.canEditEventType != null) {
- this.canEditLane = this.canEditEventType;
- delete this.canEditEventType
- }
- if (this.canDeleteEvents != null) {
- this.canRemoveEvents = this.canDeleteEvents;
- delete this.canDeleteEvents
- }
- var _2 = isc.Browser.isTouch ? true : false;
- if (this.canDragCreateEvents == null) this.canDragCreateEvents = !_2;
- if (this.canDragEvents == null) this.canDragEvents = !_2;
- if (this.minimalUI == null) this.minimalUI = isc.Browser.isHandset;
- if (this.minimalUI) {
- this.mainViewDefaults.showTabBar = false;
- var _3 = this;
- this.orientationEventId = isc.Page.setEvent("orientationChange", function() {
- _3.pageOrientationChanged()
- })
- }
- if (this.eventWindowDefaults != null) {
- this.eventCanvasDefaults = isc.addProperties({}, this.eventWindowDefaults, this.eventCanvasDefaults);
- delete this.eventWindowDefaults
- }
- if (this.eventWindowProperties != null) {
- this.eventCanvasProperties = isc.addProperties({}, this.eventWindowProperties, this.eventCanvasProperties);
- delete this.eventWindowProperties
- }
- if (this.overlapSortSpecifiers && !isc.isAn.Array(this.overlapSortSpecifiers)) {
- this.overlapSortSpecifiers = [this.overlapSortSpecifiers]
- }
- if (!this.data) this.data = this.getDefaultData();
- this.previousButtonDefaults.prompt = this.previousButtonHoverText;
- this.nextButtonDefaults.prompt = this.nextButtonHoverText;
- this.datePickerButtonDefaults.prompt = this.datePickerHoverText;
- this.addEventButtonDefaults.prompt = this.addEventButtonHoverText;
- if (this.dataSource) this.autoDetectFieldNames();
- this.$129t(this.chosenDate);
- this.createChildren();
- this.$53a();
- this.invokeSuper(isc.Calendar, "initWidget");
- this.createEditors()
- }, isc.A.updateMonthButton = function isc_Calendar_updateMonthButton() {
- if (this.getCurrentViewName() == "month") {
- this.monthButton.setTitle(this.backButtonTitle)
- } else {
- var _1 = this.chosenDate.getMonthName();
- this.monthButton.setTitle(this.monthButtonTitle.evalDynamicString(this, {
- monthName: _1
- }))
- }
- }, isc.A.pageOrientationChanged = function isc_Calendar_pageOrientationChanged(_1) {
- _1 = _1 || isc.Page.getOrientation();
- if (_1 == "landscape" && this.weekView) this.setCurrentViewName("week");
- if (_1 == "portrait" && this.dayView) this.setCurrentViewName("day")
- }, isc.A.autoDetectFieldNames = function isc_Calendar_autoDetectFieldNames() {
- this.dataSource = isc.DS.getDataSource(this.dataSource);
- var _1 = this.dataSource,
- _2 = isc.getValues(_1.getFields()),
- _3 = 1024000,
- _4 = null,
- _5;
- if (this.fieldIsMissing(this.nameField, _1)) {
- this.nameField = _1.getTitleField();
- if (this.fieldIsMissing(this.nameField, _1)) {
- this.logWarn("Specified field '" + this.nameField + "' is not present in the DataSource and no suitable alternative was auto-detected.")
- } else {
- this.logInfo("Specified event name field is not present in the DataSource - using DataSource.getTitleField() instead: '" + this.nameField + "'")
- }
- }
- if (this.fieldIsMissing(this.descriptionField, _1)) {
- _2.sortByProperties(["length"], [false]);
- _4 = {
- length: 0
- };
- for (var i = 0; i < _2.length; i++) {
- _5 = _2.get(i);
- if (!_5.type || _5.type == "text" || _5.type == "string") {
- if (_5.length > 255 && _5.length < _3) {
- this.descriptionField = _5.name;
- break
- } else if (_5.length && _5.length < _3 && _5.length > _4.length) {
- _4 = _5
- } else if (!_5.length) {
- if (!_4) _4 = _5
- }
- }
- }
- if (_4 != null && this.fieldIsMissing(this.descriptionField, _1))
- this.descriptionField = _4.name;
- if (this.fieldIsMissing(this.descriptionField, _1)) {
- this.logWarn("Specified field '" + this.descriptionField + "' is not present in the DataSource and no suitable alternative was auto-detected.")
- } else {
- this.logInfo("Specified event description field is not present in the DataSource - using auto-detected field '" + this.descriptionField + "' instead.")
- }
- }
- if (this.fieldIsMissing(this.startDateField, _1)) {
- _4 = null;
- for (var i = 0; i < _2.length; i++) {
- _5 = _2.get(i);
- if ((_5.type == "date" || _5.type == "datetime")) {
- if (_5.name.toLowerCase().indexOf("start") >= 0 || _5.name.toLowerCase().indexOf("begin") >= 0) {
- this.startDateField = _5.name;
- break
- } else _4 = _5
- }
- }
- if (_4 != null && this.fieldIsMissing(this.startDateField, _1))
- this.startDateField = _4.name;
- if (this.fieldIsMissing(this.startDateField, _1)) {
- this.logWarn("Specified field '" + this.startDateField + "' is not present in the DataSource and no suitable alternative was auto-detected.")
- } else {
- this.logInfo("Specified event startDate field is not present in the DataSource - using auto-detected field '" + this.startDateField + "' instead.")
- }
- }
- if (this.fieldIsMissing(this.endDateField, _1)) {
- _4 = null;
- for (var i = 0; i < _2.length; i++) {
- _5 = _2.get(i);
- if ((_5.type == "date" || _5.type == "datetime")) {
- if (_5.name.toLowerCase().indexOf("end") >= 0 || _5.name.toLowerCase().indexOf("stop") >= 0) {
- this.endDateField = _5.name;
- break
- } else if (_5.name != this.startDateField)
- _4 = _5
- }
- }
- if (_4 != null && this.fieldIsMissing(this.endDateField, _1))
- this.endDateField = _4.name;
- if (this.fieldIsMissing(this.endDateField, _1)) {
- this.logWarn("Specified field '" + this.endDateField + "' is not present in the DataSource and no suitable alternative was auto-detected.")
- } else {
- this.logInfo("Specified event endDate field is not present in the DataSource - using auto-detected field '" + this.endDateField + "' instead.")
- }
- }
- if (this.showTimelineView != false || (this.showDayView != false && this.showDayLanes)) {
- if (this.useSublanes && this.fieldIsMissing(this.sublaneNameField, _1)) {
- _4 = null;
- for (var i = 0; i < _2.length; i++) {
- _5 = _2.get(i);
- if (!_5.type || _5.type == "text" || _5.type == "string") {
- var _7 = _5.name.toLowerCase();
- if (_7.contains("sublane")) {
- this.sublaneNameField = _5.name;
- break
- }
- }
- }
- if (this.fieldIsMissing(this.sublaneNameField, _1)) {
- this.logWarn("Specified field '" + this.sublaneNameField + "' is not present in the DataSource and no suitable alternative was auto-detected.")
- } else {
- this.logInfo("Specified event sublane field is not present in the DataSource - using auto-detected field '" + this.sublaneNameField + "' instead.")
- }
- }
- if (this.fieldIsMissing(this.laneNameField, _1)) {
- _4 = null;
- for (var i = 0; i < _2.length; i++) {
- _5 = _2.get(i);
- if (!_5.type || _5.type == "text" || _5.type == "string") {
- var _7 = _5.name.toLowerCase();
- if (_7.contains("lane") && _7 != this.sublaneNameField) {
- this.laneNameField = _5.name;
- break
- }
- }
- }
- if (this.fieldIsMissing(this.laneNameField, _1)) {
- this.logWarn("Specified field '" + this.laneNameField + "' is not present in the DataSource and no suitable alternative was auto-detected.")
- } else {
- this.logInfo("Specified event lane field is not present in the DataSource - using auto-detected field '" + this.laneNameField + "' instead.")
- }
- }
- }
- }, isc.A.fieldIsMissing = function isc_Calendar_fieldIsMissing(_1, _2) {
- return (!_1 || _1 == "" || (_2 && !_2.getField(_1)))
- }, isc.A.getDefaultData = function isc_Calendar_getDefaultData() {
- return []
- }, isc.A.setData = function isc_Calendar_setData(_1) {
- if (this.data == _1) return;
- if (this.data) {
- this.ignore(this.data, "dataChanged");
- if (this.data.$31k && isc.isA.Function(this.data.destroy))
- this.data.destroy()
- }
- if (_1) this.data = _1;
- if (!this.data) return;
- this.observe(this.data, "dataChanged", "observer.dataChanged()");
- if (this.hasData()) {
- this.dataChanged()
- }
- }, isc.A.getData = function isc_Calendar_getData() {
- return this.data
- }, isc.A.hasData = function isc_Calendar_hasData() {
- if (!this.data || (isc.ResultSet && isc.isA.ResultSet(this.data) && !this.data.lengthIsKnown())) {
- return false
- } else {
- return true
- }
- }, isc.A.dataChanged = function isc_Calendar_dataChanged() {
- if (this.destroying || this.destroyed) return;
- if (!this.dataIsAvailable()) {
- this.$53e = true;
- this.$1746 = true
- } else {
- delete this.$1746
- }
- if (this.$53e) {
- this.logDebug('dataChanged, ignoring', 'calendar');
- this.$53e = false
- } else {
- this.logDebug('dataChanged, refreshing', 'calendar');
- delete this.$1746;
- this.refreshSelectedView()
- }
- }, isc.A.dataIsAvailable = function isc_Calendar_dataIsAvailable() {
- if (isc.isAn.Array(this.data)) return true;
- if (this.data.allMatchingRowsCached()) return true;
- return false
- }, isc.A.destroy = function isc_Calendar_destroy() {
- if (this.orientationEventId) isc.Page.clearEvent("orientationChange", this.orientationEventId);
- if (this.data) this.ignore(this.data, "dataChanged");
- if (this.controlsBar) this.controlsBar.destroy();
- if (this.controlsBarContainer) this.controlsBarContainer.destroy();
- if (this.dateChooser) this.dateChooser.destroy();
- if (this.eventCanvasButtonLayout) this.eventCanvasButtonLayout.destroy();
- if (this.mainLayout) this.mainLayout.destroy();
- this.Super("destroy", arguments)
- }, isc.A.refreshSelectedView = function isc_Calendar_refreshSelectedView() {
- var _1 = this.getSelectedView();
- if (!_1) return;
- if (!_1.isDrawn()) {
- _1.$128r = true
- return
- }
- if (this.dayViewSelected()) {
- this.dayView.refreshEvents();
- if (this.weekView) this.weekView.$123s = true;
- if (this.monthView) this.monthView.$123s = true
- } else if (this.weekViewSelected()) {
- this.weekView.refreshEvents();
- if (this.dayView) this.dayView.$123s = true;
- if (this.monthView) this.monthView.$123s = true
- } else if (this.monthViewSelected()) {
- this.monthView.refreshEvents();
- if (this.dayView) this.dayView.$123s = true;
- if (this.weekView) this.weekView.$123s = true
- } else if (this.timelineViewSelected()) {
- this.timelineView.refreshEvents()
- }
- }, isc.A.getSelectedView = function isc_Calendar_getSelectedView() {
- if (this.dayViewSelected()) {
- return this.dayView
- } else if (this.weekViewSelected()) {
- return this.weekView
- } else if (this.monthViewSelected()) {
- return this.monthView
- } else if (this.timelineViewSelected()) {
- return this.timelineView
- }
- }, isc.A.getView = function isc_Calendar_getView(_1) {
- if (!_1) return this.getSelectedView();
- if (_1 == "day") return this.dayView;
- if (_1 == "week") return this.weekView;
- if (_1 == "month") return this.monthView;
- if (_1 == "timeline") return this.timelineView
- }, isc.A.setRowHeight = function isc_Calendar_setRowHeight(_1, _2) {
- this.rowHeight = _1;
- if (this.dayView) {
- this.dayView.setCellHeight(this.rowHeight);
- this.dayView.refreshEvents();
- if (this.scrollToWorkday && !_2) this.dayView.scrollToWorkdayStart()
- }
- if (this.weekView) {
- this.weekView.setCellHeight(this.rowHeight);
- this.weekView.refreshEvents();
- if (this.scrollToWorkday && !_2) this.weekView.scrollToWorkdayStart()
- }
- }, isc.A.getCurrentViewName = function isc_Calendar_getCurrentViewName() {
- var _1 = this.getSelectedView();
- return _1 != null ? _1.viewName : null
- }, isc.A.setCurrentViewName = function isc_Calendar_setCurrentViewName(_1) {
- this.$567 = _1;
- if (this.mainView && this.mainView.tabs) {
- var _2 = this.mainView.tabs.findIndex("viewName", _1);
- if (_2 != null) {
- this.selectTab(_2)
- }
- }
- return _1
- }, isc.A.getEventPKs = function isc_Calendar_getEventPKs(_1) {
- if (!this.$129u) {
- _1 = _1 || this.getDataSource();
- if (_1) {
- this.$129u = _1.getPrimaryKeyFieldNames()
- }
- }
- return this.$129u || []
- }, isc.A.getEventCanvasID = function isc_Calendar_getEventCanvasID(_1, _2) {
- if (!_2 || !_1 || !_1.$128i) return null;
- var _3 = this.getEventKey(_2);
- if (_3) {
- return _1.$128i[_3]
- } else {
- return _2.$128i ? _2.$128i[this.getID() + "_" + _1.viewName] : null
- }
- }, isc.A.getEventKey = function isc_Calendar_getEventKey(_1) {
- var _2 = this.getEventPKs().duplicate(),
- _3 = this.$1716;
- if (!_3) _3 = isc.StringBuffer.create();
- if (_2.length > 0) {
- _3.append(this.getID(), "_event_");
- for (var i = 0; i < _2.length; i++) {
- _3.append(_1[_2[i]]);
- if (i == _2.length) break
- }
- }
- var _5 = _3.release(false);
- return _5 == "" ? null : _5
- }, isc.A.setEventCanvasID = function isc_Calendar_setEventCanvasID(_1, _2, _3) {
- if (!_1.$128i) _1.$128i = {};
- var _4 = this.getEventKey(_2);
- if (_4) {
- _1.$128i[_4] = _3
- } else {
- if (!_2.$128i) _2.$128i = {};
- _2.$128i[this.getID() + "_" + _1.viewName] = _3
- }
- }, isc.A.clearViewSelection = function isc_Calendar_clearViewSelection(_1) {
- if (_1) {
- if (_1.clearSelection) _1.clearSelection()
- } else {
- if (this.dayView) this.dayView.clearSelection();
- if (this.weekView) this.weekView.clearSelection();
- if (this.timelineView) this.timelineView.clearSelection()
- }
- }, isc.A.getDayDiff = function isc_Calendar_getDayDiff(_1, _2, _3) {
- return Math.abs(isc.DateUtil.$1094(_1, _2, _3, false, this.getWeekendDays()))
- }, isc.A.getEventStartCol = function isc_Calendar_getEventStartCol(_1, _2, _3) {
- var _4 = _3 || (_2 ? _2.calendarView : this.getSelectedView()),
- _5 = _2 || _4.getCurrentEventCanvas(_1),
- _6 = _4.getEventColumn(_5.getLeft() + 1);
- return _6
- }, isc.A.getEventEndCol = function isc_Calendar_getEventEndCol(_1, _2, _3) {
- var _4 = _4 || (_2 ? _2.calendarView : this.getSelectedView()),
- _5 = _2 || _4.getCurrentEventCanvas(_1),
- _6 = _4.getEventColumn(_5.getLeft() + _5.getVisibleWidth() + 1);
- return _6
- }, isc.A.getEventLeft = function isc_Calendar_getEventLeft(_1, _2) {
- _2 = _2 || this.getSelectedView();
- if (_2.getEventLeft) return _2.getEventLeft(_1);
- var _3 = _2.body.getColumnWidth(0),
- _4 = 0;
- if (_2.isWeekView()) {
- var _5 = this.getDayDiff(this.getEventStartDate(_1), this.chosenWeekStart, (this.showWeekends == false));
- _4 = (_5 * _3)
- } else if (this.showDayLanes) {
- var _6 = _2.completeFields.findIndex("name", _1[this.laneNameField]);
- if (_6) {
- _4 = _2.body.getColumnLeft(_6)
- }
- } else {
- var _6 = _2.getColFromDate(this.getEventStartDate(_1));
- if (_6) {
- _4 = _2.body.getColumnLeft(_6)
- }
- }
- if (this.logIsDebugEnabled("calendar")) {
- this.logDebug('calendar.getEventLeft() = ' + _4 + ' for:' + isc.Log.echoFull(_1), 'calendar')
- }
- return _4
- }, isc.A.getEventHeaderHTML = function isc_Calendar_getEventHeaderHTML(_1, _2) {
- if (!_1) return null;
- var _3 = _2.isTimelineView() ? null : isc.Time.toTime(this.getEventStartDate(_1), this.timeFormatter, true),
- _4 = (_3 ? _3 + " " : "") + (_1[this.nameField] || "");
- return _4
- }, isc.A.getEventBodyHTML = function isc_Calendar_getEventBodyHTML(_1, _2) {
- if (!_1) return null;
- return _1[this.descriptionField]
- }, isc.A.getEventLeadingDate = function isc_Calendar_getEventLeadingDate(_1, _2) {
- if (!_1) return null;
- var _3 = _1[this.leadingDateField];
- return _3 ? _3.duplicate() : null
- }, isc.A.getEventTrailingDate = function isc_Calendar_getEventTrailingDate(_1, _2) {
- if (!_1) return null;
- var _3 = _1[this.trailingDateField];
- return _3 ? _3.duplicate() : null
- }, isc.A.getEventStartDate = function isc_Calendar_getEventStartDate(_1, _2) {
- if (!_1 || !_1[this.startDateField]) return null;
- return _1[this.startDateField].duplicate()
- }, isc.A.getEventEndDate = function isc_Calendar_getEventEndDate(_1, _2) {
- if (!_1) return null;
- var _3 = this.getEventDuration(_1),
- _4 = _1[this.endDateField];
- if (_3 != null) {
- var _5 = this.getEventDurationUnit(_1) || "mn"
- _4 = this.getEventStartDate(_1);
- if (_5) _4 = isc.DateUtil.dateAdd(_4, _5, _3)
- }
- return _4 ? _4.duplicate() : null
- }, isc.A.isDurationEvent = function isc_Calendar_isDurationEvent(_1) {
- return (!_1[this.endDateField] && _1[this.durationField] != null)
- }, isc.A.getEventDuration = function isc_Calendar_getEventDuration(_1, _2) {
- return _1[this.durationField]
- }, isc.A.getEventDurationUnit = function isc_Calendar_getEventDurationUnit(_1, _2) {
- return _1[this.durationUnitField] || this.$1290
- }, isc.A.isZeroLengthEvent = function isc_Calendar_isZeroLengthEvent(_1) {
- var _2 = this.isDurationEvent(_1),
- _3 = _2 && this.getEventDuration(_1) == 0;
- return _3
- }, isc.A.setShowWeekends = function isc_Calendar_setShowWeekends(_1) {
- this.showWeekends = _1;
- if (isc.isA.TabSet(this.mainView)) {
- var _2 = this.mainView.getSelectedTabNumber();
- this.mainView.removeTabs(this.mainView.tabs);
- if (this.dayView) this.dayView.destroy();
- if (this.weekView) this.weekView.destroy();
- if (this.monthView) this.monthView.destroy();
- var _3 = this.$653();
- this.$53a();
- this.mainView.addTabs(_3);
- this.mainView.selectTab(_2)
- } else {
- var _4 = this.children[0].members[1];
- if (!_4) return;
- var _5 = _4.members[1];
- var _6 = this.$653()[0].pane;
- _4.removeMember(_5);
- _5.destroy();
- _4.addMember(_6);
- this.$53a()
- }
- this.setDateLabel()
- });
- isc.evalBoundary;
- isc.B.push(isc.A.canEditEvent = function isc_Calendar_canEditEvent(_1) {
- if (!_1) return false;
- else if (_1[this.canEditField] != null) return _1[this.canEditField];
- else return this.canEditEvents
- }, isc.A.canDragEvent = function isc_Calendar_canDragEvent(_1) {
- if (!_1 || !this.canEditEvent(_1)) return false;
- if (_1[this.canDragEventField] != null) return _1[this.canDragEventField];
- else return this.canDragEvents
- }, isc.A.canResizeEvent = function isc_Calendar_canResizeEvent(_1) {
- if (!_1 || !this.canEditEvent(_1) || !this.canDragEvent(_1)) return false;
- else if (_1[this.canResizeEventField] != null) return _1[this.canResizeEventField];
- else if (this.isZeroLengthEvent(_1)) return false;
- else return this.canResizeEvents
- }, isc.A.canRemoveEvent = function isc_Calendar_canRemoveEvent(_1) {
- if (!_1) return false;
- else if (_1[this.canRemoveField] != null) return _1[this.canRemoveField];
- else return this.canRemoveEvents && this.canEditEvent(_1)
- }, isc.A.getDateEditingStyle = function isc_Calendar_getDateEditingStyle() {
- if (!this.timelineView) {
- return "time"
- }
- var _1 = this.dateEditingStyle;
- if (!_1) {
- if (this.dataSource) _1 = this.getDataSource().getField(this.startDateField).type;
- if (!_1) {
- switch (this.timelineGranularity) {
- case "day":
- if (!this.timelineView) _1 = "date";
- else if (this.getSnapGapPixels(this.timelineView) < this.timelineView.columnWidth) {
- _1 = "datetime"
- } else {
- _1 = "date"
- }
- break;
- case "hour":
- _1 = "datetime";
- break;
- case "millisecond":
- case "second":
- case "minute":
- _1 = "time";
- break;
- default:
- _1 = "date";
- break
- }
- }
- }
- return _1
- }, isc.A.addLaneEvent = function isc_Calendar_addLaneEvent(_1, _2, _3, _4, _5, _6) {
- _6 = _6 || {};
- var _7 = this.createEventObject(null, _2, _3, _1, _6[this.sublaneNameField], _4, _5);
- this.addCalendarEvent(_7, _6)
- }, isc.A.getCleanEventRecord = function isc_Calendar_getCleanEventRecord(_1) {
- if (isc.propertyDefined(_1, "$646")) delete _1.$646;
- if (isc.propertyDefined(_1, "$126u")) delete _1.$126u;
- if (isc.propertyDefined(_1, "$122k")) delete _1.$122k;
- return _1
- }, isc.A.createEventObject = function isc_Calendar_createEventObject(_1, _2, _3, _4, _5, _6, _7) {
- var _8 = isc.addProperties({}, _1);
- if (_2) _8[this.startDateField] = _2;
- if (_3) _8[this.endDateField] = _3;
- if (_4) _8[this.laneNameField] = _4;
- if (_5) _8[this.sublaneNameField] = _5;
- if (_6) _8[this.nameField] = _6;
- if (_7) _8[this.descriptionField] = _7;
- delete _8.eventLength;
- delete _8.__ref;
- return _8
- }, isc.A.addEvent = function isc_Calendar_addEvent(_1, _2, _3, _4, _5, _6, _7) {
- _5 = _5 || {};
- var _8;
- if (isc.isA.Date(_1)) {
- _8 = this.createEventObject(null, _1, _2, _6 || _5[this.laneNameField], _5[this.sublaneNameField], _3, _4)
- } else if (isc.isAn.Object(_1)) {
- _8 = _1
- } else {
- isc.logWarn('addEvent error: startDate parameter must be either a Date or a CalendarEvent');
- return
- }
- this.addCalendarEvent(_8, _5, _7)
- }, isc.A.addCalendarEvent = function isc_Calendar_addCalendarEvent(_1, _2, _3) {
- if (!_1) return;
- if (_3 == null) _3 = true;
- var _4 = this.getEventStartDate(_1);
- if (!isc.isA.Date(_4)) {
- isc.logWarn('addCalendarEvent: passed event has no start date');
- return
- }
- _1 = this.getCleanEventRecord(isc.addProperties(_1, _2));
- if (_3) this.$53e = true;
- if (this.dataSource) {
- var _5 = this;
- isc.DataSource.get(this.dataSource).addData(_1, function(_6, _7, _8) {
- _5.processSaveResponse(_6, _7, _8)
- }, {
- componentId: this.ID,
- willHandleError: true
- });
- return
- } else {
- this.$53e = true;
- this.data.add(_1);
- this.processSaveResponse({
- status: 0
- }, [_1], {
- operationType: "add"
- })
- }
- }, isc.A.removeEvent = function isc_Calendar_removeEvent(_1, _2) {
- if (_2 == null) _2 = true;
- var _3 = this.getEventStartDate(_1),
- _4 = this.getEventEndDate(_1);
- var _5 = this;
- var _6 = function() {
- if (_5.$53b(_3, _4)) {
- _5.dayView.removeEvent(_1)
- }
- if (_5.$53c(_3, _4)) {
- _5.weekView.removeEvent(_1)
- }
- if (_5.$53d(_3, _4)) {
- _5.monthView.refreshEvents()
- }
- if (_5.$131r(_3, _4)) {
- _5.timelineView.removeEvent(_1);
- if (!_5.dataSource) _5.timelineView.retagLaneEvents(_1[_5.laneNameField])
- }
- if (_5.eventAutoArrange) {
- if (_5.dayView) {
- if (_5.dayView.isSelectedView()) _5.dayView.refreshEvents();
- else _5.dayView.$123s = true
- }
- if (_5.weekView) {
- if (_5.weekView.isSelectedView()) _5.weekView.refreshEvents();
- else _5.weekView.$123s = true
- }
- }
- if (_5.eventRemoved) _5.eventRemoved(_1)
- };
- if (_2) this.$53e = true;
- _1 = this.getCleanEventRecord(_1);
- if (this.dataSource) {
- isc.DataSource.get(this.dataSource).removeData(_1, _6, {
- componentId: this.ID,
- oldValues: _1
- });
- return
- } else {
- this.data.remove(_1);
- _6()
- }
- }, isc.A.updateEvent = function isc_Calendar_updateEvent(_1, _2, _3, _4, _5, _6, _7, _8, _9) {
- if (_7 == null) _7 = true;
- if (!isc.isAn.Object(_6)) _6 = {};
- var _10 = this.createEventObject(_1, _2, _3, _8 || _6[this.laneNameField], _9 || _6[this.sublaneNameField], _4, _5);
- this.updateCalendarEvent(_1, _10, _6, _7)
- }, isc.A.updateCalendarEvent = function isc_Calendar_updateCalendarEvent(_1, _2, _3, _4) {
- if (_4) this.$53e = true;
- _3 = _3 || {};
- var _5 = this.getSelectedView();
- var _6 = _5.getCurrentEventCanvas(_1);
- if (_6) {
- _5.clearEventCanvas(_6)
- }
- if (this.dataSource) {
- var _7 = isc.DataSource.get(this.dataSource);
- var _8 = this.getCleanEventRecord(isc.addProperties({}, _2, _3));
- var _9 = this;
- _7.updateData(_8, function(_11, _12, _13) {
- _9.processSaveResponse(_11, _12, _13, _1)
- }, {
- oldValues: _1,
- componentId: this.ID,
- willHandleError: true
- });
- return
- } else {
- var _10 = isc.addProperties({}, _1);
- isc.addProperties(_1, _2, _3);
- this.processSaveResponse({
- status: 0
- }, [_1], {
- operationType: "update"
- }, _10)
- }
- }, isc.A.processSaveResponse = function isc_Calendar_processSaveResponse(_1, _2, _3, _4) {
- var _5 = isc.isAn.Array(_2) ? _2[0] : _2,
- _6 = _3 ? _3.operationType : null,
- _7 = _6 == "update",
- _8 = _6 == "add",
- _9 = this.$1115,
- _10 = this.$1116;
- delete this.$1115;
- delete this.$1116;
- if (_1 && _1.status < 0) {
- var _11 = _1 ? _1.errors : null;
- if (_9) {
- if (_11) this.eventDialog.items[0].setErrors(_11, true);
- this.displayEventDialog()
- } else if (_10) {
- this.eventEditorLayout.show();
- if (_11) this.eventEditor.setErrors(_11, true)
- } else if (_7 && _4) {
- var _12 = this.getSelectedView();
- if (_12) _12.addEvent(_4);
- if (_11) isc.RPCManager.$a0(_1, _3)
- }
- if (!_11) isc.RPCManager.$a0(_1, _3);
- return
- }
- if (!_5 || isc.isA.String(_5)) {
- if (_8) {
- this.logWarn("Calendar Add operation did not return a record. The operation succeeded but no CalendarViews will be refreshed.")
- return
- } else _5 = _4
- }
- var _13 = _7 && _4 ? this.getEventStartDate(_4) : null,
- _14 = _7 && _4 ? this.getEventEndDate(_4) : null,
- _15 = _7 && _4 ? _4[this.laneNameField] : null,
- _16 = this.getEventStartDate(_5),
- _17 = this.getEventEndDate(_5),
- _18 = _5[this.laneNameField];
- _5.eventLength = (_17.getTime() - _16.getTime());
- if (_5[this.durationField] != null) {
- _5.isDuration = true;
- _5.isZeroDuration = _5[this.durationField] == 0
- }
- var _12 = this.getSelectedView();
- if (this.$53b(_16, _17) || (_7 && this.$53b(_13, _14))) {
- if (!this.dayViewSelected()) this.dayView.$123s = true;
- else {
- if (_7) {
- var _12 = this.dayView;
- if (this.showDayLanes) {
- _12.retagLaneEvents(_15);
- if (_18 != _15) _12.retagLaneEvents(_18)
- } else {
- _12.retagColumnEvents(0)
- }
- } else if (_8) {
- this.dayView.refreshEvents()
- }
- }
- }
- if (this.$53c(_16, _17)) {
- if (!this.weekViewSelected()) this.weekView.$123s = true;
- else {
- var _12 = this.weekView;
- if (_7) {
- _12.retagDayEvents(_13);
- if (isc.DateUtil.compareLogicalDates(_13, _16) != 0) {
- _12.retagDayEvents(_16)
- }
- } else if (_8) {
- _12.addEvent(_5, true);
- _12.retagDayEvents(_16)
- }
- }
- }
- if (this.$53d(_16, _17)) {
- if (!this.monthViewSelected()) this.monthView.$123s = true;
- else this.monthView.refreshEvents()
- }
- if (this.$131r(_16, _17)) {
- if (!this.timelineViewSelected()) this.timelineView.$123s = true;
- else {
- var _12 = this.timelineView;
- if (_7) {
- if (_15 && _15 != _18) _12.retagLaneEvents(_15);
- _12.retagLaneEvents(_18)
- } else if (_8) {
- _12.refreshEvents()
- }
- }
- }
- if (this.$53e) delete this.$53e;
- if (_7 && this.eventChanged) this.eventChanged(_5);
- if (_8 && this.eventAdded) this.eventAdded(_5)
- }, isc.A.refreshEvent = function isc_Calendar_refreshEvent(_1) {
- var _2 = this.getSelectedView();
- var _3 = _2.getCurrentEventCanvas(_1);
- if (_3) {
- _3.setEvent(_1)
- _3.markForRedraw()
- }
- }, isc.A.setEventStyle = function isc_Calendar_setEventStyle(_1, _2) {
- _1.eventWindowStyle = _2;
- var _3 = this.getSelectedView().getCurrentEventCanvas(_1);
- if (_3) {
- _3.setEventStyle(_2);
- _3.markForRedraw()
- }
- }, isc.A.eventsAreSame = function isc_Calendar_eventsAreSame(_1, _2) {
- if (!_1 || !_2) return false;
- if (this.dataSource) {
- var _3 = isc.DataSource.get(this.dataSource),
- _4 = this.getEventPKs(),
- _5 = true;
- for (var i = 0; i < _4.length; i++) {
- var _7 = _4[i];
- if (_1[_7] != _2[_7]) {
- _5 = false;
- break
- }
- }
- return _5
- } else {
- return (_1 === _2)
- }
- }, isc.A.$141h = function isc_Calendar__getEventHoverHTML(_1, _2, _3) {
- var _4 = this,
- _5 = _4.getEventStartDate(_1),
- _6 = _5.toShortDate(this.dateFormatter, false),
- _7 = isc.Time.toTime(_5, this.timeFormatter, false),
- _8 = this.getEventEndDate(_1),
- _9 = _8.toShortDate(this.dateFormatter, false),
- _10 = isc.Time.toTime(_8, this.timeFormatter, false),
- _11 = _1[_4.nameField],
- _12 = _1[_4.descriptionField],
- _13 = isc.StringBuffer.create();
- _13.append("<nobr>");
- if (_3.isTimelineView()) {
- if (isc.DateUtil.compareLogicalDates(_5, _8) != 0) {
- _13.append(_6, " ", _7, " - ", _9, " ", _10)
- } else {
- _13.append(_6, " ", _7, " - ", _10)
- }
- } else {
- _13.append(_6, " ", _7, " - ", _10)
- }
- _13.append("<nobr>");
- if (_11) _13.append("<br><br>", _11);
- if (_12) _13.append("<br>", _12);
- var _14 = _13.release(false);
- return this.getEventHoverHTML(_1, _2, _3, _14)
- }, isc.A.getEventHoverHTML = function isc_Calendar_getEventHoverHTML(_1, _2, _3, _4) {
- return _4
- }, isc.A.$141i = function isc_Calendar__getZoneHoverHTML(_1, _2, _3) {
- var _4 = this.$141h(_1, _2, _3);
- return this.getZoneHoverHTML(_1, _2, _3, _4)
- }, isc.A.getZoneHoverHTML = function isc_Calendar_getZoneHoverHTML(_1, _2, _3, _4) {
- return _4
- }, isc.A.$141j = function isc_Calendar__getIndicatorHoverHTML(_1, _2, _3) {
- var _4 = this.$141h(_1, _2, _3);
- return this.getIndicatorHoverHTML(_1, _2, _3, _4)
- }, isc.A.getIndicatorHoverHTML = function isc_Calendar_getIndicatorHoverHTML(_1, _2, _3, _4) {
- return _4
- }, isc.A.$140d = function isc_Calendar__getCellHoverHTML(_1, _2, _3, _4) {
- var _5 = _1.getField(_4),
- _6 = null,
- _7 = null;
- if (!_5) return;
- if (_5.isLaneField) {
- if (!_1.shouldShowLaneFieldHovers()) return;
- _7 = _2 && _2[_5[_1.fieldIdProperty]];
- if (_5.hoverHTML) {
- _7 = _5.hoverHTML(_2, _7, _3, _4, _1)
- }
- } else {
- if (!_1.shouldShowCellHovers()) return;
- var _6 = _1.getDateFromPoint();
- if (_6) {
- _7 = "<nobr>" + this.$178v(_6) + "</nobr>"
- }
- }
- return this.getCellHoverHTML(_1, _2, _3, _4, _6, _7)
- }, isc.A.getCellHoverHTML = function isc_Calendar_getCellHoverHTML(_1, _2, _3, _4, _5, _6) {
- return _6
- }, isc.A.$140e = function isc_Calendar__getHeaderHoverHTML(_1, _2, _3, _4, _5) {
- if (!_1.shouldShowHeaderHovers()) return;
- var _6 = _3 && (_3.title || _3.name);
- if (_2.hoverHTML) {
- _6 = _2.hoverHTML(_1, _4, _5, _6)
- }
- return this.getHeaderHoverHTML(_1, _2, _4, _5, _6)
- }, isc.A.getHeaderHoverHTML = function isc_Calendar_getHeaderHoverHTML(_1, _2, _3, _4, _5) {
- return _5
- }, isc.A.setShowViewHovers = function isc_Calendar_setShowViewHovers(_1, _2) {
- this.showViewHovers = _1;
- if (_2) {
- _2.setShowHover(_1)
- } else {
- if (this.dayView) this.dayView.setShowHover(_1);
- if (this.weekView) this.weekView.setShowHover(_1);
- if (this.monthView) this.monthView.setShowHover(_1);
- if (this.timelineView) this.timelineView.setShowHover(_1)
- }
- }, isc.A.$140a = function isc_Calendar__getDragHoverHTML(_1, _2) {
- _2 = _2 || {};
- var _3 = _2.hoverStyleName || this.hoverStyleName || "";
- var _4 = _2[this.startDateField],
- _5 = _2[this.endDateField],
- _6 = "<div style='" + _3 + "'><nobr>" + this.$178v(_4) + "</nobr></div><div style='" + _3 + "'><nobr>" + this.$178v(_5) + "</nobr></div>";
- return this.getDragHoverHTML(_1, _2, _6)
- }, isc.A.$178v = function isc_Calendar___getLocalDatetimeString(_1) {
- var _2 = _1.toShortDate(this.dateFormatter, false) + " " + isc.Time.toTime(_1, this.timeFormatter);
- return _2
- }, isc.A.getDragHoverHTML = function isc_Calendar_getDragHoverHTML(_1, _2, _3) {
- return _3
- }, isc.A.$140c = function isc_Calendar__mouseMoved(_1, _2, _3, _4, _5, _6) {
- if (!_1) return;
- if (isc.DateUtil.compareDates(_3, _4) != 0) {
- if (this.mouseDateChanged) this.mouseDateChanged(_1, _3, _4)
- }
- var _7 = _1.getField(_6),
- _8 = _7 && (_7.isLaneField || _7.isLabelField),
- _9 = _7 && _7.date,
- _10 = _2 && _2.$81f,
- _11;
- if (_8 && !_1.shouldShowLaneFieldHovers()) return;
- if (_9 && !_1.shouldShowCellHovers()) return;
- if (!_10) {
- if (_2 == _1 || _2 == _1.body || _2 == _1.frozenBody) {
- _11 = _1.getHoverHTML();
- if (_11) {
- _1.startHover()
- }
- } else {
- _11 = _2.getHoverHTML();
- if (isc.Hover.lastHoverCanvas != _2) {
- _2.startHover()
- }
- }
- } else if (_2 && _2.getHoverHTML) {
- if (!_1.isMonthView()) {
- if (isc.Hover.lastHoverCanvas != _2) {
- _2.startHover()
- }
- }
- }
- }, isc.A.$53b = function isc_Calendar__shouldRefreshDay(_1, _2) {
- if (!this.dayView || !this.dayView.body) return false;
- var _3 = _1.getTime() < this.chosenDateEnd.getTime(),
- _4 = _2.getTime() > this.chosenDateStart.getTime();
- return (_3 && _4)
- }, isc.A.$53c = function isc_Calendar__shouldRefreshWeek(_1, _2) {
- if (!this.weekView || !this.weekView.body) return false;
- var _3 = _1.getTime() < this.chosenWeekEnd.getTime(),
- _4 = _2.getTime() > this.chosenWeekStart.getTime();
- return (_3 && _4)
- }, isc.A.$53d = function isc_Calendar__shouldRefreshMonth(_1, _2) {
- if (!this.monthView || !this.monthView.body) return false;
- var _3 = new Date(this.year, this.month, -7, 0, 0, 0).getTime(),
- _4 = new Date(this.year, this.month, 37, 23, 59, 59).getTime();
- return (_1.getTime() < _4 && _2.getTime() > _3)
- }, isc.A.$131r = function isc_Calendar__shouldRefreshTimeline(_1, _2) {
- if (!this.timelineView || !this.timelineView.body) return false;
- var _3 = _1.getTime() < this.timelineView.endDate.getTime(),
- _4 = _2.getTime() > this.timelineView.startDate.getTime();
- return (_3 && _4)
- }, isc.A.getEventCanvasConstructor = function isc_Calendar_getEventCanvasConstructor(_1, _2) {
- _2 = _2 || this.getSelectedView();
- return _2.getEventCanvasConstructor(_1) || this.eventCanvasConstructor
- }, isc.A.getEventCanvasStyle = function isc_Calendar_getEventCanvasStyle(_1, _2) {
- _2 = _2 || this.getSelectedView();
- var _3 = this.$131j(_1) || _2.getEventCanvasStyle(_1) || this.eventWindowStyle || this.eventStyleName;
- return _3
- }, isc.A.$1700 = function isc_Calendar__showEventCanvasContextMenu(_1) {
- if (this.showEventCanvasContextMenu == false) return false;
- var _2 = this.getEventCanvasMenuItems(_1);
- if (_2 && _2.length > 0) {
- if (!this.eventCanvasContextMenu) this.addAutoChild("eventCanvasContextMenu");
- this.eventCanvasContextMenu.setData(_2);
- _1.contextMenu = this.eventCanvasContextMenu;
- _1.showContextMenu();
- return false
- }
- return true
- }, isc.A.$1701 = function isc_Calendar__eventCanvasContextClick(_1) {
- return this.$1700(_1)
- }, isc.A.getEventCanvasMenuItems = function isc_Calendar_getEventCanvasMenuItems(_1, _2) {
- return
- }, isc.A.hideEventCanvasControls = function isc_Calendar_hideEventCanvasControls(_1, _2) {
- var _3 = _1[_2];
- if (!_3) return;
- var _4 = ["closeButton", "contextButton"];
- for (var _5 in _3) {
- var _6 = _3[_5];
- _6.hide();
- delete _6.eventCanvas;
- if (!_4.contains(_5)) this.addChild(_6)
- }
- delete _1[_2]
- }, isc.A.$174c = function isc_Calendar__createEventCanvasControls(_1, _2) {
- var _3 = {};
- var _4 = this.createAutoChild("eventCanvasButtonLayout");
- _3.contextButton = this.createAutoChild("eventCanvasContextButton");
- _4.addMember(_3.contextButton);
- if (this.canRemoveEvents != false) {
- _3.closeButton = this.createAutoChild("eventCanvasCloseButton");
- _4.addMember(_3.closeButton)
- }
- _3.buttonLayout = _4;
- if (this.canResizeEvents != false) {
- if (!_1 || _1.vertical) {
- _3.endResizerB = this.getEventCanvasResizer(null, "B", _2)
- }
- if (!_1 || !_1.vertical) {
- _3.startResizerL = this.getEventCanvasResizer(null, "L", _2);
- _3.endResizerR = this.getEventCanvasResizer(null, "R", _2)
- }
- }
- return _3
- }, isc.A.$174d = function isc_Calendar__getRolloverControls() {
- if (!this.$129e) {
- this.$129e = this.$174c()
- }
- return this.$129e
- }, isc.A.$174e = function isc_Calendar__getFocusControls() {
- if (!this.$174f) {
- this.$174f = this.$174c(null, true)
- }
- return this.$174f
- }, isc.A.$174g = function isc_Calendar__focusEventCanvas(_1) {
- if (!_1 || _1.$174h) {
- return
- }
- if (_1.$129e) {
- this.hideEventCanvasControls(_1, "$129e")
- }
- _1.updateRolloverControls()
- }, isc.A.$174i = function isc_Calendar__blurEventCanvas(_1) {
- if (!_1 || _1.$174h) {
- return
- }
- this.hideEventCanvasControls(_1, "$174f");
- _1.updateRolloverControls()
- }, isc.A.getEventCanvasGripper = function isc_Calendar_getEventCanvasGripper(_1, _2, _3) {
- _1 = _1 || {};
- _1.src = this.getEventCanvasGripperIcon(_2, _3);
- var _4 = this.createAutoChild("eventCanvasGripper", _1);
- _3.addChild(_4);
- return _4
- }, isc.A.getEventCanvasGripperIcon = function isc_Calendar_getEventCanvasGripperIcon(_1, _2) {
- return _1.gripperIcon || this.eventCanvasGripperIcon
- }, isc.A.getEventCanvasLabel = function isc_Calendar_getEventCanvasLabel(_1, _2) {
- var _3 = this.createAutoChild("eventCanvasLabel", _1);
- _2.addChild(_3);
- return _3
- }, isc.A.$174b = function isc_Calendar__eventCanvasCloseClick(_1) {
- if (this.eventRemoveClick(_1.event, _1.calendarView.viewName) != false) {
- this.removeEvent(_1.event, false)
- }
- }, isc.A.getEventCanvasCloseButton = function isc_Calendar_getEventCanvasCloseButton(_1) {
- if (this.useEventCanvasRolloverControls) {
- if (!this.eventCanvasCloseButton) {
- this.eventCanvasCloseButton = this.addAutoChild("eventCanvasCloseButton")
- }
- return this.eventCanvasCloseButton
- } else {
- return this.createAutoChild("eventCanvasCloseButton")
- }
- }, isc.A.getEventCanvasContextButton = function isc_Calendar_getEventCanvasContextButton(_1) {
- if (this.useEventCanvasRolloverControls) {
- if (!this.eventCanvasContextButton) {
- this.eventCanvasContextButton = this.addAutoChild("eventCanvasContextButton")
- }
- return this.eventCanvasContextButton
- } else {
- return this.createAutoChild("eventCanvasContextButton")
- }
- }, isc.A.getEventCanvasResizer = function isc_Calendar_getEventCanvasResizer(_1, _2, _3) {
- var _4 = "eventCanvasResizer" + _2,
- _5 = _3 ? null : this[_4];
- if (!this.useEventCanvasRolloverControls || !_5) {
- var _6 = "eventCanvas" + (["T", "B"].contains(_2) ? "V" : "H") + "Resizer",
- _7 = {
- snapTo: _2,
- getEventEdge: function() {
- return this.snapTo
- }
- };
- _5 = this.createAutoChild(_6, _7);
- if (!_3 && this.useEventCanvasRolloverControls) this[_4] = _5
- }
- return _5
- }, isc.A.setShowZones = function isc_Calendar_setShowZones(_1) {
- this.showZones = _1;
- var _2 = this.timelineView;
- if (_2 && _2.isSelectedView()) _2.refreshEvents();
- else if (_2) _2.$123s = true
- }, isc.A.setZones = function isc_Calendar_setZones(_1) {
- if (!_1) {
- return
- }
- this.zones = _1;
- if (this.timelineView) {
- this.timelineView.drawZones()
- }
- }, isc.A.addZone = function isc_Calendar_addZone(_1) {
- if (!_1) return;
- this.zones = this.zones || [];
- this.zones.add(_1);
- this.setZones(this.zones)
- }, isc.A.removeZone = function isc_Calendar_removeZone(_1) {
- if (!_1 || !this.zones) return;
- if (isc.isA.String(_1)) _1 = this.zones.find(this.nameField, _1);
- if (_1) {
- this.zones.remove(_1);
- this.setZones(this.zones)
- }
- }, isc.A.getZoneCanvas = function isc_Calendar_getZoneCanvas(_1, _2) {
- var _3 = {
- calendar: this,
- calendarView: _2,
- event: _1,
- isZoneCanvas: true,
- styleName: this.getZoneCanvasStyle(_1, _2)
- };
- var _4 = this.createAutoChild("zoneCanvas", _3, this.zoneCanvasConstructor);
- if (this.customizeCanvas) this.customizeCanvas(_4, _2);
- return _4
- }, isc.A.$131j = function isc_Calendar__getEventStyleName(_1) {
- return _1[this.eventWindowStyleField] || _1[this.eventStyleNameField]
- }, isc.A.getZoneCanvasStyle = function isc_Calendar_getZoneCanvasStyle(_1, _2) {
- _2 = _2 || this.getSelectedView();
- var _3 = this.$131j(_1) || (_2 && _2.zoneStyleName) || this.zoneStyleName;
- return _3
- }, isc.A.setShowIndicators = function isc_Calendar_setShowIndicators(_1) {
- this.showIndicators = _1;
- var _2 = this.timelineView;
- if (_2 && _2.isSelectedView()) _2.refreshEvents();
- else if (_2) _2.$123s = true
- }, isc.A.getIndicatorCanvas = function isc_Calendar_getIndicatorCanvas(_1, _2) {
- _2 = _2 || this.getSelectedView();
- var _3 = {
- calendar: this,
- calendarView: _2,
- event: _1,
- isIndicatorCanvas: true,
- styleName: this.getIndicatorCanvasStyle(_1, _2),
- dragTarget: _2.eventDragTarget
- },
- _4 = this.createAutoChild("indicatorCanvas", _3, this.indicatorCanvasConstructor);
- if (this.customizeCanvas) this.customizeCanvas(_4, _2);
- return _4
- }, isc.A.getIndicatorCanvasStyle = function isc_Calendar_getIndicatorCanvasStyle(_1, _2) {
- _2 = _2 || this.getSelectedView();
- return this.$131j(_1) || (_2 && _2.indicatorStyleName) || this.indicatorStyleName
- }, isc.A.setIndicators = function isc_Calendar_setIndicators(_1) {
- if (!_1) {
- return
- }
- this.indicators = _1;
- if (this.timelineView) {
- this.timelineView.drawIndicators()
- }
- }, isc.A.addIndicator = function isc_Calendar_addIndicator(_1) {
- if (!_1) return;
- this.indicators = this.indicators || [];
- this.indicators.add(_1);
- this.setIndicators(this.indicators)
- }, isc.A.removeIndicator = function isc_Calendar_removeIndicator(_1) {
- if (!_1 || !this.indicators) return;
- if (isc.isA.String(_1)) _1 = this.indicators.find(this.nameField, _1);
- if (_1) {
- this.indicators.remove(_1);
- this.setIndicators(this.indicators)
- }
- }, isc.A.$129r = function isc_Calendar__getEventCanvas(_1, _2) {
- var _3 = this.canDragEvent(_1),
- _4 = this.canEditEvent(_1),
- _5 = this.canResizeEvent(_1),
- _6 = this.canRemoveEvent(_1),
- _7 = this.getEventCanvasStyle(_1, _2),
- _8 = false;
- var _9 = isc.addProperties({
- autoDraw: false,
- calendar: this,
- calendarView: _2,
- baseStyle: _7,
- canDragReposition: _3,
- canDragResize: _5,
- _redrawWithParent: false,
- showCloseButton: _6,
- descriptionText: _1[this.descriptionField],
- dragTarget: _2.eventDragTarget,
- headerProps: isc.addProperties({}, {
- dragTarget: _2.eventDragTarget
- }),
- footerProperties: {
- dragTarget: _2.eventDragTarget
- }
- }, this.eventWindowDefaults, this.eventWindowProperties);
- var _10 = _2.$128h,
- _11 = _2.getCurrentEventCanvas(_1),
- _12 = (_11 != null);
- if (_12) {
- _2.$128h.remove(_11)
- } else if (_2.useEventCanvasPool) {
- _11 = _2.getPooledEventCanvas(_1);
- if (_11) {
- _8 = true
- }
- }
- if (_11) {
- if (!_11.setEvent) {
- if (!_12) _11.setProperties(_9);
- _11.event = _1;
- _11.setEventStyle(_7)
- }
- } else {
- _9 = {
- calendar: this,
- calendarView: _2
- };
- var _13 = this.getEventCanvasConstructor(_1, _2);
- _11 = this.createAutoChild("eventCanvas", _9, _13)
- }
- if (_2.$129c && !_2.$129c.contains(_11))
- _2.$129c.add(_11);
- if (_2.$128q && !_2.$128q.contains(_1))
- _2.$128q.add(_1);
- _11.$128k = false;
- if (_11.setEvent) _11.setEvent(_1, _7);
- this.setEventCanvasID(_2, _1, _11.ID);
- if (this.customizeCanvas) this.customizeCanvas(_11, _2);
- return _11
- }, isc.A.$53g = function isc_Calendar__getEventsInRange(_1, _2, _3, _4) {
- var _5 = [],
- _6 = this.getWeekendDays(),
- _7 = this.data.getLength(),
- _8 = [],
- _9 = _1.getTime(),
- _10 = _2.getTime();
- _3 = _3 || this.getSelectedView();
- if (_4) {
- var _11 = _3.body.getVisibleColumns();
- if (_11[0] >= 0 && _11[1] >= 0) {
- for (var i = _11[0]; i <= _11[1]; i++) {
- _8.add(_3.body.fields[i][this.laneNameField])
- }
- }
- }
- for (var i = 0; i < _7; i++) {
- var _13 = this.data.get(i),
- _14 = this.getEventStartDate(_13);
- if (_4 && !_8.contains(_13[this.laneNameField])) continue;
- if (!_13 || !_14) return [];
- if (_14.getTime() >= _1.getTime() && _14.getTime() <= _2.getTime() && (this.showWeekends || !_6.contains(_14.getDay()))) {
- if (_3 && _3.isWeekView()) _5.add(_13);
- else if (!this.showDayLanes || _8.contains(_13[this.laneNameField]))
- _5.add(_13)
- }
- }
- return _5
- }, isc.A.getDayEnd = function isc_Calendar_getDayEnd(_1) {
- return isc.DateUtil.getEndOf(_1, "d", null, this.firstDayOfWeek)
- }, isc.A.isTimeline = function isc_Calendar_isTimeline() {
- var _1 = this.getCurrentViewName() == "timeline";
- return _1
- }, isc.A.$129t = function isc_Calendar__storeChosenDateRange(_1) {
- this.chosenDateStart = isc.DateUtil.getStartOf(_1, "d", false);
- this.chosenDateEnd = isc.DateUtil.getEndOf(_1, "d", false);
- var _2 = this.chosenWeekStart = isc.DateUtil.getStartOf(_1, "w", null, this.firstDayOfWeek);
- if (isc.DateUtil.compareDates(this.chosenDate, _2) == 1) {
- this.chosenWeekStart.setDate(this.chosenWeekStart.getDate() - 7)
- }
- this.chosenWeekEnd = isc.DateUtil.getEndOf(this.chosenWeekStart.duplicate(), "w", null, this.firstDayOfWeek);
- if (isc.DateUtil.compareDates(this.chosenDate, this.chosenWeekEnd) == -1) {
- this.chosenWeekStart.setDate(this.chosenWeekStart.getDate() + 7);
- this.chosenWeekEnd.setDate(this.chosenWeekEnd.getDate() + 7)
- }
- }, isc.A.setChosenDate = function isc_Calendar_setChosenDate(_1, _2) {
- var _3 = this.getSelectedView();
- var _4 = isc.Calendar.$1833(_1);
- this.year = _4.getFullYear();
- this.month = _4.getMonth();
- var _5 = isc.Calendar.$1833(this.chosenDate);
- this.chosenDate = _1;
- this.$129t(_1.duplicate());
- if (this.dayView) {
- var _6 = {
- date: isc.DateUtil.createLogicalDate(_1.getFullYear(), _1.getMonth(), _1.getDate()),
- $654: _1.getDay(),
- $658: _1.getDate(),
- $659: _1.getMonth(),
- $66a: _1.getFullYear()
- },
- _7;
- for (var i = 0; i < this.dayView.body.fields.length; i++) {
- _7 = this.dayView.body.getField(i);
- if (_7) isc.addProperties(_7, _6)
- }
- isc.DaySchedule.$129g(this, this.dayView, this.chosenDate)
- }
- if (_5.getFullYear() != this.year || _5.getMonth() != this.month) {
- if (this.monthView) {
- if (this.monthViewSelected()) this.monthView.$1739();
- else this.monthView.$123s = true
- }
- } else if (this.selectChosenDate) {
- if (this.monthView) this.monthView.selectChosenDateCells()
- }
- if (this.weekView) {
- if (_4.getWeek(this.firstDayOfWeek) != this.weekView.startDate.getWeek(this.firstDayOfWeek)) {
- this.$53a();
- if (this.weekViewSelected()) this.weekView.$1739();
- else this.weekView.$123s = true
- }
- }
- var _9 = _4.getTime();
- if (_9 != _5.getTime()) {
- if (this.dayView) {
- this.dayView.markForRedraw();
- if (this.dayViewSelected()) this.dayView.$1739();
- else this.dayView.$123s = true
- }
- }
- if (this.timelineView && !_2) {
- this.timelineView.setTimelineRange(this.chosenDate, null, null, null, null, this.headerLevels, true)
- } else {
- if (this.scrollToWorkday && _3.scrollToWorkdayStart) {
- _3.scrollToWorkdayStart()
- } else {
- _3.redraw()
- }
- }
- if (this.monthButton) this.updateMonthButton();
- this.setDateLabel();
- this.dateChanged()
- }, isc.A.dateIsWorkday = function isc_Calendar_dateIsWorkday(_1, _2) {
- if (!_1 || !this.workdays) return false;
- return this.workdays.contains(_1.getDay())
- }, isc.A.adjustCriteria = function isc_Calendar_adjustCriteria(_1) {
- return _1
- }, isc.A.shouldIncludeRangeCriteria = function isc_Calendar_shouldIncludeRangeCriteria(_1) {
- _1 = _1 || this.getSelectedView();
- if (_1 && _1.includeRangeCriteria != null) return _1.includeRangeCriteria;
- return this.includeRangeCriteria
- }, isc.A.$wo = function isc_Calendar__filter(_1, _2, _3, _4, _5) {
- var _6 = this.getSelectedView();
- if (this.shouldIncludeRangeCriteria(_6)) {
- if (_2) {
- _2 = isc.DS.removeCriteriaForField(_2, this.startDateField);
- _2 = isc.DS.removeCriteriaForField(_2, this.endDateField)
- }
- var _7 = this.getRangeCriteria(_6);
- if (_7) {
- if (!_2 || isc.isA.emptyObject(_2)) _2 = _7;
- else {
- _2 = isc.DS.combineCriteria(_2, _7)
- }
- }
- _2 = isc.DS.compressNestedCriteria(_2)
- }
- return this.Super("$wo", arguments)
- }, isc.A.getRangeCriteria = function isc_Calendar_getRangeCriteria(_1) {
- _1 = _1 || this.getSelectedView();
- if (!_1) return null;
- if (!this.shouldIncludeRangeCriteria(_1)) return null;
- var _2 = null,
- _3 = null,
- _4 = {},
- _5 = _1.rangeCriteriaMode || this.rangeCriteriaMode || "none";
- if (_5 == "auto") {
- var _6 = this.getLargestScrollableRange();
- _2 = _6[0];
- _3 = _6[1]
- } else if (_5 != "none") {
- _2 = this.getVisibleStartDate(_1);
- _3 = this.getVisibleEndDate(_1)
- }
- if (_2 && _3) {
- _4 = {
- _constructor: "AdvancedCriteria",
- operator: "and",
- criteria: [{
- fieldName: this.startDateField,
- operator: "lessThan",
- value: _3
- }, {
- fieldName: this.endDateField,
- operator: "greaterThan",
- value: _2
- }]
- }
- }
- _4 = this.adjustCriteria(_4);
- return _4
- }, isc.A.$53a = function isc_Calendar__setWeekTitles() {
- if (!this.weekView) return;
- var _1 = this.chosenWeekStart.duplicate();
- var _2 = isc.DateUtil.getShortDayNames();
- var _3 = this.getWeekendDays();
- isc.DaySchedule.$129g(this, this.weekView, this.chosenWeekStart);
- for (var i = 1; i < 8; i++) {
- if (this.weekView.getFieldNum("day" + i) >= 0) {
- var _5 = _1.toShortDate(this.dateFormatter, false);
- if (_5.match(this.$81i) != null) _5 = _5.substring(5);
- else if (_5.match(this.$81j)) _5 = _5.substring(0, _5.length - 5);
- var _6 = _2[_1.getDay()] + " " + _5;
- var p = {
- title: _6,
- align: "right",
- $654: _1.getDay(),
- $658: _1.getDate(),
- $659: _1.getMonth(),
- $66a: _1.getFullYear()
- };
- p.date = isc.DateUtil.createLogicalDate(p.$66a, p.$659, p.$658), this.weekView.setFieldProperties("day" + i, p);
- if (this.weekView.header) this.weekView.header.markForRedraw()
- }
- _1.setDate(_1.getDate() + 1)
- }
- this.weekView.startDate = this.chosenWeekStart;
- this.weekView.endDate = this.chosenWeekEnd;
- this.weekView.redraw()
- }, isc.A.next = function isc_Calendar_next() {
- var _1;
- if (this.dayViewSelected()) {
- _1 = isc.DateUtil.createDatetime(this.year, this.month, this.chosenDate.getDate() + 1);
- if (!this.showWeekends) {
- var _2 = this.getWeekendDays();
- for (var i = 0; i < _2.length; i++) {
- if (_2.contains(_1.getDay())) _1.setDate(_1.getDate() + 1)
- }
- }
- } else if (this.weekViewSelected()) {
- _1 = isc.DateUtil.createDatetime(this.year, this.month, this.chosenDate.getDate() + 7)
- } else if (this.monthViewSelected()) {
- _1 = isc.DateUtil.createDatetime(this.year, this.month + 1, 1)
- } else if (this.timelineViewSelected()) {
- _1 = this.chosenDate.duplicate();
- this.timelineView.nextOrPrev(true);
- return
- }
- this.dateChooser.setData(_1);
- this.setChosenDate(_1)
- }, isc.A.previous = function isc_Calendar_previous() {
- var _1;
- if (this.dayViewSelected()) {
- _1 = isc.DateUtil.createDatetime(this.year, this.month, this.chosenDate.getDate() - 1);
- if (!this.showWeekends) {
- var _2 = this.getWeekendDays();
- for (var i = 0; i < _2.length; i++) {
- if (_2.contains(_1.getDay())) _1.setDate(_1.getDate() - 1)
- }
- }
- } else if (this.weekViewSelected()) {
- _1 = isc.DateUtil.dateAdd(isc.DateUtil.getStartOf(this.chosenDate, "w"), "w", 1, -1)
- } else if (this.monthViewSelected()) {
- _1 = isc.DateUtil.createDatetime(this.year, this.month - 1, 1)
- } else if (this.timelineViewSelected()) {
- this.timelineView.nextOrPrev(false);
- return
- }
- this.dateChooser.setData(_1);
- this.setChosenDate(_1)
- }, isc.A.dataArrived = function isc_Calendar_dataArrived() {
- if (this.$1746) this.dataChanged();
- return true
- }, isc.A.draw = function isc_Calendar_draw(_1, _2, _3, _4) {
- this.$1737 = true;
- this.invokeSuper(isc.Calendar, "draw", _1, _2, _3, _4);
- if (isc.ResultSet && isc.isA.ResultSet(this.data) && this.dataSource) {
- if (!this.isObserving(this.data, "dataArrived")) {
- this.observe(this.data, "dataArrived", "observer.dataArrived(arguments[0], arguments[1])")
- }
- }
- if (this.mainView.isA("TabSet")) {
- if (this.showControlsBar != false) {
- this.mainView.addChild(this.controlsBar);
- this.controlsBar.moveAbove(this.mainView.tabBar)
- }
- }
- if (!isc.isA.TabSet(this.mainView)) {
- this.setChosenDate(this.chosenDate)
- } else {
- this.setDateLabel()
- }
- delete this.$1737;
- if (this.$187g) {
- var _5 = this.$187g;
- delete this.$187g;
- this.scrollToTime(_5)
- }
- }, isc.A.$653 = function isc_Calendar__getTabs() {
- var _1 = [],
- _2 = {
- calendar: this,
- baseStyle: this.baseStyle
- },
- _3 = this.lanes ? this.lanes.duplicate() : null;
- if (this.showDayView != false) {
- this.dayView = this.createAutoChild("dayView", isc.addProperties({
- viewName: "day",
- startDate: this.chosenDateStart,
- endDate: this.chosenDateEnd
- }, _2, {
- cellHeight: this.rowHeight,
- enforceVClipping: true
- }));
- _1.add({
- title: this.dayViewTitle,
- pane: this.dayView,
- viewName: "day"
- })
- }
- if (this.showWeekView != false) {
- this.weekView = this.createAutoChild("weekView", isc.addProperties({
- viewName: "week"
- }, _2, {
- cellHeight: this.rowHeight,
- enforceVClipping: true
- }));
- _1.add({
- title: this.weekViewTitle,
- pane: this.weekView,
- viewName: "week"
- })
- }
- if (this.showMonthView != false) {
- this.monthView = this.createAutoChild("monthView", isc.addProperties({
- viewName: "month"
- }, _2, {
- bodyConstructor: "MonthScheduleBody"
- }));
- _1.add({
- title: this.monthViewTitle,
- pane: this.monthView,
- viewName: "month"
- })
- }
- if (this.showTimelineView != false) {
- this.timelineView = this.createAutoChild("timelineView", isc.addProperties({
- viewName: "timeline",
- startDate: this.startDate,
- endDate: this.endDate
- }, _2));
- _1.add({
- title: this.timelineViewTitle,
- pane: this.timelineView,
- viewName: "timeline"
- })
- }
- return _1
- });
- isc.evalBoundary;
- isc.B.push(isc.A.$655 = function isc_Calendar__createTabSet(_1) {
- if (_1.length > 1) {
- this.mainView = this.createAutoChild("mainView", {
- tabs: _1,
- $8c: function(_6) {
- this.Super("$8c", arguments);
- var _2 = this.getTabPane(_6);
- this.creator.$567 = _2.viewName;
- this.creator.setDateLabel();
- var _3 = this.creator.getSelectedView();
- if (_3.isDrawn()) _3.redraw();
- if (_3.$123s) {
- _3.$1739()
- }
- this.creator.currentViewChanged(_2.viewName)
- }
- });
- var _4;
- if (this.currentViewName) {
- _4 = _1.find("viewName", this.currentViewName);
- if (_4) this.mainView.selectTab(_4)
- } else if (this.minimalUI) {
- this.pageOrientationChanged()
- } else {
- var _5 = this.weekView ? "week" : (this.dayView ? "day" : (this.monthView ? "month" : (this.timelineView ? "timeline" : null)));
- if (_5) {
- _4 = _1.find("viewName", _5);
- if (_4) {
- this.mainView.selectTab(_4);
- this.mainView.viewName = _5;
- this.$567 = _5
- }
- }
- }
- } else {
- this.mainView = _1[0].pane
- }
- }, isc.A.getLaneMap = function isc_Calendar_getLaneMap() {
- if (!this.isTimeline() && !this.showDayLanes) return {};
- var _1 = this.showDayLanes ? this.lanes : this.canGroupLanes ? this.timelineView.getOriginalData() : this.timelineView.data,
- _2 = {};
- for (var i = 0; i < _1.length; i++) {
- var _4 = _1[i].name || _1[i][this.laneNameField],
- _5 = _1[i].title || _4;
- _2[_4] = _5
- }
- return _2
- }, isc.A.getSublaneMap = function isc_Calendar_getSublaneMap(_1, _2) {
- _2 = _2 || this.getSelectedView();
- var _3 = {};
- if (isc.isA.String(_1)) _1 = _2.getLane(_1);
- if (_1 && _1.sublanes) {
- for (var i = 0; i < _1.sublanes.length; i++) {
- var _5 = _1.sublanes[i],
- _6 = _5.name || _5[this.laneNameField],
- _7 = _5.title || _6;
- _3[_6] = _7
- }
- }
- return _3
- }, isc.A.getLanePadding = function isc_Calendar_getLanePadding(_1) {
- _1 = _1 || this.getSelectedView();
- if (_1 && _1.useLanePadding()) return this.laneEventPadding;
- return 0
- }, isc.A.getLaneEvents = function isc_Calendar_getLaneEvents(_1, _2) {
- var _3 = isc.isAn.Object(_1) ? _1.name : _1;
- if (!_3 || !isc.isA.String(_3)) return [];
- _2 = _2 || this.getSelectedView();
- var _4 = this.data.findAll(this.laneNameField, _3) || [],
- _5 = [];
- for (var i = 0; i < _4.length; i++) {
- var _7 = _4[i];
- if (!_7) continue;
- if (this.shouldShowEvent(_7, _2)) {
- _5.add(_7)
- }
- }
- return _5
- }, isc.A.getSublaneEvents = function isc_Calendar_getSublaneEvents(_1, _2, _3) {
- var _4 = isc.isAn.Object(_1) ? _1.name : _1,
- _5 = isc.isAn.Object(_2) ? _2.name : _2;
- if ((!_4 || !isc.isA.String(_4)) || (!_5 || !isc.isA.String(_5))) {
- return []
- }
- _3 = _3 || this.getSelectedView();
- var _6 = this.getLaneEvents(_4, _3),
- _7 = _6.findAll(this.sublaneNameField, _5);
- return _7
- }, isc.A.createChildren = function isc_Calendar_createChildren() {
- var _1 = this.$653();
- this.$655(_1);
- var _2 = 20;
- if (this.showControlsBar != false) {
- this.dateLabel = this.createAutoChild("dateLabel");
- this.addEventButton = this.createAutoChild("addEventButton", {
- click: function() {
- var _3 = this.creator;
- var _4 = _3.getSelectedView();
- _3.eventDialog.event = null;
- _3.eventDialog.isNewEvent = true;
- _3.eventDialog.items[0].createFields();
- var _5 = new Date(),
- _6 = null,
- _7 = _3.chosenDate.duplicate();
- if (_4.isDayView()) {
- _5 = _7
- } else if (_4.isWeekView()) {
- if (_3.chosenWeekStart.getTime() > _5.getTime()) {
- _5 = _3.chosenWeekStart.duplicate()
- }
- if (!this.showWeekends) {
- var _8 = _3.getWeekendDays();
- for (var i = 0; i < _8.length; i++) {
- if (_8.contains(_5.getDay())) _5.setDate(_5.getDate() + 1)
- }
- }
- _5.setMinutes(0);
- if (_5.getHours() > 22) {
- _5.setDate(_5.getDate() + 1);
- _5.setHours(0)
- } else _5.setHours(_5.getHours() + 1)
- } else if (_4.isMonthView()) {
- _7.setDate(1);
- if (_7.getTime() > _5.getTime()) _5 = _7
- } else if (_3.isTimeline()) {
- var _10 = _3.timelineView,
- _11 = _10.getVisibleDateRange();
- _5 = _11[0];
- _6 = _5.duplicate();
- _6 = _10.addUnits(_6, 1, _3.timelineGranularity)
- }
- var _12 = {};
- _12[_3.startDateField] = _5;
- _12[_3.endDateField] = _6;
- _3.eventDialog.event = _12;
- _3.eventDialog.setDate(_5, _6);
- _3.eventDialog.setPageLeft(_3.getPageLeft());
- _3.eventDialog.setPageTop(this.getPageTop() + this.getVisibleHeight());
- _3.displayEventDialog()
- }
- });
- this.datePickerButton = this.createAutoChild("datePickerButton", {
- click: function() {
- var _3 = this.creator;
- if (!_3.dateChooser.isDrawn()) _3.dateChooser.draw();
- else _3.dateChooser.redraw();
- _3.dateChooser.placeNear(this.getPageLeft(), this.getPageTop() + this.getHeight());
- _3.dateChooser.show()
- }
- });
- if (this.minimalUI && this.showMonthButton != false && this.showMonthView != false) {
- this.monthButton = this.createAutoChild("monthButton");
- this.updateMonthButton()
- }
- this.previousButton = this.createAutoChild("previousButton", {});
- this.nextButton = this.createAutoChild("nextButton", {})
- }
- var _13 = [];
- if (this.monthButton) _13.add(this.monthButton);
- if (this.showPreviousButton != false) _13.add(this.previousButton);
- if (this.showDateLabel != false) _13.add(this.dateLabel);
- if (this.showDatePickerButton != false) _13.add(this.datePickerButton);
- if (this.canCreateEvents && this.showAddEventButton != false) _13.add(this.addEventButton);
- if (this.showNextButton != false) _13.add(this.nextButton);
- if (this.showControlsBar != false) {
- this.controlsBar = this.createAutoChild("controlsBar", {
- members: _13
- })
- }
- var _3 = this;
- this.dateChooser = this.createAutoChild("dateChooser", {
- disableWeekends: this.disableChooserWeekends != null ? this.disableChooserWeekends : false,
- showWeekends: this.showChooserWeekends != null ? this.showChooserWeekends : true,
- weekendDays: this.getWeekendDays(),
- chosenDate: this.chosenDate,
- month: this.month,
- year: this.year,
- closeOnEscapeKeypress: true,
- autoHide: true,
- autoClose: true,
- dateClick: function(_17, _18, _19) {
- var _14 = this.Super("dateClick", arguments);
- if (_14) this.creator.setChosenDate(_14);
- return _14
- },
- show: function() {
- this.Super("show", arguments);
- this.bringToFront();
- this.focus()
- }
- });
- this.addChild(this.dateChooser);
- if (!this.children) this.children = [];
- var _15 = [];
- var _16 = [];
- _16.add(this.dateChooser);
- if (this.showDateChooser) {
- _15.add(isc.VLayout.create({
- autoDraw: false,
- width: "20%",
- membersMargin: 10,
- layoutTopMargin: 10,
- members: _16
- }))
- }
- if (this.mainView.isA("TabSet")) {
- _15.add(this.mainView)
- } else {
- if (this.showControlsBar != false) {
- this.controlsBarContainer = this.createAutoChild("controlsBarContainer", {
- autoDraw: false,
- height: this.controlsBar.getVisibleHeight(),
- width: "100%"
- }, isc.HLayout);
- this.controlsBarContainer.addMember(isc.LayoutSpacer.create({
- autoDraw: false,
- width: "*"
- }));
- this.controlsBarContainer.addMember(this.controlsBar);
- this.controlsBarContainer.addMember(isc.LayoutSpacer.create({
- autoDraw: false,
- width: "*"
- }));
- this.mainLayout = this.createAutoChild("mainLayout", {
- autoDraw: false,
- members: [this.controlsBarContainer, this.mainView]
- }, isc.VLayout);
- _15.add(this.mainLayout)
- } else {
- _15.add(this.mainView)
- }
- }
- this.children.add(isc.HLayout.create({
- autoDraw: false,
- width: "100%",
- height: "100%",
- members: _15
- }));
- this.setDateLabel()
- }, isc.A.createEditors = function isc_Calendar_createEditors() {
- var _1 = this;
- this.eventDialog = this.createAutoChild("eventDialog", {
- items: [isc.DynamicForm.create({
- autoDraw: false,
- padding: 4,
- calendar: this,
- saveOnEnter: true,
- useAllDataSourceFields: true,
- numCols: 2,
- colWidths: [80, "*"],
- $642: [_1.nameField, _1.laneNameField, _1.sublaneNameField],
- getCustomValues: function() {
- if (!this.calendar.eventDialogFields) return;
- var _2 = this.$642;
- var _3 = this.calendar.eventDialogFields;
- var _4 = {};
- for (var i = 0; i < _3.length; i++) {
- var _6 = _3[i];
- if (_6.name && !_2.contains(_6.name)) {
- _4[_6.name] = this.getValue(_6.name)
- }
- }
- return _4
- },
- setCustomValues: function(_65) {
- if (!this.calendar.eventDialogFields) return;
- var _2 = this.$642;
- var _3 = this.calendar.eventDialogFields;
- for (var i = 0; i < _3.length; i++) {
- var _6 = _3[i];
- if (_6.name && !_2.contains(_6.name)) {
- this.setValue(_6.name, _65[_6.name])
- }
- }
- },
- createFields: function(_65) {
- var _1 = this.calendar,
- _7 = _1.eventDialog.isNewEvent,
- _8 = _1.isTimeline() || (_1.showDayLanes && _1.dayViewSelected()),
- _9 = _8 && _1.useSublanes;
- var _10 = [{
- name: _1.nameField,
- title: _1.eventNameFieldTitle,
- type: "text",
- width: 250,
- wrapTitle: false
- }, {
- name: _1.laneNameField,
- title: _1.eventLaneFieldTitle,
- type: "select",
- width: 150,
- valueMap: _1.getLaneMap(),
- showIf: _8 ? "true" : "false",
- changed: function(_51, _64, _66) {
- var _11 = _1.lanes.find("name", _66);
- if (_66 && _11) {
- var _12 = _51.getItem(_1.sublaneNameField);
- if (_12) _12.setValueMap(_1.getSublaneMap(_11))
- }
- }
- }, {
- name: _1.sublaneNameField,
- title: _1.eventSublaneFieldTitle,
- type: "select",
- width: 150,
- valueMap: [],
- showIf: _9 ? "true" : "false"
- }, {
- name: "save",
- title: _1.saveButtonTitle,
- editorType: "SubmitItem",
- endRow: false
- }, {
- name: "details",
- title: _1.detailsButtonTitle,
- type: "button",
- startRow: false,
- click: function(_51, _64) {
- var _1 = _51.calendar,
- _13 = _1.eventDialog.isNewEvent,
- _14 = _1.eventDialog.event || {},
- _15 = _51.getValue(_1.nameField),
- _16 = _51.getValue(_1.laneNameField),
- _17 = _51.getValue(_1.sublaneNameField);
- if (_13) {
- _14[_1.nameField] = _15;
- if (_16) _14[_1.laneNameField] = _16;
- if (_17) _14[_1.sublaneNameField] = _16
- }
- _1.showEventEditor(_14, _13)
- }
- }];
- var _18 = isc.DataSource.create({
- addGlobalId: false,
- fields: _10
- });
- this.setDataSource(_18);
- this.setFields(isc.shallowClone(this.calendar.eventDialogFields))
- },
- submit: function() {
- var _1 = this.calendar,
- _7 = _1.eventDialog.isNewEvent,
- _19 = _1.eventDialog.event || {},
- _20 = _1.eventDialog.currentStart,
- _21 = _1.eventDialog.currentEnd,
- _22 = this,
- _11 = null,
- _23 = null;
- if (!_22.validate()) return;
- if (_1.isTimeline() || (_1.dayViewSelected() && _1.showDayLanes)) {
- _11 = _22.getValue(_1.laneNameField);
- _23 = _22.getValue(_1.sublaneNameField)
- }
- var _24 = isc.addProperties({}, _22.getCustomValues());
- _1.$1115 = true;
- var _25 = _1.createEventObject(_19, _20, _21, _11, _23, _22.getValue(_1.nameField));
- if (!_7) {
- _1.updateCalendarEvent(_19, _25, _24)
- } else {
- _1.addCalendarEvent(_25, _24)
- }
- _1.hideEventDialog()
- }
- })],
- setDate: function(_65, _63) {
- var _1 = this.creator;
- if (!_63) {
- if (_65.getHours() == 23 && _65.getMinutes() == (60 - _1.getSelectedView().getTimePerCell())) {
- _63 = new Date(_65.getFullYear(), _65.getMonth(), _65.getDate() + 1)
- } else {
- _63 = new Date(_65.getFullYear(), _65.getMonth(), _65.getDate(), _65.getHours() + 1, _65.getMinutes())
- }
- }
- this.setTitle(_1.$53k(_65, _63));
- this.currentStart = _65;
- this.currentEnd = _63;
- this.items[0].setValue(_1.nameField, "")
- },
- setLane: function(_11) {
- var _1 = this.creator;
- if (isc.isA.Number(_11)) _11 = _1.lanes[_11].name;
- this.items[0].getItem(_1.laneNameField).setValue(_11)
- },
- setEvent: function(_14) {
- this.event = _14;
- var _26 = this.items[0],
- _27 = this.items[1],
- _1 = this.creator,
- _28 = _1.getSelectedView(),
- _13 = !!this.isNewEvent,
- _29 = _13 || _1.canEditEventLane(_14, _28);
- _26.getItem(_1.laneNameField).setDisabled(!_29);
- if (_1.eventDialogFields) {
- _26.clearErrors(true);
- _26.setCustomValues(_14)
- }
- this.setDate(_1.getEventStartDate(_14), _1.getEventEndDate(_14));
- if (_1.useSublanes && _14[_1.laneNameField]) {
- var _11 = _28.getLane(_14[_1.laneNameField]);
- if (_11) {
- var _12 = _26.getItem(_1.sublaneNameField);
- _12.setValueMap(_1.getSublaneMap(_11))
- }
- }
- _26.setValues(_14)
- },
- closeClick: function() {
- this.Super('closeClick');
- this.creator.clearViewSelection()
- },
- show: function() {
- if (this.creator.showQuickEventDialog) {
- if (!this.isDrawn()) this.draw();
- this.Super('show');
- this.items[0].getItem(this.creator.nameField).focusInItem()
- } else {
- this.creator.showEventEditor(this.event, this.isNewEvent)
- }
- },
- hide: function() {
- this.Super('hide');
- this.moveTo(0, 0)
- }
- });
- this.eventEditor = this.createAutoChild("eventEditor", {
- useAllDataSourceFields: true,
- titleWidth: 80,
- initWidget: function() {
- this.invokeSuper(isc.DynamicForm, "initWidget", arguments);
- var _1 = this.creator;
- this.timeFormat = _1.timeFormat
- },
- rebuildFieldList: function() {
- var _10 = [],
- _30 = _1.getDateEditingStyle(),
- _31 = [{
- name: "endType",
- type: "text",
- showTitle: false,
- width: "*",
- editorType: "SelectItem",
- textAlign: "right",
- valueMap: [_1.eventDurationFieldTitle, _1.eventEndDateFieldTitle],
- endRow: false,
- changed: function(_51, _64, _65) {
- _30 = _1.getDateEditingStyle();
- if (_65 == _1.eventDurationFieldTitle) {
- _51.getItem(_1.durationField).show();
- _51.getItem(_1.durationUnitField).show();
- if (_30 == "time") {
- _51.getItem("endHours").hide();
- _51.getItem("endMinutes").hide();
- _51.getItem("endAMPM").hide()
- } else {
- _51.getItem(_1.endDateField).hide()
- }
- } else {
- _51.getItem(_1.durationField).hide();
- _51.getItem(_1.durationUnitField).hide();
- if (_30 == "time") {
- _51.getItem("endHours").show();
- _51.getItem("endMinutes").show();
- _51.getItem("endAMPM").show()
- } else {
- _51.getItem(_1.endDateField).show()
- }
- }
- }
- }, {
- name: _1.durationField,
- type: "integer",
- editorType: "SpinnerItem",
- title: _1.eventDurationFieldTitle,
- endRow: false,
- showTitle: false,
- width: "*",
- colSpan: 1,
- defaultValue: 1
- }, {
- name: _1.durationUnitField,
- type: "text",
- showTitle: false,
- endRow: true,
- title: _1.eventDurationUnitFieldTitle,
- width: "*",
- colSpan: 1,
- valueMap: _1.getDurationUnitMap(),
- defaultValue: "minute"
- }];
- this.$642.addList([_1.nameField, _1.descriptionField, _1.startDateField, "endType", _1.durationField, _1.durationUnitField, _1.endDateField]);
- if (_1.timelineView || (_1.dayViewSelected() && _1.showDayLanes)) {
- var _32 = _1.getLaneMap(),
- _33 = {
- name: _1.laneNameField,
- title: _1.eventLaneFieldTitle,
- type: "select",
- valueMap: _32,
- endRow: true,
- width: "*",
- colSpan: 3,
- changed: function(_51, _64, _65) {
- var _11 = _1.lanes.find("name", _65);
- if (_65 && _11) {
- var _12 = _51.getItem(_1.sublaneNameField);
- if (_12) _12.setValueMap(_1.getSublaneMap(_11))
- }
- }
- };
- _10.add(_33);
- if (_1.useSublanes) {
- var _34 = {},
- _35 = {
- name: _1.sublaneNameField,
- title: _1.eventSublaneFieldTitle,
- type: "select",
- valueMap: _34,
- endRow: true,
- width: "*",
- colSpan: 3
- };
- _10.add(_35)
- }
- }
- var _36 = _1.allowDurationEvents;
- if (_30 == "date" || _30 == "datetime") {
- _10.add({
- name: _1.startDateField,
- title: _1.eventStartDateFieldTitle,
- type: _30,
- colSpan: "*",
- endRow: true
- });
- if (_36) _10.addList(_31);
- _10.addList([{
- name: _1.endDateField,
- title: _1.eventEndDateFieldTitle,
- showTitle: !_36,
- type: _30,
- colSpan: "*",
- endRow: true
- }, {
- name: "invalidDate",
- type: "blurb",
- width: "*",
- colSpan: "*",
- visible: false,
- defaultValue: _1.invalidDateMessage,
- cellStyle: this.errorStyle || "formCellError",
- endRow: true
- }])
- } else if (_30 == "time") {
- var _37 = isc.SelectItem.getInstanceProperty("textBoxStyle"),
- _38 = isc.SelectItem.getInstanceProperty("pickerIconWidth") + isc.Element.$tf(_37) + isc.Element.$tg(_37) + isc.Element.$yp(_37) + 4;
- _41 = isc.getValues(this.getTimeValues("hours")).join("<br>");
- var _39 = isc.Canvas.measureContent(_41, _37) + _38;
- _41 = isc.getValues(this.getTimeValues("minutes")).join("<br>");
- var _40 = isc.Canvas.measureContent(_41, _37) + _38;
- var _41 = isc.getValues(this.getTimeValues()).join("<br>");
- var _42 = isc.Canvas.measureContent(_41, _37) + _38;
- this.numCols = 5;
- this.setColWidths([this.titleWidth, _39, _40, _42, "*"]);
- _10.addList([{
- name: "startHours",
- title: _1.eventStartDateFieldTitle,
- type: "integer",
- width: _39,
- editorType: "select",
- valueMap: this.getTimeValues("hours")
- }, {
- name: "startMinutes",
- showTitle: false,
- type: "integer",
- width: _40,
- editorType: "select",
- valueMap: this.getTimeValues("minutes")
- }, {
- name: "startAMPM",
- showTitle: false,
- type: "select",
- width: _42,
- valueMap: this.getTimeValues(),
- endRow: true,
- showIf: function(_64) {
- return _64.form.creator.twentyFourHourTime ? "false" : "true"
- }
- }, {
- name: "invalidDate",
- type: "blurb",
- colSpan: 4,
- visible: false,
- defaultValue: _1.invalidDateMessage,
- cellStyle: this.errorStyle || "formCellError",
- endRow: true
- }]);
- if (_36) _10.addList(_31);
- _10.addList([{
- name: "endHours",
- type: "integer",
- width: "*",
- startRow: true,
- title: _1.eventEndDateFieldTitle,
- showTitle: !_36,
- editorType: "select",
- valueMap: this.getTimeValues("hours")
- }, {
- name: "endMinutes",
- showTitle: false,
- type: "integer",
- width: "*",
- editorType: "select",
- valueMap: this.getTimeValues("minutes")
- }, {
- name: "endAMPM",
- showTitle: false,
- type: "select",
- width: _42,
- valueMap: this.getTimeValues(),
- endRow: true,
- showIf: function(_64) {
- return _64.form.creator.twentyFourHourTime ? "false" : "true"
- }
- }])
- }
- _10.addList([{
- name: _1.nameField,
- title: _1.eventNameFieldTitle,
- type: "text",
- colSpan: "*",
- width: "*",
- startRow: true
- }, {
- name: _1.descriptionField,
- title: _1.eventDescriptionFieldTitle,
- type: "textArea",
- colSpan: "*",
- width: "*",
- height: 50,
- startRow: true
- }]);
- var _43 = isc.DataSource.create({
- addGlobalId: false,
- fields: _10
- });
- this.setDataSource(_43);
- var _44 = isc.shallowClone(_1.eventEditorFields);
- this.setFields(_44);
- this.$172z = true
- },
- getTimeValues: function(_65) {
- var _45 = {},
- _1 = this.creator;
- if (_65 == "hours") {
- var _46 = _1.twentyFourHourTime,
- _47 = _46 ? 24 : 12,
- _48 = _46 ? 0 : 1;
- for (var i = 0; i < _47; i++) {
- var _49 = (i + _48 < 10 ? "0" : "") + (i + _48);
- _45["" + (i + _48)] = _49
- }
- } else if (_65 == "minutes") {
- for (var i = 0; i < 60; i++) {
- var _50 = i < 10 ? "0" + i : "" + i;
- _45[i + ""] = _50
- }
- } else {
- _45["am"] = isc.Time.AMIndicator;
- _45["pm"] = isc.Time.PMIndicator
- }
- return _45
- },
- $642: ["startHours", "startMinutes", "startAMPM", "endHours", "endMinutes", "endAMPM"],
- getCustomValues: function() {
- if (!this.creator.eventEditorFields) return;
- var _1 = this.creator,
- _2 = this.$642;
- var _3 = this.creator.eventEditorFields;
- var _4 = {};
- for (var i = 0; i < _3.length; i++) {
- var _6 = _3[i];
- if (_6.name && !_2.contains(_6.name)) {
- _4[_6.name] = this.getValue(_6.name)
- }
- }
- return _4
- },
- setCustomValues: function(_65) {
- if (!this.creator.eventEditorFields) return;
- var _2 = this.$642;
- var _3 = this.creator.eventEditorFields;
- for (var i = 0; i < _3.length; i++) {
- var _6 = _3[i];
- if (_6.name && !_2.contains(_6.name)) {
- this.setValue(_6.name, _65[_6.name])
- }
- }
- }
- });
- this.eventEditorLayout = this.createAutoChild("eventEditorLayout", isc.addProperties({
- calendar: this,
- setDate: function(_65, _63, _66, _11, _23) {
- if (!_66) _66 = "";
- if (!_63) {
- _63 = isc.DateUtil.dateAdd(_65.duplicate(), "h")
- }
- var _1 = this.creator;
- this.setTitle(_1.$53k(_65, _63));
- this.currentStart = _65;
- this.currentEnd = _63;
- var _30 = _1.getDateEditingStyle(),
- _51 = this.items[0];
- if (_30 == "date" || _30 == "datetime") {
- _51.setValue(_1.startDateField, _65.duplicate());
- _51.setValue(_1.endDateField, _63.duplicate())
- } else if (_30 == "time") {
- var _52 = _1.twentyFourHourTime ? "toShortPadded24HourTime" : _1.timeFormatter,
- _53 = isc.Time.toTime(_65, _52, true),
- _54 = isc.Time.toTime(_63, _52, true);
- _51.setValue("startHours", parseInt(_53.substring(0, _53.indexOf(":"))));
- _51.setValue("endHours", parseInt(_54.substring(0, _54.indexOf(":"))));
- _51.setValue("startMinutes", parseInt(_53.substring(_53.indexOf(":") + 1, _53.indexOf(":") + 3)));
- _51.setValue("endMinutes", parseInt(_54.substring(_54.indexOf(":") + 1, _54.indexOf(":") + 3)));
- if (!_1.twentyFourHourTime) {
- _51.setValue("startAMPM", this.getAMPM(_65.getHours()));
- _51.setValue("endAMPM", this.getAMPM(_63.getHours()))
- }
- }
- },
- getHours: function(_65) {
- if (this.creator.twentyFourHourTime) return _65;
- else return this.creator.$53n(_65)
- },
- getAMPM: function(_65) {
- if (_65 < 12) return "am";
- else return "pm"
- },
- createButtonLayout: function() {
- this.buttonLayout = this.calendar.createAutoChild("eventEditorButtonLayout");
- this.saveButton = this.calendar.createAutoChild("saveButton", {
- title: this.calendar.saveButtonTitle,
- calendar: this.calendar
- });
- this.removeButton = this.calendar.createAutoChild("removeButton", {
- title: this.calendar.removeButtonTitle,
- calendar: this.calendar
- });
- this.cancelButton = this.calendar.createAutoChild("cancelButton", {
- title: this.calendar.cancelButtonTitle,
- calendar: this.calendar
- });
- this.buttonLayout.addMembers([this.saveButton, this.removeButton, this.cancelButton]);
- this.addItem(this.calendar.eventEditor);
- this.addItem(this.buttonLayout)
- },
- setEvent: function(_14) {
- if (!this.buttonLayout) {
- this.createButtonLayout()
- }
- var _51 = this.items[0],
- _1 = this.creator,
- _28 = this.view,
- _55 = _51.getItem(_1.laneNameField),
- _56 = _51.getItem(_1.sublaneNameField),
- _36 = _1.allowDurationEvents,
- _57 = _51.getItem("endType"),
- _58 = _51.getItem(_1.durationField),
- _59 = _51.getItem(_1.durationUnitField);
- if (!_1.twentyFourHourTime) {
- if (_51.getItem("startAMPM")) _51.showItem("startAMPM");
- if (_51.getItem("endAMPM")) _51.showItem("endAMPM")
- } else {
- if (_51.getItem("startAMPM")) _51.hideItem("startAMPM");
- if (_51.getItem("endAMPM")) _51.hideItem("endAMPM")
- }
- this.event = _14;
- if (_1.eventEditorFields) {
- _51.clearErrors(true);
- _51.setCustomValues(_14)
- }
- if (_55) {
- _55.setValueMap(_1.getLaneMap());
- _55.setValue(_14[_1.laneNameField]);
- _55.setDisabled(this.isNewEvent ? false : !_1.canEditEventLane(_14));
- var _60 = _28.isTimelineView() || (_28.isDayView() && _1.showDayLanes);
- if (_60) _55.show();
- else _55.hide()
- }
- if (_56) {
- _56.setValueMap(_1.getSublaneMap(_14[_1.laneNameField]));
- _56.setValue(_14[_1.sublaneNameField]);
- _56.setDisabled(this.isNewEvent ? false : !_1.canEditEventSublane(_14));
- var _60 = _1.useSublanes && (_28.isTimelineView() || (_28.isDayView() && _1.showDayLanes));
- if (_60) _56.show();
- else _56.hide()
- }
- if (_36) {
- var _61 = _14[_1.durationField],
- _62 = _14[_1.durationUnitField] || "minute";
- if (_61 != null) {
- _57.setValue(_1.eventDurationFieldTitle);
- _58.setValue(_61);
- _58.show();
- _59.setValue(_62);
- _59.show();
- if (_1.getDateEditingStyle() == "time") {
- if (_51.getField("endHours")) _51.hideField("endHours");
- if (_51.getField("endMinutes")) _51.hideField("endMinutes");
- if (_51.getField("endAMPM")) _51.hideField("endAMPM")
- } else {
- _51.hideField(_1.endDateField)
- }
- } else {
- _57.setValue(_1.eventEndDateFieldTitle);
- _58.hide();
- _59.hide();
- var _63 = _14[_1.endDateField];
- if (_1.getDateEditingStyle() == "time") {
- _51.showField("endHours");
- _51.setValue("endHours", _63.getHours());
- _51.showField("endMinutes");
- _51.setValue("endMinutes", _63.getMinutes())
- } else {
- _51.showField(_1.endDateField);
- _51.setValue(_1.endDateField, _63)
- }
- }
- }
- this.setDate(_1.getEventStartDate(_14), _1.getEventEndDate(_14));
- if (!_14[_1.nameField]) {
- _14[_1.nameField] = this.getDefaultItemValue(_1.nameField)
- }
- _51.setValue(_1.nameField, _14[_1.nameField]);
- if (!_14[_1.descriptionField]) {
- _14[_1.descriptionField] = this.getDefaultItemValue(_1.descriptionField)
- }
- _51.setValue(_1.descriptionField, _14[_1.descriptionField]);
- this.originalStart = isc.clone(this.currentStart);
- this.originalEnd = isc.clone(this.currentEnd);
- if (!this.isNewEvent && _1.canRemoveEvent(_14)) this.removeButton.show();
- else this.removeButton.hide()
- },
- getDefaultItemValue: function(_65) {
- var _51 = this.items[0],
- _64 = _51.getItem(_65);
- return _64 && _64.defaultValue
- },
- hide: function() {
- this.Super('hide');
- this.creator.clearViewSelection();
- this.creator.eventEditor.hideItem("invalidDate")
- },
- sizeMe: function() {
- this.setWidth(this.creator.mainView.getVisibleWidth());
- this.setHeight(this.creator.mainView.getVisibleHeight());
- this.setLeft(this.creator.mainView.getLeft())
- },
- draw: function() {
- var _51 = this.items && this.items[0];
- if (_51 && !_51.$172z) _51.rebuildFieldList();
- this.Super("draw", arguments)
- }
- }, this.eventEditorLayoutProperties));
- this.eventEditorLayout.addItem(this.eventEditor)
- }, isc.A.measureText = function isc_Calendar_measureText(_1, _2) {
- var _3 = isc.Label.create({
- ID: "$1674",
- autoDraw: true,
- backgroundColor: "red",
- top: -1000,
- height: 20,
- width: 1,
- wrap: false,
- autoFit: true
- });
- _3.setContents("<span style='overflow:visible;white-space:nowrap;'>" + _1 + "</span>")
- _3.redraw();
- _3.show();
- _3.bringToFront();
- var _4 = _3.getVisibleWidth();
- _3.hide();
- _3.destroy();
- _3 = null;
- return _4
- }, isc.A.hideEventDialog = function isc_Calendar_hideEventDialog() {
- this.eventDialog.hide()
- }, isc.A.displayEventDialog = function isc_Calendar_displayEventDialog() {
- this.eventDialog.show()
- }, isc.A.addEventOrUpdateEventFields = function isc_Calendar_addEventOrUpdateEventFields() {
- var _1 = this,
- _2 = _1.eventEditorLayout.isNewEvent,
- _3 = _1.eventEditorLayout.event,
- _4 = _1.eventEditor,
- _5 = _1.getDateEditingStyle(),
- _6 = _4.getValues(),
- _7 = _1.isTimeline() || (_1.dayViewSelected() && _1.showDayLanes) && _1.canEditLane,
- _8 = _7 ? _6[_1.laneNameField] : null,
- _9 = _7 && _1.useSublanes ? _6[_1.sublaneNameField] : null,
- _10 = _6["endType"] == this.eventDurationFieldTitle,
- _11 = _10 ? _6[this.durationField] || 1 : null,
- _12 = _10 ? _6[this.durationUnitField] || (_5 == "time" ? "minute" : "hour") : null;
- var _13 = isc.addProperties({}, _3, {
- eventLength: null
- });
- _13[this.nameField] = _6[this.nameField];
- _13[this.descriptionField] = _6[this.descriptionField];
- if (_8) _13[this.laneNameField] = _8;
- if (_9) _13[this.sublaneNameField] = _9;
- if (_5 == "date" || _5 == "datetime") {
- var _14 = _6[this.startDateField],
- _15 = !_10 ? _6[this.endDateField] : null;
- if (!_10 && _15 < _14) {
- _4.showItem("invalidDate");
- return false
- }
- if (!_4.validate()) return false;
- _13[_1.startDateField] = _14;
- _13.isDuration = _10;
- if (_10) {
- _13[_1.durationField] = _11;
- _13[_1.durationUnitField] = _12;
- delete _13[_1.endDateField]
- } else {
- _13[_1.endDateField] = _15;
- delete _13[_1.durationField];
- delete _13[_1.durationUnitField]
- }
- _1.eventEditorLayout.currentStart = _14;
- _1.eventEditorLayout.currentEnd = _1.getEventEndDate(_13);
- _1.eventEditorLayout.hide();
- _1.$1116 = true
- } else if (_5 == "time") {
- var _16 = _6["startAMPM"],
- _17 = _1.$534(_6["startHours"], _16),
- _18 = _6["startMinutes"];
- var _19 = _1.eventEditorLayout.currentStart.duplicate();
- _19.setHours(_17);
- _19.setMinutes(_18);
- var _20 = _19.getTime(),
- _21 = isc.DateUtil.getEndOf(_19.duplicate(), "d");
- _13[_1.startDateField] = _19;
- if (_10) {
- var _22 = _21.getTime(),
- _23 = isc.DateUtil.convertPeriodUnit(_11, _12, "ms"),
- _24 = Math.min(_20 + _23, _22);
- if (_24 != _20 + _23) {
- _11 = isc.DateUtil.convertPeriodUnit(_24 - _20, "ms", _12);
- _11 = Math.round(_11)
- }
- _13[this.durationField] = _11;
- _13[this.durationUnitField] = _12
- } else {
- var _25 = _6["endHours"],
- _26 = _6["endMinutes"],
- _27;
- if (!_1.twentyFourHourTime) {
- _27 = _6["endAMPM"];
- _25 = _1.$534(_25, _27)
- }
- if ((_25 < _17 && _25 + _26 != 0) || (_25 == _17 && _26 <= _18)) {
- _4.showItem("invalidDate");
- return false
- }
- if (_25 == 0 && _26 == 0) _25 = 24;
- if (!_4.validate()) return false;
- var _28 = _19.duplicate();
- _28.setHours(_25);
- _28.setMinutes(_26);
- if (_28.getTime() > _21.getTime()) {
- _28 = _21.duplicate()
- }
- if (isc.DateUtil.compareDates(_19, _28) == 0) {
- _4.showItem("invalidDate");
- return false
- }
- _13[_1.endDateField] = _28;
- _1.$1116 = true
- }
- }
- var _29 = isc.addProperties({}, _4.getCustomValues());
- _1.eventEditorLayout.hide();
- if (!_2) {
- _1.updateCalendarEvent(_3, _13, _29)
- } else {
- _1.addCalendarEvent(_13, _29, false)
- }
- return true
- }, isc.A.setDateLabel = function isc_Calendar_setDateLabel() {
- if (!this.dateLabel) return;
- var _1 = "",
- _2 = this.chosenDate,
- _3 = null,
- _4 = this.getCurrentViewName();
- if (_4 == "day") {} else if (_4 == "week") {
- var _5 = this.$656();
- _2 = _5[0];
- _3 = _5[1]
- } else if (_4 == "month") {
- _2 = isc.DateUtil.getStartOf(_2, "M");
- _3 = isc.DateUtil.getEndOf(_2, "M")
- } else if (_4 == "timeline") {
- var _6 = this.timelineView;
- _2 = _6.startDate;
- _3 = _6.endDate
- }
- _1 = this.getDateLabelText(_4, _2, _3);
- this.dateLabel.setContents(_1)
- });
- isc.evalBoundary;
- isc.B.push(isc.A.getDateLabelText = function isc_Calendar_getDateLabelText(_1, _2, _3) {
- var _4 = (_1 ? this.getView(_1) : null) || this.getSelectedView();
- if (isc.Time.$854) {
- _2 = isc.DateUtil.$179o(_2);
- _3 = isc.DateUtil.$179o(_3)
- }
- var _5 = _4 && _4.getDateLabelText(_2, _3)
- return _5 || ""
- }, isc.A.$656 = function isc_Calendar__getWeekRange() {
- var _1 = this.chosenWeekStart.duplicate();
- var _2 = this.chosenWeekEnd.duplicate();
- if (!this.showWeekends) {
- var _3 = this.getWeekendDays();
- var _4 = 7 - _3.length;
- while (_3.contains(_1.getDay())) {
- _1.setDate(_1.getDate() + 1)
- }
- var _5 = 0,
- _6 = _1.duplicate();
- for (var i = 0; i < _4; i++) {
- if (_3.contains(_6.getDay())) _5++;
- _6.setDate(_6.getDate() + 1)
- }
- _2 = _1.duplicate();
- _2.setDate(_2.getDate() + (_4 - 1) + _5)
- }
- return [_1, _2]
- }, isc.A.dayViewSelected = function isc_Calendar_dayViewSelected() {
- if (this.mainView && !this.mainView.isA("TabSet")) return this.mainView.viewName == "day";
- else return this.$567 == "day"
- }, isc.A.weekViewSelected = function isc_Calendar_weekViewSelected() {
- if (this.mainView && !this.mainView.isA("TabSet")) return this.mainView.viewName == "week";
- else return this.$567 == "week"
- }, isc.A.monthViewSelected = function isc_Calendar_monthViewSelected() {
- if (this.mainView && !this.mainView.isA("TabSet")) return this.mainView.viewName == "month";
- else return this.$567 == "month"
- }, isc.A.timelineViewSelected = function isc_Calendar_timelineViewSelected() {
- if (this.mainView && !this.mainView.isA("TabSet")) return this.mainView.viewName == "timeline";
- else return this.$567 == "timeline"
- }, isc.A.cancelEditing = function isc_Calendar_cancelEditing() {
- var _1 = this.getSelectedView();
- if (_1 && _1.clearSelection) _1.clearSelection();
- if (this.eventDialog && this.eventDialog.isVisible()) {
- this.eventDialog.hide()
- }
- if (this.eventEditor && this.eventEditor.isVisible()) {
- this.eventEditor.hide()
- }
- }, isc.A.showEventDialog = function isc_Calendar_showEventDialog(_1, _2) {
- if (_2 == null) _2 = (_1 == null);
- this.$53l(_1, _2)
- }, isc.A.showNewEventDialog = function isc_Calendar_showNewEventDialog(_1) {
- _1 = _1 || {};
- this.showEventDialog(_1, true)
- }, isc.A.$53l = function isc_Calendar__showEventDialog(_1, _2) {
- _1 = _1 || {};
- var _3 = this.getEventStartDate(_1) || new Date(),
- _4 = this.getEventEndDate(_1),
- _5 = this.getSelectedView(),
- _6 = _5.isMonthView() ? null : _5.getCurrentEventCanvas(_1),
- _7, _8, _9, _10 = _5.body.getLeft(),
- _11 = _5.body.getTop(),
- _12 = this.eventDialog;
- if (!_6) {
- if (this.eventEditorLayout) {
- this.eventEditorLayout.event = _1;
- this.eventEditorLayout.isNewEvent = _2
- }
- _12.eventWindow = null;
- _12.event = _1;
- _12.isNewEvent = _2;
- _12.items[0].createFields();
- var _13 = _3,
- _14 = _4;
- _1[this.startDateField] = _13;
- if (_5.isMonthView()) {
- var _15 = new Date();
- _15 = _15.getHours();
- if (_15 > 22) _15 -= 1;
- _13.setHours(_15);
- _1[this.startDateField] = _13;
- _7 = _5.getEventRow();
- _8 = _5.getEventColumn();
- _14 = isc.DateUtil.dateAdd(_13.duplicate(), "h", 1)
- } else if (_5.isTimelineView()) {
- var _16 = this.timelineView;
- _7 = _16.getEventLaneIndex(_1);
- _8 = _16.getColFromDate(_13);
- _14 = _4 || this.getDateFromPoint(_16.getDateLeftOffset(_13) + _16.getColumnWidth(_8));
- _12.setLane(_1[this.laneNameField])
- } else {
- _7 = _3.getHours() * this.getRowsPerHour(_5);
- _7 += Math.floor(_3.getMinutes() / _5.getTimePerCell());
- if (this.showDayLanes && _5.isDayView()) {
- _8 = _5.getEventLaneIndex(_1)
- } else {
- _8 = _5.getColFromDate(_3)
- }
- _14 = _4 || this.getCellDate(_7, _8, _5)
- }
- _1[this.endDateField] = _14;
- _12.setEvent(_1)
- } else {
- if (_5.isTimelineView()) {
- _7 = _5.getEventLaneIndex(_1);
- _8 = _5.getColFromDate(_3)
- } else if (_5.isDayView() || _5.isWeekView()) {
- _7 = _3.getHours() * this.getRowsPerHour(_5);
- _7 += Math.floor(_3.getMinutes() / _5.getTimePerCell());
- _8 = _5.getColFromDate(_3, _1[this.laneNameField])
- }
- _12.eventWindow = _6;
- _12.isNewEvent = false;
- _12.items[0].createFields();
- _12.setEvent(_6.event);
- if (this.bringEventsToFront) _6.bringToFront()
- }
- var _17 = _5.body.getCellPageRect(_7, _8);
- var _18 = _17[1];
- if (_12.parentWidget) _12.deparent();
- _12.moveTo(0, -9999);
- _12.draw();
- var _19 = _12.getVisibleHeight();
- var _20 = this.getPageTop() + this.getHeight();
- if (_18 + _19 >= _20) {
- _18 = _20 - (_19 + 2)
- }
- _12.placeNear(_17[0], _18);
- _12.show();
- _12.bringToFront();
- return
- }, isc.A.visibilityChanged = function isc_Calendar_visibilityChanged(_1) {
- if (!_1 && this.eventDialog) this.eventDialog.hide()
- }, isc.A.showEventEditor = function isc_Calendar_showEventEditor(_1, _2) {
- if (_2 == null) _2 = (_1 == null);
- this.$53j(_1, _2)
- }, isc.A.showNewEventEditor = function isc_Calendar_showNewEventEditor(_1) {
- this.showEventEditor(_1, true)
- }, isc.A.$53j = function isc_Calendar__showEventEditor(_1, _2) {
- if (!this.eventEditorLayout.isDrawn()) {
- this.eventEditorLayout.setVisibility(isc.Canvas.INHERIT);
- this.eventEditorLayout.draw()
- }
- this.eventEditorLayout.setWidth(this.mainView.getVisibleWidth());
- this.eventEditorLayout.setHeight(this.mainView.getVisibleHeight());
- this.eventEditorLayout.setPageLeft(this.mainView.getPageLeft());
- this.eventEditorLayout.setPageTop(this.getPageTop());
- this.eventEditorLayout.isNewEvent = _2;
- this.eventEditorLayout.view = this.getSelectedView();
- if (_1) {
- this.eventEditorLayout.setEvent(_1)
- } else {
- this.eventEditor.clearValues();
- this.eventEditorLayout.setTitle(this.newEventEditorWindowTitle);
- if (this.eventDialog && this.eventDialog.isVisible()) {
- if (this.eventEditorFields) {
- this.eventEditorLayout.items[0].setCustomValues(this.eventDialog.items[0].getCustomValues())
- }
- var _3 = this.eventDialog.items[0].getValue(this.nameField);
- var _4 = this.eventDialog.items[0].getItem(this.laneNameField);
- var _5 = _4 ? _4.getValue() : null;
- var _6 = new Date();
- this.eventEditorLayout.setDate(_6, this.eventDialog.currentEnd, _3, _5)
- }
- }
- this.hideEventDialog();
- this.eventEditorLayout.show()
- }, isc.A.$53k = function isc_Calendar__getEventDialogTitle(_1, _2) {
- var _3 = isc.DateUtil.getShortDayNames(),
- _4 = isc.DateUtil.getShortMonthNames(),
- _5 = isc.Time.toTime(_1, this.timeFormatter, false),
- _6 = isc.Time.toTime(_2, this.timeFormatter, false),
- _7;
- if (this.isTimeline()) {
- var _8 = (isc.DateUtil.compareLogicalDates(_1, _2) != 0);
- if (_8) {
- _7 = _3[_1.getDay()] + ", " + _4[_1.getMonth()] + " " + _1.getDate() + ", " + _5 + " - " + _3[_2.getDay()] + ", " + _4[_2.getMonth()] + " " + _2.getDate() + ", " + _6;
- return _7
- }
- }
- var _9 = _5 + " - " + _6;
- return _3[_1.getDay()] + ", " + _4[_1.getMonth()] + " " + _1.getDate() + ", " + _9
- }, isc.A.$53n = function isc_Calendar__to12HrNotation(_1) {
- if (_1 == 0) return 12;
- else if (_1 < 13) return _1;
- else return _1 - 12
- }, isc.A.$534 = function isc_Calendar__to24HourNotation(_1, _2) {
- _1 = parseInt(_1);
- if (_2 == null) return _1;
- else if (_2.toLowerCase() == "am" && _1 == 12) {
- return 0
- } else if (_2.toLowerCase() == "pm" && _1 < 12) {
- return _1 + 12
- } else {
- return _1
- }
- }, isc.A.$116j = function isc_Calendar__getCellCSSText(_1, _2, _3, _4) {
- var _5 = this.getCellDate(_3, _4, _1);
- if (!_5) return null;
- var _6 = this.getDateCSSText ? this.getDateCSSText(_5, _3, _4, _1) : null;
- if (_6) return _6;
- if (this.todayBackgroundColor) {
- var _7 = isc.DateUtil.compareLogicalDates(_5, new Date());
- if ((_7 !== false && _7 == 0)) {
- return "background-color:" + this.todayBackgroundColor + ";"
- }
- }
- return null
- }, isc.A.getDateHeaderTitle = function isc_Calendar_getDateHeaderTitle(_1, _2, _3, _4) {
- return null
- }, isc.A.getCellDate = function isc_Calendar_getCellDate(_1, _2, _3) {
- _3 = _3 || this.getSelectedView();
- var _4;
- if (_1 == null && _2 == null) {
- _1 = _3.getEventRow();
- _2 = _3.getEventCol()
- }
- var _5 = _3.frozenFields ? _3.frozenFields.length : 0;
- if (_3.isDayView() || _3.isWeekView() || _3.isTimelineView()) {
- var _6 = _2 - _5;
- _4 = _6 >= 0 ? _3.getCellDate(_1, _6) : null
- } else if (_3.isMonthView()) {
- if (_2 >= _3.getFields().length)
- _2 = _3.getFields().length - 1;
- var _7 = _3.data.get(_1);
- var _8 = _3.getField(_2).$66b;
- if (_7 && _7["date" + _8] != null) {
- _4 = _7["date" + _8].duplicate();
- _4.setHours(0);
- _4.setMinutes(0);
- _4.setSeconds(0)
- }
- } else {
- return
- }
- return _4
- }, isc.A.getDateFromPoint = function isc_Calendar_getDateFromPoint(_1, _2, _3, _4) {
- _4 = _4 || this.getSelectedView();
- if (_3 == null) _3 = true;
- if (_4.getDateFromPoint) return _4.getDateFromPoint(_1, _2, null, _3);
- if (_1 == null && _2 == null) {
- _1 = _4.body.getOffsetX();
- _2 = _4.body.getOffsetY()
- }
- var _5 = _4.body.getEventColumn(_1),
- _6 = _4.body.getEventRow(_2),
- _7;
- if (_4.isMonthView()) {
- _7 = this.getCellDate(_6, _5, _4)
- } else {
- return
- }
- return _7
- }, isc.A.getLane = function isc_Calendar_getLane(_1, _2) {
- if (!_1) return null;
- _2 = _2 || this.getSelectedView();
- if (_2.getLane) return _2.getLane(_1);
- return null
- }, isc.A.getEventLane = function isc_Calendar_getEventLane(_1, _2) {
- if (!_1) return null;
- return this.getLane(_1[this.laneNameField], _2)
- }, isc.A.getSublane = function isc_Calendar_getSublane(_1, _2, _3) {
- if (!_1) return null;
- _3 = _3 || this.getSelectedView();
- if (_3.getSublane) return _3.getSublane(_1, _2);
- return null
- }, isc.A.getEventSublane = function isc_Calendar_getEventSublane(_1, _2) {
- if (!_1) return null;
- return this.getSublane(_1[this.laneNameField], _1[this.sublaneNameField], _2)
- }, isc.A.getLaneFromPoint = function isc_Calendar_getLaneFromPoint(_1, _2, _3) {
- _3 = _3 || this.getSelectedView();
- if (!_3.hasLanes()) return null;
- if (_3.getLaneFromPoint) return _3.getLaneFromPoint(_1, _2);
- return null
- }, isc.A.getSublaneFromPoint = function isc_Calendar_getSublaneFromPoint(_1, _2, _3) {
- _3 = _3 || this.getSelectedView();
- if (_3.getSublaneFromPoint) return _3.getSublaneFromPoint(_1, _2);
- return null
- }, isc.A.getDateLeftOffset = function isc_Calendar_getDateLeftOffset(_1, _2) {
- if (_2 && _2.getDateLeftOffset) return _2.getDateLeftOffset(_1)
- }, isc.A.currentViewChanged = function isc_Calendar_currentViewChanged(_1) {}, isc.A.getDayBodyHTML = function isc_Calendar_getDayBodyHTML(_1, _2, _3, _4, _5) {
- if (!_1 || !_2 || _2.length == 0) return "";
- var _6 = _3.monthView,
- _7 = _1.getDay(),
- _8 = _6.getRecord(_4),
- _9 = _6.getRowHeight(_8, _4),
- _10 = "",
- _11 = null,
- _12 = "";
- for (var i = 0; i < _2.length; i++) {
- if (i > 0) _10 += "<br>";
- _10 += "<nobr>" + _2[i].name + "</nobr>";
- var _14 = isc.Canvas.measureContent(_10, this.dayBodyBaseStyle, true);
- if (_14 >= _9) {
- _11 = i - 1;
- break
- }
- }
- if (_11 == null) _11 = _2.length;
- for (var i = 0; i < _11; i++) {
- var _15 = isc.Time.toTime(this.getEventStartDate(_2[i]), this.timeFormatter, true) + " ";
- if (!this.isPrinting && this.canEditEvent(_2[i])) {
- var _16 = "<a href='javascript:" + this.ID + ".monthViewEventClick(" + _4 + "," + _5 + "," + i + ");' class='" + this.calMonthEventLinkStyle + "'>";
- _12 += _16 + _15 + _2[i][this.nameField] + "</a><br/>"
- } else {
- _12 += _15 + _2[i][this.nameField] + "<br/>"
- }
- }
- if (_11 != _2.length && !this.isPrinting) {
- var _17 = "<a href='javascript:" + this.ID + ".monthMoreEventsLinkClick(" + _4 + "," + _5 + "," + _11 + ");' class='" + this.calMonthEventLinkStyle + "'>",
- _18 = this.monthMoreEventsLinkTitle,
- _19 = _18.evalDynamicString(this, {
- eventCount: (_2.length - 1 - i)
- });
- _12 += _17 + _19 + "</a><br/>"
- }
- return _12
- }, isc.A.monthViewEventClick = function isc_Calendar_monthViewEventClick(_1, _2, _3) {
- var _4 = this.monthView.getEvents(_1, _2);
- var _5 = _4[_3];
- if (this.eventClick(_5, "month")) this.showEventEditor(_5)
- }, isc.A.$167z = function isc_Calendar__getMonthMoreEventsMenu() {
- if (!this.monthMoreEventsMenu) {
- this.monthMoreEventsMenu = this.createAutoChild("monthMoreEventsMenu")
- }
- return this.monthMoreEventsMenu
- }, isc.A.monthMoreEventsLinkClick = function isc_Calendar_monthMoreEventsLinkClick(_1, _2, _3) {
- var _4 = this,
- _5 = this.monthView,
- _6 = _5 && _5.getEvents(_1, _2) || [],
- _7 = [];
- for (var i = _3; i < _6.length; i++) {
- var _9 = _6[i];
- _7.add({
- title: _9[this.nameField],
- enabled: this.canEditEvent(_9),
- event: _9,
- calendar: _4,
- click: function() {
- if (this.calendar.eventClick(this.event, "month")) {
- this.calendar.showEventEditor(this.event)
- }
- }
- })
- }
- var _10 = this.$167z();
- _10.setItems(_7);
- _10.positionContextMenu();
- _10.show()
- }, isc.A.getMonthViewHoverHTML = function isc_Calendar_getMonthViewHoverHTML(_1, _2) {
- if (_2 != null) {
- var _3 = "";
- var _4 = this.creator || this;
- for (var i = 0; i < _2.length; i++) {
- var _6 = isc.Time.toTime(_4.getEventStartDate(_2[i]), _4.timeFormatter, true);
- _3 += "<nobr>" + _6 + " " + _2[i][_4.nameField] + "<nobr/><br/>"
- }
- return _3
- }
- }, isc.A.getDayHeaderHTML = function isc_Calendar_getDayHeaderHTML(_1, _2, _3, _4, _5) {
- return _1.getDate()
- }, isc.A.dayBodyClick = function isc_Calendar_dayBodyClick(_1, _2, _3, _4, _5) {
- return true
- }, isc.A.dayHeaderClick = function isc_Calendar_dayHeaderClick(_1, _2, _3, _4, _5) {
- return true
- }, isc.A.eventClick = function isc_Calendar_eventClick(_1, _2) {
- return true
- }, isc.A.$129v = function isc_Calendar__eventCanvasClick(_1) {
- var _2 = _1.event,
- _3 = _1.calendarView,
- _4 = _3.isWeekView(),
- _5 = this.eventClick(_2, _3.viewName);
- if (this.bringEventsToFront) _1.bringToFront();
- if (_5) {
- if (!this.canEditEvent(_2)) return;
- this.clearViewSelection();
- if (!_3.isTimelineView()) {
- var _6 = this.getEventStartDate(_2);
- var _7 = (_3.frozenFields ? _3.frozenFields.length : 0);
- var _8 = _4 ? _6.getDay() - this.firstDayOfWeek + _7 : _7;
- if (_4 && this.showWeekends == false) _8--;
- var _9 = _6.getHours() * this.getRowsPerHour(_3)
- }
- this.showEventDialog(_2)
- }
- }, isc.A.eventRemoveClick = function isc_Calendar_eventRemoveClick(_1, _2) {
- return true
- }, isc.A.eventMoved = function isc_Calendar_eventMoved(_1, _2, _3) {
- return true
- }, isc.A.eventResized = function isc_Calendar_eventResized(_1, _2) {
- return true
- }, isc.A.timelineEventMoved = function isc_Calendar_timelineEventMoved(_1, _2, _3, _4) {
- return true
- }, isc.A.timelineEventResized = function isc_Calendar_timelineEventResized(_1, _2, _3) {
- return true
- }, isc.A.getValidSnapDate = function isc_Calendar_getValidSnapDate(_1, _2) {
- if (this.isTimeline()) {} else {
- var _3 = this.getSnapGapPixels();
- var _4 = ((_1.getHours() * 60) + _1.getMinutes()) % _3;
- var _5 = (_2.getHours() * 60) + _2.getMinutes();
- var _6 = Math.round((_5 - _4) / _3);
- var _7 = (_6 * _3) + _4;
- var _8 = Math.floor(_7 / 60),
- _9 = _7 % 60;
- _2.setHours(_8);
- _2.setMinutes(_9)
- }
- return _2
- }, isc.A.selectTab = function isc_Calendar_selectTab(_1) {
- if (this.mainView && this.mainView.isA("TabSet") && this.mainView.tabs.getLength() > _1) {
- this.mainView.selectTab(_1);
- this.refreshSelectedView();
- return true
- } else {
- return false
- }
- }, isc.A.parentResized = function isc_Calendar_parentResized() {
- this.Super('parentResized', arguments);
- if (this.eventEditorLayout.isVisible()) this.eventEditorLayout.sizeMe()
- }, isc.A.dateChanged = function isc_Calendar_dateChanged() {
- return true
- }, isc.A.getActiveDay = function isc_Calendar_getActiveDay() {
- var _1 = this.getActiveTime();
- if (_1) return _1.getDay()
- }, isc.A.getActiveTime = function isc_Calendar_getActiveTime() {
- var _1 = this.ns.EH,
- _2 = this.getSelectedView();
- var _3 = _2.getEventRow();
- var _4 = _2.getEventColumn();
- return this.getCellDate(_3, _4, _2)
- }, isc.A.setTimelineRange = function isc_Calendar_setTimelineRange(_1, _2, _3, _4, _5, _6, _7) {
- if (this.timelineView) this.timelineView.setTimelineRange(_1, _2, _3, _4, _5, _6);
- if (_7) this.fireCallback(_7)
- }, isc.A.setResolution = function isc_Calendar_setResolution(_1, _2, _3, _4, _5) {
- if (this.timelineView) {
- _4 = _4 || 1;
- if (_1 && _1.length > 0) {
- this.timelineGranularity = _1[_1.length - 1].unit
- }
- var _6 = _2;
- var _7 = isc.DateUtil.dateAdd(this.startDate.duplicate(), _6, _3, 1);
- var _8 = Math.round(isc.DateUtil.convertPeriodUnit(_3, _6, this.timelineGranularity));
- this.timelineView.setTimelineRange(this.startDate, _7, this.timelineGranularity, _8, _4, _1);
- this.eventEditor.rebuildFieldList()
- }
- if (_5) this.fireCallback(_5)
- }, isc.A.getEventLength = function isc_Calendar_getEventLength(_1, _2) {
- var _3 = _1.eventLength,
- _4 = isc.DateUtil;
- if (_3 == null) {
- _3 = _4.getPeriodLength(this.getEventStartDate(_1), this.getEventEndDate(_1));
- _1.eventLength = _3
- }
- if (_2) {
- return _4.convertPeriodUnit(_1.eventLength, "ms", _2)
- }
- return _1.eventLength
- }, isc.A.canEditEventLane = function isc_Calendar_canEditEventLane(_1, _2) {
- var _3 = _1[this.canEditLaneField] != null ? _1[this.canEditLaneField] : this.canEditLane != false;
- return _3
- }, isc.A.canEditEventSublane = function isc_Calendar_canEditEventSublane(_1, _2) {
- if (!this.useSublanes) return false;
- var _3 = _1[this.canEditSublaneField];
- if (_3 == null) _3 = (this.canEditSublane != false);
- return _3
- }, isc.A.eventRepositionMove = function isc_Calendar_eventRepositionMove(_1, _2, _3) {
- var _4 = this.getEventStartDate(_2),
- _5 = this.getEventEndDate(_2);
- if (this.shouldDisableDate(_4, _3) || this.shouldDisableDate(_5, _3)) {
- return false
- }
- return true
- }, isc.A.eventRepositionStop = function isc_Calendar_eventRepositionStop(_1, _2, _3, _4) {
- return true
- }, isc.A.eventResizeMove = function isc_Calendar_eventResizeMove(_1, _2, _3, _4) {
- var _5 = this.getEventStartDate(_2),
- _6 = this.getEventEndDate(_2);
- if (_5.getTime() == _6.getTime()) return false;
- _6.setTime(_6.getTime() - 1);
- if (((_4.$1172 || _4.$159n) && this.shouldDisableDate(_5, _3)) || ((_4.$131q || _4.$131g) && this.shouldDisableDate(_6, _3))) {
- return false
- }
- return true
- }, isc.A.eventResizeStop = function isc_Calendar_eventResizeStop(_1, _2, _3, _4) {
- return true
- }, isc.A.checkForOverlap = function isc_Calendar_checkForOverlap(_1, _2, _3, _4, _5, _6) {
- var _7 = {},
- _8 = this.startDateField,
- _9 = this.endDateField;
- _7[_8] = _4.duplicate();
- _7[_9] = _5.duplicate();
- _7[this.laneNameField] = _6;
- var _10 = this.data;
- if (_6) {
- _10 = this.getLaneEvents(_6, _1)
- }
- var _11 = _1.findOverlappingEvents(_3, _7, null, (_6 != null), _10);
- if (_11.length == 0) {
- return false
- } else if (_11.length > 1) {
- return true
- } else {
- var _12 = _11[0];
- if ((this.equalDatesOverlap == false ? _5 > _12[_8] : _5 >= _12[_8]) && _4 < _12[_8]) {
- _5 = _12[_8].duplicate();
- _4 = _5.duplicate();
- _4.setMinutes(_4.getMinutes() - this.getEventLength(_3, "minute"));
- return [_4, _5]
- } else if ((this.equalDatesOverlap == false ? _4 < _12[_9] : _4 <= _12[_9]) && _5 > _12[_9]) {
- _4 = _12[_9].duplicate();
- _5 = _4.duplicate();
- _5.setMinutes(_5.getMinutes() + this.getEventLength(_3, "minute"));
- return [_4, _5]
- } else {
- return true
- }
- }
- });
- isc.B._maxIndex = isc.C + 224;
- isc.A = isc.Calendar;
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.B.push(isc.A.$1833 = function isc_c_Calendar__getAsDisplayDate(_1) {
- if (!isc.Time.$854) {
- return new Date(_1.getFullYear(), _1.getMonth(), _1.getDate())
- }
- var _2 = _1.$68g(isc.Time.getUTCHoursDisplayOffset(_1), isc.Time.getUTCMinutesDisplayOffset(_1));
- return new Date(_2.getUTCFullYear(), _2.getUTCMonth(), _2.getUTCDate())
- });
- isc.B._maxIndex = isc.C + 1;
- isc.ClassFactory.defineClass("EventWindow", "Window");
- isc.EventWindow.changeDefaults("resizerDefaults", {
- overflow: "hidden",
- height: 6,
- snapTo: "B",
- canDragResize: true
- });
- isc.EventWindow.changeDefaults("headerDefaults", {
- layoutMargin: 0,
- layoutLeftMargin: 3,
- layoutRightMargin: 3
- });
- isc.A = isc.EventWindow.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.autoDraw = false;
- isc.A.minHeight = 5;
- isc.A.minWidth = 5;
- isc.A.showHover = true;
- isc.A.canHover = true;
- isc.A.hoverWidth = 200;
- isc.A.canDragResize = true;
- isc.A.canDragReposition = true;
- isc.A.resizeFrom = ["B"];
- isc.A.showShadow = false;
- isc.A.showEdges = false;
- isc.A.showHeaderBackground = false;
- isc.A.useBackMask = false;
- isc.A.keepInParentRect = true;
- isc.A.headerProperties = {
- padding: 0,
- margin: 0,
- height: 14
- };
- isc.A.closeButtonProperties = {
- height: 10,
- width: 10
- };
- isc.A.bodyColor = null;
- isc.A.showHeaderIcon = false;
- isc.A.showMinimizeButton = false;
- isc.A.showMaximimumButton = false;
- isc.A.showFooter = true;
- isc.A.baseStyle = "eventWindow";
- isc.A.dragAppearance = "none";
- isc.A.$125c = {
- overflow: "hidden",
- defaultLayoutAlign: "center",
- height: 7
- };
- isc.B.push(isc.A.initWidget = function isc_EventWindow_initWidget() {
- this.addProperties(this.creator.viewProps);
- this.addProperties(this.creator.gridProps);
- this.addProperties(this.creator.timelineViewProperties);
- this.descriptionText = this.event[this.calendar.descriptionField];
- this.showHeader = this.calendar.showEventHeaders;
- this.showBody = this.calendar.showEventDescriptions;
- this.footerProperties = isc.addProperties({
- dragTarget: this.eventDragTarget
- }, this.footerProperties, this.$125c);
- if (this.bodyConstructor == null) this.bodyConstructor = isc.HTMLFlow;
- if (this.calendar.showEventDescriptions != false) {
- this.bodyProperties = isc.addProperties({}, this.bodyProperties, {
- contents: this.descriptionText,
- valign: "top",
- overflow: "hidden"
- })
- }
- if (this.calendar.showEventBody == false) {
- this.showBody = false;
- this.showTitle = false
- }
- this.Super("initWidget", arguments);
- if (this.calendar.showEventDescriptions == false) {
- var _1 = isc.Label.create({
- autoDraw: true,
- border: "0px",
- padding: 3,
- height: 1,
- width: 1,
- backgroundColor: this.event.backgroundColor,
- textColor: this.event.textColor,
- setContents: function(_2) {
- this.$116k = _2;
- this.Super("setContents", arguments)
- },
- canHover: true,
- showHover: true,
- eventCanvas: this,
- getHoverHTML: function() {
- return this.eventCanvas.getHoverHTML()
- },
- redrawWithParent: true
- });
- _1.addMember = function(_2) {
- this.addChild(_2)
- };
- _1.addChild(this.resizer);
- this.addChild(_1);
- this.header = _1;
- this.$128l = _1;
- this.$77n = true
- }
- this.setEventStyle(this.baseStyle)
- }, isc.A.getEvent = function isc_EventWindow_getEvent() {
- return this.event
- }, isc.A.getCalendar = function isc_EventWindow_getCalendar() {
- return this.calendar
- }, isc.A.getCalendarView = function isc_EventWindow_getCalendarView() {
- return this.calendarView
- }, isc.A.setDragProperties = function isc_EventWindow_setDragProperties(_1, _2, _3) {
- this.canDragResize = _2 == null ? true : _2;
- if (_1 == null) _1 = true;
- this.dragTarget = _3;
- this.setCanDragReposition(_1, _3);
- if (this.canDragResize) {
- if (!this.resizer) this.makeFooter();
- else if (!this.resizer.isVisible()) this.resizer.show()
- } else {
- if (this.resizer && this.resizer.isVisible()) this.resizer.hide()
- }
- }, isc.A.setEventStyle = function isc_EventWindow_setEventStyle(_1, _2, _3) {
- _2 = _2 || this.headerStyle || _1 + "Header";
- _3 = _3 || this.bodyStyle || _1 + "Body";
- this.baseStyle = _1;
- this.styleName = _1;
- this.bodyStyle = _3;
- this.headerStyle = _2;
- this.setStyleName(_1);
- if (this.header) this.header.setStyleName(this.headerStyle);
- if (this.headerLabel) {
- this.headerLabel.setStyleName(this.headerStyle)
- } else {
- this.headerLabelProperties = isc.addProperties({}, this.headerLabelProperties, {
- styleName: this.headerStyle
- })
- }
- if (this.body) this.body.setStyleName(this.bodyStyle);
- if (this.$128l) this.$128l.setStyleName(this.bodyStyle)
- }, isc.A.mouseUp = function isc_EventWindow_mouseUp() {
- return isc.EH.STOP_BUBBLING
- }, isc.A.makeFooter = function isc_EventWindow_makeFooter() {
- if (!this.showFooter || this.canDragResize == false) return;
- var _1 = {
- dragTarget: this.dragTarget,
- styleName: this.baseStyle + "Resizer"
- };
- if (this.$77n) _1.snapTo = "B";
- this.resizer = this.createAutoChild("resizer", _1);
- if (this.$77n) {
- this.header.addChild(this.resizer)
- } else {
- this.addChild(this.resizer)
- }
- if (this.resizer) this.resizer.bringToFront()
- }, isc.A.setDescriptionText = function isc_EventWindow_setDescriptionText(_1) {
- _1 = _1 || "";
- if (this.calendar.getDescriptionText) {
- _1 = this.calendar.getDescriptionText(this.event)
- }
- if (this.body) {
- this.descriptionText = _1;
- this.body.setContents(_1)
- } else {
- this.descriptionText = _1;
- if (this.$734) {
- this.$734.setWidth("100%");
- this.$734.setContents(_1)
- } else if (this.calendar.showEventDescriptions == false) {
- this.$128l.setContents(_1);
- this.$128l.redraw()
- }
- }
- }, isc.A.click = function isc_EventWindow_click() {
- if (this.$53u) return;
- if (this.$67e) {
- this.$67e = null;
- return
- }
- var _1 = this.calendar;
- if (_1.bringEventsToFront) this.bringToFront();
- var _2 = _1.eventClick(this.event, this.$53i ? "week" : "day");
- if (_2) {
- if (!_1.canEditEvent(this.event)) return;
- _1.clearViewSelection();
- var _3 = (this.$53i && _1.weekView.isLabelCol(0) ? 1 : 0);
- var _4 = this.$53i ? _1.getEventStartDate(this.event).getDay() -
- _1.firstDayOfWeek + _3 : _3;
- if (this.$53i && _1.showWeekends == false) _4--;
- _1.showEventDialog(this.event)
- }
- }, isc.A.mouseDown = function isc_EventWindow_mouseDown() {
- if (this.dragTarget) this.dragTarget.eventCanvas = this;
- this.calendar.eventDialog.hide();
- return isc.EH.STOP_BUBBLING
- }, isc.A.renderEvent = function isc_EventWindow_renderEvent(_1, _2, _3, _4) {
- var _5 = this.calendar,
- _6 = this.event;
- if (isc.isA.Number(_3) && isc.isA.Number(_4)) {
- this.resizeTo(Math.round(_3), Math.round(_4))
- }
- if (isc.isA.Number(_1) && isc.isA.Number(_2)) {
- this.moveTo(Math.round(_2), Math.round(_1))
- }
- var _7 = _5.getEventHeaderHTML(_6, this.calendarView),
- _8 = _7,
- _9 = "";
- if (_6.headerBackgroundColor) _9 += "backgroundColor: " + _6.headerBackgroundColor + ";";
- if (_6.headerTextColor) _9 += "backgroundColor: " + _6.headerTextColor + ";";
- if (_6.headerBorderColor) _9 += "border-color: " + _6.headerBorderColor + ";";
- if (_9 != "") _8 = "<span style='" + _9 + "'>" + _8 + "<span>";
- this.setTitle(_8);
- this.updateColors(_7);
- if (this.$77n) {
- this.header.resizeTo(Math.round(_3), Math.round(_4));
- this.header.setContents(_8)
- }
- if (!this.isDrawn()) this.draw();
- this.show();
- this.bringToFront()
- }, isc.A.updateColors = function isc_EventWindow_updateColors(_1) {
- var _2 = this.calendar,
- _3 = this.event,
- _4 = this.header,
- _5 = _4 ? _4.getMember ? _4.getMember(0) : _4 : null,
- _6 = _5,
- _7 = _1 || _2.getEventHeaderHTML(_3, this.calendarView);
- if (!_3) return;
- if (_5 && _5.children && _5.children[0]) {
- var _8 = _5.children[0].members;
- if (_8 && _8.length > 0) _6 = _8[0]
- }
- if (_3.backgroundColor) {
- this.setBackgroundColor(_3.backgroundColor);
- if (this.body) this.body.setBackgroundColor(_3.backgroundColor)
- } else {
- this.backgroundColor = null;
- if (this.isDrawn() && this.getStyleHandle()) {
- this.getStyleHandle().backgroundColor = null
- }
- if (this.body) {
- this.body.backgroundColor = null;
- if (this.body.isDrawn() && this.body.getStyleHandle()) {
- this.body.getStyleHandle().backgroundColor = null
- }
- }
- if (_6) {
- _6.backgroundColor = null;
- if (_6.isDrawn() && _6.getStyleHandle()) {
- _6.getStyleHandle().backgroundColor = null
- }
- }
- }
- if (_3.textColor) {
- this.setTextColor(_3.textColor);
- if (this.body) {
- var _9 = "color:" + _3.textColor + ";"
- this.body.setTextColor(_3.textColor);
- this.body.setContents("<span style='" + _9 + "'>" + _3[_2.descriptionField] || "</span>")
- }
- } else {
- if (this.textColor) {
- this.setTextColor(null);
- if (this.isDrawn() && this.getStyleHandle()) {
- this.getStyleHandle().color = null
- }
- if (this.body) {
- this.body.setTextColor(null);
- this.body.setContents(_3[_2.descriptionField])
- }
- if (_6) {
- _6.setTextColor(null);
- _6.setContents(_7)
- }
- if (this.$128l) {
- this.$128l.setTextColor(null);
- this.$128l.setContents(_7)
- }
- }
- }
- if (this.header) {
- var _10, _11;
- if (_2.showEventDescriptions == false) {
- _10 = _3.backgroundColor;
- _11 = _3.textColor
- } else {
- _10 = _3.headerBackgroundColor;
- _11 = _3.headerTextColor
- }
- if (_10) {
- this.header.setBackgroundColor(_10);
- if (_6) _6.setBackgroundColor(_10)
- } else {
- this.header.backgroundColor = null;
- if (this.isDrawn() && this.header.getStyleHandle()) {
- this.header.getStyleHandle().backgroundColor = null
- }
- if (_6) {
- _6.backgroundColor = null;
- if (_6.getStyleHandle()) {
- _6.getStyleHandle().backgroundColor = null
- }
- }
- }
- if (_11) {
- this.header.setTextColor(_11);
- var _9 = "color:" + _11 + ";",
- _12 = _2.showEventDescriptions == false ? this.header.$116k : _7,
- _13 = "<span style='" + _9 + "'>" + _12 + "</span>";
- if (!_6) {
- if (this.header.setContents) this.header.setContents(_13)
- } else {
- _6.setTextColor(_11);
- _6.setContents(_13)
- }
- } else {
- if (this.header.textColor) {
- this.header.setTextColor(null);
- if (this.isDrawn() && this.header.getStyleHandle()) {
- this.header.getStyleHandle().color = null
- }
- if (_6) {
- _6.setTextColor(null);
- if (_6.isDrawn() && _6.getStyleHandle()) {
- _6.getStyleHandle().color = null
- }
- }
- }
- }
- this.markForRedraw()
- }
- }, isc.A.getPrintHTML = function isc_EventWindow_getPrintHTML(_1, _2) {
- var _3 = isc.StringBuffer.create(),
- _4 = this.calendar,
- _5 = _4.isTimeline(),
- _6 = this.parentElement,
- _7 = _6.grid,
- _8 = 40 + _7.getHeaderHeight(),
- _9 = this.getTop(),
- _10 = _6.getPageTop(),
- _11 = (_9) + _8 + 1,
- _12 = _6.$26a,
- _13 = _7.getLeft() + _6.getLeft() + (_7.getEventLeft ? _7.getEventLeft(this.event) : _4.getEventLeft(this.event, _7)),
- _14 = this.getVisibleWidth(),
- _15 = this.getVisibleHeight() - 2,
- i = (_1 && _1.i ? _1.i : 1);
- var _17 = _4.getEventStartCol(this.event, this, this.calendarView),
- _18 = _4.getEventEndCol(this.event, this, this.calendarView);
- if (_5) {
- _13 += (14 + ((_17 - 1) * 2));
- _14 += _18 - _17
- } else {
- _13 += _7.$53i ? 6 : 8
- }
- var _19 = _5 ? this.baseStyle : this.body.styleName;
- _3.append("<div class='", _19, "' ", "style='border: 1px solid grey; vertical-align: ", (_4.showEventDescriptions ? "top" : "middle"), "; ", (_5 ? "overflow:hidden; " : ""), "position: absolute; ", "left:", _13, "; top:", _11, "; width: ", _14, "; height: ", _15, "; ", "z-index:", i + 2, ";'>");
- if (_4.showEventDescriptions) {
- _3.append(this.title, "<br>", this.event[_4.descriptionField])
- } else {
- _3.append(this.title)
- }
- _3.append("</div>");
- var _20 = _3.release(false);
- return _20
- }, isc.A.getHoverHTML = function isc_EventWindow_getHoverHTML() {
- return this.calendar.$141h(this.event, this, this.calendarView)
- }, isc.A.closeClick = function isc_EventWindow_closeClick() {
- var _1 = this.calendar;
- if (_1.eventRemoveClick(this.event) == false) {
- this.$67e = true;
- return
- }
- this.Super("closeClick", arguments);
- this.calendar.removeEvent(this.event, true);
- this.$53u = true
- }, isc.A.parentResized = function isc_EventWindow_parentResized() {
- this.Super('parentResized', arguments);
- if (this.event) this.calendarView.sizeEventCanvas(this)
- }, isc.A.getEventLength = function isc_EventWindow_getEventLength() {
- return this.event.eventLength
- }, isc.A.show = function isc_EventWindow_show() {
- this.Super("show", arguments)
- }, isc.A.resized = function isc_EventWindow_resized() {
- if (this.$77n) {
- this.header.resizeTo(this.getVisibleWidth(), this.getVisibleHeight())
- }
- });
- isc.B._maxIndex = isc.C + 20;
- isc.ClassFactory.defineClass("TimelineWindow", "EventWindow");
- isc.A = isc.TimelineWindow.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.showFooter = false;
- isc.A.resizeFrom = ["L", "R"];
- isc.A.dragAppearance = "none";
- isc.B.push(isc.A.initWidget = function isc_TimelineWindow_initWidget() {
- if (this.calendar.showEventWindowHeader == false) {
- this.showBody = false;
- this.showTitle = false
- }
- this.Super("initWidget", arguments)
- }, isc.A.draw = function isc_TimelineWindow_draw(_1, _2, _3, _4) {
- this.invokeSuper(isc.TimelineWindow, "draw", _1, _2, _3, _4);
- if (this.calendar.showEventWindowHeader == false) {
- var _5 = isc.Canvas.create({
- autoDraw: false,
- width: "100%",
- height: 0,
- top: 0,
- contents: (this.descriptionText ? this.descriptionText : " "),
- backgroundColor: this.event.backgroundColor,
- textColor: this.event.textColor
- });
- if (this.body) this.body.addMember(_5);
- else this.addMember(_5);
- _5.setHeight("100%");
- this.$734 = _5
- }
- }, isc.A.click = function isc_TimelineWindow_click() {
- var _1 = this.calendar,
- _2 = _1.timelineView,
- _3 = _1.eventClick(this.event, "timeline");
- if (_3) {
- if (!_1.canEditEvent(this.event)) return;
- _1.showEventDialog(this.event)
- } else return isc.EH.STOP_BUBBLING
- }, isc.A.destroyLines = function isc_TimelineWindow_destroyLines() {
- if (this.$645) {
- if (this.$645[0]) this.$645[0].destroy();
- if (this.$645[1]) this.$645[1].destroy();
- if (this.$645[2]) this.$645[2].destroy();
- if (this.$645[3]) this.$645[3].destroy()
- }
- }, isc.A.hideLines = function isc_TimelineWindow_hideLines() {
- if (this.$645) {
- if (this.$645[0]) this.$645[0].hide();
- if (this.$645[1]) this.$645[1].hide();
- if (this.$645[2]) this.$645[2].hide();
- if (this.$645[3]) this.$645[3].hide()
- }
- }, isc.A.showLines = function isc_TimelineWindow_showLines() {
- if (this.$645) {
- if (this.$645[0]) this.$645[0].show();
- if (this.$645[1]) this.$645[1].show();
- if (this.$645[2]) this.$645[2].show();
- if (this.$645[3]) this.$645[3].show()
- }
- });
- isc.B._maxIndex = isc.C + 6;
- isc.Calendar.registerStringMethods({
- getDayBodyHTML: "date,events,calendar,rowNum,colNum",
- getDayHeaderHTML: "date,events,calendar,rowNum,colNum",
- dayBodyClick: "date,events,calendar,rowNum,colNum",
- dayHeaderClick: "date,events,calendar,rowNum,colNum",
- eventClick: "event,viewName",
- eventChanged: "event",
- eventMoved: "newDate,event",
- eventResized: "newDate,event",
- backgroundClick: "startDate,endDate",
- backgroundMouseDown: "startDate",
- backgroundMouseUp: "startDate,endDate"
- });
- isc.defineClass("EventCanvas", "VLayout");
- isc.A = isc.EventCanvas;
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.headerSizer = null;
- isc.B.push(isc.A.getHeaderHeight = function isc_c_EventCanvas_getHeaderHeight(_1, _2, _3, _4, _5) {
- var _6 = isc.EventCanvas;
- if (!_6.headerSizer) {
- _6.headerSizer = isc.Canvas.create({
- ID: "$151s",
- autoDraw: false,
- visibility: "hidden",
- left: 0,
- top: -1000
- })
- }
- _6.headerSizer.setProperties({
- height: _4 ? 1 : _3,
- maxHeight: _4 ? null : _3,
- width: _2,
- maxWidth: _2,
- overflow: _4 ? "visible" : "hidden",
- contents: _1,
- styleName: _5.getHeaderStyle()
- });
- if (!_6.headerSizer.isDrawn()) _6.headerSizer.draw();
- else _6.headerSizer.redraw();
- var _7 = _6.headerSizer.getVisibleHeight();
- _6.headerSizer.hide();
- _6.headerSizer.clear();
- return _7
- });
- isc.B._maxIndex = isc.C + 1;
- isc.A = isc.EventCanvas.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.visibility = "hidden";
- isc.A.autoDraw = false;
- isc.A.overflow = "hidden";
- isc.A.minHeight = 1;
- isc.A.minWidth = 1;
- isc.A.showHover = true;
- isc.A.canHover = true;
- isc.A.hoverMoveWithMouse = true;
- isc.A.hoverWidth = 200;
- isc.A.snapToGrid = false;
- isc.A.keepInParentRect = true;
- isc.A.dragAppearance = "none";
- isc.A.canDragResize = true;
- isc.A.canDragReposition = true;
- isc.A.$142u = null;
- isc.A.labelOffsetX = 0;
- isc.A.labelOffsetY = 0;
- isc.A.titleOrientation = "top";
- isc.A.maxLabelWidth = 150;
- isc.A.isEventCanvas = true;
- isc.A.padding = null;
- isc.A.bodyHeight = "auto";
- isc.A.divTemplate = ["<div class='", , "' style='", , "'>", , "</div>"];
- isc.A.showContextButton = false;
- isc.A.showRolloverControls = true;
- isc.A.$174j = ["closeButton", "contextButton"];
- isc.B.push(isc.A.getShowHeader = function isc_EventCanvas_getShowHeader() {
- if (this.showHeader != null) return this.showHeader;
- return this.calendar.showEventHeaders
- }, isc.A.getShowBody = function isc_EventCanvas_getShowBody() {
- if (this.showBody != null) return this.showBody;
- return this.calendar.showEventDescriptions
- }, isc.A.initWidget = function isc_EventCanvas_initWidget() {
- if (this.vertical == null) this.vertical = this.calendarView.verticalEvents;
- this.resizeFrom = [];
- this.hoverDelay = this.calendar.hoverDelay + 1;
- if (this.useStaticControls == null) {
- this.useStaticControls = (this.calendar.useEventCanvasRolloverControls == false)
- }
- if (this.canFocus == null) this.canFocus = this.calendar.canSelectEvents;
- this.Super("initWidget", arguments);
- if (this.shouldShowGripper()) this.createGripper();
- if (this.shouldShowLabel()) this.createLabel();
- if (this.$142u == null && !this.calendarView.shouldShowEventHovers()) {}
- this.updateShowHovers()
- }, isc.A.updateShowHovers = function isc_EventCanvas_updateShowHovers() {
- if (this.$142u) this.eventProxy = this.calendarView
- }, isc.A.shouldShowGripper = function isc_EventCanvas_shouldShowGripper() {
- var _1 = this.calendar;
- if (!this.event || !_1.canEditEvent(this.event) || !_1.canDragEvent(this.event)) {
- return false
- }
- if (this.showGripper != null) return this.showGripper;
- if (this.calendar.isZeroLengthEvent(this.event)) return true;
- return false
- }, isc.A.createGripper = function isc_EventCanvas_createGripper() {
- if (this.gripper) return;
- var _1 = {
- canDrag: true,
- dragTarget: this.dragTarget,
- eventProxy: this,
- eventCanvas: this,
- canDragResize: false,
- styleName: this.gripperStyle || this.styleName + "Gripper"
- };
- this.gripper = this.calendar.getEventCanvasGripper(_1, this, this.calendarView)
- }, isc.A.shouldShowLabel = function isc_EventCanvas_shouldShowLabel() {
- if (!this.event) return false;
- if (this.showLabel != null) return this.showLabel;
- if (this.calendar.isZeroLengthEvent(this.event)) return true;
- return false
- }, isc.A.createLabel = function isc_EventCanvas_createLabel() {
- if (this.label) return;
- var _1 = {
- canDrag: false,
- eventCanvas: this,
- canDragResize: false,
- canHover: true,
- showHover: true,
- showOver: false,
- showRollOver: false,
- margin: 3,
- styleName: this.labelStyle || this.styleName + "Gripper",
- contents: this.getHeaderHTML(),
- getHoverHTML: function() {
- return this.eventCanvas.getHoverHTML()
- }
- };
- this.label = this.calendar.getEventCanvasLabel(_1, this.calendarView)
- }, isc.A.parentScrolled = function isc_EventCanvas_parentScrolled() {
- if (this.gripper || this.label) this.repositionPeers()
- }, isc.A.redraw = function isc_EventCanvas_redraw() {
- this.Super("redraw", arguments);
- if (this.gripper || this.label) this.repositionPeers()
- }, isc.A.hide = function isc_EventCanvas_hide() {
- this.Super("hide", arguments);
- if (this.gripper) this.gripper.hide();
- if (this.label) this.label.hide()
- }, isc.A.repositionPeers = function isc_EventCanvas_repositionPeers(_1) {
- if (!this.gripper && !this.label) return;
- var _2 = this.calendarView,
- _3 = _2.body,
- _4 = this.shouldShowLabel(),
- _5 = this.shouldShowGripper();
- var _6 = _3.getLeft(),
- _7 = _3.getScrollLeft(),
- _8 = _3.getVisibleWidth(),
- _9 = this.isDrawn() ? this.getWidth() : _2.$732(this.event),
- _10 = this.getLeft() + Math.floor(_9 / 2);
- if (_10 < _7 || _10 > _7 + _8) {
- if (this.gripper && this.gripper.isVisible()) this.gripper.hide();
- if (this.label && this.label.isVisible()) this.label.hide();
- return
- }
- var _11 = _3.getTop(),
- _12 = _3.getScrollTop(),
- _13 = _3.getViewportHeight(),
- _14 = this.getTop(),
- _15 = this.getHeight(),
- _16 = _14 + _15,
- _17 = false,
- _18 = false;
- if (_14 < _12 || _14 > _12 + _13) _17 = true;
- if (_16 < _12 || _16 > _12 + _13 + 1) _18 = true;
- if (this.gripper) {
- if (_17 || !_5) this.gripper.hide();
- else {
- var _19 = _10 + _6 - _7,
- _20 = _2.header.getHeight() + _14 - _12;
- if (!_1 && this.isDrawn() && !this.gripper.isDrawn()) this.gripper.draw();
- _19 = Math.floor(_19 - Math.floor(this.gripper.getVisibleWidth() / 2));
- _20 = Math.floor(_20 - (this.gripper.getVisibleHeight() / 2));
- this.gripper.moveTo(_19, _20);
- if (!_1 && this.isDrawn() && !this.gripper.isVisible()) {
- this.gripper.show();
- this.gripper.bringToFront()
- }
- }
- }
- if (this.label) {
- if (_18 || !_4) {
- this.label.hide()
- } else {
- var _19 = _10 + _6 - _7,
- _20 = _2.header.getHeight() + _16 - _12,
- _21 = this.getHeaderHTML(),
- _22 = isc.EventCanvas.getHeaderHeight(_21, (this.maxLabelWidth || _9), this.headerHeight, this.getHeaderWrap(), this);
- this.label.setContents(_21);
- if (!_1 && this.isDrawn() && !this.label.isDrawn()) this.label.draw();
- _19 = Math.floor(_19 - Math.floor(this.label.getVisibleWidth() / 2));
- _20 = Math.floor(_20 - (_22 / 2));
- this.label.moveTo(_19, _20);
- if (!_1 && this.isDrawn() && !this.label.isVisible()) {
- this.label.show();
- this.label.bringToFront()
- }
- }
- }
- }, isc.A.setEvent = function isc_EventCanvas_setEvent(_1, _2, _3, _4) {
- var _5 = this.calendar,
- _6 = this.calendarView;
- var _7 = this.$172w(_1, _2, _3, _4);
- this.canDragReposition = _7.canDragMove;
- this.canDragResize = _7.canDragResize;
- this.resizeFrom = [];
- if (_7.canDragResize) {
- if (_7.canDragStartDate) {
- if (!this.vertical) this.resizeFrom.add("L")
- }
- if (_7.canDragEndDate) {
- if (!this.vertical) this.resizeFrom.add("R");
- else this.resizeFrom.add("B")
- }
- }
- if (this.shouldShowGripper()) this.createGripper();
- else if (this.gripper) this.gripper.hide();
- if (this.shouldShowLabel()) this.createLabel();
- else if (this.label) this.label.hide();
- this.setEventStyle(_7.eventStyleName, _3, _4)
- }, isc.A.$172x = function isc_EventCanvas__getCacheValue(_1) {
- return this.$172y && this.$172y[_1]
- }, isc.A.$172w = function isc_EventCanvas__updateValueCache(_1, _2, _3, _4) {
- this.$172y = {};
- this.event = _1;
- if (this.event) {
- var _5 = this.calendar,
- _6 = this.calendarView,
- _7 = this.$172y,
- _8 = _5.canEditEvent(_1),
- _9 = _5.canDragEvent(_1),
- _10 = _5.canResizeEvent(_1),
- _11 = _5.canRemoveEvent(_1);
- _7.eventStartDate = _5.getEventStartDate(_1).getTime();
- _7.eventEndDate = _5.getEventEndDate(_1).getTime();
- _7.eventStyleName = _5.getEventCanvasStyle(_1, _6);
- _7.eventLane = _1[_5.laneNameField];
- var _6 = this.calendarView;
- _7.viewStartDate = _5.getPeriodStartDate(_6).getTime();
- _7.viewEndDate = _5.getPeriodEndDate(_6).getTime();
- _7.canEdit = _8;
- _7.canDrag = _9;
- _7.canDragMove = _9;
- _7.canDragResize = _10;
- _7.canDragStartDate = _7.canDragResize && _7.eventStartDate >= _7.viewStartDate;
- if (_6.verticalEvents) _7.canDragStartDate = false;
- _7.canDragEndDate = _7.canDragResize && _7.eventEndDate && _7.eventEndDate <= _7.viewEndDate;
- _7.showCloseButton = _11
- }
- return this.$172y
- }, isc.A.createRolloverControls = function isc_EventCanvas_createRolloverControls() {
- return this.calendar.$174c(this)
- }, isc.A.updateRolloverControls = function isc_EventCanvas_updateRolloverControls(_1) {
- var _2 = this.calendar,
- c = this.$174h || this.$174f || this.$129e;
- if (!c) {
- if (this.useStaticControls) this.$174h = this.createRolloverControls();
- else if (this.isFocused()) this.$174f = _2.$174e();
- else if (_1) this.$129e = _2.$174d();
- c = this.$174h || this.$174f || this.$129e
- }
- if (!c) return;
- for (var _4 in c) {
- c[_4].eventCanvas = this;
- this[_4] = c[_4]
- }
- if (this.closeButton) this.closeButton.canFocus = false;
- if (this.buttonLayout) {
- this.buttonLayout.canFocus = false;
- this.addChild(this.buttonLayout)
- }
- if (this.vertical) {
- this.startResizer = null;
- this.endResizer = this.endResizerB
- } else {
- this.startResizer = this.startResizerL;
- this.endResizer = this.endResizerR
- }
- if (this.startResizer) {
- this.startResizer.dragTarget = this.dragTarget;
- this.addChild(this.startResizer)
- }
- if (this.endResizer) {
- this.endResizer.dragTarget = this.dragTarget;
- this.addChild(this.endResizer)
- }
- var _5 = this.$172y || {};
- this.buttonLayout.show();
- if (this.closeButton) {
- if (!_5.showCloseButton) this.closeButton.hide();
- else this.closeButton.show()
- }
- if (this.contextButton) {
- if (!this.shouldShowContextButton()) this.contextButton.hide()
- else {
- var _6 = this.calendar.getEventCanvasMenuItems(this, this.calendarView);
- if (_6) this.contextButton.show();
- else this.contextButton.hide()
- }
- }
- if (this.startResizer) {
- if (!_5.canDragStartDate) this.startResizer.hide();
- else this.startResizer.show()
- }
- if (this.endResizer) {
- if (!_5.canDragEndDate) this.endResizer.hide();
- else this.endResizer.show()
- }
- }, isc.A.setDragProperties = function isc_EventCanvas_setDragProperties(_1, _2, _3) {
- this.canDragReposition = _1 == null ? true : _1;
- this.canDragResize = _2 == null ? true : _2;
- this.dragTarget = _3
- }, isc.A.setEventStyle = function isc_EventCanvas_setEventStyle(_1, _2, _3) {
- _2 = _2 || this.headerStyle || (_1 + "Header");
- _3 = _3 || this.bodyStyle || (_1 + "Body");
- this.baseStyle = _1;
- this.styleName = _1;
- this.$129w = _3;
- this.$7m = _2;
- if (this.gripper) {
- this.gripper.setStyleName(this.gripperStyle || _1 + "Gripper")
- }
- if (this.label) this.label.setStyleName(this.labelStyle || _1 + "Label");
- if (this.$172y) delete this.$172y.$184b;
- this.setStyleName(null);
- this.setStyleName(_1)
- }, isc.A.getStartDate = function isc_EventCanvas_getStartDate() {
- return this.$172x("eventStartDate") || this.calendar.getEventStartDate(this.event)
- }, isc.A.getEndDate = function isc_EventCanvas_getEndDate() {
- return this.$172x("eventEndDate") || this.calendar.getEventEndDate(this.event)
- }, isc.A.getDuration = function isc_EventCanvas_getDuration() {
- return this.event[this.calendar.durationField]
- }, isc.A.getEventLength = function isc_EventCanvas_getEventLength(_1) {
- if (this.event.eventLength) return this.event.eventLength;
- return this.calendar.getEventLength(this.event, _1 || "minute")
- }, isc.A.isZeroLengthEvent = function isc_EventCanvas_isZeroLengthEvent() {
- return this.calendar.isZeroLengthEvent(this.event)
- }, isc.A.getHeaderWrap = function isc_EventCanvas_getHeaderWrap() {
- if (this.headerWrap != null) return this.headerWrap;
- return this.calendar.eventHeaderWrap
- }, isc.A.getHeaderHeight = function isc_EventCanvas_getHeaderHeight(_1) {
- var _2 = this.$172x("$963");
- if (!_2) {
- if (_1 || this.getShowBody()) {
- var _3 = this.$151t(),
- _4 = this.isDrawn() || !this.calendarView.isTimelineView() ? this.getWidth() : this.calendarView.$732(this.event),
- _5 = _4 - (this.calendar.getLanePadding() * 2);
- var _6 = isc.EventCanvas.getHeaderHeight(this.getHeaderHTML(), _5, _3, this.getHeaderWrap(), this);
- _2 = _6
- } else {
- _2 = this.getInnerHeight()
- }
- if (this.$172y) this.$172y.$963 = _2
- }
- return _2
- }, isc.A.$151t = function isc_EventCanvas__getDefinedHeaderHeight() {
- return this.headerHeight != null ? this.headerHeight : this.calendar.eventHeaderHeight
- }, isc.A.getHeaderStyle = function isc_EventCanvas_getHeaderStyle() {
- return this.$7m
- }, isc.A.getHeaderHTML = function isc_EventCanvas_getHeaderHTML() {
- if (!this.event) {
- return "No event"
- }
- return this.calendar.getEventHeaderHTML(this.event, this.calendarView)
- }, isc.A.getHeaderCSSText = function isc_EventCanvas_getHeaderCSSText(_1) {
- var _2 = this.event,
- _3 = isc.StringBuffer.create();
- var _1 = _1 || this.getHeaderHeight(),
- _4 = this.getHeaderWrap(),
- _5 = this.padding != null ? this.padding : 0,
- _6 = 0,
- _7 = 0,
- _8 = 0,
- _9 = 0;
- _3.append("vertical-align:", (this.getShowBody() ? "top" : "middle"), "; ");
- if (!this.vertical) _3.append("text-align:", (this.getShowBody() ? "left; " : "center; "));
- if (!_4) _3.append("text-wrap:none; ");
- if (this.getShowBody() == false) {
- _3.append("bottom:0px; top:0px;")
- } else {
- if (this.titleOrientation == "bottom") _3.append("bottom:0px; ");
- else _3.append("top:0px;");
- _3.append("height:", (_1), "px; ")
- }
- if (_2.headerTextColor) _3.append("color:", _2.headerTextColor, ";");
- if (_2.headerBackgroundColor) {
- _3.append("background-color:", _2.headerBackgroundColor, ";")
- }
- if (_2.headerBorderColor) {
- _3.append("border-style:solid;");
- _3.append("border-color:", _2.headerBorderColor, ";")
- }
- return _3.release(false)
- }, isc.A.getBodyStyle = function isc_EventCanvas_getBodyStyle() {
- return this.$129w
- }, isc.A.getBodyHTML = function isc_EventCanvas_getBodyHTML() {
- if (!this.event) {
- return ""
- }
- return this.calendar.getEventBodyHTML(this.event, this.calendarView)
- }, isc.A.getBodyCSSText = function isc_EventCanvas_getBodyCSSText(_1) {
- var _2 = this.event,
- _3 = isc.StringBuffer.create(),
- _4 = this.padding != null ? this.padding : 0,
- _5 = 0,
- _6 = 0,
- _7 = 0,
- _8 = 0;
- if (!this.getShowHeader()) _1 = 0;
- _3.append("bottom:0px; top: ", _1 + 2, "px; ");
- _3.append("vertical-align:top; ");
- if (_2.textColor) _3.append("color:", _2.textColor, ";");
- if (_2.backgroundColor) {
- _3.append("background-color:", _2.backgroundColor, ";")
- }
- return _3.release(false)
- }, isc.A.getInnerHTML = function isc_EventCanvas_getInnerHTML() {
- var _1 = "";
- if (this.event) {
- var _2 = this.getStyleHandle();
- if (_2) {
- var _3 = this.event.backgroundColor;
- if (_3) {
- _2.backgroundColor = _3
- }
- if (this.event.borderColor) {
- _2.borderStyle = "solid";
- _2.borderColor = this.event.borderColor
- }
- }
- var _4 = this.$172x("$184b");
- if (_4) return _4;
- var _5 = "",
- _6 = "",
- _7 = this.getShowHeader(),
- _8 = this.getShowBody(),
- _9 = this.shouldShowLabel();
- var _10 = this.getHeaderHeight();
- if (_7 || _9) {
- var _11 = this.divTemplate.duplicate();
- _11[1] = this.getHeaderStyle();
- _11[3] = this.getHeaderCSSText(_10);
- _11[4] = "' eventPart='headerLabel'>"
- _11[5] = this.getHeaderHTML();
- _5 = _11.join("")
- }
- if (_8) {
- var _12 = this.divTemplate.duplicate();
- _12[1] = this.getBodyStyle();
- _12[3] = this.getBodyCSSText(_10);
- _12[4] = "' eventPart='body'>";
- _12[5] = this.getBodyHTML();
- _6 += _12.join("")
- }
- if (_9) {
- if (this.label) {
- this.label.setContents(_5)
- }
- }
- if (_7 || _8) {
- if (_7 && this.titleOrientation == "top") _1 += _5;
- if (_8) _1 += _6;
- if (_7 && this.titleOrientation == "bottom") _1 += _5
- } else if (!_9) {
- _1 = this.getHeaderHTML()
- }
- }
- if (this.$172y) this.$172y.$184b = _1;
- return _1
- }, isc.A.getHoverHTML = function isc_EventCanvas_getHoverHTML() {
- if (this.calendarView.shouldShowEventHovers()) {
- return this.calendar.$141h(this.event, this, this.calendarView)
- }
- }, isc.A.shouldShowCloseButton = function isc_EventCanvas_shouldShowCloseButton() {
- if (this.showCloseButton != null) return this.showCloseButton != false;
- return this.$172x("showCloseButton")
- }, isc.A.shouldShowContextButton = function isc_EventCanvas_shouldShowContextButton() {
- if (this.showContextButton != null) return this.showContextButton != false;
- return this.$172x("showContextButton")
- }, isc.A.getRolloverControls = function isc_EventCanvas_getRolloverControls() {
- return null
- }, isc.A.renderEvent = function isc_EventCanvas_renderEvent(_1, _2, _3, _4, _5) {
- this.setRect(_2, _1, _3, _4);
- this.checkStyle();
- if (!this.parentElement || !this.parentElement.isDrawn()) return;
- if (this.event.$174a) {
- this.tabIndex = this.event.$174a;
- delete this.event.$174a
- }
- if (!this.isDrawn()) this.draw();
- this.show();
- if (_5) this.sendToBack();
- else this.bringToFront();
- if (this.shouldShowGripper() || this.shouldShowLabel()) {
- this.repositionPeers()
- }
- if (this.useStaticControls && !this.isZoneCanvas && !this.isIndicatorCanvas) {
- this.updateRolloverControls()
- }
- }, isc.A.checkStyle = function isc_EventCanvas_checkStyle() {
- var _1 = this.calendar.getEventCanvasStyle(this.event, this.calendarView);
- if (_1 != this.styleName) this.setEventStyle(_1)
- }, isc.A.click = function isc_EventCanvas_click() {
- if (this.calendar.canSelectEvents) {} else {
- this.calendar.$129v(this)
- }
- }, isc.A.doubleClick = function isc_EventCanvas_doubleClick() {
- if (this.calendar.canSelectEvents) {
- this.calendar.$129v(this)
- }
- }, isc.A.handleShowContextMenu = function isc_EventCanvas_handleShowContextMenu() {
- return this.calendar.$1701(this)
- }, isc.A.mouseUp = function isc_EventCanvas_mouseUp() {
- return isc.EH.STOP_BUBBLING
- }, isc.A.mouseDown = function isc_EventCanvas_mouseDown() {
- if (this.dragTarget) this.dragTarget.eventCanvas = this;
- this.calendar.eventDialog.hide();
- return isc.EH.STOP_BUBBLING
- }, isc.A.focusChanged = function isc_EventCanvas_focusChanged(_1) {
- var _2 = isc.EH.getTarget();
- if (_2 != this && this.contains(_2)) return;
- if (_1 && !this.$174f) {
- this.calendar.$174g(this)
- } else if (this.$174f) {
- this.calendar.$174i(this)
- }
- }, isc.A.keyPress = function isc_EventCanvas_keyPress() {
- var _1 = this.calendar,
- _2 = this.calendarView,
- _3 = this.$172y,
- _4 = isc.EventHandler.getKey();
- if (_4) {
- if (_4 == "Enter") {
- if (_3.canEdit) _1.$129v(this)
- } else if (_4 == "Delete") {
- if (_3.showCloseButton) _1.$174b(this)
- }
- }
- }, isc.A.mouseOver = function isc_EventCanvas_mouseOver() {
- if (this.$174h || this.$174f) return;
- if (this.showRolloverControls == false) return;
- if (this.$129e) {
- var _1 = isc.EH.lastEvent.target;
- if (_1 == this || _1.eventCanvas == this) return
- }
- this.updateRolloverControls(true)
- }, isc.A.mouseOut = function isc_EventCanvas_mouseOut() {
- if (this.$174h || this.$174f) return;
- if (this.showRolloverControls == false || !this.$129e) return;
- var _1 = isc.EH.lastEvent.target;
- if (_1 && (_1.eventCanvas == this || _1 == isc.Hover.hoverCanvas)) return;
- this.calendar.hideEventCanvasControls(this, "$129e")
- }, isc.A.parentResized = function isc_EventCanvas_parentResized() {
- this.Super('parentResized', arguments);
- if (this.shouldShowGripper() || this.shouldShowLabel()) {
- this.repositionPeers()
- }
- }, isc.A.destroy = function isc_EventCanvas_destroy() {
- if (this.$174h) {
- var _1 = ["closeButton", "contextButton"];
- for (var _2 in this.$174h) {
- var _3 = this.$174h[_2];
- _3.hide();
- if (!_1.contains(_2)) this.removeChild(_3);
- _3.destroy();
- delete this[_2];
- _3 = null
- }
- delete this.$174h
- } else {
- if (this.$174f) {
- this.calendar.hideEventCanvasControls(this, "$174f")
- } else if (this.$129e) {
- this.calendar.hideEventCanvasControls(this, "$129e")
- }
- }
- if (this.gripper) {
- this.calendarView.removeChild(this.gripper);
- this.gripper.destroy();
- this.gripper = null
- }
- if (this.label) {
- this.calendarView.removeChild(this.label);
- this.label.destroy();
- this.label = null
- }
- if (this.dragTarget) this.dragTarget = null;
- this.Super("destroy", arguments)
- }, isc.A.getPrintHTML = function isc_EventCanvas_getPrintHTML(_1, _2) {
- if (_2) {
- this.delayCall("asyncGetPrintHTML", [_1, _2]);
- return null
- } else {
- return this.asyncGetPrintHTML(_1, _2)
- }
- }, isc.A.asyncGetPrintHTML = function isc_EventCanvas_asyncGetPrintHTML(_1, _2) {
- var _3 = isc.StringBuffer.create(),
- _4 = this.calendar,
- _5 = this.calendarView,
- _6 = _5.isTimelineView(),
- _7 = _5.body,
- _8 = 0,
- _9 = this.getTop(),
- _10 = _7.getTop(),
- _11 = (_9) + _8 + 1,
- _12 = _7.$26a,
- _13 = this.event,
- _14 = _5.getLeft() + _7.getLeft() + (_5.getEventLeft ? _5.getEventLeft(_13) : _4.getEventLeft(_13, _5)),
- _15 = this.getInnerWidth(),
- _16 = this.getInnerHeight() - 1,
- i = (_1 && _1.i ? _1.i : 1);
- var _18 = _4.getEventStartCol(_13, this, this.calendarView),
- _19 = _4.getEventEndCol(_13, this, this.calendarView);
- var _4 = this.calendar,
- _20 = _4.getTop(),
- _21 = _4.getPageTop(),
- _22 = _5.getTop(),
- _23 = _5.getPageTop(),
- _10 = _5.body.getTop() + _5.header ? _5.header.getHeight() : 0;
- if (_6) {
- _11 = this.getTop() + _10 + 2;
- _14 = this.getLeft() + (_5.frozenBody ? _5.frozenBody.getVisibleWidth() : 0)
- } else {
- _14 = this.getLeft() + (_5.frozenBody ? _5.frozenBody.getVisibleWidth() : 0);
- _11 = _10 + this.getTop() + 1
- }
- var _24 = this.styleName;
- _3.append("<div class='", _24, "' ", "style='vertical-align: ", (_4.showEventDescriptions ? "top" : "middle"), "; ", (_13.backgroundColor ? "background-color: " + _13.backgroundColor + ";" : ""), (_13.textColor ? "color: " + _13.textColor + ";" : ""), "overflow:hidden; ", "position: absolute; ", "left:", _14, "px; top:", _11, "px; width: ", _15, "px; height: ", _16, "px; ", "z-index:", i + 2, ";", "'>");
- _3.append(this.getInnerHTML());
- _3.append("</div>");
- if (this.label) {
- _11 = _11 + _16 - 5;
- _15 = this.label.getVisibleWidth();
- _16 = this.label.getInnerHeight();
- _14 -= Math.floor(_15 / 2);
- _3.append("<div class='", _24 + "Header", "' ", "style='overflow:hidden; ", "position: absolute; ", "padding:2px; ", "z-index:", i + 2, ";", "left:", _14, "px; top:", _11, "px; width: ", _15, "px; height: ", _16, "px; ", "'>");
- _3.append(this.getHeaderHTML());
- _3.append("</div>")
- }
- return _3.release(false)
- });
- isc.B._maxIndex = isc.C + 53;
- isc.defineClass("ZoneCanvas", "EventCanvas");
- isc.A = isc.ZoneCanvas.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.titleOrientation = null;
- isc.A.showHeader = true;
- isc.A.showBody = true;
- isc.A.canEdit = false;
- isc.A.canDrag = false;
- isc.A.canDragReposition = false;
- isc.A.canDragResize = false;
- isc.A.canRemove = false;
- isc.A.showRolloverControls = false;
- isc.A.maxLabelWidth = null;
- isc.B.push(isc.A.initWidget = function isc_ZoneCanvas_initWidget() {
- this.showCloseButton = false;
- this.canDragReposition = false;
- this.canDragResize = false;
- if (this.titleOrientation == null) this.titleOrientation = this.calendar.zoneTitleOrientation;
- this.$142u = !this.calendarView.shouldShowZoneHovers();
- this.Super("initWidget", arguments)
- }, isc.A.setEvent = function isc_ZoneCanvas_setEvent(_1, _2, _3, _4) {
- this.event = _1;
- this.showCloseButton = false;
- this.canDragReposition = false;
- this.canDragResize = false;
- var _5 = this.calendar;
- _2 = _2 || _5.getZoneCanvasStyle(_1, this.calendarView);
- this.setEventStyle(_2, _3, _4)
- }, isc.A.click = function isc_ZoneCanvas_click() {
- if (this.calendar.zoneClick) this.calendar.zoneClick(this.event, this.calendarView.viewName)
- }, isc.A.getHoverHTML = function isc_ZoneCanvas_getHoverHTML() {
- if (this.calendarView.shouldShowZoneHovers()) {
- var _1 = this.calendar.$141i(this.event, this, this.calendarView);
- return _1
- }
- }, isc.A.checkStyle = function isc_ZoneCanvas_checkStyle() {}, isc.A.updateRolloverControls = function isc_ZoneCanvas_updateRolloverControls() {});
- isc.B._maxIndex = isc.C + 6;
- isc.defineClass("IndicatorCanvas", "EventCanvas");
- isc.A = isc.IndicatorCanvas.getPrototype();
- isc.B = isc._allFuncs;
- isc.C = isc.B._maxIndex;
- isc.D = isc._funcClasses;
- isc.D[isc.C] = isc.A.Class;
- isc.A.showHeader = false;
- isc.A.showBody = false;
- isc.A.headerSnapTo = "B";
- isc.A.showGripper = true;
- isc.A.showLabel = true;
- isc.A.canDrag = true;
- isc.A.canDragReposition = true;
- isc.A.canDragResize = false;
- isc.A.canRemove = false;
- isc.A.showRolloverControls = false;
- isc.B.push(isc.A.initWidget = function isc_IndicatorCanvas_initWidget() {
- this.showCloseButton = false;
- this.canDragResize = false;
- this.Super("initWidget", arguments);
- if (this.event) this.setEvent(this.event)
- }, isc.A.setEvent = function isc_IndicatorCanvas_setEvent(_1, _2, _3, _4) {
- this.event = _1;
- var _5 = this.$172w(_1, _2, _3, _4);
- this.canEdit = _5.canEdit;
- this.canDrag = _5.canDrag
- this.canDragResize = false;
- this.canDragReposition = _5.canDragMove;
- if (this.canDragReposition == false) {
- this.setCursor(isc.Canvas.DEFAULT)
- } else {
- this.setCursor(isc.Canvas.MOVE)
- }
- this.showCloseButton = false;
- var _6 = this.calendar;
- _2 = _2 || _6.getIndicatorCanvasStyle(_1, this.calendarView);
- this.setEventStyle(_2, _3, _4)
- }, isc.A.click = function isc_IndicatorCanvas_click() {
- if (this.calendar.indicatorClick) this.calendar.indicatorClick(this.event, this.calendarView.viewName)
- }, isc.A.getHoverHTML = function isc_IndicatorCanvas_getHoverHTML() {
- return this.calendar.$141j(this.event, this, this.calendarView)
- }, isc.A.checkStyle = function isc_IndicatorCanvas_checkStyle() {}, isc.A.updateRolloverControls = function isc_IndicatorCanvas_updateRolloverControls() {});
- isc.B._maxIndex = isc.C + 6;
- isc.AutoTest.customizeCalendar();
- isc.ClassFactory.defineClass("Timeline", "Calendar");
- isc.A = isc.Timeline.getPrototype();
- isc.A.showTimelineView = true;
- isc.A.showDayView = false;
- isc.A.showWeekView = false;
- isc.A.showMonthView = false;
- isc.A.showControlBar = false;
- isc.A.labelColumnWidth = 75;
- isc.A.sizeEventsToGrid = false;
- isc.A.eventDragGap = 0;
- isc._nonDebugModules = (isc._nonDebugModules != null ? isc._nonDebugModules : []);
- isc._nonDebugModules.push('Calendar');
- isc.checkForDebugAndNonDebugModules();
- isc._moduleEnd = isc._Calendar_end = (isc.timestamp ? isc.timestamp() : new Date().getTime());
- if (isc.Log && isc.Log.logIsInfoEnabled('loadTime')) isc.Log.logInfo('Calendar module init time: ' + (isc._moduleEnd - isc._moduleStart) + 'ms', 'loadTime');
- delete isc.definingFramework;
- if (isc.Page) isc.Page.handleEvent(null, "moduleLoaded", {
- moduleName: 'Calendar',
- loadTime: (isc._moduleEnd - isc._moduleStart)
- });
- } else {
- if (window.isc && isc.Log && isc.Log.logWarn) isc.Log.logWarn("Duplicate load of module 'Calendar'.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement