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.16415515578512196Wikicontroltrue
GetUsersButtonagent.getActiveUsers();01
10000.9000141231751946Wikicontroltrue
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
notloggedin0
100012.711071039527965Wikicontroltrue
nullfalsetruenullfalse
webcollabextensionsfalsenullfalse
false
false
falsenullfalse
localrequirementsfalsetruefalse0false
initializerfalsetruefalse0false
TestRunner2falsetruefalse0false
lively.webcollab.WebChatClientfalsetruefalse0false
webcollabextensionsfalsetruefalse0false182.535507202148444nullnulltruefalsenullnulltruetrue
1true
null
null
null
nulltruetrue
-----falsetruefalse0false182.53550720214844
-1nullnullnulltruetruetrue
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'),getactiveusers:baseURL.withFilename('getactiveusers'),//-----getDocument:baseURL.withFilename('getdocument'),deleteDocument:baseURL.withFilename('deletedocument'),},parseJson:function(string){try{returnJSON.unserialize(string);}catch(e){console.warn('CannotparseJSON:'+string);debugger;returnnull;}},});WebChatClient=lively.webcollab.WebChatClient31truetrue2000000truetrue
1truetruetrue
Browseworld...falsenullfalse
Pushchangesbackfalsenullfalse
Refreshfalsenullfalse
Evalonfalsenullfalse
Sortfalsenullfalse
truetruenullfalsenullnullnullnullfalse0 ' + 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;
}]]>
null42