added Pad model via Joose, PadManager is a lot cleaner now.

This commit is contained in:
Hans Pinckaers 2011-05-16 16:30:21 +02:00
parent 7fb631b922
commit 499c560abd
5 changed files with 167 additions and 223 deletions

View file

@ -251,11 +251,11 @@ function handleUserChanges(client, message)
//ex. adoptChangesetAttribs
//Afaik, it copies the new attributes from the changeset, to the global Attribute Pool
changeset = Changeset.moveOpsToNewPool(changeset, wireApool, pad.pool());
changeset = Changeset.moveOpsToNewPool(changeset, wireApool, pad.pool);
//ex. applyUserChanges
var apool = pad.pool();
var apool = pad.pool;
var r = baseRev;
while (r < pad.getHeadRevisionNumber()) {
@ -274,7 +274,7 @@ function handleUserChanges(client, message)
pad.appendRevision(changeset, thisAuthor);
var correctionChangeset = _correctMarkersInPad(pad.atext(), pad.pool());
var correctionChangeset = _correctMarkersInPad(pad.atext, pad.pool);
if (correctionChangeset) {
pad.appendRevision(correctionChangeset);
}
@ -303,7 +303,7 @@ function handleUserChanges(client, message)
}
else
{
var forWire = Changeset.prepareForWire(pad.getRevisionChangeset(r), pad.pool());
var forWire = Changeset.prepareForWire(pad.getRevisionChangeset(r), pad.pool);
var wireMsg = {"type":"COLLABROOM","data":{type:"NEW_CHANGES", newRev:r,
changeset: forWire.translated,
apool: forWire.pool,
@ -421,8 +421,8 @@ function handleClientReady(client, message)
var pad = padManager.getPad(message.padId, false);
//prepare all values for the wire
atext = pad.atext();
var attribsForWire = Changeset.prepareForWire(atext.attribs, pad.pool());
atext = pad.atext;
var attribsForWire = Changeset.prepareForWire(atext.attribs, pad.pool);
var apool = attribsForWire.pool.toJsonable();
atext.attribs = attribsForWire.translated;