Lively Kernel canvas
// this script is evaluated on world load{
borderWidth: 2,
borderColor: Color.red,
strokeOpacity: 0,
fillOpacity: 1,
fill: Color.lightGray
}pt(140, 100)function($super, date, optPos) {
if (!optPos) optPos = pt(100,100);
$super(optPos.extent(this.initialExtent));
this.dateMs = date.valueOf();
//this.applyStyle(this.initialStyle);
this.buildDateText(date);
}function(date) {
var bnds = this.innerBounds().translatedBy(pt(0, this.getExtent().y-25));
var text = new TextMorph(bnds, date.toUTCString().slice(0,11));
text.beLabel();
text.setFontSize(18);
this.text = text;
//text.setFill(Color.rgb(169,193,208).lighter());
this.addMorphFront(text);
}function($super, morph) {
$super(morph);
if (morph instanceof HandleMorph || morph instanceof SchedulableAction) return morph;
var margin = 10;
this.droppedMorph = morph;
this.oldScale = morph.getScale();
var morphWidth = morph.bounds().extent().x;
var myWidth = this.getExtent().x - margin;
var morphHeight = morph.bounds().extent().y;
var myHeight = this.getExtent().y - 50;
var scaleFactor = Math.min(myWidth / morphWidth, myHeight/morphHeight);
console.log(scaleFactor);
if (scaleFactor < 1)
morph.setScale(scaleFactor*morph.getScale()); // using bounds of morph, its scale already in it, consider it when rescale
morph.centerAt(this.innerBounds().center());
return morph;
}Functions.Truefunction(evt) {
if (!this.droppedMorph) return;
this.droppedMorph.setScale(this.oldScale || 1);
evt.hand.addMorph(this.droppedMorph);
this.droppedMorph = null;
}function() {
var oneDay = 1000*60*60*24;
var daysAhead = 5;
var myDate = new Date(this.dateMs);
var currentDate = new Date();
this.applyStyle(this.style);
if (myDate.getDate() == currentDate.getDate())
this.applyStyle({fill: Color.white, fillOpacity: 1});
if (myDate < currentDate && myDate.getDate() != currentDate.getDate())
return;
if (!this.droppedMorph) return;
var timeDiff = myDate - currentDate;
if (timeDiff > daysAhead*oneDay) return;
var redIntensity = 1 - Math.abs(timeDiff/(daysAhead*oneDay));
this.setStrokeOpacity(redIntensity);
}function() {
this.startStepping(1000, "highlight");
}5new Date(24*60*60*1000) - new Date(0)function(date) {
return new Date(date.valueOf() + this.day);
}function(monthNo, startPos) {
var pos = startPos;
var extent = DayMorph.prototype.initialExtent;
var margin = this.defaultMargin;
monthNo -= 1;
if (!this.morphs) this.morphs = [];
var date = new Date(2009, monthNo/*month-1*/, 1/*day*/, 8/*hour*/, 1/*minute*/);
do {
this.createDayMorph(date, pos);
pos = date.getDay() % 7 == 0 ? startPos.withY(pos.y + extent.y + margin) : pos.addXY(extent.x + margin, 0);
date = this.nextDay(date);
} while (date.getMonth() === monthNo);
return this.morphs;
}function(date, pos) {
var x = new DayMorph(date, pos);
this.morphs.push(x);
x.openInWorld();
x.start();
}/*
m= new DayMorph(new Date(), pt(100,100));
m.openInWorld();
m.highlight();
allM = new CalendarBuilder().buildMonth(3, pt(10,10));
allM.invoke('remove');
TextMorph.prototype.this.fontFamily = 'Marker Felt';
TextMorph.prototype.style: { borderWidth: 0, borderColor: Color.black};
*/
null
Mon,06Apr
18
null
1000
6.363525066551018
1238997660000
null
Tue,07Apr
18
null
1000
3.751008949872745
1239084060000
null
Wed,08Apr
18
null
null
1000
2.3423921679935296
null
-SWTProjektvorschläge
6
false
3
null
1239170460000
1.3980962038040161
null
Thu,09Apr
18
null
1000
2.145463721967819
1239256860000
null
Fri,10Apr
18
null
1000
2.4145958685769875
1239343260000
null
Sat,11Apr
18
null
null
1000
2.9471035415651867
1239429660000
null
Sun,12Apr
18
null
null
1000
1.5159371644672555
1239516060000
null
Mon,13Apr
18
null
null
1000
1.2281472230678605
1239602460000
null
Tue,14Apr
18
null
1000
3.4510010350999445
-1.633601396040239
0.8172773211658292
1239688860000
0.9673670268264783
null
Wed,15Apr
18
null
1000
1.5768558474950691
1239775260000
null
Thu,16Apr
18
null
1000
1.6433256314795393
1239861660000
null
Fri,17Apr
18
null
null
1000
2.167739887094525
1239948060000
null
Sat,18Apr
18
null
null
1000
2.2360889121330905
1240034460000
null
Sun,19Apr
18
null
null
1000
2.079716153593865
1240120860000
null
Mon,20Apr
18
null
null
1000
2.9804433396177608
null
-Geovisualisierung-DatenorientiertesXML
1
18
false
null
20
1240207260000
1.3728177547454834
null
Tue,21Apr
18
null
1000
1.6427248784340354
null
-SearchEngines-Geovisualisierung-VMs
2
0
false
36
null
1240293660000
1.3728177547454834
null
Wed,22Apr
18
null
1000
4.041575100442282
null
null
-QuellcodeAnalyse-SWAVortrag-DatenorientiertesXML
2
63
true
58
1240380060000
1.3728177547454834
null
Thu,23Apr
18
null
null
1000
1.2785896188070778
null
-VirtuelleMaschienen
2
true
3
1240466460000
1.3728177547454834
null
Fri,24Apr
18
null
null
1000
5.453289095056443
null
-VMs,denganzenTag!!!
0
false
3
null
1240552860000
1.3728177547454834
null
Sat,25Apr
18
null
null
1000
1.1192651803259719
1240639260000
null
Sun,26Apr
18
null
null
1000
1.222642422183589
1240725660000
null
Mon,27Apr
18
null
1000
1.7932109325901127
1240812060000
1.2305655479431152
null
null
Tue,28Apr
18
null
1000
2.3693014626967135
null
-VirtuelleMaschinen(13:30Uhr-MichaelandenTerminerinnern)
2
43
true
3
null
1240898460000
1.2305655479431152
null
Wed,29Apr
18
null
null
1000
3.5494455275136034
1240984860000
null
Thu,30Apr
18
null
null
1000
1.468804483262331
1241071260000
null
Wed,01Apr
18
null
null
1000
1.0135517672737173
null
0.1
60
321.6153555323504
0.447148999985568
null
null
1238565660000
1
null
Thu,02Apr
18
null
1000
3.6578411543577625
1238652060000
null
Fri,03Apr
18
null
1000
2.2204102043225227
1238738460000
null
Sat,04Apr
18
null
null
1000
1.7822787998149492
1238824860000
null
Sun,05Apr
18
null
null
1000
2.7388013924130155
1238911260000
null
1240405863392
210347
1
15
null
1240405863
null