Lively Kernel canvas
Savefalsenull
truenullfalse
Login:falsenull
Loginfalsenullfalse
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'),truetruefalse27truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Loggedout
nullfalsetruenullfalse
webcollabextensionsfalsenullfalse
false
false
falsenullfalse
localrequirementsfalsetruefalse0false
initializerfalsetruefalse0false
TestRunner2falsetruefalse0false
webcollabextensionsfalsetruefalse0false
lively.webcollab.agent.WebCollabAgentfalsetruefalse0false
helperfalsetruefalse0false3103nullnulltruetruetrue
1true
null
null
null
nulltruetrue
-----falsetruefalse0false310
-1nullnullnulltruetruetrue
1true
null
null
null
nulltruetrue
module('lively.webcollab')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;}},});26truetrue2000000truetrue
1truetruetrue
Browseworld...falsenullfalse
Pushchangesbackfalsenullfalse
Refreshfalsenullfalse
Evalonfalsenullfalse
Sortfalsenullfalse
truetruefalsenullnullnullnullfalse
config={user:'robert',onLogin:function(){$morph('status').updateTextString('Loggedin')},onStreamClose:function(){$morph('status').updateTextString('Loggedout')}}agent=newWebCollabAgent(config)agent.login()agent.isLoggedIn()
nulltruetruetruefalse13truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
100010.184128957549493Wikicontroltrue
' + 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.config().onLogin && this.config().onLogin(req);
} else {
this.config().onReceive && this.config().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;
}]]>
null28