Fix image loss in onlyoffice

pull/1/head
yflory 3 years ago
parent 06bef8ff9b
commit 60ce5a1399

@ -1419,10 +1419,15 @@ define([
}); });
if (m.length === 1 && APP.loadingImage <= 0) { if (m.length === 1 && APP.loadingImage <= 0) {
try { 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(); var mediasSources = getMediasSources();
Object.keys(mediasSources).forEach(function (name) { Object.keys(mediasSources).forEach(function (name) {
if (!docs['media/'+name]) { if (!docs && !docs2) { return; }
if (!docs['media/'+name] && !docs2[name]) {
delete mediasSources[name]; delete mediasSources[name];
} }
}); });
@ -1559,7 +1564,7 @@ define([
// New OO: // New OO:
'section[data-tab="ins"] .separator:nth-last-child(2) { display: none !important; }' + // separator 'section[data-tab="ins"] .separator:nth-last-child(2) { display: none !important; }' + // separator
'#slot-btn-insequation { display: none !important; }' + // Insert equation '#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 //'.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) '#fm-btn-info { display: none !important; }' + // Author name, doc title, etc. in "File" (menu entry)
'#panel-info { display: none !important; }' + // Same but content '#panel-info { display: none !important; }' + // Same but content

Loading…
Cancel
Save