lint: changesettracker.js long-lines

pull/4832/head^2
John McLear 2021-02-17 16:29:33 +00:00
parent f5f4e3a6d1
commit 3635cb6ca6
1 changed files with 12 additions and 5 deletions

View File

@ -111,8 +111,10 @@ const makeChangesetTracker = (scheduler, apool, aceCallbacksProvider) => {
const preferInsertingAfterUserChanges = true;
const oldUserChangeset = userChangeset;
userChangeset = Changeset.follow(c2, oldUserChangeset, preferInsertingAfterUserChanges, apool);
const postChange = Changeset.follow(oldUserChangeset, c2, !preferInsertingAfterUserChanges, apool);
userChangeset = Changeset.follow(
c2, oldUserChangeset, preferInsertingAfterUserChanges, apool);
const postChange = Changeset.follow(
oldUserChangeset, c2, !preferInsertingAfterUserChanges, apool);
const preferInsertionAfterCaret = true; // (optAuthor && optAuthor > thisAuthor);
applyingNonUserChanges = true;
@ -135,7 +137,9 @@ const makeChangesetTracker = (scheduler, apool, aceCallbacksProvider) => {
// add forEach function to Array.prototype for IE8
if (!('forEach' in Array.prototype)) {
Array.prototype.forEach = function (action, that /* opt*/) {
for (let i = 0, n = this.length; i < n; i++) if (i in this) action.call(that, this[i], i, this);
for (let i = 0, n = this.length; i < n; i++) {
if (i in this) action.call(that, this[i], i, this);
}
};
}
@ -143,10 +147,13 @@ const makeChangesetTracker = (scheduler, apool, aceCallbacksProvider) => {
const authorId = parent.parent.pad.myUserInfo.userId;
// Sanitize authorship
// We need to replace all author attribs with thisSession.author, in case they copy/pasted or otherwise inserted other peoples changes
// We need to replace all author attribs with thisSession.author,
// in case they copy/pasted or otherwise inserted other peoples changes
if (apool.numToAttrib) {
for (const attr in apool.numToAttrib) {
if (apool.numToAttrib[attr][0] == 'author' && apool.numToAttrib[attr][1] == authorId) var authorAttr = Number(attr).toString(36);
if (apool.numToAttrib[attr][0] == 'author' && apool.numToAttrib[attr][1] == authorId) {
var authorAttr = Number(attr).toString(36);
}
}
// Replace all added 'author' attribs with the value of the current user