From e8ad4a84c3e4f7b5e32662240c242ef7df53a8cf Mon Sep 17 00:00:00 2001 From: Zuzanna Date: Fri, 26 Sep 2025 11:25:32 +0200 Subject: [PATCH] wip --- www/common/onlyoffice/history.js | 40 +++++--------------------------- www/common/onlyoffice/inner.js | 3 --- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/www/common/onlyoffice/history.js b/www/common/onlyoffice/history.js index c506f93bf..4405f4288 100644 --- a/www/common/onlyoffice/history.js +++ b/www/common/onlyoffice/history.js @@ -137,7 +137,6 @@ define([ console.log(data.messages); } id = id !== undefined ? id : getId(); - console.log("nextmsgs", id) fillOO(messages, ooCheckpoints); loading = false; // $share.show(); @@ -197,8 +196,6 @@ define([ var $fastPrev, $fastNext, $next, $prev; - var position; - update = function (prev) { var cps = sortedCp.length; $fastPrev.show(); @@ -217,8 +214,6 @@ define([ $prev.prop('disabled', 'disabled'); } var msgs = ooMessages[id]?.length; - console.log("disable", ooMessages, id, msgLength, msgIndex, (id === msgLength || id === msgLength-1), !prev) - console.log("disable2", (id === msgLength) && msgIndex === -1, (id === msgLength || id === msgLength-1), msgIndex === -1, !prev, id === msgLength || (id === msgLength || id === msgLength-1) && msgIndex === -1 && !prev) if ((id === msgLength) && msgIndex === -1 || (id === msgLength || id === msgLength-1) && msgIndex === -1 && !prev) { $fastNext.prop('disabled', 'disabled'); @@ -251,34 +246,23 @@ define([ loadingFalse(); msgIndex = -ooMessages[id].length-1; showVersion(false, msgs.indexOf(patch)+1); - // position = msgs.indexOf(patch)+1 - console.log("disable patch", msgIndex) - return; }); } - console.log("next5", hashes, ooMessages, id, msgIndex) - msgIndex = -msgs.length; var patch = msgs[msgs.length + msgIndex] ? msgs[msgs.length + msgIndex] : undefined; var cp = hashes[id]; config.onPatchBack(cp, [patch]); showVersion(false, msgs.indexOf(patch)+1); loadingFalse(); - console.log("disable patch", msgIndex) - - // position = msgs.indexOf(patch)+1 }) return; } } var patch = msgs[msgs.length + msgIndex]; config.onPatch(patch); - console.log("disable patch", msgIndex) - showVersion(false, msgs.indexOf(patch)+1); loadingFalse(); - // position = msgs.indexOf(patch)+1 }; var msgs; @@ -304,7 +288,6 @@ define([ } var cp = hashes[id]; } - console.log("prev disable", hashes, ooMessages, id, ) var queue = msgs.slice(0, msgIndex); config.onPatchBack(cp, queue); showVersion(false, queue.length); @@ -435,40 +418,29 @@ define([ var msgs = ooMessages[id] msgIndex = -1 config.onPatchBack(cp, msgs); - console.log("disablemsgs", hashes, ooMessages, id, msgs) - } setTimeout(function () { - console.log("disable fastnext", id, ooMessages, msgIndex) - update(); loading = false; }, 100); }); // Go to next checkpoint $fastPrev.click(function () { - console.log("disable fastprev3", id, ooMessages, msgIndex) - if (loading) { return; } loading = true; if (!ooMessages[id].length) { id--; } var cp = hashes[id]; - console.log("disable fastprev2", id, ooMessages, msgIndex) - config.loadCp(cp); - // setTimeout(function () { - console.log("disable fastprev", id, ooMessages, msgIndex) - update(true); - loadMoreOOHistory().then(() => { - var msgs = ooMessages[id]; - msgIndex = -msgs.length-1; - }); - loading = false; - // }, 100); + update(true); + loadMoreOOHistory().then(() => { + var msgs = ooMessages[id]; + msgIndex = -msgs.length-1; + }); + loading = false; }); onKeyDown = function (e) { diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 551526e76..3e0700e25 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1101,8 +1101,6 @@ define([ const getInitialChanges = function() { const changes = []; - console.log("prev ooq", ooChannel.queue) - if (content.version > 2) { ooChannel.queue.forEach(function (data) { Array.prototype.push.apply(changes, data.msg.changes); @@ -1113,7 +1111,6 @@ define([ var last = ooChannel.queue.pop(); if (last) { ooChannel.lastHash = last.hash; } } - console.log("prev changes", changes) return changes; };