Lively Kernel canvas
* MIT license
*
* Includes enhancements by Scott Trenda
* and Kris Kowal
*
* Accepts a date, a mask, or a date and a mask.
* Returns a formatted version of the given date.]]> 99 ? Math.round(L / 10) : L),
t: H < 12 ? "a" : "p",
tt: H < 12 ? "am" : "pm",
T: H < 12 ? "A" : "P",
TT: H < 12 ? "AM" : "PM",
Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
};
return mask.replace(token, function ($0) {
return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
});
};
}();
// Some common format strings
dateFormat.masks = {
"default": "ddd mmm dd yyyy HH:MM:ss",
shortDate: "m/d/yy",
mediumDate: "mmm d, yyyy",
longDate: "mmmm d, yyyy",
fullDate: "dddd, mmmm d, yyyy",
shortTime: "h:MM TT",
mediumTime: "h:MM:ss TT",
longTime: "h:MM:ss TT Z",
isoDate: "yyyy-mm-dd",
isoTime: "HH:MM:ss",
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
};
// Internationalization strings
dateFormat.i18n = {
dayNames: [
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
]
};
// For convenience...
Date.prototype.format = function (mask, utc) {
return dateFormat(this, mask, utc);
};]]>
Draft40true
savefalsenull
truenulltrue
-----falsetruefalse0
fontCourier12:spacewidth1321from1335xWidth7falsetruefalse0
worldis1:WorldMorph([[0,0,1805.300048828125,3500.199951171875]])falsetruefalse0
startingWikiNavigatorfalsetruefalse0
status207onPROPFINDhttp://lively-kernel.org/repository/webwerkstatt/projects/CodeDB/draft.xhtmlfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/projects/CodeDB/../../anonymous_module_3loadedin42msfalsetruefalse0
http://lively-kernel.org/repository/webwerkstatt/projects/CodeDB/../../anonymous_module_2loadedin688msfalsetruefalse0
loadedLayersTest.jsfalsetruefalse0
fontHelvetica40:spacewidth4076from4116xWidth20falsetruefalse0
fontHelvetica12:spacewidth1274from1288xWidth7falsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
ResizingSVGcanvasfalsetruefalse0
Moduleloadcheckdone.36modulesloaded.falsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([[0,0,1805.300048828125,3500.199951171875]])falsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
fitWidthfailureonTextMorph.getCharBoundsfalsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([[0,0,1805.300048828125,3500.199951171875]])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/projects/CodeDB/draft.xhtmlfalsetruefalse0
problemstoparsehttp://lively-kernel.org/repository/webwerkstatt/projects/CodeDB/draft.xhtmlfalsetruefalse0
extendForSerializationundefinedfalsetruefalse0814
-1nullnulltrue0falsetruetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
truetrue100truefalse
truefalse050
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
ThisisaeeeextMorph1
createLayer("DraftLayer")layerClass(DraftLayer,TextMorph,{onKeyPress:function(proceed,evt){console.log("onKeyPress"+evt)returnproceed(evt)}})
nulltrue11truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
HandMorph.addMethods({handleKeyboardEvent:function(evt){//console.log("event:"+evt)if(evt.type=="KeyUp"){this.forgetKeyDown(evt);};if(this.hasSubmorphs()){if(evt.type=="KeyDown"&&this.moveSubmorphs(evt))return;elseif(evt.type=="KeyPress"&&this.transformSubmorphs(evt))return;}//manualbubblingupb/ctheeventwon'tbubblebyitselffor(varresponder=this.keyboardFocus;responder!=null;responder=responder.owner){if(responder.takesKeyboardFocus()){varhandler=responder[evt.handlerName()];if(handler){if(handler.call(responder,evt))break;//eventconsumed?}}}//rememberkeydownformouseeventsif(!this.keysDown){this.keysDown={};};if(evt.type=="KeyDown"){this.rememberKeyDown(evt);};this.blockBrowserKeyBindings(evt);}})31truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
100012.268193511541815Wikicontroltrue
null177