Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions sdkjs/common/HistoryCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4866,6 +4866,35 @@
this.Class = Class;

this.Reverted = false;

// CryptPad: Add parser debug logging
if (localStorage.CryptPad_dev != "1") {
return;
}
if (this.Load) {
const origLoad = this.Load;
this.Load = function () {
const properties = {};
const keys = Object.keys(this);
for (let i = 0; i < keys.length; i++) {
const p = keys[i];
const firstChar = p.charAt(0);
if (firstChar.toUpperCase() === firstChar
&& p !== "Class"
&& typeof this[p] !== "function") {
let pStr;
try {
pStr = JSON.stringify(this[p]);
} catch(e) {
pStr = ""+this[p];
}
properties[p] = pStr;
}
}
console.log("Load", this.constructor.name, Class.constructor.name, Class.Id, properties);
return Reflect.apply(origLoad, this, arguments);
};
}
}
CChangesBase.prototype.Type = window['AscDFH'].historyitem_Unknown_Unknown;
CChangesBase.prototype.GetType = function()
Expand Down
Loading