mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
Pad: Delete non-functional debug logging facility
This commit is contained in:
parent
5d39a57507
commit
8d869ec927
7 changed files with 0 additions and 36 deletions
|
@ -22,8 +22,6 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const Security = require('./security');
|
|
||||||
|
|
||||||
const isNodeText = (node) => (node.nodeType === 3);
|
const isNodeText = (node) => (node.nodeType === 3);
|
||||||
|
|
||||||
const getAssoc = (obj, name) => obj[`_magicdom_${name}`];
|
const getAssoc = (obj, name) => obj[`_magicdom_${name}`];
|
||||||
|
@ -60,8 +58,6 @@ const binarySearchInfinite = (expectedLength, func) => {
|
||||||
return binarySearch(i, func);
|
return binarySearch(i, func);
|
||||||
};
|
};
|
||||||
|
|
||||||
const htmlPrettyEscape = (str) => Security.escapeHTML(str).replace(/\r?\n/g, '\\n');
|
|
||||||
|
|
||||||
const noop = () => {};
|
const noop = () => {};
|
||||||
|
|
||||||
exports.isNodeText = isNodeText;
|
exports.isNodeText = isNodeText;
|
||||||
|
@ -69,5 +65,4 @@ exports.getAssoc = getAssoc;
|
||||||
exports.setAssoc = setAssoc;
|
exports.setAssoc = setAssoc;
|
||||||
exports.binarySearch = binarySearch;
|
exports.binarySearch = binarySearch;
|
||||||
exports.binarySearchInfinite = binarySearchInfinite;
|
exports.binarySearchInfinite = binarySearchInfinite;
|
||||||
exports.htmlPrettyEscape = htmlPrettyEscape;
|
|
||||||
exports.noop = noop;
|
exports.noop = noop;
|
||||||
|
|
|
@ -26,7 +26,6 @@ const $ = require('./rjquery').$;
|
||||||
const isNodeText = Ace2Common.isNodeText;
|
const isNodeText = Ace2Common.isNodeText;
|
||||||
const getAssoc = Ace2Common.getAssoc;
|
const getAssoc = Ace2Common.getAssoc;
|
||||||
const setAssoc = Ace2Common.setAssoc;
|
const setAssoc = Ace2Common.setAssoc;
|
||||||
const htmlPrettyEscape = Ace2Common.htmlPrettyEscape;
|
|
||||||
const noop = Ace2Common.noop;
|
const noop = Ace2Common.noop;
|
||||||
const hooks = require('./pluginfw/hooks');
|
const hooks = require('./pluginfw/hooks');
|
||||||
|
|
||||||
|
@ -146,20 +145,12 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
for (let i = 0; i < names.length; ++i) console[names[i]] = noop;
|
for (let i = 0; i < names.length; ++i) console[names[i]] = noop;
|
||||||
}
|
}
|
||||||
|
|
||||||
// "dmesg" is for displaying messages in the in-page output pane
|
|
||||||
// visible when "?djs=1" is appended to the pad URL. It generally
|
|
||||||
// remains a no-op unless djs is enabled, but we make a habit of
|
|
||||||
// only calling it in error cases or while debugging.
|
|
||||||
let dmesg = noop;
|
|
||||||
window.dmesg = noop;
|
|
||||||
|
|
||||||
const scheduler = parent; // hack for opera required
|
const scheduler = parent; // hack for opera required
|
||||||
|
|
||||||
const performDocumentReplaceRange = (start, end, newText) => {
|
const performDocumentReplaceRange = (start, end, newText) => {
|
||||||
if (start === undefined) start = rep.selStart;
|
if (start === undefined) start = rep.selStart;
|
||||||
if (end === undefined) end = rep.selEnd;
|
if (end === undefined) end = rep.selEnd;
|
||||||
|
|
||||||
// dmesg(String([start.toSource(),end.toSource(),newText.toSource()]));
|
|
||||||
// start[0]: <--- start[1] --->CCCCCCCCCCC\n
|
// start[0]: <--- start[1] --->CCCCCCCCCCC\n
|
||||||
// CCCCCCCCCCCCCCCCCCCC\n
|
// CCCCCCCCCCCCCCCCCCCC\n
|
||||||
// CCCC\n
|
// CCCC\n
|
||||||
|
@ -374,7 +365,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
error: e,
|
error: e,
|
||||||
time: +new Date(),
|
time: +new Date(),
|
||||||
});
|
});
|
||||||
dmesg(e.toString());
|
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
const cs = currentCallStack;
|
const cs = currentCallStack;
|
||||||
|
@ -546,8 +536,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
idleWorkTimer.atMost(100);
|
idleWorkTimer.atMost(100);
|
||||||
|
|
||||||
if (rep.alltext !== atext.text) {
|
if (rep.alltext !== atext.text) {
|
||||||
dmesg(htmlPrettyEscape(rep.alltext));
|
|
||||||
dmesg(htmlPrettyEscape(atext.text));
|
|
||||||
throw new Error('mismatch error setting raw text in setDocAText');
|
throw new Error('mismatch error setting raw text in setDocAText');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -653,7 +641,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
sideDiv.parentNode.classList.toggle('line-numbers-hidden', !hasLineNumbers);
|
sideDiv.parentNode.classList.toggle('line-numbers-hidden', !hasLineNumbers);
|
||||||
fixView();
|
fixView();
|
||||||
},
|
},
|
||||||
dmesg: () => { dmesg = window.dmesg = value; },
|
|
||||||
userauthor: (value) => {
|
userauthor: (value) => {
|
||||||
thisAuthor = String(value);
|
thisAuthor = String(value);
|
||||||
documentAttributeManager.author = thisAuthor;
|
documentAttributeManager.author = thisAuthor;
|
||||||
|
|
|
@ -117,7 +117,6 @@ const makeContentCollector = (collectStyles, abrowser, apool, className2Author)
|
||||||
textOfLine: (i) => textArray[i],
|
textOfLine: (i) => textArray[i],
|
||||||
appendText: (txt, attrString) => {
|
appendText: (txt, attrString) => {
|
||||||
textArray[textArray.length - 1] += txt;
|
textArray[textArray.length - 1] += txt;
|
||||||
// dmesg(txt+" / "+attrString);
|
|
||||||
op.attribs = attrString;
|
op.attribs = attrString;
|
||||||
op.chars = txt.length;
|
op.chars = txt.length;
|
||||||
attribsBuilder.append(op);
|
attribsBuilder.append(op);
|
||||||
|
|
|
@ -390,7 +390,6 @@ const pad = {
|
||||||
getPadId: () => clientVars.padId,
|
getPadId: () => clientVars.padId,
|
||||||
getClientIp: () => clientVars.clientIp,
|
getClientIp: () => clientVars.clientIp,
|
||||||
getColorPalette: () => clientVars.colorPalette,
|
getColorPalette: () => clientVars.colorPalette,
|
||||||
getIsDebugEnabled: () => clientVars.debugEnabled,
|
|
||||||
getPrivilege: (name) => clientVars.accountPrivs[name],
|
getPrivilege: (name) => clientVars.accountPrivs[name],
|
||||||
getUserId: () => pad.myUserInfo.userId,
|
getUserId: () => pad.myUserInfo.userId,
|
||||||
getUserName: () => pad.myUserInfo.name,
|
getUserName: () => pad.myUserInfo.name,
|
||||||
|
@ -610,16 +609,6 @@ const pad = {
|
||||||
pad.handleOptionsChange(opts);
|
pad.handleOptionsChange(opts);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dmesg: (m) => {
|
|
||||||
if (pad.getIsDebugEnabled()) {
|
|
||||||
const djs = $('#djs').get(0);
|
|
||||||
const wasAtBottom = (djs.scrollTop - (djs.scrollHeight - $(djs).height()) >= -20);
|
|
||||||
$('#djs').append(`<p>${m}</p>`);
|
|
||||||
if (wasAtBottom) {
|
|
||||||
djs.scrollTop = djs.scrollHeight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleChannelStateChange: (newState, message) => {
|
handleChannelStateChange: (newState, message) => {
|
||||||
const oldFullyConnected = !!padconnectionstatus.isFullyConnected();
|
const oldFullyConnected = !!padconnectionstatus.isFullyConnected();
|
||||||
const wasConnecting = (padconnectionstatus.getStatus().what === 'connecting');
|
const wasConnecting = (padconnectionstatus.getStatus().what === 'connecting');
|
||||||
|
|
|
@ -49,9 +49,6 @@ const padeditor = (() => {
|
||||||
});
|
});
|
||||||
exports.focusOnLine(self.ace);
|
exports.focusOnLine(self.ace);
|
||||||
self.ace.setProperty('wraps', true);
|
self.ace.setProperty('wraps', true);
|
||||||
if (pad.getIsDebugEnabled()) {
|
|
||||||
self.ace.setProperty('dmesg', pad.dmesg);
|
|
||||||
}
|
|
||||||
self.initViewOptions();
|
self.initViewOptions();
|
||||||
self.setViewOptions(initialViewOptions);
|
self.setViewOptions(initialViewOptions);
|
||||||
// view bar
|
// view bar
|
||||||
|
|
|
@ -291,7 +291,6 @@ class SkipList {
|
||||||
if (end < 0) end = 0;
|
if (end < 0) end = 0;
|
||||||
if (end > this._keyToNodeMap.size) end = this._keyToNodeMap.size;
|
if (end > this._keyToNodeMap.size) end = this._keyToNodeMap.size;
|
||||||
|
|
||||||
window.dmesg(String([start, end, this._keyToNodeMap.size]));
|
|
||||||
if (end <= start) return [];
|
if (end <= start) return [];
|
||||||
let n = this.atIndex(start);
|
let n = this.atIndex(start);
|
||||||
const array = [n];
|
const array = [n];
|
||||||
|
|
|
@ -55,7 +55,6 @@ const undoModule = (() => {
|
||||||
e.elementType = UNDOABLE_EVENT;
|
e.elementType = UNDOABLE_EVENT;
|
||||||
stackElements.push(e);
|
stackElements.push(e);
|
||||||
numUndoableEvents++;
|
numUndoableEvents++;
|
||||||
// dmesg("pushEvent backset: "+event.backset);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const pushExternalChange = (cs) => {
|
const pushExternalChange = (cs) => {
|
||||||
|
@ -207,7 +206,6 @@ const undoModule = (() => {
|
||||||
const merge = _mergeChangesets(event.backset, topEvent.backset);
|
const merge = _mergeChangesets(event.backset, topEvent.backset);
|
||||||
if (merge) {
|
if (merge) {
|
||||||
topEvent.backset = merge;
|
topEvent.backset = merge;
|
||||||
// dmesg("reportEvent merge: "+merge);
|
|
||||||
applySelectionToTop();
|
applySelectionToTop();
|
||||||
merged = true;
|
merged = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue