Changeset 6010
- Timestamp:
- 06/24/09 12:11:48 (1 year ago)
- Files:
-
- rubricks_core/trunk/public/javascripts/components/system/src_system_user_management.js (modified) (2 diffs)
- rubricks_core/trunk/public/javascripts/components/system/system.js (modified) (5 diffs)
- rubricks_core/trunk/public/javascripts/spinelz/calendar.js (modified) (41 diffs)
- rubricks_core/trunk/public/javascripts/spinelz/datepicker.js (modified) (6 diffs)
- rubricks_core/trunk/public/javascripts/spinelz/spinelz_for_rubricks.js (modified) (47 diffs)
- rubricks_core/trunk/public/javascripts/spinelz_lib/spinelz_util.js (modified) (23 diffs)
- rubricks_core/trunk/public/javascripts/spinelz_lib/spinelz_util_for_rubricks.js (modified) (23 diffs)
- rubricks_core/trunk/public/javascripts/src_spinelz/calendar.js (modified) (19 diffs)
- rubricks_core/trunk/public/javascripts/src_spinelz/datepicker.js (modified) (6 diffs)
- rubricks_core/trunk/public/javascripts/src_spinelz_lib/spinelz_util.js (modified) (4 diffs)
- rubricks_core/trunk/public/stylesheets/spinelz/calendar.css (modified) (1 diff)
- rubricks_core/trunk/public/stylesheets/spinelz/spinelz_for_rubricks.css (modified) (1 diff)
- rubricks_core/trunk/themes/asteriksorange/images/icons/icon_user_refresh.gif (added)
- rubricks_core/trunk/themes/asteriksorange/stylesheets/icons.css (modified) (1 diff)
- rubricks_core/trunk/themes/rubrickswhite/images/icons/icon_user_refresh.gif (added)
- rubricks_core/trunk/themes/rubrickswhite/stylesheets/icons.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
rubricks_core/trunk/public/javascripts/components/system/src_system_user_management.js
r5987 r6010 211 211 var el = $('filter_conditions_user_word'); 212 212 if(el) { 213 el.blur(); 214 this.user_tab_activate(); 215 el.focus(); 213 try { 214 el.blur(); 215 this.user_tab_activate(); 216 el.focus(); 217 } catch(ex) {} 216 218 } 217 219 }, … … 478 480 ); 479 481 }, 482 user_initialize: function(initialize_id_str) { 483 new Ajax.Request( 484 rubricks.system.admin_user.variables.url_user_initialize, 485 { 486 asynchronous: true, 487 evalScripts: true, 488 parameters: {initialize_id:initialize_id_str}, 489 onLoaded: function(request) {rubricks.common.rubricks_wait_message_close();}, 490 onLoading: function(request) {rubricks.common.rubricks_wait_message_open();} 491 } 492 ); 493 }, 494 user_initialize_confirm: function(ru_id) { 495 rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_initialize_confirm, function() {rubricks.system.admin_user.functions.user_initialize(ru_id);}, function() {rubricks.system.admin_user.functions.user_tab_activate();}); 496 }, 480 497 user_invalidate: function(invalidate_id_str) { 481 498 new Ajax.Request( rubricks_core/trunk/public/javascripts/components/system/system.js
r5987 r6010 1319 1319 var el=$("filter_conditions_user_word"); 1320 1320 if(el){ 1321 try{ 1321 1322 el.blur(); 1322 1323 this.user_tab_activate(); 1323 1324 el.focus(); 1325 } 1326 catch(ex){ 1327 } 1324 1328 } 1325 1329 },refresh_group_tree:function(_1a){ … … 1491 1495 rubricks.common.rubricks_wait_message_open(); 1492 1496 }}); 1493 },user_in validate:function(_41){1494 new Ajax.Request(rubricks.system.admin_user.variables.url_user_in validate,{asynchronous:true,evalScripts:true,parameters:{invalidate_id:_41},onLoaded:function(_42){1497 },user_initialize:function(_41){ 1498 new Ajax.Request(rubricks.system.admin_user.variables.url_user_initialize,{asynchronous:true,evalScripts:true,parameters:{initialize_id:_41},onLoaded:function(_42){ 1495 1499 rubricks.common.rubricks_wait_message_close(); 1496 1500 },onLoading:function(_43){ 1497 1501 rubricks.common.rubricks_wait_message_open(); 1498 1502 }}); 1499 },user_in validate_confirm:function(_44){1500 rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_in validate_confirm,function(){1501 rubricks.system.admin_user.functions.user_in validate(_44);1503 },user_initialize_confirm:function(_44){ 1504 rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_initialize_confirm,function(){ 1505 rubricks.system.admin_user.functions.user_initialize(_44); 1502 1506 },function(){ 1503 1507 rubricks.system.admin_user.functions.user_tab_activate(); 1504 1508 }); 1509 },user_invalidate:function(_45){ 1510 new Ajax.Request(rubricks.system.admin_user.variables.url_user_invalidate,{asynchronous:true,evalScripts:true,parameters:{invalidate_id:_45},onLoaded:function(_46){ 1511 rubricks.common.rubricks_wait_message_close(); 1512 },onLoading:function(_47){ 1513 rubricks.common.rubricks_wait_message_open(); 1514 }}); 1515 },user_invalidate_confirm:function(_48){ 1516 rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_invalidate_confirm,function(){ 1517 rubricks.system.admin_user.functions.user_invalidate(_48); 1518 },function(){ 1519 rubricks.system.admin_user.functions.user_tab_activate(); 1520 }); 1505 1521 },user_invalidate_multiple:function(){ 1506 var _4 5=rubricks.system.admin_user.variables;1507 var _4 6=_45.rubricks_user_list;1508 var _4 7=(_46)?_46.getSelected().join(","):"";1509 if(_4 7.length==0){1510 rubricks.common.rubricks_message_window_open(_4 5.msg_user_not_selected,"error");1511 }else{ 1512 rubricks.common.rubricks_confirm_window_open(_4 5.msg_user_invalidate_confirm,function(){1522 var _49=rubricks.system.admin_user.variables; 1523 var _4a=_49.rubricks_user_list; 1524 var _4b=(_4a)?_4a.getSelected().join(","):""; 1525 if(_4b.length==0){ 1526 rubricks.common.rubricks_message_window_open(_49.msg_user_not_selected,"error"); 1527 }else{ 1528 rubricks.common.rubricks_confirm_window_open(_49.msg_user_invalidate_confirm,function(){ 1513 1529 rubricks.system.admin_user.functions.user_invalidate(rubricks.system.admin_user.variables.rubricks_user_list.getSelected().join(",")); 1514 1530 },function(){ 1515 _4 6.makeAvailable();1531 _4a.makeAvailable(); 1516 1532 }); 1517 1533 } … … 1543 1559 Element.hide("user_unlock_multiple_form"); 1544 1560 } 1545 },user_list_select_effect:function(_4 8){1546 var _4 9=rubricks.system.admin_user.variables.rubricks_user_list;1547 if(_4 9){1548 var _4 a=_49.getSelected();1549 if(_4 a[0]!=_48){1550 _4 9.selectEffect(_49.buildTrId(_48));1551 } 1552 } 1553 },user_lock:function(_4 b){1554 new Ajax.Request(rubricks.system.admin_user.variables.url_user_lock,{asynchronous:true,evalScripts:true,parameters:{lock_id:_4 b},onLoaded:function(_4c){1555 rubricks.common.rubricks_wait_message_close(); 1556 },onLoading:function(_ 4d){1557 rubricks.common.rubricks_wait_message_open(); 1558 }}); 1559 },user_lock_confirm:function(_ 4e){1561 },user_list_select_effect:function(_4c){ 1562 var _4d=rubricks.system.admin_user.variables.rubricks_user_list; 1563 if(_4d){ 1564 var _4e=_4d.getSelected(); 1565 if(_4e[0]!=_4c){ 1566 _4d.selectEffect(_4d.buildTrId(_4c)); 1567 } 1568 } 1569 },user_lock:function(_4f){ 1570 new Ajax.Request(rubricks.system.admin_user.variables.url_user_lock,{asynchronous:true,evalScripts:true,parameters:{lock_id:_4f},onLoaded:function(_50){ 1571 rubricks.common.rubricks_wait_message_close(); 1572 },onLoading:function(_51){ 1573 rubricks.common.rubricks_wait_message_open(); 1574 }}); 1575 },user_lock_confirm:function(_52){ 1560 1576 rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_lock_confirm,function(){ 1561 rubricks.system.admin_user.functions.user_lock(_ 4e);1577 rubricks.system.admin_user.functions.user_lock(_52); 1562 1578 },function(){ 1563 1579 rubricks.system.admin_user.functions.user_tab_activate(); 1564 1580 }); 1565 1581 },user_lock_multiple:function(){ 1566 var _ 4f=rubricks.system.admin_user.variables;1567 var _5 0=_4f.rubricks_user_list;1568 var _5 1=(_50)?_50.getSelected().join(","):"";1569 if(_5 1.length==0){1570 rubricks.common.rubricks_message_window_open(_ 4f.msg_user_not_selected,"error");1571 }else{ 1572 rubricks.common.rubricks_confirm_window_open(_ 4f.msg_user_lock_confirm,function(){1582 var _53=rubricks.system.admin_user.variables; 1583 var _54=_53.rubricks_user_list; 1584 var _55=(_54)?_54.getSelected().join(","):""; 1585 if(_55.length==0){ 1586 rubricks.common.rubricks_message_window_open(_53.msg_user_not_selected,"error"); 1587 }else{ 1588 rubricks.common.rubricks_confirm_window_open(_53.msg_user_lock_confirm,function(){ 1573 1589 rubricks.system.admin_user.functions.user_lock(rubricks.system.admin_user.variables.rubricks_user_list.getSelected().join(",")); 1574 1590 },function(){ 1575 _5 0.makeAvailable();1591 _54.makeAvailable(); 1576 1592 }); 1577 1593 } 1578 1594 },user_multiple_mode:function(){ 1579 var _5 2=rubricks.system.admin_user.variables.rubricks_user_list;1580 if(_5 2){1581 _5 2.makeMultiple();1595 var _56=rubricks.system.admin_user.variables.rubricks_user_list; 1596 if(_56){ 1597 _56.makeMultiple(); 1582 1598 } 1583 1599 this.user_list_buttons_multiple(); … … 1588 1604 this.user_tab_activate(); 1589 1605 },user_singular_mode:function(){ 1590 var _5 3=rubricks.system.admin_user.variables.rubricks_user_list;1591 if(_5 3){1592 _5 3.makeSingular();1606 var _57=rubricks.system.admin_user.variables.rubricks_user_list; 1607 if(_57){ 1608 _57.makeSingular(); 1593 1609 } 1594 1610 this.user_list_buttons_singular(); … … 1600 1616 this.show_buttons([0]); 1601 1617 this.print_list_show(); 1602 },user_unlock:function(_5 4){1603 new Ajax.Request(rubricks.system.admin_user.variables.url_user_unlock,{asynchronous:true,evalScripts:true,parameters:{unlock_id:_5 4},onLoaded:function(_55){1604 rubricks.common.rubricks_wait_message_close(); 1605 },onLoading:function(_5 6){1606 rubricks.common.rubricks_wait_message_open(); 1607 }}); 1608 },user_unlock_confirm:function(_5 7){1618 },user_unlock:function(_58){ 1619 new Ajax.Request(rubricks.system.admin_user.variables.url_user_unlock,{asynchronous:true,evalScripts:true,parameters:{unlock_id:_58},onLoaded:function(_59){ 1620 rubricks.common.rubricks_wait_message_close(); 1621 },onLoading:function(_5a){ 1622 rubricks.common.rubricks_wait_message_open(); 1623 }}); 1624 },user_unlock_confirm:function(_5b){ 1609 1625 rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_unlock_confirm,function(){ 1610 rubricks.system.admin_user.functions.user_unlock(_5 7);1626 rubricks.system.admin_user.functions.user_unlock(_5b); 1611 1627 },function(){ 1612 1628 rubricks.system.admin_user.functions.user_tab_activate(); 1613 1629 }); 1614 1630 },user_unlock_multiple:function(){ 1615 var _5 8=rubricks.system.admin_user.variables;1616 var _5 9=_58.rubricks_user_list;1617 var _5 a=(_59)?_59.getSelected().join(","):"";1618 if(_5 a.length==0){1619 rubricks.common.rubricks_message_window_open(_5 8.msg_user_not_selected,"error");1620 }else{ 1621 rubricks.common.rubricks_confirm_window_open(_5 8.msg_user_unlock_confirm,function(){1631 var _5c=rubricks.system.admin_user.variables; 1632 var _5d=_5c.rubricks_user_list; 1633 var _5e=(_5d)?_5d.getSelected().join(","):""; 1634 if(_5e.length==0){ 1635 rubricks.common.rubricks_message_window_open(_5c.msg_user_not_selected,"error"); 1636 }else{ 1637 rubricks.common.rubricks_confirm_window_open(_5c.msg_user_unlock_confirm,function(){ 1622 1638 rubricks.system.admin_user.functions.user_unlock(rubricks.system.admin_user.variables.rubricks_user_list.getSelected().join(",")); 1623 1639 },function(){ 1624 _5 9.makeAvailable();1625 }); 1626 } 1627 },user_validate:function(_5 b){1628 new Ajax.Request(rubricks.system.admin_user.variables.url_user_validate,{asynchronous:true,evalScripts:true,parameters:{validate_id:_5 b},onLoaded:function(_5c){1629 rubricks.common.rubricks_wait_message_close(); 1630 },onLoading:function(_ 5d){1631 rubricks.common.rubricks_wait_message_open(); 1632 }}); 1633 },user_validate_confirm:function(_ 5e){1640 _5d.makeAvailable(); 1641 }); 1642 } 1643 },user_validate:function(_5f){ 1644 new Ajax.Request(rubricks.system.admin_user.variables.url_user_validate,{asynchronous:true,evalScripts:true,parameters:{validate_id:_5f},onLoaded:function(_60){ 1645 rubricks.common.rubricks_wait_message_close(); 1646 },onLoading:function(_61){ 1647 rubricks.common.rubricks_wait_message_open(); 1648 }}); 1649 },user_validate_confirm:function(_62){ 1634 1650 rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_validate_confirm,function(){ 1635 rubricks.system.admin_user.functions.user_validate(_ 5e);1651 rubricks.system.admin_user.functions.user_validate(_62); 1636 1652 },function(){ 1637 1653 rubricks.system.admin_user.functions.user_tab_activate(); 1638 1654 }); 1639 1655 }}); 1640 AjaxHistory.addCallback(function(_ 5f){1641 rubricks.system.admin_user.functions.show_detail(_ 5f);1656 AjaxHistory.addCallback(function(_63){ 1657 rubricks.system.admin_user.functions.show_detail(_63); 1642 1658 },rubricks.system.admin_user.functions._ajax_history_prefix); 1643 1659 rubricks_core/trunk/public/javascripts/spinelz/calendar.js
r5987 r6010 1 1 var Calendar=Class.create(); 2 Calendar.className={container:"calendar",header:"calendar_header",preYears:"calendar_preYears",nextYears:"calendar_nextYears", years:"calendar_years",mark:"calendar_mark",ym:"calendar_ym",table:"calendar_table",thRight:"right",tdRight:"right",tdBottom:"bottom",date:"calendar_date",holiday:"calendar_holiday",regularHoliday:"calendar_regularHoliday",schedule:"calendar_schedule",highlightDay:"calendar_highlightDay",highlightTime:"calendar_highlightTime",scheduleListContainer:"calendar_scheduleListContainer",scheduleItem:"calendar_scheduleItem",scheduleTimeArea:"calendar_scheduleItemTimeArea",scheduleTimeAreaMonth:"calendar_scheduleItemTimeAreaMonth",scheduleHandler:"calendar_scheduleHandler",holidayName:"calendar_holidayName",dateContainer:"calendar_dateContainer",tableHeader:"calendar_tableHeader",rowContent:"calendar_rowContent",selected:"calendar_selected",nextYearMark:"calendar_nextYearMark",nextMonthMark:"calendar_nextMonthMark",nextWeekMark:"calendar_nextWeekMark",preYearMark:"calendar_preYearMark",preMonthMark:"calendar_preMonthMark",preWeekMark:"calendar_preWeekMark",weekTable:"calendar_weekContainerTable",weekMainTable:"calendar_weekMainTable",timeLine:"calendar_timeline",timeLineTimeTop:"calendar_timelineTimeTop",timeLineTime:"calendar_timelineTime",headerColumn:"calendar_headerColumn",columnTopDate:"calendar_columnTopDate",columnDate:"calendar_columnDate",columnDateOdd:"calendar_columnOddDate",scheduleItemSamll:"calendar_scheduleItemSmall",scheduleItemLarge:"calendar_scheduleItemLarge",scheduleItemNoBorder:"calendar_scheduleItemNoBorder",scheduleItemSelect:"calendar_scheduleItemSelect",skipNode:"calendar_skipNode",deleteImg:"calendar_deleteImage",copyImg:"calendar_copyImage",privateImg:"calendar_privateImage",scheduleContainer:"calendar_weekScheduleContainer",selector:"calendar_selector",cover:"calendar_cover"};2 Calendar.className={container:"calendar",header:"calendar_header",preYears:"calendar_preYears",nextYears:"calendar_nextYears",preYears2:"calendar_preYears2",nextYears2:"calendar_nextYears2",years:"calendar_years",mark:"calendar_mark",ym:"calendar_ym",table:"calendar_table",thRight:"right",tdRight:"right",tdBottom:"bottom",date:"calendar_date",holiday:"calendar_holiday",regularHoliday:"calendar_regularHoliday",schedule:"calendar_schedule",highlightDay:"calendar_highlightDay",highlightTime:"calendar_highlightTime",scheduleListContainer:"calendar_scheduleListContainer",scheduleItem:"calendar_scheduleItem",scheduleTimeArea:"calendar_scheduleItemTimeArea",scheduleTimeAreaMonth:"calendar_scheduleItemTimeAreaMonth",scheduleHandler:"calendar_scheduleHandler",holidayName:"calendar_holidayName",dateContainer:"calendar_dateContainer",tableHeader:"calendar_tableHeader",rowContent:"calendar_rowContent",selected:"calendar_selected",nextYearMark:"calendar_nextYearMark",nextMonthMark:"calendar_nextMonthMark",nextWeekMark:"calendar_nextWeekMark",preYearMark:"calendar_preYearMark",preMonthMark:"calendar_preMonthMark",preWeekMark:"calendar_preWeekMark",nextYearMark2:"calendar_nextYearMark2",nextMonthMark2:"calendar_nextMonthMark2",nextWeekMark2:"calendar_nextWeekMark2",preYearMark2:"calendar_preYearMark2",preMonthMark2:"calendar_preMonthMark2",preWeekMark2:"calendar_preWeekMark2",weekTable:"calendar_weekContainerTable",weekMainTable:"calendar_weekMainTable",timeLine:"calendar_timeline",timeLineTimeTop:"calendar_timelineTimeTop",timeLineTime:"calendar_timelineTime",headerColumn:"calendar_headerColumn",columnTopDate:"calendar_columnTopDate",columnDate:"calendar_columnDate",columnDateOdd:"calendar_columnOddDate",scheduleItemSamll:"calendar_scheduleItemSmall",scheduleItemLarge:"calendar_scheduleItemLarge",scheduleItemNoBorder:"calendar_scheduleItemNoBorder",scheduleItemSelect:"calendar_scheduleItemSelect",skipNode:"calendar_skipNode",deleteImg:"calendar_deleteImage",copyImg:"calendar_copyImage",privateImg:"calendar_privateImage",scheduleContainer:"calendar_weekScheduleContainer",selector:"calendar_selector",cover:"calendar_cover"}; 3 3 Calendar.smallClassName={container:"calendar_small",header:"calendar_header_small",calendar:"calendar_calendar_small",table:"calendar_tableSmall"}; 4 4 Calendar.size={large:"large",small:"small"}; 5 Calendar.marks={nextYear:"next year",nextMonth:"next month",nextWeek:"next week",nextDay:"next day",preYear:"previous year",preMonth:"previous month",preWeek:"previous week",preDay:"previous day"}; 5 6 Calendar.privateImgPath=null; 6 7 Calendar.defaultIconPath=null; … … 10 11 this.options=Object.extend({initDate:new Date(),cssPrefix:"custom_",holidays:[],schedules:[],size:Calendar.size.large,regularHoliday:[0,6],displayIndexes:[0,1,2,3,4,5,6],displayTime:[{hour:0,min:0},{hour:24,min:0}],weekIndex:0,dblclickListener:null,afterSelect:Prototype.emptyFunction,beforeRefresh:Prototype.emptyFunction,afterRefresh:Prototype.emptyFunction,changeSchedule:Prototype.emptyFunction,changeCalendar:Prototype.emptyFunction,displayType:"month",highlightDay:true,beforeRemoveSchedule:function(){ 11 12 return true; 12 },copySchedule:Prototype.emptyFunction,dblclickSchedule:null,updateTirm:Prototype.emptyFunction,displayTimeLine:true,clickDateText:null,monthHeaderFormat:null,weekHeaderFormat:null,weekSubHeaderFormat:null,dayHeaderFormat:null,dayOfWeek:DateUtil.dayOfWeek,skipString:"... #{count} more",clickSkipNode:Prototype.emptyFunction,noEvent:false,build:true,startAfterBuild:Prototype.emptyFunction,endAfterBuild:Prototype.emptyFunction,enableCtrKey:false },arguments[1]||{});13 },copySchedule:Prototype.emptyFunction,dblclickSchedule:null,updateTirm:Prototype.emptyFunction,displayTimeLine:true,clickDateText:null,monthHeaderFormat:null,weekHeaderFormat:null,weekSubHeaderFormat:null,dayHeaderFormat:null,dayOfWeek:DateUtil.dayOfWeek,skipString:"... #{count} more",clickSkipNode:Prototype.emptyFunction,noEvent:false,build:true,startAfterBuild:Prototype.emptyFunction,endAfterBuild:Prototype.emptyFunction,enableCtrKey:false,useImgMark:true},arguments[1]||{}); 13 14 this.date=this.options.initDate; 14 15 this.options.holidays=this.toHolidayHash(this.options.holidays); … … 387 388 },getSelectedTerm:function(){ 388 389 return this.builder.getSelectedTerm(); 389 },abstractSelect:function(_58,_59){ 390 this.builder.abstractSelect(_58,_59); 390 },isMovedScheduler:function(_58){ 391 var _59=_58.currentDelta(); 392 var _5a=_58.delta; 393 var _5b=5; 394 return (_58.element.moved||!($R(_5a[0]-_5b,_5a[0]).include(_59[0])&&$R(_5a[1]-_5b,_5a[1]).include(_59[1]))); 395 },abstractSelect:function(_5c,_5d){ 396 this.builder.abstractSelect(_5c,_5d); 391 397 },createRange:function(a,b){ 392 var _ 5c=null;398 var _60=null; 393 399 if(a<=b){ 394 _ 5c=$R(a,b);395 }else{ 396 _ 5c=$R(b,a);397 } 398 return _ 5c;399 },formatTime:function(_ 5d){400 var _ 5e=(_5d.hour<10)?"0"+_5d.hour:_5d.hour;401 var min=(_ 5d.min<10)?"0"+_5d.min:_5d.min;402 return _ 5e+":"+min;400 _60=$R(a,b); 401 }else{ 402 _60=$R(b,a); 403 } 404 return _60; 405 },formatTime:function(_61){ 406 var _62=(_61.hour<10)?"0"+_61.hour:_61.hour; 407 var min=(_61.min<10)?"0"+_61.min:_61.min; 408 return _62+":"+min; 403 409 },clearSelected:function(){ 404 var _6 0=this.getSelected();405 var _6 1=this;406 _6 0.each(function(e){410 var _64=this.getSelected(); 411 var _65=this; 412 _64.each(function(e){ 407 413 if(Element.hasClassName(e,Calendar.className.selected)){ 408 _6 1.removeSelectedClass(e);409 } 410 }); 411 },onDblClick:function(_6 3){412 this.abstractSelect(_6 3,this.options.dblclickListener);413 },onMouseUp:function(_6 4){414 var e=_6 4||window.event;415 var _6 6=this;416 if(_6 6.mouseDown){414 _65.removeSelectedClass(e); 415 } 416 }); 417 },onDblClick:function(_67){ 418 this.abstractSelect(_67,this.options.dblclickListener); 419 },onMouseUp:function(_68){ 420 var e=_68||window.event; 421 var _6a=this; 422 if(_6a.mouseDown){ 417 423 setTimeout(function(){ 418 _6 6.mouseDown=false;419 _6 6.options.afterSelect(_64);424 _6a.mouseDown=false; 425 _6a.options.afterSelect(_68); 420 426 },10); 421 427 } 422 },setRegularHolidayClass:function(_6 7){423 this.classNames.refreshClassNames(_6 7,"regularHoliday");428 },setRegularHolidayClass:function(_6b){ 429 this.classNames.refreshClassNames(_6b,"regularHoliday"); 424 430 },getHolidayClass:function(){ 425 431 this.classNames.refreshClassNames(node,"holiday"); 426 },setWorkdayClass:function(_6 8){427 this.classNames.refreshClassNames(_6 8,"date");428 },setScheduleClass:function(_6 9){429 this.classNames.refreshClassNames(_6 9,"schedule");430 },addSelectedClass:function(_6 a){431 this.css.addClassNames(_6 a,"selected");432 },removeSelectedClass:function(_6 b){433 this.css.removeClassNames(_6 b,"selected");434 },getDatasWithMonthAndYear:function(_ 6c){435 var _ 6d=this;436 var _ 6e=_6c.findAll(function(h){437 return _ 6d.isSameYearAndMonth(h.date);438 }); 439 return _ 6e;432 },setWorkdayClass:function(_6c){ 433 this.classNames.refreshClassNames(_6c,"date"); 434 },setScheduleClass:function(_6d){ 435 this.classNames.refreshClassNames(_6d,"schedule"); 436 },addSelectedClass:function(_6e){ 437 this.css.addClassNames(_6e,"selected"); 438 },removeSelectedClass:function(_6f){ 439 this.css.removeClassNames(_6f,"selected"); 440 },getDatasWithMonthAndYear:function(_70){ 441 var _71=this; 442 var _72=_70.findAll(function(h){ 443 return _71.isSameYearAndMonth(h.date); 444 }); 445 return _72; 440 446 },isSameYearAndMonth:function(a,b){ 441 447 if(a.constructor==Date){ … … 458 464 },isSameTime:function(a,b){ 459 465 return ((a.hour==b.hour)&&(a.min==b.min)); 460 },betweenDate:function(_7 6,_77){461 var _7 8=this.toDateNumber(_76.start);462 var _7 9=this.toDateNumber(_76.finish);463 _7 7=this.toDateNumber(_77);464 return _7 8<=_77&&_77<=_79;465 },toDateNumber:function(_7 a){466 if(_7 a.constructor==Date){467 return _7 a.getFullYear()*10000+_7a.getMonth()*100+_7a.getDate();468 }else{ 469 return _7 a.year*10000+_7a.month*100+_7a.day;466 },betweenDate:function(_7a,_7b){ 467 var _7c=this.toDateNumber(_7a.start); 468 var _7d=this.toDateNumber(_7a.finish); 469 _7b=this.toDateNumber(_7b); 470 return _7c<=_7b&&_7b<=_7d; 471 },toDateNumber:function(_7e){ 472 if(_7e.constructor==Date){ 473 return _7e.getFullYear()*10000+_7e.getMonth()*100+_7e.getDate(); 474 }else{ 475 return _7e.year*10000+_7e.month*100+_7e.day; 470 476 } 471 477 },getTimeDiff:function(a,b){ 472 var _ 7d={hour:b.hour-a.hour,min:b.min-a.min};473 if(_ 7d.min>=60){474 _ 7d.hour++;475 _ 7d.min-=60;476 }else{ 477 if(_ 7d.min<0){478 _ 7d.hour--;479 _ 7d.min+=60;480 } 481 } 482 return _ 7d;483 },findIndex:function(_ 7e,_7f){484 var _8 0=null;485 _ 7e.each(function(v,i){486 if(v==_ 7f){487 _8 0=i;478 var _81={hour:b.hour-a.hour,min:b.min-a.min}; 479 if(_81.min>=60){ 480 _81.hour++; 481 _81.min-=60; 482 }else{ 483 if(_81.min<0){ 484 _81.hour--; 485 _81.min+=60; 486 } 487 } 488 return _81; 489 },findIndex:function(_82,_83){ 490 var _84=null; 491 _82.each(function(v,i){ 492 if(v==_83){ 493 _84=i; 488 494 throw $break; 489 495 } 490 496 }); 491 return _80; 492 },recurrence:function(_83,_84){ 493 var _85=this; 494 if(_83.constructor==Array){ 495 _83.each(function(o){ 496 _85.recurrence(o,_84); 497 }); 498 }else{ 499 if(_83.keys){ 500 _83.each(function(_87){ 501 _85.recurrence(_87[1],_84); 502 }); 503 }else{ 504 _84(_83); 505 } 506 } 507 },toHolidayHash:function(_88){ 497 return _84; 498 },recurrence:function(_87,_88){ 508 499 var _89=this; 509 var _8a={}; 510 this.recurrence(_88,function(o){ 500 if(_87.constructor==Array){ 501 _87.each(function(o){ 502 _89.recurrence(o,_88); 503 }); 504 }else{ 505 if(_87.keys){ 506 _87.each(function(_8b){ 507 _89.recurrence(_8b[1],_88); 508 }); 509 }else{ 510 _88(_87); 511 } 512 } 513 },toHolidayHash:function(_8c){ 514 var _8d=this; 515 var _8e={}; 516 this.recurrence(_8c,function(o){ 511 517 if(!o.name){ 512 518 return; … … 515 521 o.date=new Date(o.date.year,o.date.month,o.date.day); 516 522 } 517 _8 a[o.date.toDateString()]=o;518 }); 519 return $H(_8 a);520 },inspectArgument:function(_ 8c,_8d){521 return this.builder.inspectArgument(_ 8c,_8d);522 },inspectDateArgument:function(_ 8e){523 return this.builder.inspectDateArgument(_ 8e);523 _8e[o.date.toDateString()]=o; 524 }); 525 return $H(_8e); 526 },inspectArgument:function(_90,_91){ 527 return this.builder.inspectArgument(_90,_91); 528 },inspectDateArgument:function(_92){ 529 return this.builder.inspectDateArgument(_92); 524 530 },sortSchedule:function(a,b){ 525 531 if(a.start.hour==b.start.hour){ … … 538 544 },hasSelectedDate:function(){ 539 545 return (this.getSelected().length!=0); 540 },getDate:function(_9 1){541 return this.builder.getDate(_9 1);546 },getDate:function(_95){ 547 return this.builder.getDate(_95); 542 548 },isRegularHoliday:function(day){ 543 549 return this.options.regularHoliday.include(day); 544 },isHoliday:function(_9 3){545 return this.options.holidays[_9 3.toDateString()];546 },isScheduleDay:function(_9 4){547 return this.options.schedules[_9 4.toDateString()];548 },cacheSchedule:function(_9 5){549 this.cached=_9 5;550 _9 5.start_old=Object.clone(_95.start);551 _9 5.finish_old=Object.clone(_95.finish);550 },isHoliday:function(_97){ 551 return this.options.holidays[_97.toDateString()]; 552 },isScheduleDay:function(_98){ 553 return this.options.schedules[_98.toDateString()]; 554 },cacheSchedule:function(_99){ 555 this.cached=_99; 556 _99.start_old=Object.clone(_99.start); 557 _99.finish_old=Object.clone(_99.finish); 552 558 }}; 553 559 var AbstractCalendar=Class.create(); … … 556 562 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 563 },buildHeader:function(){ 558 var _9 6=this.calendar.options.noEvent;559 return "<table class='"+this.calendar.classNames.header+"' style='table-layout: auto;'>"+"<tr>"+(_9 6?"":this.buildHeaderLeft())+this.buildHeaderCenter()+(_96?"":this.buildHeaderRight())+"</tr>"+"</table>";564 var _9a=this.calendar.options.noEvent; 565 return "<table class='"+this.calendar.classNames.header+"' style='table-layout: auto;'>"+"<tr>"+(_9a?"":this.buildHeaderLeft())+this.buildHeaderCenter()+(_9a?"":this.buildHeaderRight())+"</tr>"+"</table>"; 560 566 },buildSelector:function(){ 561 var _9 7="display: none; zindex:"+ZindexManager.getIndex();562 return "<div id='"+this.getSelectorId()+"' class='"+this.calendar.classNames.selector+"' style='"+_9 7+"'>"+"</div>";567 var _9b="display: none; zindex:"+ZindexManager.getIndex(); 568 return "<div id='"+this.getSelectorId()+"' class='"+this.calendar.classNames.selector+"' style='"+_9b+"'>"+"</div>"; 563 569 },buildCover:function(){ 564 570 this.cover=Builder.node("div",{id:this.calendar.element.id.appendSuffix("cover")}); … … 571 577 } 572 578 return this.cover; 573 },changeCalendar:function(_98){ 574 var _99=Event.element(_98); 575 var _9a=this.calendar.date; 576 var _9b=new Date(_9a.toDateString()); 577 if(this.hasClassName(_99,Calendar.className.preYearMark)){ 578 _9a.setDate(1); 579 _9a.setFullYear(_9a.getFullYear()-1); 580 }else{ 581 if(this.hasClassName(_99,Calendar.className.preMonthMark)){ 582 _9a.setDate(1); 583 _9a.setMonth(_9a.getMonth()-1); 584 }else{ 585 if(this.hasClassName(_99,Calendar.className.preWeekMark)){ 586 _9a.setDate(_9a.getDate()-7); 587 }else{ 588 if(this.hasClassName(_99,Calendar.className.nextYearMark)){ 589 _9a.setDate(1); 590 _9a.setFullYear(_9a.getFullYear()+1); 591 }else{ 592 if(this.hasClassName(_99,Calendar.className.nextMonthMark)){ 593 _9a.setDate(1); 594 _9a.setMonth(_9a.getMonth()+1); 595 }else{ 596 if(this.hasClassName(_99,Calendar.className.nextWeekMark)){ 597 _9a.setDate(_9a.getDate()+7); 598 } 599 } 600 } 601 } 602 } 603 } 604 this.calendar.options.changeCalendar(_9a,_9b); 579 },changeCalendar:function(_9c){ 580 var _9d=Event.element(_9c); 581 if(_9d.tagName.toLowerCase().match(/a/)){ 582 _9d=_9d.parentNode; 583 } 584 var _9e=this.calendar.date; 585 var _9f=new Date(_9e.toDateString()); 586 if(this.hasClassName(_9d,Calendar.className.preYearMark)||this.hasClassName(_9d,Calendar.className.preYearMark2)){ 587 _9e.setDate(1); 588 _9e.setFullYear(_9e.getFullYear()-1); 589 }else{ 590 if(this.hasClassName(_9d,Calendar.className.preMonthMark)||this.hasClassName(_9d,Calendar.className.preMonthMark2)){ 591 _9e.setDate(1); 592 _9e.setMonth(_9e.getMonth()-1); 593 }else{ 594 if(this.hasClassName(_9d,Calendar.className.preWeekMark)||this.hasClassName(_9d,Calendar.className.preWeekMark2)){ 595 _9e.setDate(_9e.getDate()-7); 596 }else{ 597 if(this.hasClassName(_9d,Calendar.className.nextYearMark)||this.hasClassName(_9d,Calendar.className.nextYearMark2)){ 598 _9e.setDate(1); 599 _9e.setFullYear(_9e.getFullYear()+1); 600 }else{ 601 if(this.hasClassName(_9d,Calendar.className.nextMonthMark)||this.hasClassName(_9d,Calendar.className.nextMonthMark2)){ 602 _9e.setDate(1); 603 _9e.setMonth(_9e.getMonth()+1); 604 }else{ 605 if(this.hasClassName(_9d,Calendar.className.nextWeekMark)||this.hasClassName(_9d,Calendar.className.nextWeekMark2)){ 606 _9e.setDate(_9e.getDate()+7); 607 } 608 } 609 } 610 } 611 } 612 } 613 this.calendar.options.changeCalendar(_9e,_9f); 605 614 this.calendar.refresh(); 606 },hasClassName:function(_ 9c,_9d){607 return Element.hasClassName(_ 9c,_9d)||Element.hasClassName(_9c,_9d+"Hover");608 },clickDeleteImage:function(_ 9e){609 if(this.calendar.options.beforeRemoveSchedule(_ 9e)){610 this.calendar.removeSchedule(_ 9e.id,true);611 } 612 },clickCopyImage:function(_ 9f){613 this.calendar.options.copySchedule(_ 9f,true);614 },showImage:function(_a 0,_a1){615 _a 0.each(function(img){615 },hasClassName:function(_a0,_a1){ 616 return Element.hasClassName(_a0,_a1)||Element.hasClassName(_a0,_a1+"Hover"); 617 },clickDeleteImage:function(_a2){ 618 if(this.calendar.options.beforeRemoveSchedule(_a2)){ 619 this.calendar.removeSchedule(_a2.id,true); 620 } 621 },clickCopyImage:function(_a3){ 622 this.calendar.options.copySchedule(_a3,true); 623 },showImage:function(_a4,_a5){ 624 _a4.each(function(img){ 616 625 Element.show(img); 617 626 }); 618 if(_a 1){619 Element.setStyle(_a 1,{right:(17*_a0.length)+"px"});620 } 621 },hideImage:function(_a 3,_a4){622 _a 3.each(function(img){627 if(_a5){ 628 Element.setStyle(_a5,{right:(17*_a4.length)+"px"}); 629 } 630 },hideImage:function(_a7,_a8){ 631 _a7.each(function(img){ 623 632 Element.hide(img); 624 633 }); 625 if(_a 4){626 Element.setStyle(_a 4,{right:"0px"});627 } 628 },_constrain:function(n,_a 7,_a8){629 if(n>_a 8){630 return _a 8;631 }else{ 632 if(n<_a 7){633 return _a 7;634 if(_a8){ 635 Element.setStyle(_a8,{right:"0px"}); 636 } 637 },_constrain:function(n,_ab,_ac){ 638 if(n>_ac){ 639 return _ac; 640 }else{ 641 if(n<_ab){ 642 return _ab; 634 643 }else{ 635 644 return n; … … 643 652 return this.calendar.element.id.appendSuffix(AbstractCalendar.id.scheduleContainer); 644 653 },setColumnWidth:function(){ 645 var _a 9=this.getAdjustSize();646 var _a a=$(this.getScheduleContainerId())||this.container;647 var _a b=this.calendar.options.displayIndexes;648 this.column.width=_a a.offsetWidth/_ab.length-_a9;654 var _ad=this.getAdjustSize(); 655 var _ae=$(this.getScheduleContainerId())||this.container; 656 var _af=this.calendar.options.displayIndexes; 657 this.column.width=_ae.offsetWidth/_af.length-_ad; 649 658 if(this.column.width<0){ 650 659 this.column.width=0; 651 660 } 652 661 },setCover:function(){ 653 var _ ac=$(this.getScheduleContainerId())||this.container;662 var _b0=$(this.getScheduleContainerId())||this.container; 654 663 this.cover=this.cover||$(this.calendar.element.id.appendSuffix("cover")); 655 664 if(this.cover){ … … 657 666 this.cover=null; 658 667 } 659 _ ac.appendChild(this.buildCover());660 Element.setStyle(this.cover,{height:Element.getHeight(_ ac)+"px"});668 _b0.appendChild(this.buildCover()); 669 Element.setStyle(this.cover,{height:Element.getHeight(_b0)+"px"}); 661 670 },getDragDistance:function(){ 662 var _ ad=this.getAdjustSize();663 return [this.column.width+_ ad,this.column.height/2];671 var _b1=this.getAdjustSize(); 672 return [this.column.width+_b1,this.column.height/2]; 664 673 },getWeek:function(){ 665 var _ ae=this.calendar.date;666 var _ af=this.calendar.sortWeekIndex([0,1,2,3,4,5,6]);667 var _b 0=_ae.getDay();668 var _b 1=_af.indexOf(_b0);669 var _b 2=[];670 var _b 3=[];671 var _b 4=this.calendar.options.displayIndexes;672 _ af.each(function(_b5){673 var _b 6=_b5-_b0;674 var _b 7=_af.indexOf(_b5);675 if((_b 7<_b1)&&(_b6>0)){676 _b 6-=7;677 }else{ 678 if((_b 7>_b1)&&(_b6<0)){679 _b 6+=7;680 } 681 } 682 var _b 8=DateUtil.afterDays(_ae,_b6);683 if(_b 4.indexOf(_b5)>=0){684 _b 2.push(_b8);685 }else{ 686 _b 3.push(_b8);674 var _b2=this.calendar.date; 675 var _b3=this.calendar.sortWeekIndex([0,1,2,3,4,5,6]); 676 var _b4=_b2.getDay(); 677 var _b5=_b3.indexOf(_b4); 678 var _b6=[]; 679 var _b7=[]; 680 var _b8=this.calendar.options.displayIndexes; 681 _b3.each(function(_b9){ 682 var _ba=_b9-_b4; 683 var _bb=_b3.indexOf(_b9); 684 if((_bb<_b5)&&(_ba>0)){ 685 _ba-=7; 686 }else{ 687 if((_bb>_b5)&&(_ba<0)){ 688 _ba+=7; 689 } 690 } 691 var _bc=DateUtil.afterDays(_b2,_ba); 692 if(_b8.indexOf(_b9)>=0){ 693 _b6.push(_bc); 694 }else{ 695 _b7.push(_bc); 687 696 } 688 697 }.bind(this)); 689 return [_b 2,_b3];690 },isSameStartDate:function(_b 9,_ba){691 return ((_b a.getFullYear()==_b9.start.year)&&(_ba.getMonth()==_b9.start.month)&&(_ba.getDate()==_b9.start.day));692 },isSameFinishDate:function(_b b,_bc){693 return ((_ bc.getFullYear()==_bb.finish.year)&&(_bc.getMonth()==_bb.finish.month)&&(_bc.getDate()==_bb.finish.day));698 return [_b6,_b7]; 699 },isSameStartDate:function(_bd,_be){ 700 return ((_be.getFullYear()==_bd.start.year)&&(_be.getMonth()==_bd.start.month)&&(_be.getDate()==_bd.start.day)); 701 },isSameFinishDate:function(_bf,_c0){ 702 return ((_c0.getFullYear()==_bf.finish.year)&&(_c0.getMonth()==_bf.finish.month)&&(_c0.getDate()==_bf.finish.day)); 694 703 },getSelectorId:function(){ 695 704 return this.calendar.element.id.appendSuffix(AbstractCalendar.id.selector); 696 },clickDateText:function(_ bd,_be){697 Event.stop(_ bd);698 this.calendar.date=_ be;705 },clickDateText:function(_c1,_c2){ 706 Event.stop(_c1); 707 this.calendar.date=_c2; 699 708 this.calendar.options.displayType="day"; 700 709 this.calendar.refresh(); … … 705 714 this.containerDimensions=Element.getDimensions(this.container); 706 715 this.containerOffset=Position.cumulativeOffset(this.container); 707 },mouseOverSubSchedule:function(_bf){ 708 _bf.each(function(_c0){ 709 var _c1=Element.getStyle(_c0,"borderTopColor"); 710 var _c2=Element.getStyle(_c0,"borderTop"); 711 if(_c1&&(_c1!="")&&_c2&&(_c2!="")){ 712 if(!_c0.originalBorderColor){ 713 _c0.originalBorderColor=_c1; 714 } 715 Element.setStyle(_c0,{borderColor:new Color(_c1).invert()}); 716 }else{ 717 Element.addClassName(_c0,Calendar.className.scheduleItemSelect); 718 } 719 }); 720 },mouseOutSubSchedule:function(_c3){ 716 },mouseOverSubSchedule:function(_c3){ 721 717 _c3.each(function(_c4){ 722 if(_c4.originalBorderColor){ 723 Element.setStyle(_c4,{borderColor:_c4.originalBorderColor}); 724 }else{ 725 Element.removeClassName(_c4,Calendar.className.scheduleItemSelect); 726 } 727 }); 728 },toDate:function(_c5){ 729 return DateUtil.toDate(_c5); 718 var _c5=Element.getStyle(_c4,"borderTopColor"); 719 var _c6=Element.getStyle(_c4,"borderTop"); 720 if(_c5&&(_c5!="")&&_c6&&(_c6!="")){ 721 if(!_c4.originalBorderColor){ 722 _c4.originalBorderColor=_c5; 723 } 724 Element.setStyle(_c4,{borderColor:new Color(_c5).invert()}); 725 }else{ 726 Element.addClassName(_c4,Calendar.className.scheduleItemSelect); 727 } 728 }); 729 },mouseOutSubSchedule:function(_c7){ 730 _c7.each(function(_c8){ 731 if(_c8.originalBorderColor){ 732 Element.setStyle(_c8,{borderColor:_c8.originalBorderColor}); 733 }else{ 734 Element.removeClassName(_c8,Calendar.className.scheduleItemSelect); 735 } 736 }); 737 },toDate:function(_c9){ 738 return DateUtil.toDate(_c9); 730 739 },getCalendarTableId:function(){ 731 740 return this.ids.calTable; 732 741 },setSkipNode:function(){ 733 var _c 6=new Template(this.calendar.options.skipString);734 this.skipNode.each(function(_c 7){735 _c 7.value.innerHTML=_c6.evaluate({count:this.skipSchedules[_c7.key].length});742 var _ca=new Template(this.calendar.options.skipString); 743 this.skipNode.each(function(_cb){ 744 _cb.value.innerHTML=_ca.evaluate({count:this.skipSchedules[_cb.key].length}); 736 745 }.bind(this)); 737 746 },clickSkipNode:function(){ 738 747 this.hideTooltip(); 739 748 this.calendar.options.clickSkipNode.apply(this,arguments); 740 },showTooltip:function(e,id,_c a){741 var _c b=$(this.getTooltipId());742 var _ cc=this.skipSchedules[id];743 var _ cd=null;744 var _ ce=null;745 _c b.innerHTML=_cc.map(function(s){746 _ cd=(DateUtil.toDate(s.start).sameDate(_ca))?s.start:{hour:0,min:0};747 _ ce=(DateUtil.toDate(s.finish).sameDate(_ca))?s.finish:{hour:0,min:0};748 return this.calendar.formatTime(_ cd)+"-"+this.calendar.formatTime(_ce)+" "+s.description;749 },showTooltip:function(e,id,_ce){ 750 var _cf=$(this.getTooltipId()); 751 var _d0=this.skipSchedules[id]; 752 var _d1=null; 753 var _d2=null; 754 _cf.innerHTML=_d0.map(function(s){ 755 _d1=(DateUtil.toDate(s.start).sameDate(_ce))?s.start:{hour:0,min:0}; 756 _d2=(DateUtil.toDate(s.finish).sameDate(_ce))?s.finish:{hour:0,min:0}; 757 return this.calendar.formatTime(_d1)+"-"+this.calendar.formatTime(_d2)+" "+s.description; 749 758 }.bind(this)).join("<br />"); 750 Element.positionedByCursor(_c b,e,{top:10,left:10});751 _c b.show();759 Element.positionedByCursor(_cf,e,{top:10,left:10}); 760 _cf.show(); 752 761 },hideTooltip:function(){ 753 762 $(this.getTooltipId()).hide(); … … 756 765 CalendarMonth.id=["year","month","column","nextYear","nextMonth","preYear","preMonth","calTable","scheduleContainer","container","emptyRow"]; 757 766 Object.extend(CalendarMonth.prototype,AbstractCalendar.prototype); 758 Object.extend(CalendarMonth.prototype,{initialize:function(_d 0){759 this.calendar=_d 0;767 Object.extend(CalendarMonth.prototype,{initialize:function(_d4){ 768 this.calendar=_d4; 760 769 this.week=this.getWeek()[0]; 761 770 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarMonth.id); 762 771 this.columnIds=[]; 763 772 },buildHeaderLeft:function(){ 773 if(this.calendar.options.useImgMark){ 764 774 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.preYear+"' class='"+this.calendar.classNames.preYearMark+"'></div>"+"<div id='"+this.ids.preMonth+"' class='"+this.calendar.classNames.preMonthMark+"'></div>"+"</td>"; 775 } 776 return "<td class='"+this.calendar.classNames.preYears2+"'>"+"<div id='"+this.ids.preYear+"' class='"+this.calendar.classNames.preYearMark2+"'><a href=\"javascript:void(0)\">"+Calendar.marks.preYear+"</a></div>"+"<div id='"+this.ids.preMonth+"' class='"+this.calendar.classNames.preMonthMark2+"'><a href=\"javascript:void(0)\">"+Calendar.marks.preMonth+"</a></div>"+"</td>"; 765 777 },buildHeaderCenter:function(){ 766 var _d 1=[];778 var _d5=[]; 767 779 if(this.calendar.options.monthHeaderFormat){ 768 var _d 2=this.calendar.date;769 var _d 3=new Template(this.calendar.options.monthHeaderFormat).evaluate({year:_d2.getFullYear(),month:_d2.getMonth()+1});770 _d 1=[_d3," "];771 } 772 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.ids.month+"' class='"+this.calendar.classNames.ym+"'>"+(_d 1[0]||DateUtil.months[this.calendar.date.getMonth()])+"</span>"+"<span id='"+this.ids.year+"' class='"+this.calendar.classNames.ym+"'>"+(_d1[1]||this.calendar.date.getFullYear())+"</span>"+"</td>";780 var _d6=this.calendar.date; 781 var _d7=new Template(this.calendar.options.monthHeaderFormat).evaluate({year:_d6.getFullYear(),month:_d6.getMonth()+1}); 782 _d5=[_d7," "]; 783 } 784 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.ids.month+"' class='"+this.calendar.classNames.ym+"'>"+(_d5[0]||DateUtil.months[this.calendar.date.getMonth()])+"</span>"+"<span id='"+this.ids.year+"' class='"+this.calendar.classNames.ym+"'>"+(_d5[1]||this.calendar.date.getFullYear())+"</span>"+"</td>"; 773 785 },buildHeaderRight:function(){ 786 if(this.calendar.options.useImgMark){ 774 787 return "<td class='"+this.calendar.classNames.nextYears+"'>"+"<div id='"+this.ids.nextMonth+"' class='"+this.calendar.classNames.nextMonthMark+"'></div>"+"<div id='"+this.ids.nextYear+"' class='"+this.calendar.classNames.nextYearMark+"'></div>"+"</td>"; 788 } 789 return "<td class='"+this.calendar.classNames.nextYears2+"' align='right'>"+"<div id='"+this.ids.nextMonth+"' class='"+this.calendar.classNames.nextMonthMark2+"'><a href=\"javascript:void(0)\">"+Calendar.marks.nextMonth+"</a></div>"+"<div id='"+this.ids.nextYear+"' class='"+this.calendar.classNames.nextYearMark2+"'><a href=\"javascript:void(0)\">"+Calendar.marks.nextYear+"</a></div>"+"</td>"; 775 790 },buildCalendar:function(){ 776 791 return "<div>"+this.buildTableHeader()+this.buildScheduleContainer()+"</div>"; 777 792 },buildTableHeader:function(){ 778 var _d 4=100/this.calendar.options.displayIndexes.length+"%";779 var _d 5=this.calendar.options.displayIndexes.last();780 var _d 6=this.ids.column;781 var _d 7=this.calendar.options.displayIndexes.inject("",function(_d8,i){782 var id=_d 6.appendSuffix(i);793 var _d8=100/this.calendar.options.displayIndexes.length+"%"; 794 var _d9=this.calendar.options.displayIndexes.last(); 795 var _da=this.ids.column; 796 var _db=this.calendar.options.displayIndexes.inject("",function(_dc,i){ 797 var id=_da.appendSuffix(i); 783 798 this.columnIds.push(id); 784 var _d b=(_d5==i)?this.calendar.classNames.thRight:"";785 _d 8+="<th id='"+id+"' class='"+_db+"' width='"+_d4+"'>"+this.calendar.options.dayOfWeek[i]+"</th>";786 return _d 8;799 var _df=(_d9==i)?this.calendar.classNames.thRight:""; 800 _dc+="<th id='"+id+"' class='"+_df+"' width='"+_d8+"'>"+this.calendar.options.dayOfWeek[i]+"</th>"; 801 return _dc; 787 802 }.bind(this)); 788 return "<table class='"+this.calendar.classNames.table+"'>"+"<tr>"+_d 7+"</tr>"+"</table>";803 return "<table class='"+this.calendar.classNames.table+"'>"+"<tr>"+_db+"</tr>"+"</table>"; 789 804 },buildScheduleContainer:function(){ 790 var _ dc=(this.calendar.options.size=="large")?"position: relative":"";791 return "<div id='"+this.getScheduleContainerId()+"' style='"+_ dc+";'>"+this.buildTableData()+this.buildSelector()+"</div>";805 var _e0=(this.calendar.options.size=="large")?"position: relative":""; 806 return "<div id='"+this.getScheduleContainerId()+"' style='"+_e0+";'>"+this.buildTableData()+this.buildSelector()+"</div>"; 792 807 },buildTableData:function(){ 793 var _ dd=this.calendar.options.displayIndexes;794 var _ de=new Date();795 var _ df=this.calendar.date.getFullYear();796 var _e 0=this.calendar.date.getMonth();797 var _e 1=DateUtil.getFirstDate(_df,_e0).getDay();798 var _e 2=DateUtil.getLastDate(_df,_e0).getDate();808 var _e1=this.calendar.options.displayIndexes; 809 var _e2=new Date(); 810 var _e3=this.calendar.date.getFullYear(); 811 var _e4=this.calendar.date.getMonth(); 812 var _e5=DateUtil.getFirstDate(_e3,_e4).getDay(); 813 var _e6=DateUtil.getLastDate(_e3,_e4).getDate(); 799 814 var trs=[]; 800 815 var tds=[]; 801 var _e 5=100/_dd.length+"%";802 var _e 6=_dd.last();803 var _e 7,_e8,_e9,_ea,_eb,i=null;816 var _e9=100/_e1.length+"%"; 817 var _ea=_e1.last(); 818 var _eb,_ec,_ed,_ee,_ef,i=null; 804 819 this.dateMap={}; 805 var _ ed=this.calendar.options.weekIndex;806 var _ ee=DateUtil.dayOfWeek.length*6;820 var _f1=this.calendar.options.weekIndex; 821 var _f2=DateUtil.dayOfWeek.length*6; 807 822 var i=null; 808 823 var day=1; 809 if(_ ed<=_e1){810 i=_ ed;811 _ ee+=i;812 }else{ 813 i=_ ed-7;814 _ ee-=i;815 } 816 var _f 0=_e1-_ed;817 if(_f 0<0){818 _f 0+DateUtil.dayOfWeek.length;819 } 820 if((_e 2+_f0)>_ee){821 _ ee+=DateUtil.dayOfWeek.length;822 } 823 var _f 1=_ed;824 var _f 2=0;825 for(;i<_ ee;i++){826 if(_ dd.include(_f1)){827 var _f 3=(_f1==_e6)?this.calendar.classNames.tdRight:"";828 if(i<_e 1){829 var _f 4=i-_e1+1;830 _e a=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),_f4);831 tds.push(this.buildEmptyRow(_e a,_e5,_f3,_f4));832 }else{ 833 if(day>_e 2){834 _e a=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day);835 tds.push(this.buildEmptyRow(_e a,_e5,_f3,day));836 }else{ 837 if(i==_e 1){838 _ ee+=_f2;839 } 840 _e a=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day);841 _e 8=this.calendar.options.holidays[_ea.toDateString()];824 if(_f1<=_e5){ 825 i=_f1; 826 _f2+=i; 827 }else{ 828 i=_f1-7; 829 _f2-=i; 830 } 831 var _f4=_e5-_f1; 832 if(_f4<0){ 833 _f4+DateUtil.dayOfWeek.length; 834 } 835 if((_e6+_f4)>_f2){ 836 _f2+=DateUtil.dayOfWeek.length; 837 } 838 var _f5=_f1; 839 var _f6=0; 840 for(;i<_f2;i++){ 841 if(_e1.include(_f5)){ 842 var _f7=(_f5==_ea)?this.calendar.classNames.tdRight:""; 843 if(i<_e5){ 844 var _f8=i-_e5+1; 845 _ee=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),_f8); 846 tds.push(this.buildEmptyRow(_ee,_e9,_f7,_f8)); 847 }else{ 848 if(day>_e6){ 849 _ee=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day); 850 tds.push(this.buildEmptyRow(_ee,_e9,_f7,day)); 851 }else{ 852 if(i==_e5){ 853 _f2+=_f6; 854 } 855 _ee=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day); 856 _ec=this.calendar.options.holidays[_ee.toDateString()]; 842 857 if(this.calendar.options.size==Calendar.size.large){ 843 tds.push(this.buildLargeRow(_e a,_e8,_de,_e5,_f3));844 }else{ 845 _e 9=this.calendar.options.schedules.detect(function(_f5){846 return this.calendar.betweenDate(_f 5,_ea);858 tds.push(this.buildLargeRow(_ee,_ec,_e2,_e9,_f7)); 859 }else{ 860 _ed=this.calendar.options.schedules.detect(function(_f9){ 861 return this.calendar.betweenDate(_f9,_ee); 847 862 }.bind(this)); 848 tds.push(this.buildSmallRow(_e a,_e8,_e9,_de,_e5,_f3));849 } 850 } 851 } 852 _f 2++;853 } 854 if(i>=_e 1){863 tds.push(this.buildSmallRow(_ee,_ec,_ed,_e2,_e9,_f7)); 864 } 865 } 866 } 867 _f6++; 868 } 869 if(i>=_e5){ 855 870 day++; 856 871 } 857 if(_f 1==_e6){872 if(_f5==_ea){ 858 873 if(!(tds.first().match(/empty/)&&tds.last().match(/empty/))){ 859 874 trs.push("<tr>"+tds.join("")+"</tr>"); … … 861 876 tds=[]; 862 877 } 863 if(_f 1>=6){864 _f 1=0;865 }else{ 866 _f 1++;878 if(_f5>=6){ 879 _f5=0; 880 }else{ 881 _f5++; 867 882 } 868 883 } 869 884 this.rowMax=trs.length-1; 870 885 return "<table id='"+this.getCalendarTableId()+"' class='"+this.calendar.classNames.table+"'>"+trs.join("")+"</table>"; 871 },buildEmptyRow:function(_f 6,_f7,_f8,_f9){872 var id=this.ids.emptyRow.appendSuffix(_f 9);873 this.dateMap[id]=_f 6;874 return "<td id='"+id+"' class='"+_f 8+"' width='"+_f7+"'> </td>";875 },buildLargeRow:function(_f b,_fc,_fd,_fe,_ff){876 var _10 0=null;877 var _10 1=(_fb.days()==_fd.days())?this.calendar.classNames.highlightDay:"";878 var _10 2=this.calendar.options.clickDateText;879 if(_10 2||(_102==null)){880 _10 0="<span class='"+_101+"'>"+_fb.getDate()+"</span>";881 }else{ 882 _10 0="<span class='"+_101+"' style='text-decoration: none;'>"+_fb.getDate()+"</span>";883 } 884 var _10 3="";886 },buildEmptyRow:function(_fa,_fb,_fc,_fd){ 887 var id=this.ids.emptyRow.appendSuffix(_fd); 888 this.dateMap[id]=_fa; 889 return "<td id='"+id+"' class='"+_fc+"' width='"+_fb+"'> </td>"; 890 },buildLargeRow:function(_ff,_100,_101,_102,_103){ 891 var _104=null; 892 var _105=(_ff.days()==_101.days())?this.calendar.classNames.highlightDay:""; 893 var _106=this.calendar.options.clickDateText; 894 if(_106||(_106==null)){ 895 _104="<span class='"+_105+"'>"+_ff.getDate()+"</span>"; 896 }else{ 897 _104="<span class='"+_105+"' style='text-decoration: none;'>"+_ff.getDate()+"</span>"; 898 } 899 var _107=""; 885 900 var name=""; 886 if(_ fc){887 _10 3=this.calendar.classNames.holiday;888 name="<span class='"+this.calendar.classNames.holidayName+"'>"+_ fc.name+"</span>";889 }else{ 890 if(this.calendar.isRegularHoliday(_f b.getDay())){891 _10 3=this.calendar.classNames.regularHoliday;892 }else{ 893 _10 3=this.calendar.classNames.date;894 } 895 } 896 _ ff=[_103,_ff];897 var id=this.getDateId(_f b);898 this.dateMap[id]=_f b;899 return "<td id='"+id+"' class='"+_ ff.join(" ")+"' width='"+_fe+"'>"+"<div class='"+this.calendar.classNames.dateContainer+"'>"+_100+name+"</div>"+"</td>";900 },buildSmallRow:function(date,_10 7,_108,_109,_10a,_10b){901 if(_100){ 902 _107=this.calendar.classNames.holiday; 903 name="<span class='"+this.calendar.classNames.holidayName+"'>"+_100.name+"</span>"; 904 }else{ 905 if(this.calendar.isRegularHoliday(_ff.getDay())){ 906 _107=this.calendar.classNames.regularHoliday; 907 }else{ 908 _107=this.calendar.classNames.date; 909 } 910 } 911 _103=[_107,_103]; 912 var id=this.getDateId(_ff); 913 this.dateMap[id]=_ff; 914 return "<td id='"+id+"' class='"+_103.join(" ")+"' width='"+_102+"'>"+"<div class='"+this.calendar.classNames.dateContainer+"'>"+_104+name+"</div>"+"</td>"; 915 },buildSmallRow:function(date,_10b,_10c,_10d,_10e,_10f){ 901 916 var id=this.getDateId(date); 902 917 this.dateMap[id]=date; 903 var _1 0d=$H({id:id,width:_10a});904 _10 b=[];905 if(_10 8){906 _10 b.push(this.calendar.classNames.schedule);907 var _1 0e=_108[0];908 if(_1 0e){909 _1 0d.title=_10e.description;910 } 911 }else{ 912 if(_10 7){913 _10 b.push(this.calendar.classNames.holiday);914 _1 0d.title=_107.name.stripTags();918 var _111=$H({id:id,width:_10e}); 919 _10f=[]; 920 if(_10c){ 921 _10f.push(this.calendar.classNames.schedule); 922 var _112=_10c[0]; 923 if(_112){ 924 _111.title=_112.description; 925 } 926 }else{ 927 if(_10b){ 928 _10f.push(this.calendar.classNames.holiday); 929 _111.title=_10b.name.stripTags(); 915 930 }else{ 916 931 if(this.calendar.isRegularHoliday(date.getDay())){ 917 _10 b.push(this.calendar.classNames.regularHoliday);918 }else{ 919 _10 b.push(this.calendar.classNames.date);920 } 921 } 922 } 923 if(date.days()==_10 9.days()){924 _10 b.push(Calendar.className.highlightDay);925 } 926 _10 b.push(_10b);927 _10 b=_10b.join(" ");928 _1 0d=_10d.inject("",function(html,pair){932 _10f.push(this.calendar.classNames.regularHoliday); 933 }else{ 934 _10f.push(this.calendar.classNames.date); 935 } 936 } 937 } 938 if(date.days()==_10d.days()){ 939 _10f.push(Calendar.className.highlightDay); 940 } 941 _10f.push(_10f); 942 _10f=_10f.join(" "); 943 _111=_111.inject("",function(html,pair){ 929 944 return html+" "+pair.key+"=\""+pair.value+"\""; 930 945 }); 931 return "<td class=\""+_10 b+"\""+_10d+">"+date.getDate()+"</td>";946 return "<td class=\""+_10f+"\""+_111+">"+date.getDate()+"</td>"; 932 947 },beforeBuild:function(){ 933 948 this.column={}; … … 936 951 rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.dateContainer); 937 952 this.column.dateTextHeight=parseInt(rule.style["height"],10); 938 },buildSchedule:function(_11 2,_113){939 var _11 4=this.calendar.options.noEvent;940 var id="scheduleItem_"+_11 2.id;941 var _11 6=(_112.edit==undefined||_112.edit);953 },buildSchedule:function(_116,_117){ 954 var _118=this.calendar.options.noEvent; 955 var id="scheduleItem_"+_116.id; 956 var _11a=(_116.edit==undefined||_116.edit); 942 957 var item=Builder.node("DIV",{id:id}); 943 var _11 8="";944 if(!_11 4&&_116){945 _11 8+="cursor: move";946 } 947 var _11 9=Builder.node("DIV",{id:id+"_container",style:_118});948 item.appendChild(_11 9);949 var _11 a=DateUtil.toDate(_112.start);950 var _11 b=DateUtil.toDate(_112.finish);951 if(_11 2.finish.hour==0&&_112.finish.min==0){952 _11 b=_11b.advance({days:-1});953 } 954 var _1 1c={};958 var _11c=""; 959 if(!_118&&_11a){ 960 _11c+="cursor: move"; 961 } 962 var _11d=Builder.node("DIV",{id:id+"_container",style:_11c}); 963 item.appendChild(_11d); 964 var _11e=DateUtil.toDate(_116.start); 965 var _11f=DateUtil.toDate(_116.finish); 966 if(_116.finish.hour==0&&_116.finish.min==0){ 967 _11f=_11f.advance({days:-1}); 968 } 969 var _120={}; 955 970 if(!UserAgent.isIE()){ 956 _1 1c.whiteSpace="nowrap";957 } 958 if(_11 4){959 _1 1c.cursor="default";960 } 961 if(_11 a.sameDate(_11b)){971 _120.whiteSpace="nowrap"; 972 } 973 if(_118){ 974 _120.cursor="default"; 975 } 976 if(_11e.sameDate(_11f)){ 962 977 this.calendar.css.addClassNames(item,"scheduleItemNoBorder"); 963 978 }else{ 964 if(_11 2.frame_color){965 _1 1c.border="2px solid "+_112.frame_color;966 _1 1c.backgroundColor=_112.frame_color;979 if(_116.frame_color){ 980 _120.border="2px solid "+_116.frame_color; 981 _120.backgroundColor=_116.frame_color; 967 982 } 968 983 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 969 984 } 970 Element.setStyle(item,_1 1c);971 var _1 1d=[];972 var _1 1e=(_112.removable==undefined||_112.removable);973 if(_11 6&&_11e){974 var _1 1f=Builder.node("DIV",{id:"scheduleDeleteImg_"+_112.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"});975 _1 1d.push(_11f);976 _11 9.appendChild(_11f);977 if(!_11 4){978 Event.observe(_1 1f,"click",this.clickDeleteImage.bind(this,_112));979 } 980 } 981 if(!_11 4&&this.calendar.options.dblclickSchedule){982 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_11 2));985 Element.setStyle(item,_120); 986 var _121=[]; 987 var _122=(_116.removable==undefined||_116.removable); 988 if(_11a&&_122){ 989 var _123=Builder.node("DIV",{id:"scheduleDeleteImg_"+_116.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"}); 990 _121.push(_123); 991 _11d.appendChild(_123); 992 if(!_118){ 993 Event.observe(_123,"click",this.clickDeleteImage.bind(this,_116)); 994 } 995 } 996 if(!_118&&this.calendar.options.dblclickSchedule){ 997 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_116)); 983 998 } 984 999 var icon=null; 985 if(_11 2.icon){986 icon=Builder.node("IMG",{id:"private_img_"+_11 2.id,src:_112.icon,alt:"icon",style:"float: left;",width:16,height:16});987 _11 9.appendChild(icon);1000 if(_116.icon){ 1001 icon=Builder.node("IMG",{id:"private_img_"+_116.id,src:_116.icon,alt:_116.type_name,style:"float: left;",width:16,height:16}); 1002 _11d.appendChild(icon); 988 1003 }else{ 989 1004 if(Calendar.defaultIconPath){ 990 icon=Builder.node("IMG",{id:"private_img_"+_11 2.id,src:Calendar.defaultIconPath,alt:"icon",style:"float: left;",width:16,height:16});991 _11 9.appendChild(icon);992 } 993 } 994 var _12 1=null;995 if(!_11 2.publicity){1005 icon=Builder.node("IMG",{id:"private_img_"+_116.id,src:Calendar.defaultIconPath,alt:_116.type_name,style:"float: left;",width:16,height:16}); 1006 _11d.appendChild(icon); 1007 } 1008 } 1009 var _125=null; 1010 if(!_116.publicity){ 996 1011 if(Calendar.privateImgPath){ 997 _12 1=Builder.node("IMG",{src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16});998 _11 9.appendChild(_121);999 }else{ 1000 _12 1=Builder.node("DIV",{id:"private_img_"+_112.id});1001 this.calendar.css.addClassNames(_12 1,"privateImg");1002 _11 9.appendChild(_121);1003 } 1004 } 1005 if(!_11 4&&(_11d.length>0)){1006 Event.observe(item,"mouseover",this.showImage.bind(this,_1 1d,_121));1007 Event.observe(item,"mouseout",this.hideImage.bind(this,_1 1d,_121));1012 _125=Builder.node("IMG",{src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16}); 1013 _11d.appendChild(_125); 1014 }else{ 1015 _125=Builder.node("DIV",{id:"private_img_"+_116.id}); 1016 this.calendar.css.addClassNames(_125,"privateImg"); 1017 _11d.appendChild(_125); 1018 } 1019 } 1020 if(!_118&&(_121.length>0)){ 1021 Event.observe(item,"mouseover",this.showImage.bind(this,_121,_125)); 1022 Event.observe(item,"mouseout",this.hideImage.bind(this,_121,_125)); 1008 1023 } 1009 1024 var body=Builder.node("DIV"); 1010 var text=this.getTimeText((_11 3)?_112.start:{hour:"0",min:"0"},_112.finish);1011 var _12 4=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]);1012 this.calendar.css.addClassNames(_12 4,"scheduleTimeAreaMonth");1013 _11 9.appendChild(_124);1014 var _12 5=_112.description.unescapeHTML();1015 _11 9.appendChild(Builder.node("DIV",{id:id+"_description"},[_125]));1016 item.title=text+"-"+this.calendar.formatTime(_11 2.finish)+" "+_125;1017 item.schedule=_11 2;1018 return [item,_11 9];1019 },adjustScheduleStyle:function(item,_12 7,_128,_129){1025 var text=this.getTimeText((_117)?_116.start:{hour:"0",min:"0"},_116.finish); 1026 var _128=Builder.node("DIV",{id:id+"_text",style:"float: left;"},[text]); 1027 this.calendar.css.addClassNames(_128,"scheduleTimeAreaMonth"); 1028 _11d.appendChild(_128); 1029 var _129=_116.description.unescapeHTML(); 1030 _11d.appendChild(Builder.node("DIV",{id:id+"_description"},[_129])); 1031 item.title=text+"-"+this.calendar.formatTime(_116.finish)+" "+_116.popup.unescapeHTML()+"\n "+_116.popup2.unescapeHTML()+"\n "+_116.popup3.unescapeHTML(); 1032 item.schedule=_116; 1033 return [item,_11d]; 1034 },adjustScheduleStyle:function(item,_12b,_12c,_12d){ 1020 1035 var self=this; 1021 var _12 b=parseInt(Element.getStyle(item,"height"),10);1036 var _12f=parseInt(Element.getStyle(item,"height"),10); 1022 1037 var top=parseInt(Element.getStyle(item,"top"),10); 1023 var _1 2d=this.getScheduleRange(item);1038 var _131=this.getScheduleRange(item); 1024 1039 var tops=[]; 1025 var _1 2f=3;1026 _12 9.each(function(_130){1027 var _13 1=self.getScheduleRange(_130);1028 if(_1 2d.any(function(r){1029 return _13 1.include(r);1040 var _133=3; 1041 _12d.each(function(_134){ 1042 var _135=self.getScheduleRange(_134); 1043 if(_131.any(function(r){ 1044 return _135.include(r); 1030 1045 })){ 1031 tops.push(_13 0.topIndex);1032 } 1033 }); 1034 var _13 3=$R(0,tops.length,true).detect(function(i){1046 tops.push(_134.topIndex); 1047 } 1048 }); 1049 var _137=$R(0,tops.length,true).detect(function(i){ 1035 1050 return !tops.include(i); 1036 1051 }); 1037 if(isNaN(_13 3)){1038 _13 3=tops.length;1039 } 1040 item.topIndex=_13 3;1041 Element.setStyle(item,{top:top+(_12 b+2)*_133+"px"});1042 if(_13 3>=_12f){1052 if(isNaN(_137)){ 1053 _137=tops.length; 1054 } 1055 item.topIndex=_137; 1056 Element.setStyle(item,{top:top+(_12f+2)*_137+"px"}); 1057 if(_137>=_133){ 1043 1058 Element.hide(item); 1044 var node=this.buildSkipSchedule(_12 7+"_"+_128,item);1059 var node=this.buildSkipSchedule(_12b+"_"+_12c,item); 1045 1060 if(node){ 1046 1061 var left=Element.getStyle(item,"left"); 1047 Element.setStyle(node,{top:top+(_12 b+2)*_133+"px",left:left});1062 Element.setStyle(node,{top:top+(_12f+2)*_137+"px",left:left}); 1048 1063 } 1049 1064 return node; 1050 1065 } 1051 },buildSkipSchedule:function(_13 7,item){1052 var id=this.calendar.element.id.appendSuffix(_13 7);1066 },buildSkipSchedule:function(_13b,item){ 1067 var id=this.calendar.element.id.appendSuffix(_13b); 1053 1068 if(!this.skipNode[id]){ 1054 var _13 a=this.getAdjustSize()+(UserAgent.isIE()?0.5:0);1055 var _13 b=this.column.width+_13a-1+"px";1056 var node=Builder.node("a",{id:id,style:"display: block; z-index: 1000; cursor: pointer; width: "+_13 b+";",href:"javascript:void(0);"},["more"]);1069 var _13e=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); 1070 var _13f=this.column.width+_13e-1+"px"; 1071 var node=Builder.node("a",{id:id,style:"display: block; z-index: 1000; cursor: pointer; width: "+_13f+";",href:"javascript:void(0);"},["more"]); 1057 1072 this.calendar.css.addClassNames(node,"skipNode"); 1058 1073 node.skipId=id; … … 1066 1081 return item.cellIndex+i; 1067 1082 }); 1068 },setScheduleBaseStyle:function(item,_14 0,_141,_142){1069 var _14 3=this.column.height;1070 var top=_14 3*_140+this.column.dateTextHeight;1071 var _14 5=this.getAdjustSize()+(UserAgent.isIE()?0.5:0);1072 Element.setStyle(item,{top:top+"px",width:this.column.width*_14 2+_145*(_142-1)+"px",left:this.column.width*_141+_141*_145+"px"});1083 },setScheduleBaseStyle:function(item,_144,_145,_146){ 1084 var _147=this.column.height; 1085 var top=_147*_144+this.column.dateTextHeight; 1086 var _149=this.getAdjustSize()+(UserAgent.isIE()?0.5:0); 1087 Element.setStyle(item,{top:top+"px",width:this.column.width*_146+_149*(_146-1)+"px",left:this.column.width*_145+_145*_149+"px"}); 1073 1088 },afterBuild:function(){ 1074 1089 this.calendar.options.startAfterBuild(); 1075 var _14 6=this.getTooltipId();1076 if($(_14 6)){1077 Element.appendToBody(_14 6);1090 var _14a=this.getTooltipId(); 1091 if($(_14a)){ 1092 Element.appendToBody(_14a); 1078 1093 } 1079 1094 this.scheduleNodes=[]; … … 1088 1103 this.setSelector(); 1089 1104 var self=this; 1090 var _14 8=this.calendar.options.displayIndexes;1091 var _14 9=this.getDragDistance();1092 var _14 a=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){1105 var _14c=this.calendar.options.displayIndexes; 1106 var _14d=this.getDragDistance(); 1107 var _14e=$R(0,$(this.getCalendarTableId()).rows.length).map(function(){ 1093 1108 return []; 1094 1109 }); 1095 1110 var date=this.calendar.date; 1096 var _1 4c=DateUtil.getFirstDate(date.getFullYear(),date.getMonth());1097 var _1 4d=_14c.days();1098 var _1 4e=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days();1099 self.calendar.options.schedules.each(function(_1 4f,_150){1100 var _15 1=self.toDate(_14f.start);1101 var _15 2=_151.days();1102 var _15 3=self.toDate(_14f.finish);1103 var _15 4=_153.days();1104 var days=self.getDayDiff(_1 4f);1105 if(_1 4f.finish.hour==0&&_14f.finish.min==0){1111 var _150=DateUtil.getFirstDate(date.getFullYear(),date.getMonth()); 1112 var _151=_150.days(); 1113 var _152=DateUtil.getLastDate(date.getFullYear(),date.getMonth()).days(); 1114 self.calendar.options.schedules.each(function(_153,_154){ 1115 var _155=self.toDate(_153.start); 1116 var _156=_155.days(); 1117 var _157=self.toDate(_153.finish); 1118 var _158=_157.days(); 1119 var days=self.getDayDiff(_153); 1120 if(_153.finish.hour==0&&_153.finish.min==0){ 1106 1121 days--; 1107 1122 } 1108 if((_1 4d<=_152&&_152<=_14e)||(_14d<=_154&&_154<=_14e)||((_152<=_14d)&&(_14e<=_154))){1109 if(!_1 4c.sameMonth(_151)){1110 _15 1=_14c;1111 } 1112 self.setSchedule(_1 4f,_14a,_149,days);1123 if((_151<=_156&&_156<=_152)||(_151<=_158&&_158<=_152)||((_156<=_151)&&(_152<=_158))){ 1124 if(!_150.sameMonth(_155)){ 1125 _155=_150; 1126 } 1127 self.setSchedule(_153,_14e,_14d,days); 1113 1128 } 1114 1129 }); … … 1122 1137 Event.observe(this.ids.nextMonth,"click",this.calendar.changeCalendar.bindAsEventListener(this.calendar)); 1123 1138 Event.observe(this.ids.nextYear,"click",this.calendar.changeCalendar.bindAsEventListener(this.calendar)); 1139 if(this.calendar.options.useImgMark){ 1124 1140 new Hover(this.ids.preYear); 1125 1141 new Hover(this.ids.preMonth); 1126 1142 new Hover(this.ids.nextMonth); 1127 1143 new Hover(this.ids.nextYear); 1144 } 1128 1145 if(this.calendar.options.size=="small"){ 1129 1146 $H(this.dateMap).each(function(pair){ … … 1135 1152 } 1136 1153 } 1137 },setSchedule:function(_15 8,_159,_15a,days){1138 var _1 5c=[];1139 var _1 5d=6;1140 var _1 5e=DateUtil.toDate(_158.start);1141 var date=_1 5e;1142 var _16 0=this.calendar.options.displayIndexes;1143 var _16 1=this.calendar.date;1144 var _16 2=this.calendar.options.noEvent;1145 var _16 3=this.calendar.options.clickSkipNode;1154 },setSchedule:function(_15c,_15d,_15e,days){ 1155 var _160=[]; 1156 var _161=6; 1157 var _162=DateUtil.toDate(_15c.start); 1158 var date=_162; 1159 var _164=this.calendar.options.displayIndexes; 1160 var _165=this.calendar.date; 1161 var _166=this.calendar.options.noEvent; 1162 var _167=this.calendar.options.clickSkipNode; 1146 1163 while(days>=0){ 1147 var _16 4=this.getLastWday(date);1148 var _16 5=days+1;1149 var _16 6=date.getDay();1150 var _16 7=date.advance({days:_165-1});1151 if(_16 7.getTime()>_164.getTime()){1152 _16 7=_164;1153 _16 5=_167.days()-date.days()+1;1154 } 1155 var _16 8=_167.getDay();1156 var _16 9=null;1157 if(_16 6<=_168){1158 _16 9=$R(_166,_168,false);1159 }else{ 1160 _16 9=$R(0,_168,false).toArray().concat($R(_166,_15d,false).toArray());1161 } 1162 var _16 a=_169.findAll(function(day){1163 return _16 0.include(day);1164 var _168=this.getLastWday(date); 1165 var _169=days+1; 1166 var _16a=date.getDay(); 1167 var _16b=date.advance({days:_169-1}); 1168 if(_16b.getTime()>_168.getTime()){ 1169 _16b=_168; 1170 _169=_16b.days()-date.days()+1; 1171 } 1172 var _16c=_16b.getDay(); 1173 var _16d=null; 1174 if(_16a<=_16c){ 1175 _16d=$R(_16a,_16c,false); 1176 }else{ 1177 _16d=$R(0,_16c,false).toArray().concat($R(_16a,_161,false).toArray()); 1178 } 1179 var _16e=_16d.findAll(function(day){ 1180 return _164.include(day); 1164 1181 }).length; 1165 var _1 6c=new Date(date.getTime());1166 while(_1 6c.days()<=_167.days()){1167 if((_1 6c.getFullYear()==_161.getFullYear())&&(_16c.getMonth()==_161.getMonth())){1168 var _1 6d=this.getCellPosition(_16c.getDate());1169 if(_1 6d){1170 var _1 6e=_16d.rowIndex;1171 var _1 6f=_16d.cellIndex;1172 var _17 0=this.buildSchedule(_158,_15e.sameDate(_16c));1173 var item=_17 0.first();1174 item.length=_16 a;1175 item.cellIndex=_1 6f;1176 item.cellDate=_1 6c;1182 var _170=new Date(date.getTime()); 1183 while(_170.days()<=_16b.days()){ 1184 if((_170.getFullYear()==_165.getFullYear())&&(_170.getMonth()==_165.getMonth())){ 1185 var _171=this.getCellPosition(_170.getDate()); 1186 if(_171){ 1187 var _172=_171.rowIndex; 1188 var _173=_171.cellIndex; 1189 var _174=this.buildSchedule(_15c,_162.sameDate(_170)); 1190 var item=_174.first(); 1191 item.length=_16e; 1192 item.cellIndex=_173; 1193 item.cellDate=_170; 1177 1194 this.container.appendChild(item); 1178 this.setScheduleBaseStyle(item,_1 6e,_16f,_16a);1179 var _17 2=this.adjustScheduleStyle(item,_16e,_16f,_159[_16e]);1180 if(_17 2){1181 this.container.appendChild(_17 2);1182 Event.observe(_17 2,"click",this.clickSkipNode.bindAsEventListener(this,_16c));1183 Event.observe(_17 2,"mouseover",this.showTooltip.bindAsEventListener(this,_172.skipId,_16c));1184 Event.observe(_17 2,"mouseout",this.hideTooltip.bindAsEventListener(this));1195 this.setScheduleBaseStyle(item,_172,_173,_16e); 1196 var _176=this.adjustScheduleStyle(item,_172,_173,_15d[_172]); 1197 if(_176){ 1198 this.container.appendChild(_176); 1199 Event.observe(_176,"click",this.clickSkipNode.bindAsEventListener(this,_170)); 1200 Event.observe(_176,"mouseover",this.showTooltip.bindAsEventListener(this,_176.skipId,_170)); 1201 Event.observe(_176,"mouseout",this.hideTooltip.bindAsEventListener(this)); 1185 1202 } 1186 1203 if(item.visible()){ 1187 if(!_16 2&&((_158.edit==undefined)||_158.edit)){1188 this.setDraggable(item,_17 0.last(),_15a);1204 if(!_166&&((_15c.edit==undefined)||_15c.edit)){ 1205 this.setDraggable(item,_174.last(),_15e); 1189 1206 this.setResize(item); 1190 1207 } 1191 _15 9[_16e].push(item);1208 _15d[_172].push(item); 1192 1209 this.scheduleNodes.push(item); 1193 1210 break; 1194 1211 }else{ 1195 1212 item.remove(); 1196 _16 a--;1197 } 1198 }else{ 1199 if(_16 0.include(_16c.getDay())){1200 _16 a--;1213 _16e--; 1214 } 1215 }else{ 1216 if(_164.include(_170.getDay())){ 1217 _16e--; 1201 1218 }else{ 1202 1219 this.hasInvisibleSchedule=true; … … 1204 1221 } 1205 1222 }else{ 1206 if(_16 0.include(_16c.getDay())){1207 _16 a--;1208 } 1209 } 1210 _1 6c=_16c.advance({days:1});1211 } 1212 if(_1 5c.length==0){1213 days-=_16 5;1223 if(_164.include(_170.getDay())){ 1224 _16e--; 1225 } 1226 } 1227 _170=_170.advance({days:1}); 1228 } 1229 if(_160.length==0){ 1230 days-=_169; 1214 1231 }else{ 1215 1232 days-=7; 1216 1233 } 1217 var date=_16 7.advance({days:1});1234 var date=_16b.advance({days:1}); 1218 1235 if(item){ 1219 _1 5c.push(item);1236 _160.push(item); 1220 1237 } 1221 1238 } 1222 1239 var self=this; 1223 if(!_16 2){1224 _1 5c.each(function(item){1225 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_1 5c));1226 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_1 5c));1240 if(!_166){ 1241 _160.each(function(item){ 1242 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_160)); 1243 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_160)); 1227 1244 }); 1228 1245 } … … 1231 1248 this.calendar.setIndex(); 1232 1249 } 1233 var _17 6=this.calendar.wdays.indexOf(date.getDay())+1;1234 return date.advance({days:this.calendar.wdays.length-_17 6});1250 var _17a=this.calendar.wdays.indexOf(date.getDay())+1; 1251 return date.advance({days:this.calendar.wdays.length-_17a}); 1235 1252 },setSelector:function(){ 1236 var _17 7=$(this.getSelectorId());1237 Element.setStyle(_17 7,{width:this.column.width+"px",height:this.column.height-2+"px"});1238 Element.setOpacity(_17 7,0.6);1239 },setDraggable:function(item,_17 9,_17a){1253 var _17b=$(this.getSelectorId()); 1254 Element.setStyle(_17b,{width:this.column.width+"px",height:this.column.height-2+"px"}); 1255 Element.setOpacity(_17b,0.6); 1256 },setDraggable:function(item,_17d,_17e){ 1240 1257 var self=this; 1241 var _1 7c=Position.cumulativeOffset(this.container);1242 var _1 7d=$(this.getSelectorId());1243 var _1 7e=this.column.width+(UserAgent.isIE()?0.5:0);1244 var _1 7f=this.column.height+(UserAgent.isIE()?1:0);1245 var _18 0=this.rowMax||$(this.getCalendarTableId()).rows.length;1246 var _18 1=this.calendar.options.displayIndexes.length-1;1247 var _18 2=this.getAdjustSize();1248 new Draggable(item,{handle:_17 9,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_183,_184){1249 Element.show(_1 7d);1250 },onDrag:function(_18 5,_186){1251 var _18 7=_185.element;1252 var top=parseInt(Element.getStyle(_18 7,"top"),10)+_185.offset[1];1253 var _18 9=Math.floor(top/_17f);1254 var left=parseInt(Element.getStyle(_18 7,"left"),10)+_185.offset[0];1255 var _18 b=Math.floor(left/_17e);1256 if((_18 b>=0&&_189>=0)&&(_18b<=_181&&_189<=_180)){1257 Element.setStyle(_1 7d,{left:_17e*_18b+_182*_18b+"px",top:_17f*_189+"px"});1258 } 1259 },onEnd:function(_1 8c,_18d){1260 var _1 8e=_18c.currentDelta();1261 Element.hide(_1 7d);1262 if(!(_1 8e[0]==_18c.delta[0]&&_18e[1]==_18c.delta[1])){1263 self.changeSchedule(_1 8c);1258 var _180=Position.cumulativeOffset(this.container); 1259 var _181=$(this.getSelectorId()); 1260 var _182=this.column.width+(UserAgent.isIE()?0.5:0); 1261 var _183=this.column.height+(UserAgent.isIE()?1:0); 1262 var _184=this.rowMax||$(this.getCalendarTableId()).rows.length; 1263 var _185=this.calendar.options.displayIndexes.length-1; 1264 var _186=this.getAdjustSize(); 1265 new Draggable(item,{handle:_17d,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_187,_188){ 1266 Element.show(_181); 1267 },onDrag:function(_189,_18a){ 1268 var _18b=_189.element; 1269 var top=parseInt(Element.getStyle(_18b,"top"),10)+_189.offset[1]; 1270 var _18d=Math.floor(top/_183); 1271 var left=parseInt(Element.getStyle(_18b,"left"),10)+_189.offset[0]; 1272 var _18f=Math.floor(left/_182); 1273 if((_18f>=0&&_18d>=0)&&(_18f<=_185&&_18d<=_184)){ 1274 Element.setStyle(_181,{left:_182*_18f+_186*_18f+"px",top:_183*_18d+"px"}); 1275 } 1276 },onEnd:function(_190,_191){ 1277 var _192=_190.currentDelta(); 1278 Element.hide(_181); 1279 if(!(_192[0]==_190.delta[0]&&_192[1]==_190.delta[1])){ 1280 self.changeSchedule(_190); 1264 1281 } 1265 1282 }}); 1266 1283 },setResize:function(item){ 1267 1284 var self=this; 1268 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_19 1){1269 self.updateTirm(_19 1);1285 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_195){ 1286 self.updateTirm(_195); 1270 1287 }}); 1271 },getDate:function(_19 2){1288 },getDate:function(_196){ 1272 1289 var date=this.calendar.date; 1273 if(_19 2.constructor==String){1274 return new Date(date.getFullYear(),date.getMonth(),_19 2);1275 }else{ 1276 return new Date(date.getFullYear(),date.getMonth(),_19 2.id.getSuffix());1277 } 1278 },abstractSelect:function(_19 4,_195){1279 var _19 6=null;1290 if(_196.constructor==String){ 1291 return new Date(date.getFullYear(),date.getMonth(),_196); 1292 }else{ 1293 return new Date(date.getFullYear(),date.getMonth(),_196.id.getSuffix()); 1294 } 1295 },abstractSelect:function(_198,_199){ 1296 var _19a=null; 1280 1297 if(this.calendar.options.size=="large"){ 1281 _19 6=this.findClickedElement(_194);1282 }else{ 1283 _19 6=Event.element(_194);1284 if(_19 6.tagName!="TD"){1285 _19 6=Element.getParentByTagName(["TD"],_196);1286 } 1287 } 1288 if(_19 6&&_196.id&&!_196.id.match(/emptyRow/)){1289 var date=this.getDate(_19 6);1290 _19 5(date,_196);1298 _19a=this.findClickedElement(_198); 1299 }else{ 1300 _19a=Event.element(_198); 1301 if(_19a.tagName!="TD"){ 1302 _19a=Element.getParentByTagName(["TD"],_19a); 1303 } 1304 } 1305 if(_19a&&_19a.id&&!_19a.id.match(/emptyRow/)){ 1306 var date=this.getDate(_19a); 1307 _199(date,_19a); 1291 1308 } 1292 1309 },getSelectedTerm:function(){ 1293 1310 var self=this; 1294 var _19 9=this.calendar.getSelected();1295 return [_19 9.first(),_199.last()].map(function(e){1311 var _19d=this.calendar.getSelected(); 1312 return [_19d.first(),_19d.last()].map(function(e){ 1296 1313 return self.getDate(e); 1297 1314 }); 1298 },selectDay:function(_19 b){1299 var _1 9c=this.calendar;1300 var th=Event.element(_19 b);1315 },selectDay:function(_19f){ 1316 var _1a0=this.calendar; 1317 var th=Event.element(_19f); 1301 1318 if(th.tagName!="TH"){ 1302 1319 th=Element.getParentByTagName("TH",th); … … 1304 1321 this.iterateTable({doCell:function(cell){ 1305 1322 if((cell.cellIndex==th.cellIndex)&&cell.id){ 1306 _1 9c.addSelectedClass(cell);1323 _1a0.addSelectedClass(cell); 1307 1324 } 1308 1325 }}); 1309 },inspectArgument:function(_1 9f,time){1326 },inspectArgument:function(_1a3,time){ 1310 1327 var self=this; 1311 var _1a 2=this.calendar.getSelected();1312 var _1a 3=[];1313 self.calendar.recurrence(_1 9f,function(o){1328 var _1a6=this.calendar.getSelected(); 1329 var _1a7=[]; 1330 self.calendar.recurrence(_1a3,function(o){ 1314 1331 if(!o.date){ 1315 _1a 2.each(function(d){1316 var _1a 6={};1332 _1a6.each(function(d){ 1333 var _1aa={}; 1317 1334 if(!o.date){ 1318 _1a 6={date:self.getDate(d)};1335 _1aa={date:self.getDate(d)}; 1319 1336 if(time){ 1320 _1a 6.start={hour:0,min:0};1321 _1a 6.finish={hour:0,min:0};1322 } 1323 } 1324 Object.extend(_1a 6,o);1325 _1a 3.push(_1a6);1337 _1aa.start={hour:0,min:0}; 1338 _1aa.finish={hour:0,min:0}; 1339 } 1340 } 1341 Object.extend(_1aa,o); 1342 _1a7.push(_1aa); 1326 1343 }); 1327 1344 }else{ 1328 1345 if(o.date.constructor==Object){ 1329 1346 o.date=new Date(o.date.year,o.date.month,o.date.day); 1330 _1a 3.push(o);1331 }else{ 1332 _1a 3.push(o);1333 } 1334 } 1335 }); 1336 return _1a 3;1347 _1a7.push(o); 1348 }else{ 1349 _1a7.push(o); 1350 } 1351 } 1352 }); 1353 return _1a7; 1337 1354 },inspectDateArgument:function(date){ 1338 1355 if(date){ … … 1347 1364 return map; 1348 1365 }else{ 1349 var _1a 9=this;1350 var _1a a=this.calendar.getSelected();1351 if(_1a a.length==0){1366 var _1ad=this; 1367 var _1ae=this.calendar.getSelected(); 1368 if(_1ae.length==0){ 1352 1369 return null; 1353 1370 } 1354 return _1a a.collect(function(d){1355 return _1a 9.getDate(d);1356 }); 1357 } 1358 },findClickedElement:function(_1 ac){1359 var _1 ad=$(this.getScheduleContainerId());1360 var _1 ae=Position.cumulativeOffset(_1ad);1361 var _1 af=Position.realOffset(_1ad).last();1362 _1 af-=document.documentElement.scrollTop||document.body.scrollTop;1363 var x=Event.pointerX(_1 ac)-_1ae[0];1364 var y=Event.pointerY(_1 ac)-_1ae[1]+_1af;1365 var _1b 2=Math.floor(y/this.column.height);1366 var _1b 3=Math.floor(x/this.column.width);1367 return $(this.calendarTable.rows[_1b 2].cells[_1b3]);1368 },multipleSelection:function(_1b 4){1371 return _1ae.collect(function(d){ 1372 return _1ad.getDate(d); 1373 }); 1374 } 1375 },findClickedElement:function(_1b0){ 1376 var _1b1=$(this.getScheduleContainerId()); 1377 var _1b2=Position.cumulativeOffset(_1b1); 1378 var _1b3=Position.realOffset(_1b1).last(); 1379 _1b3-=document.documentElement.scrollTop||document.body.scrollTop; 1380 var x=Event.pointerX(_1b0)-_1b2[0]; 1381 var y=Event.pointerY(_1b0)-_1b2[1]+_1b3; 1382 var _1b6=Math.floor(y/this.column.height); 1383 var _1b7=Math.floor(x/this.column.width); 1384 return $(this.calendarTable.rows[_1b6].cells[_1b7]); 1385 },multipleSelection:function(_1b8){ 1369 1386 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 1370 1387 return; 1371 1388 } 1372 1389 var self=this; 1373 var _1b 6=this.calendar;1374 var _1b 7=this.calendar.selectedBase;1375 this.abstractSelect(_1b 4,function(date,_1b9){1376 var _1b a=$(_1b7.id);1377 var _1b b=_1b6.createRange(parseInt(_1ba.id.getSuffix()),parseInt(_1b9.id.getSuffix()));1390 var _1ba=this.calendar; 1391 var _1bb=this.calendar.selectedBase; 1392 this.abstractSelect(_1b8,function(date,_1bd){ 1393 var _1be=$(_1bb.id); 1394 var _1bf=_1ba.createRange(parseInt(_1be.id.getSuffix()),parseInt(_1bd.id.getSuffix())); 1378 1395 self.iterateTable({doCell:function(cell){ 1379 1396 if(cell.tagName!="TD"||!cell.id){ … … 1381 1398 } 1382 1399 var id=parseInt(cell.id.getSuffix(),10); 1383 if(_1b b.include(id)){1384 _1b 6.addSelectedClass(cell);1385 }else{ 1386 _1b 6.removeSelectedClass(cell);1400 if(_1bf.include(id)){ 1401 _1ba.addSelectedClass(cell); 1402 }else{ 1403 _1ba.removeSelectedClass(cell); 1387 1404 } 1388 1405 }}); 1389 1406 }); 1390 1407 },iterateTable:function(){ 1391 var _1 be=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]);1392 var _1 bf=$(this.getCalendarTableId());1393 if(_1 be.doTable){1394 _1 be.doTable(_1bf);1395 } 1396 $A(_1 bf.rows).each(function(row){1397 if(_1 be.doRow){1398 _1 be.doRow(row);1408 var _1c2=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]); 1409 var _1c3=$(this.getCalendarTableId()); 1410 if(_1c2.doTable){ 1411 _1c2.doTable(_1c3); 1412 } 1413 $A(_1c3.rows).each(function(row){ 1414 if(_1c2.doRow){ 1415 _1c2.doRow(row); 1399 1416 } 1400 1417 $A(row.cells).each(function(cell){ 1401 if(_1 be.doCell){1402 _1 be.doCell(cell);1403 } 1404 }); 1405 }); 1406 },findRow:function(_1c 2){1407 var _1c 3=$(this.getCalendarTableId());1408 return $A(_1c 3.rows).detect(function(row){1409 return row.rowIndex==_1c 2;1410 }); 1411 },findCell:function(_1c 5,_1c6){1412 return $A(this.findRow(_1c 5).cells).detect(function(cell){1413 return cell.cellIndex==_1c 6;1418 if(_1c2.doCell){ 1419 _1c2.doCell(cell); 1420 } 1421 }); 1422 }); 1423 },findRow:function(_1c6){ 1424 var _1c7=$(this.getCalendarTableId()); 1425 return $A(_1c7.rows).detect(function(row){ 1426 return row.rowIndex==_1c6; 1427 }); 1428 },findCell:function(_1c9,_1ca){ 1429 return $A(this.findRow(_1c9).cells).detect(function(cell){ 1430 return cell.cellIndex==_1ca; 1414 1431 }); 1415 1432 },getDateId:function(date){ … … 1429 1446 return {cellIndex:cell.cellIndex,rowIndex:row.rowIndex}; 1430 1447 } 1431 },changeSchedule:function(_1 ce){1432 var _1 cf=_1ce.element;1433 var _1d 0=_1cf.schedule;1434 this.calendar.cacheSchedule(_1d 0);1435 var _1d 1=$(this.getSelectorId());1436 var top=parseInt(Element.getStyle(_1d 1,"top"),10);1437 var _1d 3=Math.floor(top/this.column.height);1438 var left=parseInt(Element.getStyle(_1d 1,"left"),10);1439 var _1d 5=Math.floor(left/this.column.width);1440 var _1d 6=$(this.getCalendarTableId());1441 var _1d 7=_1d6.rows.length-1;1442 var _1d 8=this.calendar.options.displayIndexes.length-1;1443 if((_1d 5>=0&&_1d3>=0)&&(_1d5<=_1d8&&_1d3<=_1d7)){1444 var cell=this.findCell(_1d 3,_1d5);1448 },changeSchedule:function(_1d2){ 1449 var _1d3=_1d2.element; 1450 var _1d4=_1d3.schedule; 1451 this.calendar.cacheSchedule(_1d4); 1452 var _1d5=$(this.getSelectorId()); 1453 var top=parseInt(Element.getStyle(_1d5,"top"),10); 1454 var _1d7=Math.floor(top/this.column.height); 1455 var left=parseInt(Element.getStyle(_1d5,"left"),10); 1456 var _1d9=Math.floor(left/this.column.width); 1457 var _1da=$(this.getCalendarTableId()); 1458 var _1db=_1da.rows.length-1; 1459 var _1dc=this.calendar.options.displayIndexes.length-1; 1460 if((_1d9>=0&&_1d7>=0)&&(_1d9<=_1dc&&_1d7<=_1db)){ 1461 var cell=this.findCell(_1d7,_1d9); 1445 1462 var date=new Date(this.calendar.date.getTime()); 1446 var _1d b=_1cf.cellDate.days()-DateUtil.toDate(_1d0.start).days();1447 date.setDate(parseInt(cell.id.getSuffix(),10)-_1d b);1448 var diff=this.getDayDiff(_1d 0);1449 var _1 dd=date.advance({days:diff});1450 if(_1d 0.start.month==date.getMonth()&&_1d0.start.day==date.getDate()&&_1d0.finish.month==_1dd.getMonth()&&_1d0.finish.day==_1dd.getDate()){1463 var _1df=_1d3.cellDate.days()-DateUtil.toDate(_1d4.start).days(); 1464 date.setDate(parseInt(cell.id.getSuffix(),10)-_1df); 1465 var diff=this.getDayDiff(_1d4); 1466 var _1e1=date.advance({days:diff}); 1467 if(_1d4.start.month==date.getMonth()&&_1d4.start.day==date.getDate()&&_1d4.finish.month==_1e1.getMonth()&&_1d4.finish.day==_1e1.getDate()){ 1451 1468 this.calendar.refreshSchedule(); 1452 1469 return; 1453 1470 } 1454 _1d 0.start.year=date.getFullYear();1455 _1d 0.start.month=date.getMonth();1456 _1d 0.start.day=date.getDate();1457 _1d 0.finish.year=_1dd.getFullYear();1458 _1d 0.finish.month=_1dd.getMonth();1459 _1d 0.finish.day=_1dd.getDate();1471 _1d4.start.year=date.getFullYear(); 1472 _1d4.start.month=date.getMonth(); 1473 _1d4.start.day=date.getDate(); 1474 _1d4.finish.year=_1e1.getFullYear(); 1475 _1d4.finish.month=_1e1.getMonth(); 1476 _1d4.finish.day=_1e1.getDate(); 1460 1477 var arr=this.calendar.options.schedules; 1461 var idx=arr.indexOf(_1d 0);1478 var idx=arr.indexOf(_1d4); 1462 1479 arr.remove(idx); 1463 var _1e 0=DateUtil.toDate(_1d0.start);1480 var _1e4=DateUtil.toDate(_1d4.start); 1464 1481 arr.each(function(s,i){ 1465 1482 idx=i; 1466 if(_1e 0<DateUtil.toDate(s.start)){1483 if(_1e4<DateUtil.toDate(s.start)){ 1467 1484 throw $break; 1468 1485 } 1469 1486 }); 1470 arr.insert(idx,_1d 0);1487 arr.insert(idx,_1d4); 1471 1488 this.calendar.refreshSchedule(); 1472 this.calendar.options.changeSchedule(_1d 0);1489 this.calendar.options.changeSchedule(_1d4); 1473 1490 }else{ 1474 1491 this.calendar.refreshSchedule(); 1475 1492 } 1476 },updateTirm:function(_1e 3){1477 var _1e 4=_1e3.schedule;1478 var _1e 5=parseInt(Element.getStyle(_1e3,"width"));1479 var top=parseInt(Element.getStyle(_1e 3,"top"));1480 var left=parseInt(Element.getStyle(_1e 3,"left"));1481 var _1e 8=Math.round((left+_1e5)/this.column.width)-1;1482 var _1e 9=Math.round(top/this.column.height);1483 var cell=this.findCell(_1e 9,_1e8);1484 var _1e b=_1e4.finish;1485 var _1 ec=null;1493 },updateTirm:function(_1e7){ 1494 var _1e8=_1e7.schedule; 1495 var _1e9=parseInt(Element.getStyle(_1e7,"width")); 1496 var top=parseInt(Element.getStyle(_1e7,"top")); 1497 var left=parseInt(Element.getStyle(_1e7,"left")); 1498 var _1ec=Math.round((left+_1e9)/this.column.width)-1; 1499 var _1ed=Math.round(top/this.column.height); 1500 var cell=this.findCell(_1ed,_1ec); 1501 var _1ef=_1e8.finish; 1502 var _1f0=null; 1486 1503 if(this.dateMap){ 1487 _1 ec=this.dateMap[cell.id].toHash();1488 }else{ 1489 _1 ec=new Date(this.calendar.date.getTime());1490 _1 ec.setDate(parseInt(cell.id.getSuffix(),10));1491 _1 ec=_1ec.toHash();1492 } 1493 _1 ec.hour=_1eb.hour;1494 _1 ec.min=_1eb.min;1495 if(DateUtil.toDate(_1e 4.start).getTime()>=DateUtil.toDate(_1ec).getTime()){1496 var _1 ed=23;1497 var _1 ee=55;1498 if(_1e 4.start.hour==_1ed&&_1e4.start.min==_1ee){1504 _1f0=this.dateMap[cell.id].toHash(); 1505 }else{ 1506 _1f0=new Date(this.calendar.date.getTime()); 1507 _1f0.setDate(parseInt(cell.id.getSuffix(),10)); 1508 _1f0=_1f0.toHash(); 1509 } 1510 _1f0.hour=_1ef.hour; 1511 _1f0.min=_1ef.min; 1512 if(DateUtil.toDate(_1e8.start).getTime()>=DateUtil.toDate(_1f0).getTime()){ 1513 var _1f1=23; 1514 var _1f2=55; 1515 if(_1e8.start.hour==_1f1&&_1e8.start.min==_1f2){ 1499 1516 this.calendar.refreshSchedule(); 1500 if(!((_1 ec.year==_1eb.year)&&(_1ec.month==_1eb.month)&&(_1ec.day==_1eb.day))){1517 if(!((_1f0.year==_1ef.year)&&(_1f0.month==_1ef.month)&&(_1f0.day==_1ef.day))){ 1501 1518 this.calendar.options.updateTirm(); 1502 1519 } 1503 1520 return; 1504 1521 }else{ 1505 _1 ec.hour=_1ed;1506 _1 ec.min=_1ee;1507 } 1508 } 1509 _1e 4.finish=_1ec;1522 _1f0.hour=_1f1; 1523 _1f0.min=_1f2; 1524 } 1525 } 1526 _1e8.finish=_1f0; 1510 1527 this.calendar.refreshSchedule(); 1511 if(!((_1 ec.year==_1eb.year)&&(_1ec.month==_1eb.month)&&(_1ec.day==_1eb.day))){1512 this.calendar.options.updateTirm(_1e 4);1513 } 1514 },getTimeText:function(_1 ef,_1f0){1515 var _1f 1=this.calendar;1516 return _1f 1.formatTime(_1ef);1517 },getDayDiff:function(_1f 2){1518 return DateUtil.numberOfDays(this.toDate(_1f 2.start),this.toDate(_1f2.finish));1528 if(!((_1f0.year==_1ef.year)&&(_1f0.month==_1ef.month)&&(_1f0.day==_1ef.day))){ 1529 this.calendar.options.updateTirm(_1e8); 1530 } 1531 },getTimeText:function(_1f3,_1f4){ 1532 var _1f5=this.calendar; 1533 return _1f5.formatTime(_1f3); 1534 },getDayDiff:function(_1f6){ 1535 return DateUtil.numberOfDays(this.toDate(_1f6.start),this.toDate(_1f6.finish)); 1519 1536 }}); 1520 1537 var CalendarWeek=Class.create(); 1521 1538 CalendarWeek.id=["calTable","columnContainer","columnHeader","column","next","pre","headerText"]; 1522 1539 Object.extend(CalendarWeek.prototype,AbstractCalendar.prototype); 1523 Object.extend(CalendarWeek.prototype,{initialize:function(_1f 3){1524 this.calendar=_1f 3;1525 var _1f 4=this.getWeek();1526 this.week=_1f 4[0];1527 this.invisibleWeek=_1f 4[1];1540 Object.extend(CalendarWeek.prototype,{initialize:function(_1f7){ 1541 this.calendar=_1f7; 1542 var _1f8=this.getWeek(); 1543 this.week=_1f8[0]; 1544 this.invisibleWeek=_1f8[1]; 1528 1545 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 1529 1546 this.setDisplayTime(); 1530 1547 },buildHeaderLeft:function(){ 1548 if(this.calendar.options.useImgMark){ 1531 1549 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.pre+"' class='"+this.calendar.classNames.preWeekMark+"'></div>"+"</td>"; 1550 } 1551 return "<td class='"+this.calendar.classNames.preYears2+"'>"+"<div id='"+this.ids.pre+"' class='"+this.calendar.classNames.preWeekMark2+"'><a href=\"javascript:void(0)\">"+this.preMarkChars()+"</a></div>"+"</td>"; 1532 1552 },buildHeaderCenter:function(){ 1533 var _1f 5=[];1553 var _1f9=[]; 1534 1554 if(this.calendar.options.weekHeaderFormat){ 1535 _1f 5=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())];1536 } 1537 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f 5[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f5[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f5[2]||this.week.last().toDateString())+"</span>"+"</td>";1555 _1f9=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())]; 1556 } 1557 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f9[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f9[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f9[2]||this.week.last().toDateString())+"</span>"+"</td>"; 1538 1558 },formatHeaderDate:function(date){ 1539 1559 if(this.calendar.options.weekHeaderFormat){ … … 1542 1562 return []; 1543 1563 },buildHeaderRight:function(){ 1564 if(this.calendar.options.useImgMark){ 1544 1565 return "<td class='"+this.calendar.classNames.nextYears+"' align='right'>"+"<div id='"+this.ids.next+"' class='"+this.calendar.classNames.nextWeekMark+"'></div>"+"</td>"; 1566 } 1567 return "<td class='"+this.calendar.classNames.nextYears2+"' align='right'>"+"<div id='"+this.ids.next+"' class='"+this.calendar.classNames.nextWeekMark2+"'><a href=\"javascript:void(0)\">"+this.nextMarkChars()+"</a></div>"+"</td>"; 1568 },preMarkChars:function(){ 1569 return Calendar.marks.preWeek; 1570 },nextMarkChars:function(){ 1571 return Calendar.marks.nextWeek; 1545 1572 },buildCalendar:function(){ 1546 var _1f 7=(this.calendar.options.displayTimeLine)?this.buildTimeLine():"";1547 _1f 7+=this.buildCalendarContainer();1548 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1f 7+"</tr>"+"</table>";1573 var _1fb=(this.calendar.options.displayTimeLine)?this.buildTimeLine():""; 1574 _1fb+=this.buildCalendarContainer(); 1575 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1fb+"</tr>"+"</table>"; 1549 1576 },buildTimeLine:function(){ 1550 1577 var time=new Date(); 1551 var hour=0,_1f a=24;1578 var hour=0,_1fe=24; 1552 1579 time.setHours(hour); 1553 1580 time.setMinutes(0); 1554 var _1f b=this.buildTimeLineTop();1581 var _1ff=this.buildTimeLineTop(); 1555 1582 var now=new Date().getHours(); 1556 while(hour<_1f a){1583 while(hour<_1fe){ 1557 1584 if(this.includeDisplayTime(hour)){ 1558 var _ 1fd="pointer: default;";1559 if(_1f b.length==0){1560 _ 1fd+="border-top: none;";1561 } 1562 var _ 1fe=this.calendar.classNames.timeLineTime;1585 var _201="pointer: default;"; 1586 if(_1ff.length==0){ 1587 _201+="border-top: none;"; 1588 } 1589 var _202=this.calendar.classNames.timeLineTime; 1563 1590 if(hour==now){ 1564 _ 1fe+=" "+this.calendar.classNames.highlightTime;1565 } 1566 _1f b+="<div class='"+_1fe+"' style='"+_1fd+"'>"+this.formatTime(time)+"</div>";1591 _202+=" "+this.calendar.classNames.highlightTime; 1592 } 1593 _1ff+="<div class='"+_202+"' style='"+_201+"'>"+this.formatTime(time)+"</div>"; 1567 1594 } 1568 1595 hour++; 1569 1596 time.setHours(hour); 1570 1597 } 1571 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1f b+"</td>";1598 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1ff+"</td>"; 1572 1599 },buildTimeLineTop:function(){ 1573 1600 return "<div class='"+this.calendar.classNames.timeLineTimeTop+"'></div>"; … … 1575 1602 return "<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+this.buildCalendarHeader()+this.buildCalendarMain()+"</table>"+"</td>"; 1576 1603 },buildCalendarHeader:function(){ 1577 var _ 1ff=this.calendar.options.displayIndexes;1604 var _203=this.calendar.options.displayIndexes; 1578 1605 var ths=""; 1579 var _20 1=new Date().days();1580 var _20 2=100/_1ff.length+"%";1581 var _20 3=this.calendar.element.id.appendSuffix(this.ids.column);1582 var _20 4=this.calendar.element.id.appendSuffix(this.ids.headerText);1606 var _205=new Date().days(); 1607 var _206=100/_203.length+"%"; 1608 var _207=this.calendar.element.id.appendSuffix(this.ids.column); 1609 var _208=this.calendar.element.id.appendSuffix(this.ids.headerText); 1583 1610 this.headers=[]; 1584 var _20 5=this.calendar.options.noEvent;1585 var _20 6=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null;1586 this.week.each(function(w,_20 8){1611 var _209=this.calendar.options.noEvent; 1612 var _20a=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null; 1613 this.week.each(function(w,_20c){ 1587 1614 var text=null; 1588 if(_20 6){1589 text=_20 6.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]});1615 if(_20a){ 1616 text=_20a.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]}); 1590 1617 }else{ 1591 1618 text=w.toDateString().split(" "); … … 1593 1620 text=text.join(" "); 1594 1621 } 1595 var _20 a=(w.days()==_201)?this.calendar.classNames.highlightDay:"";1596 var _20 b=_204.appendSuffix(_208);1622 var _20e=(w.days()==_205)?this.calendar.classNames.highlightDay:""; 1623 var _20f=_208.appendSuffix(_20c); 1597 1624 var node="<div class='"+this.calendar.classNames.headerColumn+"'>"; 1598 if(_20 5){1599 node+="<span='#' id='"+_20 b+"' class='"+_20a+"' style='cursor: default;'>"+text+"</a>";1600 }else{ 1601 node+="<a href='#' id='"+_20 b+"' class='"+_20a+"'>"+text+"</a>";1625 if(_209){ 1626 node+="<span='#' id='"+_20f+"' class='"+_20e+"' style='cursor: default;'>"+text+"</a>"; 1627 }else{ 1628 node+="<a href='#' id='"+_20f+"' class='"+_20e+"'>"+text+"</a>"; 1602 1629 } 1603 1630 node+="</div>"; 1604 this.headers.push({id:_20 b,wday:w});1605 ths+="<th id='"+_20 3.appendSuffix(_208)+"' width='"+_202+"'>"+node+"</th>";1631 this.headers.push({id:_20f,wday:w}); 1632 ths+="<th id='"+_207.appendSuffix(_20c)+"' width='"+_206+"'>"+node+"</th>"; 1606 1633 }.bind(this)); 1607 1634 return "<tr>"+"<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+"<tr>"+ths+"</tr>"+"</table>"+"</td>"+"</tr>"; 1608 1635 },buildCalendarMain:function(){ 1609 var _2 0d=this.calendar.options.displayIndexes;1636 var _211=this.calendar.options.displayIndexes; 1610 1637 var tds=""; 1611 var _2 0f=100/_20d.length+"%";1638 var _213=100/_211.length+"%"; 1612 1639 this.dateMap={}; 1613 this.week.each(function(w,_21 1){1614 var _21 2=this.calendar.options.schedules[w.toDateString()];1615 var _21 3="";1640 this.week.each(function(w,_215){ 1641 var _216=this.calendar.options.schedules[w.toDateString()]; 1642 var _217=""; 1616 1643 var i=0,j=0; 1617 1644 while(i<24){ 1618 1645 if(this.includeDisplayTime(i)){ 1619 var _21 6="";1620 if(_21 3.length==0){1621 _21 6=this.calendar.classNames.columnTopDate;1646 var _21a=""; 1647 if(_217.length==0){ 1648 _21a=this.calendar.classNames.columnTopDate; 1622 1649 }else{ 1623 1650 if(i%1==0){ 1624 _21 6=this.calendar.classNames.columnDate;1625 }else{ 1626 _21 6=this.calendar.classNames.columnDateOdd;1627 } 1628 } 1629 var id=this.getDateId(w,i,_21 1);1651 _21a=this.calendar.classNames.columnDate; 1652 }else{ 1653 _21a=this.calendar.classNames.columnDateOdd; 1654 } 1655 } 1656 var id=this.getDateId(w,i,_215); 1630 1657 var hour=i/1; 1631 1658 var min=i%1*60; 1632 1659 this.dateMap[id]=new Date(w.getFullYear(),w.getMonth(),w.getDate(),hour,min,0); 1633 _21 3+="<div id='"+id+"' class='"+_216+"'></div>";1660 _217+="<div id='"+id+"' class='"+_21a+"'></div>"; 1634 1661 } 1635 1662 i+=0.5; 1636 1663 } 1637 tds+="<td width='"+_2 0f+"'>"+_213+"</td>";1664 tds+="<td width='"+_213+"'>"+_217+"</td>"; 1638 1665 }.bind(this)); 1639 1666 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>"; … … 1643 1670 var rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.columnDate); 1644 1671 this.column.height=parseInt(rule.style["height"],10)+1; 1645 },buildSchedule:function(_2 1c){1646 var id="scheduleItem_"+_2 1c.id;1647 var _2 1e=(_21c.edit==undefined||_21c.edit);1672 },buildSchedule:function(_220){ 1673 var id="scheduleItem_"+_220.id; 1674 var _222=(_220.edit==undefined||_220.edit); 1648 1675 var item=Builder.node("DIV",{id:id}); 1649 1676 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 1650 var _22 0=this.calendar.options.noEvent;1651 var term=DateUtil.toDate(_2 1c.finish).minutes()-DateUtil.toDate(_21c.start).minutes();1652 var _22 2={};1653 if(_2 1c.background_color){1654 _22 2.backgroundColor=_21c.background_color;1655 } 1656 if(_2 1c.frame_color){1657 _22 2.borderTop="2px solid "+_21c.frame_color;1658 _22 2.borderLeft="1px solid "+_21c.frame_color;1659 _22 2.borderRight="1px solid "+_21c.frame_color;1660 _22 2.borderBottom="2px solid "+_21c.frame_color;1677 var _224=this.calendar.options.noEvent; 1678 var term=DateUtil.toDate(_220.finish).minutes()-DateUtil.toDate(_220.start).minutes(); 1679 var _226={}; 1680 if(_220.background_color){ 1681 _226.backgroundColor=_220.background_color; 1682 } 1683 if(_220.frame_color){ 1684 _226.borderTop="2px solid "+_220.frame_color; 1685 _226.borderLeft="1px solid "+_220.frame_color; 1686 _226.borderRight="1px solid "+_220.frame_color; 1687 _226.borderBottom="2px solid "+_220.frame_color; 1661 1688 if(term<=30){ 1662 _22 2.backgroundColor=_21c.frame_color;1663 } 1664 } 1665 if(_22 0){1666 _22 2.cursor="default";1667 } 1668 Element.setStyle(item,_22 2);1669 var _22 3=[];1670 if(_2 1e){1671 var _22 4=Builder.node("DIV",{id:"scheduleDeleteImg_"+_21c.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"});1672 _22 3.push(_224);1673 item.appendChild(_22 4);1674 if(!_22 0){1675 Event.observe(_22 4,"click",this.clickDeleteImage.bind(this,_21c));1676 } 1677 } 1678 if(!_22 0&&this.calendar.options.dblclickSchedule){1679 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_2 1c));1689 _226.backgroundColor=_220.frame_color; 1690 } 1691 } 1692 if(_224){ 1693 _226.cursor="default"; 1694 } 1695 Element.setStyle(item,_226); 1696 var _227=[]; 1697 if(_222){ 1698 var _228=Builder.node("DIV",{id:"scheduleDeleteImg_"+_220.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"}); 1699 _227.push(_228); 1700 item.appendChild(_228); 1701 if(!_224){ 1702 Event.observe(_228,"click",this.clickDeleteImage.bind(this,_220)); 1703 } 1704 } 1705 if(!_224&&this.calendar.options.dblclickSchedule){ 1706 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_220)); 1680 1707 } 1681 1708 var icon=null; 1682 if(_2 1c.icon){1683 icon=Builder.node("IMG",{src:_2 1c.icon,alt:"icon",style:"float: left;",width:16,height:16});1709 if(_220.icon){ 1710 icon=Builder.node("IMG",{src:_220.icon,alt:_220.type_name,style:"float: left;",width:16,height:16}); 1684 1711 }else{ 1685 1712 if(Calendar.defaultIconPath){ 1686 icon=Builder.node("IMG",{src:Calendar.defaultIconPath,alt: "icon",style:"float: left;",width:16,height:16});1687 } 1688 } 1689 var _22 6=null;1690 if(!_2 1c.publicity){1713 icon=Builder.node("IMG",{src:Calendar.defaultIconPath,alt:_220.type_name,style:"float: left;",width:16,height:16}); 1714 } 1715 } 1716 var _22a=null; 1717 if(!_220.publicity){ 1691 1718 if(Calendar.privateImgPath){ 1692 _22 6=Builder.node("IMG",{id:"private_img_"+_21c.id,src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16});1693 item.appendChild(_22 6);1694 }else{ 1695 _22 6=Builder.node("DIV",{id:"private_img_"+_21c.id});1696 this.calendar.css.addClassNames(_22 6,"privateImg");1697 item.appendChild(_22 6);1698 } 1699 } 1700 if(!_22 0&&(_223.length>0)){1701 Event.observe(item,"mouseover",this.showImage.bind(this,_22 3,_226));1702 Event.observe(item,"mouseout",this.hideImage.bind(this,_22 3,_226));1703 } 1704 var text=this.getTimeText(_2 1c.start,_21c.finish);1705 var _22 8=_21c.description.unescapeHTML();1706 var _22 9={id:id+"_text"};1707 if(_2 1c.frame_color){1708 _22 9.style="background-color:"+_21c.frame_color+";";1709 } 1710 if(!_22 0&&_21e){1711 _22 9.style+="cursor: move;";1719 _22a=Builder.node("IMG",{id:"private_img_"+_220.id,src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16}); 1720 item.appendChild(_22a); 1721 }else{ 1722 _22a=Builder.node("DIV",{id:"private_img_"+_220.id}); 1723 this.calendar.css.addClassNames(_22a,"privateImg"); 1724 item.appendChild(_22a); 1725 } 1726 } 1727 if(!_224&&(_227.length>0)){ 1728 Event.observe(item,"mouseover",this.showImage.bind(this,_227,_22a)); 1729 Event.observe(item,"mouseout",this.hideImage.bind(this,_227,_22a)); 1730 } 1731 var text=this.getTimeText(_220.start,_220.finish); 1732 var _22c=_220.description.unescapeHTML(); 1733 var _22d={id:id+"_text"}; 1734 if(_220.frame_color){ 1735 _22d.style="background-color:"+_220.frame_color+";"; 1736 } 1737 if(!_224&&_222){ 1738 _22d.style+="cursor: move;"; 1712 1739 } 1713 1740 if(term<=15){ 1714 var _22 a=this.calendar.formatTime(_21c.start);1715 _22 9.style+="line-height: 12px;";1741 var _22e=this.calendar.formatTime(_220.start); 1742 _22d.style+="line-height: 12px;"; 1716 1743 if(UserAgent.isFF()){ 1717 _22 9.style+="white-space: nowrap;";1718 } 1719 var _22 b=Builder.node("DIV",_229,[icon,_22a+" "+_228]);1720 this.calendar.css.addClassNames(_22 b,"scheduleTimeArea");1721 item.appendChild(_22 b);1744 _22d.style+="white-space: nowrap;"; 1745 } 1746 var _22f=Builder.node("DIV",_22d,[icon,_22e+" "+_22c]); 1747 this.calendar.css.addClassNames(_22f,"scheduleTimeArea"); 1748 item.appendChild(_22f); 1722 1749 }else{ 1723 1750 if(term<=30){ 1724 var _22 a=this.calendar.formatTime(_21c.start);1751 var _22e=this.calendar.formatTime(_220.start); 1725 1752 if(UserAgent.isIE()){ 1726 _22 9.style+="line-height: 20px;";1727 }else{ 1728 _22 9.style+="line-height: 18px; white-space: nowrap;";1729 } 1730 var _22 b=Builder.node("DIV",_229,[icon,_22a+" "+_228]);1731 this.calendar.css.addClassNames(_22 b,"scheduleTimeArea");1732 item.appendChild(_22 b);1733 }else{ 1734 _22 9.style+="line-height: 18px;";1735 var _22 b=Builder.node("DIV",_229,[icon,text]);1736 this.calendar.css.addClassNames(_22 b,"scheduleTimeArea");1737 item.appendChild(_22 b);1738 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_22 8]));1739 } 1740 } 1741 item.title=text.replace(/ /g,"")+" "+_22 8;1742 item.schedule=_2 1c;1743 return [item,_22 b];1744 },adjustScheduleStyle:function(item,_2 2d,_22e){1745 var _2 2f=item.schedule;1746 var time=this.convertHours(_2 2f);1747 var _23 1=time[0];1748 var _23 2=time[1];1753 _22d.style+="line-height: 20px;"; 1754 }else{ 1755 _22d.style+="line-height: 18px; white-space: nowrap;"; 1756 } 1757 var _22f=Builder.node("DIV",_22d,[icon,_22e+" "+_22c]); 1758 this.calendar.css.addClassNames(_22f,"scheduleTimeArea"); 1759 item.appendChild(_22f); 1760 }else{ 1761 _22d.style+="line-height: 18px;"; 1762 var _22f=Builder.node("DIV",_22d,[icon,text]); 1763 this.calendar.css.addClassNames(_22f,"scheduleTimeArea"); 1764 item.appendChild(_22f); 1765 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_22c])); 1766 } 1767 } 1768 item.title=text.replace(/ /g,"")+" "+_220.popup.unescapeHTML()+"\n "+_220.popup2.unescapeHTML()+"\n "+_220.popup3.unescapeHTML(); 1769 item.schedule=_220; 1770 return [item,_22f]; 1771 },adjustScheduleStyle:function(item,_231,_232){ 1772 var _233=item.schedule; 1773 var time=this.convertHours(_233); 1774 var _235=time[0]; 1775 var _236=time[1]; 1749 1776 var same=[]; 1750 1777 var self=this; 1751 if(!_2 2e.sames){1752 _2 2e.sames=[];1753 } 1754 _2 2e.each(function(h){1755 var _23 6=self.convertHours(h.schedule);1756 var _23 7=_236[0];1757 var _23 8=_236[1];1758 if(((_23 7<=_231)&&(_238>_231))||((_237<_232)&&(_238>=_232))||((_231<=_237)&&(_232>_237))||((_231<_238)&&(_232>=_238))){1778 if(!_232.sames){ 1779 _232.sames=[]; 1780 } 1781 _232.each(function(h){ 1782 var _23a=self.convertHours(h.schedule); 1783 var _23b=_23a[0]; 1784 var _23c=_23a[1]; 1785 if(((_23b<=_235)&&(_23c>_235))||((_23b<_236)&&(_23c>=_236))||((_235<=_23b)&&(_236>_23b))||((_235<_23c)&&(_236>=_23c))){ 1759 1786 same.push(h); 1760 1787 } 1761 1788 }); 1762 var _23 9=_22d*this.getAdjustSize();1789 var _23d=_231*this.getAdjustSize(); 1763 1790 if(UserAgent.isIE()||this.calendar.options.noEvent){ 1764 _23 9+=1;1765 } 1766 var left=this.column.width*_2 2d+_239;1791 _23d+=1; 1792 } 1793 var left=this.column.width*_231+_23d; 1767 1794 if(same.length==0){ 1768 1795 Element.setStyle(item,{left:left+"px"}); 1769 1796 }else{ 1770 var _23 b=false;1771 _2 2e.sames.each(function(_23c){1772 if(_23 b){1797 var _23f=false; 1798 _232.sames.each(function(_240){ 1799 if(_23f){ 1773 1800 throw $break; 1774 1801 } 1775 1802 same.each(function(s){ 1776 if(_2 3c.include(s)){1777 same=_2 3c;1778 _23 b=true;1803 if(_240.include(s)){ 1804 same=_240; 1805 _23f=true; 1779 1806 throw $break; 1780 1807 } … … 1782 1809 }); 1783 1810 same.push(item); 1784 var _2 3e=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1;1811 var _242=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 1785 1812 same.each(function(s,i){ 1786 var _24 1=left+_23e*i+(2*i);1787 Element.setStyle(s,{width:_2 3e+"px",left:_241+"px"});1788 }); 1789 if(!_23 b){1790 _2 2e.sames.push(same);1813 var _245=left+_242*i+(2*i); 1814 Element.setStyle(s,{width:_242+"px",left:_245+"px"}); 1815 }); 1816 if(!_23f){ 1817 _232.sames.push(same); 1791 1818 } 1792 1819 } 1793 1820 return left; 1794 1821 },setScheduleBaseStyle:function(item){ 1795 var _24 3=item.schedule;1796 if(!this.calendar.isSameDate(_24 3.start,_243.finish)){1797 _24 3.finish.hour=24;1798 _24 3.finish.min=0;1799 } 1800 var time=this.convertHours(_24 3);1801 var _24 5=time.first();1802 var _24 6=time.last();1803 var _24 7=this.column.height*2;1804 var diff=this.calendar.getTimeDiff(_24 3.start,_243.finish);1822 var _247=item.schedule; 1823 if(!this.calendar.isSameDate(_247.start,_247.finish)){ 1824 _247.finish.hour=24; 1825 _247.finish.min=0; 1826 } 1827 var time=this.convertHours(_247); 1828 var _249=time.first(); 1829 var _24a=time.last(); 1830 var _24b=this.column.height*2; 1831 var diff=this.calendar.getTimeDiff(_247.start,_247.finish); 1805 1832 var rate=(diff.hour+(diff.min/60))||1; 1806 1833 var over=0; 1807 1834 var top=0; 1808 var _2 4c=0;1809 var _2 4d=this.includeDisplayTime(_245);1810 var _2 4e=this.includeDisplayTime(_246,true);1811 if(!_2 4d&&!_24e){1812 if((this.startTime<=_24 5&&this.startTime<=_246)||(_245<this.finishTime&&_246<this.finishTime)){1813 top=_2 4c=0;1835 var _250=0; 1836 var _251=this.includeDisplayTime(_249); 1837 var _252=this.includeDisplayTime(_24a,true); 1838 if(!_251&&!_252){ 1839 if((this.startTime<=_249&&this.startTime<=_24a)||(_249<this.finishTime&&_24a<this.finishTime)){ 1840 top=_250=0; 1814 1841 Element.hide(item); 1815 1842 this.hasInvisibleSchedule=true; 1816 1843 }else{ 1817 1844 top=0; 1818 _2 4c=_247*(this.finishTime-this.startTime)-3;1819 } 1820 }else{ 1821 if(_2 4d){1822 top=_24 7*(_245-this.startTime);1823 _2 4c=_247*rate-3;1845 _250=_24b*(this.finishTime-this.startTime)-3; 1846 } 1847 }else{ 1848 if(_251){ 1849 top=_24b*(_249-this.startTime); 1850 _250=_24b*rate-3; 1824 1851 }else{ 1825 1852 top=0; 1826 over=this.startTime-_24 5;1827 _2 4c=_247*(rate-over);1828 } 1829 if(_2 4e){1830 }else{ 1831 over=_24 6-this.finishTime;1832 _2 4c-=_247*over;1853 over=this.startTime-_249; 1854 _250=_24b*(rate-over); 1855 } 1856 if(_252){ 1857 }else{ 1858 over=_24a-this.finishTime; 1859 _250-=_24b*over; 1833 1860 } 1834 1861 } 1835 1862 try{ 1836 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_2 4c+"px"});1863 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_250+"px"}); 1837 1864 } 1838 1865 catch(e){ … … 1846 1873 this.setCover(); 1847 1874 var self=this; 1848 var _25 0=$(this.getScheduleContainerId());1849 var _25 1=this.getDragDistance();1875 var _254=$(this.getScheduleContainerId()); 1876 var _255=this.getDragDistance(); 1850 1877 this.scheduleNodes=[]; 1851 var _25 2=this.week.map(function(){1878 var _256=this.week.map(function(){ 1852 1879 return []; 1853 1880 }); 1854 var _25 3=this.week.legth-1;1855 var _25 4=this.calendar.options.noEvent;1856 this.calendar.options.schedules.each(function(_25 5){1857 var _25 6=[];1858 var sub,_25 8,_259=null;1859 self.week.each(function(date,_25 b){1860 if(self.calendar.betweenDate(_25 5,date)){1861 if(self.isSameStartDate(_25 5,date)&&self.isSameFinishDate(_255,date)){1862 _25 9=self.setSchedule(_255,_25b,_252,_250,_251);1863 _25 9.cellDate=date;1864 _25 6.push(_259);1865 }else{ 1866 sub=self.copyOneDaySchedule(_25 5,date);1881 var _257=this.week.legth-1; 1882 var _258=this.calendar.options.noEvent; 1883 this.calendar.options.schedules.each(function(_259){ 1884 var _25a=[]; 1885 var sub,_25c,_25d=null; 1886 self.week.each(function(date,_25f){ 1887 if(self.calendar.betweenDate(_259,date)){ 1888 if(self.isSameStartDate(_259,date)&&self.isSameFinishDate(_259,date)){ 1889 _25d=self.setSchedule(_259,_25f,_256,_254,_255); 1890 _25d.cellDate=date; 1891 _25a.push(_25d); 1892 }else{ 1893 sub=self.copyOneDaySchedule(_259,date); 1867 1894 if(sub.finish.hour==0&&sub.finish.min==0){ 1868 1895 throw $continue; 1869 1896 } 1870 _25 8=self.setSchedule(sub,_25b,_252,_250,_251);1871 _25 8.originalSchedule=_255;1872 _25 8.cellDate=date;1873 _25 6.push(_258);1897 _25c=self.setSchedule(sub,_25f,_256,_254,_255); 1898 _25c.originalSchedule=_259; 1899 _25c.cellDate=date; 1900 _25a.push(_25c); 1874 1901 } 1875 1902 }else{ … … 1881 1908 if(!self.hasInvisibleSchedule){ 1882 1909 (self.invisibleWeek||[]).each(function(date){ 1883 if(self.calendar.betweenDate(_25 5,date)){1910 if(self.calendar.betweenDate(_259,date)){ 1884 1911 self.hasInvisibleSchedule=true; 1885 1912 throw $break; … … 1887 1914 }); 1888 1915 } 1889 if(!_25 4){1890 _25 6.each(function(item){1891 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_25 6));1892 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_25 6));1893 }); 1894 } 1895 if(!self.hasInvisibleSchedule&&(_25 6.length==0)){1916 if(!_258){ 1917 _25a.each(function(item){ 1918 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_25a)); 1919 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_25a)); 1920 }); 1921 } 1922 if(!self.hasInvisibleSchedule&&(_25a.length==0)){ 1896 1923 self.hasInvisibleSchedule=true; 1897 1924 } … … 1902 1929 Event.observe(this.ids.pre,"click",this.calendar.changeCalendar.bindAsEventListener(this.calendar)); 1903 1930 Event.observe(this.ids.next,"click",this.calendar.changeCalendar.bindAsEventListener(this.calendar)); 1931 if(this.calendar.options.useImgMark){ 1904 1932 new Hover(this.ids.pre); 1905 1933 new Hover(this.ids.next); 1906 var _25e=this.calendar.options.clickDateText||this.clickDateText; 1934 } 1935 var _262=this.calendar.options.clickDateText||this.clickDateText; 1907 1936 if(this.headers){ 1908 this.headers.each(function(_2 5f){1909 Event.observe(_2 5f.id,"mousedown",_25e.bindAsEventListener(this,_25f.wday));1937 this.headers.each(function(_263){ 1938 Event.observe(_263.id,"mousedown",_262.bindAsEventListener(this,_263.wday)); 1910 1939 }.bind(this)); 1911 1940 } 1912 1941 } 1913 },copyOneDaySchedule:function(_26 0,date){1942 },copyOneDaySchedule:function(_264,date){ 1914 1943 var sub=null; 1915 if(this.isSameStartDate(_26 0,date)){1916 sub=this.copySchedule(_26 0,date);1944 if(this.isSameStartDate(_264,date)){ 1945 sub=this.copySchedule(_264,date); 1917 1946 sub.finish.hour=24; 1918 1947 sub.finish.min=0; 1919 1948 }else{ 1920 if(this.isSameFinishDate(_26 0,date)){1921 sub=this.copySchedule(_26 0,date);1949 if(this.isSameFinishDate(_264,date)){ 1950 sub=this.copySchedule(_264,date); 1922 1951 sub.start.hour=0; 1923 1952 sub.start.min=0; 1924 1953 }else{ 1925 sub=this.copySchedule(_26 0,date);1954 sub=this.copySchedule(_264,date); 1926 1955 sub.start.hour=0; 1927 1956 sub.start.min=0; … … 1931 1960 } 1932 1961 return sub; 1933 },copySchedule:function(_26 3,date){1934 sub=Object.extend({},_26 3);1935 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_26 3.start.hour,min:_263.start.min};1936 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_26 3.finish.hour,min:_263.finish.min};1962 },copySchedule:function(_267,date){ 1963 sub=Object.extend({},_267); 1964 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_267.start.hour,min:_267.start.min}; 1965 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_267.finish.hour,min:_267.finish.min}; 1937 1966 return sub; 1938 },setSchedule:function(_26 5,_266,_267,_268,_269){1939 var _26 a=this.buildSchedule(_265);1940 var item=_26 a.first();1941 _26 8.appendChild(item);1967 },setSchedule:function(_269,_26a,_26b,_26c,_26d){ 1968 var _26e=this.buildSchedule(_269); 1969 var item=_26e.first(); 1970 _26c.appendChild(item); 1942 1971 this.setScheduleBaseStyle(item); 1943 var left=this.adjustScheduleStyle(item,_26 6,_267[_266]);1944 var _2 6d=_266*this.getAdjustSize();1945 var _2 6e=this.column.width+_26d+"px";1946 if(!this.calendar.options.noEvent&&((_26 5.edit==undefined)||_265.edit)){1947 this.setDraggable(item,_26 a.last(),_268,_269);1972 var left=this.adjustScheduleStyle(item,_26a,_26b[_26a]); 1973 var _271=_26a*this.getAdjustSize(); 1974 var _272=this.column.width+_271+"px"; 1975 if(!this.calendar.options.noEvent&&((_269.edit==undefined)||_269.edit)){ 1976 this.setDraggable(item,_26e.last(),_26c,_26d); 1948 1977 this.setResize(item); 1949 1978 } 1950 _26 7[_266].push(item);1979 _26b[_26a].push(item); 1951 1980 this.scheduleNodes.push(item); 1952 1981 return item; 1953 1982 },getDragDistance:function(){ 1954 var _2 6f=this.getAdjustSize();1955 return [this.column.width+_2 6f,this.column.height/2];1956 },setDraggable:function(item,_27 1,_272,_273){1983 var _273=this.getAdjustSize(); 1984 return [this.column.width+_273,this.column.height/2]; 1985 },setDraggable:function(item,_275,_276,_277){ 1957 1986 var self=this; 1958 new Draggable(item,{handle:_27 1,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_277){1959 var _27 8=Element.getDimensions(item);1960 var _27 9=Element.getDimensions(_272);1961 var _27 a=(self.column.height/2);1962 var _27 b=_277.offset;1963 x=Math.floor((x+_27 b[0])/_273[0])*_273[0];1964 y=Math.round((y)/_27 3[1])*_273[1];1965 xy=[self._constrain(x,0,_27 9.width-_278.width),self._constrain(y,0-(_278.height-_27a),_279.height-_27a)];1987 new Draggable(item,{handle:_275,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_27b){ 1988 var _27c=Element.getDimensions(item); 1989 var _27d=Element.getDimensions(_276); 1990 var _27e=(self.column.height/2); 1991 var _27f=_27b.offset; 1992 x=Math.floor((x+_27f[0])/_277[0])*_277[0]; 1993 y=Math.round((y)/_277[1])*_277[1]; 1994 xy=[self._constrain(x,0,_27d.width-_27c.width),self._constrain(y,0-(_27c.height-_27e),_27d.height-_27e)]; 1966 1995 return xy; 1967 },onEnd:function(_27c,_27d){ 1968 self.changeSchedule(_27c,_27d); 1969 },change:function(_27e){ 1970 self.changeTimeDisplay(_27e.element); 1996 },onEnd:function(_280,_281){ 1997 if(_280.element.moved){ 1998 self.changeSchedule(_280,_281); 1999 }else{ 2000 self.calendar.refreshSchedule(); 2001 } 2002 },change:function(_282){ 2003 if(self.calendar.isMovedScheduler(_282)){ 2004 _282.element.moved=true; 2005 self.changeTimeDisplay(_282.element); 2006 } 1971 2007 }}); 1972 2008 },setResize:function(item){ 1973 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_28 0){1974 this.updateTirm(_28 0);1975 }.bind(this),change:function(_28 1){1976 this.changeTimeDisplay(_28 1);2009 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_284){ 2010 this.updateTirm(_284); 2011 }.bind(this),change:function(_285){ 2012 this.changeTimeDisplay(_285); 1977 2013 }.bind(this)}); 1978 },getDate:function(_28 2){1979 return _28 2.date;1980 },abstractSelect:function(_28 3,_284){1981 var _28 5=this.findClickedElement(_283);1982 if(_28 5){1983 if(Element.hasClassName(_28 5,Calendar.className.columnDate)||Element.hasClassName(_285,Calendar.className.columnDateOdd)||Element.hasClassName(_285,Calendar.className.columnTopDate)){1984 var date=this.getDate(_28 5);1985 _28 4(date,_285);2014 },getDate:function(_286){ 2015 return _286.date; 2016 },abstractSelect:function(_287,_288){ 2017 var _289=this.findClickedElement(_287); 2018 if(_289){ 2019 if(Element.hasClassName(_289,Calendar.className.columnDate)||Element.hasClassName(_289,Calendar.className.columnDateOdd)||Element.hasClassName(_289,Calendar.className.columnTopDate)){ 2020 var date=this.getDate(_289); 2021 _288(date,_289); 1986 2022 } 1987 2023 } 1988 2024 },getSelectedTerm:function(){ 1989 var _28 7=this.calendar.getSelected();1990 if(_28 7.length==0){2025 var _28b=this.calendar.getSelected(); 2026 if(_28b.length==0){ 1991 2027 return; 1992 2028 } 1993 2029 if(this.calendar.options.build){ 1994 var last=_28 7.last();2030 var last=_28b.last(); 1995 2031 if(last){ 1996 2032 last=this.dateMap[last.id]; 1997 2033 }else{ 1998 last=this.dateMap[_28 7.first().id];2034 last=this.dateMap[_28b.first().id]; 1999 2035 } 2000 2036 last=new Date(last.getFullYear(),last.getMonth(),last.getDate(),last.getHours(),last.getMinutes(),0); 2001 2037 last.setMinutes(last.getMinutes()+30); 2002 return [this.dateMap[_28 7.first().id],last];2003 }else{ 2004 var last=this._getDateTimeFromElement(_28 7.last());2038 return [this.dateMap[_28b.first().id],last]; 2039 }else{ 2040 var last=this._getDateTimeFromElement(_28b.last()); 2005 2041 last.setMinutes(last.getMinutes()+30); 2006 return [this._getDateTimeFromElement(_28 7.first()),last];2042 return [this._getDateTimeFromElement(_28b.first()),last]; 2007 2043 } 2008 2044 },setWidth:function(node){ 2009 2045 Element.setStyle(node,{width:this.column.width+"px"}); 2010 },inspectArgument:function(_28 a,time){2011 if(_28 a.date){2012 return _28 a;2046 },inspectArgument:function(_28e,time){ 2047 if(_28e.date){ 2048 return _28e; 2013 2049 } 2014 2050 var self=this; 2015 var _2 8d=this.calendar.getSelected();2016 var _2 8e=[];2017 this.calendar.recurrence(_28 a,function(o){2018 var _29 0={};2051 var _291=this.calendar.getSelected(); 2052 var _292=[]; 2053 this.calendar.recurrence(_28e,function(o){ 2054 var _294={}; 2019 2055 if(!o.date){ 2020 _29 0={date:self.getDate(_28d[0])};2056 _294={date:self.getDate(_291[0])}; 2021 2057 if(!o.start){ 2022 _29 0.start=_28d[0].time;2058 _294.start=_291[0].time; 2023 2059 } 2024 2060 if(!o.finish){ 2025 _29 0.finish=_28d[_28d.length-1].time;2026 } 2027 } 2028 Object.extend(_29 0,o);2029 _2 8e.push(_290);2030 }); 2031 return _2 8e;2061 _294.finish=_291[_291.length-1].time; 2062 } 2063 } 2064 Object.extend(_294,o); 2065 _292.push(_294); 2066 }); 2067 return _292; 2032 2068 },inspectDateArgument:function(date){ 2033 2069 if(date){ 2034 2070 return date; 2035 2071 } 2036 var _29 2=this;2037 var _29 3=this.getSelected();2038 if(_29 3.length==0){2072 var _296=this; 2073 var _297=this.getSelected(); 2074 if(_297.length==0){ 2039 2075 return null; 2040 2076 } 2041 return _29 3.collect(function(d){2042 return _29 2.getDate(d);2043 }); 2044 },addColumnClass:function(_29 5){2077 return _297.collect(function(d){ 2078 return _296.getDate(d); 2079 }); 2080 },addColumnClass:function(_299){ 2045 2081 if(document.all){ 2046 this.calendar.css.addClassNames(_29 5,"columnWin");2047 }else{ 2048 this.calendar.css.addClassNames(_29 5,"column");2082 this.calendar.css.addClassNames(_299,"columnWin"); 2083 }else{ 2084 this.calendar.css.addClassNames(_299,"column"); 2049 2085 } 2050 2086 },getHeaderId:function(){ … … 2052 2088 },getColumnId:function(i){ 2053 2089 return this.calendar.element.id.appendSuffix(CalendarWeek.id.column+"_"+i); 2054 },changeSchedule:function(_29 7,_298){2055 var _29 9=_297.element;2056 var _29 a=_299.schedule;2057 var time=this.getTimeByElement(_29 9);2058 this.calendar.cacheSchedule(_29 a);2059 var _2 9c=$(this.getScheduleContainerId());2060 var _2 9d=Element.getDimensions(_29c);2061 var _2 9e=Position.cumulativeOffset(_29c);2062 var x=Event.pointerX(_29 8);2063 var y=Event.pointerY(_29 8);2064 var left=parseInt(Element.getStyle(_29 9,"left"));2065 var _2a 2=Math.round(left/this.column.width);2066 var date=this.week[_2a 2];2067 if(_29 a.start.year==date.getFullYear()&&_29a.start.month==date.getMonth()&&_29a.start.day==date.getDate()&&_29a.start.hour==time[0].hour&&_29a.start.min==time[0].min&&_29a.finish.year==date.getFullYear()&&_29a.finish.month==date.getMonth()&&_29a.finish.day==date.getDate()&&_29a.finish.hour==time[1].hour&&_29a.finish.min==time[1].min){2090 },changeSchedule:function(_29b,_29c){ 2091 var _29d=_29b.element; 2092 var _29e=_29d.schedule; 2093 var time=this.getTimeByElement(_29d); 2094 this.calendar.cacheSchedule(_29e); 2095 var _2a0=$(this.getScheduleContainerId()); 2096 var _2a1=Element.getDimensions(_2a0); 2097 var _2a2=Position.cumulativeOffset(_2a0); 2098 var x=Event.pointerX(_29c); 2099 var y=Event.pointerY(_29c); 2100 var left=parseInt(Element.getStyle(_29d,"left")); 2101 var _2a6=Math.round(left/this.column.width); 2102 var date=this.week[_2a6]; 2103 if(_29e.start.year==date.getFullYear()&&_29e.start.month==date.getMonth()&&_29e.start.day==date.getDate()&&_29e.start.hour==time[0].hour&&_29e.start.min==time[0].min&&_29e.finish.year==date.getFullYear()&&_29e.finish.month==date.getMonth()&&_29e.finish.day==date.getDate()&&_29e.finish.hour==time[1].hour&&_29e.finish.min==time[1].min){ 2068 2104 this.calendar.refreshSchedule(); 2069 2105 return; 2070 2106 } 2071 if(_29 9.originalSchedule){2072 _29 a=_299.originalSchedule;2073 } 2074 var _2a 4={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min};2075 var _2a 5=DateUtil.toDate(_2a4);2076 var _2a 6=_299.cellDate.days()-DateUtil.toDate(_29a.start).days();2077 _2a 5.setDate(_2a5.getDate()-_2a6);2078 var diff=_2a 5.getTime()-DateUtil.toDate(_29a.start).getTime();2079 _29 a.start=_2a5.toHash();2080 _29 a.finish=new Date(DateUtil.toDate(_29a.finish).getTime()+diff).toHash();2107 if(_29d.originalSchedule){ 2108 _29e=_29d.originalSchedule; 2109 } 2110 var _2a8={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:time[0].hour,min:time[0].min}; 2111 var _2a9=DateUtil.toDate(_2a8); 2112 var _2aa=_29d.cellDate.days()-DateUtil.toDate(_29e.start).days(); 2113 _2a9.setDate(_2a9.getDate()-_2aa); 2114 var diff=_2a9.getTime()-DateUtil.toDate(_29e.start).getTime(); 2115 _29e.start=_2a9.toHash(); 2116 _29e.finish=new Date(DateUtil.toDate(_29e.finish).getTime()+diff).toHash(); 2081 2117 this.calendar.refreshSchedule(); 2082 this.calendar.options.changeSchedule(_29 a);2083 },updateTirm:function(_2a 8){2084 var _2a 9=_2a8.schedule;2085 var time=this.getTimeByElement(_2a 8);2086 this.calendar.cacheSchedule(_2a 9);2087 var left=parseInt(Element.getStyle(_2a 8,"left"));2088 var _2 ac=Math.floor(left/this.column.width);2089 var date=this.week[_2 ac];2090 var _2 ae=this.isChengeSchedule(_2a8,time);2091 if(_2a 8.originalSchedule){2092 _2a 9=_2a8.originalSchedule;2093 } 2094 if(_2 ae.start){2095 _2a 9.start.year=date.getFullYear();2096 _2a 9.start.month=date.getMonth();2097 _2a 9.start.day=date.getDate();2098 _2a 9.start.hour=time[0].hour;2099 _2a 9.start.min=time[0].min;2100 } 2101 if(_2 ae.finish){2102 _2a 9.finish.year=date.getFullYear();2103 _2a 9.finish.month=date.getMonth();2104 _2a 9.finish.day=date.getDate();2105 _2a 9.finish.hour=time[1].hour;2106 _2a 9.finish.min=time[1].min;2118 this.calendar.options.changeSchedule(_29e); 2119 },updateTirm:function(_2ac){ 2120 var _2ad=_2ac.schedule; 2121 var time=this.getTimeByElement(_2ac); 2122 this.calendar.cacheSchedule(_2ad); 2123 var left=parseInt(Element.getStyle(_2ac,"left")); 2124 var _2b0=Math.floor(left/this.column.width); 2125 var date=this.week[_2b0]; 2126 var _2b2=this.isChengeSchedule(_2ac,time); 2127 if(_2ac.originalSchedule){ 2128 _2ad=_2ac.originalSchedule; 2129 } 2130 if(_2b2.start){ 2131 _2ad.start.year=date.getFullYear(); 2132 _2ad.start.month=date.getMonth(); 2133 _2ad.start.day=date.getDate(); 2134 _2ad.start.hour=time[0].hour; 2135 _2ad.start.min=time[0].min; 2136 } 2137 if(_2b2.finish){ 2138 _2ad.finish.year=date.getFullYear(); 2139 _2ad.finish.month=date.getMonth(); 2140 _2ad.finish.day=date.getDate(); 2141 _2ad.finish.hour=time[1].hour; 2142 _2ad.finish.min=time[1].min; 2107 2143 } 2108 2144 this.calendar.refreshSchedule(); 2109 if(_2 ae.start||_2ae.finish){2110 this.calendar.options.updateTirm(_2a 9);2111 } 2112 },changeTimeDisplay:function(_2 af){2113 var _2b 0=_2af.schedule;2114 var time=this.getTimeByElement(_2 af);2115 var _2b 2=Element.getElementsByClassName(_2af,Calendar.className.scheduleTimeArea)[0];2145 if(_2b2.start||_2b2.finish){ 2146 this.calendar.options.updateTirm(_2ad); 2147 } 2148 },changeTimeDisplay:function(_2b3){ 2149 var _2b4=_2b3.schedule; 2150 var time=this.getTimeByElement(_2b3); 2151 var _2b6=Element.getElementsByClassName(_2b3,Calendar.className.scheduleTimeArea)[0]; 2116 2152 var text=this.getTimeText(time[0],time[1]); 2117 _2b 2.innerHTML=text;2118 },findClickedElement:function(_2b 4){2119 var _2b 5=$(this.getScheduleContainerId());2120 var _2b 6=Position.cumulativeOffset(_2b5);2121 var _2b 7=Position.realOffset(_2b5).last();2122 _2b 7-=document.documentElement.scrollTop||document.body.scrollTop;2123 var x=Event.pointerX(_2b 4)-_2b6[0];2124 var y=Event.pointerY(_2b 4)-_2b6[1]+_2b7;2125 var _2b a=Math.floor(y/this.column.height);2126 var _2b b=Math.floor(x/this.column.width);2153 _2b6.innerHTML=text; 2154 },findClickedElement:function(_2b8){ 2155 var _2b9=$(this.getScheduleContainerId()); 2156 var _2ba=Position.cumulativeOffset(_2b9); 2157 var _2bb=Position.realOffset(_2b9).last(); 2158 _2bb-=document.documentElement.scrollTop||document.body.scrollTop; 2159 var x=Event.pointerX(_2b8)-_2ba[0]; 2160 var y=Event.pointerY(_2b8)-_2ba[1]+_2bb; 2161 var _2be=Math.floor(y/this.column.height); 2162 var _2bf=Math.floor(x/this.column.width); 2127 2163 var row=this.calendarTable.rows[0]; 2128 if(_2b b>=row.cells.length){2129 _2b b--;2130 } 2131 return $(row.cells[_2b b]).down(_2ba);2132 },multipleSelection:function(_2 bd){2164 if(_2bf>=row.cells.length){ 2165 _2bf--; 2166 } 2167 return $(row.cells[_2bf]).down(_2be); 2168 },multipleSelection:function(_2c1){ 2133 2169 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 2134 2170 return; 2135 2171 } 2136 2172 var self=this; 2137 var _2 bf=this.calendar;2138 var _2c 0=this.calendar.selectedBase;2139 var _2c 1=this._getDateFromElement(_2c0).getDate();2140 this.abstractSelect(_2 bd,function(date,_2c3){2141 var _2c 4=$(_2c0.id);2142 if(_2c 1!=self._getDateFromElement(_2c3).getDate()){2173 var _2c3=this.calendar; 2174 var _2c4=this.calendar.selectedBase; 2175 var _2c5=this._getDateFromElement(_2c4).getDate(); 2176 this.abstractSelect(_2c1,function(date,_2c7){ 2177 var _2c8=$(_2c4.id); 2178 if(_2c5!=self._getDateFromElement(_2c7).getDate()){ 2143 2179 return; 2144 2180 } 2145 var _2c 5=$A(_2c4.parentNode.childNodes);2146 var ids=[this._getTime(_2c 0),this._getTime(_2c3)];2181 var _2c9=$A(_2c8.parentNode.childNodes); 2182 var ids=[this._getTime(_2c4),this._getTime(_2c7)]; 2147 2183 ids.sort(function(a,b){ 2148 2184 return a-b; 2149 2185 }); 2150 _2c 5.each(function(n){2186 _2c9.each(function(n){ 2151 2187 if(!n.id){ 2152 2188 throw $continue; … … 2154 2190 var id=this._getTime(n); 2155 2191 if((id<ids[0])||(ids[1]<id)){ 2156 _2 bf.removeSelectedClass(n);2192 _2c3.removeSelectedClass(n); 2157 2193 }else{ 2158 2194 if(!Element.hasClassName(n,Calendar.className.selected)){ 2159 _2 bf.addSelectedClass(n);2195 _2c3.addSelectedClass(n); 2160 2196 } 2161 2197 } 2162 2198 }.bind(this)); 2163 2199 }.bind(this)); 2164 },getTimeByElement:function(_2c b){2165 var _2 cc=_2cb.schedule;2166 var top=parseInt(Element.getStyle(_2c b,"top"),10);2167 var _2 ce=parseInt(Element.getStyle(_2cb,"height"),10);2168 var _2 cf=this.column.height*2;2169 var _2d 0=15/60;2170 var _2d 1=top/_2cf+this.startTime;2171 _2d 1=Math.round(_2d1/_2d0)*_2d0;2172 var _2d 2={};2173 _2d 2.hour=Math.floor(_2d1);2174 _2d 2.min=(_2d1-_2d2.hour)*60;2175 var _2d 3=Math.round(_2ce/_2cf/_2d0)*_2d0+_2d1;2176 var _2d 4={};2177 _2d 4.hour=Math.floor(_2d3);2178 _2d 4.min=Math.round((_2d3-_2d4.hour)*60);2179 if(_2d 4.min==60){2180 _2d 4.hour+=1;2181 _2d 4.min=0;2182 } 2183 return [_2d 2,_2d4];2200 },getTimeByElement:function(_2cf){ 2201 var _2d0=_2cf.schedule; 2202 var top=parseInt(Element.getStyle(_2cf,"top"),10); 2203 var _2d2=parseInt(Element.getStyle(_2cf,"height"),10); 2204 var _2d3=this.column.height*2; 2205 var _2d4=15/60; 2206 var _2d5=top/_2d3+this.startTime; 2207 _2d5=Math.round(_2d5/_2d4)*_2d4; 2208 var _2d6={}; 2209 _2d6.hour=Math.floor(_2d5); 2210 _2d6.min=(_2d5-_2d6.hour)*60; 2211 var _2d7=Math.round(_2d2/_2d3/_2d4)*_2d4+_2d5; 2212 var _2d8={}; 2213 _2d8.hour=Math.floor(_2d7); 2214 _2d8.min=Math.round((_2d7-_2d8.hour)*60); 2215 if(_2d8.min==60){ 2216 _2d8.hour+=1; 2217 _2d8.min=0; 2218 } 2219 return [_2d6,_2d8]; 2184 2220 },getTimeByTop:function(top){ 2185 var _2d 6=this.column.height*2;2186 var _2d 7=15/60;2187 var _2d 8=top/_2d6+this.startTime;2188 _2d 8=Math.round(_2d8/_2d7)*_2d7;2189 var _2d 9={};2190 _2d 9.hour=Math.floor(_2d8);2191 _2d 9.min=(_2d8-_2d9.hour)*60;2192 return _2d 9;2193 },getDateId:function(date,time,_2 dc){2194 var id=this.calendar.element.id.appendSuffix(_2 dc+"_"+date.getDate());2221 var _2da=this.column.height*2; 2222 var _2db=15/60; 2223 var _2dc=top/_2da+this.startTime; 2224 _2dc=Math.round(_2dc/_2db)*_2db; 2225 var _2dd={}; 2226 _2dd.hour=Math.floor(_2dc); 2227 _2dd.min=(_2dc-_2dd.hour)*60; 2228 return _2dd; 2229 },getDateId:function(date,time,_2e0){ 2230 var id=this.calendar.element.id.appendSuffix(_2e0+"_"+date.getDate()); 2195 2231 return id.appendSuffix(time*10); 2196 2232 },dateIdToTime:function(id){ … … 2204 2240 time.pop(); 2205 2241 return time.join(":"); 2206 },includeDisplayTime:function(_2e 2,_2e3){2207 if(_2e 3){2208 return (this.startTime<_2e 2)&&(_2e2<this.finishTime);2209 }else{ 2210 return (this.startTime<=_2e 2)&&(_2e2<this.finishTime);2211 } 2212 },convertHours:function(_2e 4){2213 return [_2e 4.start.hour+_2e4.start.min/60,_2e4.finish.hour+_2e4.finish.min/60];2242 },includeDisplayTime:function(_2e6,_2e7){ 2243 if(_2e7){ 2244 return (this.startTime<_2e6)&&(_2e6<this.finishTime); 2245 }else{ 2246 return (this.startTime<=_2e6)&&(_2e6<this.finishTime); 2247 } 2248 },convertHours:function(_2e8){ 2249 return [_2e8.start.hour+_2e8.start.min/60,_2e8.finish.hour+_2e8.finish.min/60]; 2214 2250 },setDisplayTime:function(){ 2215 2251 this.startTime=this.calendar.options.displayTime.first().hour; 2216 var _2e 5=this.calendar.options.displayTime.last();2217 this.finishTime=Math.ceil(_2e 5.hour+_2e5.min/60);2218 },getTimeText:function(_2e 6,_2e7){2219 var _2e 8=this.calendar;2220 return _2e 8.formatTime(_2e6)+" - "+_2e8.formatTime(_2e7);2221 },isChengeSchedule:function(_2e 9,_2ea){2222 var _2e b=_2e9.schedule;2223 var _2 ec=((_2eb.start.hour!=_2ea[0].hour)||(_2eb.start.min!=_2ea[0].min));2224 var _2 ed=((_2eb.finish.hour!=_2ea[1].hour)||(_2eb.finish.min!=_2ea[1].min));2225 if(_2e 9.originalSchedule){2226 if(_2 ec&&_2ed){2227 var _2 ee=DateUtil.toDate(_2eb.start).getTime();2228 var _2 ef=DateUtil.toDate(_2e9.originalSchedule.start).getTime();2229 if(_2 ee==_2ef){2230 _2 ed=false;2231 }else{ 2232 _2 ec=false;2233 } 2234 }else{ 2235 _2 ec=false;2236 } 2237 } 2238 return {start:_2 ec,finish:_2ed};2239 },_getDateFromElement:function(_2f 0){2240 var arr=_2f 0.id.split("_");2241 var _2f 2=arr[arr.length-3];2242 return this.week[_2f 2];2243 },_getDateTimeFromElement:function(_2f 3){2244 var id=_2f 3.id.split("_");2245 var _2f 5=id[id.length-3];2246 if(this.week[_2f 5]){2247 var date=new Date(this.week[_2f 5].getTime());2252 var _2e9=this.calendar.options.displayTime.last(); 2253 this.finishTime=Math.ceil(_2e9.hour+_2e9.min/60); 2254 },getTimeText:function(_2ea,_2eb){ 2255 var _2ec=this.calendar; 2256 return _2ec.formatTime(_2ea)+" - "+_2ec.formatTime(_2eb); 2257 },isChengeSchedule:function(_2ed,_2ee){ 2258 var _2ef=_2ed.schedule; 2259 var _2f0=((_2ef.start.hour!=_2ee[0].hour)||(_2ef.start.min!=_2ee[0].min)); 2260 var _2f1=((_2ef.finish.hour!=_2ee[1].hour)||(_2ef.finish.min!=_2ee[1].min)); 2261 if(_2ed.originalSchedule){ 2262 if(_2f0&&_2f1){ 2263 var _2f2=DateUtil.toDate(_2ef.start).getTime(); 2264 var _2f3=DateUtil.toDate(_2ed.originalSchedule.start).getTime(); 2265 if(_2f2==_2f3){ 2266 _2f1=false; 2267 }else{ 2268 _2f0=false; 2269 } 2270 }else{ 2271 _2f0=false; 2272 } 2273 } 2274 return {start:_2f0,finish:_2f1}; 2275 },_getDateFromElement:function(_2f4){ 2276 var arr=_2f4.id.split("_"); 2277 var _2f6=arr[arr.length-3]; 2278 return this.week[_2f6]; 2279 },_getDateTimeFromElement:function(_2f7){ 2280 var id=_2f7.id.split("_"); 2281 var _2f9=id[id.length-3]; 2282 if(this.week[_2f9]){ 2283 var date=new Date(this.week[_2f9].getTime()); 2248 2284 date.setMinutes(parseInt(id.pop(),10)); 2249 2285 date.setHours(parseInt(id.pop(),10)); 2250 2286 return date; 2251 2287 }else{ 2252 return this._getDate(_2f 3);2253 } 2254 },_getDate:function(_2f 7){2255 var id=_2f 7.id.split("_");2288 return this._getDate(_2f7); 2289 } 2290 },_getDate:function(_2fb){ 2291 var id=_2fb.id.split("_"); 2256 2292 var date=new Date(this.calendar.date.getTime()); 2257 2293 date.setMinutes(parseInt(id.pop(),10)); 2258 2294 date.setHours(parseInt(id.pop(),10)); 2259 2295 return date; 2260 },_getTimeString:function(_2f a){2261 var arr=_2f a.id.split("_");2296 },_getTimeString:function(_2fe){ 2297 var arr=_2fe.id.split("_"); 2262 2298 var min=arr[arr.length-1]; 2263 2299 if(min=="0"){ … … 2269 2305 } 2270 2306 return arr[arr.length-2]+min; 2271 },_getTime:function(_ 2fd){2272 return parseInt(this._getTimeString(_ 2fd),10);2307 },_getTime:function(_301){ 2308 return parseInt(this._getTimeString(_301),10); 2273 2309 }}); 2274 2310 var CalendarDay=Class.create(); 2275 2311 CalendarDay.id=["dayHeader"]; 2276 2312 Object.extend(CalendarDay.prototype,CalendarWeek.prototype); 2277 Object.extend(CalendarDay.prototype,{initialize:function(_ 2fe){2278 var day=_ 2fe.date.getDay();2279 this.calendar=_ 2fe;2313 Object.extend(CalendarDay.prototype,{initialize:function(_302){ 2314 var day=_302.date.getDay(); 2315 this.calendar=_302; 2280 2316 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 2281 2317 this.dayIds=SpinelzUtil.concat(this.calendar.element.id,CalendarDay.id); … … 2292 2328 delete this.calendar.options.weekIndexOld; 2293 2329 },buildHeaderCenter:function(){ 2294 var _30 0=this.calendar.date.toDateString();2330 var _304=this.calendar.date.toDateString(); 2295 2331 if(this.calendar.options.dayHeaderFormat){ 2296 2332 var date=this.calendar.date; 2297 _300=new Template(this.calendar.options.dayHeaderFormat).evaluate({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),wday:this.calendar.options.dayOfWeek[date.getDay()]}); 2298 } 2299 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_300+"</span>"+"</td>"; 2333 _304=new Template(this.calendar.options.dayHeaderFormat).evaluate({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),wday:this.calendar.options.dayOfWeek[date.getDay()]}); 2334 } 2335 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.dayIds.header+"' class='"+this.calendar.classNames.ym+"'>"+_304+"</span>"+"</td>"; 2336 },preMarkChars:function(){ 2337 return Calendar.marks.preDay; 2338 },nextMarkChars:function(){ 2339 return Calendar.marks.nextDay; 2300 2340 },buildTimeLineTop:function(){ 2301 2341 return ""; 2302 2342 },buildCalendarHeader:function(){ 2303 2343 return ""; 2304 },changeCalendar:function(_302){ 2305 var _303=Event.element(_302); 2306 var _304=new Date(this.calendar.date.toDateString()); 2307 if(this.hasClassName(_303,Calendar.className.preWeekMark)){ 2344 },changeCalendar:function(_306){ 2345 var _307=Event.element(_306); 2346 if(_307.tagName.toLowerCase().match(/^a$/)){ 2347 _307=_307.parentNode; 2348 } 2349 var _308=new Date(this.calendar.date.toDateString()); 2350 if(this.hasClassName(_307,Calendar.className.preWeekMark)||this.hasClassName(_307,Calendar.className.preWeekMark2)){ 2308 2351 this.calendar.date.setDate(this.calendar.date.getDate()-1); 2309 2352 }else{ 2310 if(this.hasClassName(_30 3,Calendar.className.nextWeekMark)){2353 if(this.hasClassName(_307,Calendar.className.nextWeekMark)||this.hasClassName(_307,Calendar.className.nextWeekMark2)){ 2311 2354 this.calendar.date.setDate(this.calendar.date.getDate()+1); 2312 2355 } 2313 2356 } 2314 this.calendar.options.changeCalendar(this.calendar.date,_30 4);2357 this.calendar.options.changeCalendar(this.calendar.date,_308); 2315 2358 this.calendar.refresh(); 2316 2359 }}); 2317 2360 var CalendarResizeableEx=Class.create(); 2318 2361 Object.extend(CalendarResizeableEx.prototype,Resizeable.prototype); 2319 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_30 5){2320 var _30 6=Object.extend({top:3,bottom:3,left:3,right:3,minHeight:0,minWidth:0,zindex:1000,resize:null,distance:1,change:Prototype.emptyFunction,restriction:true},arguments[1]||{});2321 this.element=$(_30 5);2362 Object.extend(CalendarResizeableEx.prototype,{initialize:function(_309){ 2363 var _30a=Object.extend({top:3,bottom:3,left:3,right:3,minHeight:0,minWidth:0,zindex:1000,resize:null,distance:1,change:Prototype.emptyFunction,restriction:true},arguments[1]||{}); 2364 this.element=$(_309); 2322 2365 this.handle=this.element; 2323 2366 Element.makePositioned(this.element); 2324 this.options=_30 6;2367 this.options=_30a; 2325 2368 this.active=false; 2326 2369 this.resizing=false; … … 2332 2375 this.eventKeypress=this.keyPress.bindAsEventListener(this); 2333 2376 this.registerEvents(); 2334 },startResize:function(_30 7){2335 Event.stop(_30 7);2336 if(Event.isLeftClick(_30 7)){2337 var src=Event.element(_30 7);2377 },startResize:function(_30b){ 2378 Event.stop(_30b); 2379 if(Event.isLeftClick(_30b)){ 2380 var src=Event.element(_30b); 2338 2381 if(src.tagName&&(src.tagName=="INPUT"||src.tagName=="SELECT"||src.tagName=="BUTTON"||src.tagName=="TEXTAREA")){ 2339 2382 return; 2340 2383 } 2341 var dir=this.directions(_30 7);2384 var dir=this.directions(_30b); 2342 2385 if(dir.length>0){ 2343 2386 this.active=true; … … 2346 2389 this.startWidth=parseInt(Element.getStyle(this.element,"width"),10); 2347 2390 this.startHeight=parseInt(Element.getStyle(this.element,"height"),10); 2348 this.startX=_30 7.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;2349 this.startY=_30 7.clientY+document.body.scrollTop+document.documentElement.scrollTop;2391 this.startX=_30b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft; 2392 this.startY=_30b.clientY+document.body.scrollTop+document.documentElement.scrollTop; 2350 2393 this.currentDirection=dir; 2351 2394 if(this.options.restriction){ 2352 var _30 a=this.element.parentNode;2353 this.restDimensions=Element.getDimensions(_30 a);2354 this.restOffset=Position.cumulativeOffset(_30 a);2395 var _30e=this.element.parentNode; 2396 this.restDimensions=Element.getDimensions(_30e); 2397 this.restOffset=Position.cumulativeOffset(_30e); 2355 2398 this.scroll=Position.realOffset(this.element)[1]-(document.documentElement.scrollTop||document.body.scrollTop); 2356 2399 } 2357 2400 } 2358 2401 } 2359 },draw:function(_30 b){2360 Event.stop(_30 b);2361 var _3 0c=[Event.pointerX(_30b),Event.pointerY(_30b)];2362 var _3 0d=this.element.style;2402 },draw:function(_30f){ 2403 Event.stop(_30f); 2404 var _310=[Event.pointerX(_30f),Event.pointerY(_30f)]; 2405 var _311=this.element.style; 2363 2406 if(this.currentDirection.indexOf("n")!=-1){ 2364 if(this.restOffset[1]-this.scroll>=_3 0c[1]){2407 if(this.restOffset[1]-this.scroll>=_310[1]){ 2365 2408 return; 2366 2409 } 2367 var _3 0e=this.startY-_30c[1];2368 var _3 0f=this.map(this.startHeight+_30e);2369 if(_3 0f>this.options.minHeight){2370 _3 0d.height=(_30f-4)+"px";2371 _3 0d.top=this.map(this.startTop-_30e)+"px";2410 var _312=this.startY-_310[1]; 2411 var _313=this.map(this.startHeight+_312); 2412 if(_313>this.options.minHeight){ 2413 _311.height=(_313-4)+"px"; 2414 _311.top=this.map(this.startTop-_312)+"px"; 2372 2415 } 2373 2416 } 2374 2417 if(this.currentDirection.indexOf("w")!=-1){ 2375 var _3 0e=this.map(this.startX-_30c[0]);2376 var _31 0=Element.getStyle(this.element,"margin-left")||"0";2377 var _31 1=this.startWidth+_30e;2378 if(_31 1>this.options.minWidth){2379 _3 0d.left=(this.startLeft-_30e-parseInt(_310))+"px";2380 _3 0d.width=_311+"px";2418 var _312=this.map(this.startX-_310[0]); 2419 var _314=Element.getStyle(this.element,"margin-left")||"0"; 2420 var _315=this.startWidth+_312; 2421 if(_315>this.options.minWidth){ 2422 _311.left=(this.startLeft-_312-parseInt(_314))+"px"; 2423 _311.width=_315+"px"; 2381 2424 } 2382 2425 } 2383 2426 if(this.currentDirection.indexOf("s")!=-1){ 2384 var _31 2=this.restDimensions.height+this.restOffset[1];2385 var _3 0e=_30c[1]-this.startY;2386 if(_31 2-this.scroll<=_30c[1]){2427 var _316=this.restDimensions.height+this.restOffset[1]; 2428 var _312=_310[1]-this.startY; 2429 if(_316-this.scroll<=_310[1]){ 2387 2430 return; 2388 2431 } 2389 var _3 0f=this.map(this.startHeight+_30c[1]-this.startY);2390 if(_3 0f>this.options.minHeight){2391 _3 0d.height=(_30f-4)+"px";2432 var _313=this.map(this.startHeight+_310[1]-this.startY); 2433 if(_313>this.options.minHeight){ 2434 _311.height=(_313-4)+"px"; 2392 2435 } 2393 2436 } 2394 2437 if(this.currentDirection.indexOf("e")!=-1){ 2395 var _31 1=this.map(this.startWidth+_30c[0]-this.startX);2396 if(_31 1>this.options.minWidth){2397 _3 0d.width=_311+"px";2398 } 2399 } 2400 if(_3 0d.visibility=="hidden"){2401 _3 0d.visibility="";2438 var _315=this.map(this.startWidth+_310[0]-this.startX); 2439 if(_315>this.options.minWidth){ 2440 _311.width=_315+"px"; 2441 } 2442 } 2443 if(_311.visibility=="hidden"){ 2444 _311.visibility=""; 2402 2445 } 2403 2446 this.options.change(this.element); 2404 },directions:function(_31 3){2405 var _31 4=[Event.pointerX(_313),Event.pointerY(_313)];2406 var _31 5=Position.cumulativeOffset(this.element);2407 var _31 6=document.documentElement.scrollTop||document.body.scrollTop;2408 var _31 7=Position.realOffset(this.element)[1]-_316;2409 var _31 8="";2410 if(this.between(_31 4[1]-_315[1]+_317,0,this.options.top)){2411 _31 8+="n";2412 } 2413 if(this.between((_31 5[1]+this.element.offsetHeight)-_314[1]-_317,0,this.options.bottom)){2414 _31 8+="s";2415 } 2416 if(this.between(_31 4[0]-_315[0],0,this.options.left)){2417 _31 8+="w";2418 } 2419 if(this.between((_31 5[0]+this.element.offsetWidth)-_314[0],0,this.options.right)){2420 _31 8+="e";2421 } 2422 return _31 8;2423 },map:function(_31 9){2424 return Math.round(_31 9/this.options.distance)*this.options.distance;2447 },directions:function(_317){ 2448 var _318=[Event.pointerX(_317),Event.pointerY(_317)]; 2449 var _319=Position.cumulativeOffset(this.element); 2450 var _31a=document.documentElement.scrollTop||document.body.scrollTop; 2451 var _31b=Position.realOffset(this.element)[1]-_31a; 2452 var _31c=""; 2453 if(this.between(_318[1]-_319[1]+_31b,0,this.options.top)){ 2454 _31c+="n"; 2455 } 2456 if(this.between((_319[1]+this.element.offsetHeight)-_318[1]-_31b,0,this.options.bottom)){ 2457 _31c+="s"; 2458 } 2459 if(this.between(_318[0]-_319[0],0,this.options.left)){ 2460 _31c+="w"; 2461 } 2462 if(this.between((_319[0]+this.element.offsetWidth)-_318[0],0,this.options.right)){ 2463 _31c+="e"; 2464 } 2465 return _31c; 2466 },map:function(_31d){ 2467 return Math.round(_31d/this.options.distance)*this.options.distance; 2425 2468 }}); 2426 2469 rubricks_core/trunk/public/javascripts/spinelz/datepicker.js
r5987 r6010 5 5 Element.setStyle(this.element,{visibility:"hidden"}); 6 6 this.target=$(_2); 7 this.options=Object.extend({date:new Date(), format:DateUtil.toLocaleDateString,cssPrefix:"custom_",callBack:Prototype.emptyFunction,standBy:false,headerFormat:null,dayOfWeek:DateUtil.dayOfWeek,appendToBody:false,invalidDates:[]},arguments[3]||{});7 this.options=Object.extend({date:new Date(),regularHoliday:[0,6],format:DateUtil.toLocaleDateString,cssPrefix:"custom_",callBack:Prototype.emptyFunction,standBy:false,headerFormat:null,dayOfWeek:DateUtil.dayOfWeek,appendToBody:false,invalidDates:[]},arguments[3]||{}); 8 8 this.css=CssUtil.getInstance(this.options.cssPrefix,DatePicker.className); 9 9 this.classNames=this.css.allJoinClassNames(); … … 113 113 return _17; 114 114 },buildCalendar:function(){ 115 var _1a="<div class='"+this.classNames["calendar"]+"'>"+"<table class='"+this.classNames["table"]+"' >"+this.buildTableHeader()+this.buildTableData()+"</table>"+"</div>";115 var _1a="<div class='"+this.classNames["calendar"]+"'>"+"<table class='"+this.classNames["table"]+"' id='"+this.element.id.appendSuffix("dates")+"'>"+this.buildTableHeader()+this.buildTableData()+"</table>"+"</div>"; 116 116 return _1a; 117 117 },buildTableHeader:function(){ … … 137 137 var id=_23.appendSuffix(i); 138 138 this.dateIds.push(id); 139 var _2b= ((i%7==0)||((i+1)%7==0))?"holiday":"date";139 var _2b=this.options.regularHoliday.include(i%7)?"holiday":"date"; 140 140 var _2c=this.classNames[_2b]; 141 141 if((i<_21)||day>_22){ … … 180 180 _3a.className=this.classNames["today"]+" "+_3a.className; 181 181 this.todayCell=id; 182 this.hovers[id].re fresh();182 this.hovers[id].resetClasses(); 183 183 } 184 184 day++; … … 192 192 return !_3b.include(_3d); 193 193 }).join(" "); 194 this.hovers[this.todayCell].re fresh();194 this.hovers[this.todayCell].resetClasses(); 195 195 } 196 196 this.todayCell=null; … … 296 296 var _4f=$(_4e).innerHTML; 297 297 return _4f&&(_4f!=""); 298 },refreshRegularHoliday:function(_50){ 299 this.options.regularHoliday=_50; 300 this.css=CssUtil.getInstance(this.options.cssPrefix,DatePicker.className); 301 this.classNames=this.css.allJoinClassNames(); 302 $A($(this.element.id.appendSuffix("dates")).rows).each(function(row,i){ 303 if(i==0){ 304 throw $continue; 305 } 306 $A(row.cells).each(function(_53,j){ 307 var _55=this.options.regularHoliday.include(j%7)?"holiday":"date"; 308 _53.className=this.classNames[_55]; 309 }.bind(this)); 310 }.bind(this)); 311 $H(this.hovers).each(function(_56){ 312 _56.value.resetClasses(); 313 }); 298 314 }}; 299 315 rubricks_core/trunk/public/javascripts/spinelz/spinelz_for_rubricks.js
r5987 r6010 478 478 479 479 var Calendar=Class.create(); 480 Calendar.className={container:"calendar",header:"calendar_header",preYears:"calendar_preYears",nextYears:"calendar_nextYears", years:"calendar_years",mark:"calendar_mark",ym:"calendar_ym",table:"calendar_table",thRight:"right",tdRight:"right",tdBottom:"bottom",date:"calendar_date",holiday:"calendar_holiday",regularHoliday:"calendar_regularHoliday",schedule:"calendar_schedule",highlightDay:"calendar_highlightDay",highlightTime:"calendar_highlightTime",scheduleListContainer:"calendar_scheduleListContainer",scheduleItem:"calendar_scheduleItem",scheduleTimeArea:"calendar_scheduleItemTimeArea",scheduleTimeAreaMonth:"calendar_scheduleItemTimeAreaMonth",scheduleHandler:"calendar_scheduleHandler",holidayName:"calendar_holidayName",dateContainer:"calendar_dateContainer",tableHeader:"calendar_tableHeader",rowContent:"calendar_rowContent",selected:"calendar_selected",nextYearMark:"calendar_nextYearMark",nextMonthMark:"calendar_nextMonthMark",nextWeekMark:"calendar_nextWeekMark",preYearMark:"calendar_preYearMark",preMonthMark:"calendar_preMonthMark",preWeekMark:"calendar_preWeekMark",weekTable:"calendar_weekContainerTable",weekMainTable:"calendar_weekMainTable",timeLine:"calendar_timeline",timeLineTimeTop:"calendar_timelineTimeTop",timeLineTime:"calendar_timelineTime",headerColumn:"calendar_headerColumn",columnTopDate:"calendar_columnTopDate",columnDate:"calendar_columnDate",columnDateOdd:"calendar_columnOddDate",scheduleItemSamll:"calendar_scheduleItemSmall",scheduleItemLarge:"calendar_scheduleItemLarge",scheduleItemNoBorder:"calendar_scheduleItemNoBorder",scheduleItemSelect:"calendar_scheduleItemSelect",skipNode:"calendar_skipNode",deleteImg:"calendar_deleteImage",copyImg:"calendar_copyImage",privateImg:"calendar_privateImage",scheduleContainer:"calendar_weekScheduleContainer",selector:"calendar_selector",cover:"calendar_cover"};480 Calendar.className={container:"calendar",header:"calendar_header",preYears:"calendar_preYears",nextYears:"calendar_nextYears",preYears2:"calendar_preYears2",nextYears2:"calendar_nextYears2",years:"calendar_years",mark:"calendar_mark",ym:"calendar_ym",table:"calendar_table",thRight:"right",tdRight:"right",tdBottom:"bottom",date:"calendar_date",holiday:"calendar_holiday",regularHoliday:"calendar_regularHoliday",schedule:"calendar_schedule",highlightDay:"calendar_highlightDay",highlightTime:"calendar_highlightTime",scheduleListContainer:"calendar_scheduleListContainer",scheduleItem:"calendar_scheduleItem",scheduleTimeArea:"calendar_scheduleItemTimeArea",scheduleTimeAreaMonth:"calendar_scheduleItemTimeAreaMonth",scheduleHandler:"calendar_scheduleHandler",holidayName:"calendar_holidayName",dateContainer:"calendar_dateContainer",tableHeader:"calendar_tableHeader",rowContent:"calendar_rowContent",selected:"calendar_selected",nextYearMark:"calendar_nextYearMark",nextMonthMark:"calendar_nextMonthMark",nextWeekMark:"calendar_nextWeekMark",preYearMark:"calendar_preYearMark",preMonthMark:"calendar_preMonthMark",preWeekMark:"calendar_preWeekMark",nextYearMark2:"calendar_nextYearMark2",nextMonthMark2:"calendar_nextMonthMark2",nextWeekMark2:"calendar_nextWeekMark2",preYearMark2:"calendar_preYearMark2",preMonthMark2:"calendar_preMonthMark2",preWeekMark2:"calendar_preWeekMark2",weekTable:"calendar_weekContainerTable",weekMainTable:"calendar_weekMainTable",timeLine:"calendar_timeline",timeLineTimeTop:"calendar_timelineTimeTop",timeLineTime:"calendar_timelineTime",headerColumn:"calendar_headerColumn",columnTopDate:"calendar_columnTopDate",columnDate:"calendar_columnDate",columnDateOdd:"calendar_columnOddDate",scheduleItemSamll:"calendar_scheduleItemSmall",scheduleItemLarge:"calendar_scheduleItemLarge",scheduleItemNoBorder:"calendar_scheduleItemNoBorder",scheduleItemSelect:"calendar_scheduleItemSelect",skipNode:"calendar_skipNode",deleteImg:"calendar_deleteImage",copyImg:"calendar_copyImage",privateImg:"calendar_privateImage",scheduleContainer:"calendar_weekScheduleContainer",selector:"calendar_selector",cover:"calendar_cover"}; 481 481 Calendar.smallClassName={container:"calendar_small",header:"calendar_header_small",calendar:"calendar_calendar_small",table:"calendar_tableSmall"}; 482 482 Calendar.size={large:"large",small:"small"}; 483 Calendar.marks={nextYear:"next year",nextMonth:"next month",nextWeek:"next week",nextDay:"next day",preYear:"previous year",preMonth:"previous month",preWeek:"previous week",preDay:"previous day"}; 483 484 Calendar.privateImgPath=null; 484 485 Calendar.defaultIconPath=null; … … 488 489 this.options=Object.extend({initDate:new Date(),cssPrefix:"custom_",holidays:[],schedules:[],size:Calendar.size.large,regularHoliday:[0,6],displayIndexes:[0,1,2,3,4,5,6],displayTime:[{hour:0,min:0},{hour:24,min:0}],weekIndex:0,dblclickListener:null,afterSelect:Prototype.emptyFunction,beforeRefresh:Prototype.emptyFunction,afterRefresh:Prototype.emptyFunction,changeSchedule:Prototype.emptyFunction,changeCalendar:Prototype.emptyFunction,displayType:"month",highlightDay:true,beforeRemoveSchedule:function(){ 489 490 return true; 490 },copySchedule:Prototype.emptyFunction,dblclickSchedule:null,updateTirm:Prototype.emptyFunction,displayTimeLine:true,clickDateText:null,monthHeaderFormat:null,weekHeaderFormat:null,weekSubHeaderFormat:null,dayHeaderFormat:null,dayOfWeek:DateUtil.dayOfWeek,skipString:"... #{count} more",clickSkipNode:Prototype.emptyFunction,noEvent:false,build:true,startAfterBuild:Prototype.emptyFunction,endAfterBuild:Prototype.emptyFunction,enableCtrKey:false },arguments[1]||{});491 },copySchedule:Prototype.emptyFunction,dblclickSchedule:null,updateTirm:Prototype.emptyFunction,displayTimeLine:true,clickDateText:null,monthHeaderFormat:null,weekHeaderFormat:null,weekSubHeaderFormat:null,dayHeaderFormat:null,dayOfWeek:DateUtil.dayOfWeek,skipString:"... #{count} more",clickSkipNode:Prototype.emptyFunction,noEvent:false,build:true,startAfterBuild:Prototype.emptyFunction,endAfterBuild:Prototype.emptyFunction,enableCtrKey:false,useImgMark:true},arguments[1]||{}); 491 492 this.date=this.options.initDate; 492 493 this.options.holidays=this.toHolidayHash(this.options.holidays); … … 865 866 },getSelectedTerm:function(){ 866 867 return this.builder.getSelectedTerm(); 867 },abstractSelect:function(_58,_59){ 868 this.builder.abstractSelect(_58,_59); 868 },isMovedScheduler:function(_58){ 869 var _59=_58.currentDelta(); 870 var _5a=_58.delta; 871 var _5b=5; 872 return (_58.element.moved||!($R(_5a[0]-_5b,_5a[0]).include(_59[0])&&$R(_5a[1]-_5b,_5a[1]).include(_59[1]))); 873 },abstractSelect:function(_5c,_5d){ 874 this.builder.abstractSelect(_5c,_5d); 869 875 },createRange:function(a,b){ 870 var _ 5c=null;876 var _60=null; 871 877 if(a<=b){ 872 _ 5c=$R(a,b);873 }else{ 874 _ 5c=$R(b,a);875 } 876 return _ 5c;877 },formatTime:function(_ 5d){878 var _ 5e=(_5d.hour<10)?"0"+_5d.hour:_5d.hour;879 var min=(_ 5d.min<10)?"0"+_5d.min:_5d.min;880 return _ 5e+":"+min;878 _60=$R(a,b); 879 }else{ 880 _60=$R(b,a); 881 } 882 return _60; 883 },formatTime:function(_61){ 884 var _62=(_61.hour<10)?"0"+_61.hour:_61.hour; 885 var min=(_61.min<10)?"0"+_61.min:_61.min; 886 return _62+":"+min; 881 887 },clearSelected:function(){ 882 var _6 0=this.getSelected();883 var _6 1=this;884 _6 0.each(function(e){888 var _64=this.getSelected(); 889 var _65=this; 890 _64.each(function(e){ 885 891 if(Element.hasClassName(e,Calendar.className.selected)){ 886 _6 1.removeSelectedClass(e);887 } 888 }); 889 },onDblClick:function(_6 3){890 this.abstractSelect(_6 3,this.options.dblclickListener);891 },onMouseUp:function(_6 4){892 var e=_6 4||window.event;893 var _6 6=this;894 if(_6 6.mouseDown){892 _65.removeSelectedClass(e); 893 } 894 }); 895 },onDblClick:function(_67){ 896 this.abstractSelect(_67,this.options.dblclickListener); 897 },onMouseUp:function(_68){ 898 var e=_68||window.event; 899 var _6a=this; 900 if(_6a.mouseDown){ 895 901 setTimeout(function(){ 896 _6 6.mouseDown=false;897 _6 6.options.afterSelect(_64);902 _6a.mouseDown=false; 903 _6a.options.afterSelect(_68); 898 904 },10); 899 905 } 900 },setRegularHolidayClass:function(_6 7){901 this.classNames.refreshClassNames(_6 7,"regularHoliday");906 },setRegularHolidayClass:function(_6b){ 907 this.classNames.refreshClassNames(_6b,"regularHoliday"); 902 908 },getHolidayClass:function(){ 903 909 this.classNames.refreshClassNames(node,"holiday"); 904 },setWorkdayClass:function(_6 8){905 this.classNames.refreshClassNames(_6 8,"date");906 },setScheduleClass:function(_6 9){907 this.classNames.refreshClassNames(_6 9,"schedule");908 },addSelectedClass:function(_6 a){909 this.css.addClassNames(_6 a,"selected");910 },removeSelectedClass:function(_6 b){911 this.css.removeClassNames(_6 b,"selected");912 },getDatasWithMonthAndYear:function(_ 6c){913 var _ 6d=this;914 var _ 6e=_6c.findAll(function(h){915 return _ 6d.isSameYearAndMonth(h.date);916 }); 917 return _ 6e;910 },setWorkdayClass:function(_6c){ 911 this.classNames.refreshClassNames(_6c,"date"); 912 },setScheduleClass:function(_6d){ 913 this.classNames.refreshClassNames(_6d,"schedule"); 914 },addSelectedClass:function(_6e){ 915 this.css.addClassNames(_6e,"selected"); 916 },removeSelectedClass:function(_6f){ 917 this.css.removeClassNames(_6f,"selected"); 918 },getDatasWithMonthAndYear:function(_70){ 919 var _71=this; 920 var _72=_70.findAll(function(h){ 921 return _71.isSameYearAndMonth(h.date); 922 }); 923 return _72; 918 924 },isSameYearAndMonth:function(a,b){ 919 925 if(a.constructor==Date){ … … 936 942 },isSameTime:function(a,b){ 937 943 return ((a.hour==b.hour)&&(a.min==b.min)); 938 },betweenDate:function(_7 6,_77){939 var _7 8=this.toDateNumber(_76.start);940 var _7 9=this.toDateNumber(_76.finish);941 _7 7=this.toDateNumber(_77);942 return _7 8<=_77&&_77<=_79;943 },toDateNumber:function(_7 a){944 if(_7 a.constructor==Date){945 return _7 a.getFullYear()*10000+_7a.getMonth()*100+_7a.getDate();946 }else{ 947 return _7 a.year*10000+_7a.month*100+_7a.day;944 },betweenDate:function(_7a,_7b){ 945 var _7c=this.toDateNumber(_7a.start); 946 var _7d=this.toDateNumber(_7a.finish); 947 _7b=this.toDateNumber(_7b); 948 return _7c<=_7b&&_7b<=_7d; 949 },toDateNumber:function(_7e){ 950 if(_7e.constructor==Date){ 951 return _7e.getFullYear()*10000+_7e.getMonth()*100+_7e.getDate(); 952 }else{ 953 return _7e.year*10000+_7e.month*100+_7e.day; 948 954 } 949 955 },getTimeDiff:function(a,b){ 950 var _ 7d={hour:b.hour-a.hour,min:b.min-a.min};951 if(_ 7d.min>=60){952 _ 7d.hour++;953 _ 7d.min-=60;954 }else{ 955 if(_ 7d.min<0){956 _ 7d.hour--;957 _ 7d.min+=60;958 } 959 } 960 return _ 7d;961 },findIndex:function(_ 7e,_7f){962 var _8 0=null;963 _ 7e.each(function(v,i){964 if(v==_ 7f){965 _8 0=i;956 var _81={hour:b.hour-a.hour,min:b.min-a.min}; 957 if(_81.min>=60){ 958 _81.hour++; 959 _81.min-=60; 960 }else{ 961 if(_81.min<0){ 962 _81.hour--; 963 _81.min+=60; 964 } 965 } 966 return _81; 967 },findIndex:function(_82,_83){ 968 var _84=null; 969 _82.each(function(v,i){ 970 if(v==_83){ 971 _84=i; 966 972 throw $break; 967 973 } 968 974 }); 969 return _80; 970 },recurrence:function(_83,_84){ 971 var _85=this; 972 if(_83.constructor==Array){ 973 _83.each(function(o){ 974 _85.recurrence(o,_84); 975 }); 976 }else{ 977 if(_83.keys){ 978 _83.each(function(_87){ 979 _85.recurrence(_87[1],_84); 980 }); 981 }else{ 982 _84(_83); 983 } 984 } 985 },toHolidayHash:function(_88){ 975 return _84; 976 },recurrence:function(_87,_88){ 986 977 var _89=this; 987 var _8a={}; 988 this.recurrence(_88,function(o){ 978 if(_87.constructor==Array){ 979 _87.each(function(o){ 980 _89.recurrence(o,_88); 981 }); 982 }else{ 983 if(_87.keys){ 984 _87.each(function(_8b){ 985 _89.recurrence(_8b[1],_88); 986 }); 987 }else{ 988 _88(_87); 989 } 990 } 991 },toHolidayHash:function(_8c){ 992 var _8d=this; 993 var _8e={}; 994 this.recurrence(_8c,function(o){ 989 995 if(!o.name){ 990 996 return; … … 993 999 o.date=new Date(o.date.year,o.date.month,o.date.day); 994 1000 } 995 _8 a[o.date.toDateString()]=o;996 }); 997 return $H(_8 a);998 },inspectArgument:function(_ 8c,_8d){999 return this.builder.inspectArgument(_ 8c,_8d);1000 },inspectDateArgument:function(_ 8e){1001 return this.builder.inspectDateArgument(_ 8e);1001 _8e[o.date.toDateString()]=o; 1002 }); 1003 return $H(_8e); 1004 },inspectArgument:function(_90,_91){ 1005 return this.builder.inspectArgument(_90,_91); 1006 },inspectDateArgument:function(_92){ 1007 return this.builder.inspectDateArgument(_92); 1002 1008 },sortSchedule:function(a,b){ 1003 1009 if(a.start.hour==b.start.hour){ … … 1016 1022 },hasSelectedDate:function(){ 1017 1023 return (this.getSelected().length!=0); 1018 },getDate:function(_9 1){1019 return this.builder.getDate(_9 1);1024 },getDate:function(_95){ 1025 return this.builder.getDate(_95); 1020 1026 },isRegularHoliday:function(day){ 1021 1027 return this.options.regularHoliday.include(day); 1022 },isHoliday:function(_9 3){1023 return this.options.holidays[_9 3.toDateString()];1024 },isScheduleDay:function(_9 4){1025 return this.options.schedules[_9 4.toDateString()];1026 },cacheSchedule:function(_9 5){1027 this.cached=_9 5;1028 _9 5.start_old=Object.clone(_95.start);1029 _9 5.finish_old=Object.clone(_95.finish);1028 },isHoliday:function(_97){ 1029 return this.options.holidays[_97.toDateString()]; 1030 },isScheduleDay:function(_98){ 1031 return this.options.schedules[_98.toDateString()]; 1032 },cacheSchedule:function(_99){ 1033 this.cached=_99; 1034 _99.start_old=Object.clone(_99.start); 1035 _99.finish_old=Object.clone(_99.finish); 1030 1036 }}; 1031 1037 var AbstractCalendar=Class.create(); … … 1034 1040 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>"; 1035 1041 },buildHeader:function(){ 1036 var _9 6=this.calendar.options.noEvent;1037 return "<table class='"+this.calendar.classNames.header+"' style='table-layout: auto;'>"+"<tr>"+(_9 6?"":this.buildHeaderLeft())+this.buildHeaderCenter()+(_96?"":this.buildHeaderRight())+"</tr>"+"</table>";1042 var _9a=this.calendar.options.noEvent; 1043 return "<table class='"+this.calendar.classNames.header+"' style='table-layout: auto;'>"+"<tr>"+(_9a?"":this.buildHeaderLeft())+this.buildHeaderCenter()+(_9a?"":this.buildHeaderRight())+"</tr>"+"</table>"; 1038 1044 },buildSelector:function(){ 1039 var _9 7="display: none; zindex:"+ZindexManager.getIndex();1040 return "<div id='"+this.getSelectorId()+"' class='"+this.calendar.classNames.selector+"' style='"+_9 7+"'>"+"</div>";1045 var _9b="display: none; zindex:"+ZindexManager.getIndex(); 1046 return "<div id='"+this.getSelectorId()+"' class='"+this.calendar.classNames.selector+"' style='"+_9b+"'>"+"</div>"; 1041 1047 },buildCover:function(){ 1042 1048 this.cover=Builder.node("div",{id:this.calendar.element.id.appendSuffix("cover")}); … … 1049 1055 } 1050 1056 return this.cover; 1051 },changeCalendar:function(_98){ 1052 var _99=Event.element(_98); 1053 var _9a=this.calendar.date; 1054 var _9b=new Date(_9a.toDateString()); 1055 if(this.hasClassName(_99,Calendar.className.preYearMark)){ 1056 _9a.setDate(1); 1057 _9a.setFullYear(_9a.getFullYear()-1); 1058 }else{ 1059 if(this.hasClassName(_99,Calendar.className.preMonthMark)){ 1060 _9a.setDate(1); 1061 _9a.setMonth(_9a.getMonth()-1); 1062 }else{ 1063 if(this.hasClassName(_99,Calendar.className.preWeekMark)){ 1064 _9a.setDate(_9a.getDate()-7); 1065 }else{ 1066 if(this.hasClassName(_99,Calendar.className.nextYearMark)){ 1067 _9a.setDate(1); 1068 _9a.setFullYear(_9a.getFullYear()+1); 1069 }else{ 1070 if(this.hasClassName(_99,Calendar.className.nextMonthMark)){ 1071 _9a.setDate(1); 1072 _9a.setMonth(_9a.getMonth()+1); 1073 }else{ 1074 if(this.hasClassName(_99,Calendar.className.nextWeekMark)){ 1075 _9a.setDate(_9a.getDate()+7); 1076 } 1077 } 1078 } 1079 } 1080 } 1081 } 1082 this.calendar.options.changeCalendar(_9a,_9b); 1057 },changeCalendar:function(_9c){ 1058 var _9d=Event.element(_9c); 1059 if(_9d.tagName.toLowerCase().match(/a/)){ 1060 _9d=_9d.parentNode; 1061 } 1062 var _9e=this.calendar.date; 1063 var _9f=new Date(_9e.toDateString()); 1064 if(this.hasClassName(_9d,Calendar.className.preYearMark)||this.hasClassName(_9d,Calendar.className.preYearMark2)){ 1065 _9e.setDate(1); 1066 _9e.setFullYear(_9e.getFullYear()-1); 1067 }else{ 1068 if(this.hasClassName(_9d,Calendar.className.preMonthMark)||this.hasClassName(_9d,Calendar.className.preMonthMark2)){ 1069 _9e.setDate(1); 1070 _9e.setMonth(_9e.getMonth()-1); 1071 }else{ 1072 if(this.hasClassName(_9d,Calendar.className.preWeekMark)||this.hasClassName(_9d,Calendar.className.preWeekMark2)){ 1073 _9e.setDate(_9e.getDate()-7); 1074 }else{ 1075 if(this.hasClassName(_9d,Calendar.className.nextYearMark)||this.hasClassName(_9d,Calendar.className.nextYearMark2)){ 1076 _9e.setDate(1); 1077 _9e.setFullYear(_9e.getFullYear()+1); 1078 }else{ 1079 if(this.hasClassName(_9d,Calendar.className.nextMonthMark)||this.hasClassName(_9d,Calendar.className.nextMonthMark2)){ 1080 _9e.setDate(1); 1081 _9e.setMonth(_9e.getMonth()+1); 1082 }else{ 1083 if(this.hasClassName(_9d,Calendar.className.nextWeekMark)||this.hasClassName(_9d,Calendar.className.nextWeekMark2)){ 1084 _9e.setDate(_9e.getDate()+7); 1085 } 1086 } 1087 } 1088 } 1089 } 1090 } 1091 this.calendar.options.changeCalendar(_9e,_9f); 1083 1092 this.calendar.refresh(); 1084 },hasClassName:function(_ 9c,_9d){1085 return Element.hasClassName(_ 9c,_9d)||Element.hasClassName(_9c,_9d+"Hover");1086 },clickDeleteImage:function(_ 9e){1087 if(this.calendar.options.beforeRemoveSchedule(_ 9e)){1088 this.calendar.removeSchedule(_ 9e.id,true);1089 } 1090 },clickCopyImage:function(_ 9f){1091 this.calendar.options.copySchedule(_ 9f,true);1092 },showImage:function(_a 0,_a1){1093 _a 0.each(function(img){1093 },hasClassName:function(_a0,_a1){ 1094 return Element.hasClassName(_a0,_a1)||Element.hasClassName(_a0,_a1+"Hover"); 1095 },clickDeleteImage:function(_a2){ 1096 if(this.calendar.options.beforeRemoveSchedule(_a2)){ 1097 this.calendar.removeSchedule(_a2.id,true); 1098 } 1099 },clickCopyImage:function(_a3){ 1100 this.calendar.options.copySchedule(_a3,true); 1101 },showImage:function(_a4,_a5){ 1102 _a4.each(function(img){ 1094 1103 Element.show(img); 1095 1104 }); 1096 if(_a 1){1097 Element.setStyle(_a 1,{right:(17*_a0.length)+"px"});1098 } 1099 },hideImage:function(_a 3,_a4){1100 _a 3.each(function(img){1105 if(_a5){ 1106 Element.setStyle(_a5,{right:(17*_a4.length)+"px"}); 1107 } 1108 },hideImage:function(_a7,_a8){ 1109 _a7.each(function(img){ 1101 1110 Element.hide(img); 1102 1111 }); 1103 if(_a 4){1104 Element.setStyle(_a 4,{right:"0px"});1105 } 1106 },_constrain:function(n,_a 7,_a8){1107 if(n>_a 8){1108 return _a 8;1109 }else{ 1110 if(n<_a 7){1111 return _a 7;1112 if(_a8){ 1113 Element.setStyle(_a8,{right:"0px"}); 1114 } 1115 },_constrain:function(n,_ab,_ac){ 1116 if(n>_ac){ 1117 return _ac; 1118 }else{ 1119 if(n<_ab){ 1120 return _ab; 1112 1121 }else{ 1113 1122 return n; … … 1121 1130 return this.calendar.element.id.appendSuffix(AbstractCalendar.id.scheduleContainer); 1122 1131 },setColumnWidth:function(){ 1123 var _a 9=this.getAdjustSize();1124 var _a a=$(this.getScheduleContainerId())||this.container;1125 var _a b=this.calendar.options.displayIndexes;1126 this.column.width=_a a.offsetWidth/_ab.length-_a9;1132 var _ad=this.getAdjustSize(); 1133 var _ae=$(this.getScheduleContainerId())||this.container; 1134 var _af=this.calendar.options.displayIndexes; 1135 this.column.width=_ae.offsetWidth/_af.length-_ad; 1127 1136 if(this.column.width<0){ 1128 1137 this.column.width=0; 1129 1138 } 1130 1139 },setCover:function(){ 1131 var _ ac=$(this.getScheduleContainerId())||this.container;1140 var _b0=$(this.getScheduleContainerId())||this.container; 1132 1141 this.cover=this.cover||$(this.calendar.element.id.appendSuffix("cover")); 1133 1142 if(this.cover){ … … 1135 1144 this.cover=null; 1136 1145 } 1137 _ ac.appendChild(this.buildCover());1138 Element.setStyle(this.cover,{height:Element.getHeight(_ ac)+"px"});1146 _b0.appendChild(this.buildCover()); 1147 Element.setStyle(this.cover,{height:Element.getHeight(_b0)+"px"}); 1139 1148 },getDragDistance:function(){ 1140 var _ ad=this.getAdjustSize();1141 return [this.column.width+_ ad,this.column.height/2];1149 var _b1=this.getAdjustSize(); 1150 return [this.column.width+_b1,this.column.height/2]; 1142 1151 },getWeek:function(){ 1143 var _ ae=this.calendar.date;1144 var _ af=this.calendar.sortWeekIndex([0,1,2,3,4,5,6]);1145 var _b 0=_ae.getDay();1146 var _b 1=_af.indexOf(_b0);1147 var _b 2=[];1148 var _b 3=[];1149 var _b 4=this.calendar.options.displayIndexes;1150 _ af.each(function(_b5){1151 var _b 6=_b5-_b0;1152 var _b 7=_af.indexOf(_b5);1153 if((_b 7<_b1)&&(_b6>0)){1154 _b 6-=7;1155 }else{ 1156 if((_b 7>_b1)&&(_b6<0)){1157 _b 6+=7;1158 } 1159 } 1160 var _b 8=DateUtil.afterDays(_ae,_b6);1161 if(_b 4.indexOf(_b5)>=0){1162 _b 2.push(_b8);1163 }else{ 1164 _b 3.push(_b8);1152 var _b2=this.calendar.date; 1153 var _b3=this.calendar.sortWeekIndex([0,1,2,3,4,5,6]); 1154 var _b4=_b2.getDay(); 1155 var _b5=_b3.indexOf(_b4); 1156 var _b6=[]; 1157 var _b7=[]; 1158 var _b8=this.calendar.options.displayIndexes; 1159 _b3.each(function(_b9){ 1160 var _ba=_b9-_b4; 1161 var _bb=_b3.indexOf(_b9); 1162 if((_bb<_b5)&&(_ba>0)){ 1163 _ba-=7; 1164 }else{ 1165 if((_bb>_b5)&&(_ba<0)){ 1166 _ba+=7; 1167 } 1168 } 1169 var _bc=DateUtil.afterDays(_b2,_ba); 1170 if(_b8.indexOf(_b9)>=0){ 1171 _b6.push(_bc); 1172 }else{ 1173 _b7.push(_bc); 1165 1174 } 1166 1175 }.bind(this)); 1167 return [_b 2,_b3];1168 },isSameStartDate:function(_b 9,_ba){1169 return ((_b a.getFullYear()==_b9.start.year)&&(_ba.getMonth()==_b9.start.month)&&(_ba.getDate()==_b9.start.day));1170 },isSameFinishDate:function(_b b,_bc){1171 return ((_ bc.getFullYear()==_bb.finish.year)&&(_bc.getMonth()==_bb.finish.month)&&(_bc.getDate()==_bb.finish.day));1176 return [_b6,_b7]; 1177 },isSameStartDate:function(_bd,_be){ 1178 return ((_be.getFullYear()==_bd.start.year)&&(_be.getMonth()==_bd.start.month)&&(_be.getDate()==_bd.start.day)); 1179 },isSameFinishDate:function(_bf,_c0){ 1180 return ((_c0.getFullYear()==_bf.finish.year)&&(_c0.getMonth()==_bf.finish.month)&&(_c0.getDate()==_bf.finish.day)); 1172 1181 },getSelectorId:function(){ 1173 1182 return this.calendar.element.id.appendSuffix(AbstractCalendar.id.selector); 1174 },clickDateText:function(_ bd,_be){1175 Event.stop(_ bd);1176 this.calendar.date=_ be;1183 },clickDateText:function(_c1,_c2){ 1184 Event.stop(_c1); 1185 this.calendar.date=_c2; 1177 1186 this.calendar.options.displayType="day"; 1178 1187 this.calendar.refresh(); … … 1183 1192 this.containerDimensions=Element.getDimensions(this.container); 1184 1193 this.containerOffset=Position.cumulativeOffset(this.container); 1185 },mouseOverSubSchedule:function(_bf){ 1186 _bf.each(function(_c0){ 1187 var _c1=Element.getStyle(_c0,"borderTopColor"); 1188 var _c2=Element.getStyle(_c0,"borderTop"); 1189 if(_c1&&(_c1!="")&&_c2&&(_c2!="")){ 1190 if(!_c0.originalBorderColor){ 1191 _c0.originalBorderColor=_c1; 1192 } 1193 Element.setStyle(_c0,{borderColor:new Color(_c1).invert()}); 1194 }else{ 1195 Element.addClassName(_c0,Calendar.className.scheduleItemSelect); 1196 } 1197 }); 1198 },mouseOutSubSchedule:function(_c3){ 1194 },mouseOverSubSchedule:function(_c3){ 1199 1195 _c3.each(function(_c4){ 1200 if(_c4.originalBorderColor){ 1201 Element.setStyle(_c4,{borderColor:_c4.originalBorderColor}); 1202 }else{ 1203 Element.removeClassName(_c4,Calendar.className.scheduleItemSelect); 1204 } 1205 }); 1206 },toDate:function(_c5){ 1207 return DateUtil.toDate(_c5); 1196 var _c5=Element.getStyle(_c4,"borderTopColor"); 1197 var _c6=Element.getStyle(_c4,"borderTop"); 1198 if(_c5&&(_c5!="")&&_c6&&(_c6!="")){ 1199 if(!_c4.originalBorderColor){ 1200 _c4.originalBorderColor=_c5; 1201 } 1202 Element.setStyle(_c4,{borderColor:new Color(_c5).invert()}); 1203 }else{ 1204 Element.addClassName(_c4,Calendar.className.scheduleItemSelect); 1205 } 1206 }); 1207 },mouseOutSubSchedule:function(_c7){ 1208 _c7.each(function(_c8){ 1209 if(_c8.originalBorderColor){ 1210 Element.setStyle(_c8,{borderColor:_c8.originalBorderColor}); 1211 }else{ 1212 Element.removeClassName(_c8,Calendar.className.scheduleItemSelect); 1213 } 1214 }); 1215 },toDate:function(_c9){ 1216 return DateUtil.toDate(_c9); 1208 1217 },getCalendarTableId:function(){ 1209 1218 return this.ids.calTable; 1210 1219 },setSkipNode:function(){ 1211 var _c 6=new Template(this.calendar.options.skipString);1212 this.skipNode.each(function(_c 7){1213 _c 7.value.innerHTML=_c6.evaluate({count:this.skipSchedules[_c7.key].length});1220 var _ca=new Template(this.calendar.options.skipString); 1221 this.skipNode.each(function(_cb){ 1222 _cb.value.innerHTML=_ca.evaluate({count:this.skipSchedules[_cb.key].length}); 1214 1223 }.bind(this)); 1215 1224 },clickSkipNode:function(){ 1216 1225 this.hideTooltip(); 1217 1226 this.calendar.options.clickSkipNode.apply(this,arguments); 1218 },showTooltip:function(e,id,_c a){1219 var _c b=$(this.getTooltipId());1220 var _ cc=this.skipSchedules[id];1221 var _ cd=null;1222 var _ ce=null;1223 _c b.innerHTML=_cc.map(function(s){1224 _ cd=(DateUtil.toDate(s.start).sameDate(_ca))?s.start:{hour:0,min:0};1225 _ ce=(DateUtil.toDate(s.finish).sameDate(_ca))?s.finish:{hour:0,min:0};1226 return this.calendar.formatTime(_ cd)+"-"+this.calendar.formatTime(_ce)+" "+s.description;1227 },showTooltip:function(e,id,_ce){ 1228 var _cf=$(this.getTooltipId()); 1229 var _d0=this.skipSchedules[id]; 1230 var _d1=null; 1231 var _d2=null; 1232 _cf.innerHTML=_d0.map(function(s){ 1233 _d1=(DateUtil.toDate(s.start).sameDate(_ce))?s.start:{hour:0,min:0}; 1234 _d2=(DateUtil.toDate(s.finish).sameDate(_ce))?s.finish:{hour:0,min:0}; 1235 return this.calendar.formatTime(_d1)+"-"+this.calendar.formatTime(_d2)+" "+s.description; 1227 1236 }.bind(this)).join("<br />"); 1228 Element.positionedByCursor(_c b,e,{top:10,left:10});1229 _c b.show();1237 Element.positionedByCursor(_cf,e,{top:10,left:10}); 1238 _cf.show(); 1230 1239 },hideTooltip:function(){ 1231 1240 $(this.getTooltipId()).hide(); … … 1234 1243 CalendarMonth.id=["year","month","column","nextYear","nextMonth","preYear","preMonth","calTable","scheduleContainer","container","emptyRow"]; 1235 1244 Object.extend(CalendarMonth.prototype,AbstractCalendar.prototype); 1236 Object.extend(CalendarMonth.prototype,{initialize:function(_d 0){1237 this.calendar=_d 0;1245 Object.extend(CalendarMonth.prototype,{initialize:function(_d4){ 1246 this.calendar=_d4; 1238 1247 this.week=this.getWeek()[0]; 1239 1248 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarMonth.id); 1240 1249 this.columnIds=[]; 1241 1250 },buildHeaderLeft:function(){ 1251 if(this.calendar.options.useImgMark){ 1242 1252 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.preYear+"' class='"+this.calendar.classNames.preYearMark+"'></div>"+"<div id='"+this.ids.preMonth+"' class='"+this.calendar.classNames.preMonthMark+"'></div>"+"</td>"; 1253 } 1254 return "<td class='"+this.calendar.classNames.preYears2+"'>"+"<div id='"+this.ids.preYear+"' class='"+this.calendar.classNames.preYearMark2+"'><a href=\"javascript:void(0)\">"+Calendar.marks.preYear+"</a></div>"+"<div id='"+this.ids.preMonth+"' class='"+this.calendar.classNames.preMonthMark2+"'><a href=\"javascript:void(0)\">"+Calendar.marks.preMonth+"</a></div>"+"</td>"; 1243 1255 },buildHeaderCenter:function(){ 1244 var _d 1=[];1256 var _d5=[]; 1245 1257 if(this.calendar.options.monthHeaderFormat){ 1246 var _d 2=this.calendar.date;1247 var _d 3=new Template(this.calendar.options.monthHeaderFormat).evaluate({year:_d2.getFullYear(),month:_d2.getMonth()+1});1248 _d 1=[_d3," "];1249 } 1250 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.ids.month+"' class='"+this.calendar.classNames.ym+"'>"+(_d 1[0]||DateUtil.months[this.calendar.date.getMonth()])+"</span>"+"<span id='"+this.ids.year+"' class='"+this.calendar.classNames.ym+"'>"+(_d1[1]||this.calendar.date.getFullYear())+"</span>"+"</td>";1258 var _d6=this.calendar.date; 1259 var _d7=new Template(this.calendar.options.monthHeaderFormat).evaluate({year:_d6.getFullYear(),month:_d6.getMonth()+1}); 1260 _d5=[_d7," "]; 1261 } 1262 return "<td class='"+this.calendar.classNames.years+"'>"+"<span id='"+this.ids.month+"' class='"+this.calendar.classNames.ym+"'>"+(_d5[0]||DateUtil.months[this.calendar.date.getMonth()])+"</span>"+"<span id='"+this.ids.year+"' class='"+this.calendar.classNames.ym+"'>"+(_d5[1]||this.calendar.date.getFullYear())+"</span>"+"</td>"; 1251 1263 },buildHeaderRight:function(){ 1264 if(this.calendar.options.useImgMark){ 1252 1265 return "<td class='"+this.calendar.classNames.nextYears+"'>"+"<div id='"+this.ids.nextMonth+"' class='"+this.calendar.classNames.nextMonthMark+"'></div>"+"<div id='"+this.ids.nextYear+"' class='"+this.calendar.classNames.nextYearMark+"'></div>"+"</td>"; 1266 } 1267 return "<td class='"+this.calendar.classNames.nextYears2+"' align='right'>"+"<div id='"+this.ids.nextMonth+"' class='"+this.calendar.classNames.nextMonthMark2+"'><a href=\"javascript:void(0)\">"+Calendar.marks.nextMonth+"</a></div>"+"<div id='"+this.ids.nextYear+"' class='"+this.calendar.classNames.nextYearMark2+"'><a href=\"javascript:void(0)\">"+Calendar.marks.nextYear+"</a></div>"+"</td>"; 1253 1268 },buildCalendar:function(){ 1254 1269 return "<div>"+this.buildTableHeader()+this.buildScheduleContainer()+"</div>"; 1255 1270 },buildTableHeader:function(){ 1256 var _d 4=100/this.calendar.options.displayIndexes.length+"%";1257 var _d 5=this.calendar.options.displayIndexes.last();1258 var _d 6=this.ids.column;1259 var _d 7=this.calendar.options.displayIndexes.inject("",function(_d8,i){1260 var id=_d 6.appendSuffix(i);1271 var _d8=100/this.calendar.options.displayIndexes.length+"%"; 1272 var _d9=this.calendar.options.displayIndexes.last(); 1273 var _da=this.ids.column; 1274 var _db=this.calendar.options.displayIndexes.inject("",function(_dc,i){ 1275 var id=_da.appendSuffix(i); 1261 1276 this.columnIds.push(id); 1262 var _d b=(_d5==i)?this.calendar.classNames.thRight:"";1263 _d 8+="<th id='"+id+"' class='"+_db+"' width='"+_d4+"'>"+this.calendar.options.dayOfWeek[i]+"</th>";1264 return _d 8;1277 var _df=(_d9==i)?this.calendar.classNames.thRight:""; 1278 _dc+="<th id='"+id+"' class='"+_df+"' width='"+_d8+"'>"+this.calendar.options.dayOfWeek[i]+"</th>"; 1279 return _dc; 1265 1280 }.bind(this)); 1266 return "<table class='"+this.calendar.classNames.table+"'>"+"<tr>"+_d 7+"</tr>"+"</table>";1281 return "<table class='"+this.calendar.classNames.table+"'>"+"<tr>"+_db+"</tr>"+"</table>"; 1267 1282 },buildScheduleContainer:function(){ 1268 var _ dc=(this.calendar.options.size=="large")?"position: relative":"";1269 return "<div id='"+this.getScheduleContainerId()+"' style='"+_ dc+";'>"+this.buildTableData()+this.buildSelector()+"</div>";1283 var _e0=(this.calendar.options.size=="large")?"position: relative":""; 1284 return "<div id='"+this.getScheduleContainerId()+"' style='"+_e0+";'>"+this.buildTableData()+this.buildSelector()+"</div>"; 1270 1285 },buildTableData:function(){ 1271 var _ dd=this.calendar.options.displayIndexes;1272 var _ de=new Date();1273 var _ df=this.calendar.date.getFullYear();1274 var _e 0=this.calendar.date.getMonth();1275 var _e 1=DateUtil.getFirstDate(_df,_e0).getDay();1276 var _e 2=DateUtil.getLastDate(_df,_e0).getDate();1286 var _e1=this.calendar.options.displayIndexes; 1287 var _e2=new Date(); 1288 var _e3=this.calendar.date.getFullYear(); 1289 var _e4=this.calendar.date.getMonth(); 1290 var _e5=DateUtil.getFirstDate(_e3,_e4).getDay(); 1291 var _e6=DateUtil.getLastDate(_e3,_e4).getDate(); 1277 1292 var trs=[]; 1278 1293 var tds=[]; 1279 var _e 5=100/_dd.length+"%";1280 var _e 6=_dd.last();1281 var _e 7,_e8,_e9,_ea,_eb,i=null;1294 var _e9=100/_e1.length+"%"; 1295 var _ea=_e1.last(); 1296 var _eb,_ec,_ed,_ee,_ef,i=null; 1282 1297 this.dateMap={}; 1283 var _ ed=this.calendar.options.weekIndex;1284 var _ ee=DateUtil.dayOfWeek.length*6;1298 var _f1=this.calendar.options.weekIndex; 1299 var _f2=DateUtil.dayOfWeek.length*6; 1285 1300 var i=null; 1286 1301 var day=1; 1287 if(_ ed<=_e1){1288 i=_ ed;1289 _ ee+=i;1290 }else{ 1291 i=_ ed-7;1292 _ ee-=i;1293 } 1294 var _f 0=_e1-_ed;1295 if(_f 0<0){1296 _f 0+DateUtil.dayOfWeek.length;1297 } 1298 if((_e 2+_f0)>_ee){1299 _ ee+=DateUtil.dayOfWeek.length;1300 } 1301 var _f 1=_ed;1302 var _f 2=0;1303 for(;i<_ ee;i++){1304 if(_ dd.include(_f1)){1305 var _f 3=(_f1==_e6)?this.calendar.classNames.tdRight:"";1306 if(i<_e 1){1307 var _f 4=i-_e1+1;1308 _e a=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),_f4);1309 tds.push(this.buildEmptyRow(_e a,_e5,_f3,_f4));1310 }else{ 1311 if(day>_e 2){1312 _e a=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day);1313 tds.push(this.buildEmptyRow(_e a,_e5,_f3,day));1314 }else{ 1315 if(i==_e 1){1316 _ ee+=_f2;1317 } 1318 _e a=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day);1319 _e 8=this.calendar.options.holidays[_ea.toDateString()];1302 if(_f1<=_e5){ 1303 i=_f1; 1304 _f2+=i; 1305 }else{ 1306 i=_f1-7; 1307 _f2-=i; 1308 } 1309 var _f4=_e5-_f1; 1310 if(_f4<0){ 1311 _f4+DateUtil.dayOfWeek.length; 1312 } 1313 if((_e6+_f4)>_f2){ 1314 _f2+=DateUtil.dayOfWeek.length; 1315 } 1316 var _f5=_f1; 1317 var _f6=0; 1318 for(;i<_f2;i++){ 1319 if(_e1.include(_f5)){ 1320 var _f7=(_f5==_ea)?this.calendar.classNames.tdRight:""; 1321 if(i<_e5){ 1322 var _f8=i-_e5+1; 1323 _ee=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),_f8); 1324 tds.push(this.buildEmptyRow(_ee,_e9,_f7,_f8)); 1325 }else{ 1326 if(day>_e6){ 1327 _ee=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day); 1328 tds.push(this.buildEmptyRow(_ee,_e9,_f7,day)); 1329 }else{ 1330 if(i==_e5){ 1331 _f2+=_f6; 1332 } 1333 _ee=new Date(this.calendar.date.getFullYear(),this.calendar.date.getMonth(),day); 1334 _ec=this.calendar.options.holidays[_ee.toDateString()]; 1320 1335 if(this.calendar.options.size==Calendar.size.large){ 1321 tds.push(this.buildLargeRow(_e a,_e8,_de,_e5,_f3));1322 }else{ 1323 _e 9=this.calendar.options.schedules.detect(function(_f5){1324 return this.calendar.betweenDate(_f 5,_ea);1336 tds.push(this.buildLargeRow(_ee,_ec,_e2,_e9,_f7)); 1337 }else{ 1338 _ed=this.calendar.options.schedules.detect(function(_f9){ 1339 return this.calendar.betweenDate(_f9,_ee); 1325 1340 }.bind(this)); 1326 tds.push(this.buildSmallRow(_e a,_e8,_e9,_de,_e5,_f3));1327 } 1328 } 1329 } 1330 _f 2++;1331 } 1332 if(i>=_e 1){1341 tds.push(this.buildSmallRow(_ee,_ec,_ed,_e2,_e9,_f7)); 1342 } 1343 } 1344 } 1345 _f6++; 1346 } 1347 if(i>=_e5){ 1333 1348 day++; 1334 1349 } 1335 if(_f 1==_e6){1350 if(_f5==_ea){ 1336 1351 if(!(tds.first().match(/empty/)&&tds.last().match(/empty/))){ 1337 1352 trs.push("<tr>"+tds.join("")+"</tr>"); … … 1339 1354 tds=[]; 1340 1355 } 1341 if(_f 1>=6){1342 _f 1=0;1343 }else{ 1344 _f 1++;1356 if(_f5>=6){ 1357 _f5=0; 1358 }else{ 1359 _f5++; 1345 1360 } 1346 1361 } 1347 1362 this.rowMax=trs.length-1; 1348 1363 return "<table id='"+this.getCalendarTableId()+"' class='"+this.calendar.classNames.table+"'>"+trs.join("")+"</table>"; 1349 },buildEmptyRow:function(_f 6,_f7,_f8,_f9){1350 var id=this.ids.emptyRow.appendSuffix(_f 9);1351 this.dateMap[id]=_f 6;1352 return "<td id='"+id+"' class='"+_f 8+"' width='"+_f7+"'> </td>";1353 },buildLargeRow:function(_f b,_fc,_fd,_fe,_ff){1354 var _10 0=null;1355 var _10 1=(_fb.days()==_fd.days())?this.calendar.classNames.highlightDay:"";1356 var _10 2=this.calendar.options.clickDateText;1357 if(_10 2||(_102==null)){1358 _10 0="<span class='"+_101+"'>"+_fb.getDate()+"</span>";1359 }else{ 1360 _10 0="<span class='"+_101+"' style='text-decoration: none;'>"+_fb.getDate()+"</span>";1361 } 1362 var _10 3="";1364 },buildEmptyRow:function(_fa,_fb,_fc,_fd){ 1365 var id=this.ids.emptyRow.appendSuffix(_fd); 1366 this.dateMap[id]=_fa; 1367 return "<td id='"+id+"' class='"+_fc+"' width='"+_fb+"'> </td>"; 1368 },buildLargeRow:function(_ff,_100,_101,_102,_103){ 1369 var _104=null; 1370 var _105=(_ff.days()==_101.days())?this.calendar.classNames.highlightDay:""; 1371 var _106=this.calendar.options.clickDateText; 1372 if(_106||(_106==null)){ 1373 _104="<span class='"+_105+"'>"+_ff.getDate()+"</span>"; 1374 }else{ 1375 _104="<span class='"+_105+"' style='text-decoration: none;'>"+_ff.getDate()+"</span>"; 1376 } 1377 var _107=""; 1363 1378 var name=""; 1364 if(_ fc){1365 _10 3=this.calendar.classNames.holiday;1366 name="<span class='"+this.calendar.classNames.holidayName+"'>"+_ fc.name+"</span>";1367 }else{ 1368 if(this.calendar.isRegularHoliday(_f b.getDay())){1369 _10 3=this.calendar.classNames.regularHoliday;1370 }else{ 1371 _10 3=this.calendar.classNames.date;1372 } 1373 } 1374 _ ff=[_103,_ff];1375 var id=this.getDateId(_f b);1376 this.dateMap[id]=_f b;1377 return "<td id='"+id+"' class='"+_ ff.join(" ")+"' width='"+_fe+"'>"+"<div class='"+this.calendar.classNames.dateContainer+"'>"+_100+name+"</div>"+"</td>";1378 },buildSmallRow:function(date,_10 7,_108,_109,_10a,_10b){1379 if(_100){ 1380 _107=this.calendar.classNames.holiday; 1381 name="<span class='"+this.calendar.classNames.holidayName+"'>"+_100.name+"</span>"; 1382 }else{ 1383 if(this.calendar.isRegularHoliday(_ff.getDay())){ 1384 _107=this.calendar.classNames.regularHoliday; 1385 }else{ 1386 _107=this.calendar.classNames.date; 1387 } 1388 } 1389 _103=[_107,_103]; 1390 var id=this.getDateId(_ff); 1391 this.dateMap[id]=_ff; 1392 return "<td id='"+id+"' class='"+_103.join(" ")+"' width='"+_102+"'>"+"<div class='"+this.calendar.classNames.dateContainer+"'>"+_104+name+"</div>"+"</td>"; 1393 },buildSmallRow:function(date,_10b,_10c,_10d,_10e,_10f){ 1379 1394 var id=this.getDateId(date); 1380 1395 this.dateMap[id]=date; 1381 var _1 0d=$H({id:id,width:_10a});1382 _10 b=[];1383 if(_10 8){1384 _10 b.push(this.calendar.classNames.schedule);1385 var _1 0e=_108[0];1386 if(_1 0e){1387 _1 0d.title=_10e.description;1388 } 1389 }else{ 1390 if(_10 7){1391 _10 b.push(this.calendar.classNames.holiday);1392 _1 0d.title=_107.name.stripTags();1396 var _111=$H({id:id,width:_10e}); 1397 _10f=[]; 1398 if(_10c){ 1399 _10f.push(this.calendar.classNames.schedule); 1400 var _112=_10c[0]; 1401 if(_112){ 1402 _111.title=_112.description; 1403 } 1404 }else{ 1405 if(_10b){ 1406 _10f.push(this.calendar.classNames.holiday); 1407 _111.title=_10b.name.stripTags(); 1393 1408 }else{ 1394 1409 if(this.calendar.isRegularHoliday(date.getDay())){ 1395 _10 b.push(this.calendar.classNames.regularHoliday);1396 }else{ 1397 _10 b.push(this.calendar.classNames.date);1398 } 1399 } 1400 } 1401 if(date.days()==_10 9.days()){1402 _10 b.push(Calendar.className.highlightDay);1403 } 1404 _10 b.push(_10b);1405 _10 b=_10b.join(" ");1406 _1 0d=_10d.inject("",function(html,pair){1410 _10f.push(this.calendar.classNames.regularHoliday); 1411 }else{ 1412 _10f.push(this.calendar.classNames.date); 1413 } 1414 } 1415 } 1416 if(date.days()==_10d.days()){ 1417 _10f.push(Calendar.className.highlightDay); 1418 } 1419 _10f.push(_10f); 1420 _10f=_10f.join(" "); 1421 _111=_111.inject("",function(html,pair){ 1407 1422 return html+" "+pair.key+"=\""+pair.value+"\""; 1408 1423 }); 1409 return "<td class=\""+_10 b+"\""+_10d+">"+date.getDate()+"</td>";1424 return "<td class=\""+_10f+"\""+_111+">"+date.getDate()+"</td>"; 1410 1425 },beforeBuild:function(){ 1411 1426 this.column={}; … … 1414 1429 rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.dateContainer); 1415 1430 this.column.dateTextHeight=parseInt(rule.style["height"],10); 1416 },buildSchedule:function(_11 2,_113){1417 var _11 4=this.calendar.options.noEvent;1418 var id="scheduleItem_"+_11 2.id;1419 var _11 6=(_112.edit==undefined||_112.edit);1431 },buildSchedule:function(_116,_117){ 1432 var _118=this.calendar.options.noEvent; 1433 var id="scheduleItem_"+_116.id; 1434 var _11a=(_116.edit==undefined||_116.edit); 1420 1435 var item=Builder.node("DIV",{id:id}); 1421
