Changeset 5827
- Timestamp:
- 07/02/08 10:49:47 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/compress/javascripts/spinelz/calendar.js
r5826 r5827 554 554 AbstractCalendar.id={container:"container",scheduleContainer:"scheduleContainer",selector:"selector",tooltip:"tooltip"}; 555 555 AbstractCalendar.prototype={destroy:Prototype.emptyFunction,beforeBuild:Prototype.emptyFunction,build:function(){ 556 return "<div id='"+this.getContainerId()+"' class='"+this.calendar.classNames.container+"'>"+this.buildHeader()+this.buildCalendar()+"<div id=\""+this.getTooltipId +"\" class=\"calendar_tooltip\" style=\"display: none;\"></div>"+"</div>";556 return "<div id='"+this.getContainerId()+"' class='"+this.calendar.classNames.container+"'>"+this.buildHeader()+this.buildCalendar()+"<div id=\""+this.getTooltipId()+"\" class=\"calendar_tooltip\" style=\"display: none;\"></div>"+"</div>"; 557 557 },buildHeader:function(){ 558 558 var _96=this.calendar.options.noEvent; … … 1185 1185 Event.observe(_173,"mouseout",this.hideTooltip.bindAsEventListener(this)); 1186 1186 } 1187 if(item.visible()){ 1187 1188 if(!_163&&((_159.edit==undefined)||_159.edit)){ 1188 1189 this.setDraggable(item,_171.last(),_15b); … … 1192 1193 this.scheduleNodes.push(item); 1193 1194 break; 1195 }else{ 1196 item.remove(); 1197 _16b--; 1198 } 1194 1199 }else{ 1195 1200 if(_161.include(_16d.getDay())){ … … 1456 1461 _1d1.finish.month=_1de.getMonth(); 1457 1462 _1d1.finish.day=_1de.getDate(); 1463 var arr=this.calendar.options.schedules; 1464 var idx=arr.indexOf(_1d1); 1465 arr.remove(idx); 1466 var _1e1=DateUtil.toDate(_1d1.start); 1467 arr.each(function(s,i){ 1468 idx=i; 1469 if(_1e1<DateUtil.toDate(s.start)){ 1470 throw $break; 1471 } 1472 }); 1473 arr.insert(idx,_1d1); 1458 1474 this.calendar.refreshSchedule(); 1459 1475 this.calendar.options.changeSchedule(_1d1); … … 1461 1477 this.calendar.refreshSchedule(); 1462 1478 } 1463 },updateTirm:function(_1 df){1464 var _1e 0=_1df.schedule;1465 var _1e 1=parseInt(Element.getStyle(_1df,"width"));1466 var top=parseInt(Element.getStyle(_1 df,"top"));1467 var left=parseInt(Element.getStyle(_1 df,"left"));1468 var _1e 4=Math.round((left+_1e1)/this.column.width)-1;1469 var _1e 5=Math.round(top/this.column.height);1470 var cell=this.findCell(_1e 5,_1e4);1471 var _1e 7=_1e0.finish;1472 var _1e 8=null;1479 },updateTirm:function(_1e4){ 1480 var _1e5=_1e4.schedule; 1481 var _1e6=parseInt(Element.getStyle(_1e4,"width")); 1482 var top=parseInt(Element.getStyle(_1e4,"top")); 1483 var left=parseInt(Element.getStyle(_1e4,"left")); 1484 var _1e9=Math.round((left+_1e6)/this.column.width)-1; 1485 var _1ea=Math.round(top/this.column.height); 1486 var cell=this.findCell(_1ea,_1e9); 1487 var _1ec=_1e5.finish; 1488 var _1ed=null; 1473 1489 if(this.dateMap){ 1474 _1e 8=this.dateMap[cell.id].toHash();1475 }else{ 1476 _1e 8=new Date(this.calendar.date.getTime());1477 _1e 8.setDate(parseInt(cell.id.getSuffix(),10));1478 _1e 8=_1e8.toHash();1479 } 1480 _1e 8.hour=_1e7.hour;1481 _1e 8.min=_1e7.min;1482 if(DateUtil.toDate(_1e 0.start).getTime()>=DateUtil.toDate(_1e8).getTime()){1483 var _1e 9=23;1484 var _1e a=55;1485 if(_1e 0.start.hour==_1e9&&_1e0.start.min==_1ea){1490 _1ed=this.dateMap[cell.id].toHash(); 1491 }else{ 1492 _1ed=new Date(this.calendar.date.getTime()); 1493 _1ed.setDate(parseInt(cell.id.getSuffix(),10)); 1494 _1ed=_1ed.toHash(); 1495 } 1496 _1ed.hour=_1ec.hour; 1497 _1ed.min=_1ec.min; 1498 if(DateUtil.toDate(_1e5.start).getTime()>=DateUtil.toDate(_1ed).getTime()){ 1499 var _1ee=23; 1500 var _1ef=55; 1501 if(_1e5.start.hour==_1ee&&_1e5.start.min==_1ef){ 1486 1502 this.calendar.refreshSchedule(); 1487 if(!((_1e 8.year==_1e7.year)&&(_1e8.month==_1e7.month)&&(_1e8.day==_1e7.day))){1503 if(!((_1ed.year==_1ec.year)&&(_1ed.month==_1ec.month)&&(_1ed.day==_1ec.day))){ 1488 1504 this.calendar.options.updateTirm(); 1489 1505 } 1490 1506 return; 1491 1507 }else{ 1492 _1e 8.hour=_1e9;1493 _1e 8.min=_1ea;1494 } 1495 } 1496 _1e 0.finish=_1e8;1508 _1ed.hour=_1ee; 1509 _1ed.min=_1ef; 1510 } 1511 } 1512 _1e5.finish=_1ed; 1497 1513 this.calendar.refreshSchedule(); 1498 if(!((_1e 8.year==_1e7.year)&&(_1e8.month==_1e7.month)&&(_1e8.day==_1e7.day))){1499 this.calendar.options.updateTirm(_1e 0);1500 } 1501 },getTimeText:function(_1 eb,_1ec){1502 var _1 ed=this.calendar;1503 return _1 ed.formatTime(_1eb);1504 },getDayDiff:function(_1 ee){1505 return DateUtil.numberOfDays(this.toDate(_1 ee.start),this.toDate(_1ee.finish));1514 if(!((_1ed.year==_1ec.year)&&(_1ed.month==_1ec.month)&&(_1ed.day==_1ec.day))){ 1515 this.calendar.options.updateTirm(_1e5); 1516 } 1517 },getTimeText:function(_1f0,_1f1){ 1518 var _1f2=this.calendar; 1519 return _1f2.formatTime(_1f0); 1520 },getDayDiff:function(_1f3){ 1521 return DateUtil.numberOfDays(this.toDate(_1f3.start),this.toDate(_1f3.finish)); 1506 1522 }}); 1507 1523 var CalendarWeek=Class.create(); 1508 1524 CalendarWeek.id=["calTable","columnContainer","columnHeader","column","next","pre","headerText"]; 1509 1525 Object.extend(CalendarWeek.prototype,AbstractCalendar.prototype); 1510 Object.extend(CalendarWeek.prototype,{initialize:function(_1 ef){1511 this.calendar=_1 ef;1512 var _1f 0=this.getWeek();1513 this.week=_1f 0[0];1514 this.invisibleWeek=_1f 0[1];1526 Object.extend(CalendarWeek.prototype,{initialize:function(_1f4){ 1527 this.calendar=_1f4; 1528 var _1f5=this.getWeek(); 1529 this.week=_1f5[0]; 1530 this.invisibleWeek=_1f5[1]; 1515 1531 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 1516 1532 this.setDisplayTime(); … … 1518 1534 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.pre+"' class='"+this.calendar.classNames.preWeekMark+"'></div>"+"</td>"; 1519 1535 },buildHeaderCenter:function(){ 1520 var _1f 1=[];1536 var _1f6=[]; 1521 1537 if(this.calendar.options.weekHeaderFormat){ 1522 _1f 1=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())];1523 } 1524 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f 1[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f1[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f1[2]||this.week.last().toDateString())+"</span>"+"</td>";1538 _1f6=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())]; 1539 } 1540 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f6[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f6[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f6[2]||this.week.last().toDateString())+"</span>"+"</td>"; 1525 1541 },formatHeaderDate:function(date){ 1526 1542 if(this.calendar.options.weekHeaderFormat){ … … 1531 1547 return "<td class='"+this.calendar.classNames.nextYears+"' align='right'>"+"<div id='"+this.ids.next+"' class='"+this.calendar.classNames.nextWeekMark+"'></div>"+"</td>"; 1532 1548 },buildCalendar:function(){ 1533 var _1f 3=(this.calendar.options.displayTimeLine)?this.buildTimeLine():"";1534 _1f 3+=this.buildCalendarContainer();1535 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1f 3+"</tr>"+"</table>";1549 var _1f8=(this.calendar.options.displayTimeLine)?this.buildTimeLine():""; 1550 _1f8+=this.buildCalendarContainer(); 1551 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1f8+"</tr>"+"</table>"; 1536 1552 },buildTimeLine:function(){ 1537 1553 var time=new Date(); 1538 var hour=0,_1f 6=24;1554 var hour=0,_1fb=24; 1539 1555 time.setHours(hour); 1540 1556 time.setMinutes(0); 1541 var _1f 7=this.buildTimeLineTop();1557 var _1fc=this.buildTimeLineTop(); 1542 1558 var now=new Date().getHours(); 1543 while(hour<_1f 6){1559 while(hour<_1fb){ 1544 1560 if(this.includeDisplayTime(hour)){ 1545 var _1f 9="pointer: default;";1546 if(_1f 7.length==0){1547 _1f 9+="border-top: none;";1548 } 1549 var _1f a=this.calendar.classNames.timeLineTime;1561 var _1fe="pointer: default;"; 1562 if(_1fc.length==0){ 1563 _1fe+="border-top: none;"; 1564 } 1565 var _1ff=this.calendar.classNames.timeLineTime; 1550 1566 if(hour==now){ 1551 _1f a+=" "+this.calendar.classNames.highlightTime;1552 } 1553 _1f 7+="<div class='"+_1fa+"' style='"+_1f9+"'>"+this.formatTime(time)+"</div>";1567 _1ff+=" "+this.calendar.classNames.highlightTime; 1568 } 1569 _1fc+="<div class='"+_1ff+"' style='"+_1fe+"'>"+this.formatTime(time)+"</div>"; 1554 1570 } 1555 1571 hour++; 1556 1572 time.setHours(hour); 1557 1573 } 1558 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1f 7+"</td>";1574 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1fc+"</td>"; 1559 1575 },buildTimeLineTop:function(){ 1560 1576 return "<div class='"+this.calendar.classNames.timeLineTimeTop+"'></div>"; … … 1562 1578 return "<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+this.buildCalendarHeader()+this.buildCalendarMain()+"</table>"+"</td>"; 1563 1579 },buildCalendarHeader:function(){ 1564 var _ 1fb=this.calendar.options.displayIndexes;1580 var _200=this.calendar.options.displayIndexes; 1565 1581 var ths=""; 1566 var _ 1fd=new Date().days();1567 var _ 1fe=100/_1fb.length+"%";1568 var _ 1ff=this.calendar.element.id.appendSuffix(this.ids.column);1569 var _20 0=this.calendar.element.id.appendSuffix(this.ids.headerText);1582 var _202=new Date().days(); 1583 var _203=100/_200.length+"%"; 1584 var _204=this.calendar.element.id.appendSuffix(this.ids.column); 1585 var _205=this.calendar.element.id.appendSuffix(this.ids.headerText); 1570 1586 this.headers=[]; 1571 var _20 1=this.calendar.options.noEvent;1572 var _20 2=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null;1573 this.week.each(function(w,_20 4){1587 var _206=this.calendar.options.noEvent; 1588 var _207=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null; 1589 this.week.each(function(w,_209){ 1574 1590 var text=null; 1575 if(_20 2){1576 text=_20 2.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]});1591 if(_207){ 1592 text=_207.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]}); 1577 1593 }else{ 1578 1594 text=w.toDateString().split(" "); … … 1580 1596 text=text.join(" "); 1581 1597 } 1582 var _20 6=(w.days()==_1fd)?this.calendar.classNames.highlightDay:"";1583 var _20 7=_200.appendSuffix(_204);1598 var _20b=(w.days()==_202)?this.calendar.classNames.highlightDay:""; 1599 var _20c=_205.appendSuffix(_209); 1584 1600 var node="<div class='"+this.calendar.classNames.headerColumn+"'>"; 1585 if(_20 1){1586 node+="<span='#' id='"+_20 7+"' class='"+_206+"' style='cursor: default;'>"+text+"</a>";1587 }else{ 1588 node+="<a href='#' id='"+_20 7+"' class='"+_206+"'>"+text+"</a>";1601 if(_206){ 1602 node+="<span='#' id='"+_20c+"' class='"+_20b+"' style='cursor: default;'>"+text+"</a>"; 1603 }else{ 1604 node+="<a href='#' id='"+_20c+"' class='"+_20b+"'>"+text+"</a>"; 1589 1605 } 1590 1606 node+="</div>"; 1591 this.headers.push({id:_20 7,wday:w});1592 ths+="<th id='"+_ 1ff.appendSuffix(_204)+"' width='"+_1fe+"'>"+node+"</th>";1607 this.headers.push({id:_20c,wday:w}); 1608 ths+="<th id='"+_204.appendSuffix(_209)+"' width='"+_203+"'>"+node+"</th>"; 1593 1609 }.bind(this)); 1594 1610 return "<tr>"+"<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+"<tr>"+ths+"</tr>"+"</table>"+"</td>"+"</tr>"; 1595 1611 },buildCalendarMain:function(){ 1596 var _20 9=this.calendar.options.displayIndexes;1612 var _20e=this.calendar.options.displayIndexes; 1597 1613 var tds=""; 1598 var _2 0b=100/_209.length+"%";1614 var _210=100/_20e.length+"%"; 1599 1615 this.dateMap={}; 1600 this.week.each(function(w,_2 0d){1601 var _2 0e=this.calendar.options.schedules[w.toDateString()];1602 var _2 0f="";1616 this.week.each(function(w,_212){ 1617 var _213=this.calendar.options.schedules[w.toDateString()]; 1618 var _214=""; 1603 1619 var i=0,j=0; 1604 1620 while(i<24){ 1605 1621 if(this.includeDisplayTime(i)){ 1606 var _21 2="";1607 if(_2 0f.length==0){1608 _21 2=this.calendar.classNames.columnTopDate;1622 var _217=""; 1623 if(_214.length==0){ 1624 _217=this.calendar.classNames.columnTopDate; 1609 1625 }else{ 1610 1626 if(i%1==0){ 1611 _21 2=this.calendar.classNames.columnDate;1612 }else{ 1613 _21 2=this.calendar.classNames.columnDateOdd;1614 } 1615 } 1616 var id=this.getDateId(w,i,_2 0d);1627 _217=this.calendar.classNames.columnDate; 1628 }else{ 1629 _217=this.calendar.classNames.columnDateOdd; 1630 } 1631 } 1632 var id=this.getDateId(w,i,_212); 1617 1633 var hour=i/1; 1618 1634 var min=i%1*60; 1619 1635 this.dateMap[id]=new Date(w.getFullYear(),w.getMonth(),w.getDate(),hour,min,0); 1620 _2 0f+="<div id='"+id+"' class='"+_212+"'></div>";1636 _214+="<div id='"+id+"' class='"+_217+"'></div>"; 1621 1637 } 1622 1638 i+=0.5; 1623 1639 } 1624 tds+="<td width='"+_2 0b+"'>"+_20f+"</td>";1640 tds+="<td width='"+_210+"'>"+_214+"</td>"; 1625 1641 }.bind(this)); 1626 1642 return "<tr>"+"<td>"+"<div id='"+this.getScheduleContainerId()+"' class='"+this.calendar.classNames.scheduleContainer+"' style='position: relative;'>"+"<table id='"+this.getCalendarTableId()+"' class='"+this.calendar.classNames.weekMainTable+"' style='position: relative;'>"+"<tr>"+tds+"</tr>"+"</table>"+"</div>"+"</td>"+"</tr>"; … … 1630 1646 var rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.columnDate); 1631 1647 this.column.height=parseInt(rule.style["height"],10)+1; 1632 },buildSchedule:function(_21 8){1633 var id="scheduleItem_"+_21 8.id;1634 var _21 a=(_218.edit==undefined||_218.edit);1648 },buildSchedule:function(_21d){ 1649 var id="scheduleItem_"+_21d.id; 1650 var _21f=(_21d.edit==undefined||_21d.edit); 1635 1651 var item=Builder.node("DIV",{id:id}); 1636 1652 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 1637 var _2 1c=this.calendar.options.noEvent;1638 var term=DateUtil.toDate(_21 8.finish).minutes()-DateUtil.toDate(_218.start).minutes();1639 var _2 1e={};1640 if(_21 8.background_color){1641 _2 1e.backgroundColor=_218.background_color;1642 } 1643 if(_21 8.frame_color){1644 _2 1e.borderTop="2px solid "+_218.frame_color;1645 _2 1e.borderLeft="1px solid "+_218.frame_color;1646 _2 1e.borderRight="1px solid "+_218.frame_color;1647 _2 1e.borderBottom="2px solid "+_218.frame_color;1653 var _221=this.calendar.options.noEvent; 1654 var term=DateUtil.toDate(_21d.finish).minutes()-DateUtil.toDate(_21d.start).minutes(); 1655 var _223={}; 1656 if(_21d.background_color){ 1657 _223.backgroundColor=_21d.background_color; 1658 } 1659 if(_21d.frame_color){ 1660 _223.borderTop="2px solid "+_21d.frame_color; 1661 _223.borderLeft="1px solid "+_21d.frame_color; 1662 _223.borderRight="1px solid "+_21d.frame_color; 1663 _223.borderBottom="2px solid "+_21d.frame_color; 1648 1664 if(term<=30){ 1649 _2 1e.backgroundColor=_218.frame_color;1650 } 1651 } 1652 if(_2 1c){1653 _2 1e.cursor="default";1654 } 1655 Element.setStyle(item,_2 1e);1656 var _2 1f=[];1657 if(_21 a){1658 var _22 0=Builder.node("DIV",{id:"scheduleDeleteImg_"+_218.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"});1659 _2 1f.push(_220);1660 item.appendChild(_22 0);1661 if(!_2 1c){1662 Event.observe(_22 0,"click",this.clickDeleteImage.bind(this,_218));1663 } 1664 } 1665 if(!_2 1c&&this.calendar.options.dblclickSchedule){1666 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_21 8));1665 _223.backgroundColor=_21d.frame_color; 1666 } 1667 } 1668 if(_221){ 1669 _223.cursor="default"; 1670 } 1671 Element.setStyle(item,_223); 1672 var _224=[]; 1673 if(_21f){ 1674 var _225=Builder.node("DIV",{id:"scheduleDeleteImg_"+_21d.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"}); 1675 _224.push(_225); 1676 item.appendChild(_225); 1677 if(!_221){ 1678 Event.observe(_225,"click",this.clickDeleteImage.bind(this,_21d)); 1679 } 1680 } 1681 if(!_221&&this.calendar.options.dblclickSchedule){ 1682 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_21d)); 1667 1683 } 1668 1684 var icon=null; 1669 if(_21 8.icon){1670 icon=Builder.node("IMG",{src:_21 8.icon,alt:"icon",style:"float: left;",width:16,height:16});1685 if(_21d.icon){ 1686 icon=Builder.node("IMG",{src:_21d.icon,alt:"icon",style:"float: left;",width:16,height:16}); 1671 1687 }else{ 1672 1688 if(Calendar.defaultIconPath){ … … 1674 1690 } 1675 1691 } 1676 var _22 2=null;1677 if(!_21 8.publicity){1692 var _227=null; 1693 if(!_21d.publicity){ 1678 1694 if(Calendar.privateImgPath){ 1679 _22 2=Builder.node("IMG",{id:"private_img_"+_218.id,src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16});1680 item.appendChild(_22 2);1681 }else{ 1682 _22 2=Builder.node("DIV",{id:"private_img_"+_218.id});1683 this.calendar.css.addClassNames(_22 2,"privateImg");1684 item.appendChild(_22 2);1685 } 1686 } 1687 if(!_2 1c&&(_21f.length>0)){1688 Event.observe(item,"mouseover",this.showImage.bind(this,_2 1f,_222));1689 Event.observe(item,"mouseout",this.hideImage.bind(this,_2 1f,_222));1690 } 1691 var text=this.getTimeText(_21 8.start,_218.finish);1692 var _22 4=_218.description.unescapeHTML();1693 var _22 5={id:id+"_text"};1694 if(_21 8.frame_color){1695 _22 5.style="background-color:"+_218.frame_color+";";1696 } 1697 if(!_2 1c&&_21a){1698 _22 5.style+="cursor: move;";1695 _227=Builder.node("IMG",{id:"private_img_"+_21d.id,src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16}); 1696 item.appendChild(_227); 1697 }else{ 1698 _227=Builder.node("DIV",{id:"private_img_"+_21d.id}); 1699 this.calendar.css.addClassNames(_227,"privateImg"); 1700 item.appendChild(_227); 1701 } 1702 } 1703 if(!_221&&(_224.length>0)){ 1704 Event.observe(item,"mouseover",this.showImage.bind(this,_224,_227)); 1705 Event.observe(item,"mouseout",this.hideImage.bind(this,_224,_227)); 1706 } 1707 var text=this.getTimeText(_21d.start,_21d.finish); 1708 var _229=_21d.description.unescapeHTML(); 1709 var _22a={id:id+"_text"}; 1710 if(_21d.frame_color){ 1711 _22a.style="background-color:"+_21d.frame_color+";"; 1712 } 1713 if(!_221&&_21f){ 1714 _22a.style+="cursor: move;"; 1699 1715 } 1700 1716 if(term<=15){ 1701 var _22 6=this.calendar.formatTime(_218.start);1702 _22 5.style+="line-height: 12px;";1717 var _22b=this.calendar.formatTime(_21d.start); 1718 _22a.style+="line-height: 12px;"; 1703 1719 if(UserAgent.isFF()){ 1704 _22 5.style+="white-space: nowrap;";1705 } 1706 var _22 7=Builder.node("DIV",_225,[icon,_226+" "+_224]);1707 this.calendar.css.addClassNames(_22 7,"scheduleTimeArea");1708 item.appendChild(_22 7);1720 _22a.style+="white-space: nowrap;"; 1721 } 1722 var _22c=Builder.node("DIV",_22a,[icon,_22b+" "+_229]); 1723 this.calendar.css.addClassNames(_22c,"scheduleTimeArea"); 1724 item.appendChild(_22c); 1709 1725 }else{ 1710 1726 if(term<=30){ 1711 var _22 6=this.calendar.formatTime(_218.start);1727 var _22b=this.calendar.formatTime(_21d.start); 1712 1728 if(UserAgent.isIE()){ 1713 _22 5.style+="line-height: 20px;";1714 }else{ 1715 _22 5.style+="line-height: 18px; white-space: nowrap;";1716 } 1717 var _22 7=Builder.node("DIV",_225,[icon,_226+" "+_224]);1718 this.calendar.css.addClassNames(_22 7,"scheduleTimeArea");1719 item.appendChild(_22 7);1720 }else{ 1721 _22 5.style+="line-height: 18px;";1722 var _22 7=Builder.node("DIV",_225,[icon,text]);1723 this.calendar.css.addClassNames(_22 7,"scheduleTimeArea");1724 item.appendChild(_22 7);1725 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_22 4]));1726 } 1727 } 1728 item.title=text.replace(/ /g,"")+" "+_22 4;1729 item.schedule=_21 8;1730 return [item,_22 7];1731 },adjustScheduleStyle:function(item,_22 9,_22a){1732 var _2 2b=item.schedule;1733 var time=this.convertHours(_2 2b);1734 var _2 2d=time[0];1735 var _2 2e=time[1];1729 _22a.style+="line-height: 20px;"; 1730 }else{ 1731 _22a.style+="line-height: 18px; white-space: nowrap;"; 1732 } 1733 var _22c=Builder.node("DIV",_22a,[icon,_22b+" "+_229]); 1734 this.calendar.css.addClassNames(_22c,"scheduleTimeArea"); 1735 item.appendChild(_22c); 1736 }else{ 1737 _22a.style+="line-height: 18px;"; 1738 var _22c=Builder.node("DIV",_22a,[icon,text]); 1739 this.calendar.css.addClassNames(_22c,"scheduleTimeArea"); 1740 item.appendChild(_22c); 1741 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_229])); 1742 } 1743 } 1744 item.title=text.replace(/ /g,"")+" "+_229; 1745 item.schedule=_21d; 1746 return [item,_22c]; 1747 },adjustScheduleStyle:function(item,_22e,_22f){ 1748 var _230=item.schedule; 1749 var time=this.convertHours(_230); 1750 var _232=time[0]; 1751 var _233=time[1]; 1736 1752 var same=[]; 1737 1753 var self=this; 1738 _22 a.each(function(h){1739 var _23 2=self.convertHours(h.schedule);1740 var _23 3=_232[0];1741 var _23 4=_232[1];1742 if(((_23 3<=_22d)&&(_234>_22d))||((_233<_22e)&&(_234>=_22e))||((_22d<=_233)&&(_22e>_233))||((_22d<_234)&&(_22e>=_234))){1754 _22f.each(function(h){ 1755 var _237=self.convertHours(h.schedule); 1756 var _238=_237[0]; 1757 var _239=_237[1]; 1758 if(((_238<=_232)&&(_239>_232))||((_238<_233)&&(_239>=_233))||((_232<=_238)&&(_233>_238))||((_232<_239)&&(_233>=_239))){ 1743 1759 same.push(h); 1744 1760 } 1745 1761 }); 1746 var _23 5=_229*this.getAdjustSize();1762 var _23a=_22e*this.getAdjustSize(); 1747 1763 if(UserAgent.isIE()||this.calendar.options.noEvent){ 1748 _23 5+=1;1749 } 1750 var left=this.column.width*_22 9+_235;1764 _23a+=1; 1765 } 1766 var left=this.column.width*_22e+_23a; 1751 1767 if(same.length==0){ 1752 1768 Element.setStyle(item,{left:left+"px"}); 1753 1769 }else{ 1754 1770 same.push(item); 1755 var _23 7=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1;1771 var _23c=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 1756 1772 same.each(function(s,i){ 1757 var _23 a=left+_237*i+(2*i);1758 Element.setStyle(s,{width:_23 7+"px",left:_23a+"px"});1773 var _23f=left+_23c*i+(2*i); 1774 Element.setStyle(s,{width:_23c+"px",left:_23f+"px"}); 1759 1775 }); 1760 1776 } 1761 1777 return left; 1762 1778 },setScheduleBaseStyle:function(item){ 1763 var _2 3c=item.schedule;1764 if(!this.calendar.isSameDate(_2 3c.start,_23c.finish)){1765 _2 3c.finish.hour=24;1766 _2 3c.finish.min=0;1767 } 1768 var time=this.convertHours(_2 3c);1769 var _2 3e=time.first();1770 var _2 3f=time.last();1771 var _24 0=this.column.height*2;1772 var diff=this.calendar.getTimeDiff(_2 3c.start,_23c.finish);1779 var _241=item.schedule; 1780 if(!this.calendar.isSameDate(_241.start,_241.finish)){ 1781 _241.finish.hour=24; 1782 _241.finish.min=0; 1783 } 1784 var time=this.convertHours(_241); 1785 var _243=time.first(); 1786 var _244=time.last(); 1787 var _245=this.column.height*2; 1788 var diff=this.calendar.getTimeDiff(_241.start,_241.finish); 1773 1789 var rate=(diff.hour+(diff.min/60))||1; 1774 1790 var over=0; 1775 1791 var top=0; 1776 var _24 5=0;1777 var _24 6=this.includeDisplayTime(_23e);1778 var _24 7=this.includeDisplayTime(_23f,true);1779 if(!_24 6&&!_247){1780 if((this.startTime<=_2 3e&&this.startTime<=_23f)||(_23e<this.finishTime&&_23f<this.finishTime)){1781 top=_24 5=0;1792 var _24a=0; 1793 var _24b=this.includeDisplayTime(_243); 1794 var _24c=this.includeDisplayTime(_244,true); 1795 if(!_24b&&!_24c){ 1796 if((this.startTime<=_243&&this.startTime<=_244)||(_243<this.finishTime&&_244<this.finishTime)){ 1797 top=_24a=0; 1782 1798 Element.hide(item); 1783 1799 this.hasInvisibleSchedule=true; 1784 1800 }else{ 1785 1801 top=0; 1786 _24 5=_240*(this.finishTime-this.startTime)-3;1787 } 1788 }else{ 1789 if(_24 6){1790 top=_24 0*(_23e-this.startTime);1791 _24 5=_240*rate-3;1802 _24a=_245*(this.finishTime-this.startTime)-3; 1803 } 1804 }else{ 1805 if(_24b){ 1806 top=_245*(_243-this.startTime); 1807 _24a=_245*rate-3; 1792 1808 }else{ 1793 1809 top=0; 1794 over=this.startTime-_2 3e;1795 _24 5=_240*(rate-over);1796 } 1797 if(_24 7){1798 }else{ 1799 over=_2 3f-this.finishTime;1800 _24 5-=_240*over;1810 over=this.startTime-_243; 1811 _24a=_245*(rate-over); 1812 } 1813 if(_24c){ 1814 }else{ 1815 over=_244-this.finishTime; 1816 _24a-=_245*over; 1801 1817 } 1802 1818 } 1803 1819 try{ 1804 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_24 5+"px"});1820 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_24a+"px"}); 1805 1821 } 1806 1822 catch(e){ … … 1814 1830 this.setCover(); 1815 1831 var self=this; 1816 var _24 9=$(this.getScheduleContainerId());1817 var _24 a=this.getDragDistance();1832 var _24e=$(this.getScheduleContainerId()); 1833 var _24f=this.getDragDistance(); 1818 1834 this.scheduleNodes=[]; 1819 var _2 4b=this.week.map(function(){1835 var _250=this.week.map(function(){ 1820 1836 return []; 1821 1837 }); 1822 var _2 4c=this.week.legth-1;1823 var _2 4d=this.calendar.options.noEvent;1824 this.calendar.options.schedules.each(function(_2 4e){1825 var _2 4f=[];1826 var sub,_25 1,_252=null;1827 self.week.each(function(date,_25 4){1828 if(self.calendar.betweenDate(_2 4e,date)){1829 if(self.isSameStartDate(_2 4e,date)&&self.isSameFinishDate(_24e,date)){1830 _25 2=self.setSchedule(_24e,_254,_24b,_249,_24a);1831 _25 2.cellDate=date;1832 _2 4f.push(_252);1833 }else{ 1834 sub=self.copyOneDaySchedule(_2 4e,date);1838 var _251=this.week.legth-1; 1839 var _252=this.calendar.options.noEvent; 1840 this.calendar.options.schedules.each(function(_253){ 1841 var _254=[]; 1842 var sub,_256,_257=null; 1843 self.week.each(function(date,_259){ 1844 if(self.calendar.betweenDate(_253,date)){ 1845 if(self.isSameStartDate(_253,date)&&self.isSameFinishDate(_253,date)){ 1846 _257=self.setSchedule(_253,_259,_250,_24e,_24f); 1847 _257.cellDate=date; 1848 _254.push(_257); 1849 }else{ 1850 sub=self.copyOneDaySchedule(_253,date); 1835 1851 if(sub.finish.hour==0&&sub.finish.min==0){ 1836 1852 throw $continue; 1837 1853 } 1838 _25 1=self.setSchedule(sub,_254,_24b,_249,_24a);1839 _25 1.originalSchedule=_24e;1840 _25 1.cellDate=date;1841 _2 4f.push(_251);1854 _256=self.setSchedule(sub,_259,_250,_24e,_24f); 1855 _256.originalSchedule=_253; 1856 _256.cellDate=date; 1857 _254.push(_256); 1842 1858 } 1843 1859 }else{ … … 1849 1865 if(!self.hasInvisibleSchedule){ 1850 1866 (self.invisibleWeek||[]).each(function(date){ 1851 if(self.calendar.betweenDate(_2 4e,date)){1867 if(self.calendar.betweenDate(_253,date)){ 1852 1868 self.hasInvisibleSchedule=true; 1853 1869 throw $break; … … 1855 1871 }); 1856 1872 } 1857 if(!_2 4d){1858 _2 4f.each(function(item){1859 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_2 4f));1860 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_2 4f));1861 }); 1862 } 1863 if(!self.hasInvisibleSchedule&&(_2 4f.length==0)){1873 if(!_252){ 1874 _254.each(function(item){ 1875 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_254)); 1876 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_254)); 1877 }); 1878 } 1879 if(!self.hasInvisibleSchedule&&(_254.length==0)){ 1864 1880 self.hasInvisibleSchedule=true; 1865 1881 } … … 1872 1888 new Hover(this.ids.pre); 1873 1889 new Hover(this.ids.next); 1874 var _25 7=this.calendar.options.clickDateText||this.clickDateText;1890 var _25c=this.calendar.options.clickDateText||this.clickDateText; 1875 1891 if(this.headers){ 1876 this.headers.each(function(_25 8){1877 Event.observe(_25 8.id,"mousedown",_257.bindAsEventListener(this,_258.wday));1892 this.headers.each(function(_25d){ 1893 Event.observe(_25d.id,"mousedown",_25c.bindAsEventListener(this,_25d.wday)); 1878 1894 }.bind(this)); 1879 1895 } 1880 1896 } 1881 },copyOneDaySchedule:function(_25 9,date){1897 },copyOneDaySchedule:function(_25e,date){ 1882 1898 var sub=null; 1883 if(this.isSameStartDate(_25 9,date)){1884 sub=this.copySchedule(_25 9,date);1899 if(this.isSameStartDate(_25e,date)){ 1900 sub=this.copySchedule(_25e,date); 1885 1901 sub.finish.hour=24; 1886 1902 sub.finish.min=0; 1887 1903 }else{ 1888 if(this.isSameFinishDate(_25 9,date)){1889 sub=this.copySchedule(_25 9,date);1904 if(this.isSameFinishDate(_25e,date)){ 1905 sub=this.copySchedule(_25e,date); 1890 1906 sub.start.hour=0; 1891 1907 sub.start.min=0; 1892 1908 }else{ 1893 sub=this.copySchedule(_25 9,date);1909 sub=this.copySchedule(_25e,date); 1894 1910 sub.start.hour=0; 1895 1911 sub.start.min=0; … … 1899 1915 } 1900 1916 return sub; 1901 },copySchedule:function(_2 5c,date){1902 sub=Object.extend({},_2 5c);1903 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_2 5c.start.hour,min:_25c.start.min};1904 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_2 5c.finish.hour,min:_25c.finish.min};1917 },copySchedule:function(_261,date){ 1918 sub=Object.extend({},_261); 1919 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_261.start.hour,min:_261.start.min}; 1920 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_261.finish.hour,min:_261.finish.min}; 1905 1921 return sub; 1906 },setSchedule:function(_2 5e,_25f,_260,_261,_262){1907 var _26 3=this.buildSchedule(_25e);1908 var item=_26 3.first();1909 _26 1.appendChild(item);1922 },setSchedule:function(_263,_264,_265,_266,_267){ 1923 var _268=this.buildSchedule(_263); 1924 var item=_268.first(); 1925 _266.appendChild(item); 1910 1926 this.setScheduleBaseStyle(item); 1911 var left=this.adjustScheduleStyle(item,_2 5f,_260[_25f]);1912 var _26 6=_25f*this.getAdjustSize();1913 var _26 7=this.column.width+_266+"px";1914 if(!this.calendar.options.noEvent&&((_2 5e.edit==undefined)||_25e.edit)){1915 this.setDraggable(item,_26 3.last(),_261,_262);1927 var left=this.adjustScheduleStyle(item,_264,_265[_264]); 1928 var _26b=_264*this.getAdjustSize(); 1929 var _26c=this.column.width+_26b+"px"; 1930 if(!this.calendar.options.noEvent&&((_263.edit==undefined)||_263.edit)){ 1931 this.setDraggable(item,_268.last(),_266,_267); 1916 1932 this.setResize(item); 1917 1933 } 1918 _26 0[_25f].push(item);1934 _265[_264].push(item); 1919 1935 this.scheduleNodes.push(item); 1920 1936 return item; 1921 1937 },getDragDistance:function(){ 1922 var _26 8=this.getAdjustSize();1923 return [this.column.width+_26 8,this.column.height/2];1924 },setDraggable:function(item,_26 a,_26b,_26c){1938 var _26d=this.getAdjustSize(); 1939 return [this.column.width+_26d,this.column.height/2]; 1940 },setDraggable:function(item,_26f,_270,_271){ 1925 1941 var self=this; 1926 new Draggable(item,{handle:_26 a,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_270){1927 var _27 1=Element.getDimensions(item);1928 var _27 2=Element.getDimensions(_26b);1929 var _27 3=(self.column.height/2);1930 var _27 4=_270.offset;1942 new Draggable(item,{handle:_26f,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_275){ 1943 var _276=Element.getDimensions(item); 1944 var _277=Element.getDimensions(_270); 1945 var _278=(self.column.height/2); 1946 var _279=_275.offset; 1931 1947 var xy=[x,y].map(function(v,i){ 1932 return Math.floor((v+_27 4[i])/_26c[i])*_26c[i];1933 }); 1934 xy=[self._constrain(xy[0],0,_27 2.width-_271.width),self._constrain(xy[1],0-(_271.height-_273),_272.height-_273)];1948 return Math.floor((v+_279[i])/_271[i])*_271[i]; 1949 }); 1950 xy=[self._constrain(xy[0],0,_277.width-_276.width),self._constrain(xy[1],0-(_276.height-_278),_277.height-_278)]; 1935 1951 return xy; 1936 },onEnd:function(_27 8,_279){1937 self.changeSchedule(_27 8,_279);1938 },change:function(_27 a){1939 self.changeTimeDisplay(_27 a.element);1952 },onEnd:function(_27d,_27e){ 1953 self.changeSchedule(_27d,_27e); 1954 },change:function(_27f){ 1955 self.changeTimeDisplay(_27f.element); 1940 1956 }}); 1941 1957 },setResize:function(item){ 1942 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_2 7c){1943 this.updateTirm(_2 7c);1944 }.bind(this),change:function(_2 7d){1945 this.changeTimeDisplay(_2 7d);1958 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_281){ 1959 this.updateTirm(_281); 1960 }.bind(this),change:function(_282){ 1961 this.changeTimeDisplay(_282); 1946 1962 }.bind(this)}); 1947 },getDate:function(_2 7e){1948 return _2 7e.date;1949 },abstractSelect:function(_2 7f,_280){1950 var _28 1=this.findClickedElement(_27f);1951 if(_28 1){1952 if(Element.hasClassName(_28 1,Calendar.className.columnDate)||Element.hasClassName(_281,Calendar.className.columnDateOdd)||Element.hasClassName(_281,Calendar.className.columnTopDate)){1953 var date=this.getDate(_28 1);1954 _28 0(date,_281);1963 },getDate:function(_283){ 1964 return _283.date; 1965 },abstractSelect:function(_284,_285){ 1966 var _286=this.findClickedElement(_284); 1967 if(_286){ 1968 if(Element.hasClassName(_286,Calendar.className.columnDate)||Element.hasClassName(_286,Calendar.className.columnDateOdd)||Element.hasClassName(_286,Calendar.className.columnTopDate)){ 1969 var date=this.getDate(_286); 1970 _285(date,_286); 1955 1971 } 1956 1972 } 1957 1973 },getSelectedTerm:function(){ 1958 var _28 3=this.calendar.getSelected();1959 if(_28 3.length==0){1974 var _288=this.calendar.getSelected(); 1975 if(_288.length==0){ 1960 1976 return; 1961 1977 } 1962 1978 if(this.calendar.options.build){ 1963 var last=_28 3.last();1979 var last=_288.last(); 1964 1980 if(last){ 1965 1981 last=this.dateMap[last.id]; 1966 1982 }else{ 1967 last=this.dateMap[_28 3.first().id];1983 last=this.dateMap[_288.first().id]; 1968 1984 } 1969 1985 last=new Date(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),0); 1970 1986 last.setMinutes(last.getMinutes()+30); 1971 return [this.dateMap[_28 3.first().id],last];1972 }else{ 1973 var last=this._getDateTimeFromElement(_28 3.last());1987 return [this.dateMap[_288.first().id],last]; 1988 }else{ 1989 var last=this._getDateTimeFromElement(_288.last()); 1974 1990 last.setMinutes(last.getMinutes()+30); 1975 return [this._getDateTimeFromElement(_28 3.first()),last];1991 return [this._getDateTimeFromElement(_288.first()),last]; 1976 1992 } 1977 1993 },setWidth:function(node){ 1978 1994 Element.setStyle(node,{width:this.column.width+"px"}); 1979 },inspectArgument:function(_28 6,time){1980 if(_28 6.date){1981 return _28 6;1995 },inspectArgument:function(_28b,time){ 1996 if(_28b.date){ 1997 return _28b; 1982 1998 } 1983 1999 var self=this; 1984 var _28 9=this.calendar.getSelected();1985 var _28 a=[];1986 this.calendar.recurrence(_28 6,function(o){1987 var _2 8c={};2000 var _28e=this.calendar.getSelected(); 2001 var _28f=[]; 2002 this.calendar.recurrence(_28b,function(o){ 2003 var _291={}; 1988 2004 if(!o.date){ 1989 _2 8c={date:self.getDate(_289[0])};2005 _291={date:self.getDate(_28e[0])}; 1990 2006 if(!o.start){ 1991 _2 8c.start=_289[0].time;2007 _291.start=_28e[0].time; 1992 2008 } 1993 2009 if(!o.finish){ 1994 _2 8c.finish=_289[_289.length-1].time;1995 } 1996 } 1997 Object.extend(_2 8c,o);1998 _28 a.push(_28c);1999 }); 2000 return _28 a;2010 _291.finish=_28e[_28e.length-1].time; 2011 } 2012 } 2013 Object.extend(_291,o); 2014 _28f.push(_291); 2015 }); 2016 return _28f; 2001 2017 },inspectDateArgument:function(date){ 2002 2018 if(date){ 2003 2019 return date; 2004 2020 } 2005 var _2 8e=this;2006 var _2 8f=this.getSelected();2007 if(_2 8f.length==0){2021 var _293=this; 2022 var _294=this.getSelected(); 2023 if(_294.length==0){ 2008 2024 return null; 2009 2025 } 2010 return _2 8f.collect(function(d){2011 return _2 8e.getDate(d);2012 }); 2013 },addColumnClass:function(_29 1){2026 return _294.collect(function(d){ 2027 return _293.getDate(d); 2028 }); 2029 },addColumnClass:function(_296){ 2014 2030 if(document.all){ 2015 this.calendar.css.addClassNames(_29 1,"columnWin");2016 }else{ 2017 this.calendar.css.addClassNames(_29 1,"column");2031 this.calendar.css.addClassNames(_296,"columnWin"); 2032 }else{ 2033 this.calendar.css.addClassNames(_296,"column"); 2018 2034 } 2019 2035 },getHeaderId:function(){ … … 2021 2037 },getColumnId:function(i){ 2022 2038 return this.calendar.element.id.appendSuffix(CalendarWeek.id.column+"_"+i); 2023 },changeSchedule:function(_29 3,_294){2024 var _29 5=_293.element;2025 var _29 6=_295.schedule;2026 var time=this.getTimeByElement(_29 5);2027 this.calendar.cacheSchedule(_29 6);2028 var _29 8=$(this.getScheduleContainerId());2029 var _29 9=Element.getDimensions(_298);2030 var _29 a=Position.cumulativeOffset(_298);2031 var x=Event.pointerX(_29 4);2032 var y=Event.pointerY(_29 4);2033 var left=parseInt(Element.getStyle(_29 5,"left"));2034 var _2 9e=Math.round(left/this.column.width);2035 var date=this.week[_2 9e];2036 if(_29 6.start.year==date.getFullYear()&&_296.start.month==date.getMonth()&&_296.start.day==date.getDate()&&_296.start.hour==time[0].hour&&_296.start.min==time[0].min&&_296.finish.year==date.getFullYear()&&_296.finish.month==date.getMonth()&&_296.finish.day==date.getDate()&&_296.finish.hour==time[1].hour&&_296.finish.min==time[1].min){2039 },changeSchedule:function(_298,_299){ 2040 var _29a=_298.element; 2041 var _29b=_29a.schedule; 2042 var time=this.getTimeByElement(_29a); 2043 this.calendar.cacheSchedule(_29b); 2044 var _29d=$(this.getScheduleContainerId()); 2045 var _29e=Element.getDimensions(_29d); 2046 var _29f=Position.cumulativeOffset(_29d); 2047 var x=Event.pointerX(_299); 2048 var y=Event.pointerY(_299); 2049 var left=parseInt(Element.getStyle(_29a,"left")); 2050 var _2a3=Math.round(left/this.column.width); 2051 var date=this.week[_2a3]; 2052 if(_29b.start.year==date.getFullYear()&&_29b.start.month==date.getMonth()&&_29b.start.day==date.getDate()&&_29b.start.hour==time[0].hour&&_29b.start.min==time[0].min&&_29b.finish.year==date.getFullYear()&&_29b.finish.month==date.getMonth()&&_29b.finish.day==date.getDate()&&_29b.finish.hour==time[1].hour&&_29b.finish.min==time[1].min){ 2037 2053 this.calendar.refreshSchedule(); 2038 2054 return; 2039 2055 } 2040 if(_29 5.originalSchedule){2041 _29 6=_295.originalSchedule;2042 } 2043 var _2a 0={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min};2044 var _2a 1=DateUtil.toDate(_2a0);2045 var _2a 2=_295.cellDate.days()-DateUtil.toDate(_296.start).days();2046 _2a 1.setDate(_2a1.getDate()-_2a2);2047 var diff=_2a 1.getTime()-DateUtil.toDate(_296.start).getTime();2048 _29 6.start=_2a1.toHash();2049 _29 6.finish=new Date(DateUtil.toDate(_296.finish).getTime()+diff).toHash();2056 if(_29a.originalSchedule){ 2057 _29b=_29a.originalSchedule; 2058 } 2059 var _2a5={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 2060 var _2a6=DateUtil.toDate(_2a5); 2061 var _2a7=_29a.cellDate.days()-DateUtil.toDate(_29b.start).days(); 2062 _2a6.setDate(_2a6.getDate()-_2a7); 2063 var diff=_2a6.getTime()-DateUtil.toDate(_29b.start).getTime(); 2064 _29b.start=_2a6.toHash(); 2065 _29b.finish=new Date(DateUtil.toDate(_29b.finish).getTime()+diff).toHash(); 2050 2066 this.calendar.refreshSchedule(); 2051 this.calendar.options.changeSchedule(_29 6);2052 },updateTirm:function(_2a 4){2053 var _2a 5=_2a4.schedule;2054 var time=this.getTimeByElement(_2a 4);2055 this.calendar.cacheSchedule(_2a 5);2056 var left=parseInt(Element.getStyle(_2a 4,"left"));2057 var _2a 8=Math.floor(left/this.column.width);2058 var date=this.week[_2a 8];2059 var _2a a=this.isChengeSchedule(_2a4,time);2060 if(_2a 4.originalSchedule){2061 _2a 5=_2a4.originalSchedule;2062 } 2063 if(_2a a.start){2064 _2a 5.start.year=date.getFullYear();2065 _2a 5.start.month=date.getMonth();2066 _2a 5.start.day=date.getDate();2067 _2a 5.start.hour=time[0].hour;2068 _2a 5.start.min=time[0].min;2069 } 2070 if(_2a a.finish){2071 _2a 5.finish.year=date.getFullYear();2072 _2a 5.finish.month=date.getMonth();2073 _2a 5.finish.day=date.getDate();2074 _2a 5.finish.hour=time[1].hour;2075 _2a 5.finish.min=time[1].min;2067 this.calendar.options.changeSchedule(_29b); 2068 },updateTirm:function(_2a9){ 2069 var _2aa=_2a9.schedule; 2070 var time=this.getTimeByElement(_2a9); 2071 this.calendar.cacheSchedule(_2aa); 2072 var left=parseInt(Element.getStyle(_2a9,"left")); 2073 var _2ad=Math.floor(left/this.column.width); 2074 var date=this.week[_2ad]; 2075 var _2af=this.isChengeSchedule(_2a9,time); 2076 if(_2a9.originalSchedule){ 2077 _2aa=_2a9.originalSchedule; 2078 } 2079 if(_2af.start){ 2080 _2aa.start.year=date.getFullYear(); 2081 _2aa.start.month=date.getMonth(); 2082 _2aa.start.day=date.getDate(); 2083 _2aa.start.hour=time[0].hour; 2084 _2aa.start.min=time[0].min; 2085 } 2086 if(_2af.finish){ 2087 _2aa.finish.year=date.getFullYear(); 2088 _2aa.finish.month=date.getMonth(); 2089 _2aa.finish.day=date.getDate(); 2090 _2aa.finish.hour=time[1].hour; 2091 _2aa.finish.min=time[1].min; 2076 2092 } 2077 2093 this.calendar.refreshSchedule(); 2078 if(_2a a.start||_2aa.finish){2079 this.calendar.options.updateTirm(_2a 5);2080 } 2081 },changeTimeDisplay:function(_2 ab){2082 var _2 ac=_2ab.schedule;2083 var time=this.getTimeByElement(_2 ab);2084 var _2 ae=Element.getElementsByClassName(_2ab,Calendar.className.scheduleTimeArea)[0];2094 if(_2af.start||_2af.finish){ 2095 this.calendar.options.updateTirm(_2aa); 2096 } 2097 },changeTimeDisplay:function(_2b0){ 2098 var _2b1=_2b0.schedule; 2099 var time=this.getTimeByElement(_2b0); 2100 var _2b3=Element.getElementsByClassName(_2b0,Calendar.className.scheduleTimeArea)[0]; 2085 2101 var text=this.getTimeText(time[0],time[1]); 2086 _2 ae.innerHTML=text;2087 },findClickedElement:function(_2b 0){2088 var _2b 1=$(this.getScheduleContainerId());2089 var _2b 2=Position.cumulativeOffset(_2b1);2090 var _2b 3=Position.realOffset(_2b1).last();2091 _2b 3-=document.documentElement.scrollTop||document.body.scrollTop;2092 var x=Event.pointerX(_2b 0)-_2b2[0];2093 var y=Event.pointerY(_2b 0)-_2b2[1]+_2b3;2094 var _2b 6=Math.floor(y/this.column.height);2095 var _2b 7=Math.floor(x/this.column.width);2102 _2b3.innerHTML=text; 2103 },findClickedElement:function(_2b5){ 2104 var _2b6=$(this.getScheduleContainerId()); 2105 var _2b7=Position.cumulativeOffset(_2b6); 2106 var _2b8=Position.realOffset(_2b6).last(); 2107 _2b8-=document.documentElement.scrollTop||document.body.scrollTop; 2108 var x=Event.pointerX(_2b5)-_2b7[0]; 2109 var y=Event.pointerY(_2b5)-_2b7[1]+_2b8; 2110 var _2bb=Math.floor(y/this.column.height); 2111 var _2bc=Math.floor(x/this.column.width); 2096 2112 var row=this.calendarTable.rows[0]; 2097 if(_2b 7>=row.cells.length){2098 _2b 7--;2099 } 2100 return $(row.cells[_2b 7]).down(_2b6);2101 },multipleSelection:function(_2b 9){2113 if(_2bc>=row.cells.length){ 2114 _2bc--; 2115 } 2116 return $(row.cells[_2bc]).down(_2bb); 2117 },multipleSelection:function(_2be){ 2102 2118 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 2103 2119 return; 2104 2120 } 2105 2121 var self=this; 2106 var _2 bb=this.calendar;2107 var _2 bc=this.calendar.selectedBase;2108 var _2 bd=this._getDateFromElement(_2bc).getDate();2109 this.abstractSelect(_2b 9,function(date,_2bf){2110 var _2c 0=$(_2bc.id);2111 if(_2 bd!=self._getDateFromElement(_2bf).getDate()){2122 var _2c0=this.calendar; 2123 var _2c1=this.calendar.selectedBase; 2124 var _2c2=this._getDateFromElement(_2c1).getDate(); 2125 this.abstractSelect(_2be,function(date,_2c4){ 2126 var _2c5=$(_2c1.id); 2127 if(_2c2!=self._getDateFromElement(_2c4).getDate()){ 2112 2128 return; 2113 2129 } 2114 var _2c 1=$A(_2c0.parentNode.childNodes);2115 var ids=[this._getTime(_2 bc),this._getTime(_2bf)];2130 var _2c6=$A(_2c5.parentNode.childNodes);
