From 60ce5a1399bdb6ec7babc308aa55b9ddd2fc2254 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 15 Oct 2021 12:08:29 +0200 Subject: [PATCH] Fix image loss in onlyoffice --- www/common/onlyoffice/inner.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 0454b4bc5..7a04ef857 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1419,10 +1419,15 @@ define([ }); if (m.length === 1 && APP.loadingImage <= 0) { try { - var docs = window.frames[0].AscCommon.g_oDocumentUrls.urls || {}; + // "docs" contains the correct images that we've just uploaded + // "docs2" contains the correct images from the .bin checkpoint + // both of them are not reliable in the other case + var docs = getWindow().AscCommon.g_oDocumentUrls.urls; + var docs2 = getEditor().ImageLoader.map_image_index; var mediasSources = getMediasSources(); Object.keys(mediasSources).forEach(function (name) { - if (!docs['media/'+name]) { + if (!docs && !docs2) { return; } + if (!docs['media/'+name] && !docs2[name]) { delete mediasSources[name]; } }); @@ -1559,7 +1564,7 @@ define([ // New OO: 'section[data-tab="ins"] .separator:nth-last-child(2) { display: none !important; }' + // separator '#slot-btn-insequation { display: none !important; }' + // Insert equation - '#asc-gen125 { display: none !important; }' + // Disable presenter mode + //'#asc-gen125 { display: none !important; }' + // Disable presenter mode //'.toolbar .tabs .ribtab:not(.canedit) { display: none !important; }' + // Switch collaborative mode '#fm-btn-info { display: none !important; }' + // Author name, doc title, etc. in "File" (menu entry) '#panel-info { display: none !important; }' + // Same but content