Changeset 5764
- Timestamp:
- 05/27/08 13:14:25 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/compress/javascripts/spinelz/calendar.js
r5763 r5764 1105 1105 item.length=_14f; 1106 1106 item.cellIndex=_154; 1107 item.cellDate=_151; 1107 1108 this.container.appendChild(item); 1108 1109 this.setScheduleBaseStyle(item,_153,_154,_14f); … … 1361 1362 var cell=this.findCell(_1b4,_1b6); 1362 1363 var date=new Date(this.calendar.date.getTime()); 1363 date.setDate(parseInt(cell.id.getSuffix(),10)); 1364 var _1bc=_1b1.cellDate.days()-DateUtil.toDate(_1b2.start).days(); 1365 date.setDate(parseInt(cell.id.getSuffix(),10)-_1bc); 1364 1366 var diff=this.getDayDiff(_1b2); 1365 var _1b d=date.advance({days:diff});1366 if(_1b2.start.month==date.getMonth()&&_1b2.start.day==date.getDate()&&_1b2.finish.month==_1b d.getMonth()&&_1b2.finish.day==_1bd.getDate()){1367 var _1be=date.advance({days:diff}); 1368 if(_1b2.start.month==date.getMonth()&&_1b2.start.day==date.getDate()&&_1b2.finish.month==_1be.getMonth()&&_1b2.finish.day==_1be.getDate()){ 1367 1369 this.calendar.refreshSchedule(); 1368 1370 return; … … 1371 1373 _1b2.start.month=date.getMonth(); 1372 1374 _1b2.start.day=date.getDate(); 1373 _1b2.finish.year=_1b d.getFullYear();1374 _1b2.finish.month=_1b d.getMonth();1375 _1b2.finish.day=_1b d.getDate();1375 _1b2.finish.year=_1be.getFullYear(); 1376 _1b2.finish.month=_1be.getMonth(); 1377 _1b2.finish.day=_1be.getDate(); 1376 1378 this.calendar.refreshSchedule(); 1377 1379 this.calendar.options.changeSchedule(_1b2); … … 1379 1381 this.calendar.refreshSchedule(); 1380 1382 } 1381 },updateTirm:function(_1b e){1382 var _1 bf=_1be.schedule;1383 var _1c 0=parseInt(Element.getStyle(_1be,"width"));1384 var top=parseInt(Element.getStyle(_1b e,"top"));1385 var left=parseInt(Element.getStyle(_1b e,"left"));1386 var _1c 3=Math.round((left+_1c0)/this.column.width)-1;1387 var _1c 4=Math.round(top/this.column.height);1388 var cell=this.findCell(_1c 4,_1c3);1389 var _1c 6=_1bf.finish;1390 var _1c 7=null;1383 },updateTirm:function(_1bf){ 1384 var _1c0=_1bf.schedule; 1385 var _1c1=parseInt(Element.getStyle(_1bf,"width")); 1386 var top=parseInt(Element.getStyle(_1bf,"top")); 1387 var left=parseInt(Element.getStyle(_1bf,"left")); 1388 var _1c4=Math.round((left+_1c1)/this.column.width)-1; 1389 var _1c5=Math.round(top/this.column.height); 1390 var cell=this.findCell(_1c5,_1c4); 1391 var _1c7=_1c0.finish; 1392 var _1c8=null; 1391 1393 if(this.dateMap){ 1392 _1c 7=this.dateMap[cell.id].toHash();1393 }else{ 1394 _1c 7=new Date(this.calendar.date.getTime());1395 _1c 7.setDate(parseInt(cell.id.getSuffix(),10));1396 _1c 7=_1c7.toHash();1397 } 1398 _1c 7.hour=_1c6.hour;1399 _1c 7.min=_1c6.min;1400 if(DateUtil.toDate(_1 bf.start).getTime()>=DateUtil.toDate(_1c7).getTime()){1401 var _1c 8=23;1402 var _1c 9=55;1403 if(_1 bf.start.hour==_1c8&&_1bf.start.min==_1c9){1394 _1c8=this.dateMap[cell.id].toHash(); 1395 }else{ 1396 _1c8=new Date(this.calendar.date.getTime()); 1397 _1c8.setDate(parseInt(cell.id.getSuffix(),10)); 1398 _1c8=_1c8.toHash(); 1399 } 1400 _1c8.hour=_1c7.hour; 1401 _1c8.min=_1c7.min; 1402 if(DateUtil.toDate(_1c0.start).getTime()>=DateUtil.toDate(_1c8).getTime()){ 1403 var _1c9=23; 1404 var _1ca=55; 1405 if(_1c0.start.hour==_1c9&&_1c0.start.min==_1ca){ 1404 1406 this.calendar.refreshSchedule(); 1405 1407 this.calendar.options.updateTirm(); 1406 1408 return; 1407 1409 }else{ 1408 _1c 7.hour=_1c8;1409 _1c 7.min=_1c9;1410 } 1411 } 1412 _1 bf.finish=_1c7;1410 _1c8.hour=_1c9; 1411 _1c8.min=_1ca; 1412 } 1413 } 1414 _1c0.finish=_1c8; 1413 1415 this.calendar.refreshSchedule(); 1414 this.calendar.options.updateTirm(_1 bf);1415 },getTimeText:function(_1c a,_1cb){1416 var _1c c=this.calendar;1417 return _1c c.formatTime(_1ca);1418 },getDayDiff:function(_1c d){1419 return DateUtil.numberOfDays(this.toDate(_1c d.start),this.toDate(_1cd.finish));1416 this.calendar.options.updateTirm(_1c0); 1417 },getTimeText:function(_1cb,_1cc){ 1418 var _1cd=this.calendar; 1419 return _1cd.formatTime(_1cb); 1420 },getDayDiff:function(_1ce){ 1421 return DateUtil.numberOfDays(this.toDate(_1ce.start),this.toDate(_1ce.finish)); 1420 1422 }}); 1421 1423 var CalendarWeek=Class.create(); 1422 1424 CalendarWeek.id=["calTable","columnContainer","columnHeader","column","next","pre","headerText"]; 1423 1425 Object.extend(CalendarWeek.prototype,AbstractCalendar.prototype); 1424 Object.extend(CalendarWeek.prototype,{initialize:function(_1c e){1425 this.calendar=_1c e;1426 Object.extend(CalendarWeek.prototype,{initialize:function(_1cf){ 1427 this.calendar=_1cf; 1426 1428 this.week=this.getWeek(); 1427 1429 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); … … 1430 1432 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.pre+"' class='"+this.calendar.classNames.preWeekMark+"'></div>"+"</td>"; 1431 1433 },buildHeaderCenter:function(){ 1432 var _1 cf=[];1434 var _1d0=[]; 1433 1435 if(this.calendar.options.weekHeaderFormat){ 1434 _1 cf=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())];1435 } 1436 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1 cf[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1cf[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1cf[2]||this.week.last().toDateString())+"</span>"+"</td>";1436 _1d0=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())]; 1437 } 1438 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1d0[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1d0[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1d0[2]||this.week.last().toDateString())+"</span>"+"</td>"; 1437 1439 },formatHeaderDate:function(date){ 1438 1440 if(this.calendar.options.weekHeaderFormat){ … … 1443 1445 return "<td class='"+this.calendar.classNames.nextYears+"' align='right'>"+"<div id='"+this.ids.next+"' class='"+this.calendar.classNames.nextWeekMark+"'></div>"+"</td>"; 1444 1446 },buildCalendar:function(){ 1445 var _1d 1=(this.calendar.options.displayTimeLine)?this.buildTimeLine():"";1446 _1d 1+=this.buildCalendarContainer();1447 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1d 1+"</tr>"+"</table>";1447 var _1d2=(this.calendar.options.displayTimeLine)?this.buildTimeLine():""; 1448 _1d2+=this.buildCalendarContainer(); 1449 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1d2+"</tr>"+"</table>"; 1448 1450 },buildTimeLine:function(){ 1449 1451 var time=new Date(); 1450 var hour=0,_1d 4=24;1452 var hour=0,_1d5=24; 1451 1453 time.setHours(hour); 1452 1454 time.setMinutes(0); 1453 var _1d 5=this.buildTimeLineTop();1455 var _1d6=this.buildTimeLineTop(); 1454 1456 var now=new Date().getHours(); 1455 while(hour<_1d 4){1457 while(hour<_1d5){ 1456 1458 if(this.includeDisplayTime(hour)){ 1457 var _1d 7="pointer: default;";1458 if(_1d 5.length==0){1459 _1d 7+="border-top: none;";1460 } 1461 var _1d 8=this.calendar.classNames.timeLineTime;1459 var _1d8="pointer: default;"; 1460 if(_1d6.length==0){ 1461 _1d8+="border-top: none;"; 1462 } 1463 var _1d9=this.calendar.classNames.timeLineTime; 1462 1464 if(hour==now){ 1463 _1d 8+=" "+this.calendar.classNames.highlightTime;1464 } 1465 _1d 5+="<div class='"+_1d8+"' style='"+_1d7+"'>"+this.formatTime(time)+"</div>";1465 _1d9+=" "+this.calendar.classNames.highlightTime; 1466 } 1467 _1d6+="<div class='"+_1d9+"' style='"+_1d8+"'>"+this.formatTime(time)+"</div>"; 1466 1468 } 1467 1469 hour++; 1468 1470 time.setHours(hour); 1469 1471 } 1470 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1d 5+"</td>";1472 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1d6+"</td>"; 1471 1473 },buildTimeLineTop:function(){ 1472 1474 return "<div class='"+this.calendar.classNames.timeLineTimeTop+"'></div>"; … … 1474 1476 return "<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+this.buildCalendarHeader()+this.buildCalendarMain()+"</table>"+"</td>"; 1475 1477 },buildCalendarHeader:function(){ 1476 var _1d 9=this.calendar.options.displayIndexes;1478 var _1da=this.calendar.options.displayIndexes; 1477 1479 var ths=""; 1478 var _1d b=new Date().days();1479 var _1d c=100/_1d9.length+"%";1480 var _1d d=this.calendar.element.id.appendSuffix(this.ids.column);1481 var _1d e=this.calendar.element.id.appendSuffix(this.ids.headerText);1480 var _1dc=new Date().days(); 1481 var _1dd=100/_1da.length+"%"; 1482 var _1de=this.calendar.element.id.appendSuffix(this.ids.column); 1483 var _1df=this.calendar.element.id.appendSuffix(this.ids.headerText); 1482 1484 this.headers=[]; 1483 var _1 df=this.calendar.options.noEvent;1484 var _1e 0=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null;1485 this.week.each(function(w,_1e 2){1485 var _1e0=this.calendar.options.noEvent; 1486 var _1e1=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null; 1487 this.week.each(function(w,_1e3){ 1486 1488 var text=null; 1487 if(_1e 0){1488 text=_1e 0.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]});1489 if(_1e1){ 1490 text=_1e1.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]}); 1489 1491 }else{ 1490 1492 text=w.toDateString().split(" "); … … 1492 1494 text=text.join(" "); 1493 1495 } 1494 var _1e 4=(w.days()==_1db)?this.calendar.classNames.highlightDay:"";1495 var _1e 5=_1de.appendSuffix(_1e2);1496 var _1e5=(w.days()==_1dc)?this.calendar.classNames.highlightDay:""; 1497 var _1e6=_1df.appendSuffix(_1e3); 1496 1498 var node="<div class='"+this.calendar.classNames.headerColumn+"'>"; 1497 if(_1 df){1498 node+="<span='#' id='"+_1e 5+"' class='"+_1e4+"' style='cursor: default;'>"+text+"</a>";1499 }else{ 1500 node+="<a href='#' id='"+_1e 5+"' class='"+_1e4+"'>"+text+"</a>";1499 if(_1e0){ 1500 node+="<span='#' id='"+_1e6+"' class='"+_1e5+"' style='cursor: default;'>"+text+"</a>"; 1501 }else{ 1502 node+="<a href='#' id='"+_1e6+"' class='"+_1e5+"'>"+text+"</a>"; 1501 1503 } 1502 1504 node+="</div>"; 1503 this.headers.push({id:_1e 5,wday:w});1504 ths+="<th id='"+_1d d.appendSuffix(_1e2)+"' width='"+_1dc+"'>"+node+"</th>";1505 this.headers.push({id:_1e6,wday:w}); 1506 ths+="<th id='"+_1de.appendSuffix(_1e3)+"' width='"+_1dd+"'>"+node+"</th>"; 1505 1507 }.bind(this)); 1506 1508 return "<tr>"+"<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+"<tr>"+ths+"</tr>"+"</table>"+"</td>"+"</tr>"; 1507 1509 },buildCalendarMain:function(){ 1508 var _1e 7=this.calendar.options.displayIndexes;1510 var _1e8=this.calendar.options.displayIndexes; 1509 1511 var tds=""; 1510 var _1e 9=100/_1e7.length+"%";1512 var _1ea=100/_1e8.length+"%"; 1511 1513 this.dateMap={}; 1512 this.week.each(function(w,_1e b){1513 var _1e c=this.calendar.options.schedules[w.toDateString()];1514 var _1e d="";1514 this.week.each(function(w,_1ec){ 1515 var _1ed=this.calendar.options.schedules[w.toDateString()]; 1516 var _1ee=""; 1515 1517 var i=0,j=0; 1516 1518 while(i<24){ 1517 1519 if(this.includeDisplayTime(i)){ 1518 var _1f 0="";1519 if(_1e d.length==0){1520 _1f 0=this.calendar.classNames.columnTopDate;1520 var _1f1=""; 1521 if(_1ee.length==0){ 1522 _1f1=this.calendar.classNames.columnTopDate; 1521 1523 }else{ 1522 1524 if(i%1==0){ 1523 _1f 0=this.calendar.classNames.columnDate;1524 }else{ 1525 _1f 0=this.calendar.classNames.columnDateOdd;1526 } 1527 } 1528 var id=this.getDateId(w,i,_1e b);1525 _1f1=this.calendar.classNames.columnDate; 1526 }else{ 1527 _1f1=this.calendar.classNames.columnDateOdd; 1528 } 1529 } 1530 var id=this.getDateId(w,i,_1ec); 1529 1531 var hour=i/1; 1530 1532 var min=i%1*60; 1531 1533 this.dateMap[id]=new Date(w.getFullYear(),w.getMonth(),w.getDate(),hour,min,0); 1532 _1e d+="<div id='"+id+"' class='"+_1f0+"'></div>";1534 _1ee+="<div id='"+id+"' class='"+_1f1+"'></div>"; 1533 1535 } 1534 1536 i+=0.5; 1535 1537 } 1536 tds+="<td width='"+_1e 9+"'>"+_1ed+"</td>";1538 tds+="<td width='"+_1ea+"'>"+_1ee+"</td>"; 1537 1539 }.bind(this)); 1538 1540 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>"; … … 1542 1544 var rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.columnDate); 1543 1545 this.column.height=parseInt(rule.style["height"],10)+1; 1544 },buildSchedule:function(_1f 6){1545 var id="scheduleItem_"+_1f 6.id;1546 var _1f 8=(_1f6.edit==undefined||_1f6.edit);1546 },buildSchedule:function(_1f7){ 1547 var id="scheduleItem_"+_1f7.id; 1548 var _1f9=(_1f7.edit==undefined||_1f7.edit); 1547 1549 var item=Builder.node("DIV",{id:id}); 1548 1550 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 1549 var _1fa=this.calendar.options.noEvent; 1550 var _1fb={}; 1551 if(_1f6.background_color){ 1552 _1fb.backgroundColor=_1f6.background_color; 1553 } 1554 if(_1f6.frame_color){ 1555 _1fb.border="2px solid "+_1f6.frame_color; 1556 } 1557 if(_1fa){ 1558 _1fb.cursor="default"; 1559 } 1560 Element.setStyle(item,_1fb); 1561 if(_1f8){ 1562 var _1fc=Builder.node("DIV",{id:"scheduleDeleteImg_"+_1f6.id,className:this.calendar.css.joinClassNames("deleteImg")}); 1563 Element.hide(_1fc); 1564 item.appendChild(_1fc); 1565 if(!_1fa){ 1566 Event.observe(_1fc,"click",this.clickDeleteImage.bind(this,_1f6)); 1567 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_1fc)); 1568 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_1fc)); 1569 } 1570 } 1571 if(!_1fa&&this.calendar.options.dblclickSchedule){ 1572 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_1f6)); 1573 } 1574 var _1fd=null; 1575 if(_1f8){ 1576 _1fd=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 1577 if(_1fa){ 1551 var _1fb=this.calendar.options.noEvent; 1552 var _1fc={}; 1553 if(_1f7.background_color){ 1554 _1fc.backgroundColor=_1f7.background_color; 1555 } 1556 if(_1f7.frame_color){ 1557 _1fc.border="2px solid "+_1f7.frame_color; 1558 } 1559 if(_1fb){ 1560 _1fc.cursor="default"; 1561 } 1562 Element.setStyle(item,_1fc); 1563 if(_1f9){ 1564 var _1fd=Builder.node("DIV",{id:"scheduleDeleteImg_"+_1f7.id,className:this.calendar.css.joinClassNames("deleteImg")}); 1578 1565 Element.hide(_1fd); 1579 }1580 1566 item.appendChild(_1fd); 1567 if(!_1fb){ 1568 Event.observe(_1fd,"click",this.clickDeleteImage.bind(this,_1f7)); 1569 Event.observe(item,"mouseover",this.showDeleteImage.bind(this,_1fd)); 1570 Event.observe(item,"mouseout",this.hideDeleteImage.bind(this,_1fd)); 1571 } 1572 } 1573 if(!_1fb&&this.calendar.options.dblclickSchedule){ 1574 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_1f7)); 1575 } 1576 var _1fe=null; 1577 if(_1f9){ 1578 _1fe=Builder.node("DIV",{className:this.calendar.css.joinClassNames("scheduleHandler")}); 1579 if(_1fb){ 1580 Element.hide(_1fe); 1581 } 1582 item.appendChild(_1fe); 1581 1583 } 1582 1584 var icon=null; 1583 if(_1f 6.icon){1584 icon=Builder.node("IMG",{src:_1f 6.icon,alt:"icon",style:"float: left;",width:16,height:16});1585 if(_1f7.icon){ 1586 icon=Builder.node("IMG",{src:_1f7.icon,alt:"icon",style:"float: left;",width:16,height:16}); 1585 1587 item.appendChild(icon); 1586 1588 } 1587 if(!_1f 6.publicity){1589 if(!_1f7.publicity){ 1588 1590 if(Calendar.privateImgPath){ 1589 1591 icon=Builder.node("IMG",{src:Calendar.privateImgPath,alt:"private",style:"float: left;",width:16,height:16}); 1590 1592 item.appendChild(icon); 1591 1593 }else{ 1592 icon=Builder.node("DIV",{id:"private_img_"+_1f 6.id});1594 icon=Builder.node("DIV",{id:"private_img_"+_1f7.id}); 1593 1595 this.calendar.css.addClassNames(icon,"privateImg"); 1594 1596 item.appendChild(icon); 1595 1597 } 1596 1598 } 1597 var text=this.getTimeText(_1f 6.start,_1f6.finish);1599 var text=this.getTimeText(_1f7.start,_1f7.finish); 1598 1600 text=Builder.node("DIV",{id:id+"_text"},[text]); 1599 1601 this.calendar.css.addClassNames(text,"scheduleTimeArea"); 1600 1602 item.appendChild(text); 1601 var _20 0=_1f6.description.unescapeHTML();1602 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_20 0]));1603 item.title=_20 0;1604 item.schedule=_1f 6;1605 return [item,_1f d];1606 },adjustScheduleStyle:function(item,_20 2,_203){1607 var _20 4=item.schedule;1608 var time=this.convertHours(_20 4);1609 var _20 6=time[0];1610 var _20 7=time[1];1603 var _201=_1f7.description.unescapeHTML(); 1604 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_201])); 1605 item.title=_201; 1606 item.schedule=_1f7; 1607 return [item,_1fe]; 1608 },adjustScheduleStyle:function(item,_203,_204){ 1609 var _205=item.schedule; 1610 var time=this.convertHours(_205); 1611 var _207=time[0]; 1612 var _208=time[1]; 1611 1613 var same=[]; 1612 1614 var self=this; 1613 _20 3.each(function(h){1614 var _20 b=self.convertHours(h.schedule);1615 var _20 c=_20b[0];1616 var _20 d=_20b[1];1617 if(((_20 c<=_206)&&(_20d>_206))||((_20c<_207)&&(_20d>=_207))||((_206<=_20c)&&(_207>_20c))||((_206<_20d)&&(_207>=_20d))){1615 _204.each(function(h){ 1616 var _20c=self.convertHours(h.schedule); 1617 var _20d=_20c[0]; 1618 var _20e=_20c[1]; 1619 if(((_20d<=_207)&&(_20e>_207))||((_20d<_208)&&(_20e>=_208))||((_207<=_20d)&&(_208>_20d))||((_207<_20e)&&(_208>=_20e))){ 1618 1620 same.push(h); 1619 1621 } 1620 1622 }); 1621 var _20 e=_202*this.getAdjustSize();1623 var _20f=_203*this.getAdjustSize(); 1622 1624 if(UserAgent.isIE()||this.calendar.options.noEvent){ 1623 _20 e+=1;1624 } 1625 var left=this.column.width*_20 2+_20e;1625 _20f+=1; 1626 } 1627 var left=this.column.width*_203+_20f; 1626 1628 if(same.length==0){ 1627 1629 Element.setStyle(item,{left:left+"px"}); 1628 1630 }else{ 1629 1631 same.push(item); 1630 var _21 0=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1;1632 var _211=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 1631 1633 same.each(function(s,i){ 1632 var _21 3=left+_210*i+(2*i);1633 Element.setStyle(s,{width:_21 0+"px",left:_213+"px"});1634 var _214=left+_211*i+(2*i); 1635 Element.setStyle(s,{width:_211+"px",left:_214+"px"}); 1634 1636 }); 1635 1637 } 1636 1638 return left; 1637 1639 },setScheduleBaseStyle:function(item){ 1638 var _21 5=item.schedule;1639 if(!this.calendar.isSameDate(_21 5.start,_215.finish)){1640 _21 5.finish.hour=24;1641 _21 5.finish.min=0;1642 } 1643 var time=this.convertHours(_21 5);1644 var _21 7=time.first();1645 var _21 8=time.last();1646 var _21 9=this.column.height*2;1647 var diff=this.calendar.getTimeDiff(_21 5.start,_215.finish);1640 var _216=item.schedule; 1641 if(!this.calendar.isSameDate(_216.start,_216.finish)){ 1642 _216.finish.hour=24; 1643 _216.finish.min=0; 1644 } 1645 var time=this.convertHours(_216); 1646 var _218=time.first(); 1647 var _219=time.last(); 1648 var _21a=this.column.height*2; 1649 var diff=this.calendar.getTimeDiff(_216.start,_216.finish); 1648 1650 var rate=(diff.hour+(diff.min/60))||1; 1649 1651 var over=0; 1650 1652 var top=0; 1651 var _21e=0; 1652 var _21f=this.includeDisplayTime(_217); 1653 var _21f=0; 1653 1654 var _220=this.includeDisplayTime(_218); 1654 if(!_21f&&!_220){ 1655 if((this.startTime<=_217&&this.startTime<=_218)||(_217<this.finishTime&&_218<this.finishTime)){ 1656 top=_21e=0; 1655 var _221=this.includeDisplayTime(_219); 1656 if(!_220&&!_221){ 1657 if((this.startTime<=_218&&this.startTime<=_219)||(_218<this.finishTime&&_219<this.finishTime)){ 1658 top=_21f=0; 1657 1659 Element.hide(item); 1658 1660 }else{ 1659 1661 top=0; 1660 _21 e=_219*(this.finishTime-this.startTime)-3;1661 } 1662 }else{ 1663 if(_2 1f){1664 top=_21 9*(_217-this.startTime);1665 _21 e=_219*rate-3;1662 _21f=_21a*(this.finishTime-this.startTime)-3; 1663 } 1664 }else{ 1665 if(_220){ 1666 top=_21a*(_218-this.startTime); 1667 _21f=_21a*rate-3; 1666 1668 }else{ 1667 1669 top=0; 1668 over=this.startTime-_21 7;1669 _21 e=_219*(rate-over);1670 } 1671 if(_22 0){1672 }else{ 1673 over=_21 8-this.finishTime;1674 _21 e-=_219*over;1670 over=this.startTime-_218; 1671 _21f=_21a*(rate-over); 1672 } 1673 if(_221){ 1674 }else{ 1675 over=_219-this.finishTime; 1676 _21f-=_21a*over; 1675 1677 } 1676 1678 } 1677 1679 try{ 1678 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_21 e+"px"});1680 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_21f+"px"}); 1679 1681 } 1680 1682 catch(e){ … … 1686 1688 this.setCover(); 1687 1689 var self=this; 1688 var _22 2=$(this.getScheduleContainerId());1689 var _22 3=this.getDragDistance();1690 var _223=$(this.getScheduleContainerId()); 1691 var _224=this.getDragDistance(); 1690 1692 this.scheduleNodes=[]; 1691 var _22 4=this.week.map(function(){1693 var _225=this.week.map(function(){ 1692 1694 return []; 1693 1695 }); 1694 var _225=this.week.legth-1; 1695 var _226=this.calendar.options.noEvent; 1696 this.calendar.options.schedules.each(function(_227){ 1697 var _228=[]; 1698 var sub,_22a=null; 1699 self.week.each(function(date,_22c){ 1700 if(self.calendar.betweenDate(_227,date)){ 1701 if(self.isSameStartDate(_227,date)&&self.isSameFinishDate(_227,date)){ 1702 _228.push(self.setSchedule(_227,_22c,_224,_222,_223)); 1703 }else{ 1704 sub=self.copyOneDaySchedule(_227,date); 1696 var _226=this.week.legth-1; 1697 var _227=this.calendar.options.noEvent; 1698 this.calendar.options.schedules.each(function(_228){ 1699 var _229=[]; 1700 var sub,_22b,_22c=null; 1701 self.week.each(function(date,_22e){ 1702 if(self.calendar.betweenDate(_228,date)){ 1703 if(self.isSameStartDate(_228,date)&&self.isSameFinishDate(_228,date)){ 1704 _22c=self.setSchedule(_228,_22e,_225,_223,_224); 1705 _22c.cellDate=date; 1706 _229.push(_22c); 1707 }else{ 1708 sub=self.copyOneDaySchedule(_228,date); 1705 1709 if(sub.finish.hour==0&&sub.finish.min==0){ 1706 1710 throw $continue; 1707 1711 } 1708 _22a=self.setSchedule(sub,_22c,_224,_222,_223); 1709 _22a.originalSchedule=_227; 1710 _228.push(_22a); 1712 _22b=self.setSchedule(sub,_22e,_225,_223,_224); 1713 _22b.originalSchedule=_228; 1714 _22b.cellDate=date; 1715 _229.push(_22b); 1711 1716 } 1712 1717 }else{ … … 1716 1721 } 1717 1722 }); 1718 if(!_22 6){1719 _22 8.each(function(item){1720 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_22 8));1721 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_22 8));1723 if(!_227){ 1724 _229.each(function(item){ 1725 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_229)); 1726 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_229)); 1722 1727 }); 1723 1728 } … … 1730 1735 new Hover(this.ids.pre); 1731 1736 new Hover(this.ids.next); 1732 var _2 2e=this.calendar.options.clickDateText||this.clickDateText;1737 var _230=this.calendar.options.clickDateText||this.clickDateText; 1733 1738 if(this.headers){ 1734 this.headers.each(function(_2 2f){1735 Event.observe(_2 2f.id,"mousedown",_22e.bindAsEventListener(this,_22f.wday));1739 this.headers.each(function(_231){ 1740 Event.observe(_231.id,"mousedown",_230.bindAsEventListener(this,_231.wday)); 1736 1741 }.bind(this)); 1737 1742 } 1738 1743 } 1739 },copyOneDaySchedule:function(_23 0,date){1744 },copyOneDaySchedule:function(_232,date){ 1740 1745 var sub=null; 1741 if(this.isSameStartDate(_23 0,date)){1742 sub=this.copySchedule(_23 0,date);1746 if(this.isSameStartDate(_232,date)){ 1747 sub=this.copySchedule(_232,date); 1743 1748 sub.finish.hour=24; 1744 1749 sub.finish.min=0; 1745 1750 }else{ 1746 if(this.isSameFinishDate(_23 0,date)){1747 sub=this.copySchedule(_23 0,date);1751 if(this.isSameFinishDate(_232,date)){ 1752 sub=this.copySchedule(_232,date); 1748 1753 sub.start.hour=0; 1749 1754 sub.start.min=0; 1750 1755 }else{ 1751 sub=this.copySchedule(_23 0,date);1756 sub=this.copySchedule(_232,date); 1752 1757 sub.start.hour=0; 1753 1758 sub.start.min=0; … … 1757 1762 } 1758 1763 return sub; 1759 },copySchedule:function(_23 3,date){1760 sub=Object.extend({},_23 3);1761 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_23 3.start.hour,min:_233.start.min};1762 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_23 3.finish.hour,min:_233.finish.min};1764 },copySchedule:function(_235,date){ 1765 sub=Object.extend({},_235); 1766 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_235.start.hour,min:_235.start.min}; 1767 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_235.finish.hour,min:_235.finish.min}; 1763 1768 return sub; 1764 },setSchedule:function(_23 5,_236,_237,_238,_239){1765 var _23 a=this.buildSchedule(_235);1766 var item=_23 a.first();1767 _23 8.appendChild(item);1769 },setSchedule:function(_237,_238,_239,_23a,_23b){ 1770 var _23c=this.buildSchedule(_237); 1771 var item=_23c.first(); 1772 _23a.appendChild(item); 1768 1773 this.setScheduleBaseStyle(item); 1769 var left=this.adjustScheduleStyle(item,_23 6,_237[_236]);1770 var _23 d=_236*this.getAdjustSize();1771 var _2 3e=this.column.width+_23d+"px";1772 if(!this.calendar.options.noEvent&&((_23 5.edit==undefined)||_235.edit)){1773 this.setDraggable(item,_23 a.last(),_238,_239);1774 var left=this.adjustScheduleStyle(item,_238,_239[_238]); 1775 var _23f=_238*this.getAdjustSize(); 1776 var _240=this.column.width+_23f+"px"; 1777 if(!this.calendar.options.noEvent&&((_237.edit==undefined)||_237.edit)){ 1778 this.setDraggable(item,_23c.last(),_23a,_23b); 1774 1779 this.setResize(item); 1775 1780 } 1776 _23 7[_236].push(item);1781 _239[_238].push(item); 1777 1782 this.scheduleNodes.push(item); 1778 1783 return item; 1779 1784 },getDragDistance:function(){ 1780 var _2 3f=this.getAdjustSize();1781 return [this.column.width+_2 3f,this.column.height/2];1782 },setDraggable:function(item,_24 1,_242,_243){1785 var _241=this.getAdjustSize(); 1786 return [this.column.width+_241,this.column.height/2]; 1787 },setDraggable:function(item,_243,_244,_245){ 1783 1788 var self=this; 1784 new Draggable(item,{handle:_24 1,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y){1785 var _24 7=Element.getDimensions(item);1786 var _24 8=Element.getDimensions(_242);1787 var _24 9=(self.column.height/2);1789 new Draggable(item,{handle:_243,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y){ 1790 var _249=Element.getDimensions(item); 1791 var _24a=Element.getDimensions(_244); 1792 var _24b=(self.column.height/2); 1788 1793 var xy=[x,y].map(function(v,i){ 1789 return Math.floor(v/_24 3[i])*_243[i];1790 }); 1791 xy=[self._constrain(xy[0],0,_24 8.width-_247.width),self._constrain(xy[1],0-(_247.height-_249),_248.height-_249)];1794 return Math.floor(v/_245[i])*_245[i]; 1795 }); 1796 xy=[self._constrain(xy[0],0,_24a.width-_249.width),self._constrain(xy[1],0-(_249.height-_24b),_24a.height-_24b)]; 1792 1797 return xy; 1793 },onEnd:function(_24 d,_24e){1794 self.changeSchedule(_24 d,_24e);1795 },change:function(_2 4f){1796 self.changeTimeDisplay(_2 4f.element);1798 },onEnd:function(_24f,_250){ 1799 self.changeSchedule(_24f,_250); 1800 },change:function(_251){ 1801 self.changeTimeDisplay(_251.element); 1797 1802 }}); 1798 1803 },setResize:function(item){ 1799 new CalendarResizeableEx(item,{left:0,right:0,distance:this.column.height/2,restriction:true,resize:function(_25 1){1800 this.updateTirm(_25 1);1801 }.bind(this),change:function(_25 2){1802 this.changeTimeDisplay(_25 2);1804 new CalendarResizeableEx(item,{left:0,right:0,distance:this.column.height/2,restriction:true,resize:function(_253){ 1805 this.updateTirm(_253); 1806 }.bind(this),change:function(_254){ 1807 this.changeTimeDisplay(_254); 1803 1808 }.bind(this)}); 1804 },getDate:function(_25 3){1805 return _25 3.date;1806 },abstractSelect:function(_25 4,_255){1807 var _25 6=this.findClickedElement(_254);1808 if(_25 6){1809 if(Element.hasClassName(_25 6,Calendar.className.columnDate)||Element.hasClassName(_256,Calendar.className.columnDateOdd)||Element.hasClassName(_256,Calendar.className.columnTopDate)){1810 var date=this.getDate(_25 6);1811 _25 5(date,_256);1809 },getDate:function(_255){ 1810 return _255.date; 1811 },abstractSelect:function(_256,_257){ 1812 var _258=this.findClickedElement(_256); 1813 if(_258){ 1814 if(Element.hasClassName(_258,Calendar.className.columnDate)||Element.hasClassName(_258,Calendar.className.columnDateOdd)||Element.hasClassName(_258,Calendar.className.columnTopDate)){ 1815 var date=this.getDate(_258); 1816 _257(date,_258); 1812 1817 } 1813 1818 } 1814 1819 },getSelectedTerm:function(){ 1815 var _25 8=this.calendar.getSelected();1816 if(_25 8.length==0){1820 var _25a=this.calendar.getSelected(); 1821 if(_25a.length==0){ 1817 1822 return; 1818 1823 } 1819 1824 if(this.calendar.options.build){ 1820 var last=_25 8.last();1825 var last=_25a.last(); 1821 1826 if(last){ 1822 1827 last=this.dateMap[last.id]; 1823 1828 }else{ 1824 last=this.dateMap[_25 8.first().id];1829 last=this.dateMap[_25a.first().id]; 1825 1830 } 1826 1831 last=new Date(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),0); 1827 1832 last.setMinutes(last.getMinutes()+30); 1828 return [this.dateMap[_25 8.first().id],last];1829 }else{ 1830 var last=this._getDateTimeFromElement(_25 8.last());1833 return [this.dateMap[_25a.first().id],last]; 1834 }else{ 1835 var last=this._getDateTimeFromElement(_25a.last()); 1831 1836 last.setMinutes(last.getMinutes()+30); 1832 return [this._getDateTimeFromElement(_25 8.first()),last];1837 return [this._getDateTimeFromElement(_25a.first()),last]; 1833 1838 } 1834 1839 },setWidth:function(node){ 1835 1840 Element.setStyle(node,{width:this.column.width+"px"}); 1836 },inspectArgument:function(_25 b,time){1837 if(_25 b.date){1838 return _25 b;1841 },inspectArgument:function(_25d,time){ 1842 if(_25d.date){ 1843 return _25d; 1839 1844 } 1840 1845 var self=this; 1841 var _2 5e=this.calendar.getSelected();1842 var _2 5f=[];1843 this.calendar.recurrence(_25 b,function(o){1844 var _26 1={};1846 var _260=this.calendar.getSelected(); 1847 var _261=[]; 1848 this.calendar.recurrence(_25d,function(o){ 1849 var _263={}; 1845 1850 if(!o.date){ 1846 _26 1={date:self.getDate(_25e[0])};1851 _263={date:self.getDate(_260[0])}; 1847 1852 if(!o.start){ 1848 _26 1.start=_25e[0].time;1853 _263.start=_260[0].time; 1849 1854 } 1850 1855 if(!o.finish){ 1851 _26 1.finish=_25e[_25e.length-1].time;1852 } 1853 } 1854 Object.extend(_26 1,o);1855 _2 5f.push(_261);1856 }); 1857 return _2 5f;1856 _263.finish=_260[_260.length-1].time; 1857 } 1858 } 1859 Object.extend(_263,o); 1860 _261.push(_263); 1861 }); 1862 return _261; 1858 1863 },inspectDateArgument:function(date){ 1859 1864 if(date){ 1860 1865 return date; 1861 1866 } 1862 var _26 3=this;1863 var _26 4=this.getSelected();1864 if(_26 4.length==0){1867 var _265=this; 1868 var _266=this.getSelected(); 1869 if(_266.length==0){ 1865 1870 return null; 1866 1871 } 1867 return _26 4.collect(function(d){1868 return _26 3.getDate(d);1869 }); 1870 },addColumnClass:function(_26 6){1872 return _266.collect(function(d){ 1873 return _265.getDate(d); 1874 }); 1875 },addColumnClass:function(_268){ 1871 1876 if(document.all){ 1872 this.calendar.css.addClassNames(_26 6,"columnWin");1873 }else{ 1874 this.calendar.css.addClassNames(_26 6,"column");1877 this.calendar.css.addClassNames(_268,"columnWin"); 1878 }else{ 1879 this.calendar.css.addClassNames(_268,"column"); 1875 1880 } 1876 1881 },getHeaderId:function(){ … … 1878 1883 },getColumnId:function(i){ 1879 1884 return this.calendar.element.id.appendSuffix(CalendarWeek.id.column+"_"+i); 1880 },changeSchedule:function(_26 8,_269){1881 var _26 a=_268.element;1882 var _26 b=_26a.schedule;1883 var time=this.getTimeByElement(_26 a);1884 this.calendar.cacheSchedule(_26 b);1885 var _26 d=$(this.getScheduleContainerId());1886 var _2 6e=Element.getDimensions(_26d);1887 var _2 6f=Position.cumulativeOffset(_26d);1888 var x=Event.pointerX(_26 9);1889 var y=Event.pointerY(_26 9);1890 var left=parseInt(Element.getStyle(_26 a,"left"));1891 var _27 3=Math.round(left/this.column.width);1892 var date=this.week[_27 3];1893 if(_26 b.start.year==date.getFullYear()&&_26b.start.month==date.getMonth()&&_26b.start.day==date.getDate()&&_26b.start.hour==time[0].hour&&_26b.start.min==time[0].min&&_26b.finish.year==date.getFullYear()&&_26b.finish.month==date.getMonth()&&_26b.finish.day==date.getDate()&&_26b.finish.hour==time[1].hour&&_26b.finish.min==time[1].min){1885 },changeSchedule:function(_26a,_26b){ 1886 var _26c=_26a.element; 1887 var _26d=_26c.schedule; 1888 var time=this.getTimeByElement(_26c); 1889 this.calendar.cacheSchedule(_26d); 1890 var _26f=$(this.getScheduleContainerId()); 1891 var _270=Element.getDimensions(_26f); 1892 var _271=Position.cumulativeOffset(_26f); 1893 var x=Event.pointerX(_26b); 1894 var y=Event.pointerY(_26b); 1895 var left=parseInt(Element.getStyle(_26c,"left")); 1896 var _275=Math.round(left/this.column.width); 1897 var date=this.week[_275]; 1898 if(_26d.start.year==date.getFullYear()&&_26d.start.month==date.getMonth()&&_26d.start.day==date.getDate()&&_26d.start.hour==time[0].hour&&_26d.start.min==time[0].min&&_26d.finish.year==date.getFullYear()&&_26d.finish.month==date.getMonth()&&_26d.finish.day==date.getDate()&&_26d.finish.hour==time[1].hour&&_26d.finish.min==time[1].min){ 1894 1899 this.calendar.refreshSchedule(); 1895 1900 return; 1896 1901 } 1897 if(_26a.originalSchedule){ 1898 _26b=_26a.originalSchedule; 1899 } 1900 var _275={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 1901 var diff=DateUtil.toDate(_275).getTime()-DateUtil.toDate(_26b.start).getTime(); 1902 _26b.start=_275; 1903 _26b.finish=new Date(DateUtil.toDate(_26b.finish).getTime()+diff).toHash(); 1902 if(_26c.originalSchedule){ 1903 _26d=_26c.originalSchedule; 1904 } 1905 var _277={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 1906 var _278=DateUtil.toDate(_277); 1907 var _279=_26c.cellDate.days()-DateUtil.toDate(_26d.start).days(); 1908 _278.setDate(_278.getDate()-_279); 1909 var diff=_278.getTime()-DateUtil.toDate(_26d.start).getTime(); 1910 _26d.start=_278.toHash(); 1911 _26d.finish=new Date(DateUtil.toDate(_26d.finish).getTime()+diff).toHash(); 1904 1912 this.calendar.refreshSchedule(); 1905 this.calendar.options.changeSchedule(_26 b);1906 },updateTirm:function(_27 7){1907 var _27 8=_277.schedule;1908 var time=this.getTimeByElement(_27 7);1909 this.calendar.cacheSchedule(_27 8);1910 var left=parseInt(Element.getStyle(_27 7,"left"));1911 var _27 b=Math.floor(left/this.column.width);1912 var date=this.week[_27 b];1913 var _2 7d=this.isChengeSchedule(_277,time);1914 if(_27 7.originalSchedule){1915 _27 8=_277.originalSchedule;1916 } 1917 if(_2 7d.start){1918 _27 8.start.year=date.getFullYear();1919 _27 8.start.month=date.getMonth();1920 _27 8.start.day=date.getDate();1921 _27 8.start.hour=time[0].hour;1922 _27 8.start.min=time[0].min;1923 } 1924 if(_2 7d.finish){1925 _27 8.finish.year=date.getFullYear();1926 _27 8.finish.month=date.getMonth();1927 _27 8.finish.day=date.getDate();1928 _27 8.finish.hour=time[1].hour;1929 _27 8.finish.min=time[1].min;1913 this.calendar.options.changeSchedule(_26d); 1914 },updateTirm:function(_27b){ 1915 var _27c=_27b.schedule; 1916 var time=this.getTimeByElement(_27b); 1917 this.calendar.cacheSchedule(_27c); 1918 var left=parseInt(Element.getStyle(_27b,"left")); 1919 var _27f=Math.floor(left/this.column.width); 1920 var date=this.week[_27f]; 1921 var _281=this.isChengeSchedule(_27b,time); 1922 if(_27b.originalSchedule){ 1923 _27c=_27b.originalSchedule; 1924 } 1925 if(_281.start){ 1926 _27c.start.year=date.getFullYear(); 1927 _27c.start.month=date.getMonth(); 1928 _27c.start.day=date.getDate(); 1929 _27c.start.hour=time[0].hour; 1930 _27c.start.min=time[0].min; 1931 } 1932 if(_281.finish){ 1933 _27c.finish.year=date.getFullYear(); 1934 _27c.finish.month=date.getMonth(); 1935 _27c.finish.day=date.getDate(); 1936 _27c.finish.hour=time[1].hour; 1937 _27c.finish.min=time[1].min; 1930 1938 } 1931 1939 this.calendar.refreshSchedule(); 1932 this.calendar.options.updateTirm(_27 8);1933 },changeTimeDisplay:function(_2 7e){1934 var _2 7f=_27e.schedule;1935 var time=this.getTimeByElement(_2 7e);1936 var _28 1=Element.getElementsByClassName(_27e,Calendar.className.scheduleTimeArea)[0];1940 this.calendar.options.updateTirm(_27c); 1941 },changeTimeDisplay:function(_282){ 1942 var _283=_282.schedule; 1943 var time=this.getTimeByElement(_282); 1944 var _285=Element.getElementsByClassName(_282,Calendar.className.scheduleTimeArea)[0]; 1937 1945 var text=this.getTimeText(time[0],time[1]); 1938 _28 1.innerHTML=text;1939 },findClickedElement:function(_28 3){1940 var _28 4=$(this.getScheduleContainerId());1941 var _28 5=Position.cumulativeOffset(_284);1942 var _28 6=Position.realOffset(_284).last();1943 _28 6-=document.documentElement.scrollTop||document.body.scrollTop;1944 var x=Event.pointerX(_28 3)-_285[0];1945 var y=Event.pointerY(_28 3)-_285[1]+_286;1946 var _28 9=Math.floor(y/this.column.height);1947 var _28 a=Math.floor(x/this.column.width);1946 _285.innerHTML=text; 1947 },findClickedElement:function(_287){ 1948 var _288=$(this.getScheduleContainerId()); 1949 var _289=Position.cumulativeOffset(_288); 1950 var _28a=Position.realOffset(_288).last(); 1951 _28a-=document.documentElement.scrollTop||document.body.scrollTop; 1952 var x=Event.pointerX(_287)-_289[0]; 1953 var y=Event.pointerY(_287)-_289[1]+_28a; 1954 var _28d=Math.floor(y/this.column.height); 1955 var _28e=Math.floor(x/this.column.width); 1948 1956 var row=this.calendarTable.rows[0]; 1949 if(_28 a>=row.cells.length){1950 _28 a--;1951 } 1952 return $(row.cells[_28 a]).down(_289);1953 },multipleSelection:function(_2 8c){1957 if(_28e>=row.cells.length){ 1958 _28e--; 1959 } 1960 return $(row.cells[_28e]).down(_28d); 1961 },multipleSelection:function(_290){ 1954 1962 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 1955 1963 return; 1956 1964 } 1957 1965 var self=this; 1958 var _2 8e=this.calendar;1959 var _2 8f=this.calendar.selectedBase;1960 var _29 0=this._getDateFromElement(_28f).getDate();1961 this.abstractSelect(_2 8c,function(date,_292){1962 var _29 3=$(_28f.id);1963 if(_29 0!=self._getDateFromElement(_292).getDate()){1966 var _292=this.calendar; 1967 var _293=this.calendar.selectedBase; 1968 var _294=this._getDateFromElement(_293).getDate(); 1969 this.abstractSelect(_290,function(date,_296){ 1970 var _297=$(_293.id); 1971 if(_294!=self._getDateFromElement(_296).getDate()){ 1964 1972 return; 1965 1973 } 1966 var _29 4=$A(_293.parentNode.childNodes);1967 var ids=[this._getTime(_2 8f),this._getTime(_292)];1974 var _298=$A(_297.parentNode.childNodes); 1975 var ids=[this._getTime(_293),this._getTime(_296)]; 1968 1976 ids.sort(function(a,b){ 1969 1977 return a-b; 1970 1978 }); 1971 _29 4.each(function(n){1979 _298.each(function(n){ 1972 1980 if(!n.id){ 1973 1981 throw $continue; … … 1975 1983 var id=this._getTime(n); 1976 1984 if((id<ids[0])||(ids[1]<id)){ 1977 _2 8e.removeSelectedClass(n);1985 _292.removeSelectedClass(n); 1978 1986 }else{ 1979 1987 if(!Element.hasClassName(n,Calendar.className.selected)){ 1980 _2 8e.addSelectedClass(n);1988 _292.addSelectedClass(n); 1981 1989 } 1982 1990 } 1983 1991 }.bind(this)); 1984 1992 }.bind(this)); 1985 },getTimeByElement:function(_29 a){1986 var _29 b=_29a.schedule;1987 var top=parseInt(Element.getStyle(_29 a,"top"),10);1988 var _2 9d=parseInt(Element.getStyle(_29a,"height"),10);1989 var _2 9e=this.column.height*2;1990 var _2 9f=15/60;1991 var _2a 0=top/_29e+this.startTime;1992 _2a 0=Math.round(_2a0/_29f)*_29f;1993 var _2a 1={};1994 _2a 1.hour=Math.floor(_2a0);1995 _2a 1.min=(_2a0-_2a1.hour)*60;1996 var _2a 2=Math.round(_29d/_29e/_29f)*_29f+_2a0;1997 var _2a 3={};1998 _2a 3.hour=Math.floor(_2a2);1999 _2a 3.min=Math.round((_2a2-_2a3.hour)*60);2000 if(_2a 3.min==60){2001 _2a 3.hour+=1;2002 _2a 3.min=0;2003 } 2004 return [_2a 1,_2a3];1993 },getTimeByElement:function(_29e){ 1994 var _29f=_29e.schedule; 1995 var top=parseInt(Element.getStyle(_29e,"top"),10); 1996 var _2a1=parseInt(Element.getStyle(_29e,"height"),10); 1997 var _2a2=this.column.height*2; 1998 var _2a3=15/60; 1999 var _2a4=top/_2a2+this.startTime; 2000 _2a4=Math.round(_2a4/_2a3)*_2a3; 2001 var _2a5={}; 2002 _2a5.hour=Math.floor(_2a4); 2003 _2a5.min=(_2a4-_2a5.hour)*60; 2004 var _2a6=Math.round(_2a1/_2a2/_2a3)*_2a3+_2a4; 2005 var _2a7={}; 2006 _2a7.hour=Math.floor(_2a6); 2007 _2a7.min=Math.round((_2a6-_2a7.hour)*60); 2008 if(_2a7.min==60){ 2009 _2a7.hour+=1; 2010 _2a7.min=0; 2011 } 2012 return [_2a5,_2a7]; 2005 2013 },getTimeByTop:function(top){ 2006 var _2a 5=this.column.height*2;2007 var _2a 6=15/60;2008 var _2a 7=top/_2a5+this.startTime;2009 _2a 7=Math.round(_2a7/_2a6)*_2a6;2010 var _2a 8={};2011 _2a 8.hour=Math.floor(_2a7);2012 _2a 8.min=(_2a7-_2a8.hour)*60;2013 return _2a 8;2014 },getDateId:function(date,time,_2a b){2015 var id=this.calendar.element.id.appendSuffix(_2a b+"_"+date.getDate());2014 var _2a9=this.column.height*2; 2015 var _2aa=15/60; 2016 var _2ab=top/_2a9+this.startTime; 2017 _2ab=Math.round(_2ab/_2aa)*_2aa; 2018 var _2ac={}; 2019 _2ac.hour=Math.floor(_2ab); 2020 _2ac.min=(_2ab-_2ac.hour)*60; 2021 return _2ac; 2022 },getDateId:function(date,time,_2af){ 2023 var id=this.calendar.element.id.appendSuffix(_2af+"_"+date.getDate()); 2016 2024 return id.appendSuffix(time*10); 2017 2025 },dateIdToTime:function(id){ … … 2025 2033 time.pop(); 2026 2034 return time.join(":"); 2027 },includeDisplayTime:function(_2b 1){2028 return (this.startTime<=_2b 1)&&(_2b1<this.finishTime);2029 },convertHours:function(_2b 2){2030 return [_2b 2.start.hour+_2b2.start.min/60,_2b2.finish.hour+_2b2.finish.min/60];2035 },includeDisplayTime:function(_2b5){ 2036 return (this.startTime<=_2b5)&&(_2b5<this.finishTime); 2037 },convertHours:function(_2b6){ 2038 return [_2b6.start.hour+_2b6.start.min/60,_2b6.finish.hour+_2b6.finish.min/60]; 2031 2039 },setDisplayTime:function(){ 2032 2040 this.startTime=this.calendar.options.displayTime.first().hour; 2033 var _2b 3=this.calendar.options.displayTime.last();2034 this.finishTime=Math.ceil(_2b 3.hour+_2b3.min/60);2035 },getTimeText:function(_2b 4,_2b5){2036 var _2b 6=this.calendar;2037 return _2b 6.formatTime(_2b4)+" - "+_2b6.formatTime(_2b5);2038 },isChengeSchedule:function(_2b 7,_2b8){2039 var _2b 9=_2b7.schedule;2040 var _2b a=((_2b9.start.hour!=_2b8[0].hour)||(_2b9.start.min!=_2b8[0].min));2041 var _2b b=((_2b9.finish.hour!=_2b8[1].hour)||(_2b9.finish.min!=_2b8[1].min));2042 if(_2b 7.originalSchedule){2043 if(_2b a&&_2bb){2044 var _2 bc=DateUtil.toDate(_2b9.start).getTime();2045 var _2 bd=DateUtil.toDate(_2b7.originalSchedule.start).getTime();2046 if(_2 bc==_2bd){2047 _2b b=false;2048 }else{ 2049 _2b a=false;2050 } 2051 } 2052 } 2053 return {start:_2b a,finish:_2bb};2054 },_getDateFromElement:function(_2 be){2055 var arr=_2 be.id.split("_");2056 var _2c 0=arr[arr.length-3];2057 return this.week[_2c 0];2058 },_getDateTimeFromElement:function(_2c 1){2059 var id=_2c 1.id.split("_");2060 var _2c 3=id[id.length-3];2061 if(this.week[_2c 3]){2062 var date=new Date(this.week[_2c 3].getTime());2041 var _2b7=this.calendar.options.displayTime.last(); 2042 this.finishTime=Math.ceil(_2b7.hour+_2b7.min/60); 2043 },getTimeText:function(_2b8,_2b9){ 2044 var _2ba=this.calendar; 2045 return _2ba.formatTime(_2b8)+" - "+_2ba.formatTime(_2b9); 2046 },isChengeSchedule:function(_2bb,_2bc){ 2047 var _2bd=_2bb.schedule; 2048 var _2be=((_2bd.start.hour!=_2bc[0].hour)||(_2bd.start.min!=_2bc[0].min)); 2049 var _2bf=((_2bd.finish.hour!=_2bc[1].hour)|
