Lively Kernel canvas
Savefalsenull
truenullfalse
Loggedin
Saveas...falsenullfalsenull
Login:falsenull
Loginfalsenullfalse
EinTest2EinTest2EinTestEinTestEinTestEinTestEinTest7
10000.02721090838990636Wikicontroltrue
10009.6716996670792Wikicontroltrue
nulltruechatMorph=newBoxMorph(newRectangle(20,100,400,500))chatMorph.openInWorld()//chatMorph.remove()chatMorph.setFill(Color.rgb(220,220,220))loginLabel=newTextMorph(newRectangle(20,20,50,20),'Login:')chatMorph.addMorph(loginLabel)loginLabel.beLabel()loginLabel.setPosition(pt(20,24))//loginLabel.remove()login=newTextMorph(newRectangle(70,20,80,20),'')chatMorph.addMorph(login)login.setExtent(pt(160,20))login.setName('login')//login.remove()loginButton=newButtonMorph(newRectangle(240,20,70,20))chatMorph.addMorph(loginButton)loginButton.setLabel('Login')loginHandler={btnPress:function(val){if(!val)return;varuser=$morph('login').textString;}}connect(loginButton,'value',$morph('login'),clip=newClipMorph(newRectangle(0,0,400,400))clip.applyStyle({borderWidth:1,borderColor:Color.black})clip.openInWorld()clip.ownerclip.remove()truetruefalse34truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
config={user:'robert',listenOnChannels:['testChannel'],onLogin:function(){agent.shouldBeLoggedIn=true$morph('status').updateTextString('Loggedin')},onStreamClose:function(){$morph('status').updateTextString('Loggedout');if(agent.shouldBeLoggedIn)agent.login();},onLogout:function(){agent.shouldBeLoggedIn=false},onReceive:function(json){varm=$morph('chatText')varchatText=json.message.text+'\n'+m.textString;m.updateTextString(chatText)},}agent=newWebCollabAgent(config)agent.login()agent.isLoggedIn()agent.logout()agent.broadcast({channel:'testChannel',text:'EinTest2'})agent2=newWebCollabAgent({user:'robert3'})
nulltruetruetruefalse36truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
nullfalsetruenullfalse
webcollabextensionsfalsenullfalse
false
false
falsenullfalse
localrequirementsfalsetruefalse0false
initializerfalsetruefalse0false
TestRunner2falsetruefalse0false
lively.webcollab.WebChatClientfalsetruefalse0false
webcollabextensionsfalsetruefalse0false3104nullnulltruefalsenullnulltruetrue
1true
null
null
null
nulltruetrue
-----falsetruefalse0false310
-1nullnullnulltruefalsenullnulltruetrue
1true
null
null
null
nulltruetrue
varbaseURL=URL.common.domain.withFilename('web-collab-squeak/web-collab/');Object.extend(lively.webcollab,{urls:{login:baseURL.withFilename('login'),logout:baseURL.withFilename('logout'),testStream:baseURL.withFilename('testStream'),reset:baseURL.withFilename('reset'),broadcast:baseURL.withFilename('broadcast'),//-----getDocument:baseURL.withFilename('getdocument'),deleteDocument:baseURL.withFilename('deletedocument'),},parseJson:function(string){try{returnJSON.unserialize(string);}catch(e){console.warn('CannotparseJSON:'+string);debugger;returnnull;}},});WebCollabAgent=lively.webcollab.agent.WebCollabAgenttruetrue2000000truetrue
1truetruetrue
Browseworld...falsenullfalse
Pushchangesbackfalsenullfalse
Refreshfalsenullfalse
Evalonfalsenullfalse
Sortfalsenullfalse
truetruenullfalsenullnullnullnullfalse ' + msg : '');
var testSerialized = Strings.format('new %s(null, "%s")', test.name(), test.currentSelector);
this.testResultDict[id] = {isListItem: true, string: string, value: testSerialized, test: test, isJSONConformant: true}
var list = Object.values(this.testResultDict).select(function(ea) { return ea.isListItem });
var errorOccurred = list.any(function(ea) { return ea.test && ea.test._errorOccured });
this.panel.testInput.setFill(errorOccurred ? Color.red : Color.green);
this.setList(list);
}]]> 400)
throw new Error('Error in login/receive from stream. Message: ' + newText);
// newText can be a list of cr lf separated json messages
// call onLogin/onReceive just with one json obj at a time
var messages = newText.split('\r\n');
messages.pop(); // remove last empty string
messages.forEach(function(message) {
var json = lively.webcollab.parseJson(message);
if (reqTextPos === 0 || json.isLoginMessage /*FIXME under heavy load reqTextPos not 0 when login response arrives*/) {
this._isLoggedIn = json && json.isSuccess;
this.onLogin(req);
} else {
this.onReceive(json);
}
}, this);
}]]> 400) {
var json = JSON.parse(req.responseText);
throw new Error('Logout not successful ' + json.status);
}
this._isLoggedIn = false;
}]]>= 400)
throw new Error('Failure issuing request. Status: ' + req.status + ' ' + req.responseText);
};
req.open(method, url, !sync);
req.send(content);
return req;
}]]>
null33