From 3635cb6ca6b95ccc851aaaa21d6132f4ae744041 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 17 Feb 2021 16:29:33 +0000 Subject: [PATCH] lint: changesettracker.js long-lines --- src/static/js/changesettracker.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/static/js/changesettracker.js b/src/static/js/changesettracker.js index d64923396..7ddc54a11 100644 --- a/src/static/js/changesettracker.js +++ b/src/static/js/changesettracker.js @@ -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