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),
]]> 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);
};]]>
EntwicklertagebuchCollaboration40true
savefalsenulltruenull
newentryfalsenullfalsetrue
null
sortfalsenullfalsetrue
null
reversefalsenullfalsetrue
null
2010-07-05,MonFinishedbackendrefactoring.WenowhaveaRedis-basedcommandserverwithsupportfordifferentwikipages,milestones(i.e.everysavecreatesamilestone)andusers.Shouldbeeasilyextensibleforournextsteps...184
true
2010-07-04,SunWebsocketdraftspecificationseemstochangemonthly,weshouldmoveawayfromWebsockets.TryingoutFaye(http://faye.jcoglan.com),acometserverwithbayeuxprotocolimplementation(basedonpublish/subscribe).Result:FoundnootherwaythanwebsocketstosenddatafromclienttoserverwithoutadditionalHTTPrequest.Sowesticktowebsockets...187
true
2010-06-18,Fri18
true
BUG?!?endlesseventloopincollaborationduetotimingevent.wikicontroltextmorphisseteverysecondtoposition0,0thisendsinonemessagetoserverpersecondperclient!!18
true3
CallstackforsetPosition:setPosition...Core.js:4880WorldMorph$doOneCycleBase.js:151bound184
true
CallstackfortranslateBy:translateBy...setPosition...Core.js:4880WorldMorph$doOneCycleBase.js:151bound186
true
2010-06-07,Mon18
true
changedinterceptingofmorphfunctionstocontextjslayers...18
true
2010-05-30,SunFirstversionofcollaborationwiththecommandpattern(Collaboration.js+server/commandServer.js).Rightnow,changesmadetoexistingtextmorphsaresynchronized,knownproblems:*Loadingexistingcommandsintoanewclientdoesn'twork,isthereanyeventwhichisfiredwhentheworldisfullyloaded?*Commandsareserializedwiththeirexecuteandundomethods,whichwouldbeunnecessarywhensubclassingLocalCommandclassBUG:WhensavingajournalentryinChrome,ajournalentryloosesitsbackgroundcolor+borders.18
true11
2010-05-29,Sat18
true
temporarycodeIdea:*Commandpatternforsynchronization*Userinteractionstoredinjsoncommandobjects(LocalCommandvsRemoteCommand)*Firststep:serializeddo+undomethods*Nextstep:doandundomethodsconsistsofmorphid,functionname,parameters(nodeserializationofmethodsrequired18
true8
*Serverspecification**managesacommandqueue**Whenanewclientgetsconnected:sendallexistingcommandstoclient**ReceiveLocalCommand->sendRemoteCommandtoallClientsexcepttherequestingone18 send RemoteCommand to all Clients except the requesting one"]]>
true4
2010-05-25,Tue18
updatedtonewjournal18
2010-05-24,Monthoughts:-useofcommandpatternforsynchronisation(likeinwebcards...):1commandgetssuccessivenumberfromclient2clientexecutecommand+sendtoserver3serverstoresallcommands(couchdb?)+checksnumberandreassociateifneeded4serversendscommandtoallclients5allotherclientsexecutecommand6clientchecksnumberandundoifneededothercommandsandreexecuteincorrectorder-commandneedsinfo(needstobetransferable:json):-morphname-function/propertyname-new/oldvalue1814
2010-05-18,Tuerubystylejavascript:klick182
2010-05-17,Monwell...websocketsandtransparentproxiesisn'tgood:klickmod_proxyreversepoxy:klickadditionalinfos:klick184
2010-05-11,Tuewebsocketsareinitializedandusedintestpagefirst.xhtmlserverstillhavetobetranslatedtonodejsstillgettingsometimeserrorduringsavingofpages(line427orsomethingsimiliarfunctionnotdefined...)187
2010-05-11,Tuewebsocketsandnode.js:klick(edit:thelinktothewebsocketsimplementationwasdown,hereisaneventdrivenimplementation:klick)183
2010-05-11,Tuecleanedupdirectorystructure:addedserverdir-whichcontainsthenode.jsserverfilesaddedtestingdir-containingtheoldrubyserver184
2010-05-10,MonWebSocketonlyworksinchromeorwebkit...182
2010-05-08,Sat*Startedspikeonevaluatingpushingperformance.*Firstapproach:WebSocketinChromewitha"broadcasting"Rubybackend(about20lineswitheventmachine/em-websocketgem)*Result:Quasirealtimemirroringofmousepossible(onlocalhost,norealnetwork)185
null
null
nullnullnull
2010-05-04,Tue-useofcontextjsforeverything(theswissarmyknivefromlivelykernel...)182
2010-05-03,MonSomenotes...*Comet**Pushingdatatobrowser**Long-pollingvsHTML5websockets(Chromeonly))*WeshouldhavealookatRobert'sseminarpaperaboutOT-wherecanwefindit?*OTjustseemtofitintotextediting-whataboutgraphicalobjects/DOMelements?Whattosynchronize?1.HTMLdocument/DOM**"Openingachat"justmeanstoopenatexteditorandwrite**Attention:Ifaclockisdisplayedonthepage,thiscancausehightraffic/manyconflicts!2.JavaScriptobjects/classes;EditedjavascriptfilesFeatures*Seeotheruserswhoareeditingthepageatthesametime(andopenachattotalktothem)*Provideatimelinetoseehowseepageevolved(likeinetherpad.com)OnLivelyjournal*Grr,howtoresizeanentry?*Deletionofnewentrynotpossible,havetoreloadthepageComments:Jens:-YoucanreziseitwiththeHandlesinthelowerrightcorner,butautomaticresizingisonthefeaturelistforthenextjournaliteration.(Firstresize,andthenpress"reverse".)Youcanrightclickonanentryandthenchoose"remove"fromthemenu.-OTisgenerallyapplicabletoallkindsofobjects/commandsandnotlimmtedtotextediting.-Robert'sPaper:http://www.lively-kernel.org/repository/webwerkstatt/papers/Krahn_2010_OperationalTransformations.pdf1837
2010-04-28,Wedfirstdraftofofrequirements:-newwindow(somekindofsubworldinthewindow)-subworldhasaname(orsomekindofID)-otheruserscanfindsubworldwiththisname/id-everythinginthissubworldissynchronizedwitheveryparticipant...openquestions:-likegoogle:oneparticipantcaneditoneobjectatatime?ormorethanoneparticipant?-collisionsarefirstcomefirstserve->secondisignored?-everythingsynchronized!->objectrestrictions?(whatiseverything;))comments:(Jens)-btw:didyouknowthatyoucan"blockindent"withCMD+[andbackwithCDM+]?-havealookatOperationalTransformationsforthegeneralIdea(RobertwroteaSeminarPaperaboutit)RobertimplementedOTinJavaScriptwithaSqueakcounterparttoallowcollaborativetexteditinginatextwindowinabrowser.-TheproblemofwritingtheconflictresultionalgorithmtwicemaybesolvedwithaJavaScriptwebserversuchasNode.js-havealsoalookatJuliusDannert'sMasterThesis:WebCardsusesasimplecommandarchitecturewithoutconflictresolution,whereallcommandsaresendtotheCouchDBanddistributedvialongpollingtootherclients18 second is ignored?\n\t\t\t- everything synchronized! -> object restrictions? (what is everything ;))\n\ncomments: (Jens)\n- btw: did you know that you can \"block indent\" with CMD + [ and back with CDM + ] ?\n- have a look at Operational Transformations for the general Idea\n (Robert wrote a Seminar Paper about it)\nRobert implemented OT in JavaScript with a Squeak counterpart to allow collaborative text editing in a text window in a browser.\n- The problem of writing the conflict resultion algorithm twice may be solved with a JavaScript web server such as Node.js \n- have also a look at Julius Dannert's Master Thesis:\nWebCards uses a simple command architecture without conflict resolution, where all commands are send to the CouchDB and distributed via long polling to other clients \n\n"]]>
26
2010-04-27,Tuehmmfirstexternallinkcreated...standardurlisabsolut,butrelativeisneeded:(nextproblemduringsaving:(writingthislinesthethirdtime...hopeitworksthistime;)186
null
null
nullnullnull
firstexternallink:first.xhtml
2010-04-27,Tuehmmseemslikesavingmultipleduringonesession(withoutreloadingthewholesite)doesntwork!erroronline428duringsaving...btw.can'tcopytheerrormessage...Comment(Jens):okItrytoreproduceit...-secondedit,third...andagain-thefirsttimeItriedtocommentthisissuehereIgotthesameproblem,butnowIcan'reproduceit....-suchconnectionsproblemsarenowshowninthetoprightcornerandcanbecopiedbyclickingonmore,andreviewedinthebrowsersdeveloperconsole.1813
2010-04-27,Tueeditedfirst.xhtmlsavingworked...182
2010-04-26,Mon18
foundjournal;)andprojectstart16
1
true
Wikicontroltruetrue
TODO:-addMorphstillhavebigissues....-saveanewmilestoneswhenusersaveswikipages-ImplementundopartofcommandsDONE->Playback->Simpleconflictmanagement-Collaborationsettingsmorph->Playback(milestones,...)->SwitchcollaborationOn/Off->Showuserswhichareonthesamepage(namenearmouse)-ShowmousecursorsDONE-Trytogetwebsocketrunningonlively-kernel.orgwebserver-Scopeidgenerationtocurrentuser(e.g."user_id#TextMorph#")EVENTS:-setScaleworks-setExtentworks-setBoundsworks-setRotationworks-reshapeworks-translateByworks-setPositionworks-onMouseMoveworks-setTextStringworks-drag&droppartlyworks-addMorphworks-removeMorphworks
nulltrue Playback\n -> Simple conflict management\n- Collaboration settings morph\n -> Playback (milestones, ...)\n -> Switch collaboration On/ Off\n -> Show users which are on the same page (name near mouse)\n- Show mouse cursors DONE\n- Try to get websocket running on lively-kernel.org webserver\n- Scope id generation to current user (e.g. \"user_id#TextMorph#\")\n\nEVENTS:\n\n- setScale\t\t\tworks\n- setExtent\t\t\tworks\n- setBounds \t\tworks\n- setRotation \t\tworks\n- reshape \t\t\tworks\n- translateBy \t\tworks\n- setPosition \t\tworks\n- onMouseMove \tworks\n- setTextString\t\tworks\n- drag&drop\t\t\tpartly works\n- addMorph\t\t\tworks\n- removeMorph\t\tworks\n"]]>truetruefalse3truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
dismissallfalsenulltruefalsetrue
Xfalsenulltruefalsetrue
serializing....16nulltruenull230