Changeset 5826
- Timestamp:
- 07/01/08 16:36:20 (2 months ago)
- Files:
-
- spinelz/trunk/compress/javascripts/spinelz/calendar.js (modified) (23 diffs)
- spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js (modified) (23 diffs)
- spinelz/trunk/compress/javascripts/spinelz_lib/spinelz_util.js (modified) (2 diffs)
- spinelz/trunk/compress/javascripts/spinelz_lib/spinelz_util_for_rubricks.js (modified) (2 diffs)
- spinelz/trunk/src/javascripts/spinelz/calendar.js (modified) (2 diffs)
- spinelz/trunk/src/javascripts/spinelz_lib/spinelz_util.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/compress/javascripts/spinelz/calendar.js
r5825 r5826 1242 1242 var _182=this.calendar.options.displayIndexes.length-1; 1243 1243 var _183=this.getAdjustSize(); 1244 new Draggable(item,{handle:_17a,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_184 ){1244 new Draggable(item,{handle:_17a,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,onStart:function(_184,_185){ 1245 1245 Element.show(_17e); 1246 },onDrag:function(_185,_186){ 1247 var _187=_185.element; 1248 var top=parseInt(Element.getStyle(_187,"top"),10)+_185.offset[1]; 1249 var _189=Math.floor(top/_180); 1250 var left=parseInt(Element.getStyle(_187,"left"),10)+_185.offset[0]; 1251 var _18b=Math.floor(left/_17f); 1252 if((_18b>=0&&_189>=0)&&(_18b<=_182&&_189<=_181)){ 1253 Element.setStyle(_17e,{left:_17f*_18b+_183*_18b+"px",top:_180*_189+"px"}); 1254 } 1255 },onEnd:function(_18c){ 1246 },onDrag:function(_186,_187){ 1247 var _188=_186.element; 1248 var top=parseInt(Element.getStyle(_188,"top"),10)+_186.offset[1]; 1249 var _18a=Math.floor(top/_180); 1250 var left=parseInt(Element.getStyle(_188,"left"),10)+_186.offset[0]; 1251 var _18c=Math.floor(left/_17f); 1252 if((_18c>=0&&_18a>=0)&&(_18c<=_182&&_18a<=_181)){ 1253 Element.setStyle(_17e,{left:_17f*_18c+_183*_18c+"px",top:_180*_18a+"px"}); 1254 } 1255 },onEnd:function(_18d,_18e){ 1256 var _18f=_18d.currentDelta(); 1256 1257 Element.hide(_17e); 1257 self.changeSchedule(_18c); 1258 if(_18f[0]==_18d.delta[0]&&_18f[1]==_18d.delta[1]){ 1259 self.calendar.refreshSchedule(); 1260 }else{ 1261 self.changeSchedule(_18d); 1262 } 1258 1263 }}); 1259 1264 },setResize:function(item){ 1260 1265 var self=this; 1261 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_1 8f){1262 self.updateTirm(_1 8f);1266 new CalendarResizeableEx(item,{left:0,top:0,bottom:0,distance:this.column.width,restriction:true,resize:function(_192){ 1267 self.updateTirm(_192); 1263 1268 }}); 1264 },getDate:function(_19 0){1269 },getDate:function(_193){ 1265 1270 var date=this.calendar.date; 1266 if(_19 0.constructor==String){1267 return new Date(date.getFullYear(),date.getMonth(),_19 0);1268 }else{ 1269 return new Date(date.getFullYear(),date.getMonth(),_19 0.id.getSuffix());1270 } 1271 },abstractSelect:function(_19 2,_193){1272 var _19 4=null;1271 if(_193.constructor==String){ 1272 return new Date(date.getFullYear(),date.getMonth(),_193); 1273 }else{ 1274 return new Date(date.getFullYear(),date.getMonth(),_193.id.getSuffix()); 1275 } 1276 },abstractSelect:function(_195,_196){ 1277 var _197=null; 1273 1278 if(this.calendar.options.size=="large"){ 1274 _19 4=this.findClickedElement(_192);1275 }else{ 1276 _19 4=Event.element(_192);1277 if(_19 4.tagName!="TD"){1278 _19 4=Element.getParentByTagName(["TD"],_194);1279 } 1280 } 1281 if(_19 4&&_194.id&&!_194.id.match(/emptyRow/)){1282 var date=this.getDate(_19 4);1283 _19 3(date,_194);1279 _197=this.findClickedElement(_195); 1280 }else{ 1281 _197=Event.element(_195); 1282 if(_197.tagName!="TD"){ 1283 _197=Element.getParentByTagName(["TD"],_197); 1284 } 1285 } 1286 if(_197&&_197.id&&!_197.id.match(/emptyRow/)){ 1287 var date=this.getDate(_197); 1288 _196(date,_197); 1284 1289 } 1285 1290 },getSelectedTerm:function(){ 1286 1291 var self=this; 1287 var _19 7=this.calendar.getSelected();1288 return [_19 7.first(),_197.last()].map(function(e){1292 var _19a=this.calendar.getSelected(); 1293 return [_19a.first(),_19a.last()].map(function(e){ 1289 1294 return self.getDate(e); 1290 1295 }); 1291 },selectDay:function(_19 9){1292 var _19 a=this.calendar;1293 var th=Event.element(_19 9);1296 },selectDay:function(_19c){ 1297 var _19d=this.calendar; 1298 var th=Event.element(_19c); 1294 1299 if(th.tagName!="TH"){ 1295 1300 th=Element.getParentByTagName("TH",th); … … 1297 1302 this.iterateTable({doCell:function(cell){ 1298 1303 if((cell.cellIndex==th.cellIndex)&&cell.id){ 1299 _19 a.addSelectedClass(cell);1304 _19d.addSelectedClass(cell); 1300 1305 } 1301 1306 }}); 1302 },inspectArgument:function(_1 9d,time){1307 },inspectArgument:function(_1a0,time){ 1303 1308 var self=this; 1304 var _1a 0=this.calendar.getSelected();1305 var _1a 1=[];1306 self.calendar.recurrence(_1 9d,function(o){1309 var _1a3=this.calendar.getSelected(); 1310 var _1a4=[]; 1311 self.calendar.recurrence(_1a0,function(o){ 1307 1312 if(!o.date){ 1308 _1a 0.each(function(d){1309 var _1a 4={};1313 _1a3.each(function(d){ 1314 var _1a7={}; 1310 1315 if(!o.date){ 1311 _1a 4={date:self.getDate(d)};1316 _1a7={date:self.getDate(d)}; 1312 1317 if(time){ 1313 _1a 4.start={hour:0,min:0};1314 _1a 4.finish={hour:0,min:0};1315 } 1316 } 1317 Object.extend(_1a 4,o);1318 _1a 1.push(_1a4);1318 _1a7.start={hour:0,min:0}; 1319 _1a7.finish={hour:0,min:0}; 1320 } 1321 } 1322 Object.extend(_1a7,o); 1323 _1a4.push(_1a7); 1319 1324 }); 1320 1325 }else{ 1321 1326 if(o.date.constructor==Object){ 1322 1327 o.date=new Date(o.date.year,o.date.month,o.date.day); 1323 _1a 1.push(o);1324 }else{ 1325 _1a 1.push(o);1326 } 1327 } 1328 }); 1329 return _1a 1;1328 _1a4.push(o); 1329 }else{ 1330 _1a4.push(o); 1331 } 1332 } 1333 }); 1334 return _1a4; 1330 1335 },inspectDateArgument:function(date){ 1331 1336 if(date){ … … 1340 1345 return map; 1341 1346 }else{ 1342 var _1a 7=this;1343 var _1a 8=this.calendar.getSelected();1344 if(_1a 8.length==0){1347 var _1aa=this; 1348 var _1ab=this.calendar.getSelected(); 1349 if(_1ab.length==0){ 1345 1350 return null; 1346 1351 } 1347 return _1a 8.collect(function(d){1348 return _1a 7.getDate(d);1349 }); 1350 } 1351 },findClickedElement:function(_1a a){1352 var _1a b=$(this.getScheduleContainerId());1353 var _1a c=Position.cumulativeOffset(_1ab);1354 var _1 ad=Position.realOffset(_1ab).last();1355 _1 ad-=document.documentElement.scrollTop||document.body.scrollTop;1356 var x=Event.pointerX(_1a a)-_1ac[0];1357 var y=Event.pointerY(_1a a)-_1ac[1]+_1ad;1358 var _1b 0=Math.floor(y/this.column.height);1359 var _1b 1=Math.floor(x/this.column.width);1360 return $(this.calendarTable.rows[_1b 0].cells[_1b1]);1361 },multipleSelection:function(_1b 2){1352 return _1ab.collect(function(d){ 1353 return _1aa.getDate(d); 1354 }); 1355 } 1356 },findClickedElement:function(_1ad){ 1357 var _1ae=$(this.getScheduleContainerId()); 1358 var _1af=Position.cumulativeOffset(_1ae); 1359 var _1b0=Position.realOffset(_1ae).last(); 1360 _1b0-=document.documentElement.scrollTop||document.body.scrollTop; 1361 var x=Event.pointerX(_1ad)-_1af[0]; 1362 var y=Event.pointerY(_1ad)-_1af[1]+_1b0; 1363 var _1b3=Math.floor(y/this.column.height); 1364 var _1b4=Math.floor(x/this.column.width); 1365 return $(this.calendarTable.rows[_1b3].cells[_1b4]); 1366 },multipleSelection:function(_1b5){ 1362 1367 if(!this.calendar.selectedBase||!this.calendar.mouseDown){ 1363 1368 return; 1364 1369 } 1365 1370 var self=this; 1366 var _1b 4=this.calendar;1367 var _1b 5=this.calendar.selectedBase;1368 this.abstractSelect(_1b 2,function(date,_1b7){1369 var _1b 8=$(_1b5.id);1370 var _1b 9=_1b4.createRange(parseInt(_1b8.id.getSuffix()),parseInt(_1b7.id.getSuffix()));1371 var _1b7=this.calendar; 1372 var _1b8=this.calendar.selectedBase; 1373 this.abstractSelect(_1b5,function(date,_1ba){ 1374 var _1bb=$(_1b8.id); 1375 var _1bc=_1b7.createRange(parseInt(_1bb.id.getSuffix()),parseInt(_1ba.id.getSuffix())); 1371 1376 self.iterateTable({doCell:function(cell){ 1372 1377 if(cell.tagName!="TD"||!cell.id){ … … 1374 1379 } 1375 1380 var id=parseInt(cell.id.getSuffix(),10); 1376 if(_1b 9.include(id)){1377 _1b 4.addSelectedClass(cell);1378 }else{ 1379 _1b 4.removeSelectedClass(cell);1381 if(_1bc.include(id)){ 1382 _1b7.addSelectedClass(cell); 1383 }else{ 1384 _1b7.removeSelectedClass(cell); 1380 1385 } 1381 1386 }}); 1382 1387 }); 1383 1388 },iterateTable:function(){ 1384 var _1b c=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]);1385 var _1 bd=$(this.getCalendarTableId());1386 if(_1b c.doTable){1387 _1b c.doTable(_1bd);1388 } 1389 $A(_1 bd.rows).each(function(row){1390 if(_1b c.doRow){1391 _1b c.doRow(row);1389 var _1bf=Object.extend({doTable:null,doRow:null,doCell:null},arguments[0]); 1390 var _1c0=$(this.getCalendarTableId()); 1391 if(_1bf.doTable){ 1392 _1bf.doTable(_1c0); 1393 } 1394 $A(_1c0.rows).each(function(row){ 1395 if(_1bf.doRow){ 1396 _1bf.doRow(row); 1392 1397 } 1393 1398 $A(row.cells).each(function(cell){ 1394 if(_1b c.doCell){1395 _1b c.doCell(cell);1396 } 1397 }); 1398 }); 1399 },findRow:function(_1c 0){1400 var _1c 1=$(this.getCalendarTableId());1401 return $A(_1c 1.rows).detect(function(row){1402 return row.rowIndex==_1c 0;1403 }); 1404 },findCell:function(_1c 3,_1c4){1405 return $A(this.findRow(_1c 3).cells).detect(function(cell){1406 return cell.cellIndex==_1c 4;1399 if(_1bf.doCell){ 1400 _1bf.doCell(cell); 1401 } 1402 }); 1403 }); 1404 },findRow:function(_1c3){ 1405 var _1c4=$(this.getCalendarTableId()); 1406 return $A(_1c4.rows).detect(function(row){ 1407 return row.rowIndex==_1c3; 1408 }); 1409 },findCell:function(_1c6,_1c7){ 1410 return $A(this.findRow(_1c6).cells).detect(function(cell){ 1411 return cell.cellIndex==_1c7; 1407 1412 }); 1408 1413 },getDateId:function(date){ … … 1422 1427 return {cellIndex:cell.cellIndex,rowIndex:row.rowIndex}; 1423 1428 } 1424 },changeSchedule:function(_1c c){1425 var _1 cd=_1cc.element;1426 var _1 ce=_1cd.schedule;1427 this.calendar.cacheSchedule(_1 ce);1428 var _1 cf=$(this.getSelectorId());1429 var top=parseInt(Element.getStyle(_1 cf,"top"),10);1430 var _1d 1=Math.floor(top/this.column.height);1431 var left=parseInt(Element.getStyle(_1 cf,"left"),10);1432 var _1d 3=Math.floor(left/this.column.width);1433 var _1d 4=$(this.getCalendarTableId());1434 var _1d 5=_1d4.rows.length-1;1435 var _1d 6=this.calendar.options.displayIndexes.length-1;1436 if((_1d 3>=0&&_1d1>=0)&&(_1d3<=_1d6&&_1d1<=_1d5)){1437 var cell=this.findCell(_1d 1,_1d3);1429 },changeSchedule:function(_1cf){ 1430 var _1d0=_1cf.element; 1431 var _1d1=_1d0.schedule; 1432 this.calendar.cacheSchedule(_1d1); 1433 var _1d2=$(this.getSelectorId()); 1434 var top=parseInt(Element.getStyle(_1d2,"top"),10); 1435 var _1d4=Math.floor(top/this.column.height); 1436 var left=parseInt(Element.getStyle(_1d2,"left"),10); 1437 var _1d6=Math.floor(left/this.column.width); 1438 var _1d7=$(this.getCalendarTableId()); 1439 var _1d8=_1d7.rows.length-1; 1440 var _1d9=this.calendar.options.displayIndexes.length-1; 1441 if((_1d6>=0&&_1d4>=0)&&(_1d6<=_1d9&&_1d4<=_1d8)){ 1442 var cell=this.findCell(_1d4,_1d6); 1438 1443 var date=new Date(this.calendar.date.getTime()); 1439 var _1d 9=_1cd.cellDate.days()-DateUtil.toDate(_1ce.start).days();1440 date.setDate(parseInt(cell.id.getSuffix(),10)-_1d 9);1441 var diff=this.getDayDiff(_1 ce);1442 var _1d b=date.advance({days:diff});1443 if(_1 ce.start.month==date.getMonth()&&_1ce.start.day==date.getDate()&&_1ce.finish.month==_1db.getMonth()&&_1ce.finish.day==_1db.getDate()){1444 var _1dc=_1d0.cellDate.days()-DateUtil.toDate(_1d1.start).days(); 1445 date.setDate(parseInt(cell.id.getSuffix(),10)-_1dc); 1446 var diff=this.getDayDiff(_1d1); 1447 var _1de=date.advance({days:diff}); 1448 if(_1d1.start.month==date.getMonth()&&_1d1.start.day==date.getDate()&&_1d1.finish.month==_1de.getMonth()&&_1d1.finish.day==_1de.getDate()){ 1444 1449 this.calendar.refreshSchedule(); 1445 1450 return; 1446 1451 } 1447 _1 ce.start.year=date.getFullYear();1448 _1 ce.start.month=date.getMonth();1449 _1 ce.start.day=date.getDate();1450 _1 ce.finish.year=_1db.getFullYear();1451 _1 ce.finish.month=_1db.getMonth();1452 _1 ce.finish.day=_1db.getDate();1452 _1d1.start.year=date.getFullYear(); 1453 _1d1.start.month=date.getMonth(); 1454 _1d1.start.day=date.getDate(); 1455 _1d1.finish.year=_1de.getFullYear(); 1456 _1d1.finish.month=_1de.getMonth(); 1457 _1d1.finish.day=_1de.getDate(); 1453 1458 this.calendar.refreshSchedule(); 1454 this.calendar.options.changeSchedule(_1 ce);1459 this.calendar.options.changeSchedule(_1d1); 1455 1460 }else{ 1456 1461 this.calendar.refreshSchedule(); 1457 1462 } 1458 },updateTirm:function(_1d c){1459 var _1 dd=_1dc.schedule;1460 var _1 de=parseInt(Element.getStyle(_1dc,"width"));1461 var top=parseInt(Element.getStyle(_1d c,"top"));1462 var left=parseInt(Element.getStyle(_1d c,"left"));1463 var _1e 1=Math.round((left+_1de)/this.column.width)-1;1464 var _1e 2=Math.round(top/this.column.height);1465 var cell=this.findCell(_1e 2,_1e1);1466 var _1e 4=_1dd.finish;1467 var _1e 5=null;1463 },updateTirm:function(_1df){ 1464 var _1e0=_1df.schedule; 1465 var _1e1=parseInt(Element.getStyle(_1df,"width")); 1466 var top=parseInt(Element.getStyle(_1df,"top")); 1467 var left=parseInt(Element.getStyle(_1df,"left")); 1468 var _1e4=Math.round((left+_1e1)/this.column.width)-1; 1469 var _1e5=Math.round(top/this.column.height); 1470 var cell=this.findCell(_1e5,_1e4); 1471 var _1e7=_1e0.finish; 1472 var _1e8=null; 1468 1473 if(this.dateMap){ 1469 _1e 5=this.dateMap[cell.id].toHash();1470 }else{ 1471 _1e 5=new Date(this.calendar.date.getTime());1472 _1e 5.setDate(parseInt(cell.id.getSuffix(),10));1473 _1e 5=_1e5.toHash();1474 } 1475 _1e 5.hour=_1e4.hour;1476 _1e 5.min=_1e4.min;1477 if(DateUtil.toDate(_1 dd.start).getTime()>=DateUtil.toDate(_1e5).getTime()){1478 var _1e 6=23;1479 var _1e 7=55;1480 if(_1 dd.start.hour==_1e6&&_1dd.start.min==_1e7){1474 _1e8=this.dateMap[cell.id].toHash(); 1475 }else{ 1476 _1e8=new Date(this.calendar.date.getTime()); 1477 _1e8.setDate(parseInt(cell.id.getSuffix(),10)); 1478 _1e8=_1e8.toHash(); 1479 } 1480 _1e8.hour=_1e7.hour; 1481 _1e8.min=_1e7.min; 1482 if(DateUtil.toDate(_1e0.start).getTime()>=DateUtil.toDate(_1e8).getTime()){ 1483 var _1e9=23; 1484 var _1ea=55; 1485 if(_1e0.start.hour==_1e9&&_1e0.start.min==_1ea){ 1481 1486 this.calendar.refreshSchedule(); 1482 if(!((_1e 5.year==_1e4.year)&&(_1e5.month==_1e4.month)&&(_1e5.day==_1e4.day))){1487 if(!((_1e8.year==_1e7.year)&&(_1e8.month==_1e7.month)&&(_1e8.day==_1e7.day))){ 1483 1488 this.calendar.options.updateTirm(); 1484 1489 } 1485 1490 return; 1486 1491 }else{ 1487 _1e 5.hour=_1e6;1488 _1e 5.min=_1e7;1489 } 1490 } 1491 _1 dd.finish=_1e5;1492 _1e8.hour=_1e9; 1493 _1e8.min=_1ea; 1494 } 1495 } 1496 _1e0.finish=_1e8; 1492 1497 this.calendar.refreshSchedule(); 1493 if(!((_1e 5.year==_1e4.year)&&(_1e5.month==_1e4.month)&&(_1e5.day==_1e4.day))){1494 this.calendar.options.updateTirm(_1 dd);1495 } 1496 },getTimeText:function(_1e 8,_1e9){1497 var _1e a=this.calendar;1498 return _1e a.formatTime(_1e8);1499 },getDayDiff:function(_1e b){1500 return DateUtil.numberOfDays(this.toDate(_1e b.start),this.toDate(_1eb.finish));1498 if(!((_1e8.year==_1e7.year)&&(_1e8.month==_1e7.month)&&(_1e8.day==_1e7.day))){ 1499 this.calendar.options.updateTirm(_1e0); 1500 } 1501 },getTimeText:function(_1eb,_1ec){ 1502 var _1ed=this.calendar; 1503 return _1ed.formatTime(_1eb); 1504 },getDayDiff:function(_1ee){ 1505 return DateUtil.numberOfDays(this.toDate(_1ee.start),this.toDate(_1ee.finish)); 1501 1506 }}); 1502 1507 var CalendarWeek=Class.create(); 1503 1508 CalendarWeek.id=["calTable","columnContainer","columnHeader","column","next","pre","headerText"]; 1504 1509 Object.extend(CalendarWeek.prototype,AbstractCalendar.prototype); 1505 Object.extend(CalendarWeek.prototype,{initialize:function(_1e c){1506 this.calendar=_1e c;1507 var _1 ed=this.getWeek();1508 this.week=_1 ed[0];1509 this.invisibleWeek=_1 ed[1];1510 Object.extend(CalendarWeek.prototype,{initialize:function(_1ef){ 1511 this.calendar=_1ef; 1512 var _1f0=this.getWeek(); 1513 this.week=_1f0[0]; 1514 this.invisibleWeek=_1f0[1]; 1510 1515 this.ids=SpinelzUtil.concat(this.calendar.element.id,CalendarWeek.id); 1511 1516 this.setDisplayTime(); … … 1513 1518 return "<td class='"+this.calendar.classNames.preYears+"'>"+"<div id='"+this.ids.pre+"' class='"+this.calendar.classNames.preWeekMark+"'></div>"+"</td>"; 1514 1519 },buildHeaderCenter:function(){ 1515 var _1 ee=[];1520 var _1f1=[]; 1516 1521 if(this.calendar.options.weekHeaderFormat){ 1517 _1 ee=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())];1518 } 1519 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1 ee[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1ee[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1ee[2]||this.week.last().toDateString())+"</span>"+"</td>";1522 _1f1=[this.formatHeaderDate(this.week.first()),"-",this.formatHeaderDate(this.week.last())]; 1523 } 1524 return "<td class='"+this.calendar.classNames.years+"'>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f1[0]||this.week[0].toDateString())+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f1[1]||"-")+"</span>"+"<span class='"+this.calendar.classNames.ym+"'>"+(_1f1[2]||this.week.last().toDateString())+"</span>"+"</td>"; 1520 1525 },formatHeaderDate:function(date){ 1521 1526 if(this.calendar.options.weekHeaderFormat){ … … 1526 1531 return "<td class='"+this.calendar.classNames.nextYears+"' align='right'>"+"<div id='"+this.ids.next+"' class='"+this.calendar.classNames.nextWeekMark+"'></div>"+"</td>"; 1527 1532 },buildCalendar:function(){ 1528 var _1f 0=(this.calendar.options.displayTimeLine)?this.buildTimeLine():"";1529 _1f 0+=this.buildCalendarContainer();1530 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1f 0+"</tr>"+"</table>";1533 var _1f3=(this.calendar.options.displayTimeLine)?this.buildTimeLine():""; 1534 _1f3+=this.buildCalendarContainer(); 1535 return "<table id='"+this.ids.columnContainer+"' class='"+this.calendar.classNames.weekTable+"'>"+"<tr>"+_1f3+"</tr>"+"</table>"; 1531 1536 },buildTimeLine:function(){ 1532 1537 var time=new Date(); 1533 var hour=0,_1f 3=24;1538 var hour=0,_1f6=24; 1534 1539 time.setHours(hour); 1535 1540 time.setMinutes(0); 1536 var _1f 4=this.buildTimeLineTop();1541 var _1f7=this.buildTimeLineTop(); 1537 1542 var now=new Date().getHours(); 1538 while(hour<_1f 3){1543 while(hour<_1f6){ 1539 1544 if(this.includeDisplayTime(hour)){ 1540 var _1f 6="pointer: default;";1541 if(_1f 4.length==0){1542 _1f 6+="border-top: none;";1543 } 1544 var _1f 7=this.calendar.classNames.timeLineTime;1545 var _1f9="pointer: default;"; 1546 if(_1f7.length==0){ 1547 _1f9+="border-top: none;"; 1548 } 1549 var _1fa=this.calendar.classNames.timeLineTime; 1545 1550 if(hour==now){ 1546 _1f 7+=" "+this.calendar.classNames.highlightTime;1547 } 1548 _1f 4+="<div class='"+_1f7+"' style='"+_1f6+"'>"+this.formatTime(time)+"</div>";1551 _1fa+=" "+this.calendar.classNames.highlightTime; 1552 } 1553 _1f7+="<div class='"+_1fa+"' style='"+_1f9+"'>"+this.formatTime(time)+"</div>"; 1549 1554 } 1550 1555 hour++; 1551 1556 time.setHours(hour); 1552 1557 } 1553 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1f 4+"</td>";1558 return "<td class='"+this.calendar.classNames.timeLine+"'>"+_1f7+"</td>"; 1554 1559 },buildTimeLineTop:function(){ 1555 1560 return "<div class='"+this.calendar.classNames.timeLineTimeTop+"'></div>"; … … 1557 1562 return "<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+this.buildCalendarHeader()+this.buildCalendarMain()+"</table>"+"</td>"; 1558 1563 },buildCalendarHeader:function(){ 1559 var _1f 8=this.calendar.options.displayIndexes;1564 var _1fb=this.calendar.options.displayIndexes; 1560 1565 var ths=""; 1561 var _1f a=new Date().days();1562 var _1f b=100/_1f8.length+"%";1563 var _1f c=this.calendar.element.id.appendSuffix(this.ids.column);1564 var _ 1fd=this.calendar.element.id.appendSuffix(this.ids.headerText);1566 var _1fd=new Date().days(); 1567 var _1fe=100/_1fb.length+"%"; 1568 var _1ff=this.calendar.element.id.appendSuffix(this.ids.column); 1569 var _200=this.calendar.element.id.appendSuffix(this.ids.headerText); 1565 1570 this.headers=[]; 1566 var _ 1fe=this.calendar.options.noEvent;1567 var _ 1ff=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null;1568 this.week.each(function(w,_20 1){1571 var _201=this.calendar.options.noEvent; 1572 var _202=(this.calendar.options.weekSubHeaderFormat)?new Template(this.calendar.options.weekSubHeaderFormat):null; 1573 this.week.each(function(w,_204){ 1569 1574 var text=null; 1570 if(_ 1ff){1571 text=_ 1ff.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]});1575 if(_202){ 1576 text=_202.evaluate({month:w.getMonth().succ(),day:w.getDate(),wday:this.calendar.options.dayOfWeek[w.getDay()]}); 1572 1577 }else{ 1573 1578 text=w.toDateString().split(" "); … … 1575 1580 text=text.join(" "); 1576 1581 } 1577 var _20 3=(w.days()==_1fa)?this.calendar.classNames.highlightDay:"";1578 var _20 4=_1fd.appendSuffix(_201);1582 var _206=(w.days()==_1fd)?this.calendar.classNames.highlightDay:""; 1583 var _207=_200.appendSuffix(_204); 1579 1584 var node="<div class='"+this.calendar.classNames.headerColumn+"'>"; 1580 if(_ 1fe){1581 node+="<span='#' id='"+_20 4+"' class='"+_203+"' style='cursor: default;'>"+text+"</a>";1582 }else{ 1583 node+="<a href='#' id='"+_20 4+"' class='"+_203+"'>"+text+"</a>";1585 if(_201){ 1586 node+="<span='#' id='"+_207+"' class='"+_206+"' style='cursor: default;'>"+text+"</a>"; 1587 }else{ 1588 node+="<a href='#' id='"+_207+"' class='"+_206+"'>"+text+"</a>"; 1584 1589 } 1585 1590 node+="</div>"; 1586 this.headers.push({id:_20 4,wday:w});1587 ths+="<th id='"+_1f c.appendSuffix(_201)+"' width='"+_1fb+"'>"+node+"</th>";1591 this.headers.push({id:_207,wday:w}); 1592 ths+="<th id='"+_1ff.appendSuffix(_204)+"' width='"+_1fe+"'>"+node+"</th>"; 1588 1593 }.bind(this)); 1589 1594 return "<tr>"+"<td>"+"<table class='"+this.calendar.classNames.weekMainTable+"'>"+"<tr>"+ths+"</tr>"+"</table>"+"</td>"+"</tr>"; 1590 1595 },buildCalendarMain:function(){ 1591 var _20 6=this.calendar.options.displayIndexes;1596 var _209=this.calendar.options.displayIndexes; 1592 1597 var tds=""; 1593 var _20 8=100/_206.length+"%";1598 var _20b=100/_209.length+"%"; 1594 1599 this.dateMap={}; 1595 this.week.each(function(w,_20 a){1596 var _20 b=this.calendar.options.schedules[w.toDateString()];1597 var _20 c="";1600 this.week.each(function(w,_20d){ 1601 var _20e=this.calendar.options.schedules[w.toDateString()]; 1602 var _20f=""; 1598 1603 var i=0,j=0; 1599 1604 while(i<24){ 1600 1605 if(this.includeDisplayTime(i)){ 1601 var _2 0f="";1602 if(_20 c.length==0){1603 _2 0f=this.calendar.classNames.columnTopDate;1606 var _212=""; 1607 if(_20f.length==0){ 1608 _212=this.calendar.classNames.columnTopDate; 1604 1609 }else{ 1605 1610 if(i%1==0){ 1606 _2 0f=this.calendar.classNames.columnDate;1607 }else{ 1608 _2 0f=this.calendar.classNames.columnDateOdd;1609 } 1610 } 1611 var id=this.getDateId(w,i,_20 a);1611 _212=this.calendar.classNames.columnDate; 1612 }else{ 1613 _212=this.calendar.classNames.columnDateOdd; 1614 } 1615 } 1616 var id=this.getDateId(w,i,_20d); 1612 1617 var hour=i/1; 1613 1618 var min=i%1*60; 1614 1619 this.dateMap[id]=new Date(w.getFullYear(),w.getMonth(),w.getDate(),hour,min,0); 1615 _20 c+="<div id='"+id+"' class='"+_20f+"'></div>";1620 _20f+="<div id='"+id+"' class='"+_212+"'></div>"; 1616 1621 } 1617 1622 i+=0.5; 1618 1623 } 1619 tds+="<td width='"+_20 8+"'>"+_20c+"</td>";1624 tds+="<td width='"+_20b+"'>"+_20f+"</td>"; 1620 1625 }.bind(this)); 1621 1626 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>"; … … 1625 1630 var rule=CssUtil.getCssRuleBySelectorText("."+Calendar.className.columnDate); 1626 1631 this.column.height=parseInt(rule.style["height"],10)+1; 1627 },buildSchedule:function(_21 5){1628 var id="scheduleItem_"+_21 5.id;1629 var _21 7=(_215.edit==undefined||_215.edit);1632 },buildSchedule:function(_218){ 1633 var id="scheduleItem_"+_218.id; 1634 var _21a=(_218.edit==undefined||_218.edit); 1630 1635 var item=Builder.node("DIV",{id:id}); 1631 1636 this.calendar.css.addClassNames(item,"scheduleItemLarge"); 1632 var _21 9=this.calendar.options.noEvent;1633 var term=DateUtil.toDate(_21 5.finish).minutes()-DateUtil.toDate(_215.start).minutes();1634 var _21 b={};1635 if(_21 5.background_color){1636 _21 b.backgroundColor=_215.background_color;1637 } 1638 if(_21 5.frame_color){1639 _21 b.borderTop="2px solid "+_215.frame_color;1640 _21 b.borderLeft="1px solid "+_215.frame_color;1641 _21 b.borderRight="1px solid "+_215.frame_color;1642 _21 b.borderBottom="2px solid "+_215.frame_color;1637 var _21c=this.calendar.options.noEvent; 1638 var term=DateUtil.toDate(_218.finish).minutes()-DateUtil.toDate(_218.start).minutes(); 1639 var _21e={}; 1640 if(_218.background_color){ 1641 _21e.backgroundColor=_218.background_color; 1642 } 1643 if(_218.frame_color){ 1644 _21e.borderTop="2px solid "+_218.frame_color; 1645 _21e.borderLeft="1px solid "+_218.frame_color; 1646 _21e.borderRight="1px solid "+_218.frame_color; 1647 _21e.borderBottom="2px solid "+_218.frame_color; 1643 1648 if(term<=30){ 1644 _21 b.backgroundColor=_215.frame_color;1645 } 1646 } 1647 if(_21 9){1648 _21 b.cursor="default";1649 } 1650 Element.setStyle(item,_21 b);1651 var _21 c=[];1652 if(_21 7){1653 var _2 1d=Builder.node("DIV",{id:"scheduleDeleteImg_"+_215.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"});1654 _21 c.push(_21d);1655 item.appendChild(_2 1d);1656 if(!_21 9){1657 Event.observe(_2 1d,"click",this.clickDeleteImage.bind(this,_215));1658 } 1659 } 1660 if(!_21 9&&this.calendar.options.dblclickSchedule){1661 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_21 5));1649 _21e.backgroundColor=_218.frame_color; 1650 } 1651 } 1652 if(_21c){ 1653 _21e.cursor="default"; 1654 } 1655 Element.setStyle(item,_21e); 1656 var _21f=[]; 1657 if(_21a){ 1658 var _220=Builder.node("DIV",{id:"scheduleDeleteImg_"+_218.id,className:this.calendar.css.joinClassNames("deleteImg"),style:"display: none;"}); 1659 _21f.push(_220); 1660 item.appendChild(_220); 1661 if(!_21c){ 1662 Event.observe(_220,"click",this.clickDeleteImage.bind(this,_218)); 1663 } 1664 } 1665 if(!_21c&&this.calendar.options.dblclickSchedule){ 1666 Event.observe(item,"dblclick",this.calendar.options.dblclickSchedule.bind(this,_218)); 1662 1667 } 1663 1668 var icon=null; 1664 if(_21 5.icon){1665 icon=Builder.node("IMG",{src:_21 5.icon,alt:"icon",style:"float: left;",width:16,height:16});1669 if(_218.icon){ 1670 icon=Builder.node("IMG",{src:_218.icon,alt:"icon",style:"float: left;",width:16,height:16}); 1666 1671 }else{ 1667 1672 if(Calendar.defaultIconPath){ … … 1669 1674 } 1670 1675 } 1671 var _2 1f=null;1672 if(!_21 5.publicity){1676 var _222=null; 1677 if(!_218.publicity){ 1673 1678 if(Calendar.privateImgPath){ 1674 _2 1f=Builder.node("IMG",{id:"private_img_"+_215.id,src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16});1675 item.appendChild(_2 1f);1676 }else{ 1677 _2 1f=Builder.node("DIV",{id:"private_img_"+_215.id});1678 this.calendar.css.addClassNames(_2 1f,"privateImg");1679 item.appendChild(_2 1f);1680 } 1681 } 1682 if(!_21 9&&(_21c.length>0)){1683 Event.observe(item,"mouseover",this.showImage.bind(this,_21 c,_21f));1684 Event.observe(item,"mouseout",this.hideImage.bind(this,_21 c,_21f));1685 } 1686 var text=this.getTimeText(_21 5.start,_215.finish);1687 var _22 1=_215.description.unescapeHTML();1688 var _22 2={id:id+"_text"};1689 if(_21 5.frame_color){1690 _22 2.style="background-color:"+_215.frame_color+";";1691 } 1692 if(!_21 9&&_217){1693 _22 2.style+="cursor: move;";1679 _222=Builder.node("IMG",{id:"private_img_"+_218.id,src:Calendar.privateImgPath,alt:"private",style:"position: absolute; right: 0px; display: block;",width:16,height:16}); 1680 item.appendChild(_222); 1681 }else{ 1682 _222=Builder.node("DIV",{id:"private_img_"+_218.id}); 1683 this.calendar.css.addClassNames(_222,"privateImg"); 1684 item.appendChild(_222); 1685 } 1686 } 1687 if(!_21c&&(_21f.length>0)){ 1688 Event.observe(item,"mouseover",this.showImage.bind(this,_21f,_222)); 1689 Event.observe(item,"mouseout",this.hideImage.bind(this,_21f,_222)); 1690 } 1691 var text=this.getTimeText(_218.start,_218.finish); 1692 var _224=_218.description.unescapeHTML(); 1693 var _225={id:id+"_text"}; 1694 if(_218.frame_color){ 1695 _225.style="background-color:"+_218.frame_color+";"; 1696 } 1697 if(!_21c&&_21a){ 1698 _225.style+="cursor: move;"; 1694 1699 } 1695 1700 if(term<=15){ 1696 var _22 3=this.calendar.formatTime(_215.start);1697 _22 2.style+="line-height: 12px;";1701 var _226=this.calendar.formatTime(_218.start); 1702 _225.style+="line-height: 12px;"; 1698 1703 if(UserAgent.isFF()){ 1699 _22 2.style+="white-space: nowrap;";1700 } 1701 var _22 4=Builder.node("DIV",_222,[icon,_223+" "+_221]);1702 this.calendar.css.addClassNames(_22 4,"scheduleTimeArea");1703 item.appendChild(_22 4);1704 _225.style+="white-space: nowrap;"; 1705 } 1706 var _227=Builder.node("DIV",_225,[icon,_226+" "+_224]); 1707 this.calendar.css.addClassNames(_227,"scheduleTimeArea"); 1708 item.appendChild(_227); 1704 1709 }else{ 1705 1710 if(term<=30){ 1706 var _22 3=this.calendar.formatTime(_215.start);1711 var _226=this.calendar.formatTime(_218.start); 1707 1712 if(UserAgent.isIE()){ 1708 _22 2.style+="line-height: 20px;";1709 }else{ 1710 _22 2.style+="line-height: 18px; white-space: nowrap;";1711 } 1712 var _22 4=Builder.node("DIV",_222,[icon,_223+" "+_221]);1713 this.calendar.css.addClassNames(_22 4,"scheduleTimeArea");1714 item.appendChild(_22 4);1715 }else{ 1716 _22 2.style+="line-height: 18px;";1717 var _22 4=Builder.node("DIV",_222,[icon,text]);1718 this.calendar.css.addClassNames(_22 4,"scheduleTimeArea");1719 item.appendChild(_22 4);1720 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_22 1]));1721 } 1722 } 1723 item.title=text.replace(/ /g,"")+" "+_22 1;1724 item.schedule=_21 5;1725 return [item,_22 4];1726 },adjustScheduleStyle:function(item,_22 6,_227){1727 var _22 8=item.schedule;1728 var time=this.convertHours(_22 8);1729 var _22 a=time[0];1730 var _22 b=time[1];1713 _225.style+="line-height: 20px;"; 1714 }else{ 1715 _225.style+="line-height: 18px; white-space: nowrap;"; 1716 } 1717 var _227=Builder.node("DIV",_225,[icon,_226+" "+_224]); 1718 this.calendar.css.addClassNames(_227,"scheduleTimeArea"); 1719 item.appendChild(_227); 1720 }else{ 1721 _225.style+="line-height: 18px;"; 1722 var _227=Builder.node("DIV",_225,[icon,text]); 1723 this.calendar.css.addClassNames(_227,"scheduleTimeArea"); 1724 item.appendChild(_227); 1725 item.appendChild(Builder.node("DIV",{id:id+"_description"},[_224])); 1726 } 1727 } 1728 item.title=text.replace(/ /g,"")+" "+_224; 1729 item.schedule=_218; 1730 return [item,_227]; 1731 },adjustScheduleStyle:function(item,_229,_22a){ 1732 var _22b=item.schedule; 1733 var time=this.convertHours(_22b); 1734 var _22d=time[0]; 1735 var _22e=time[1]; 1731 1736 var same=[]; 1732 1737 var self=this; 1733 _22 7.each(function(h){1734 var _2 2f=self.convertHours(h.schedule);1735 var _23 0=_22f[0];1736 var _23 1=_22f[1];1737 if(((_23 0<=_22a)&&(_231>_22a))||((_230<_22b)&&(_231>=_22b))||((_22a<=_230)&&(_22b>_230))||((_22a<_231)&&(_22b>=_231))){1738 _22a.each(function(h){ 1739 var _232=self.convertHours(h.schedule); 1740 var _233=_232[0]; 1741 var _234=_232[1]; 1742 if(((_233<=_22d)&&(_234>_22d))||((_233<_22e)&&(_234>=_22e))||((_22d<=_233)&&(_22e>_233))||((_22d<_234)&&(_22e>=_234))){ 1738 1743 same.push(h); 1739 1744 } 1740 1745 }); 1741 var _23 2=_226*this.getAdjustSize();1746 var _235=_229*this.getAdjustSize(); 1742 1747 if(UserAgent.isIE()||this.calendar.options.noEvent){ 1743 _23 2+=1;1744 } 1745 var left=this.column.width*_22 6+_232;1748 _235+=1; 1749 } 1750 var left=this.column.width*_229+_235; 1746 1751 if(same.length==0){ 1747 1752 Element.setStyle(item,{left:left+"px"}); 1748 1753 }else{ 1749 1754 same.push(item); 1750 var _23 4=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1;1755 var _237=parseInt(Element.getStyle(item,"width"),10)/(same.length)-(UserAgent.isIE()?1:2)+1; 1751 1756 same.each(function(s,i){ 1752 var _23 7=left+_234*i+(2*i);1753 Element.setStyle(s,{width:_23 4+"px",left:_237+"px"});1757 var _23a=left+_237*i+(2*i); 1758 Element.setStyle(s,{width:_237+"px",left:_23a+"px"}); 1754 1759 }); 1755 1760 } 1756 1761 return left; 1757 1762 },setScheduleBaseStyle:function(item){ 1758 var _23 9=item.schedule;1759 if(!this.calendar.isSameDate(_23 9.start,_239.finish)){1760 _23 9.finish.hour=24;1761 _23 9.finish.min=0;1762 } 1763 var time=this.convertHours(_23 9);1764 var _23 b=time.first();1765 var _23 c=time.last();1766 var _2 3d=this.column.height*2;1767 var diff=this.calendar.getTimeDiff(_23 9.start,_239.finish);1763 var _23c=item.schedule; 1764 if(!this.calendar.isSameDate(_23c.start,_23c.finish)){ 1765 _23c.finish.hour=24; 1766 _23c.finish.min=0; 1767 } 1768 var time=this.convertHours(_23c); 1769 var _23e=time.first(); 1770 var _23f=time.last(); 1771 var _240=this.column.height*2; 1772 var diff=this.calendar.getTimeDiff(_23c.start,_23c.finish); 1768 1773 var rate=(diff.hour+(diff.min/60))||1; 1769 1774 var over=0; 1770 1775 var top=0; 1771 var _24 2=0;1772 var _24 3=this.includeDisplayTime(_23b);1773 var _24 4=this.includeDisplayTime(_23c,true);1774 if(!_24 3&&!_244){1775 if((this.startTime<=_23 b&&this.startTime<=_23c)||(_23b<this.finishTime&&_23c<this.finishTime)){1776 top=_24 2=0;1776 var _245=0; 1777 var _246=this.includeDisplayTime(_23e); 1778 var _247=this.includeDisplayTime(_23f,true); 1779 if(!_246&&!_247){ 1780 if((this.startTime<=_23e&&this.startTime<=_23f)||(_23e<this.finishTime&&_23f<this.finishTime)){ 1781 top=_245=0; 1777 1782 Element.hide(item); 1778 1783 this.hasInvisibleSchedule=true; 1779 1784 }else{ 1780 1785 top=0; 1781 _24 2=_23d*(this.finishTime-this.startTime)-3;1782 } 1783 }else{ 1784 if(_24 3){1785 top=_2 3d*(_23b-this.startTime);1786 _24 2=_23d*rate-3;1786 _245=_240*(this.finishTime-this.startTime)-3; 1787 } 1788 }else{ 1789 if(_246){ 1790 top=_240*(_23e-this.startTime); 1791 _245=_240*rate-3; 1787 1792 }else{ 1788 1793 top=0; 1789 over=this.startTime-_23 b;1790 _24 2=_23d*(rate-over);1791 } 1792 if(_24 4){1793 }else{ 1794 over=_23 c-this.finishTime;1795 _24 2-=_23d*over;1794 over=this.startTime-_23e; 1795 _245=_240*(rate-over); 1796 } 1797 if(_247){ 1798 }else{ 1799 over=_23f-this.finishTime; 1800 _245-=_240*over; 1796 1801 } 1797 1802 } 1798 1803 try{ 1799 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_24 2+"px"});1804 Element.setStyle(item,{top:top+"px",width:this.column.width+"px",height:_245+"px"}); 1800 1805 } 1801 1806 catch(e){ … … 1809 1814 this.setCover(); 1810 1815 var self=this; 1811 var _24 6=$(this.getScheduleContainerId());1812 var _24 7=this.getDragDistance();1816 var _249=$(this.getScheduleContainerId()); 1817 var _24a=this.getDragDistance(); 1813 1818 this.scheduleNodes=[]; 1814 var _24 8=this.week.map(function(){1819 var _24b=this.week.map(function(){ 1815 1820 return []; 1816 1821 }); 1817 var _24 9=this.week.legth-1;1818 var _24 a=this.calendar.options.noEvent;1819 this.calendar.options.schedules.each(function(_24 b){1820 var _24 c=[];1821 var sub,_2 4e,_24f=null;1822 self.week.each(function(date,_25 1){1823 if(self.calendar.betweenDate(_24 b,date)){1824 if(self.isSameStartDate(_24 b,date)&&self.isSameFinishDate(_24b,date)){1825 _2 4f=self.setSchedule(_24b,_251,_248,_246,_247);1826 _2 4f.cellDate=date;1827 _24 c.push(_24f);1828 }else{ 1829 sub=self.copyOneDaySchedule(_24 b,date);1822 var _24c=this.week.legth-1; 1823 var _24d=this.calendar.options.noEvent; 1824 this.calendar.options.schedules.each(function(_24e){ 1825 var _24f=[]; 1826 var sub,_251,_252=null; 1827 self.week.each(function(date,_254){ 1828 if(self.calendar.betweenDate(_24e,date)){ 1829 if(self.isSameStartDate(_24e,date)&&self.isSameFinishDate(_24e,date)){ 1830 _252=self.setSchedule(_24e,_254,_24b,_249,_24a); 1831 _252.cellDate=date; 1832 _24f.push(_252); 1833 }else{ 1834 sub=self.copyOneDaySchedule(_24e,date); 1830 1835 if(sub.finish.hour==0&&sub.finish.min==0){ 1831 1836 throw $continue; 1832 1837 } 1833 _2 4e=self.setSchedule(sub,_251,_248,_246,_247);1834 _2 4e.originalSchedule=_24b;1835 _2 4e.cellDate=date;1836 _24 c.push(_24e);1838 _251=self.setSchedule(sub,_254,_24b,_249,_24a); 1839 _251.originalSchedule=_24e; 1840 _251.cellDate=date; 1841 _24f.push(_251); 1837 1842 } 1838 1843 }else{ … … 1844 1849 if(!self.hasInvisibleSchedule){ 1845 1850 (self.invisibleWeek||[]).each(function(date){ 1846 if(self.calendar.betweenDate(_24 b,date)){1851 if(self.calendar.betweenDate(_24e,date)){ 1847 1852 self.hasInvisibleSchedule=true; 1848 1853 throw $break; … … 1850 1855 }); 1851 1856 } 1852 if(!_24 a){1853 _24 c.each(function(item){1854 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_24 c));1855 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_24 c));1856 }); 1857 } 1858 if(!self.hasInvisibleSchedule&&(_24 c.length==0)){1857 if(!_24d){ 1858 _24f.each(function(item){ 1859 Event.observe(item,"mouseover",self.mouseOverSubSchedule.bind(this,_24f)); 1860 Event.observe(item,"mouseout",self.mouseOutSubSchedule.bind(this,_24f)); 1861 }); 1862 } 1863 if(!self.hasInvisibleSchedule&&(_24f.length==0)){ 1859 1864 self.hasInvisibleSchedule=true; 1860 1865 } … … 1867 1872 new Hover(this.ids.pre); 1868 1873 new Hover(this.ids.next); 1869 var _25 4=this.calendar.options.clickDateText||this.clickDateText;1874 var _257=this.calendar.options.clickDateText||this.clickDateText; 1870 1875 if(this.headers){ 1871 this.headers.each(function(_25 5){1872 Event.observe(_25 5.id,"mousedown",_254.bindAsEventListener(this,_255.wday));1876 this.headers.each(function(_258){ 1877 Event.observe(_258.id,"mousedown",_257.bindAsEventListener(this,_258.wday)); 1873 1878 }.bind(this)); 1874 1879 } 1875 1880 } 1876 },copyOneDaySchedule:function(_25 6,date){1881 },copyOneDaySchedule:function(_259,date){ 1877 1882 var sub=null; 1878 if(this.isSameStartDate(_25 6,date)){1879 sub=this.copySchedule(_25 6,date);1883 if(this.isSameStartDate(_259,date)){ 1884 sub=this.copySchedule(_259,date); 1880 1885 sub.finish.hour=24; 1881 1886 sub.finish.min=0; 1882 1887 }else{ 1883 if(this.isSameFinishDate(_25 6,date)){1884 sub=this.copySchedule(_25 6,date);1888 if(this.isSameFinishDate(_259,date)){ 1889 sub=this.copySchedule(_259,date); 1885 1890 sub.start.hour=0; 1886 1891 sub.start.min=0; 1887 1892 }else{ 1888 sub=this.copySchedule(_25 6,date);1893 sub=this.copySchedule(_259,date); 1889 1894 sub.start.hour=0; 1890 1895 sub.start.min=0; … … 1894 1899 } 1895 1900 return sub; 1896 },copySchedule:function(_25 9,date){1897 sub=Object.extend({},_25 9);1898 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_25 9.start.hour,min:_259.start.min};1899 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_25 9.finish.hour,min:_259.finish.min};1901 },copySchedule:function(_25c,date){ 1902 sub=Object.extend({},_25c); 1903 sub.start={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_25c.start.hour,min:_25c.start.min}; 1904 sub.finish={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),hour:_25c.finish.hour,min:_25c.finish.min}; 1900 1905 return sub; 1901 },setSchedule:function(_25 b,_25c,_25d,_25e,_25f){1902 var _26 0=this.buildSchedule(_25b);1903 var item=_26 0.first();1904 _2 5e.appendChild(item);1906 },setSchedule:function(_25e,_25f,_260,_261,_262){ 1907 var _263=this.buildSchedule(_25e); 1908 var item=_263.first(); 1909 _261.appendChild(item); 1905 1910 this.setScheduleBaseStyle(item); 1906 var left=this.adjustScheduleStyle(item,_25 c,_25d[_25c]);1907 var _26 3=_25c*this.getAdjustSize();1908 var _26 4=this.column.width+_263+"px";1909 if(!this.calendar.options.noEvent&&((_25 b.edit==undefined)||_25b.edit)){1910 this.setDraggable(item,_26 0.last(),_25e,_25f);1911 var left=this.adjustScheduleStyle(item,_25f,_260[_25f]); 1912 var _266=_25f*this.getAdjustSize(); 1913 var _267=this.column.width+_266+"px"; 1914 if(!this.calendar.options.noEvent&&((_25e.edit==undefined)||_25e.edit)){ 1915 this.setDraggable(item,_263.last(),_261,_262); 1911 1916 this.setResize(item); 1912 1917 } 1913 _2 5d[_25c].push(item);1918 _260[_25f].push(item); 1914 1919 this.scheduleNodes.push(item); 1915 1920 return item; 1916 1921 },getDragDistance:function(){ 1917 var _26 5=this.getAdjustSize();1918 return [this.column.width+_26 5,this.column.height/2];1919 },setDraggable:function(item,_26 7,_268,_269){1922 var _268=this.getAdjustSize(); 1923 return [this.column.width+_268,this.column.height/2]; 1924 },setDraggable:function(item,_26a,_26b,_26c){ 1920 1925 var self=this; 1921 new Draggable(item,{handle:_26 7,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_26d){1922 var _2 6e=Element.getDimensions(item);1923 var _2 6f=Element.getDimensions(_268);1924 var _27 0=(self.column.height/2);1925 var _27 1=_26d.offset;1926 new Draggable(item,{handle:_26a,scroll:window,starteffect:Prototype.emptyFunction,endeffect:Prototype.emptyFunction,snap:function(x,y,_270){ 1927 var _271=Element.getDimensions(item); 1928 var _272=Element.getDimensions(_26b); 1929 var _273=(self.column.height/2); 1930 var _274=_270.offset; 1926 1931 var xy=[x,y].map(function(v,i){ 1927 return Math.floor((v+_27 1[i])/_269[i])*_269[i];1928 }); 1929 xy=[self._constrain(xy[0],0,_2 6f.width-_26e.width),self._constrain(xy[1],0-(_26e.height-_270),_26f.height-_270)];1932 return Math.floor((v+_274[i])/_26c[i])*_26c[i]; 1933 }); 1934 xy=[self._constrain(xy[0],0,_272.width-_271.width),self._constrain(xy[1],0-(_271.height-_273),_272.height-_273)]; 1930 1935 return xy; 1931 },onEnd:function(_27 5,_276){1932 self.changeSchedule(_27 5,_276);1933 },change:function(_27 7){1934 self.changeTimeDisplay(_27 7.element);1936 },onEnd:function(_278,_279){ 1937 self.changeSchedule(_278,_279); 1938 },change:function(_27a){ 1939 self.changeTimeDisplay(_27a.element); 1935 1940 }}); 1936 1941 },setResize:function(item){ 1937 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_27 9){1938 this.updateTirm(_27 9);1939 }.bind(this),change:function(_27 a){1940 this.changeTimeDisplay(_27 a);1942 new CalendarResizeableEx(item,{left:0,right:0,top:0,distance:this.column.height/2,restriction:true,resize:function(_27c){ 1943 this.updateTirm(_27c); 1944 }.bind(this),change:function(_27d){ 1945 this.changeTimeDisplay(_27d); 1941 1
