ace2_inner: prefix all logging statements: "console.*" -> "top.console.*"
For reference, see: https://github.com/ether/etherpad-lite/pull/3915#issuecomment-617681463
This commit is contained in:
parent
5fa414636b
commit
1bd595fdc7
1 changed files with 33 additions and 33 deletions
|
@ -130,7 +130,7 @@ function Ace2Inner(){
|
||||||
console = {};
|
console = {};
|
||||||
for (var i = 0; i < names.length; ++i)
|
for (var i = 0; i < names.length; ++i)
|
||||||
console[names[i]] = noop;
|
console[names[i]] = noop;
|
||||||
//console.error = function(str) { alert(str); };
|
//top.console.error = function(str) { alert(str); };
|
||||||
}
|
}
|
||||||
|
|
||||||
var PROFILER = window.PROFILER;
|
var PROFILER = window.PROFILER;
|
||||||
|
@ -379,7 +379,7 @@ function Ace2Inner(){
|
||||||
|
|
||||||
if (currentCallStack)
|
if (currentCallStack)
|
||||||
{
|
{
|
||||||
console.error("Can't enter callstack " + type + ", already in " + currentCallStack.type);
|
top.console.error("Can't enter callstack " + type + ", already in " + currentCallStack.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
var profiling = false;
|
var profiling = false;
|
||||||
|
@ -387,7 +387,7 @@ function Ace2Inner(){
|
||||||
function profileRest()
|
function profileRest()
|
||||||
{
|
{
|
||||||
profiling = true;
|
profiling = true;
|
||||||
console.profile();
|
top.console.profile();
|
||||||
}
|
}
|
||||||
|
|
||||||
function newEditEvent(eventType)
|
function newEditEvent(eventType)
|
||||||
|
@ -477,7 +477,7 @@ function Ace2Inner(){
|
||||||
documentAttributeManager: documentAttributeManager
|
documentAttributeManager: documentAttributeManager
|
||||||
});
|
});
|
||||||
|
|
||||||
//console.log("Just did action for: "+type);
|
//top.console.log("Just did action for: "+type);
|
||||||
cleanExit = true;
|
cleanExit = true;
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
|
@ -493,7 +493,7 @@ function Ace2Inner(){
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
var cs = currentCallStack;
|
var cs = currentCallStack;
|
||||||
//console.log("Finished action for: "+type);
|
//top.console.log("Finished action for: "+type);
|
||||||
if (cleanExit)
|
if (cleanExit)
|
||||||
{
|
{
|
||||||
submitOldEvent(cs.editEvent);
|
submitOldEvent(cs.editEvent);
|
||||||
|
@ -527,7 +527,7 @@ function Ace2Inner(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
currentCallStack = null;
|
currentCallStack = null;
|
||||||
if (profiling) console.profileEnd();
|
if (profiling) top.console.profileEnd();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -749,7 +749,7 @@ function Ace2Inner(){
|
||||||
* See for reference:
|
* See for reference:
|
||||||
* - https://github.com/ether/etherpad-lite/issues/3861
|
* - https://github.com/ether/etherpad-lite/issues/3861
|
||||||
*/
|
*/
|
||||||
console.warn('atext.text is an empty string(""). Replacing with "\\n". See issue #3861.');
|
top.console.warn('atext.text is an empty string(""). Replacing with "\\n". See issue #3861.');
|
||||||
atext.text = "\n";
|
atext.text = "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1066,7 +1066,7 @@ function Ace2Inner(){
|
||||||
|
|
||||||
function newTimeLimit(ms)
|
function newTimeLimit(ms)
|
||||||
{
|
{
|
||||||
//console.debug("new time limit");
|
//top.console.debug("new time limit");
|
||||||
var startTime = now();
|
var startTime = now();
|
||||||
var lastElapsed = 0;
|
var lastElapsed = 0;
|
||||||
var exceededAlready = false;
|
var exceededAlready = false;
|
||||||
|
@ -1077,7 +1077,7 @@ function Ace2Inner(){
|
||||||
{
|
{
|
||||||
if ((!printedTrace))
|
if ((!printedTrace))
|
||||||
{ // && now() - startTime - ms > 300) {
|
{ // && now() - startTime - ms > 300) {
|
||||||
//console.trace();
|
//top.console.trace();
|
||||||
printedTrace = true;
|
printedTrace = true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1086,8 +1086,8 @@ function Ace2Inner(){
|
||||||
if (elapsed > ms)
|
if (elapsed > ms)
|
||||||
{
|
{
|
||||||
exceededAlready = true;
|
exceededAlready = true;
|
||||||
//console.debug("time limit hit, before was %d/%d", lastElapsed, ms);
|
//top.console.debug("time limit hit, before was %d/%d", lastElapsed, ms);
|
||||||
//console.trace();
|
//top.console.trace();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1186,7 +1186,7 @@ function Ace2Inner(){
|
||||||
|
|
||||||
var isTimeUp = newTimeLimit(250);
|
var isTimeUp = newTimeLimit(250);
|
||||||
|
|
||||||
//console.time("idlework");
|
//top.console.time("idlework");
|
||||||
var finishedImportantWork = false;
|
var finishedImportantWork = false;
|
||||||
var finishedWork = false;
|
var finishedWork = false;
|
||||||
|
|
||||||
|
@ -1205,13 +1205,13 @@ function Ace2Inner(){
|
||||||
|
|
||||||
var visibleRange = scroll.getVisibleCharRange(rep);
|
var visibleRange = scroll.getVisibleCharRange(rep);
|
||||||
var docRange = [0, rep.lines.totalWidth()];
|
var docRange = [0, rep.lines.totalWidth()];
|
||||||
//console.log("%o %o", docRange, visibleRange);
|
//top.console.log("%o %o", docRange, visibleRange);
|
||||||
finishedImportantWork = true;
|
finishedImportantWork = true;
|
||||||
finishedWork = true;
|
finishedWork = true;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
//console.timeEnd("idlework");
|
//top.console.timeEnd("idlework");
|
||||||
if (finishedWork)
|
if (finishedWork)
|
||||||
{
|
{
|
||||||
idleWorkTimer.atMost(1000);
|
idleWorkTimer.atMost(1000);
|
||||||
|
@ -1294,7 +1294,7 @@ function Ace2Inner(){
|
||||||
selectionNeedsResetting = true;
|
selectionNeedsResetting = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (timer()) console.dirxml(lineEntry.lineNode.dom);
|
//if (timer()) top.console.dirxml(lineEntry.lineNode.dom);
|
||||||
if (firstLine === null) firstLine = lineIndex;
|
if (firstLine === null) firstLine = lineIndex;
|
||||||
lastLine = lineIndex;
|
lastLine = lineIndex;
|
||||||
lineStart = lineEnd;
|
lineStart = lineEnd;
|
||||||
|
@ -1305,7 +1305,7 @@ function Ace2Inner(){
|
||||||
{
|
{
|
||||||
currentCallStack.selectionAffected = true;
|
currentCallStack.selectionAffected = true;
|
||||||
}
|
}
|
||||||
//console.debug("Recolored line range %d-%d", firstLine, lastLine);
|
//top.console.debug("Recolored line range %d-%d", firstLine, lastLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
// like getSpansForRange, but for a line, and the func takes (text,class)
|
// like getSpansForRange, but for a line, and the func takes (text,class)
|
||||||
|
@ -1511,7 +1511,7 @@ function Ace2Inner(){
|
||||||
observeSuspiciousNodes();
|
observeSuspiciousNodes();
|
||||||
p.mark("dirty");
|
p.mark("dirty");
|
||||||
var dirtyRanges = getDirtyRanges();
|
var dirtyRanges = getDirtyRanges();
|
||||||
//console.log("dirtyRanges: "+toSource(dirtyRanges));
|
//top.console.log("dirtyRanges: "+toSource(dirtyRanges));
|
||||||
var dirtyRangesCheckOut = true;
|
var dirtyRangesCheckOut = true;
|
||||||
var j = 0;
|
var j = 0;
|
||||||
var a, b;
|
var a, b;
|
||||||
|
@ -1545,8 +1545,8 @@ function Ace2Inner(){
|
||||||
p.mark("getsel");
|
p.mark("getsel");
|
||||||
var selection = getSelection();
|
var selection = getSelection();
|
||||||
|
|
||||||
//console.log(magicdom.root.dom.innerHTML);
|
//top.console.log(magicdom.root.dom.innerHTML);
|
||||||
//console.log("got selection: %o", selection);
|
//top.console.log("got selection: %o", selection);
|
||||||
var selStart, selEnd; // each one, if truthy, has [line,char] needed to set selection
|
var selStart, selEnd; // each one, if truthy, has [line,char] needed to set selection
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var splicesToDo = [];
|
var splicesToDo = [];
|
||||||
|
@ -1594,7 +1594,7 @@ function Ace2Inner(){
|
||||||
// It could be SPAN or a DIV; basically this is any case where the contentCollector
|
// It could be SPAN or a DIV; basically this is any case where the contentCollector
|
||||||
// decides it isn't done.
|
// decides it isn't done.
|
||||||
// Note that this clean node might need to be there for the next dirty range.
|
// Note that this clean node might need to be there for the next dirty range.
|
||||||
//console.log("inclusive of "+lastDirtyNode.next().dom.tagName);
|
//top.console.log("inclusive of "+lastDirtyNode.next().dom.tagName);
|
||||||
b++;
|
b++;
|
||||||
var cleanLine = lastDirtyNode.nextSibling;
|
var cleanLine = lastDirtyNode.nextSibling;
|
||||||
cc.collectContent(cleanLine);
|
cc.collectContent(cleanLine);
|
||||||
|
@ -1619,7 +1619,7 @@ function Ace2Inner(){
|
||||||
// Firefox isn't quite so bad, but it's still pretty quirky.
|
// Firefox isn't quite so bad, but it's still pretty quirky.
|
||||||
var scrollToTheLeftNeeded = true;
|
var scrollToTheLeftNeeded = true;
|
||||||
}
|
}
|
||||||
// console.log("Editor warning: " + linesWrapped + " long line" + (linesWrapped == 1 ? " was" : "s were") + " hard-wrapped into " + ccData.numLinesAfter + " lines.");
|
// top.console.log("Editor warning: " + linesWrapped + " long line" + (linesWrapped == 1 ? " was" : "s were") + " hard-wrapped into " + ccData.numLinesAfter + " lines.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ss[0] >= 0) selStart = [ss[0] + a + netNumLinesChangeSoFar, ss[1]];
|
if (ss[0] >= 0) selStart = [ss[0] + a + netNumLinesChangeSoFar, ss[1]];
|
||||||
|
@ -1683,7 +1683,7 @@ function Ace2Inner(){
|
||||||
if(n.parentNode) n.parentNode.removeChild(n);
|
if(n.parentNode) n.parentNode.removeChild(n);
|
||||||
|
|
||||||
//dmesg(htmlPrettyEscape(htmlForRemovedChild(n)));
|
//dmesg(htmlPrettyEscape(htmlForRemovedChild(n)));
|
||||||
//console.log("removed: "+id);
|
//top.console.log("removed: "+id);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(scrollToTheLeftNeeded){ // needed to stop chrome from breaking the ui when long strings without spaces are pasted
|
if(scrollToTheLeftNeeded){ // needed to stop chrome from breaking the ui when long strings without spaces are pasted
|
||||||
|
@ -1903,7 +1903,7 @@ function Ace2Inner(){
|
||||||
{
|
{
|
||||||
var line = lineAndChar[0];
|
var line = lineAndChar[0];
|
||||||
var charsLeft = lineAndChar[1];
|
var charsLeft = lineAndChar[1];
|
||||||
//console.log("line: %d, key: %s, node: %o", line, rep.lines.atIndex(line).key,
|
//top.console.log("line: %d, key: %s, node: %o", line, rep.lines.atIndex(line).key,
|
||||||
//getCleanNodeByKey(rep.lines.atIndex(line).key));
|
//getCleanNodeByKey(rep.lines.atIndex(line).key));
|
||||||
var lineEntry = rep.lines.atIndex(line);
|
var lineEntry = rep.lines.atIndex(line);
|
||||||
charsLeft -= lineEntry.lineMarker;
|
charsLeft -= lineEntry.lineMarker;
|
||||||
|
@ -2028,7 +2028,7 @@ function Ace2Inner(){
|
||||||
n = parNode;
|
n = parNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (n.id === "") console.debug("BAD");
|
if (n.id === "") top.console.debug("BAD");
|
||||||
if (n.firstChild && isBlockElement(n.firstChild))
|
if (n.firstChild && isBlockElement(n.firstChild))
|
||||||
{
|
{
|
||||||
col += 1; // lineMarker
|
col += 1; // lineMarker
|
||||||
|
@ -2915,11 +2915,11 @@ function Ace2Inner(){
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
//console.log("selStart: %o, selEnd: %o, focusAtStart: %s", rep.selStart, rep.selEnd,
|
//top.console.log("selStart: %o, selEnd: %o, focusAtStart: %s", rep.selStart, rep.selEnd,
|
||||||
//String(!!rep.selFocusAtStart));
|
//String(!!rep.selFocusAtStart));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
//console.log("%o %o %s", rep.selStart, rep.selEnd, rep.selFocusAtStart);
|
//top.console.log("%o %o %s", rep.selStart, rep.selEnd, rep.selFocusAtStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isPadLoading(eventType)
|
function isPadLoading(eventType)
|
||||||
|
@ -3152,14 +3152,14 @@ function Ace2Inner(){
|
||||||
// returns whether line was already correctly assigned (i.e. correctly
|
// returns whether line was already correctly assigned (i.e. correctly
|
||||||
// clean or dirty, according to cleanRanges, and if clean, correctly
|
// clean or dirty, according to cleanRanges, and if clean, correctly
|
||||||
// attached or not attached (i.e. in the same range as) the prev and next lines).
|
// attached or not attached (i.e. in the same range as) the prev and next lines).
|
||||||
//console.log("correctly assigning: %d", line);
|
//top.console.log("correctly assigning: %d", line);
|
||||||
var rng = rangeForLine(line);
|
var rng = rangeForLine(line);
|
||||||
var lineClean = isClean(line);
|
var lineClean = isClean(line);
|
||||||
if (rng < 0)
|
if (rng < 0)
|
||||||
{
|
{
|
||||||
if (lineClean)
|
if (lineClean)
|
||||||
{
|
{
|
||||||
console.debug("somehow lost clean line");
|
top.console.debug("somehow lost clean line");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3239,7 +3239,7 @@ function Ace2Inner(){
|
||||||
detectChangesAroundLine(N - 1, 1);
|
detectChangesAroundLine(N - 1, 1);
|
||||||
|
|
||||||
p.mark("obs");
|
p.mark("obs");
|
||||||
//console.log("observedChanges: "+toSource(observedChanges));
|
//top.console.log("observedChanges: "+toSource(observedChanges));
|
||||||
for (var k in observedChanges.cleanNodesNearChanges)
|
for (var k in observedChanges.cleanNodesNearChanges)
|
||||||
{
|
{
|
||||||
var key = k.substring(1);
|
var key = k.substring(1);
|
||||||
|
@ -4718,10 +4718,10 @@ function Ace2Inner(){
|
||||||
// can handle "backwards"-oriented selection, shift-arrow-keys move start
|
// can handle "backwards"-oriented selection, shift-arrow-keys move start
|
||||||
// of selection
|
// of selection
|
||||||
browserSelection.collapse(end.container, end.offset);
|
browserSelection.collapse(end.container, end.offset);
|
||||||
//console.trace();
|
//top.console.trace();
|
||||||
//console.log(htmlPrettyEscape(rep.alltext));
|
//top.console.log(htmlPrettyEscape(rep.alltext));
|
||||||
//console.log("%o %o", rep.selStart, rep.selEnd);
|
//top.console.log("%o %o", rep.selStart, rep.selEnd);
|
||||||
//console.log("%o %d", start.container, start.offset);
|
//top.console.log("%o %d", start.container, start.offset);
|
||||||
browserSelection.extend(start.container, start.offset);
|
browserSelection.extend(start.container, start.offset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue