remove console logs and cruft
This commit is contained in:
parent
f4de7f6a90
commit
337179fddd
|
@ -176,7 +176,6 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider)
|
||||||
, iterator = Changeset.opIterator(cs.ops)
|
, iterator = Changeset.opIterator(cs.ops)
|
||||||
, op
|
, op
|
||||||
, assem = Changeset.mergingOpAssembler();
|
, assem = Changeset.mergingOpAssembler();
|
||||||
console.log(cs.ops)
|
|
||||||
while(iterator.hasNext()) {
|
while(iterator.hasNext()) {
|
||||||
op = iterator.next()
|
op = iterator.next()
|
||||||
if(op.opcode == '+') {
|
if(op.opcode == '+') {
|
||||||
|
@ -186,7 +185,10 @@ console.log(cs.ops)
|
||||||
if(!attrNum) return
|
if(!attrNum) return
|
||||||
attr = apool.getAttrib(attrNum)
|
attr = apool.getAttrib(attrNum)
|
||||||
if(!attr) return
|
if(!attr) return
|
||||||
if('author' == attr[0] && !~newAttrs.indexOf(authorAttr)) {newAttrs += '*'+authorAttr; console.log('replacing author attribute ', attrNum, '(', attr[1], ') with', authorAttr) }
|
if('author' == attr[0] && !~newAttrs.indexOf(authorAttr)) {
|
||||||
|
newAttrs += '*'+authorAttr;
|
||||||
|
// console.log('replacing author attribute ', attrNum, '(', attr[1], ') with', authorAttr)
|
||||||
|
}
|
||||||
else newAttrs += '*'+attrNum
|
else newAttrs += '*'+attrNum
|
||||||
})
|
})
|
||||||
op.attribs = newAttrs
|
op.attribs = newAttrs
|
||||||
|
@ -194,30 +196,9 @@ console.log(cs.ops)
|
||||||
assem.append(op)
|
assem.append(op)
|
||||||
}
|
}
|
||||||
assem.endDocument();
|
assem.endDocument();
|
||||||
console.log(assem.toString())
|
|
||||||
userChangeset = Changeset.pack(cs.oldLen, cs.newLen, assem.toString(), cs.charBank)
|
userChangeset = Changeset.pack(cs.oldLen, cs.newLen, assem.toString(), cs.charBank)
|
||||||
Changeset.checkRep(userChangeset)
|
Changeset.checkRep(userChangeset)
|
||||||
console.log(userChangeset)
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
// Make sure the actual author is the AuthorID
|
|
||||||
// We need to replace apool attrToNum value where the first value before
|
|
||||||
// the comma is author with authorId
|
|
||||||
var attrToNum = apool.attribToNum;
|
|
||||||
if(attrToNum){
|
|
||||||
for (var attr in attrToNum){
|
|
||||||
var splitAttr = attr.split(',');
|
|
||||||
var isAuthor = (splitAttr[0] === 'author'); // Is it an author val?
|
|
||||||
if (isAuthor){
|
|
||||||
// We force write the author over a change, for sanity n stuff
|
|
||||||
var newValue = 'author,'+authorId; // Create a new value
|
|
||||||
var key = attrToNum[attr]; // Key is actually the value
|
|
||||||
delete apool.attribToNum[attr]; // Delete the old value
|
|
||||||
apool.attribToNum[newValue] = key; // Write a new value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (Changeset.isIdentity(userChangeset)) toSubmit = null;
|
if (Changeset.isIdentity(userChangeset)) toSubmit = null;
|
||||||
else toSubmit = userChangeset;
|
else toSubmit = userChangeset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue