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);
};]]>
Developer'sJournal-LivelyHTML32true
savefalsenulltruenull
newentryfalsenulltruefalsetrue
null
sortfalsenulltruefalsetrue
null
reversefalsenulltruefalsetrue
null
2010-08-17,Tue-Screencast18
true
Thescreencastshows:-Simpleworld-Complexwidgets(browser,Fabrik,etc.)-"Native"widgets-Systembrowserusingnativewidgets-AugmentingHTMLdocuments518
true
http://lively-kernel.org/other/LivelyHTMLScreencast.mov18
true
2010-07-19,Mon-Benchmarks18
true
http://lively-kernel.org/repository/webwerkstatt/projects/HTML5/ellipseBenchmark.xhtml?useFlattenedHTMLRenderingLayer=truehttp://lively-kernel.org/repository/webwerkstatt/benchmarks/ellipseBenchmark.xhtmlhttp://lively-kernel.org/repository/webwerkstatt/projects/HTML5/mouseEventBenchmark.xhtml?useFlattenedHTMLRenderingLayer=truehttp://lively-kernel.org/repository/webwerkstatt/benchmarks/benchmarkMouseEvents.xhtmlhttp://lively-kernel.org/repository/webwerkstatt/projects/HTML5/listBenchmark.xhtml?useFlattenedHTMLRenderingLayer=truehttp://www.lively-kernel.org/repository/webwerkstatt/benchmarks/listBenchmark.xhtml
true
2010-07-10,Sat-Textisworking18
true
Duringthelastweekwemadesomegoodprogress.TextisknowworkinginLivelyHTMLanditbecomesclearerthatLivelyHTMLmighthavesomehugeadvantagesovertheSVGapproach:evenourabsolutelynon-optimizedthatusesContextJSfeelsveryresponsiveandfast.Additionally,itmightbeveryeasytocreate"native"widgets(liketexts,lists)thatcanperfectlylivetogetherwiththealreadyexistingmorphs.Butthosewillbemuchfaster...Ihavetogetbackcoding!!!184
true
2010-06-27,Sun-GradientModelTheSVGrenderinginLivelymakesuseofgradientelementsoftheSVGnamespace.Ifagradientwasusedwithintheworld,thesegradientelementswherereferredbyid.InHTML5,thereisnothingsimilartoagradientelement.Insteadofthis,gradientsarerepresentedasspecificstyleattributesorcolorvalues.Inordertosupportgradientsproperly,weneedtomakegradientstonon-nodeobjects,meaningtheyarenolongersubclassedfromlively.data.Wrapper.18
true7
2010-06-27,Sun-FixedWrappingBuginLivelyWiththeoverwritingofmethodsbymeansofaddMethodsandsubclassinLively,existingmethodsarewrappedwiththenewoverwritingmethods.Whilemakingextensiveuseoftheseoverwritingcapabilities,itmayhappen,thatsomemethodsareadoublewrapped.However,doublewrappingledtoanincorrectpassingofargumentstotheunderlyingmethods.ThisfacthamperedourimplementationofHTML5rendering,aswealwayshadtoensure,thatnodoublewrappingoccurs.WehavenowmanagedtofixthisbugbycorrectingthewrappedmethodinFunction$wrap.Theactualproblemwiththisfunctionis,thatitalwaysprependsthesuperparametertotheargumentsofthecalledmethod.Ifawrappedmethodnowcallsasecondwrappedmethod,thesuperparameterisprependedasecondtimeandthefirstargumentofthecalledmethodbecomesthesuperparameter.Byaddingacheck,ifthecalledfunctionisawrappedfunction,thesuperparameterisnowonlyprependedonce.18
true12
2010-06-22,Tue-TranslationBenchmark18
true
WetriedtomeasuretheperformanceimpactofsettingtheCSS3transformationstringvs.usingthetop/leftCSSattributes.Result:usingtranslation()inthetransformationpropertyis~280%slower.Benchmark18
true5
2010-06-22,Tue-PositionTerminologyWehaveintroducedanewterminologyforthepositioningofmorphsandshapesinourHTML5implementation.Ourgoalistomaketheterminologyeasiertounderstandforpeoplebeingnewtolivelyandthereforeenablingthemtocontributeevenfaster.Thefigureatthebottomofthisentrydepictsourterminologyindetail.TerminologyDescriptionThepositionofthemorphcanbeidentifiedbythetranslationattribute.Theoriginofamorphisdeterminedbytheoriginofitsshape.Ashapestoresthetranslationofitssurroundingmorphandkeepssomeinformationaboutitspositionwithinitsmorph.Additionally,itsorigindeterminestheaxisofrotation.RepresentationinHTMLscenegraphtranslation(shape)-->top+leftattributeinmorphdivtranslation(morph)-->top+leftattributeinmorphdivorigin(morph)-->notrepresentedingraphorigin(shape)-->translate()beforeandafterrotation()inshape'stransformCSSpropertyposition(shape)-->top+leftattributeinshapediv18 top + left attribute in morph div\ntranslation (morph) --> top + left attribute in morph div\norigin (morph) --> not represented in graph\norigin (shape) --> translate() before and after rotation() in shape's transform CSS property\nposition (shape) --> top + left attribute in shape div"]]>19
true
2010-06-20,Sun-IntegrationofStylePropertiesintoShapeIncontrasttoourpreviousidea,withwhicheachshapehasaanobjectholdingallitsvisualproperties,wemovedallvisualpropertiesdirectlyintotheshape.Thisallowsustoeasilyvaryvisualpropertiesbetweendifferenttypesofshapes.Asanexample,polygonsneedacollectionofvertices,whereasacircleonlyhasaradius.Asmanypropertiesarequitesimilarbetweendifferenttypesofshapes,wedecidedtoimplementanabstractionfortheapplianceofthevisualpropertiestotheactualshapenodesinthescenegraph.Wenowhaveareaderandwriter,which,incombination,allowtoapplyavisualpropertyindifferentformats,suchasCSS3styleattributeorasSVGattribute.Nextsteps:1)Westillhavesomepositioningproblemsinourdemoworld.ItwascausedbytheintegrationfromtheStylePropertiesobject.Ournextstepistofixthesebugs.(seecurrentdemoworld)2)IntegrateallpropertieswhichwerealsoavailableintheSVGsceneimplementationofLively.18
true13
2010-06-20,Sun-HTMLShapeDeserialization[Update]WehavecontinuedwiththedeserializationandcanatleastrestoretheMorphstructurefromanXHTMLfile.Ourcurrentchallengeismetainformationstoredwithamorph,suchascode,field,arrayorrecordblocks.Atthemoment,wearenotevenabletosaveaworldandcanthereforenottestthedeserialization.Nextsteps:1)TrytosaveaHTML5world.2)Checkmetainformationwrittenbyserializationprocess3)Deserializepreviouslyserializedmetainformation4)Checkifdeserializationnowworksinitsentirety18
true11
2010-06-17,Thu-HTMLShapeDeserializationThedeserializationofHTMLshapeswiththehelpofanimporterdoesnotworkasexpected.IntheSVGcase,ashapecouldberecoginizedandreconstructedbyreadingthetagnameoftheshapeelement.ThisdoesnotworkforHTMLanymore,asallshapesareeitherdivorcanvaselements.Ournewapproachistointroduceanewattributecalledshapeintoshapeelements.ThenewattributewillbeassignedtothecommonLivelynamespace,sothatHTMLprocessingdoesnotgetconfusedwithcustomattributes.InordertointegratethenewattributeintotheexistingLivelyKernel,theimportermustbemodified,asitcurrentlydeserializesshapesbytheirelementnames.Therearetwodifferentsolutionshowtheimportercouldbemodified.1.)ExtendtheexistingImporterinthecaseHTML5renderingisused.Indetail,somedeserializationmethodsareoverwrittentorecognizetheshapeattributeinthedivorcanvaselement.2.)Modifytheorignalimportertorecognizetheshapeattributeinanyelement.Inadditiontothis,thecurrentSVGshapesmustbechangedtoalsostoretheirshapetypeintotheshapeattribute.Wewouldpreferthesecondapproach,asonlyoneimporterwouldberequiredforanytypeofrenderingenvironment.ThefirstsolutiononlyhasadvantagesifSVGiscompletelyreplacedbyHTML5inthefuture.18
true21
2010-06-15,Tue-DraftforStylePropertiesObject18
true
2010-06-13,Sun-DeserializationofHTMLSceneGraphWehavestartedwiththeimplementationofthedeserializationofanHTMLscenegraph.Informationthatmustbeparsedarethenestingofelementsinordertofindhierarchiesinthescenegraph.Additionally,thevisualpropertiesofthecomponentsinthegraphmustbeinterpreted.VisualpropertiesarerepresentedinHTMLattributes,whichmustberead.TherearetwodifferenttypesofHTMLnodes,whichrepresenttheirvisualpropertiesinaverydiverseway:1.)StandardHTMLelements,suchasdivs,holdtheirvisualinformationinattributeslikestyle,width,height.Howevernotallvisualinformationcanbestoredinthesedefaultattributes.2.)Canvaselements,whoseappearanceissolelycontrolledviaJavaScriptcode.InordertobeabletoderiveashapefromserializedHTMLcode,additionalhintsmustbeaddedtocanvaselements,i.e.declaringattributesinthecanvaselement.Nextsteps:-ParsedefaultHTMLpropertiesfromanHTMLnode-Parsenon-HTMLpropertiesfromanode(thismayalsoincludeSVGproperties)-ReconstructtheMorphtree18
true18
2010-06-11,Fri-FirstUpdatesinceawhile--checkoutourdemopage18
true
Sorry,wedidnotupdateourjournalforsometime...wewilldoitmoreregularlynow,Ipromise:-)18
true
ThefirstchangewewanttoannounceisthatwehavemigratedthispagesuccessfullytoJensnewJournalapp.Worksquitefine,butwhenTextMorphsaresplittedthentheygettheirdefaultfontsize.@Jens,isthatintended?Jens:TheSplittinglogicisnotfinishedyet:-)18
true3
LastweekDanIngallswerevisitingtheHPIandheattendedourSeminar.Hereisourprojectoverviewwegavehim:LivelyHTMLPresentation06/10/10.18
true1
Thepresentationincludesalinktoourdemoworld.Jens:Theworlddoesnotloadforme...:-(18
true1
WecurrentlyworkonadesignofthegraphicbindingsthatallowstorenderLivelyMorphsinHTML,SVG,andCanvasconsistently.Withouttoomuchhacks.Staytuned!181
truenull
2010-05-06,Thu18
ThingsdoneStartedtocreatelogicforembeddingLivelyinXHTML.ThiswayLivelycanbeloadedondemand,itsAPIandtoolscanbeusedfordevelopment.Currentlythereareproblemswhenloadingaworld.16
4
2010-05-03,Mon18
Requirements1)Encapsulaterenderingfromprogramlogic-SVGscenegraphcreationiscurrentlyscatteredacrossseveralmodules-allowseasierreplacementofrenderingcomponentsinLivelyKernel2)RenderingofworldbymeansofHTML5-ReplaceSVGscenegraphwithHTMLelementsforperformancegainandhighercompatibility3)HigherperformanceofrenderingincomparisontoSVGrendering4)Preservelook&feelfromSVGrenderedLivelyKernel5)Renderingresultshouldbebrowserindependent-considersupportofCSS3attributesindifferentrenderingenginesforbrowsers16
9
SomemorethoughtsJens:-livelyfyanexistingwebpageandconvertexistingcontentintoMorphs-LivelyPageswithmuchtextareprettyslowDan:-cleanuptherenderinginterface-Prematureoptimization(exampleofactualmeasurementsthatpointtoSVGperformancebeingaproblem?)-EmbedLivelyinHTML-IntegrationofCSS16
10
Maintasks-FindoutwhatHTML5/CSS3iscapableof,andcreateasmallprototypeofanexampleworld(WorldMorph,Morphswithothershapes,animations)-SeparatescenegraphlogicfromhighlevelMorphAPI-IntegrateHTMLrenderingintothesystem-[Possibleextension]Switchrenderingmodeonthefly-[Possibleextension]LoadLivelyintoexistingpagesand"livelyfy"16
6
true
Seetheprogresshappening24
HTMLTODO[X]-zoom-mousehiddenintext-nodeconenctions-don'tdoworldresizeforembeddedworlds4
Wikicontroltruetrue
null201