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.
|
||||
*/
|
||||
|
||||
const Security = require('./security');
|
||||
|
||||
const isNodeText = (node) => (node.nodeType === 3);
|
||||
|
||||
const getAssoc = (obj, name) => obj[`_magicdom_${name}`];
|
||||
|
@ -60,8 +58,6 @@ const binarySearchInfinite = (expectedLength, func) => {
|
|||
return binarySearch(i, func);
|
||||
};
|
||||
|
||||
const htmlPrettyEscape = (str) => Security.escapeHTML(str).replace(/\r?\n/g, '\\n');
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
exports.isNodeText = isNodeText;
|
||||
|
@ -69,5 +65,4 @@ exports.getAssoc = getAssoc;
|
|||
exports.setAssoc = setAssoc;
|
||||
exports.binarySearch = binarySearch;
|
||||
exports.binarySearchInfinite = binarySearchInfinite;
|
||||
exports.htmlPrettyEscape = htmlPrettyEscape;
|
||||
exports.noop = noop;
|
||||
|
|
|
@ -26,7 +26,6 @@ const $ = require('./rjquery').$;
|
|||
const isNodeText = Ace2Common.isNodeText;
|
||||
const getAssoc = Ace2Common.getAssoc;
|
||||
const setAssoc = Ace2Common.setAssoc;
|
||||
const htmlPrettyEscape = Ace2Common.htmlPrettyEscape;
|
||||
const noop = Ace2Common.noop;
|
||||
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;
|
||||
}
|
||||
|
||||
// "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 performDocumentReplaceRange = (start, end, newText) => {
|
||||
if (start === undefined) start = rep.selStart;
|
||||
if (end === undefined) end = rep.selEnd;
|
||||
|
||||
// dmesg(String([start.toSource(),end.toSource(),newText.toSource()]));
|
||||
// start[0]: <--- start[1] --->CCCCCCCCCCC\n
|
||||
// CCCCCCCCCCCCCCCCCCCC\n
|
||||
// CCCC\n
|
||||
|
@ -374,7 +365,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
error: e,
|
||||
time: +new Date(),
|
||||
});
|
||||
dmesg(e.toString());
|
||||
throw e;
|
||||
} finally {
|
||||
const cs = currentCallStack;
|
||||
|
@ -546,8 +536,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
idleWorkTimer.atMost(100);
|
||||
|
||||
if (rep.alltext !== atext.text) {
|
||||
dmesg(htmlPrettyEscape(rep.alltext));
|
||||
dmesg(htmlPrettyEscape(atext.text));
|
||||
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);
|
||||
fixView();
|
||||
},
|
||||
dmesg: () => { dmesg = window.dmesg = value; },
|
||||
userauthor: (value) => {
|
||||
thisAuthor = String(value);
|
||||
documentAttributeManager.author = thisAuthor;
|
||||
|
|
|
@ -117,7 +117,6 @@ const makeContentCollector = (collectStyles, abrowser, apool, className2Author)
|
|||
textOfLine: (i) => textArray[i],
|
||||
appendText: (txt, attrString) => {
|
||||
textArray[textArray.length - 1] += txt;
|
||||
// dmesg(txt+" / "+attrString);
|
||||
op.attribs = attrString;
|
||||
op.chars = txt.length;
|
||||
attribsBuilder.append(op);
|
||||
|
|
|
@ -390,7 +390,6 @@ const pad = {
|
|||
getPadId: () => clientVars.padId,
|
||||
getClientIp: () => clientVars.clientIp,
|
||||
getColorPalette: () => clientVars.colorPalette,
|
||||
getIsDebugEnabled: () => clientVars.debugEnabled,
|
||||
getPrivilege: (name) => clientVars.accountPrivs[name],
|
||||
getUserId: () => pad.myUserInfo.userId,
|
||||
getUserName: () => pad.myUserInfo.name,
|
||||
|
@ -610,16 +609,6 @@ const pad = {
|
|||
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) => {
|
||||
const oldFullyConnected = !!padconnectionstatus.isFullyConnected();
|
||||
const wasConnecting = (padconnectionstatus.getStatus().what === 'connecting');
|
||||
|
|
|
@ -49,9 +49,6 @@ const padeditor = (() => {
|
|||
});
|
||||
exports.focusOnLine(self.ace);
|
||||
self.ace.setProperty('wraps', true);
|
||||
if (pad.getIsDebugEnabled()) {
|
||||
self.ace.setProperty('dmesg', pad.dmesg);
|
||||
}
|
||||
self.initViewOptions();
|
||||
self.setViewOptions(initialViewOptions);
|
||||
// view bar
|
||||
|
|
|
@ -291,7 +291,6 @@ class SkipList {
|
|||
if (end < 0) end = 0;
|
||||
if (end > this._keyToNodeMap.size) end = this._keyToNodeMap.size;
|
||||
|
||||
window.dmesg(String([start, end, this._keyToNodeMap.size]));
|
||||
if (end <= start) return [];
|
||||
let n = this.atIndex(start);
|
||||
const array = [n];
|
||||
|
|
|
@ -55,7 +55,6 @@ const undoModule = (() => {
|
|||
e.elementType = UNDOABLE_EVENT;
|
||||
stackElements.push(e);
|
||||
numUndoableEvents++;
|
||||
// dmesg("pushEvent backset: "+event.backset);
|
||||
};
|
||||
|
||||
const pushExternalChange = (cs) => {
|
||||
|
@ -207,7 +206,6 @@ const undoModule = (() => {
|
|||
const merge = _mergeChangesets(event.backset, topEvent.backset);
|
||||
if (merge) {
|
||||
topEvent.backset = merge;
|
||||
// dmesg("reportEvent merge: "+merge);
|
||||
applySelectionToTop();
|
||||
merged = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue