lint compliance
This commit is contained in:
parent
dd814713dd
commit
283f739be5
@ -22,7 +22,7 @@ define([
|
|||||||
var f = console.log;
|
var f = console.log;
|
||||||
if (typeof(console[level]) === "function") {
|
if (typeof(console[level]) === "function") {
|
||||||
f = console[level];
|
f = console[level];
|
||||||
};
|
}
|
||||||
if (logObject) { return void f(obj); }
|
if (logObject) { return void f(obj); }
|
||||||
f(JSON.stringify(obj));
|
f(JSON.stringify(obj));
|
||||||
};
|
};
|
||||||
@ -211,7 +211,7 @@ define([
|
|||||||
// first: data about the change with the lowest offset
|
// first: data about the change with the lowest offset
|
||||||
// last: data about the change with the latest offset
|
// last: data about the change with the latest offset
|
||||||
// in the comments, "I" am "first"
|
// in the comments, "I" am "first"
|
||||||
var fixMarks = function (first, last, content, toKeepEnd) {
|
var fixMarks = function (Env, first, last, content, toKeepEnd) {
|
||||||
var toKeep = [];
|
var toKeep = [];
|
||||||
var toJoin = {};
|
var toJoin = {};
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ define([
|
|||||||
var addCh = added[added.length - 1].length - removed[removed.length - 1].length;
|
var addCh = added[added.length - 1].length - removed[removed.length - 1].length;
|
||||||
if (addLine > 0) { addCh -= pos.ch; }
|
if (addLine > 0) { addCh -= pos.ch; }
|
||||||
if (addLine < 0) { addCh += pos.ch; }
|
if (addLine < 0) { addCh += pos.ch; }
|
||||||
toKeepEnd.forEach(function (array, i) {
|
toKeepEnd.forEach(function (array) {
|
||||||
// Push to correct lines
|
// Push to correct lines
|
||||||
array[1] += addLine;
|
array[1] += addLine;
|
||||||
if (typeof(array[4]) !== "undefined") { array[3] += addLine; }
|
if (typeof(array[4]) !== "undefined") { array[3] += addLine; }
|
||||||
@ -336,9 +336,9 @@ define([
|
|||||||
// We can't trust localDoc anymore because it contains data from the other branch
|
// We can't trust localDoc anymore because it contains data from the other branch
|
||||||
// It means the only changes that we need to consider are ours.
|
// It means the only changes that we need to consider are ours.
|
||||||
// Diff between userDoc and authDoc to see what we changed
|
// Diff between userDoc and authDoc to see what we changed
|
||||||
var myOps = ChainPad.Diff.diff(authDoc.content, userDoc.content).reverse();
|
var _myOps = ChainPad.Diff.diff(authDoc.content, userDoc.content).reverse();
|
||||||
var authormarks = Util.clone(authDoc.authormarks);
|
var authormarks = Util.clone(authDoc.authormarks);
|
||||||
myOps.forEach(function (op) {
|
_myOps.forEach(function (op) {
|
||||||
fixMarksFromOp(Env, op, authormarks.marks, authDoc.content);
|
fixMarksFromOp(Env, op, authormarks.marks, authDoc.content);
|
||||||
});
|
});
|
||||||
debug(Env, 'log', 'Fixed marks');
|
debug(Env, 'log', 'Fixed marks');
|
||||||
@ -420,7 +420,7 @@ define([
|
|||||||
prev.total = prev.me ? myTotal : theirTotal;
|
prev.total = prev.me ? myTotal : theirTotal;
|
||||||
op.total = op.me ? myTotal : theirTotal;
|
op.total = op.me ? myTotal : theirTotal;
|
||||||
// Fix the markers
|
// Fix the markers
|
||||||
fixMarks(op, prev, content, toKeepEnd);
|
fixMarks(Env, op, prev, content, toKeepEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (op.me) { myTotal -= op.size; }
|
if (op.me) { myTotal -= op.size; }
|
||||||
|
|||||||
@ -416,6 +416,7 @@ define([
|
|||||||
sframeChan.query('Q_GET_FULL_HISTORY', {
|
sframeChan.query('Q_GET_FULL_HISTORY', {
|
||||||
debug: true,
|
debug: true,
|
||||||
}, function (err, data) {
|
}, function (err, data) {
|
||||||
|
var start = 0;
|
||||||
var replay, input, left, right;
|
var replay, input, left, right;
|
||||||
var content = h('div.cp-app-debug-progress.cp-loading-progress', [
|
var content = h('div.cp-app-debug-progress.cp-loading-progress', [
|
||||||
h('p', [
|
h('p', [
|
||||||
@ -438,9 +439,7 @@ define([
|
|||||||
var chainpad = makeChainpad();
|
var chainpad = makeChainpad();
|
||||||
console.warn(chainpad);
|
console.warn(chainpad);
|
||||||
|
|
||||||
var start = 0;
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var messages = data.slice();
|
|
||||||
var play = function (_i) {
|
var play = function (_i) {
|
||||||
if (_i < (start+1)) { _i = start + 1; }
|
if (_i < (start+1)) { _i = start + 1; }
|
||||||
if (_i > data.length - 1) { _i = data.length - 1; }
|
if (_i > data.length - 1) { _i = data.length - 1; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user