mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
editor: Delete commented-out code
This commit is contained in:
parent
eeead46437
commit
ab4e99f67a
3 changed files with 1 additions and 96 deletions
|
@ -108,7 +108,6 @@ exports.newLen = (cs) => exports.unpack(cs).newLen;
|
||||||
* @return {Op} type object iterator
|
* @return {Op} type object iterator
|
||||||
*/
|
*/
|
||||||
exports.opIterator = (opsStr, optStartIndex) => {
|
exports.opIterator = (opsStr, optStartIndex) => {
|
||||||
// print(opsStr);
|
|
||||||
const regex = /((?:\*[0-9a-z]+)*)(?:\|([0-9a-z]+))?([-+=])([0-9a-z]+)|\?|/g;
|
const regex = /((?:\*[0-9a-z]+)*)(?:\|([0-9a-z]+))?([-+=])([0-9a-z]+)|\?|/g;
|
||||||
const startIndex = (optStartIndex || 0);
|
const startIndex = (optStartIndex || 0);
|
||||||
let curIndex = startIndex;
|
let curIndex = startIndex;
|
||||||
|
@ -644,15 +643,8 @@ exports.textLinesMutator = (lines) => {
|
||||||
curLine += L;
|
curLine += L;
|
||||||
curCol = 0;
|
curCol = 0;
|
||||||
}
|
}
|
||||||
// print(inSplice+" / "+isCurLineInSplice()+" / "+curSplice[0]+" /
|
|
||||||
// "+curSplice[1]+" / "+lines.length);
|
|
||||||
/* if (inSplice && (! isCurLineInSplice()) && (curSplice[0] + curSplice[1] < lines.length)) {
|
|
||||||
print("BLAH");
|
|
||||||
putCurLineInSplice();
|
|
||||||
}*/
|
|
||||||
// tests case foo in remove(), which isn't otherwise covered in current impl
|
// tests case foo in remove(), which isn't otherwise covered in current impl
|
||||||
}
|
}
|
||||||
// debugPrint("skip");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const skip = (N, L, includeInSplice) => {
|
const skip = (N, L, includeInSplice) => {
|
||||||
|
@ -667,7 +659,6 @@ exports.textLinesMutator = (lines) => {
|
||||||
putCurLineInSplice();
|
putCurLineInSplice();
|
||||||
}
|
}
|
||||||
curCol += N;
|
curCol += N;
|
||||||
// debugPrint("skip");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -684,10 +675,8 @@ exports.textLinesMutator = (lines) => {
|
||||||
return lines_slice(m, m + k).join('');
|
return lines_slice(m, m + k).join('');
|
||||||
};
|
};
|
||||||
if (isCurLineInSplice()) {
|
if (isCurLineInSplice()) {
|
||||||
// print(curCol);
|
|
||||||
if (curCol === 0) {
|
if (curCol === 0) {
|
||||||
removed = curSplice[curSplice.length - 1];
|
removed = curSplice[curSplice.length - 1];
|
||||||
// print("FOO"); // case foo
|
|
||||||
curSplice.length--;
|
curSplice.length--;
|
||||||
removed += nextKLinesText(L - 1);
|
removed += nextKLinesText(L - 1);
|
||||||
curSplice[1] += L - 1;
|
curSplice[1] += L - 1;
|
||||||
|
@ -704,7 +693,6 @@ exports.textLinesMutator = (lines) => {
|
||||||
removed = nextKLinesText(L);
|
removed = nextKLinesText(L);
|
||||||
curSplice[1] += L;
|
curSplice[1] += L;
|
||||||
}
|
}
|
||||||
// debugPrint("remove");
|
|
||||||
}
|
}
|
||||||
return removed;
|
return removed;
|
||||||
};
|
};
|
||||||
|
@ -722,7 +710,6 @@ exports.textLinesMutator = (lines) => {
|
||||||
removed = curSplice[sline].substring(curCol, curCol + N);
|
removed = curSplice[sline].substring(curCol, curCol + N);
|
||||||
curSplice[sline] = curSplice[sline].substring(0, curCol) +
|
curSplice[sline] = curSplice[sline].substring(0, curCol) +
|
||||||
curSplice[sline].substring(curCol + N);
|
curSplice[sline].substring(curCol + N);
|
||||||
// debugPrint("remove");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return removed;
|
return removed;
|
||||||
|
@ -736,13 +723,6 @@ exports.textLinesMutator = (lines) => {
|
||||||
if (L) {
|
if (L) {
|
||||||
const newLines = exports.splitTextLines(text);
|
const newLines = exports.splitTextLines(text);
|
||||||
if (isCurLineInSplice()) {
|
if (isCurLineInSplice()) {
|
||||||
// if (curCol == 0) {
|
|
||||||
// curSplice.length--;
|
|
||||||
// curSplice[1]--;
|
|
||||||
// Array.prototype.push.apply(curSplice, newLines);
|
|
||||||
// curLine += newLines.length;
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
const sline = curSplice.length - 1;
|
const sline = curSplice.length - 1;
|
||||||
const theLine = curSplice[sline];
|
const theLine = curSplice[sline];
|
||||||
const lineCol = curCol;
|
const lineCol = curCol;
|
||||||
|
@ -753,7 +733,6 @@ exports.textLinesMutator = (lines) => {
|
||||||
curLine += newLines.length;
|
curLine += newLines.length;
|
||||||
curSplice.push(theLine.substring(lineCol));
|
curSplice.push(theLine.substring(lineCol));
|
||||||
curCol = 0;
|
curCol = 0;
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
Array.prototype.push.apply(curSplice, newLines);
|
Array.prototype.push.apply(curSplice, newLines);
|
||||||
curLine += newLines.length;
|
curLine += newLines.length;
|
||||||
|
@ -767,12 +746,10 @@ exports.textLinesMutator = (lines) => {
|
||||||
curSplice[sline].substring(curCol);
|
curSplice[sline].substring(curCol);
|
||||||
curCol += text.length;
|
curCol += text.length;
|
||||||
}
|
}
|
||||||
// debugPrint("insert");
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasMore = () => {
|
const hasMore = () => {
|
||||||
// print(lines.length+" / "+inSplice+" / "+(curSplice.length - 2)+" / "+curSplice[1]);
|
|
||||||
let docLines = lines_length();
|
let docLines = lines_length();
|
||||||
if (inSplice) {
|
if (inSplice) {
|
||||||
docLines += curSplice.length - 2 - curSplice[1];
|
docLines += curSplice.length - 2 - curSplice[1];
|
||||||
|
@ -784,7 +761,6 @@ exports.textLinesMutator = (lines) => {
|
||||||
if (inSplice) {
|
if (inSplice) {
|
||||||
leaveSplice();
|
leaveSplice();
|
||||||
}
|
}
|
||||||
// debugPrint("close");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const self = {
|
const self = {
|
||||||
|
@ -826,7 +802,6 @@ exports.applyZip = (in1, idx1, in2, idx2, func) => {
|
||||||
if ((!op2.opcode) && iter2.hasNext()) iter2.next(op2);
|
if ((!op2.opcode) && iter2.hasNext()) iter2.next(op2);
|
||||||
func(op1, op2, opOut);
|
func(op1, op2, opOut);
|
||||||
if (opOut.opcode) {
|
if (opOut.opcode) {
|
||||||
// print(opOut.toSource());
|
|
||||||
assem.append(opOut);
|
assem.append(opOut);
|
||||||
opOut.opcode = '';
|
opOut.opcode = '';
|
||||||
}
|
}
|
||||||
|
@ -1011,7 +986,6 @@ exports.composeAttributes = (att1, att2, resultIsMutation, pool) => {
|
||||||
buf.append('*');
|
buf.append('*');
|
||||||
buf.append(exports.numToString(pool.putAttrib(atts[i])));
|
buf.append(exports.numToString(pool.putAttrib(atts[i])));
|
||||||
}
|
}
|
||||||
// print(att1+" / "+att2+" / "+buf.toString());
|
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1023,7 +997,6 @@ exports._slicerZipperFunc = (attOp, csOp, opOut, pool) => {
|
||||||
// attOp is the op from the sequence that is being operated on, either an
|
// attOp is the op from the sequence that is being operated on, either an
|
||||||
// attribution string or the earlier of two exportss being composed.
|
// attribution string or the earlier of two exportss being composed.
|
||||||
// pool can be null if definitely not needed.
|
// pool can be null if definitely not needed.
|
||||||
// print(csOp.toSource()+" "+attOp.toSource()+" "+opOut.toSource());
|
|
||||||
if (attOp.opcode === '-') {
|
if (attOp.opcode === '-') {
|
||||||
exports.copyOp(attOp, opOut);
|
exports.copyOp(attOp, opOut);
|
||||||
attOp.opcode = '';
|
attOp.opcode = '';
|
||||||
|
@ -1120,15 +1093,7 @@ exports.applyToAttribution = (cs, astr, pool) => {
|
||||||
(op1, op2, opOut) => exports._slicerZipperFunc(op1, op2, opOut, pool));
|
(op1, op2, opOut) => exports._slicerZipperFunc(op1, op2, opOut, pool));
|
||||||
};
|
};
|
||||||
|
|
||||||
/* exports.oneInsertedLineAtATimeOpIterator = function(opsStr, optStartIndex, charBank) {
|
|
||||||
var iter = exports.opIterator(opsStr, optStartIndex);
|
|
||||||
var bankIndex = 0;
|
|
||||||
|
|
||||||
};*/
|
|
||||||
|
|
||||||
exports.mutateAttributionLines = (cs, lines, pool) => {
|
exports.mutateAttributionLines = (cs, lines, pool) => {
|
||||||
// dmesg(cs);
|
|
||||||
// dmesg(lines.toSource()+" ->");
|
|
||||||
const unpacked = exports.unpack(cs);
|
const unpacked = exports.unpack(cs);
|
||||||
const csIter = exports.opIterator(unpacked.ops);
|
const csIter = exports.opIterator(unpacked.ops);
|
||||||
const csBank = unpacked.charBank;
|
const csBank = unpacked.charBank;
|
||||||
|
@ -1154,7 +1119,6 @@ exports.mutateAttributionLines = (cs, lines, pool) => {
|
||||||
let lineAssem = null;
|
let lineAssem = null;
|
||||||
|
|
||||||
const outputMutOp = (op) => {
|
const outputMutOp = (op) => {
|
||||||
// print("outputMutOp: "+op.toSource());
|
|
||||||
if (!lineAssem) {
|
if (!lineAssem) {
|
||||||
lineAssem = exports.mergingOpAssembler();
|
lineAssem = exports.mergingOpAssembler();
|
||||||
}
|
}
|
||||||
|
@ -1174,17 +1138,12 @@ exports.mutateAttributionLines = (cs, lines, pool) => {
|
||||||
if ((!csOp.opcode) && csIter.hasNext()) {
|
if ((!csOp.opcode) && csIter.hasNext()) {
|
||||||
csIter.next(csOp);
|
csIter.next(csOp);
|
||||||
}
|
}
|
||||||
// print(csOp.toSource()+" "+attOp.toSource()+" "+opOut.toSource());
|
|
||||||
// print(csOp.opcode+"/"+csOp.lines+"/"+csOp.attribs+"/"+lineAssem+
|
|
||||||
// "/"+lineIter+"/"+(lineIter?lineIter.hasNext():null));
|
|
||||||
// print("csOp: "+csOp.toSource());
|
|
||||||
if ((!csOp.opcode) && (!attOp.opcode) && (!lineAssem) && (!(lineIter && lineIter.hasNext()))) {
|
if ((!csOp.opcode) && (!attOp.opcode) && (!lineAssem) && (!(lineIter && lineIter.hasNext()))) {
|
||||||
break; // done
|
break; // done
|
||||||
} else if (csOp.opcode === '=' && csOp.lines > 0 && (!csOp.attribs) &&
|
} else if (csOp.opcode === '=' && csOp.lines > 0 && (!csOp.attribs) &&
|
||||||
(!attOp.opcode) && (!lineAssem) && (!(lineIter && lineIter.hasNext()))) {
|
(!attOp.opcode) && (!lineAssem) && (!(lineIter && lineIter.hasNext()))) {
|
||||||
// skip multiple lines; this is what makes small changes not order of the document size
|
// skip multiple lines; this is what makes small changes not order of the document size
|
||||||
mut.skipLines(csOp.lines);
|
mut.skipLines(csOp.lines);
|
||||||
// print("skipped: "+csOp.lines);
|
|
||||||
csOp.opcode = '';
|
csOp.opcode = '';
|
||||||
} else if (csOp.opcode === '+') {
|
} else if (csOp.opcode === '+') {
|
||||||
if (csOp.lines > 1) {
|
if (csOp.lines > 1) {
|
||||||
|
@ -1205,7 +1164,6 @@ exports.mutateAttributionLines = (cs, lines, pool) => {
|
||||||
if ((!attOp.opcode) && isNextMutOp()) {
|
if ((!attOp.opcode) && isNextMutOp()) {
|
||||||
nextMutOp(attOp);
|
nextMutOp(attOp);
|
||||||
}
|
}
|
||||||
// print("attOp: "+attOp.toSource());
|
|
||||||
exports._slicerZipperFunc(attOp, csOp, opOut, pool);
|
exports._slicerZipperFunc(attOp, csOp, opOut, pool);
|
||||||
if (opOut.opcode) {
|
if (opOut.opcode) {
|
||||||
outputMutOp(opOut);
|
outputMutOp(opOut);
|
||||||
|
@ -1216,8 +1174,6 @@ exports.mutateAttributionLines = (cs, lines, pool) => {
|
||||||
|
|
||||||
exports.assert(!lineAssem, `line assembler not finished:${cs}`);
|
exports.assert(!lineAssem, `line assembler not finished:${cs}`);
|
||||||
mut.close();
|
mut.close();
|
||||||
|
|
||||||
// dmesg("-> "+lines.toSource());
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1299,11 +1255,6 @@ exports.compose = (cs1, cs2, pool) => {
|
||||||
const bankAssem = exports.stringAssembler();
|
const bankAssem = exports.stringAssembler();
|
||||||
|
|
||||||
const newOps = exports.applyZip(unpacked1.ops, 0, unpacked2.ops, 0, (op1, op2, opOut) => {
|
const newOps = exports.applyZip(unpacked1.ops, 0, unpacked2.ops, 0, (op1, op2, opOut) => {
|
||||||
// var debugBuilder = exports.stringAssembler();
|
|
||||||
// debugBuilder.append(exports.opString(op1));
|
|
||||||
// debugBuilder.append(',');
|
|
||||||
// debugBuilder.append(exports.opString(op2));
|
|
||||||
// debugBuilder.append(' / ');
|
|
||||||
const op1code = op1.opcode;
|
const op1code = op1.opcode;
|
||||||
const op2code = op2.opcode;
|
const op2code = op2.opcode;
|
||||||
if (op1code === '+' && op2code === '-') {
|
if (op1code === '+' && op2code === '-') {
|
||||||
|
@ -1317,13 +1268,6 @@ exports.compose = (cs1, cs2, pool) => {
|
||||||
bankAssem.append(bankIter1.take(opOut.chars));
|
bankAssem.append(bankIter1.take(opOut.chars));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// debugBuilder.append(exports.opString(op1));
|
|
||||||
// debugBuilder.append(',');
|
|
||||||
// debugBuilder.append(exports.opString(op2));
|
|
||||||
// debugBuilder.append(' -> ');
|
|
||||||
// debugBuilder.append(exports.opString(opOut));
|
|
||||||
// print(debugBuilder.toString());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return exports.pack(len1, len3, newOps, bankAssem.toString());
|
return exports.pack(len1, len3, newOps, bankAssem.toString());
|
||||||
|
@ -2196,7 +2140,6 @@ exports._slicerZipperFuncWithDeletions = (attOp, csOp, opOut, pool) => {
|
||||||
// attOp is the op from the sequence that is being operated on, either an
|
// attOp is the op from the sequence that is being operated on, either an
|
||||||
// attribution string or the earlier of two exportss being composed.
|
// attribution string or the earlier of two exportss being composed.
|
||||||
// pool can be null if definitely not needed.
|
// pool can be null if definitely not needed.
|
||||||
// print(csOp.toSource()+" "+attOp.toSource()+" "+opOut.toSource());
|
|
||||||
if (attOp.opcode === '-') {
|
if (attOp.opcode === '-') {
|
||||||
exports.copyOp(attOp, opOut);
|
exports.copyOp(attOp, opOut);
|
||||||
attOp.opcode = '';
|
attOp.opcode = '';
|
||||||
|
|
|
@ -301,12 +301,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
const inCallStack = (type, action) => {
|
const inCallStack = (type, action) => {
|
||||||
if (disposed) return;
|
if (disposed) return;
|
||||||
|
|
||||||
if (currentCallStack) {
|
|
||||||
// Do not uncomment this in production. It will break Etherpad being provided in iFrames.
|
|
||||||
// I am leaving this in for testing usefulness.
|
|
||||||
// top.console.error(`Can't enter callstack ${type}, already in ${currentCallStack.type}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const newEditEvent = (eventType) => ({
|
const newEditEvent = (eventType) => ({
|
||||||
eventType,
|
eventType,
|
||||||
backset: null,
|
backset: null,
|
||||||
|
@ -388,11 +382,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
if (cleanExit) {
|
if (cleanExit) {
|
||||||
submitOldEvent(cs.editEvent);
|
submitOldEvent(cs.editEvent);
|
||||||
if (cs.domClean && cs.type !== 'setup') {
|
if (cs.domClean && cs.type !== 'setup') {
|
||||||
// if (cs.isUserChange)
|
|
||||||
// {
|
|
||||||
// if (cs.repChanged) parenModule.notifyChange();
|
|
||||||
// else parenModule.notifyTick();
|
|
||||||
// }
|
|
||||||
if (cs.selectionAffected) {
|
if (cs.selectionAffected) {
|
||||||
updateBrowserSelectionFromRep();
|
updateBrowserSelectionFromRep();
|
||||||
}
|
}
|
||||||
|
@ -753,7 +742,7 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
let printedTrace = false;
|
let printedTrace = false;
|
||||||
const isTimeUp = () => {
|
const isTimeUp = () => {
|
||||||
if (exceededAlready) {
|
if (exceededAlready) {
|
||||||
if ((!printedTrace)) { // && now() - startTime - ms > 300) {
|
if ((!printedTrace)) {
|
||||||
printedTrace = true;
|
printedTrace = true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1176,7 +1165,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
entries.push(newEntry);
|
entries.push(newEntry);
|
||||||
lineNodeInfos[k] = newEntry.domInfo;
|
lineNodeInfos[k] = newEntry.domInfo;
|
||||||
}
|
}
|
||||||
// var fragment = magicdom.wrapDom(document.createDocumentFragment());
|
|
||||||
domInsertsNeeded.push([nodeToAddAfter, lineNodeInfos]);
|
domInsertsNeeded.push([nodeToAddAfter, lineNodeInfos]);
|
||||||
dirtyNodes.forEach((n) => {
|
dirtyNodes.forEach((n) => {
|
||||||
toDeleteAtEnd.push(n);
|
toDeleteAtEnd.push(n);
|
||||||
|
@ -1212,11 +1200,8 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
p.mark('del');
|
p.mark('del');
|
||||||
// delete old dom nodes
|
// delete old dom nodes
|
||||||
toDeleteAtEnd.forEach((n) => {
|
toDeleteAtEnd.forEach((n) => {
|
||||||
// var id = n.uniqueId();
|
|
||||||
// parent of n may not be "root" in IE due to non-tree-shaped DOM (wtf)
|
// parent of n may not be "root" in IE due to non-tree-shaped DOM (wtf)
|
||||||
if (n.parentNode) n.parentNode.removeChild(n);
|
if (n.parentNode) n.parentNode.removeChild(n);
|
||||||
|
|
||||||
// dmesg(htmlPrettyEscape(htmlForRemovedChild(n)));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// needed to stop chrome from breaking the ui when long strings without spaces are pasted
|
// needed to stop chrome from breaking the ui when long strings without spaces are pasted
|
||||||
|
@ -1228,7 +1213,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
// if the nodes that define the selection weren't encountered during
|
// if the nodes that define the selection weren't encountered during
|
||||||
// content collection, figure out where those nodes are now.
|
// content collection, figure out where those nodes are now.
|
||||||
if (selection && !selStart) {
|
if (selection && !selStart) {
|
||||||
// if (domChanges) dmesg("selection not collected");
|
|
||||||
const selStartFromHook = hooks.callAll('aceStartLineAndCharForPoint', {
|
const selStartFromHook = hooks.callAll('aceStartLineAndCharForPoint', {
|
||||||
callstack: currentCallStack,
|
callstack: currentCallStack,
|
||||||
editorInfo,
|
editorInfo,
|
||||||
|
@ -1398,9 +1382,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
const getPointForLineAndChar = (lineAndChar) => {
|
const getPointForLineAndChar = (lineAndChar) => {
|
||||||
const line = lineAndChar[0];
|
const line = lineAndChar[0];
|
||||||
let charsLeft = lineAndChar[1];
|
let charsLeft = lineAndChar[1];
|
||||||
// Do not uncomment this in production it will break iFrames.
|
|
||||||
// top.console.log("line: %d, key: %s, node: %o", line, rep.lines.atIndex(line).key,
|
|
||||||
// getCleanNodeByKey(rep.lines.atIndex(line).key));
|
|
||||||
const lineEntry = rep.lines.atIndex(line);
|
const lineEntry = rep.lines.atIndex(line);
|
||||||
charsLeft -= lineEntry.lineMarker;
|
charsLeft -= lineEntry.lineMarker;
|
||||||
if (charsLeft < 0) {
|
if (charsLeft < 0) {
|
||||||
|
@ -1574,7 +1555,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
throw new Error(`doRepApplyChangeset length mismatch: ${errMsg}`);
|
throw new Error(`doRepApplyChangeset length mismatch: ${errMsg}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// (function doRecordUndoInformation(changes) {
|
|
||||||
((changes) => {
|
((changes) => {
|
||||||
const editEvent = currentCallStack.editEvent;
|
const editEvent = currentCallStack.editEvent;
|
||||||
if (editEvent.eventType === 'nonundoable') {
|
if (editEvent.eventType === 'nonundoable') {
|
||||||
|
@ -1597,7 +1577,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
}
|
}
|
||||||
})(changes);
|
})(changes);
|
||||||
|
|
||||||
// rep.alltext = Changeset.applyToText(changes, rep.alltext);
|
|
||||||
Changeset.mutateAttributionLines(changes, rep.alines, rep.apool);
|
Changeset.mutateAttributionLines(changes, rep.alines, rep.apool);
|
||||||
|
|
||||||
if (changesetTracker.isTracking()) {
|
if (changesetTracker.isTracking()) {
|
||||||
|
@ -1994,7 +1973,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
theChangeset = builder.toString();
|
theChangeset = builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// dmesg(htmlPrettyEscape(theChangeset));
|
|
||||||
doRepApplyChangeset(theChangeset);
|
doRepApplyChangeset(theChangeset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2170,13 +2148,8 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
// Do not uncomment this in production it will break iFrames.
|
|
||||||
// top.console.log("selStart: %o, selEnd: %o, focusAtStart: %s", rep.selStart, rep.selEnd,
|
|
||||||
// String(!!rep.selFocusAtStart));
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
// Do not uncomment this in production it will break iFrames.
|
|
||||||
// top.console.log("%o %o %s", rep.selStart, rep.selEnd, rep.selFocusAtStart);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const isPadLoading = (eventType) => (
|
const isPadLoading = (eventType) => (
|
||||||
|
@ -2641,7 +2614,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
const tabSize = THE_TAB.length;
|
const tabSize = THE_TAB.length;
|
||||||
const toDelete = ((col2 - 1) % tabSize) + 1;
|
const toDelete = ((col2 - 1) % tabSize) + 1;
|
||||||
performDocumentReplaceRange([lineNum, col - toDelete], [lineNum, col], '');
|
performDocumentReplaceRange([lineNum, col - toDelete], [lineNum, col], '');
|
||||||
// scrollSelectionIntoView();
|
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2730,7 +2702,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
const altKey = evt.altKey;
|
const altKey = evt.altKey;
|
||||||
const shiftKey = evt.shiftKey;
|
const shiftKey = evt.shiftKey;
|
||||||
|
|
||||||
// dmesg("keyevent type: "+type+", which: "+which);
|
|
||||||
// Don't take action based on modifier keys going up and down.
|
// Don't take action based on modifier keys going up and down.
|
||||||
// Modifier keys do not generate "keypress" events.
|
// Modifier keys do not generate "keypress" events.
|
||||||
// 224 is the command-key under Mac Firefox.
|
// 224 is the command-key under Mac Firefox.
|
||||||
|
@ -2930,7 +2901,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
fastIncorp(4);
|
fastIncorp(4);
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
doReturnKey();
|
doReturnKey();
|
||||||
// scrollSelectionIntoView();
|
|
||||||
scheduler.setTimeout(() => {
|
scheduler.setTimeout(() => {
|
||||||
outerWin.scrollBy(-100, 0);
|
outerWin.scrollBy(-100, 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
@ -2979,7 +2949,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
fastIncorp(5);
|
fastIncorp(5);
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
doTabKey(evt.shiftKey);
|
doTabKey(evt.shiftKey);
|
||||||
// scrollSelectionIntoView();
|
|
||||||
specialHandled = true;
|
specialHandled = true;
|
||||||
}
|
}
|
||||||
if ((!specialHandled) &&
|
if ((!specialHandled) &&
|
||||||
|
@ -3273,7 +3242,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
if (isCollapsed) {
|
if (isCollapsed) {
|
||||||
const diveDeep = () => {
|
const diveDeep = () => {
|
||||||
while (p.node.childNodes.length > 0) {
|
while (p.node.childNodes.length > 0) {
|
||||||
// && (p.node == root || p.node.parentNode == root)) {
|
|
||||||
if (p.index === 0) {
|
if (p.index === 0) {
|
||||||
p.node = p.node.firstChild;
|
p.node = p.node.firstChild;
|
||||||
p.maxIndex = nodeMaxIndex(p.node);
|
p.maxIndex = nodeMaxIndex(p.node);
|
||||||
|
@ -3514,9 +3482,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
$(document).on('click', handleClick);
|
$(document).on('click', handleClick);
|
||||||
// dropdowns on edit bar need to be closed on clicks on both pad inner and pad outer
|
// dropdowns on edit bar need to be closed on clicks on both pad inner and pad outer
|
||||||
$(outerWin.document).on('click', hideEditBarDropdowns);
|
$(outerWin.document).on('click', hideEditBarDropdowns);
|
||||||
// Disabled: https://github.com/ether/etherpad-lite/issues/2546
|
|
||||||
// Will break OL re-numbering: https://github.com/ether/etherpad-lite/pull/2533
|
|
||||||
// $(document).on("cut", handleCut);
|
|
||||||
|
|
||||||
// If non-nullish, pasting on a link should be suppressed.
|
// If non-nullish, pasting on a link should be suppressed.
|
||||||
let suppressPasteOnLink = null;
|
let suppressPasteOnLink = null;
|
||||||
|
@ -3715,7 +3680,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
|
|
||||||
const mods = [];
|
const mods = [];
|
||||||
for (let n = firstLine; n <= lastLine; n++) {
|
for (let n = firstLine; n <= lastLine; n++) {
|
||||||
// var t = '';
|
|
||||||
let level = 0;
|
let level = 0;
|
||||||
let togglingOn = true;
|
let togglingOn = true;
|
||||||
const listType = /([a-z]+)([0-9]+)/.exec(getLineListType(n));
|
const listType = /([a-z]+)([0-9]+)/.exec(getLineListType(n));
|
||||||
|
@ -3726,7 +3690,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listType) {
|
if (listType) {
|
||||||
// t = listType[1];
|
|
||||||
level = Number(listType[2]);
|
level = Number(listType[2]);
|
||||||
}
|
}
|
||||||
const t = getLineListType(n);
|
const t = getLineListType(n);
|
||||||
|
|
|
@ -356,7 +356,6 @@ that is a string.
|
||||||
return self.indexOfEntry(self.atOffset(offset));
|
return self.indexOfEntry(self.atOffset(offset));
|
||||||
},
|
},
|
||||||
search: (entryFunc) => _search(entryFunc),
|
search: (entryFunc) => _search(entryFunc),
|
||||||
// debugToString: _debugToString,
|
|
||||||
debugGetPoint: _getPoint,
|
debugGetPoint: _getPoint,
|
||||||
debugDepth: () => start.levels,
|
debugDepth: () => start.levels,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue