From fc83d0ae6e5ea9b8cc77343565a29d66b6998863 Mon Sep 17 00:00:00 2001 From: leonlee Date: Thu, 14 Jan 2021 11:43:40 +0800 Subject: [PATCH] ZKCAL-82: Rename CalendarEvent and SimpleCalendarEvent to avoid confusing --- .../src/archive/web/js/calendar/Calendars.js | 166 ++-- .../web/js/calendar/CalendarsDefault.js | 762 +++++++++--------- .../archive/web/js/calendar/CalendarsMonth.js | 100 +-- .../js/calendar/{DayEvent.js => DayItem.js} | 250 +++--- .../{DayOfMonthEvent.js => DayOfMonthItem.js} | 124 +-- .../{DaylongEvent.js => DaylongItem.js} | 48 +- ...gOfMonthEvent.js => DaylongOfMonthItem.js} | 312 +++---- .../web/js/calendar/{Event.js => Item.js} | 284 +++---- .../js/calendar/{LongEvent.js => LongItem.js} | 242 +++--- .../web/js/calendar/less/style/_calendar.less | 118 +-- calendar/src/archive/web/js/calendar/zk.wpd | 12 +- .../src/org/zkoss/calendar/Calendars.java | 210 ++--- .../{CalendarEvent.java => CalendarItem.java} | 212 ++--- .../org/zkoss/calendar/api/CalendarModel.java | 4 +- .../src/org/zkoss/calendar/api/Calendars.java | 10 +- .../api/{EventRender.java => ItemRender.java} | 102 +-- .../calendar/event/CalendarDataEvent.java | 12 +- .../calendar/event/CalendarDropEvent.java | 10 +- .../zkoss/calendar/event/CalendarsEvent.java | 40 +- ...arEvent.java => AbstractCalendarItem.java} | 12 +- .../calendar/impl/AbstractCalendarModel.java | 10 +- ...t.java => LocaleDateTimeCalendarItem.java} | 10 +- ...ndarEvent.java => SimpleCalendarItem.java} | 110 +-- .../calendar/impl/SimpleCalendarModel.java | 60 +- .../src/org/zkoss/calendar/impl/Util.java | 32 +- .../zkoss/zcaldemo/CalendarDemoComposer.java | 34 +- .../zcaldemo/CreateEditEventComposer.java | 8 +- .../zcaldemo/ZKCalendarDemoComposer.java | 26 +- .../src/main/java/test/Cal68Controller.java | 12 +- .../src/main/java/test/Cal70Composer.java | 8 +- .../src/main/java/test/Cal71Controller.java | 4 +- .../src/main/java/test/Cal73Controller.java | 8 +- .../src/main/java/test/Cal76Controller.java | 14 +- .../src/main/webapp/test/zkcal67.zul | 2 +- zkdoc/release-note | 4 +- 35 files changed, 1685 insertions(+), 1687 deletions(-) rename calendar/src/archive/web/js/calendar/{DayEvent.js => DayItem.js} (86%) rename calendar/src/archive/web/js/calendar/{DayOfMonthEvent.js => DayOfMonthItem.js} (90%) rename calendar/src/archive/web/js/calendar/{DaylongEvent.js => DaylongItem.js} (84%) rename calendar/src/archive/web/js/calendar/{DaylongOfMonthEvent.js => DaylongOfMonthItem.js} (87%) rename calendar/src/archive/web/js/calendar/{Event.js => Item.js} (79%) rename calendar/src/archive/web/js/calendar/{LongEvent.js => LongItem.js} (90%) rename calendar/src/org/zkoss/calendar/api/{CalendarEvent.java => CalendarItem.java} (66%) rename calendar/src/org/zkoss/calendar/api/{EventRender.java => ItemRender.java} (63%) rename calendar/src/org/zkoss/calendar/impl/{AbstractCalendarEvent.java => AbstractCalendarItem.java} (82%) rename calendar/src/org/zkoss/calendar/impl/{LocaleDateTimeCalendarEvent.java => LocaleDateTimeCalendarItem.java} (65%) rename calendar/src/org/zkoss/calendar/impl/{SimpleCalendarEvent.java => SimpleCalendarItem.java} (62%) diff --git a/calendar/src/archive/web/js/calendar/Calendars.js b/calendar/src/archive/web/js/calendar/Calendars.js index 8d25520..c0d3fb8 100644 --- a/calendar/src/archive/web/js/calendar/Calendars.js +++ b/calendar/src/archive/web/js/calendar/Calendars.js @@ -32,8 +32,8 @@ it will be useful, but WITHOUT ANY WARRANTY. } function _compareStartTime(x , y) { - var isDaylongMonX = zk.Widget.$(x).className == 'calendar.DaylongOfMonthEvent', - isDaylongMonY = zk.Widget.$(y).className == 'calendar.DaylongOfMonthEvent', + var isDaylongMonX = zk.Widget.$(x).className == 'calendar.DaylongOfMonthItem', + isDaylongMonY = zk.Widget.$(y).className == 'calendar.DaylongOfMonthItem', xBd = isDaylongMonX ? Math.min(x.upperBoundBd.getTime(), x.zoneBd.getTime()) : x.zoneBd.getTime(), @@ -55,7 +55,7 @@ it will be useful, but WITHOUT ANY WARRANTY. return 1; } - function _getEventPeriod(ce) { + function _getItemPeriod(ce) { var bd = new Date(ce.zoneBd), ed = new Date(ce.zoneEd); @@ -92,7 +92,7 @@ calendar.Calendars = zk.$extends(zul.Widget, { '', ''].join(''), - evtTemplate: ['
', + itemTemplate: ['
', '
', '
%4
', '
', @@ -120,7 +120,7 @@ calendar.Calendars = zk.$extends(zul.Widget, { this.$supers('bind_', arguments); this._dragItems = {}; this._ghost = {}; - this._eventKey = {}; + this._itemKey = {}; this.params = {}; zWatch.listen({onSize: this, onShow: this, onResponse: this}); }, @@ -140,7 +140,7 @@ calendar.Calendars = zk.$extends(zul.Widget, { } } } - this._dragItems = this._ghost = this._eventKey = this.params = this._restoreCE = null; + this._dragItems = this._ghost = this._itemKey = this.params = this._restoreCE = null; this.$supers('unbind_', arguments); }, @@ -154,16 +154,16 @@ calendar.Calendars = zk.$extends(zul.Widget, { this.clearGhost(); }, - processEvtData_: function (event) { - event.isLocked = event.isLocked == 'true' ? true : false; - event.beginDate = new Date(zk.parseInt(event.beginDate)); - event.endDate = new Date(zk.parseInt(event.endDate)); + processItemData_: function (item) { + item.isLocked = item.isLocked == 'true' ? true : false; + item.beginDate = new Date(zk.parseInt(item.beginDate)); + item.endDate = new Date(zk.parseInt(item.endDate)); - event.zoneBd = this.fixTimeZoneFromServer(event.beginDate); - event.zoneEd = this.fixTimeZoneFromServer(event.endDate); + item.zoneBd = this.fixTimeZoneFromServer(item.beginDate); + item.zoneEd = this.fixTimeZoneFromServer(item.endDate); - var key = event.key, - period = this._eventKey[key], + var key = item.key, + period = this._itemKey[key], inMon = this.mon; if (!period) { var keyDate = zk.fmt.Date.parseDate(key); @@ -175,36 +175,36 @@ calendar.Calendars = zk.$extends(zul.Widget, { if (inMon) period.week = Math.floor(keyDate / 7); - this._eventKey[key] = period; + this._itemKey[key] = period; } - event._preOffset = period.day; + item._preOffset = period.day; if (inMon) - event.startWeek = this._weekDates[period.week]; + item.startWeek = this._weekDates[period.week]; - return event; + return item; }, createChildrenWidget_: function () { - this.cleanEvtAry_(); - //append all event be widget children - for (var i = 0, j = this._events.length; i < j; i++) { - var events = this._events[i]; - for (var k = 0, l = events.length; k < l; k++) { - var event = this.processEvtData_(events[k]); + this.cleanItemAry_(); + //append all item be widget children + for (var i = 0, j = this._items.length; i < j; i++) { + var items = this._items[i]; + for (var k = 0, l = items.length; k < l; k++) { + var item = this.processItemData_(items[k]); //over range //Bug ZKCAL-36: should check if event endDate and view begin Date are equal - if (event.zoneBd >= this.zoneEd || event.zoneEd <= this.zoneBd) + if (item.zoneBd >= this.zoneEd || item.zoneEd <= this.zoneBd) continue; - this.processChildrenWidget_(_isExceedOneDay(this, event), event); + this.processChildrenWidget_(_isExceedOneDay(this, item), item); } } }, - processChildrenWidget_: function (isExceedOneDay, event) { + processChildrenWidget_: function (isExceedOneDay, item) { }, - drawEvent_: function (preOffset, className, tr, dayNode) { + drawItem_: function (preOffset, className, tr, dayNode) { var html = [], s = ' '; for (var n = preOffset; n--;) @@ -323,7 +323,7 @@ calendar.Calendars = zk.$extends(zul.Widget, { change: cls._changeDaydrag, draw: cls._drawDaydrag, ignoredrag: cls._ignoreDaydrag - }): null; + }) : null; }, addDayClickEvent_: function (element) { @@ -346,10 +346,10 @@ calendar.Calendars = zk.$extends(zul.Widget, { }, //ZKCAL-48: support tooltip doTooltipOver_: function (evt) { - if (this.isListen('onEventTooltip')) { + if (this.isListen('onItemTooltip')) { var zcls = this.getZclass(), node = evt.target, - ce = zk.Widget.$(node).event; + ce = zk.Widget.$(node).item; if (jq(node).hasClass(zcls + '-evt-faker-more') && node.parentNode.id.indexOf('-frow') > 0) return; @@ -367,7 +367,7 @@ calendar.Calendars = zk.$extends(zul.Widget, { var p = [Math.round(evt.pageX), Math.round(evt.pageY)], data = {data: [ce.id, p[0], p[1], jq.innerWidth(), jq.innerHeight()]}, - e = new zk.Event(this, 'onEventTooltip', data, null, evt.domEvent), + e = new zk.Event(this, 'onItemTooltip', data, null, evt.domEvent), self = this; setTimeout(function () { @@ -389,80 +389,80 @@ calendar.Calendars = zk.$extends(zul.Widget, { this.$supers('doTooltipOut_', arguments); }, - setAddDayEvent: function (eventArray) { - eventArray = jq.evalJSON(eventArray); - if (!eventArray.length) return; + setAddDayItem: function (itemArray) { + itemArray = jq.evalJSON(itemArray); + if (!itemArray.length) return; this.clearGhost(); var hasAdd = {day: false, daylong: false}; - for (var event; (event = eventArray.shift());) { - if (zk.Widget.$(event.id)) continue; - event = this.processEvtData_(event); + for (var item; (item = itemArray.shift());) { + if (zk.Widget.$(item.id)) continue; + item = this.processItemData_(item); //over range - //Bug ZKCAL-36: should check if event endDate and view begin Date are equal - if (event.zoneBd >= this.zoneEd || event.zoneEd <= this.zoneBd) + //Bug ZKCAL-36: should check if item endDate and view begin Date are equal + if (item.zoneBd >= this.zoneEd || item.zoneEd <= this.zoneBd) continue; - var isExceedOneDay = _isExceedOneDay(this, event); - this.processChildrenWidget_(isExceedOneDay, event); + var isExceedOneDay = _isExceedOneDay(this, item); + this.processChildrenWidget_(isExceedOneDay, item); hasAdd[isExceedOneDay ? 'daylong' : 'day'] = true; } - this.reAlignEvents_(hasAdd); + this.reAlignItems_(hasAdd); }, - setModifyDayEvent: function (eventArray) { - eventArray = jq.evalJSON(eventArray); - if (!eventArray.length) return; + setModifyDayItem: function (itemArray) { + itemArray = jq.evalJSON(itemArray); + if (!itemArray.length) return; this.clearGhost(); var hasAdd = {day: false, daylong: false}; - for (var event; (event = eventArray.shift());) { - var childWidget = zk.Widget.$(event.id), + for (var item; (item = itemArray.shift());) { + var childWidget = zk.Widget.$(item.id), inMon = this.mon, isBeginTimeChange = false; - event = this.processEvtData_(event); + item = this.processItemData_(item); //Bug ZKCAL-47: childWidget may not in the range and has beem removed. if (!childWidget) { - if (event.zoneBd > this.zoneEd || event.zoneEd < this.zoneBd) { - //if event still not in the range, skip + if (item.zoneBd > this.zoneEd || item.zoneEd < this.zoneBd) { + //if item still not in the range, skip continue; } else { - //if event is in the range, create childWidget. - this.processChildrenWidget_(_isExceedOneDay(this, event), event); - childWidget = zk.Widget.$(event.id); + //if item is in the range, create childWidget. + this.processChildrenWidget_(_isExceedOneDay(this, item), item); + childWidget = zk.Widget.$(item.id); } } if (inMon && - (isBeginTimeChange = childWidget.isBeginTimeChange(event))) + (isBeginTimeChange = childWidget.isBeginTimeChange(item))) this.removeNodeInArray_(childWidget); //over range - if (event.zoneBd > this.zoneEd || event.zoneEd < this.zoneBd) { + if (item.zoneBd > this.zoneEd || item.zoneEd < this.zoneBd) { if (!inMon) this.removeNodeInArray_(childWidget, hasAdd); this.removeChild(childWidget); continue; } - var isExceedOneDay = _isExceedOneDay(this, event), + var isExceedOneDay = _isExceedOneDay(this, item), clsName = childWidget.className, - isDayEvent = inMon ? clsName == 'calendar.DayOfMonthEvent' : clsName == 'calendar.DayEvent', - isChangeEvent = isExceedOneDay ? isDayEvent : !isDayEvent; + isDayItem = inMon ? clsName == 'calendar.DayOfMonthItem' : clsName == 'calendar.DayItem', + isChangeEvent = isExceedOneDay ? isDayItem : !isDayItem; if (isChangeEvent) { if (!inMon) - this[isDayEvent ? '_dayEvents' : '_daylongEvents'].$remove(childWidget.$n()); + this[isDayItem ? '_dayItems' : '_daylongItems'].$remove(childWidget.$n()); this.removeChild(childWidget); - this.processChildrenWidget_(isExceedOneDay, event); + this.processChildrenWidget_(isExceedOneDay, item); hasAdd.day = hasAdd.daylong = true; } else { - childWidget.event = event; + childWidget.item = item; childWidget.update(isBeginTimeChange); if (inMon) { @@ -475,23 +475,23 @@ calendar.Calendars = zk.$extends(zul.Widget, { } } - this.reAlignEvents_(hasAdd); + this.reAlignItems_(hasAdd); }, - setRemoveDayEvent: function (eventArray) { - eventArray = jq.evalJSON(eventArray); - if (!eventArray.length) return; + setRemoveDayItem: function (itemArray) { + itemArray = jq.evalJSON(itemArray); + if (!itemArray.length) return; var hasAdd = {day: false, daylong: false}; - for (var event; (event = eventArray.shift());) { - var childWidget = zk.Widget.$(event.id); + for (var item; (item = itemArray.shift());) { + var childWidget = zk.Widget.$(item.id); if (!childWidget) continue; this.removeNodeInArray_(childWidget, hasAdd); this.removeChild(childWidget); } - this.reAlignEvents_(hasAdd); + this.reAlignItems_(hasAdd); }, dateSorting_: function (x, y) { @@ -562,9 +562,9 @@ calendar.Calendars = zk.$extends(zul.Widget, { onPopupClick: function (evt) { var childWidget = zk.Widget.$(evt.target); - if (childWidget.$instanceof(calendar.Event)) { + if (childWidget.$instanceof(calendar.Item)) { var p = [Math.round(evt.pageX), Math.round(evt.pageY)]; //ZKCAL-42: sometimes it returns float number in IE 10 - this.fire('onEventEdit',{data:[childWidget.uuid, p[0], p[1], jq.innerWidth(), jq.innerHeight()]}); + this.fire('onItemEdit',{data:[childWidget.uuid, p[0], p[1], jq.innerWidth(), jq.innerHeight()]}); evt.stop(); } }, @@ -593,8 +593,8 @@ calendar.Calendars = zk.$extends(zul.Widget, { jq(n).hasClass(widget.getZclass() + '-month-date-cnt')) return true; if (n.nodeType == 1 && jq(n).hasClass(p._fakerMoreCls) && !jq(n).hasClass(p._fakerNoMoreCls) || - (targetWidget.$instanceof(calendar.Event) && - (!n.parentNode || targetWidget.event.isLocked))) + (targetWidget.$instanceof(calendar.Item) && + (!n.parentNode || targetWidget.item.isLocked))) return true; return false; }, @@ -607,7 +607,7 @@ calendar.Calendars = zk.$extends(zul.Widget, { inMon = widget.mon, dataObj = widget.getDragDataObj_(), targetWidget = zk.Widget.$(evt.domEvent), - ce = targetWidget.$instanceof(calendar.Event) ? targetWidget.$n() : null, + ce = targetWidget.$instanceof(calendar.Item) ? targetWidget.$n() : null, hs = []; jq(document.body).prepend(dataObj.getRope(widget, cnt, hs)); var row = dataObj.getRow(cnt), @@ -649,7 +649,7 @@ calendar.Calendars = zk.$extends(zul.Widget, { jq(document.body.firstChild).before(jq(faker)); dg.node = jq('#' + uuid + '-dd')[0]; - dg._zdur = _getEventPeriod(targetWidget.event); + dg._zdur = _getItemPeriod(targetWidget.item); dg._zevt = ce; } @@ -760,9 +760,9 @@ calendar.Calendars = zk.$extends(zul.Widget, { if (dg._zevt) { var zcls = widget.getZclass(), targetWidget = zk.Widget.$(dg._zevt), - event = targetWidget.event, + item = targetWidget.item, bd = new Date(widget.zoneBd), - ebd = new Date(event.zoneBd), + ebd = new Date(item.zoneBd), ddClass = zcls + '-evt-dd', inMon = widget.mon; bd = calUtil.addDay(bd, dataObj.getDur(dg)); @@ -780,16 +780,16 @@ calendar.Calendars = zk.$extends(zul.Widget, { jq(cloneNodes[n]).removeClass(ddClass); } - if (!calUtil.isTheSameDay(ebd, event.zoneBd)) { + if (!calUtil.isTheSameDay(ebd, item.zoneBd)) { ce = dg._zevt; ce.style.visibility = 'hidden'; - var ed = new Date(event.zoneEd); + var ed = new Date(item.zoneEd); ed.setFullYear(bd.getFullYear()); ed.setDate(1); ed.setMonth(bd.getMonth()); - ed.setDate(bd.getDate() + _getEventPeriod(event) - (_isZeroTime(ed) ? 0 : 1)); - widget.fire('onEventUpdate', { + ed.setDate(bd.getDate() + _getItemPeriod(item) - (_isZeroTime(ed) ? 0 : 1)); + widget.fire('onItemUpdate', { data: [ dg._zevt.id, widget.fixTimeZoneFromClient(ebd), @@ -800,14 +800,14 @@ calendar.Calendars = zk.$extends(zul.Widget, { jq.innerHeight() ] }); - widget._restoreCE = ce; //ZKCAL-39: should store calendar event + widget._restoreCE = ce; //ZKCAL-39: should store calendar item } jq('#' + widget.uuid + '-rope').remove(); jq('#' + widget.uuid + '-dd').remove(); } else { var newData = dataObj.getNewDate(widget, dg); - widget.fire('onEventCreate', { + widget.fire('onItemCreate', { data: [ widget.fixTimeZoneFromClient(newData.bd), widget.fixTimeZoneFromClient(newData.ed), diff --git a/calendar/src/archive/web/js/calendar/CalendarsDefault.js b/calendar/src/archive/web/js/calendar/CalendarsDefault.js index aae78f7..8841d4d 100644 --- a/calendar/src/archive/web/js/calendar/CalendarsDefault.js +++ b/calendar/src/archive/web/js/calendar/CalendarsDefault.js @@ -14,19 +14,19 @@ it will be useful, but WITHOUT ANY WARRANTY. */ (function () { function _getHightOffsPercent(date, timeslots) { - var timeslotTime = 60/timeslots, - bdTimeslot = date.getMinutes()%timeslotTime; + var timeslotTime = 60 / timeslots, + bdTimeslot = date.getMinutes() % timeslotTime; if (!bdTimeslot) return 0; - return bdTimeslot/timeslotTime; + return bdTimeslot / timeslotTime; } - function _setEvtWgtHeight(wgt, node, id, height) { - var body = jq(node).find('#'+id+'-body')[0], + function _setItemWgtHeight(wgt, node, id, height) { + var body = jq(node).find('#' + id + '-body')[0], inner = body.firstChild.firstChild; for (var child = jq(node).children()[0]; child; child = child.nextSibling) { - if (wgt.isLegalChild(child)) + if (wgt.isLegalChild(child)) height -= child.offsetHeight; } height = zk(body).revisedHeight(height); @@ -36,27 +36,27 @@ it will be useful, but WITHOUT ANY WARRANTY. } function _getSlotCount(bd, ed, timeslots) { - var timeslotTime = 60/timeslots, - bdHour = (typeof bd) == "number" ? bd: bd.getHours(), - edHour = (typeof ed) == "number" ? ed: ed.getHours(), - bdMinu = (typeof bd) == "number" ? 0: bd.getMinutes(), - edMinu = (typeof ed) == "number" ? 0: ed.getMinutes(); - return (edHour - bdHour) * timeslots + - (edMinu - bdMinu)/timeslotTime; + var timeslotTime = 60 / timeslots, + bdHour = (typeof bd) == 'number' ? bd : bd.getHours(), + edHour = (typeof ed) == 'number' ? ed : ed.getHours(), + bdMinu = (typeof bd) == 'number' ? 0 : bd.getMinutes(), + edMinu = (typeof ed) == 'number' ? 0 : ed.getMinutes(); + return (edHour - bdHour) * timeslots + + (edMinu - bdMinu) / timeslotTime; } function _updateCntHeight(wgt) { - var $cnt = jq(wgt.$n("cnt")), + var $cnt = jq(wgt.$n('cnt')), timeslots = wgt._timeslots, hourCount = wgt._et - wgt._bt, $firstSlot = $cnt.find('.z-calendars-hour-sep')[0], //fine tune if user customize height by CSS - slotHeight = $firstSlot ? + slotHeight = $firstSlot ? ($firstSlot.offsetHeight + zk($firstSlot).sumStyles('tb', jq.margins) + 1) : 46, - totalHeight = hourCount * slotHeight * timeslots/2; + totalHeight = hourCount * slotHeight * timeslots / 2; $cnt.find('.z-calendars-week-cnt').height(totalHeight); jq(wgt.cntRows).find('.z-calendars-week-day-cnt').height(totalHeight).css('margin-bottom', -totalHeight); - jq(wgt.cntRows).find('.z-calendars-hour-of-day').height(slotHeight * timeslots/2 - 1); - wgt._slotOffs = 12/timeslots; + jq(wgt.cntRows).find('.z-calendars-hour-of-day').height(slotHeight * timeslots / 2 - 1); + wgt._slotOffs = 12 / timeslots; wgt.beginIndex = wgt._bt * timeslots; } @@ -74,20 +74,20 @@ it will be useful, but WITHOUT ANY WARRANTY. var hourRowHtml = '
', hourSepRowHtml = '
', html = []; - for(var i = offset; i--;) + for (var i = offset; i--;) html.push(hourRowHtml); html = html.join(''); for (var i = ts; i--;) jq(timeRows[ts - i - 1]).append(html); html = []; - for(var i = offset * timeslots/2; i--;) + for (var i = offset * timeslots / 2; i--;) html.push(hourSepRowHtml); jq(cntRows.previousSibling.lastChild).find('.z-calendars-hour-inner').append(html.join('')); - } else if (offset < 0){ + } else if (offset < 0) { for (var i = ts; i--;) - jq(timeRows[ts - i - 1]).children('.z-calendars-hour-of-day:gt('+(hourCount-1)+')').remove(); - jq(cntRows.previousSibling.lastChild).find('.z-calendars-hour-sep:gt('+(hourCount * timeslots/2 - 1)+')').remove(); + jq(timeRows[ts - i - 1]).children('.z-calendars-hour-of-day:gt(' + (hourCount - 1) + ')').remove(); + jq(cntRows.previousSibling.lastChild).find('.z-calendars-hour-sep:gt(' + (hourCount * timeslots / 2 - 1) + ')').remove(); } _updateCntHeight(wgt); @@ -104,7 +104,7 @@ it will be useful, but WITHOUT ANY WARRANTY. if (!offset) return; var header = wgt.$n('header'), - a = wgt.$n("hdarrow"); + a = wgt.$n('hdarrow'); a.style.left = jq.px((a.parentNode.offsetWidth * ts - a.offsetWidth) - 5); if (offset > 0) { var zoneTH = '', @@ -112,7 +112,7 @@ it will be useful, but WITHOUT ANY WARRANTY. zoneHourTD = '' + jq(cntRows).children('.z-calendars-timezone-end').html() + '', html1 = [], html2 = [], html3 = []; - for(var i = offset; i--;) { + for (var i = offset; i--;) { html1.push(zoneTH); html2.push(zoneTD); html3.push(zoneHourTD); @@ -120,7 +120,7 @@ it will be useful, but WITHOUT ANY WARRANTY. jq(header).children('.z-calendars-timezone-end').before(html1.join('')); jq(cntRows.previousSibling).children('.z-calendars-timezone-end').before(html2.join('')); jq(cntRows).children('.z-calendars-timezone-end').before(html3.join('')); - } else if (offset < 0){ + } else if (offset < 0) { jq(header).children('.z-calendars-timezone-end').prevAll().slice(ts - 1).remove(); jq(cntRows.previousSibling).children('.z-calendars-timezone-end').prevAll().slice(ts - 1).remove(); jq(cntRows).children('.z-calendars-timezone-end').prevAll().slice(ts - 1).remove(); @@ -137,9 +137,9 @@ it will be useful, but WITHOUT ANY WARRANTY. return uuid; })); var temp = jq('#' + uuid + '-tempblock'), - hdTable = wgt.$n('header').offsetParent, + hdTable = wgt.$n('header').offsetParent, parent = hdTable.parentNode, - cnt = wgt.$n('cnt'), + cnt = wgt.$n('cnt'), cntTable = cnt.firstChild; temp.append(hdTable); @@ -173,32 +173,32 @@ it will be useful, but WITHOUT ANY WARRANTY. cIndex = 0; jq(cells[begin + cIndex].firstChild).append( widget.ddTemplate.replace(new RegExp("%([1-2])", "g"), function (match, index) { - return index < 2 ? widget.uuid + '-dd' : 'z-calevent'; + return index < 2 ? widget.uuid + '-dd' : 'z-calitem'; })); dg._zoffs.x = x; dg._zoffs.y = y; - dg.node = jq('#'+uuid+'-dd')[0]; + dg.node = jq('#' + uuid + '-dd')[0]; dg.node.parent = jq(cells[begin + cIndex].firstChild); dg._zecnt = dg.node.childNodes[0].firstChild.firstChild; - jq(dg.node).addClass(widget.getZclass() + "-evt-ghost"); + jq(dg.node).addClass(widget.getZclass() + '-evt-ghost'); var r = y + dg.handle.scrollTop - y1; r = Math.floor(r / ph); dg.node.style.top = jq.px(r * ph); var offsHgh = 0, - body = jq('#'+uuid+'-dd-body')[0], + body = jq('#' + uuid + '-dd-body')[0], height = 0, inner = body.firstChild.firstChild; - inner.firstChild.innerHTML = - widget._dateTime[r*widget._slotOffs] + ' - ' + - widget._dateTime[r*widget._slotOffs + 12]; + inner.firstChild.innerHTML = + widget._dateTime[r * widget._slotOffs] + ' - ' + + widget._dateTime[r * widget._slotOffs + 12]; - for(var child = jq(dg.node).children().get(0);child;child=child.nextSibling){ - if(widget.isLegalChild(child)) - height+=child.offsetHeight; + for (var child = jq(dg.node).children().get(0);child;child = child.nextSibling) { + if (widget.isLegalChild(child)) + height += child.offsetHeight; } height += zk(body).padBorderHeight(); @@ -238,7 +238,7 @@ it will be useful, but WITHOUT ANY WARRANTY. if (r < b) b = r; else if (r > b) e = r; - if (faker.offsetTop != b * ph) + if (faker.offsetTop != b * ph) faker.style.top = jq.px(b * ph); var hgh = ((e - b) * ph) - dg._zrzoffs, @@ -247,9 +247,9 @@ it will be useful, but WITHOUT ANY WARRANTY. dg._zecnt.style.height = jq.px(hgh); // Update header - dg._zhd.innerHTML = - widget._dateTime[(beginIndex + b)*widget._slotOffs] + ' - ' + - widget._dateTime[(beginIndex + e)*widget._slotOffs]; + dg._zhd.innerHTML = + widget._dateTime[(beginIndex + b) * widget._slotOffs] + ' - ' + + widget._dateTime[(beginIndex + e) * widget._slotOffs]; } function _createDragEndghost(dg) { @@ -257,25 +257,25 @@ it will be useful, but WITHOUT ANY WARRANTY. hgh = dg._zoffs.ph; dg._zdata = { - rows: dg.node.offsetTop / hgh, - cols: dg.node.parentNode.parentNode.cellIndex - widget.ts, - dur: Math.ceil(dg.node.offsetHeight / hgh), + rows: dg.node.offsetTop / hgh, + cols: dg.node.parentNode.parentNode.cellIndex - widget.ts, + dur: Math.ceil(dg.node.offsetHeight / hgh), ghostNode: dg.node - }; + }; } function _createDragEnd(dg, evt) { var widget = dg.control, rows = dg._zdata.rows, bd = new Date(widget.zoneBd), - timeslotTime = 60/widget._timeslots; + timeslotTime = 60 / widget._timeslots; bd.setDate(bd.getDate() + dg._zdata.cols); - bd.setMilliseconds(0);// clean + bd.setMilliseconds(0);// clean var ed = new Date(bd); rows += widget.beginIndex; - bd.setMinutes(bd.getMinutes() + rows * timeslotTime ); - ed.setMinutes(ed.getMinutes() + (rows + dg._zdata.dur) * timeslotTime ); + bd.setMinutes(bd.getMinutes() + rows * timeslotTime); + ed.setMinutes(ed.getMinutes() + (rows + dg._zdata.dur) * timeslotTime); widget.fireCalEvent(bd, ed, evt); } @@ -316,9 +316,9 @@ it will be useful, but WITHOUT ANY WARRANTY. } // Update header r += widget.beginIndex; - dg._zhd.innerHTML = - widget._dateTime[zoffs.bi*widget._slotOffs] + ' - ' + - widget._dateTime[r*widget._slotOffs]; + dg._zhd.innerHTML = + widget._dateTime[zoffs.bi * widget._slotOffs] + ' - ' + + widget._dateTime[r * widget._slotOffs]; } function _resizeDragEndghost(dg) { @@ -338,10 +338,10 @@ it will be useful, but WITHOUT ANY WARRANTY. isOverEndTime = edHour > et || (edHour == et && ed.getMinutes() > 0); if (dur || isOverEndTime) { - //reset in time range + //reset in time range if (isOverEndTime) ed.setHours(widget._et, 0); - ed.setMinutes(ed.getMinutes() + dur * (60/widget._timeslots)); + ed.setMinutes(ed.getMinutes() + dur * (60 / widget._timeslots)); //reset in time range if (bd.getHours() < bt) bd.setHours(bt); @@ -349,8 +349,8 @@ it will be useful, but WITHOUT ANY WARRANTY. widget.fireCalEvent(bd, ed, evt, ce.id); widget._restoreCE = ce; } else { - jq('#'+widget.uuid+'-dd').remove(); - ce.style.visibility = ""; + jq('#' + widget.uuid + '-dd').remove(); + ce.style.visibility = ''; } dg._zrz = false; } @@ -364,23 +364,23 @@ it will be useful, but WITHOUT ANY WARRANTY. bt = widget._bt, et = widget._et, timeslots = widget._timeslots, - timeslotTime = 60/timeslots, + timeslotTime = 60 / timeslots, ph = dg._zoffs.ph, isOverBeginTime = bd.getHours() < bt, isOverEndTime = edHour > et || (edHour == et && ed.getMinutes() > 0); - dg._overIndex = 0; + dg._overIndex = 0; if (isOverBeginTime || isOverEndTime) { - var minutes = (ed-bd) / 60000, + var minutes = (ed - bd) / 60000, id = faker.id; - _setEvtWgtHeight(widget, faker, targetWgt.uuid,(minutes/60 * timeslots * ph)); + _setItemWgtHeight(widget, faker, targetWgt.uuid,(minutes / 60 * timeslots * ph)); if (isOverEndTime) dg._overIndex = _getSlotCount(et, ed, timeslots); if (isOverBeginTime) dg._overIndex = _getSlotCount(bd, bt, timeslots); - } + } dg._zdelta = ce.offsetTop - (evt.pageY + dg.handle.scrollTop - dg._zoffs.t); } @@ -397,7 +397,7 @@ it will be useful, but WITHOUT ANY WARRANTY. cIndex = dg._zoffs.s, lefts = cnt._lefts, cells = dg._zcells, - begin = zoffs.b + begin = zoffs.b, ph = zoffs.ph, th = zoffs.th; @@ -429,9 +429,9 @@ it will be useful, but WITHOUT ANY WARRANTY. } // Update header - dg._zhd.innerHTML = - widget._dateTime[(r + widget.beginIndex)*widget._slotOffs] + ' - ' + - widget._dateTime[(r + zoffs.ei + dg._overIndex)*widget._slotOffs]; + dg._zhd.innerHTML = + widget._dateTime[(r + widget.beginIndex) * widget._slotOffs] + ' - ' + + widget._dateTime[(r + zoffs.ei + dg._overIndex) * widget._slotOffs]; } function _updateDragEndghost(dg) { @@ -439,12 +439,12 @@ it will be useful, but WITHOUT ANY WARRANTY. ce = dg._zevt; gostNode.parent = jq(gostNode.parentNode); - dg._zdata = { + dg._zdata = { rows: (ce.offsetTop - gostNode.offsetTop) / dg._zoffs.ph, - cols: ce.parentNode.parentNode.cellIndex - - gostNode.parentNode.parentNode.cellIndex, + cols: ce.parentNode.parentNode.cellIndex - + gostNode.parentNode.parentNode.cellIndex, ghostNode: gostNode - }; + }; } function _updateDragEnd(dg, evt) { @@ -455,7 +455,7 @@ it will be useful, but WITHOUT ANY WARRANTY. ce = dg._zevt; if (cols || rows) { var timeslots = widget._timeslots, - timeslotTime = 60/timeslots, + timeslotTime = 60 / timeslots, bd = new Date(ce._bd), ed = new Date(ce._ed), bdTimeslot = _getHightOffsPercent(bd, timeslots), @@ -467,27 +467,27 @@ it will be useful, but WITHOUT ANY WARRANTY. //adjust time in time range if (bd.getHours() < bt) { var slotCount = _getSlotCount(bd, bt, timeslots); - bd.setMinutes(bd.getMinutes() + + bd.setMinutes(bd.getMinutes() + slotCount * timeslotTime); - ed.setMinutes(ed.getMinutes() + + ed.setMinutes(ed.getMinutes() + slotCount * timeslotTime); } bd.setDate(bd.getDate() - offset[0]); - bd.setMinutes(bd.getMinutes() - offset[1]); + bd.setMinutes(bd.getMinutes() - offset[1]); ed.setDate(ed.getDate() - offset[0]); ed.setMinutes(ed.getMinutes() - offset[1]); var bdOffset = bd.getTimezoneOffset(), edOffset2 = ed.getTimezoneOffset(); //DST: Fixed different offset after update time - if (edOffset != edOffset2 && ed.getHours()== bd.getHours()) { + if (edOffset != edOffset2 && ed.getHours() == bd.getHours()) { ed = new Date(bd); - ed.setUTCMinutes(ed.getUTCMinutes() + _getSlotCount(bd, ed, timeslots) * timeslotTime); + ed.setUTCMinutes(ed.getUTCMinutes() + _getSlotCount(bd, ed, timeslots) * timeslotTime); } widget.fireCalEvent(bd, ed, evt, ce.id); widget._restoreCE = ce; } else { - jq('#'+widget.uuid+'-dd').remove(); - ce.style.visibility = ""; + jq('#' + widget.uuid + '-dd').remove(); + ce.style.visibility = ''; } } @@ -500,40 +500,40 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { '
'].join(''), _dateTime: [ - '00:00', '00:05', '00:10', '00:15', '00:20', '00:25', '00:30', '00:35', '00:40', '00:45', '00:50', '00:55', - '01:00', '01:05', '01:10', '01:15', '01:20', '01:25', '01:30', '01:35', '01:40', '01:45', '01:50', '01:55', - '02:00', '02:05', '02:10', '02:15', '02:20', '02:25', '02:30', '02:35', '02:40', '02:45', '02:50', '02:55', - '03:00', '03:05', '03:10', '03:15', '03:20', '03:25', '03:30', '03:35', '03:40', '03:45', '03:50', '03:55', - '04:00', '04:05', '04:10', '04:15', '04:20', '04:25', '04:30', '04:35', '04:40', '04:45', '04:50', '04:55', - '05:00', '05:05', '05:10', '05:15', '05:20', '05:25', '05:30', '05:35', '05:40', '05:45', '05:50', '05:55', - '06:00', '06:05', '06:10', '06:15', '06:20', '06:25', '06:30', '06:35', '06:40', '06:45', '06:50', '06:55', - '07:00', '07:05', '07:10', '07:15', '07:20', '07:25', '07:30', '07:35', '07:40', '07:45', '07:50', '07:55', - '08:00', '08:05', '08:10', '08:15', '08:20', '08:25', '08:30', '08:35', '08:40', '08:45', '08:50', '08:55', - '09:00', '09:05', '09:10', '09:15', '09:20', '09:25', '09:30', '09:35', '09:40', '09:45', '09:50', '09:55', - '10:00', '10:05', '10:10', '10:15', '10:20', '10:25', '10:30', '10:35', '10:40', '10:45', '10:50', '10:55', - '11:00', '11:05', '11:10', '11:15', '11:20', '11:25', '11:30', '11:35', '11:40', '11:45', '11:50', '11:55', - '12:00', '12:05', '12:10', '12:15', '12:20', '12:25', '12:30', '12:35', '12:40', '12:45', '12:50', '12:55', - '13:00', '13:05', '13:10', '13:15', '13:20', '13:25', '13:30', '13:35', '13:40', '13:45', '13:50', '13:55', - '14:00', '14:05', '14:10', '14:15', '14:20', '14:25', '14:30', '14:35', '14:40', '14:45', '14:50', '14:55', - '15:00', '15:05', '15:10', '15:15', '15:20', '15:25', '15:30', '15:35', '15:40', '15:45', '15:50', '15:55', - '16:00', '16:05', '16:10', '16:15', '16:20', '16:25', '16:30', '16:35', '16:40', '16:45', '16:50', '16:55', - '17:00', '17:05', '17:10', '17:15', '17:20', '17:25', '17:30', '17:35', '17:40', '17:45', '17:50', '17:55', - '18:00', '18:05', '18:10', '18:15', '18:20', '18:25', '18:30', '18:35', '18:40', '18:45', '18:50', '18:55', - '19:00', '19:05', '19:10', '19:15', '19:20', '19:25', '19:30', '19:35', '19:40', '19:45', '19:50', '19:55', - '20:00', '20:05', '20:10', '20:15', '20:20', '20:25', '20:30', '20:35', '20:40', '20:45', '20:50', '20:55', - '21:00', '21:05', '21:10', '21:15', '21:20', '21:25', '21:30', '21:35', '21:40', '21:45', '21:50', '21:55', - '22:00', '22:05', '22:10', '22:15', '22:20', '22:25', '22:30', '22:35', '22:40', '22:45', '22:50', '22:55', - '23:00', '23:05', '23:10', '23:15', '23:20', '23:25', '23:30', '23:35', '23:40', '23:45', '23:50', '23:55', + '00:00', '00:05', '00:10', '00:15', '00:20', '00:25', '00:30', '00:35', '00:40', '00:45', '00:50', '00:55', + '01:00', '01:05', '01:10', '01:15', '01:20', '01:25', '01:30', '01:35', '01:40', '01:45', '01:50', '01:55', + '02:00', '02:05', '02:10', '02:15', '02:20', '02:25', '02:30', '02:35', '02:40', '02:45', '02:50', '02:55', + '03:00', '03:05', '03:10', '03:15', '03:20', '03:25', '03:30', '03:35', '03:40', '03:45', '03:50', '03:55', + '04:00', '04:05', '04:10', '04:15', '04:20', '04:25', '04:30', '04:35', '04:40', '04:45', '04:50', '04:55', + '05:00', '05:05', '05:10', '05:15', '05:20', '05:25', '05:30', '05:35', '05:40', '05:45', '05:50', '05:55', + '06:00', '06:05', '06:10', '06:15', '06:20', '06:25', '06:30', '06:35', '06:40', '06:45', '06:50', '06:55', + '07:00', '07:05', '07:10', '07:15', '07:20', '07:25', '07:30', '07:35', '07:40', '07:45', '07:50', '07:55', + '08:00', '08:05', '08:10', '08:15', '08:20', '08:25', '08:30', '08:35', '08:40', '08:45', '08:50', '08:55', + '09:00', '09:05', '09:10', '09:15', '09:20', '09:25', '09:30', '09:35', '09:40', '09:45', '09:50', '09:55', + '10:00', '10:05', '10:10', '10:15', '10:20', '10:25', '10:30', '10:35', '10:40', '10:45', '10:50', '10:55', + '11:00', '11:05', '11:10', '11:15', '11:20', '11:25', '11:30', '11:35', '11:40', '11:45', '11:50', '11:55', + '12:00', '12:05', '12:10', '12:15', '12:20', '12:25', '12:30', '12:35', '12:40', '12:45', '12:50', '12:55', + '13:00', '13:05', '13:10', '13:15', '13:20', '13:25', '13:30', '13:35', '13:40', '13:45', '13:50', '13:55', + '14:00', '14:05', '14:10', '14:15', '14:20', '14:25', '14:30', '14:35', '14:40', '14:45', '14:50', '14:55', + '15:00', '15:05', '15:10', '15:15', '15:20', '15:25', '15:30', '15:35', '15:40', '15:45', '15:50', '15:55', + '16:00', '16:05', '16:10', '16:15', '16:20', '16:25', '16:30', '16:35', '16:40', '16:45', '16:50', '16:55', + '17:00', '17:05', '17:10', '17:15', '17:20', '17:25', '17:30', '17:35', '17:40', '17:45', '17:50', '17:55', + '18:00', '18:05', '18:10', '18:15', '18:20', '18:25', '18:30', '18:35', '18:40', '18:45', '18:50', '18:55', + '19:00', '19:05', '19:10', '19:15', '19:20', '19:25', '19:30', '19:35', '19:40', '19:45', '19:50', '19:55', + '20:00', '20:05', '20:10', '20:15', '20:20', '20:25', '20:30', '20:35', '20:40', '20:45', '20:50', '20:55', + '21:00', '21:05', '21:10', '21:15', '21:20', '21:25', '21:30', '21:35', '21:40', '21:45', '21:50', '21:55', + '22:00', '22:05', '22:10', '22:15', '22:20', '22:25', '22:30', '22:35', '22:40', '22:45', '22:50', '22:55', + '23:00', '23:05', '23:10', '23:15', '23:20', '23:25', '23:30', '23:35', '23:40', '23:45', '23:50', '23:55', '00:00' ], - $define : { - days: function() { + $define: { + days: function () { if (!this.desktop) return; var days = this._days, header = this.$n('header'), - cnt = this.$n('cnt'), + cnt = this.$n('cnt'), $row = jq(this.cntRows), daylongMoreRows = this.daylongMoreRows, zcls = this.getZclass(), @@ -541,19 +541,19 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { offset = days - oldRowCount; if (zk.ie) { - jq(header.offsetParent).find("td:not(.z-calendars-daylong-evt)").attr('colspan',days); + jq(header.offsetParent).find('td:not(.z-calendars-daylong-evt)').attr('colspan',days); jq(cnt).find('tr:eq(1) td:last').attr('colspan',days); - } else jq(this.$n('inner')).find("[colspan]").attr('colspan',days); + } else jq(this.$n('inner')).find('[colspan]').attr('colspan',days); if (offset > 0) { - var titleRowHtml = '
', + var titleRowHtml = '
', daylongRowHtml = ' ', - cntRowHtml ='
', + cntRowHtml = '
', html1 = [], html2 = [], html3 = []; - for(var i = offset; i--;) { + for (var i = offset; i--;) { html1.push(titleRowHtml); html2.push(daylongRowHtml); html3.push(cntRowHtml); @@ -562,9 +562,9 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { jq(daylongMoreRows).append(html2.join('')); $row.append(html3.join('')); } else if (offset < 0) { - jq(this.$n('daylong')).find('.z-calendars-daylong-more:gt('+(days-1)+')').remove(); - jq(header).children('.z-calendars-day-of-week:gt('+(days-1)+')').remove(); - $row.children('.z-calendars-week-day:gt('+(days-1)+')').remove(); + jq(this.$n('daylong')).find('.z-calendars-daylong-more:gt(' + (days - 1) + ')').remove(); + jq(header).children('.z-calendars-day-of-week:gt(' + (days - 1) + ')').remove(); + $row.children('.z-calendars-week-day:gt(' + (days - 1) + ')').remove(); } if (zk.ie || zk.opera) @@ -573,14 +573,14 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { this.title = jq(header).find('.' + this.getZclass() + '-day-of-week-cnt'); this.updateDateRange_(); }, - events: function () { - this._events = jq.evalJSON(this._events); + items: function () { + this._items = jq.evalJSON(this._items); if (!this.$n()) return; for (var i = this.nChildren; i--;) { var child = this.getChildAt(i), className = child.className; - if (className == 'calendar.DayEvent' || className == 'calendar.DaylongEvent') + if (className == 'calendar.DayItem' || className == 'calendar.DaylongItem') this.removeChild(child); } @@ -602,7 +602,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { for (var i = this._zonesOffset.length; i--;) this._zonesOffset[i] = zk.parseInt(this._zonesOffset[i]); - if (!this.desktop) return; + if (!this.desktop) return; this.updateDateOfBdAndEd_(); @@ -610,12 +610,12 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { this.updateTimeZoneCol_({ignoreFirstCol: true}); }, - timeslots: function(){ + timeslots: function () { if (!this.desktop) return; var hourSepRowHtml = '
', html = []; - for(var i = this._timeslots/2; i--;) + for (var i = this._timeslots / 2; i--;) html.push(hourSepRowHtml); hourSepRowHtml = html.join(''); @@ -629,7 +629,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { this.beforeSize(); this.onSize(); }, - bt: _zkf = function(){ + bt: _zkf = function () { if (!this.desktop) return; this.updateTimeZoneCol_(this); }, @@ -640,35 +640,35 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { this.$supers('bind_', arguments); this._scrollInfo = {}; - this._dayEvents = []; - this._daylongEvents = []; + this._dayItems = []; + this._daylongItems = []; this._daylongSpace = []; this._daySpace = []; var zcls = this.getZclass(), p = this.params; - p._fakerMoreCls = zcls + "-daylong-faker-more"; - p._fakerNoMoreCls = zcls + "-daylong-faker-nomore"; + p._fakerMoreCls = zcls + '-daylong-faker-more'; + p._fakerNoMoreCls = zcls + '-daylong-faker-nomore'; var widget = this, - $cnt = jq(this.$n("cnt")), + $cnt = jq(this.$n('cnt')), zcls = this.getZclass(); //define all positions //put the title - this.title = jq(this.$n("header")).find('.' + zcls + '-day-of-week-cnt'); + this.title = jq(this.$n('header')).find('.' + zcls + '-day-of-week-cnt'); //put the daylong event this.daylongRows = this.$n('daylong').firstChild.firstChild; //put the daylong more space this.daylongMoreRows = this.daylongRows.firstChild; //put the day event - this.cntRows = $cnt.find("tr")[zk.ie ? 2: 1]; + this.cntRows = $cnt.find('tr')[zk.ie ? 2 : 1]; - this.weekDay = jq(this.cntRows).children('.'+ zcls +'-week-day'); + this.weekDay = jq(this.cntRows).children('.' + zcls + '-week-day'); -/****************************** zone arrow ******************************/ - var a = this.$n("hdarrow"), - hd = this.$n("header"), +/****************************** zone arrow ******************************/ + var a = this.$n('hdarrow'), + hd = this.$n('header'), title = this.title, ed = new Date(this.zoneEd); //store value in head tag @@ -676,12 +676,12 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { ed = calUtil.addDay(ed, -1); title[i].time = this.fixTimeZoneFromClient(ed); } - jq(a).bind("click", this.onArrowClick); -/************************** head event **************************************/ + jq(a).bind('click', this.onArrowClick); +/************************** head event **************************************/ if (hd.childNodes.length > this.ts + 2) this.addDayClickEvent_(hd); - $cnt.bind("scroll", function () { + $cnt.bind('scroll', function () { widget._scrollInfo[widget.uuid] = $cnt[0].scrollTop; }); @@ -689,76 +689,76 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { this.editMode(true); }, - unbind_ : function () { - this.title = this.daylongRows = this.daylongMoreRows = this.cntRows = - this._scrollInfo = this._dayEvents = this._daylongEvents = + unbind_: function () { + this.title = this.daylongRows = this.daylongMoreRows = this.cntRows = + this._scrollInfo = this._dayItems = this._daylongItems = this._daylongSpace = this._daySpace = null; this.$supers('unbind_', arguments); }, _resetDaylongPosition: function () { var daylongRows = jq(this.daylongRows), - zcls = this.getZclass(); - //clean all rows exclusive blank row + zcls = this.getZclass(); + //clean all rows exclusive blank row daylongRows.children().not(':last-child').remove(); - // append all rows + // append all rows for (var i = this._daylongSpace.length; i--;) { daylongRows.prepend(''); var rowSpace = this._daylongSpace[i], - tr = jq(daylongRows[0].firstChild); + tr = jq(daylongRows[0].firstChild); //append events for (var k = 0, l = rowSpace.length; k < l; k++) { var childWgt = rowSpace[k], ce = childWgt; - if (k == 0){//first - ce._days = childWgt._days; - this.drawEvent_(childWgt._preOffset, zcls + '-daylong-evt', tr, ce); + if (k == 0) {//first + ce._days = childWgt._days; + this.drawItem_(childWgt._preOffset, zcls + '-daylong-evt', tr, ce); } else { - var preWidget = rowSpace[k-1], + var preWidget = rowSpace[k - 1], start = childWgt._preOffset, preEnd = preWidget._preOffset + preWidget._days, offset = start - preEnd; ce._days = childWgt._days; - this.drawEvent_(offset, zcls + '-daylong-evt', tr, ce); + this.drawItem_(offset, zcls + '-daylong-evt', tr, ce); } - ce.style.visibility = "";//recover moving event + ce.style.visibility = '';//recover moving event if (k == l - 1) {//last var html = ''; - for (var n = childWgt._afterOffset; n--;) + for (var n = childWgt._afterOffset; n--;) html += ' '; tr.append(html); } } } jq('#' + this.uuid + '-hdarrow').removeClass(this.getZclass() + '-week-header-arrow-close'); - }, + }, _rePositionDay: function () { - this._dayEvents.sort(this.dateSorting_); + this._dayItems.sort(this.dateSorting_); this._daySpace = []; for (var i = this._days; i--;) this._daySpace.push([]); // all daylong event - for (var i = 0 ,j = this._dayEvents.length; i < j; i++) { - var dayEvent = this._dayEvents[i]; - this._daySpace[dayEvent._preOffset].push(dayEvent); + for (var i = 0 ,j = this._dayItems.length; i < j; i++) { + var dayItem = this._dayItems[i]; + this._daySpace[dayItem._preOffset].push(dayItem); } this.fixPosition(); }, - _rePositionDaylong: function () { - this._daylongEvents.sort(this.dateSorting_); - this._daylongSpace = []; + _rePositionDaylong: function () { + this._daylongItems.sort(this.dateSorting_); + this._daylongSpace = []; var uuid = this.uuid; // all daylong event - for (var i = 0, j = this._daylongEvents.length; i < j; i++) { - var daylongEvent = this._daylongEvents[i]; + for (var i = 0, j = this._daylongItems.length; i < j; i++) { + var daylongEvent = this._daylongItems[i]; this.putInDaylongSpace_(this._daylongSpace, daylongEvent); } @@ -779,7 +779,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { _updateHourColSize(this); if (_updateTimeZoneColSize(this)) - opts = {ignoreFirstCol: false} + opts = {ignoreFirstCol: false}; //update texts for (var i = ts; i--;) { @@ -791,7 +791,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { div = str.substr(str.indexOf('<'),str.length); zoneText.html(zones[index] + div); this.clearCache(); - jq(this.$n("hdarrow")).bind("click", this.onArrowClick); + jq(this.$n('hdarrow')).bind('click', this.onArrowClick); } else zoneText.html(zones[index]); //fist column is not need to redraw @@ -802,7 +802,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { current.setMinutes(0); for (var k = beginHour; k < endHour; k++) { current.setHours(k); - var context = captionByTimeOfDay ? captionByTimeOfDay[ index * 24 + k ]: + var context = captionByTimeOfDay ? captionByTimeOfDay[ index * 24 + k ] : zk.fmt.Date.formatDate(this.getTimeZoneTime(current,zk.parseInt(this._zonesOffset[index])),'HH:mm'); jq(cell[k - bt]).html(context); @@ -813,22 +813,22 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { updateDateRange_: function () { this.updateDateOfBdAndEd_(); - this._captionByDate = this.captionByDate ? jq.evalJSON(this.captionByDate): null; + this._captionByDate = this.captionByDate ? jq.evalJSON(this.captionByDate) : null; //ZKCAL-54: Fix setting time label format by DateFormatter not working - this._captionByTimeOfDay = this.captionByTimeOfDay ? jq.evalJSON(this.captionByTimeOfDay): null; - if(!this.$n())return; + this._captionByTimeOfDay = this.captionByTimeOfDay ? jq.evalJSON(this.captionByTimeOfDay) : null; + if (!this.$n()) return; var zcls = this.getZclass(); - this.weekDay = jq(this.cntRows).children('.'+ zcls +'-week-day'); + this.weekDay = jq(this.cntRows).children('.' + zcls + '-week-day'); - var hd = jq(this.$n("header")), - cnt = jq(this.$n("cnt")), + var hd = jq(this.$n('header')), + cnt = jq(this.$n('cnt')), titles = this.title, ed = new Date(this.zoneEd), current = new Date(), - week_day = zcls + "-week-day", - week_today = zcls + "-week-today", - week_weekend = zcls + "-week-weekend", + week_day = zcls + '-week-day', + week_today = zcls + '-week-today', + week_weekend = zcls + '-week-weekend', weekDay = this.weekDay; //remove today and weekend class @@ -846,9 +846,9 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { d.setHours(d.getHours() + 2); //adjust to correct date var title = titles[i], - content = this._captionByDate ? this._captionByDate[i] : + content = this._captionByDate ? this._captionByDate[i] : zk.fmt.Date.formatDate(d, 'EEE ') + - '
' + zk.fmt.Date.formatDate(d, this.weekFmt) + '
'; + '
' + zk.fmt.Date.formatDate(d, this.weekFmt) + '
'; jq(title).html(content); title.time = this.fixTimeZoneFromClient(ed); if (ed.getDay() == 0 || ed.getDay() == 6) {//SUNDAY or SATURDAY @@ -863,24 +863,24 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { } }, - cleanEvtAry_: function () { - this._eventKey = {}; - this._daylongEvents = []; - this._dayEvents = []; + cleanItemAry_: function () { + this._itemKey = {}; + this._daylongItems = []; + this._dayItems = []; }, - processChildrenWidget_: function (isExceedOneDay, event) { - var dayEvent = isExceedOneDay ? - new calendar.DaylongEvent({event:event}): - new calendar.DayEvent({event:event}) - zoneBd = event.zoneBd, - zoneEd = event.zoneEd; - if (!isExceedOneDay && - (zoneBd.getHours() >= this._et || + processChildrenWidget_: function (isExceedOneDay, item) { + var dayItem = isExceedOneDay ? + new calendar.DaylongItem({item: item}) : + new calendar.DayItem({item: item}), + zoneBd = item.zoneBd, + zoneEd = item.zoneEd; + if (!isExceedOneDay && + (zoneBd.getHours() >= this._et || (zoneEd.getHours() <= this._bt && zoneEd.getHours() != 0 && zoneEd.getMinutes() == 0))) - return; - this.appendChild(dayEvent); - this[isExceedOneDay ? '_daylongEvents': '_dayEvents'].push(dayEvent.$n()); + return; + this.appendChild(dayItem); + this[isExceedOneDay ? '_daylongItems' : '_dayItems'].push(dayItem.$n()); }, getDragDataObj_: function () { @@ -898,37 +898,37 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { html.push('
'); hs.push(cnt.firstChild.offsetHeight); return html.join(''); - }, + }, getRow: function (cnt) { return cnt.firstChild.firstChild.lastChild.firstChild; - }, + }, getCols: function (p, dg) { - return Math.floor((p[0] - dg._zoffs.l)/dg._zdim.w); - }, + return Math.floor((p[0] - dg._zoffs.l) / dg._zdim.w); + }, getRows: function () { return 0; - }, - getDur: function (dg) { + }, + getDur: function (dg) { return dg._zpos1[0]; - }, + }, getNewDate: function (widget, dg) { var c = dg._zpos[0], c1 = dg._zpos1[0], offs = c < c1 ? c : c1, - bd = new Date(widget.zoneBd) + bd = new Date(widget.zoneBd), ed = new Date(widget.zoneBd); bd.setDate(bd.getDate() + offs); ed.setDate(bd.getDate() + dg._zpos1[2]); - return {bd:bd, ed:ed}; - } + return {bd: bd, ed: ed}; + } }; return this._dragDataObj; - }, + }, - reAlignEvents_: function (hasAdd) { - if (hasAdd.day) + reAlignItems_: function (hasAdd) { + if (hasAdd.day) this._rePositionDay(); if (hasAdd.daylong) @@ -937,13 +937,13 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { // recalculate this.beforeSize(); this.onSize(); - }, + }, removeNodeInArray_: function (childWidget, hasAdd) { - var isDayEvent = childWidget.className == 'calendar.DayEvent'; - this[isDayEvent ? '_dayEvents': '_daylongEvents'].$remove(childWidget.$n()); - hasAdd[isDayEvent ? 'day': 'daylong'] = true; - }, + var isDayItem = childWidget.className == 'calendar.DayItem'; + this[isDayItem ? '_dayItems' : '_daylongItems'].$remove(childWidget.$n()); + hasAdd[isDayItem ? 'day' : 'daylong'] = true; + }, onClick: function (cnt, evt) { var widget = zk.Widget.$(cnt), @@ -951,10 +951,10 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { if (!cnt._lefts || p[0] <= cnt._lefts[0]) return; - var ce = zk.Widget.$(evt.target).event; + var ce = zk.Widget.$(evt.target).item; if (ce) { - widget.fire("onEventEdit",{ + widget.fire('onItemEdit', { data: [ce.id,p[0],p[1], jq.innerWidth(),jq.innerHeight()]}); } else { var ts = widget.ts, @@ -968,7 +968,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { cIndex = cells.length - ts, rows = Math.floor((y + cnt.scrollTop - offs[1]) / ph), timeslots = widget._timeslots, - timeslotTime = 60/timeslots; + timeslotTime = 60 / timeslots; for (; cIndex--;) { //Fix ZKCAL-55: Problems with horizontal scrollbar @@ -982,42 +982,42 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { jq(cells[ts + cIndex].firstChild).prepend( widget.ddTemplate.replace(new RegExp("%([1-2])", "g"), function (match, index) { - return index < 2 ? widget.uuid + '-dd' : 'z-calevent'; + return index < 2 ? widget.uuid + '-dd' : 'z-calitem'; }) ); - var faker = jq('#'+widget.uuid+'-dd')[0]; - jq(faker).addClass(widget.getZclass() + "-evt-ghost"); + var faker = jq('#' + widget.uuid + '-dd')[0]; + jq(faker).addClass(widget.getZclass() + '-evt-ghost'); faker.style.top = jq.px(rows * ph); var offsHgh = 0, - body = jq('#'+widget.uuid+'-dd-body')[0], + body = jq('#' + widget.uuid + '-dd-body')[0], height = 0, inner = body.firstChild.firstChild; rows += widget.beginIndex; var beginIndex = rows * widget._slotOffs, - eventTimeSlot = this.getNewEventTimeSlots_(); - endIndex = beginIndex + (eventTimeSlot * timeslotTime / 5); + itemTimeSlot = this.getNewItemTimeSlots_(); + endIndex = beginIndex + (itemTimeSlot * timeslotTime / 5); inner.firstChild.innerHTML = widget._dateTime[beginIndex] + ' - ' + widget._dateTime[endIndex]; - for (var child = jq(faker).children().get(0);child;child=child.nextSibling) { - if (this.isLegalChild(child)) - height+=child.offsetHeight; + for (var child = jq(faker).children().get(0);child;child = child.nextSibling) { + if (this.isLegalChild(child)) + height += child.offsetHeight; } height += zk(body).padBorderHeight(); height += zk(body.firstChild).padBorderHeight(); height += zk(inner).padBorderHeight(); height += 2; - inner.style.height = jq.px((ph*eventTimeSlot) - height); + inner.style.height = jq.px((ph * itemTimeSlot) - height); var bd = new Date(widget.zoneBd); bd.setDate(bd.getDate() + cIndex); bd.setMilliseconds(0);// clean bd.setMinutes(bd.getMinutes() + rows * timeslotTime); var ed = new Date(bd); - ed.setMinutes(ed.getMinutes() + eventTimeSlot * timeslotTime); + ed.setMinutes(ed.getMinutes() + itemTimeSlot * timeslotTime); //ZKCAL-50: available to click on DST day start from 01:00 if (bd.getTime() == ed.getTime() && rows == timeslots) { bd.setHours(bd.getHours() + 1); @@ -1029,22 +1029,22 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { evt.stop(); }, - //Feature ZKCAL-51: override to define default event time duration - getNewEventTimeSlots_: function() { + //Feature ZKCAL-51: override to define default item time duration + getNewItemTimeSlots_: function () { return this._timeslots; }, onDaylongClick: function (daylong, evt) { var widget = zk.Widget.$(daylong), - ce = zk.Widget.$(evt.target).event, + ce = zk.Widget.$(evt.target).item, p = [Math.round(evt.pageX), Math.round(evt.pageY)]; //ZKCAL-42: sometimes it returns float number in IE 10 - if (ce) { - widget.fire("onEventEdit",{ - data: [ce.id, p[0], p[1], jq.innerWidth(), jq.innerHeight()]}); + if (ce) { + widget.fire('onItemEdit', { + data: [ce.id, p[0], p[1], jq.innerWidth(), jq.innerHeight()]}); } else { var zcls = widget.getZclass(), - html = '
' + html = '
' + '
'; jq(document.body).prepend(html); @@ -1052,7 +1052,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { var row = daylong.firstChild.firstChild.lastChild, width = row.firstChild.offsetWidth, offs = zk(daylong).revisedOffset(), - cols = Math.floor((p[0] - offs[0])/width), + cols = Math.floor((p[0] - offs[0]) / width), zoneBd = widget.zoneBd, bd = new Date(widget.zoneBd); if (zoneBd.getHours() == 23) //ZKCAL-50: DST cross between week @@ -1074,25 +1074,25 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { s: zinfo.length }; - widget.fixRope_(zinfo, jq('#'+widget.uuid+"-rope")[0].firstChild, cols, - 0, zoffs, {w: width, h: daylong.offsetHeight, hs:[daylong.offsetHeight]}, 1); + widget.fixRope_(zinfo, jq('#' + widget.uuid + '-rope')[0].firstChild, cols, + 0, zoffs, {w: width, h: daylong.offsetHeight, hs: [daylong.offsetHeight]}, 1); var ed = new Date(bd); ed = calUtil.addDay(ed, 1); ed.setHours(0); //DST case - widget.fire("onEventCreate", { + widget.fire('onItemCreate', { data: [ - widget.fixTimeZoneFromClient(bd), - widget.fixTimeZoneFromClient(ed), - p[0], - p[1], - jq.innerWidth(), + widget.fixTimeZoneFromClient(bd), + widget.fixTimeZoneFromClient(ed), + p[0], + p[1], + jq.innerWidth(), jq.innerHeight() ] }); widget._ghost[widget.uuid] = function () { - jq('#'+widget.uuid+"-rope").remove(); + jq('#' + widget.uuid + '-rope').remove(); delete widget._ghost[widget.uuid]; }; } @@ -1105,21 +1105,21 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { $a = jq(a), widget = zk.Widget.$(a), zcls = widget.getZclass(), - cls = zcls + "-week-header-arrow-close"; + cls = zcls + '-week-header-arrow-close'; isClose = $a.hasClass(cls), - daylong = widget.$n("daylong"), - rows = daylong.firstChild.rows, + daylong = widget.$n('daylong'), + rows = daylong.firstChild.rows, len = rows.length; widget.clearGhost(); - isClose ? $a.removeClass(cls): $a.addClass(cls); + isClose ? $a.removeClass(cls) : $a.addClass(cls); if (len < 2) return; // nothing to do if (!isClose) { var data = [], - datas = rows[len-1].cells.length; + datas = rows[len - 1].cells.length; for (var i = 0, c = datas; c--; i++) data[i] = []; @@ -1127,32 +1127,32 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { for (var k = 0, z = 0, cells = rows[i].cells, cl = cells.length; k < cl && z + k < datas; k++) { if (cells[k].firstChild.id) - data[k+z].push(cells[k].firstChild); + data[k + z].push(cells[k].firstChild); var cols = cells[k].colSpan; while (--cols > 0) - data[k+ ++z].push(cells[k].firstChild); + data[k + ++z].push(cells[k].firstChild); } - rows[i].style.display = "none"; + rows[i].style.display = 'none'; } var faker = daylong.firstChild.insertRow(len - 1); for (var i = datas; i--;) { cell = faker.insertCell(0); cell.className = rows[len].cells[i].className; - jq(cell).addClass(zcls + "-daylong-faker-more"); + jq(cell).addClass(zcls + '-daylong-faker-more'); if (data[i].length > 0) { var evts = data[i]; - cell.innerHTML = calUtil.format(msgcal.dayMORE, [evts.length] ) - jq(cell).bind("click", widget.onMoreClick); + cell.innerHTML = calUtil.format(msgcal.dayMORE, [evts.length]); + jq(cell).bind('click', widget.onMoreClick); } else { - cell.innerHTML = zk.ie ? " " : ""; - jq(cell).addClass(zcls + "-daylong-faker-nomore"); + cell.innerHTML = zk.ie ? ' ' : ''; + jq(cell).addClass(zcls + '-daylong-faker-nomore'); } } - widget._evtsData = data; + widget._itemsData = data; } else { for (var i = 0, j = len - 1; i < j; i++) - rows[i].style.display = ""; + rows[i].style.display = ''; jq(rows[len - 2]).remove(); } @@ -1170,22 +1170,22 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { uuid = widget.uuid, ci = cell.cellIndex, pp, - table = jq('#'+widget.uuid+'-ppcnt')[0]; + table = jq('#' + widget.uuid + '-ppcnt')[0]; - widget.clearGhost(); + widget.clearGhost(); if (!widget._pp) { jq(document.body).append(widget.ppTemplate.replace(new RegExp("%([1-2])", "g"), function (match, index) { return index < 2 ? uuid : 'z-calpp'; - })); - pp = widget._pp = jq('#'+uuid+'-pp')[0]; + })); + pp = widget._pp = jq('#' + uuid + '-pp')[0]; jq(document.body).bind('click', widget.proxy(widget.unMoreClick)); - table = jq('#'+uuid+'-ppcnt')[0]; + table = jq('#' + uuid + '-ppcnt')[0]; - if(!widget._readonly) - jq(widget._pp).bind("click", widget.proxy(widget.onPopupClick)); + if (!widget._readonly) + jq(widget._pp).bind('click', widget.proxy(widget.onPopupClick)); } else { if (widget._pp.ci == ci) { - // ignore onEventCreate + // ignore onItemCreate evt.stop(); return; } @@ -1200,18 +1200,18 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { var date = jq('#' + widget.uuid).find('.z-calendars-day-of-week-cnt')[ci], targetDate = new Date(date.time); if (targetDate) - jq('#' + widget.uuid+'-pphd')[0].innerHTML = zk.fmt.Date.formatDate(targetDate, 'EEE, MMM/d'); + jq('#' + widget.uuid + '-pphd')[0].innerHTML = zk.fmt.Date.formatDate(targetDate, 'EEE, MMM/d'); - var offs= zk(cell).revisedOffset(), + var offs = zk(cell).revisedOffset(), wd = daylong.offsetWidth, csz = cell.parentNode.cells.length, - single = wd/csz; + single = wd / csz; - wd = csz > 2 ? single*3*0.9 : wd * 0.8; + wd = csz > 2 ? single * 3 * 0.9 : wd * 0.8; if (csz > 2 && ci > 0) - if (csz > ci+1) - pp.style.left = jq.px(offs[0] - (wd - single)/2); + if (csz > ci + 1) + pp.style.left = jq.px(offs[0] - (wd - single) / 2); else pp.style.left = jq.px(offs[0] - (wd - single)); else if (csz > 2) @@ -1222,69 +1222,69 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { pp.style.width = jq.px(wd); //filling data - var evts = widget._evtsData[ci], + var evts = widget._itemsData[ci], oneDay = calUtil.DAYTIME, bd = widget.zoneBd; ed = new Date(bd); ed = calUtil.addDay(ed, 1); - for (var i = evts.length; i--;) { + for (var i = evts.length; i--;) { var tr = table.insertRow(0), cr = tr.insertCell(0), cm = tr.insertCell(0), cl = tr.insertCell(0), ce = evts[i], - event = zk.Widget.$(ce).event, - hc = event.headerColor, - cc = event.contentColor, - zcls = event.zclass; + item = zk.Widget.$(ce).item, + hc = item.headerColor, + cc = item.contentColor, + zcls = item.zclass; - ce._bd = ce._bd || event.zoneBd; - ce._ed = ce._ed || event.zoneEd; - cl.className = "z-calpp-evt-l"; + ce._bd = ce._bd || item.zoneBd; + ce._ed = ce._ed || item.zoneEd; + cl.className = 'z-calpp-evt-l'; if (bd.getTime() + (oneDay * ci) - ce._bd.getTime() >= 1000) { var info = [ - ce.id + "-fl", + ce.id + '-fl', zcls, - zcls + "-left", - ce._bd.getMonth() + 1 + "/" + ce._bd.getDate(), + zcls + '-left', + ce._bd.getMonth() + 1 + '/' + ce._bd.getDate(), hc ? ' style="background:' + hc + '"' : '', cc ? ' style="background:' + cc + '"' : '', cc ? ' style="border-bottom-color:' + cc + ';border-top-color:' + cc + '"' : '', cc ? ' style="background:' + cc + '"' : '', - ]; - cl.innerHTML = widget.evtTemplate.replace(new RegExp("%([1-8])", "g"), function (match, index) { + ]; + cl.innerHTML = widget.itemTemplate.replace(new RegExp("%([1-8])", "g"), function (match, index) { return info[index - 1]; }); } else - cl.innerHTML = ""; + cl.innerHTML = ''; - cm.className = "z-calpp-evt-m"; + cm.className = 'z-calpp-evt-m'; var faker = ce.cloneNode(true); - jq(faker).addClass("z-calpp-evt-faker"); + jq(faker).addClass('z-calpp-evt-faker'); cm.appendChild(faker); - cr.className = "z-calpp-evt-r"; + cr.className = 'z-calpp-evt-r'; if (ce._ed.getTime() - (ed.getTime() + (oneDay * ci)) >= 1000) { var d = new Date(ce._ed.getTime() - 1000), info = [ - ce.id + "-fr", + ce.id + '-fr', zcls, - zcls + "-right", - d.getMonth() + 1 + "/" + d.getDate(), + zcls + '-right', + d.getMonth() + 1 + '/' + d.getDate(), hc ? ' style="background:' + hc + '"' : '', cc ? ' style="background:' + cc + '"' : '', cc ? ' style="border-bottom-color:' + cc + ';border-top-color:' + cc + '"' : '', cc ? ' style="background:' + cc + '"' : '' - ]; - cr.innerHTML = widget.evtTemplate.replace(new RegExp("%([1-8])", "g"), function (match, index) { + ]; + cr.innerHTML = widget.itemTemplate.replace(new RegExp("%([1-8])", "g"), function (match, index) { return info[index - 1]; }); } else - cr.innerHTML = ""; + cr.innerHTML = ''; } - zk(pp).cleanVisibility(); + zk(pp).cleanVisibility(); evt.stop(); }, @@ -1294,24 +1294,24 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { data = zk.copy({dragged: drag.control}, evt.data), ce; - if ((ce = zk.Widget.$(target)) && + if ((ce = zk.Widget.$(target)) && ce.className != 'calendar.CalendarsDefault') { - data.ce = ce.event.id; + data.ce = ce.item.id; target = ce.$n().parentNode; } - if (jq.nodeName(target, 'td') && + if (jq.nodeName(target, 'td') && jq(target.offsetParent).hasClass('z-calendars-daylong-cnt')) { time.setDate(time.getDate() + target.cellIndex); } else if (jq(target).hasClass('z-calendars-week-day-cnt')) { target = target.parentNode; time.setDate(time.getDate() + target.cellIndex - this.ts); - var cnt = this.$n("cnt"), + var cnt = this.$n('cnt'), offs = zk(cnt).revisedOffset(), - rows = Math.floor((evt.pageY + cnt.scrollTop - offs[1]) / this.perHeight) + rows = Math.floor((evt.pageY + cnt.scrollTop - offs[1]) / this.perHeight) + this.beginIndex; - time.setMinutes(time.getMinutes() + rows * 60/this._timeslots ); + time.setMinutes(time.getMinutes() + rows * 60 / this._timeslots); } else return; data.time = this.fixTimeZoneFromClient(time); this.fire('onDrop', data, null, zk.Widget.auDelay); @@ -1326,10 +1326,10 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { var uuid = this.uuid; if (bd.getMinutes() == ed.getMinutes() && bd.getHours() == ed.getHours()) { jq.alert('The DST begin time and end time cannot be equal', {icon: 'ERROR'}); - jq('#'+uuid+'-dd').remove(); + jq('#' + uuid + '-dd').remove(); delete this._ghost[uuid]; if (id) - jq(id, zk)[0].style.visibility = ""; + jq(id, zk)[0].style.visibility = ''; } else { //ZKCAL-50: add event on DST start day var zoneBd = this.zoneBd, @@ -1345,15 +1345,15 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { jq.innerWidth(), jq.innerHeight() ], - eventName = "onEventCreate"; + eventName = 'onItemCreate'; if (id) { data.unshift(id); - eventName = "onEventUpdate"; + eventName = 'onItemUpdate'; } this.fire(eventName, {data: data}); var widget = this; - this._ghost[uuid] = function () { - jq('#'+uuid+'-dd').remove(); + this._ghost[uuid] = function () { + jq('#' + uuid + '-dd').remove(); delete widget._ghost[uuid]; }; } @@ -1361,13 +1361,13 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { getTimeIndex: function (date) { var timeslots = this._timeslots, - timeslotTime = 60/timeslots, + timeslotTime = 60 / timeslots, // ZKCAL-70: index out of number of total slots index index = Math.max(((date.getHours() - this._bt) * timeslots) + - Math.floor(date.getMinutes()/timeslotTime), 0), + Math.floor(date.getMinutes() / timeslotTime), 0), maxAvailableTimeslotIndex = (this._et - this._bt) * timeslots - 1; - return Math.min(index, maxAvailableTimeslotIndex); + return Math.min(index, maxAvailableTimeslotIndex); }, _getTimeOffset: function (d, dur, dur2) { @@ -1375,14 +1375,14 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { index = dur2 ? dur2 : this.getTimeIndex(d) + dur, timeslots = this._timeslots; - d1.setHours(this._bt + Math.floor(index/timeslots), (index%timeslots) * (60/timeslots), 0, 0); + d1.setHours(this._bt + Math.floor(index / timeslots), (index % timeslots) * (60 / timeslots), 0, 0); d.setMilliseconds(0); return dur2 ? d1 - d : d - d1; - }, + }, - fixPosition: function () { - var cnt = this.$n("cnt"), + fixPosition: function () { + var cnt = this.$n('cnt'), row = this.cntRows, perHgh = this.perHeight, weekDay = this.weekDay, @@ -1394,19 +1394,19 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { var list = this._daySpace[i]; if (!list.length) continue; var data = []; - for (var n = slotCount; n--;) + for (var n = slotCount; n--;) data[n] = []; - for (var k = 0, l =list.length; k < l; k++) { + for (var k = 0, l = list.length; k < l; k++) { var ce = list[k], - childWidget = zk.Widget.$(ce), - target= weekDay[ce._preOffset].firstChild, - event = childWidget.event, - bd = new Date(event.zoneBd), - ed = new Date(event.zoneEd), + childWidget = zk.Widget.$(ce), + target = weekDay[ce._preOffset].firstChild, + item = childWidget.item, + bd = new Date(item.zoneBd), + ed = new Date(item.zoneEd), isCrossDay = ed.getDate() != bd.getDate(); - jq(target).append(ce); - ce.style.visibility = ""; + jq(target).append(ce); + ce.style.visibility = ''; ce._bd = bd; ce._ed = ed; @@ -1415,7 +1415,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { ed = new Date(ed.getTime() - 1000); // fix hgh - var bi = this.getTimeIndex(bd), + var bi = this.getTimeIndex(bd), ei = this.getTimeIndex(ed), top = bi * perHgh, timeslots = this._timeslots, @@ -1423,12 +1423,12 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { edHeightOffs = 0; if (bi) { - var bdTimeslot = _getHightOffsPercent(bd, timeslots) - bdHeightOffs = bdTimeslot ? perHgh * bdTimeslot: 0; + var bdTimeslot = _getHightOffsPercent(bd, timeslots); + bdHeightOffs = bdTimeslot ? perHgh * bdTimeslot : 0; } if (ei) { - var edTimeslot = _getHightOffsPercent(ed, timeslots) - edHeightOffs = edTimeslot ? perHgh * edTimeslot: 0; + var edTimeslot = _getHightOffsPercent(ed, timeslots); + edHeightOffs = edTimeslot ? perHgh * edTimeslot : 0; if (isCrossDay)//ZKCAL-29 ed = new Date(ed.getTime() + 1000); } @@ -1436,7 +1436,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { ce._bi = bi; ce._ei = ei; ce.style.top = jq.px(top + bdHeightOffs); - _setEvtWgtHeight(this, ce, ce.id, ((ei -bi) * perHgh) - bdHeightOffs + edHeightOffs); + _setItemWgtHeight(this, ce, ce.id, ((ei - bi) * perHgh) - bdHeightOffs + edHeightOffs); if (bi < 0) continue; @@ -1445,7 +1445,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { var tmp = data[bi++]; if (tmp[n]) { for (;;) { - if (!tmp[++n]) + if (!tmp[++n]) break; } } @@ -1455,46 +1455,46 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { this.clearGhost(); - // fix width + // fix width var childWidget = list[list.length - 1], target = weekDay[childWidget._preOffset].firstChild; for (var ce = target.firstChild; ce; ce = ce.nextSibling) { - var bd = ce._bd, - bi = ce._bi, - ei = ce._ei, - maxSize = 0, + var bd = ce._bd, + bi = ce._bi, + ei = ce._ei, + maxSize = 0, tmp = {}; if (bi < 0) continue; for (var m = bi; m <= ei && m < slotCount; m++) { var len = data[m].length; - if (maxSize < len) + if (maxSize < len) maxSize = len; for (var n = 0; n < len; n++) { - if (!data[m][n] || tmp[data[m][n].id]) + if (!data[m][n] || tmp[data[m][n].id]) continue; tmp[data[m][n].id] = 1; var ei2 = data[m][n]._ei; - if (ei < ei2) + if (ei < ei2) ei = ei2; } } - var len = maxSize? maxSize: 1, + var len = maxSize ? maxSize : 1, width = 100 / len, index = data[bi].indexOf(ce); - if (index == maxSize - 1) - ce.style.width = width + "%"; - else - ce.style.width = (width * 1.7) + "%"; - ce.style.left = width * index + "%"; + if (index == maxSize - 1) + ce.style.width = width + '%'; + else + ce.style.width = (width * 1.7) + '%'; + ce.style.left = width * index + '%'; - var fce = ce.previousSibling, - moved = false; + var fce = ce.previousSibling, + moved = false; // adjust the order - while (fce) { + while (fce) { if (data[fce._bi].indexOf(fce) > index) { fce = fce.previousSibling; moved = true; @@ -1506,15 +1506,15 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { } break; } - } + } } } - }, + }, beforeSize: zk.ie6_ ? function (cmp) { - var inner = this.$n("inner"); - inner.style.height = "0px"; - inner.lastChild.style.height = "0px"; + var inner = this.$n('inner'); + inner.style.height = '0px'; + inner.lastChild.style.height = '0px'; } : function () {return false;}, onSize: _zkf = function () { @@ -1524,7 +1524,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { this.createChildrenWidget_(); this._rePositionDaylong(); this._rePositionDay(); - var a = this.$n("hdarrow"); + var a = this.$n('hdarrow'); //arrow position a.style.left = jq.px((a.parentNode.offsetWidth * this.ts - a.offsetWidth) - 5); } @@ -1534,12 +1534,12 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { this.clearGhost(); if (!hgh) return; - var inner = this.$n("inner"), - cnt = this.$n("cnt"), + var inner = this.$n('inner'), + cnt = this.$n('cnt'), cntHeight = zk(inner.parentNode).padBorderHeight() + zk(inner).padBorderHeight() + zk(cnt).padBorderHeight() + - jq(cnt).find('.z-calendars-week-cnt').outerHeight() + + jq(cnt).find('.z-calendars-week-cnt').outerHeight() + jq(inner).find('.z-calendars-week-header').height(), row = this.cntRows; for (var child = cmp.firstChild; child; child = child.nextSibling) { @@ -1587,16 +1587,16 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { var cnt = dg.node, widget = dg.control; - if (zk.processing || !cnt._lefts || p[0] <= cnt._lefts[0] || p[0] > cnt._lefts[cnt._lefts.length-1]) + if (zk.processing || !cnt._lefts || p[0] <= cnt._lefts[0] || p[0] > cnt._lefts[cnt._lefts.length - 1]) return true; // clear ghost widget.clearGhost(); var n = evt.domTarget, targetWidget = zk.Widget.$(n); - if (targetWidget.className == 'calendar.DayEvent' && (!n.parentNode || targetWidget.event.isLocked )) + if (targetWidget.className == 'calendar.DayItem' && (!n.parentNode || targetWidget.item.isLocked)) return true; - else if (n.nodeType == 1 && (jq(n).hasClass("z-calevent-resizer-icon")) || jq(n).hasClass("z-calevent-resizer")) { + else if (n.nodeType == 1 && (jq(n).hasClass('z-calitem-resizer-icon')) || jq(n).hasClass('z-calitem-resizer')) { if (widget._dragItems[cnt.id]) widget._dragItems[cnt.id]._zrz = true; } @@ -1607,7 +1607,7 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { var cnt = dg.node, targetWidget = dg.control._resizing ? dg.control._resizing : zk.Widget.$(evt.domTarget), - ce = targetWidget.className == 'calendar.DayEvent'? targetWidget.$n(): null, + ce = targetWidget.className == 'calendar.DayItem' ? targetWidget.$n() : null, widget = dg.control, ts = widget.ts, cells = widget.cntRows.cells, @@ -1620,18 +1620,18 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { b: ts, // begin index ph: ph, // per height th: cells[ts].firstChild.offsetHeight // total height - } + }; if (!ce) _createDragStart(dg, evt); else { - var timeslotTime = 60/widget._timeslots, - bdOffs = ce._bd.getMinutes()%timeslotTime, - edOffs = ce._ed.getMinutes()%timeslotTime; + var timeslotTime = 60 / widget._timeslots, + bdOffs = ce._bd.getMinutes() % timeslotTime, + edOffs = ce._ed.getMinutes() % timeslotTime; if (bdOffs || edOffs) { jq.alert('Only allowed to move within fitted timeslot', {icon: 'ERROR'}); ce._error = true; - ce.style.visibility = ""; - jq('#'+widget.uuid+'-dd').remove(); + ce.style.visibility = ''; + jq('#' + widget.uuid + '-dd').remove(); } var faker = ce.cloneNode(true), @@ -1643,8 +1643,8 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { //reset ce.parentNode.appendChild(faker); - ce.style.visibility = "hidden"; - dg.node = jq('#'+uuid+'-dd')[0]; + ce.style.visibility = 'hidden'; + dg.node = jq('#' + uuid + '-dd')[0]; dg._zevt = ce; dg._zhd = dg.node.childNodes[0].firstChild.firstChild.firstChild; @@ -1656,12 +1656,12 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { dg._zoffs.bi = beginIndex + Math.floor(ce.offsetTop / ph); // end index dg._zoffs.ei = beginIndex + Math.ceil(ce.offsetHeight / ph); - } + } return dg.node; }, _drawDaydrag: function (dg, p, evt) { - if(dg._zevt && dg._zevt._error) return; + if (dg._zevt && dg._zevt._error) return; var widget = dg.control, zoffs = dg._zoffs, @@ -1671,8 +1671,8 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { ph = zoffs.ph; // avoid the wrong mousemove event in IE6. - if (zk.ie6_ && zoffs.x && - evt.pageX == zoffs.x && + if (zk.ie6_ && zoffs.x && + evt.pageX == zoffs.x && zoffs.y == y) { zoffs.x = null; return; @@ -1705,12 +1705,12 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { else _updateDragging(dg, evt); }, - _endghostDaydrag: function (dg, origin){ - if (dg._zevt) { + _endghostDaydrag: function (dg, origin) { + if (dg._zevt) { _updateDragEndghost(dg); - if (dg._zrz) + if (dg._zrz) _resizeDragEndghost(dg); - } else _createDragEndghost(dg); + } else _createDragEndghost(dg); }, _endDaydrag: function (dg, evt) { @@ -1718,14 +1718,14 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { var widget = dg.control, ghostNode = dg._zdata.ghostNode; - if(widget._resizing){ + if (widget._resizing) { widget._resizing = null; } if (dg._zevt && dg._zevt._error) { dg._zevt._error = false; - dg._zevt.style.visibility = ""; - jq('#'+widget.uuid+'-dd').remove(); + dg._zevt.style.visibility = ''; + jq('#' + widget.uuid + '-dd').remove(); return; } clearInterval(widget.run); @@ -1737,18 +1737,18 @@ calendar.CalendarsDefault = zk.$extends(calendar.Calendars, { else _updateDragEnd(dg, evt); // fix opera jumping - if (zk.opera) + if (zk.opera) dg.handle.scrollTop = widget._scrollInfo[widget.uuid]; - dg._zchanged = dg._zecnt = dg._zrzoffs = - dg._zrs = dg._zdata = dg._zcells = + dg._zchanged = dg._zecnt = dg._zrzoffs = + dg._zrs = dg._zdata = dg._zcells = dg._zoffs = dg._zevt = null; }, - _resetPosition: function (faker, widget) { - faker.style.width = "100%"; - faker.style.left = "0px"; - jq(faker).addClass(widget.getZclass() + "-evt-ghost"); + _resetPosition: function (faker, widget) { + faker.style.width = '100%'; + faker.style.left = '0px'; + jq(faker).addClass(widget.getZclass() + '-evt-ghost'); } }); })(); \ No newline at end of file diff --git a/calendar/src/archive/web/js/calendar/CalendarsMonth.js b/calendar/src/archive/web/js/calendar/CalendarsMonth.js index d33ff81..6d83599 100644 --- a/calendar/src/archive/web/js/calendar/CalendarsMonth.js +++ b/calendar/src/archive/web/js/calendar/CalendarsMonth.js @@ -29,22 +29,22 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { woyRowTemplate: '
', $define: { - events: function () { - this._events = jq.evalJSON(this._events); + items: function () { + this._items = jq.evalJSON(this._items); if (!this.$n()) return; for (var i = this.nChildren; i--;) { var child = this.getChildAt(i), className = child.className; - if (className == 'calendar.DayOfMonthEvent' || className == 'calendar.DaylongOfMonthEvent') + if (className == 'calendar.DayOfMonthItem' || className == 'calendar.DaylongOfMonthItem') this.removeChild(child); } this.createChildrenWidget_(); this._rePositionDay(); - //reset evt data - this._evtsData = this._createEvtsData(false); + //reset items data + this._itemsData = this._createItemsData(false); // recalculate this.onSize(); }, @@ -82,7 +82,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { this.woyCnt = jq(this.$n('woy')).contents().find('.' + zcls + '-week-of-year-text'); //put all day title this.allDayTitle = jq(cnt).contents().find('.' + zcls + '-month-date-cnt'); - //put day event + //put day item this.weekRows = jq(cnt).contents().find('.' + zcls + '-day-of-month-body'); this.weekRowsBg = jq(cnt).contents().find('.' + zcls + '-day-of-month-bg'); @@ -118,7 +118,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { }); } - this._evtsData = this._createEvtsData(true); + this._itemsData = this._createItemsData(true); if (!this._readonly) this.editMode(true); @@ -129,7 +129,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { this.$supers('unbind_', arguments); }, - _createEvtsData: function (isAddClkEvt) { + _createItemsData: function (isAddClkEvt) { var cnt = this.$n('cnt'), rdata = []; for (var ri = 0, n = cnt.firstChild; n; n = n.nextSibling, ri++) { @@ -180,24 +180,24 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { this._weekDates = weekDates; }, - _putInMapList: function (dayEvent) { - var node = dayEvent.$n(), - list = this._eventWeekSet[this._weekDates.indexOf(node.startWeek)]; + _putInMapList: function (dayItem) { + var node = dayItem.$n(), + list = this._itemWeekSet[this._weekDates.indexOf(node.startWeek)]; if (!list) { list = []; - this._eventWeekSet[this._weekDates.indexOf(node.startWeek)] = list; + this._itemWeekSet[this._weekDates.indexOf(node.startWeek)] = list; } list.push(node); //add cut node - var cloneNodes = dayEvent.cloneNodes; + var cloneNodes = dayItem.cloneNodes; if (!cloneNodes) return; for (var n = cloneNodes.length; n--;) { var cloneNode = cloneNodes[n], index = this._weekDates.indexOf(cloneNode.startWeek); - list = this._eventWeekSet[index]; + list = this._itemWeekSet[index]; if (!list) { list = []; - this._eventWeekSet[index] = list; + this._itemWeekSet[index] = list; } list.push(cloneNode); } @@ -226,14 +226,14 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { var dayNode = allEvent[m]; if (m == 0)//first - this.drawEvent_(dayNode._preOffset, zcls + '-month-date-evt', prevTr, dayNode); + this.drawItem_(dayNode._preOffset, zcls + '-month-date-evt', prevTr, dayNode); else { var preDayNode = allEvent[m - 1], start = dayNode._preOffset, preEnd = preDayNode._preOffset + preDayNode._days, offset = start - preEnd; - this.drawEvent_(offset, zcls + '-month-date-evt', prevTr, dayNode); + this.drawItem_(offset, zcls + '-month-date-evt', prevTr, dayNode); } dayNode.style.visibility = ''; if (m == n - 1) {//last @@ -252,12 +252,12 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { var sortFunc = this.dateSorting_, daySpace = this._daySpace, - eventWeekSet = this._eventWeekSet, + itemWeekSet = this._itemWeekSet, uuid = this.uuid; // all day event - for (var i = 0, j = eventWeekSet.length; i < j; i++) { - var list = eventWeekSet[i], + for (var i = 0, j = itemWeekSet.length; i < j; i++) { + var list = itemWeekSet[i], weekList = []; if (!list || !list.length) continue; list.sort(sortFunc); @@ -448,18 +448,18 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { } }, - cleanEvtAry_: function () { - this._eventKey = {}; - this._eventWeekSet = []; + cleanItemAry_: function () { + this._itemKey = {}; + this._itemWeekSet = []; }, - processChildrenWidget_: function (isExceedOneDay, event) { - var dayEvent = isExceedOneDay ? - new calendar.DaylongOfMonthEvent({event: event}) : - new calendar.DayOfMonthEvent({event: event}); + processChildrenWidget_: function (isExceedOneDay, item) { + var dayItem = isExceedOneDay ? + new calendar.DaylongOfMonthItem({item: item}) : + new calendar.DayOfMonthItem({item: item}); - this.appendChild(dayEvent); - this._putInMapList(dayEvent); + this.appendChild(dayItem); + this._putInMapList(dayItem); }, getDragDataObj_: function () { @@ -513,9 +513,9 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { return this._dragDataObj; }, - reAlignEvents_: function (hasAdd) { + reAlignItems_: function (hasAdd) { this._rePositionDay(); - this._evtsData = this._createEvtsData(false); + this._itemsData = this._createItemsData(false); // recalculate this.onSize(); }, @@ -523,14 +523,14 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { removeNodeInArray_: function (childWidget, hasAdd) { var node = childWidget.$n(), weekIndex = this._weekDates.indexOf(node.startWeek); - this._eventWeekSet[weekIndex].$remove(node); + this._itemWeekSet[weekIndex].$remove(node); var cloneNodes = childWidget.cloneNodes; if (!cloneNodes) return; weekIndex++; for (var n = cloneNodes.length; n--;) { var cloneNode = cloneNodes[n]; - this._eventWeekSet[weekIndex + n].$remove(cloneNode); + this._itemWeekSet[weekIndex + n].$remove(cloneNode); } }, @@ -544,12 +544,12 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { var widget = zk.Widget.$(cnt), zcls = widget.getZclass(), node = evt.target, - ce = zk.Widget.$(node).event, + ce = zk.Widget.$(node).item, p = [Math.round(evt.pageX), Math.round(evt.pageY)]; //ZKCAL-42: sometimes it returns float number in IE 10 if (jq(node).hasClass(zcls + '-evt-faker-more') && node.parentNode.id.indexOf('-frow') > 0) return; if (ce) { - widget.fire('onEventEdit', { + widget.fire('onItemEdit', { data: [ce.id, p[0], p[1], jq.innerWidth(), jq.innerHeight()]}); } else { var cmp = widget.$n(), @@ -600,7 +600,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { ed.setHours(ed.getHours() + 2); } - widget.fire('onEventCreate', { + widget.fire('onItemCreate', { data: [ widget.fixTimeZoneFromClient(bd), widget.fixTimeZoneFromClient(ed), @@ -642,7 +642,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { jq(pp).bind('click', widget.proxy(widget.onPopupClick)); } else { if (widget._pp.ci == ci) { - // ignore onEventCreate + // ignore onItemCreate evt.stop(); return; } @@ -683,7 +683,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { //filling data var cmp = widget.$n(), - evts = widget._evtsData[widget.getIndex(row)][ci], + evts = widget._itemsData[widget.getIndex(row)][ci], oneDay = calUtil.DAYTIME, bd = targetDate, ed = new Date(bd); @@ -695,14 +695,14 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { cl = tr.insertCell(0), ce = evts[i], cewgt = zk.Widget.$(ce), - event = cewgt.event, - isDayLongEvent = cewgt.$instanceof(calendar.DaylongOfMonthEvent), - hc = event.headerColor, - cc = event.contentColor, - zcls = event.zclass; - - ce._bd = ce._bd || event.zoneBd; - ce._ed = ce._ed || event.zoneEd; + item = cewgt.item, + isDayLongEvent = cewgt.$instanceof(calendar.DaylongOfMonthItem), + hc = item.headerColor, + cc = item.contentColor, + zcls = item.zclass; + + ce._bd = ce._bd || item.zoneBd; + ce._ed = ce._ed || item.zoneEd; cl.className = 'z-calpp-month-evt-l'; if (isDayLongEvent && bd - ce._bd >= 1000) { var info = [ @@ -716,7 +716,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { cc ? ' style="background:' + cc + ';border-left-color:' + cc + ';border-right-color:' + cc + '"' : '', cc ? ' style="background:' + cc + '"' : '' ]; - cl.innerHTML = widget.evtTemplate.replace(new RegExp("%([1-9])", "g"), function (match, index) { + cl.innerHTML = widget.itemTemplate.replace(new RegExp("%([1-9])", "g"), function (match, index) { return info[index - 1]; }); } else @@ -740,7 +740,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { cc ? ' style="background:' + cc + ';border-left-color:' + cc + ';border-right-color:' + cc + '"' : '', cc ? ' style="background:' + cc + '"' : '' ]; - cr.innerHTML = widget.evtTemplate.replace(new RegExp("%([1-9])", "g"), function (match, index) { + cr.innerHTML = widget.itemTemplate.replace(new RegExp("%([1-9])", "g"), function (match, index) { return info[index - 1]; }); } else @@ -771,7 +771,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { if ((ce = zk.Widget.$(target)) && ce.className != 'calendar.CalendarsMonth') { - data.ce = ce.event.id; + data.ce = ce.item.id; target = ce.$n().parentNode; } @@ -801,7 +801,7 @@ calendar.CalendarsMonth = zk.$extends(calendar.Calendars, { table = n.lastChild, rows = table.rows, len = rows.length, - data = this._evtsData[ri]; + data = this._itemsData[ri]; if (len > 1 && (h < sh || rows[len - 1].id)) { if (rows[len - 1].id && rows[len - 1].id.startsWith(this.uuid + '-frow')) { jq(rows[len - 1]).remove(); diff --git a/calendar/src/archive/web/js/calendar/DayEvent.js b/calendar/src/archive/web/js/calendar/DayItem.js similarity index 86% rename from calendar/src/archive/web/js/calendar/DayEvent.js rename to calendar/src/archive/web/js/calendar/DayItem.js index c3efd5f..9d25dc6 100644 --- a/calendar/src/archive/web/js/calendar/DayEvent.js +++ b/calendar/src/archive/web/js/calendar/DayItem.js @@ -1,126 +1,126 @@ -/* Calendars.js - - Purpose: - - Description: - - History: - Thu Nov 5 12:33:21 TST 2009, Created by Jimmy - -Copyright (C) 2009 Potix Corporation. All Rights Reserved. - -This program is distributed under GPL Version 3.0 in the hope that -it will be useful, but WITHOUT ANY WARRANTY. - */ -calendar.DayEvent = zk.$extends(calendar.Event, { - redraw: function (out) { - this.defineClassName_(); - - var ce = this.event, - id = ce.id, - p = this.params, - headerStyle = p.headerStyle, - contentStyle = p.contentStyle, - resizer = p.resizer; - p._resizerCnt = '
' + - '
'; - - out.push('', - '
', - '
', - '
', - '
', this.getEvtTitle(ce), '
', - '
', - '
', ce.content, '
'); - // resizer - if (!ce.isLocked) - out.push(p._resizerCnt); - - out.push('
', - '
'); - }, - bind_: function (e) { - this.$supers('bind_', arguments); - var ce = this.event; - if (ce && !ce.isLocked) { - var wgt = this; - jq(this.$n('resizer')).mousedown(function () { - if (wgt.parent) { - wgt.parent._resizing = wgt; - } - }).mouseup(function () { - if (wgt.parent) wgt.parent._resizing = null; - }); - } - }, - unbind_: function () { - var ce = this.event; - if (ce && !ce.isLocked) { - var wgt = this; - jq(this.$n('resizer')).unbind('mousedown'); - jq(this.$n('resizer')).unbind('mouseup'); - if (this.parent) { - this.parent._resizing = null; - } - } - this.$supers('unbind_', arguments); - }, - getEvtTitle: function (ce) { - var bd = ce.zoneBd, - ed = ce.zoneEd; - return ce.title ? ce.title : (ed - bd < (7200000 / this.parent._timeslots)) ? - (zk.fmt.Date.formatDate(bd,'HH:mm') + ' - ' + ce.content) : - (zk.fmt.Date.formatDate(bd,'HH:mm') + ' - ' + zk.fmt.Date.formatDate(ed,'HH:mm')); - }, - - update: function (updateLastModify) { - this.clearCache(); - this.defineCss_(); - - var ce = this.event, - p = this.params, - contentStyle = p.contentStyle, - cnt = jq(this.$n('cnt')); - - this.updateHeaderStyle_(p.headerStyle); - - jq(this.$n('inner')).attr('style', contentStyle); - cnt.attr('style', contentStyle); - cnt.children('.' + p.text).html(ce.content); - - jq(this.$n('hd')).html(this.getEvtTitle(ce)); - - this._createResizer(); - - this.calculate_(updateLastModify); - }, - - _createResizer: function () { - var inner = this.$n('inner'), - target = inner.lastChild, - p = this.params, - hasResizer = target.className == p.resizer; - - if (!this.event.isLocked) { - if (!hasResizer) - jq(inner).append(p._resizerCnt); - } else if (hasResizer) - jq(target).remove(); - }, - - defineClassName_: function () { - this.$super('defineClassName_', arguments); - // CSS ClassName - var zcls = this.getZclass(), - p = this.params; - - p.header = zcls + '-header', - p.resizer = zcls + '-resizer', - p.resizer_icon = p.resizer + '-icon'; - }, - - updateHeaderStyle_: function (headerStyle) { - this.$super('updateHeaderStyle_', arguments); - jq(this.$n('hd')).attr('style',headerStyle); - } +/* Calendars.js + + Purpose: + + Description: + + History: + Thu Nov 5 12:33:21 TST 2009, Created by Jimmy + +Copyright (C) 2009 Potix Corporation. All Rights Reserved. + +This program is distributed under GPL Version 3.0 in the hope that +it will be useful, but WITHOUT ANY WARRANTY. + */ +calendar.DayItem = zk.$extends(calendar.Item, { + redraw: function (out) { + this.defineClassName_(); + + var ce = this.item, + id = ce.id, + p = this.params, + headerStyle = p.headerStyle, + contentStyle = p.contentStyle, + resizer = p.resizer; + p._resizerCnt = '
' + + '
'; + + out.push('', + '
', + '
', + '
', + '
', this.getItemTitle(ce), '
', + '
', + '
', ce.content, '
'); + // resizer + if (!ce.isLocked) + out.push(p._resizerCnt); + + out.push('
', + '
'); + }, + bind_: function (e) { + this.$supers('bind_', arguments); + var ce = this.item; + if (ce && !ce.isLocked) { + var wgt = this; + jq(this.$n('resizer')).mousedown(function () { + if (wgt.parent) { + wgt.parent._resizing = wgt; + } + }).mouseup(function () { + if (wgt.parent) wgt.parent._resizing = null; + }); + } + }, + unbind_: function () { + var ce = this.item; + if (ce && !ce.isLocked) { + var wgt = this; + jq(this.$n('resizer')).unbind('mousedown'); + jq(this.$n('resizer')).unbind('mouseup'); + if (this.parent) { + this.parent._resizing = null; + } + } + this.$supers('unbind_', arguments); + }, + getItemTitle: function (ce) { + var bd = ce.zoneBd, + ed = ce.zoneEd; + return ce.title ? ce.title : (ed - bd < (7200000 / this.parent._timeslots)) ? + (zk.fmt.Date.formatDate(bd,'HH:mm') + ' - ' + ce.content) : + (zk.fmt.Date.formatDate(bd,'HH:mm') + ' - ' + zk.fmt.Date.formatDate(ed,'HH:mm')); + }, + + update: function (updateLastModify) { + this.clearCache(); + this.defineCss_(); + + var ce = this.item, + p = this.params, + contentStyle = p.contentStyle, + cnt = jq(this.$n('cnt')); + + this.updateHeaderStyle_(p.headerStyle); + + jq(this.$n('inner')).attr('style', contentStyle); + cnt.attr('style', contentStyle); + cnt.children('.' + p.text).html(ce.content); + + jq(this.$n('hd')).html(this.getItemTitle(ce)); + + this._createResizer(); + + this.calculate_(updateLastModify); + }, + + _createResizer: function () { + var inner = this.$n('inner'), + target = inner.lastChild, + p = this.params, + hasResizer = target.className == p.resizer; + + if (!this.item.isLocked) { + if (!hasResizer) + jq(inner).append(p._resizerCnt); + } else if (hasResizer) + jq(target).remove(); + }, + + defineClassName_: function () { + this.$super('defineClassName_', arguments); + // CSS ClassName + var zcls = this.getZclass(), + p = this.params; + + p.header = zcls + '-header', + p.resizer = zcls + '-resizer', + p.resizer_icon = p.resizer + '-icon'; + }, + + updateHeaderStyle_: function (headerStyle) { + this.$super('updateHeaderStyle_', arguments); + jq(this.$n('hd')).attr('style', headerStyle); + } }); \ No newline at end of file diff --git a/calendar/src/archive/web/js/calendar/DayOfMonthEvent.js b/calendar/src/archive/web/js/calendar/DayOfMonthItem.js similarity index 90% rename from calendar/src/archive/web/js/calendar/DayOfMonthEvent.js rename to calendar/src/archive/web/js/calendar/DayOfMonthItem.js index 69ff562..230b12e 100644 --- a/calendar/src/archive/web/js/calendar/DayOfMonthEvent.js +++ b/calendar/src/archive/web/js/calendar/DayOfMonthItem.js @@ -1,63 +1,63 @@ -/* Calendars.js - - Purpose: - - Description: - - History: - Thu Nov 5 12:33:21 TST 2009, Created by Jimmy - -Copyright (C) 2009 Potix Corporation. All Rights Reserved. - -This program is distributed under GPL Version 3.0 in the hope that -it will be useful, but WITHOUT ANY WARRANTY. - */ -calendar.DayOfMonthEvent = zk.$extends(calendar.Event, { - - redraw: function (out) { - var ce = this.event, - id = ce.id, - headerColor = ce.headerColor, - innerStyle = headerColor ? ' style="background:' + headerColor + '"' : '', - zcls = this.getZclass(), - inner = zcls + '-inner', - header = zcls + '-header', - content = zcls + '-cnt'; - - this.uuid = id; - - out.push('', - '
', - '', this.getCntText(ce), '', - '', ce.content, '
'); - }, - - getCntText: function (ce) { - return ce.title ? ce.title.substr(0,ce.title.indexOf(' - ')) : - zk.fmt.Date.formatDate(ce.zoneBd,'HH:mm'); - }, - - domClass_: function (no) { - var scls = this.$supers('domClass_', arguments); - return scls + ' ' + this.getZclass() + '-month'; - }, - - getDays: function () { - return 1; - }, - - update: function (updateLastModify) { - var ce = this.event, - inner = jq(this.$n('inner')), - hd = jq(this.$n('hd')), - cnt = jq(this.$n('cnt')), - headerColor = ce.headerColor, - innerStyle = headerColor ? 'background:' + headerColor : ''; - - inner.attr('style', innerStyle); - hd.html(this.getCntText(ce) + ' '); - cnt.html(ce.content); - - this.calculate_(updateLastModify); - } +/* Calendars.js + + Purpose: + + Description: + + History: + Thu Nov 5 12:33:21 TST 2009, Created by Jimmy + +Copyright (C) 2009 Potix Corporation. All Rights Reserved. + +This program is distributed under GPL Version 3.0 in the hope that +it will be useful, but WITHOUT ANY WARRANTY. + */ +calendar.DayOfMonthItem = zk.$extends(calendar.Item, { + + redraw: function (out) { + var ce = this.item, + id = ce.id, + headerColor = ce.headerColor, + innerStyle = headerColor ? ' style="background:' + headerColor + '"' : '', + zcls = this.getZclass(), + inner = zcls + '-inner', + header = zcls + '-header', + content = zcls + '-cnt'; + + this.uuid = id; + + out.push('', + '
', + '', this.getCntText(ce), '', + '', ce.content, '
'); + }, + + getCntText: function (ce) { + return ce.title ? ce.title.substr(0,ce.title.indexOf(' - ')) : + zk.fmt.Date.formatDate(ce.zoneBd,'HH:mm'); + }, + + domClass_: function (no) { + var scls = this.$supers('domClass_', arguments); + return scls + ' ' + this.getZclass() + '-month'; + }, + + getDays: function () { + return 1; + }, + + update: function (updateLastModify) { + var ce = this.item, + inner = jq(this.$n('inner')), + hd = jq(this.$n('hd')), + cnt = jq(this.$n('cnt')), + headerColor = ce.headerColor, + innerStyle = headerColor ? 'background:' + headerColor : ''; + + inner.attr('style', innerStyle); + hd.html(this.getCntText(ce) + ' '); + cnt.html(ce.content); + + this.calculate_(updateLastModify); + } }); \ No newline at end of file diff --git a/calendar/src/archive/web/js/calendar/DaylongEvent.js b/calendar/src/archive/web/js/calendar/DaylongItem.js similarity index 84% rename from calendar/src/archive/web/js/calendar/DaylongEvent.js rename to calendar/src/archive/web/js/calendar/DaylongItem.js index f3febcb..cf2b531 100644 --- a/calendar/src/archive/web/js/calendar/DaylongEvent.js +++ b/calendar/src/archive/web/js/calendar/DaylongItem.js @@ -1,25 +1,25 @@ -/* Calendars.js - - Purpose: - - Description: - - History: - Thu Nov 5 12:33:21 TST 2009, Created by Jimmy - -Copyright (C) 2009 Potix Corporation. All Rights Reserved. - -This program is distributed under GPL Version 3.0 in the hope that -it will be useful, but WITHOUT ANY WARRANTY. - */ -calendar.DaylongEvent = zk.$extends(calendar.LongEvent, { - - getCornerStyle_: function () { - return ''; - }, - - getDays: function () { - var node = this.$n(); - return this.parent._days - node._preOffset - node._afterOffset; - } +/* Calendars.js + + Purpose: + + Description: + + History: + Thu Nov 5 12:33:21 TST 2009, Created by Jimmy + +Copyright (C) 2009 Potix Corporation. All Rights Reserved. + +This program is distributed under GPL Version 3.0 in the hope that +it will be useful, but WITHOUT ANY WARRANTY. + */ +calendar.DaylongItem = zk.$extends(calendar.LongItem, { + + getCornerStyle_: function () { + return ''; + }, + + getDays: function () { + var node = this.$n(); + return this.parent._days - node._preOffset - node._afterOffset; + } }); \ No newline at end of file diff --git a/calendar/src/archive/web/js/calendar/DaylongOfMonthEvent.js b/calendar/src/archive/web/js/calendar/DaylongOfMonthItem.js similarity index 87% rename from calendar/src/archive/web/js/calendar/DaylongOfMonthEvent.js rename to calendar/src/archive/web/js/calendar/DaylongOfMonthItem.js index dffb956..a382730 100644 --- a/calendar/src/archive/web/js/calendar/DaylongOfMonthEvent.js +++ b/calendar/src/archive/web/js/calendar/DaylongOfMonthItem.js @@ -1,157 +1,157 @@ -/* Calendars.js - - Purpose: - - Description: - - History: - Thu Nov 5 12:33:21 TST 2009, Created by Jimmy - -Copyright (C) 2009 Potix Corporation. All Rights Reserved. - -This program is distributed under GPL Version 3.0 in the hope that -it will be useful, but WITHOUT ANY WARRANTY. - */ -calendar.DaylongOfMonthEvent = zk.$extends(calendar.LongEvent, { - - $init: function () { - this.$supers('$init', arguments); - this.cloneNodes = []; - }, - - getCornerStyle_: function () { - return this.params.contentStyle; - }, - - getInnerStyle_: function () { - return this.params.innerStyle; - }, - - domClass_: function (no) { - var scls = this.$supers('domClass_', arguments); - return scls + ' ' + this.getZclass() + '-daylong-month'; - }, - - getDays: function () { - var node = this.$n(); - - if (this.cloneCount) - return 7 - node._preOffset; - - return 7 - node._preOffset - node._afterOffset; - }, - - processCloneNode_: function (node) { - var parent = this.parent, - weekDates = parent._weekDates, - ed = node.lowerBoundEd, - startWeek = node.startWeek, - cloneCount; - //calculate over next week - if (ed > startWeek.zoneEd) - cloneCount = Math.ceil(calUtil.getPeriod(ed, startWeek.zoneEd) / 7); - this._processCloneNode(weekDates, cloneCount); - - node.zoneEd = cloneCount ? startWeek.zoneEd : this.event.zoneEd; - }, - - _createCloneNode: function (index) { - var uuid = this.uuid, - event = this.event, - cloneNode = this.$n().cloneNode(true), - body = jq(cloneNode).children('#' + this.uuid + '-body')[0], - cnt = body.firstChild.firstChild; - - //change id - cloneNode.id = uuid + '-sub' + index; - body.id = uuid + '-sub' + index + '-body'; - cnt.id = uuid + '-sub' + index + '-cnt'; - - cloneNode.cnt = cnt; - cloneNode.body = body; - cloneNode._preOffset = 0; - cloneNode._afterOffset = 0; - cloneNode.zoneBd = event.zoneBd; - cloneNode.zoneEd = event.zoneEd; - cloneNode._days = 7; - - return cloneNode; - }, - - _processCloneNode: function (weekDates, cloneCount) { - this.cloneNodes = []; - this.cloneCount = cloneCount; - if (!cloneCount) return; - - var node = this.$n(), - body = jq(this.$n('body')), - startWeekIndex = weekDates.indexOf(node.startWeek) + 1, - p = this.params, - left_arrow = p.left_arrow, - hasLeftArrow = body.hasClass(left_arrow); - left_arrowCnt = p.left_arrowCnt; - - //add right arrow if over next week - body.addClass(p.right_arrow); - - //clone node - for (var i = 0, j = cloneCount; i < j; i++) { - var cloneNode = this._createCloneNode(i), - cloneBody = jq(cloneNode.body), - startWeek = weekDates[startWeekIndex + i]; - - cloneNode.startWeek = startWeek; - cloneNode.upperBoundBd = startWeek.zoneBd; - cloneNode.lowerBoundEd = startWeek.zoneEd; - - // always has left arrow because clone node always over previous week - if (!hasLeftArrow) { - cloneBody.addClass(left_arrow); - } - this.cloneNodes.push(cloneNode); - } - - this._processLastCloneNode(cloneCount); - - }, - - _processLastCloneNode: function (cloneCount) { - var cloneNode = this.cloneNodes[cloneCount - 1], - cloneBody = jq(cloneNode.body), - lowerBoundEd = this.$n().lowerBoundEd, - p = this.params, - isAfter = this.event.zoneEd > this.parent.zoneEd; - - cloneNode.lowerBoundEd = lowerBoundEd; - cloneNode._afterOffset = calUtil.getPeriod(cloneNode.startWeek.zoneEd, lowerBoundEd); - cloneNode._days = 7 - cloneNode._afterOffset; - - if (!isAfter) { - cloneBody.removeClass(p.right_arrow); - } - }, - - defineClassName_: function () { - this.$super('defineClassName_', arguments); - - var contentColor = this.event.contentColor; - - this.params.innerStyle = contentColor ? ' style="background:' + contentColor + - ';border-left-color:' + contentColor + - ';border-right-color:' + contentColor + '"' : ''; - }, - - defineCss_: function () { - this.$super('defineCss_', arguments); - - var contentColor = this.event.contentColor; - - this.params.innerStyle = contentColor ? 'background:' + contentColor + - ';border-left-color:' + contentColor + - ';border-right-color:' + contentColor : ''; - }, - - updateContentStyle_: function (contentStyle) { - // do nothing after ZKCAL-76, t2/b2 was removed - } +/* Calendars.js + + Purpose: + + Description: + + History: + Thu Nov 5 12:33:21 TST 2009, Created by Jimmy + +Copyright (C) 2009 Potix Corporation. All Rights Reserved. + +This program is distributed under GPL Version 3.0 in the hope that +it will be useful, but WITHOUT ANY WARRANTY. + */ +calendar.DaylongOfMonthItem = zk.$extends(calendar.LongItem, { + + $init: function () { + this.$supers('$init', arguments); + this.cloneNodes = []; + }, + + getCornerStyle_: function () { + return this.params.contentStyle; + }, + + getInnerStyle_: function () { + return this.params.innerStyle; + }, + + domClass_: function (no) { + var scls = this.$supers('domClass_', arguments); + return scls + ' ' + this.getZclass() + '-daylong-month'; + }, + + getDays: function () { + var node = this.$n(); + + if (this.cloneCount) + return 7 - node._preOffset; + + return 7 - node._preOffset - node._afterOffset; + }, + + processCloneNode_: function (node) { + var parent = this.parent, + weekDates = parent._weekDates, + ed = node.lowerBoundEd, + startWeek = node.startWeek, + cloneCount; + //calculate over next week + if (ed > startWeek.zoneEd) + cloneCount = Math.ceil(calUtil.getPeriod(ed, startWeek.zoneEd) / 7); + this._processCloneNode(weekDates, cloneCount); + + node.zoneEd = cloneCount ? startWeek.zoneEd : this.item.zoneEd; + }, + + _createCloneNode: function (index) { + var uuid = this.uuid, + item = this.item, + cloneNode = this.$n().cloneNode(true), + body = jq(cloneNode).children('#' + this.uuid + '-body')[0], + cnt = body.firstChild.firstChild; + + //change id + cloneNode.id = uuid + '-sub' + index; + body.id = uuid + '-sub' + index + '-body'; + cnt.id = uuid + '-sub' + index + '-cnt'; + + cloneNode.cnt = cnt; + cloneNode.body = body; + cloneNode._preOffset = 0; + cloneNode._afterOffset = 0; + cloneNode.zoneBd = item.zoneBd; + cloneNode.zoneEd = item.zoneEd; + cloneNode._days = 7; + + return cloneNode; + }, + + _processCloneNode: function (weekDates, cloneCount) { + this.cloneNodes = []; + this.cloneCount = cloneCount; + if (!cloneCount) return; + + var node = this.$n(), + body = jq(this.$n('body')), + startWeekIndex = weekDates.indexOf(node.startWeek) + 1, + p = this.params, + left_arrow = p.left_arrow, + hasLeftArrow = body.hasClass(left_arrow); + left_arrowCnt = p.left_arrowCnt; + + //add right arrow if over next week + body.addClass(p.right_arrow); + + //clone node + for (var i = 0, j = cloneCount; i < j; i++) { + var cloneNode = this._createCloneNode(i), + cloneBody = jq(cloneNode.body), + startWeek = weekDates[startWeekIndex + i]; + + cloneNode.startWeek = startWeek; + cloneNode.upperBoundBd = startWeek.zoneBd; + cloneNode.lowerBoundEd = startWeek.zoneEd; + + // always has left arrow because clone node always over previous week + if (!hasLeftArrow) { + cloneBody.addClass(left_arrow); + } + this.cloneNodes.push(cloneNode); + } + + this._processLastCloneNode(cloneCount); + + }, + + _processLastCloneNode: function (cloneCount) { + var cloneNode = this.cloneNodes[cloneCount - 1], + cloneBody = jq(cloneNode.body), + lowerBoundEd = this.$n().lowerBoundEd, + p = this.params, + isAfter = this.item.zoneEd > this.parent.zoneEd; + + cloneNode.lowerBoundEd = lowerBoundEd; + cloneNode._afterOffset = calUtil.getPeriod(cloneNode.startWeek.zoneEd, lowerBoundEd); + cloneNode._days = 7 - cloneNode._afterOffset; + + if (!isAfter) { + cloneBody.removeClass(p.right_arrow); + } + }, + + defineClassName_: function () { + this.$super('defineClassName_', arguments); + + var contentColor = this.item.contentColor; + + this.params.innerStyle = contentColor ? ' style="background:' + contentColor + + ';border-left-color:' + contentColor + + ';border-right-color:' + contentColor + '"' : ''; + }, + + defineCss_: function () { + this.$super('defineCss_', arguments); + + var contentColor = this.item.contentColor; + + this.params.innerStyle = contentColor ? 'background:' + contentColor + + ';border-left-color:' + contentColor + + ';border-right-color:' + contentColor : ''; + }, + + updateContentStyle_: function (contentStyle) { + // do nothing after ZKCAL-76, t2/b2 was removed + } }); \ No newline at end of file diff --git a/calendar/src/archive/web/js/calendar/Event.js b/calendar/src/archive/web/js/calendar/Item.js similarity index 79% rename from calendar/src/archive/web/js/calendar/Event.js rename to calendar/src/archive/web/js/calendar/Item.js index d475799..e4e147f 100644 --- a/calendar/src/archive/web/js/calendar/Event.js +++ b/calendar/src/archive/web/js/calendar/Item.js @@ -1,143 +1,143 @@ -/* Calendars.js - - Purpose: - - Description: - - History: - Thu Nov 5 12:33:21 TST 2009, Created by Jimmy - -Copyright (C) 2009 Potix Corporation. All Rights Reserved. - -This program is distributed under GPL Version 3.0 in the hope that -it will be useful, but WITHOUT ANY WARRANTY. - */ -calendar.Event = zk.$extends(zk.Widget, { - bind_: function () { - this.$supers('bind_', arguments); - this.calculate_(true); - }, - - unbind_: function () { - var node = this.$n(); - - node.zoneBd = node.zoneEd = node._preOffset = node._afterOffset = - node._days = this.event = null; - this.$supers('unbind_', arguments); - }, - - defineClassName_: function () { - var zcls = this.getZclass(), - ce = this.event, - headerColor = ce.headerColor, - contentColor = ce.contentColor; - - this.params = { - // CSS ClassName - body: zcls + '-body', - inner: zcls + '-inner', - content: zcls + '-cnt', - text: zcls + '-text', - headerStyle: headerColor ? ' style="background:' + headerColor + '"' : '', - contentStyle: contentColor ? ' style="background:' + contentColor + '"' : '' - }; - this.uuid = ce.id; - }, - - defineCss_: function () { - var ce = this.event, - headerColor = ce.headerColor, - contentColor = ce.contentColor, - p = this.params; - p.headerStyle = headerColor ? 'background:' + headerColor : ''; - p.contentStyle = contentColor ? 'background:' + contentColor : ''; - }, - - updateHeaderStyle_: function (headerStyle) { - var node = jq(this.$n()), - body = jq(this.$n('body')), - p = this.params; - body.attr('style', headerStyle); - body.children('.' + p.inner).attr('style', this.getInnerStyle_()); - }, - - getZclass: function () { - var zcls = this.event.zclass; - return zcls ? zcls : 'z-calevent'; - }, - - getInnerStyle_: function () { - return this.params.headerStyle; - }, - - calculate_: function (updateLastModify) { - var node = this.$n(), - event = this.event, - parent = this.parent, - bd = event.zoneBd, - ed = event.zoneEd, - inMon = parent.mon; - - if (inMon) - node.startWeek = event.startWeek; - - var time = inMon ? node.startWeek : parent; - - node.zoneBd = bd; - node.zoneEd = ed; - - this._createBoundTime(node, bd, ed); - - //_afterOffset could be calculated using bound time after processing clone node - if (this.processCloneNode_) - this.processCloneNode_(node); - - node._preOffset = event._preOffset; - - if (this._isDayEvent()) return; - - node._afterOffset = this.cloneCount ? 0 : - this._getOffset({start: node.lowerBoundEd, end: time.zoneEd}); - - node._days = event._days = this.getDays(); - if (updateLastModify) - node._lastModify = new Date().getTime(); - }, - - isBeginTimeChange: function (event) { - return this.$n().zoneBd.getTime() != event.zoneBd.getTime(); - }, - - _createBoundTime: function (node, bd, ed) { - //have findBoundTime_ function - if (this.findBoundTime_) { - var time = this.findBoundTime_(bd, ed); - bd = time.bd; - ed = time.ed; - } - node.upperBoundBd = this._setBoundDate(bd); - if (this._isDayEvent()) return; - node.lowerBoundEd = this._setBoundDate(ed, true); - }, - - _isDayEvent: function () { -// zk.log(this.$instanceof(calendarDayEvent)); - if (!this._isDayEvt) - this._isDayEvt = this.className == 'calendar.DayEvent'; - return this._isDayEvt; - }, - - _getOffset: function (time) { - return calUtil.getPeriod(time.end, time.start); - }, - - _setBoundDate: function (date, isAddOneDay) { - var result = new Date(date); - if (date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() != 0) { - if (isAddOneDay) - result = calUtil.addDay(date, 1); - result.setHours(0,0,0,0); - } - return result; - } +/* Calendars.js + + Purpose: + + Description: + + History: + Thu Nov 5 12:33:21 TST 2009, Created by Jimmy + +Copyright (C) 2009 Potix Corporation. All Rights Reserved. + +This program is distributed under GPL Version 3.0 in the hope that +it will be useful, but WITHOUT ANY WARRANTY. + */ +calendar.Item = zk.$extends(zk.Widget, { + bind_: function () { + this.$supers('bind_', arguments); + this.calculate_(true); + }, + + unbind_: function () { + var node = this.$n(); + + node.zoneBd = node.zoneEd = node._preOffset = node._afterOffset = + node._days = this.item = null; + this.$supers('unbind_', arguments); + }, + + defineClassName_: function () { + var zcls = this.getZclass(), + ce = this.item, + headerColor = ce.headerColor, + contentColor = ce.contentColor; + + this.params = { + // CSS ClassName + body: zcls + '-body', + inner: zcls + '-inner', + content: zcls + '-cnt', + text: zcls + '-text', + headerStyle: headerColor ? ' style="background:' + headerColor + '"' : '', + contentStyle: contentColor ? ' style="background:' + contentColor + '"' : '' + }; + this.uuid = ce.id; + }, + + defineCss_: function () { + var ce = this.item, + headerColor = ce.headerColor, + contentColor = ce.contentColor, + p = this.params; + p.headerStyle = headerColor ? 'background:' + headerColor : ''; + p.contentStyle = contentColor ? 'background:' + contentColor : ''; + }, + + updateHeaderStyle_: function (headerStyle) { + var node = jq(this.$n()), + body = jq(this.$n('body')), + p = this.params; + body.attr('style', headerStyle); + body.children('.' + p.inner).attr('style', this.getInnerStyle_()); + }, + + getZclass: function () { + var zcls = this.item.zclass; + return zcls ? zcls : 'z-calitem'; + }, + + getInnerStyle_: function () { + return this.params.headerStyle; + }, + + calculate_: function (updateLastModify) { + var node = this.$n(), + item = this.item, + parent = this.parent, + bd = item.zoneBd, + ed = item.zoneEd, + inMon = parent.mon; + + if (inMon) + node.startWeek = item.startWeek; + + var time = inMon ? node.startWeek : parent; + + node.zoneBd = bd; + node.zoneEd = ed; + + this._createBoundTime(node, bd, ed); + + //_afterOffset could be calculated using bound time after processing clone node + if (this.processCloneNode_) + this.processCloneNode_(node); + + node._preOffset = item._preOffset; + + if (this._isDayItem()) return; + + node._afterOffset = this.cloneCount ? 0 : + this._getOffset({start: node.lowerBoundEd, end: time.zoneEd}); + + node._days = item._days = this.getDays(); + if (updateLastModify) + node._lastModify = new Date().getTime(); + }, + + isBeginTimeChange: function (item) { + return this.$n().zoneBd.getTime() != item.zoneBd.getTime(); + }, + + _createBoundTime: function (node, bd, ed) { + //have findBoundTime_ function + if (this.findBoundTime_) { + var time = this.findBoundTime_(bd, ed); + bd = time.bd; + ed = time.ed; + } + node.upperBoundBd = this._setBoundDate(bd); + if (this._isDayItem()) return; + node.lowerBoundEd = this._setBoundDate(ed, true); + }, + + _isDayItem: function () { +// zk.log(this.$instanceof(calendarDayEvent)); + if (!this._isDayEvt) + this._isDayEvt = this.className == 'calendar.DayItem'; + return this._isDayEvt; + }, + + _getOffset: function (time) { + return calUtil.getPeriod(time.end, time.start); + }, + + _setBoundDate: function (date, isAddOneDay) { + var result = new Date(date); + if (date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() != 0) { + if (isAddOneDay) + result = calUtil.addDay(date, 1); + result.setHours(0,0,0,0); + } + return result; + } }); \ No newline at end of file diff --git a/calendar/src/archive/web/js/calendar/LongEvent.js b/calendar/src/archive/web/js/calendar/LongItem.js similarity index 90% rename from calendar/src/archive/web/js/calendar/LongEvent.js rename to calendar/src/archive/web/js/calendar/LongItem.js index 5d9058a..2bdd03e 100644 --- a/calendar/src/archive/web/js/calendar/LongEvent.js +++ b/calendar/src/archive/web/js/calendar/LongItem.js @@ -1,122 +1,122 @@ -/* Calendars.js - - Purpose: - - Description: - - History: - Thu Nov 5 12:33:21 TST 2009, Created by Jimmy - -Copyright (C) 2009 Potix Corporation. All Rights Reserved. - -This program is distributed under GPL Version 3.0 in the hope that -it will be useful, but WITHOUT ANY WARRANTY. - */ -calendar.LongEvent = zk.$extends(calendar.Event, { - - redraw: function (out) { - this.defineClassName_(); - - var ce = this.event, - id = ce.id, - p = this.params, - headerStyle = p.headerStyle, - contentStyle = p.contentStyle, - arrowStyle = p.arrowStyle, - parent = this.parent, - isBefore = ce.zoneBd < parent.zoneBd, - isAfter = ce.zoneEd > parent.zoneEd, - cornerStyle = this.getCornerStyle_(); - - out.push('', - '
', - '
', - '
'); - - out.push('
', ce.content, '
', - ''); - }, - - update: function (updateLastModify) { - this.defineCss_(); - - var cnt = jq(this.$n('cnt')), - parent = this.parent, - ce = this.event, - p = this.params, - isBefore = ce.zoneBd < parent.zoneBd, - isAfter = ce.zoneEd > parent.zoneEd; - - this.updateHeaderStyle_(p.headerStyle); - - if (this.updateContentStyle_) - this.updateContentStyle_(p.contentStyle); - - cnt.attr('class', p.content); - cnt.attr('style', p.contentStyle); - cnt.children('.' + p.text).html(ce.content); - - this.updateArrow_(isAfter, p.right_arrow); - this.updateArrow_(isBefore, p.left_arrow); - - this.calculate_(updateLastModify); - }, - - findBoundTime_: function (bd, ed) { - var parent = this.parent, - pbd = parent.zoneBd, - ped = parent.zoneEd; - - if (bd < pbd) - bd = new Date(pbd); - - if (ed > ped) - ed = new Date(ped); - - //end equals calendar begin, Bug ZKCAL-32: should check to seconds - if (ed.getHours() == 0 && ed.getMinutes() == 0 && ed.getSeconds() == 0 && calUtil.isTheSameDay(ed, pbd)) - ed = calUtil.addDay(ed, 1); - - return {bd: bd, ed: ed}; - }, - - defineClassName_: function () { - this.$super('defineClassName_', arguments); - // CSS ClassName - var zcls = this.getZclass(), - p = this.params, - contentColor = this.event.contentColor; - - p.left_arrow = zcls + '-left-arrow'; - p.right_arrow = zcls + '-right-arrow'; - - p.arrowStyle = contentColor ? - ' style="border-bottom-color:' + contentColor + - ';border-top-color:' + contentColor + '"' : ''; - }, - - defineCss_: function () { - this.$super('defineCss_', arguments); - - var contentColor = this.event.contentColor, - p = this.params; - - p.arrowStyle = contentColor ? - ' style="border-bottom-color:' + contentColor + - ';border-top-color:' + contentColor + '"' : ''; - }, - - updateArrow_: function (needAdd, arrowCls) { - jq(this.$n('body')).toggleClass(arrowCls, needAdd); - } - +/* Calendars.js + + Purpose: + + Description: + + History: + Thu Nov 5 12:33:21 TST 2009, Created by Jimmy + +Copyright (C) 2009 Potix Corporation. All Rights Reserved. + +This program is distributed under GPL Version 3.0 in the hope that +it will be useful, but WITHOUT ANY WARRANTY. + */ +calendar.LongItem = zk.$extends(calendar.Item, { + + redraw: function (out) { + this.defineClassName_(); + + var ce = this.item, + id = ce.id, + p = this.params, + headerStyle = p.headerStyle, + contentStyle = p.contentStyle, + arrowStyle = p.arrowStyle, + parent = this.parent, + isBefore = ce.zoneBd < parent.zoneBd, + isAfter = ce.zoneEd > parent.zoneEd, + cornerStyle = this.getCornerStyle_(); + + out.push('', + '
', + '
', + '
'); + + out.push('
', ce.content, '
', + ''); + }, + + update: function (updateLastModify) { + this.defineCss_(); + + var cnt = jq(this.$n('cnt')), + parent = this.parent, + ce = this.item, + p = this.params, + isBefore = ce.zoneBd < parent.zoneBd, + isAfter = ce.zoneEd > parent.zoneEd; + + this.updateHeaderStyle_(p.headerStyle); + + if (this.updateContentStyle_) + this.updateContentStyle_(p.contentStyle); + + cnt.attr('class', p.content); + cnt.attr('style', p.contentStyle); + cnt.children('.' + p.text).html(ce.content); + + this.updateArrow_(isAfter, p.right_arrow); + this.updateArrow_(isBefore, p.left_arrow); + + this.calculate_(updateLastModify); + }, + + findBoundTime_: function (bd, ed) { + var parent = this.parent, + pbd = parent.zoneBd, + ped = parent.zoneEd; + + if (bd < pbd) + bd = new Date(pbd); + + if (ed > ped) + ed = new Date(ped); + + //end equals calendar begin, Bug ZKCAL-32: should check to seconds + if (ed.getHours() == 0 && ed.getMinutes() == 0 && ed.getSeconds() == 0 && calUtil.isTheSameDay(ed, pbd)) + ed = calUtil.addDay(ed, 1); + + return {bd: bd, ed: ed}; + }, + + defineClassName_: function () { + this.$super('defineClassName_', arguments); + // CSS ClassName + var zcls = this.getZclass(), + p = this.params, + contentColor = this.item.contentColor; + + p.left_arrow = zcls + '-left-arrow'; + p.right_arrow = zcls + '-right-arrow'; + + p.arrowStyle = contentColor ? + ' style="border-bottom-color:' + contentColor + + ';border-top-color:' + contentColor + '"' : ''; + }, + + defineCss_: function () { + this.$super('defineCss_', arguments); + + var contentColor = this.item.contentColor, + p = this.params; + + p.arrowStyle = contentColor ? + ' style="border-bottom-color:' + contentColor + + ';border-top-color:' + contentColor + '"' : ''; + }, + + updateArrow_: function (needAdd, arrowCls) { + jq(this.$n('body')).toggleClass(arrowCls, needAdd); + } + }); \ No newline at end of file diff --git a/calendar/src/archive/web/js/calendar/less/style/_calendar.less b/calendar/src/archive/web/js/calendar/less/style/_calendar.less index b066431..e578420 100644 --- a/calendar/src/archive/web/js/calendar/less/style/_calendar.less +++ b/calendar/src/archive/web/js/calendar/less/style/_calendar.less @@ -17,7 +17,7 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); zoom: 1; } -.z-calendars-week-body .z-calevent-body { +.z-calendars-week-body .z-calitem-body { border: 1px solid @bodyColor; } @@ -232,7 +232,7 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); height: 300px; } .z-calendars-month-cnt,.z-calendars-daylong-cnt { - & .z-calevent-body { + & .z-calitem-body { margin: 0 @basePadding; } } @@ -387,41 +387,41 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); } } // Calendar Event -.z-calevent { +.z-calitem { color: @invertFontColor; overflow: hidden; cursor: pointer; } -.z-calevent-body { +.z-calitem-body { border-radius: @borderRadius; overflow: hidden; zoom:1; } -.z-calevent-body.z-calevent-left-arrow { +.z-calitem-body.z-calitem-left-arrow { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; } -.z-calevent-body.z-calevent-left-arrow .z-calevent-cnt { +.z-calitem-body.z-calitem-left-arrow .z-calitem-cnt { padding-left: 10px; } -.z-calevent-body.z-calevent-right-arrow { +.z-calitem-body.z-calitem-right-arrow { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; } -.z-calevent-inner dt, -.z-calevent-inner dd, -.z-calevent-inner dl { +.z-calitem-inner dt, +.z-calitem-inner dd, +.z-calitem-inner dl { margin: 0; overflow: hidden; text-align: left; } -.z-calevent-inner dl { +.z-calitem-inner dl { background: @eventColor; } -.z-calevent-header { +.z-calitem-header { background: @eventColor; font-size: @fontSizeL; font-family: @fontFamilyC; @@ -430,7 +430,7 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); white-space: nowrap; padding: 0 @basePadding; } -.z-calevent-inner .z-calevent-cnt { +.z-calitem-inner .z-calitem-cnt { background: @eventColor; font-size: @fontSizeL; font-family: @fontFamilyC; @@ -439,7 +439,7 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); line-height: 20px; color: @invertFontColor; } -.z-calevent-resizer { +.z-calitem-resizer { bottom: 2px; cursor: s-resize; height: 7px; @@ -457,78 +457,78 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); width: 10px; } } -.z-calendars-daylong-evt .z-calevent-inner .z-calevent-left-arrow, -.z-calevent-daylong-month .z-calevent-inner .z-calevent-left-arrow, -.z-calevent-left-more-faker .z-calevent-inner .z-calevent-left-arrow { +.z-calendars-daylong-evt .z-calitem-inner .z-calitem-left-arrow, +.z-calitem-daylong-month .z-calitem-inner .z-calitem-left-arrow, +.z-calitem-left-more-faker .z-calitem-inner .z-calitem-left-arrow { margin-left: 0; zoom: 1; } -.z-calendars-daylong-evt .z-calevent-inner .z-calevent-right-arrow, -.z-calevent-daylong-month .z-calevent-inner .z-calevent-right-arrow, -.z-calevent-right-more-faker .z-calevent-inner .z-calevent-right-arrow { +.z-calendars-daylong-evt .z-calitem-inner .z-calitem-right-arrow, +.z-calitem-daylong-month .z-calitem-inner .z-calitem-right-arrow, +.z-calitem-right-more-faker .z-calitem-inner .z-calitem-right-arrow { margin-right: 0; zoom: 1; } -.z-calendars-daylong-evt .z-calevent-text, -.z-calevent-daylong-month .z-calevent-text, -.z-calpp .z-calevent-text, -.z-calpp-month .z-calevent-text, -.z-calendars-evt-faker-dd .z-calevent-text { +.z-calendars-daylong-evt .z-calitem-text, +.z-calitem-daylong-month .z-calitem-text, +.z-calpp .z-calitem-text, +.z-calpp-month .z-calitem-text, +.z-calendars-evt-faker-dd .z-calitem-text { height: 20px; width: 100%; white-space: nowrap; overflow: hidden; } -.z-calevent-daylong-month .z-calevent-text { +.z-calitem-daylong-month .z-calitem-text { height: 20px; line-height: 20px; } -.z-calendars-week-day-cnt .z-calevent { +.z-calendars-week-day-cnt .z-calitem { width: 100%; position: absolute; } -.z-calendars-daylong-evt .z-calevent-cnt, -.z-calevent-daylong-month .z-calevent-cnt { +.z-calendars-daylong-evt .z-calitem-cnt, +.z-calitem-daylong-month .z-calitem-cnt { padding: 0 @basePadding; white-space: nowrap; cursor: pointer; overflow: hidden; } -.z-calevent-daylong-month .z-calevent-cnt { +.z-calitem-daylong-month .z-calitem-cnt { padding: 0 @basePadding; } -.z-calevent-daylong-month .z-calevent-t3, -.z-calevent-daylong-month .z-calevent-b3, -.z-calpp-month-evt-cnt .z-calevent-t3, -.z-calpp-month-evt-cnt .z-calevent-b3 { +.z-calitem-daylong-month .z-calitem-t3, +.z-calitem-daylong-month .z-calitem-b3, +.z-calpp-month-evt-cnt .z-calitem-t3, +.z-calpp-month-evt-cnt .z-calitem-b3 { background: @eventColor; } -.z-calevent-daylong-month .z-calevent-inner, -.z-calpp-month-evt-cnt .z-calevent-inner { +.z-calitem-daylong-month .z-calitem-inner, +.z-calpp-month-evt-cnt .z-calitem-inner { border-left-color: @eventColor; border-right-color: @eventColor; } -.z-calevent-month { +.z-calitem-month { white-space: nowrap; zoom: 1; padding: 0 @basePadding; line-height: 18px; } -.z-calevent-month .z-calevent-inner { +.z-calitem-month .z-calitem-inner { background: @eventColor; border-radius: @borderRadius; overflow: hidden; } -.z-calevent-month .z-calevent-header { +.z-calitem-month .z-calitem-header { background: transparent; color: @invertFontColor; font-size: @fontSizeL; font-family: @fontFamilyC; white-space: nowrap; } -.z-calevent-month .z-calevent-cnt { +.z-calitem-month .z-calitem-cnt { background: transparent; color: @invertFontColor; font-size: @fontSizeL; @@ -605,7 +605,7 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); vertical-align: top; position: relative; - & .z-calevent-left-more-faker { + & .z-calitem-left-more-faker { position: absolute; left: 0px; height: 20px; @@ -622,7 +622,7 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); vertical-align: top; position: relative; - & .z-calevent-right-more-faker { + & .z-calitem-right-more-faker { position: absolute; right: 0px; height: 20px; @@ -636,10 +636,10 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); &-m { vertical-align: top; padding: 1px 0 0; - .z-calevent-month { + .z-calitem-month { padding: 0; } - .z-calevent-text { + .z-calitem-text { padding: 0 @basePadding; } } @@ -653,31 +653,31 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); } } // popup override - & .z-calevent-body.z-calevent-left-arrow .z-calevent-cnt { + & .z-calitem-body.z-calitem-left-arrow .z-calitem-cnt { padding-left: @basePadding; } } -.z-calevent-left-more-faker, -.z-calevent-right-more-faker { +.z-calitem-left-more-faker, +.z-calitem-right-more-faker { cursor: pointer; } -.z-calpp-evt-faker .z-calevent-left-arrow-icon, -.z-calpp-evt-faker .z-calevent-right-arrow-icon, -.z-calpp-month-evt-faker .z-calevent-left-arrow-icon, -.z-calpp-month-evt-faker .z-calevent-right-arrow-icon { +.z-calpp-evt-faker .z-calitem-left-arrow-icon, +.z-calpp-evt-faker .z-calitem-right-arrow-icon, +.z-calpp-month-evt-faker .z-calitem-left-arrow-icon, +.z-calpp-month-evt-faker .z-calitem-right-arrow-icon { display: none; } -.z-calpp-evt-faker .z-calevent-inner .z-calevent-left-arrow, -.z-calpp-evt-faker .z-calevent-inner .z-calevent-right-arrow, -.z-calpp-month-evt-faker .z-calevent-inner .z-calevent-left-arrow, -.z-calpp-month-evt-faker .z-calevent-inner .z-calevent-right-arrow { +.z-calpp-evt-faker .z-calitem-inner .z-calitem-left-arrow, +.z-calpp-evt-faker .z-calitem-inner .z-calitem-right-arrow, +.z-calpp-month-evt-faker .z-calitem-inner .z-calitem-left-arrow, +.z-calpp-month-evt-faker .z-calitem-inner .z-calitem-right-arrow { padding: 0 1px; } -.z-calevent-left-more-faker .z-calevent-text { +.z-calitem-left-more-faker .z-calitem-text { text-align: right; } -.z-calevent-right-more-faker .z-calevent-text { +.z-calitem-right-more-faker .z-calitem-text { text-align: left; } @@ -714,11 +714,11 @@ e('<%@ taglib uri="http://www.zkoss.org/dsp/web/theme" prefix="t" %>'); left: 0; z-index: 28; // less than zkau.initZIndex } -.z-calendars-evt-faker-dd .z-calevent-inner .z-calevent-left-arrow { +.z-calendars-evt-faker-dd .z-calitem-inner .z-calitem-left-arrow { padding-left: 10px; zoom: 1; } -.z-calendars-evt-faker-dd .z-calevent-inner .z-calevent-right-arrow { +.z-calendars-evt-faker-dd .z-calitem-inner .z-calitem-right-arrow { padding-right: 7px; zoom: 1; } diff --git a/calendar/src/archive/web/js/calendar/zk.wpd b/calendar/src/archive/web/js/calendar/zk.wpd index beecf66..6317ebe 100644 --- a/calendar/src/archive/web/js/calendar/zk.wpd +++ b/calendar/src/archive/web/js/calendar/zk.wpd @@ -14,11 +14,11 @@ Copyright (C) 2009 Potix Corporation. All Rights Reserved. - - - - - - + + + + + +