Lively Kernel canvas
//
DraftingShowProgress40
null
null1
Insight:Nottheuploading,buttheserializionisverytimeconsuming!18
//$morph('progress').setValue(0.0)$morph('progress').setLabel('')url=newURL('http://www.lively-kernel.org/repository/webwerkstatt/draft/draft.xhtml')r=newWebResource('http://www.lively-kernel.org/repository/webwerkstatt/draft/Draft.xhtml')c=r.getContent()withLayers([ShowProgressLayer],function(){tmp=newWebResource('http://www.lively-kernel.org/repository/webwerkstatt/draft/TmpDraft5.xhtml')tmp.beAsync();tmp.setContent(c)})12truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
createLayer("ShowProgressLayer")layerClass(ShowProgressLayer,NetRequest,{request:function(proceed,method,url,content){this.transport.upload.onprogress=function(rpe){console.log("progress"+(rpe.loaded/rpe.total))$morph('progress').setValue(rpe.loaded/rpe.total)}proceed(method,url,content)},})layerClass(ShowProgressLayer,Exporter,{serialize:function(destDocument){$morph('progress').setValue(0);$morph('progress').setLabel('Extendforserialization');//modelisinsertedaspartoftherootmorph.varhelpers=this.extendForSerialization();varresult=destDocument.importNode(this.rootMorph.rawNode,true);this.removeHelperNodes(helpers);$morph('progress').setValue(1);returnresult;}})createLayer("ShowProgressOnWorldSaveLayer");layerClass(ShowProgressOnWorldSaveLayer,WorldMorph,{saveWorld:function(proceed,optURL){optURL=optURL||URL.source.filename()varstart=newDate().getTime();vardoc=Exporter.shrinkWrapMorph(this.world());varserializeTime=newDate().getTime()-start;withLayers([ShowProgressLayer],function(){Exporter.saveDocumentAsyncToFile(doc,optURL);}.bind(this))vartime=newDate().getTime()-start;this.setStatusMessage("worldsavedto"+optURL+"in"+time+"ms("+(time-serializeTime)+"msupload)",Color.green,3)},})enableLayer(ShowProgressOnWorldSaveLayer)//disableLayer(ShowProgressOnWorldSaveLayer)Object.extend(Exporter,{saveDocumentAsyncToFile:function(doc,filename){if(!filename)returnnull;if(!filename.endsWith('.xhtml')){filename+=".xhtml";console.log("changedurlto"+filename+"forbase"+URL.source);}varurl=URL.source.withFilename(filename);varresource=newWebResource(url);resource.beAsync();resource.setContent(doc);returnnull;},})64truetruefalsetruetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
nullfalsetruenullfalse
Widgets.jsfalsenullfalse
false
false
falsenullfalse
http://www.lively-kernel.org/repository/webwerkstatt/truetruetruetruetrue
truetrue
1truetruetrue
codebasefalsenullfalsetrue
localfalsenullfalsetrue
Localcodefalsetruefalse0false186-1nullnullnulltruetruetrue
1true
null
null
null
nulltruetrue
-----falsetruefalse0false217
-1nullnullnulltruetruetrue
1true
null
null
null
nulltruetrue
-----falsetruefalse0false217
-1nullnullnulltruetruetrue
1true
null
null
null
nulltruetrue
20null
truetrue2000000truetrue
1truetruetrue
20null
truetruetruetrue
1truetruetrue
Addmodulefalsenullfalsetrue
Loadallfalsenullfalsetrue
LineNofalsenullfalsetrue
Refreshfalsenullfalsetrue
Evalonfalsenullfalsetrue
Sortfalsenullfalsetrue
Viewas...falsenullfalsetrue
truetrue
falsenullnullnullnullfalse
10000.9Wikicontroltrue
null66