Lively Kernel canvas
Savefalsenull
truenullfalse0
notloggedin0
Saveas...falsenullfalsenull0
10000.9185668837047085Wikicontroltrue
0
10000.00025854330698682053Wikicontroltrue
0
LoginButtonif(!Global.agent){WorldMorph.current().alert('Noagentdefined');return;}varuserName=$morph('login').textString;if(!userName){WorldMorph.current().alert('Pleaseenterausername!');return;}if(agent.isLoggedIn()){WorldMorph.current().alert(userName+'isalreadyloggedin!')return;}agent.setChannel(userName)agent.setUser(userName)agent.login()190
10000.000005468772407752453Wikicontroltrue
0
10000.006364635067151832Wikicontroltrue
0
Login:falsenull
robert
Loginfalsenullfalsenull
Logoutfalsenullfalsenull
Channel:falsenull
test
robert:robertloggedoutrobert:robertloggedinrobert:robertloggedoutrobert:robertloggedinrobert:robertloggedoutrobert:robertloggedinrobert:robertloggedoutrobert:robertloggedinrobert:robertloggedinrobert2:diesisteintest:!!!!robert:hallo!robert:dasisteintest:-)robert:halloweltrobert:dasdrobert:asdsdrobertsadsdrobertasdsrobertdsdrobertsadrobertdsadrobertasdsdrobertasdsadrobertasdrobertdsadrobertasdsEinTest2EinTest2EinTestEinTestEinTestEinTest34true
Sendfalsenullfalsenull
false0
10009.353717257451926Wikicontroltrue
LogutButtonagent.broadcast({text:agent.user+'loggedout'});agent.logout();0
-----falsetruefalse0false200
0nullnullfalsenull
agent=newWebChatClient()agent.channelagent.broadcast()agent.loginagent.setUser(userName)agent.login()varchannel=$morph('channel').textStringvartext=$morph('sendText').textStringif(!channel){WorldMorph.current().alert('Nochanneldefined')return;}if(!text)returnagent.broadcast({channel:channel,text:text})//$morph('sendText').updateTextString('')x={"user":"robert","listenOnChannels":[],"isLoginMessage":true}x.isLoginMessage$morph('sendText').closeDnD()
nulltruetruetruefalse25truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse0
SendButtonvarchannel=$morph('channel').textStringvartext=$morph('sendText').textStringif(!channel){WorldMorph.current().alert('Nochanneldefined')return;}if(!text)returnagent.broadcast({channel:channel,text:text})//$morph('sendText').updateTextString('')11
nullfalsetruenullfalse
updateUserListfunctionfalsenullfalse
false
false
falsenullfalse
localrequirementsfalsetruefalse0false
initializerfalsetruefalse0false
TestRunner2falsetruefalse0false
lively.webcollab.WebChatClientfalsetruefalse0false
webcollabextensionsfalsetruefalse0false
updateUserListfunctionfalsetruefalse0false3105nullnulltruefalsenullnulltruetrue
1true
null
null
null
nulltruetrue
-----falsetruefalse0false310
-1nullnullnulltruefalsenullnullfalsetruetrue
1true
null
null
null
nulltruetrue
1true
updateUserList=function(json){varisLogin=json.message.text.endsWith('loggedin');varisLogout=json.message.text.endsWith('loggedout');varuserList=$morph('activeUsers');if(isLogin)userList.updateList(userList.itemList.concat([json.user]))if(isLogout)userList.updateList(userList.itemList.without(json.user))}truetrue2000000truetruetruetrue
Browseworld...falsenullfalse
Pushchangesbackfalsenullfalse
Refreshfalsenullfalse
Evalonfalsenullfalse
Sortfalsenullfalse
truetruenullfalsenullnullnullnullfalse0
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,350,200))clip.applyStyle({borderWidth:1,borderColor:Color.black})clip.openInWorld()clip.ownerclip.remove()list=newListMorph(newRectangle(0,0,200,250),['nix'])list.openInWorld()list.itemListlist.updateList([])truetruefalse40truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse0 ' + 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)
this.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.unserialize(req.responseText);
this.error('Logout not successful ' + json.status);
}
this._isLoggedIn = false;
}]]>= 400)
this.error('Failure issuing request. Status: ' + req.status + ' ' + req.responseText);
};
req.open(method, url, !sync);
req.send(content);
return req;
}]]>
null39