Lively Kernel canvas
Savefalsenull
truenullfalse0
Saveas...falsenullfalsenull0
LogutButtonagent.broadcast({text:agent.user+'loggedout'});agent.logout();03
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
10000.4251681883732598Wikicontroltrue
GetUsersButtonagent.getActiveUsers();0
10009.22021914690085Wikicontroltrue
Login:falsenull
robert
Loginfalsenullfalsenull
Logoutfalsenullfalsenull
Channel:falsenull
test
true
Sendfalsenullfalsenull
false
-----falsetruefalse0false200
0nullnullfalsenull
Getusersfalsenullfalsenull0
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()210
nullfalsetruenullfalse
updateUserListfunctionfalsenullfalse
false
false
falsenullfalse
localrequirementsfalsetruefalse0false
initializerfalsetruefalse0false
TestRunner2falsetruefalse0false
lively.webcollab.WebChatClientfalsetruefalse0false
webcollabextensionsfalsetruefalse0false313.015-1nullnullnulltruenullfalsenulltruetrue
1true
null
null
null
nulltruetrue
-----falsetruefalse0false313.015
-1nullnullnulltruetruetrue
1true
null
null
null
nulltruetrue
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))}8truetrue2000000truetrue
1truetruetrue
Browseworld...falsenullfalse
Pushchangesbackfalsenullfalse
Refreshfalsenullfalse
Evalonfalsenullfalse
Sortfalsenullfalse
truetruenullfalsenullnullnullnullfalse0
notloggedin0 ' + 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('Error requesting active users');
var json = JSON.unserialize(req.responseText);
this.onGetActiveUsers(json.activeUsers);
}]]>= 400)
this.error('Failure issuing request. Status: ' + req.status + ' ' + req.responseText);
};
req.open(method, url, !sync);
req.send(content);
return req;
}]]>
null41