From f087837e675d9ecaaa7e0057a113506415a3959d Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 5 May 2020 14:03:30 +0200 Subject: [PATCH 01/18] Loop over all oo checkpoints until you find one available --- www/common/onlyoffice/inner.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index b65aac99d..0a42f79f3 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -221,10 +221,12 @@ define([ var now = function () { return +new Date(); }; - var getLastCp = function (old) { + var getLastCp = function (old, i) { var hashes = old ? oldHashes : content.hashes; if (!hashes || !Object.keys(hashes).length) { return {}; } - var lastIndex = Math.max.apply(null, Object.keys(hashes).map(Number)); + i = i || 0; + var idx = Object.keys(hashes).map(Number).sort(); + var lastIndex = idx[idx.length - 1 - i]; var last = JSON.parse(JSON.stringify(hashes[lastIndex])); return last; }; @@ -1365,9 +1367,7 @@ define([ }, 100); }; - var loadLastDocument = function () { - var lastCp = getLastCp(); - if (!lastCp) { return; } + var loadLastDocument = function (lastCp, onCpError) { ooChannel.cpIndex = lastCp.index || 0; var parsed = Hash.parsePadUrl(lastCp.file); var secret = Hash.getSecrets('file', parsed.hash); @@ -1381,6 +1381,7 @@ define([ xhr.responseType = 'arraybuffer'; xhr.onload = function () { if (/^4/.test('' + this.status)) { + onCpError(); return void console.error('XHR error', this.status); } var arrayBuffer = xhr.response; @@ -1393,15 +1394,25 @@ define([ }); } }; + xhr.onerror = function () { + onCpError(); + }; xhr.send(null); }; - var loadDocument = function (noCp, useNewDefault) { + var loadDocument = function (noCp, useNewDefault, i) { if (ooLoaded) { return; } var type = common.getMetadataMgr().getPrivateData().ooType; var file = getFileType(); if (!noCp) { + var lastCp = getLastCp(false, i); + // If the last checkpoint is empty, load the "initial" doc instead + if (!lastCp || !lastCp.file) { return void loadDocument(true, useNewDefault); } // Load latest checkpoint - return void loadLastDocument(); + return void loadLastDocument(lastCp, function () { + // Checkpoint error: load the previous one + i = i || 0; + loadDocument(noCp, useNewDefault, ++i); + }); } var newText; switch (type) { From 84b5741cdffdf6587245b217b55b00975a6d70ba Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 5 May 2020 14:41:02 +0200 Subject: [PATCH 02/18] Reload when a checkpoint has drawings --- www/common/onlyoffice/inner.js | 57 +++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 0a42f79f3..f0884f918 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -346,6 +346,21 @@ define([ }; APP.FM = common.createFileManager(fmConfig); + var checkDrawings = function () { + var editor = getEditor(); + if (!editor) { return false; } + var s = editor.GetSheets(); + var hasDrawings = false; + s.forEach(function (obj, i) { + obj.worksheet.Drawings.forEach(function (d) { + console.log(d.graphicObject, d.graphicObject.Id); + }); + }); + return s.some(function (obj, i) { + return obj.worksheet.Drawings.length; + }); + }; + var saveToServer = function () { var text = getContent(); var blob = new Blob([text], {type: 'plain/text'}); @@ -356,6 +371,19 @@ define([ index: ooChannel.cpIndex }; fixSheets(); + +var hasDrawings = checkDrawings(); +console.log(hasDrawings); + +if (hasDrawings) { + data.callback = function () { + console.error('reload'); + $('iframe[name="frameEditor"]').after(h('div#cp-app-oo-placeholder')).remove();// XXX + startOO(blob, file, true); // XXX + }; +} + + APP.FM.handleFile(blob, data); }; @@ -841,8 +869,8 @@ define([ }; var ooLoaded = false; - var startOO = function (blob, file) { - if (APP.ooconfig) { return void console.error('already started'); } + var startOO = function (blob, file, force) { + if (APP.ooconfig && !force) { return void console.error('already started'); } var url = URL.createObjectURL(blob); var lock = readOnly || APP.migrate; @@ -1367,7 +1395,7 @@ define([ }, 100); }; - var loadLastDocument = function (lastCp, onCpError) { + var loadLastDocument = function (lastCp, onCpError, cb) { ooChannel.cpIndex = lastCp.index || 0; var parsed = Hash.parsePadUrl(lastCp.file); var secret = Hash.getSecrets('file', parsed.hash); @@ -1390,6 +1418,9 @@ define([ FileCrypto.decrypt(u8, key, function (err, decrypted) { if (err) { return void console.error(err); } var blob = new Blob([decrypted.content], {type: 'plain/text'}); + if (cb) { + return cb(blob, getFileType()); + } startOO(blob, getFileType()); }); } @@ -1670,6 +1701,21 @@ define([ var reloadPopup = false; + var checkNewCheckpoint = function () { + var hasDrawings = checkDrawings(); + if (hasDrawings) { + console.error('reload'); + var lastCp = getLastCp(); + loadLastDocument(lastCp, function () { + // On error, do nothing + }, function (blob, type) { + $('iframe[name="frameEditor"]').after(h('div#cp-app-oo-placeholder')) + .remove();// XXX + startOO(blob, type, true); + }); + } + }; + config.onRemote = function () { if (initializing) { return; } var userDoc = APP.realtime.getUserDoc(); @@ -1695,10 +1741,13 @@ define([ var latest = getLastCp(true); var newLatest = getLastCp(); if (newLatest.index > latest.index) { + // New checkpoint sframeChan.query('Q_OO_SAVE', { hash: newLatest.hash, url: newLatest.file - }, function () { }); + }, function () { + checkNewCheckpoint(); + }); } oldHashes = JSON.parse(JSON.stringify(content.hashes)); } From 6edbe019d66b5629adee2214a41be96de4f2c2df Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 5 May 2020 15:03:20 +0200 Subject: [PATCH 03/18] Fix fixSheets --- www/common/onlyoffice/inner.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index f0884f918..18275f414 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -269,6 +269,8 @@ define([ // so that the messages we send to the realtime channel are // loadable by users joining after the checkpoint var fixSheets = function () { + var hasDrawings = checkDrawings(); + if (hasDrawings) { return; } // XXX we need a migration for old sheets... try { var editor = getEditor(); // if we are not in the sheet app From a7f98cbed97340b8ff52082703e420e36e7825c8 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 6 May 2020 16:31:17 +0200 Subject: [PATCH 04/18] Fix infinite loop --- www/common/common-interface.js | 1 + www/settings/inner.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 20eb1d536..55fe42e2a 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -1044,6 +1044,7 @@ define([ var MutationObserver = window.MutationObserver; var addTippy = function (i, el) { if (el._tippy) { return; } + if (!el.getAttribute('title')) { return; } if (el.nodeName === 'IFRAME') { return; } var opts = { distance: 15 diff --git a/www/settings/inner.js b/www/settings/inner.js index 255670c27..5e0cf5440 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -1586,4 +1586,4 @@ define([ UI.removeLoadingScreen(); }); -}); \ No newline at end of file +}); From ab7c31c681518427abf17209fb35d841c0ae2100 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 6 May 2020 16:50:03 +0200 Subject: [PATCH 05/18] Fix trim history from a pad --- www/common/sframe-common-outer.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 0a301fc15..4c240a2ec 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -490,6 +490,13 @@ define([ // Put in the following function the RPC queries that should also work in filepicker var addCommonRpc = function (sframeChan, safe) { + Cryptpad.universal.onEvent.reg(function (data) { + sframeChan.event('EV_UNIVERSAL_EVENT', data); + }); + sframeChan.on('Q_UNIVERSAL_COMMAND', function (data, cb) { + Cryptpad.universal.execCommand(data, cb); + }); + sframeChan.on('Q_ANON_RPC_MESSAGE', function (data, cb) { Cryptpad.anonRpcMsg(data.msg, data.content, function (err, response) { cb({error: err, response: response}); @@ -1374,13 +1381,6 @@ define([ Cryptpad.cursor.execCommand(data, cb); }); - Cryptpad.universal.onEvent.reg(function (data) { - sframeChan.event('EV_UNIVERSAL_EVENT', data); - }); - sframeChan.on('Q_UNIVERSAL_COMMAND', function (data, cb) { - Cryptpad.universal.execCommand(data, cb); - }); - Cryptpad.onTimeoutEvent.reg(function () { sframeChan.event('EV_WORKER_TIMEOUT'); }); From bc8a122b8791fd5540e4a05eb77bfc582198eb38 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 6 May 2020 13:44:47 -0400 Subject: [PATCH 06/18] update changelog for 3.17.0 (RedGazelle) --- CHANGELOG.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 700d70409..5e6705ae6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,51 @@ +# RedGazelle release (3.17.0) + +## Goals + +Our goal for this release was to introduce a first version of comments and mentions in our rich text editor as a part of a second R&D project funded by [NLnet](https://nlnet.nl/). We also received the results of an "accessibility audit" that was conducted as a part of our first NLnet PET project and so we've begun to integrate the auditor's feedback into the platform. + +Otherwise we've continued with our major goal of continuing to support a growing number of users on our instance via server improvements (without introducing any regressions). + +## Update notes + +The most drastic change in this release is that we've removed all docker-related files from the platform's repository. These files were all added via community contributions. Having them in the main repo gave the impression that we support installation via docker (which we do not). + +Docker-related files can now be found in the community-support [cryptpad-docker](https://github.com/xwiki-labs/cryptpad-docker/) repository. +If you have an existing instance that you've installed using docker and you'd like to update, you may review the [migration guide](https://github.com/xwiki-labs/cryptpad-docker/blob/master/MIGRATION.md). If you encounter any problems in the process we advise that you create an issue in the repository's issue-tracker. + +Once again, this repository is **community-maintained**. If you are using this repository then _you are a part of the community_! Bug reports are useful, but fixes are even better! + +Otherwise, this is a fairly standard release. We've updated two of our client-side dependencies: + +1. ChainPad features a memory management optimization which is particularly relevant to editing very large documents or loading a drive with a large number of files. In one test we were able to reduce memory consumption in Chrome from 1.7GB to 20MB. +2. CKEditor (the third-party library we use for our rich-text editor) has been updated so that we could make use of some more recent APIs for the _comments_ feature. + +To update from **3.16.0** to **3.17.0**: + +1. Stop your server +2. Fetch the latest source with git +3. Install the latest client-side dependencies with `bower update` +4. Restart your server + +## Features + +* As noted above, this release introduces a first version of [comments at the right of the screen](https://github.com/xwiki-labs/cryptpad/issues/143) in our rich text editor. We're aware of a few usability issues under heavy concurrent usage, and we have some more improvements planned, but we figured that these issues were minor enough that people would be happy to use them in the meantime. The comments system integrates with the rest of our social functionality, so you'll have the ability to mention other users with the `@` symbol when typing within a comment. +* We've made some minor changes to the server's logging system to suppress some uninformative log statements and to include some useful information in logs to improve our ability to debug some serverside performance issues. This probably won't affect you directly, but indirectly you'll benefit from some bug fixes and performance tweaks as we get a better understanding of what the server does at runtime. +* We've received an _enormous_ amount of support tickets on CryptPad.fr (enough that if we answered them all we'd have very little time left for development). In response, we've updated the support ticket inbox available to administrators to highlight unanswered messages from non-paying users in yellow while support tickets from _premium users_ are highlighted in red. Administrators on other instances will notice that users of their instance with quotas increased via the server's `customLimits` config block will be counted as _premium_ as well. +* Finally, we've continued to receive translations in a number of languages via our [Weblate instance](https://weblate.cryptpad.fr/projects/cryptpad/app/). + +## Bug fixes + +* We've fixed a minor bug in our code editor in which hiding _author colors_ while they were still enabled for the document caused a tooltip containing `undefined` to be displayed when hovering over the text. +* A race condition in our server which was introduced when we started validating cryptographic signatures in child processes made it such that incoming messages could be written to the database in a different order than they were received. We implemented a per-channel queue which should now guarantee their ordering. +* It used to be that an error in the process of creating a thumbnail for an encrypted file upload would prevent the file upload from completing (and prevent future uploads in that session). We've added some guards to catch these errors and handle them appropriately, closing [#540](https://github.com/xwiki-labs/cryptpad/issues/540). +* CryptPad builds some CSS on the client because the source files (written in LESS) are smaller than the produced CSS. This results in faster load times for users with slow network connections. We identified and fixed bug in the loader which caused some files to be included in the compiled output multiple times, resulting in faster load times. +* We addressed a minor bug in the drive's item sorting logic which was triggered when displaying inverse sortings. +* Our last release introduced a set of custom styles for the mermaidjs integration in our code editor and featured one style which was not applied consistently across the wide variety of elements that could appear in mermaid graphs. As such, we've reverted the style (a color change in mermaid `graph` charts). +* In the process of implementing comments in our rich text editor we realized that there were some bugs in our cursor recovery code (used to maintain your cursor position when multiple people are typing in the same document). We made some small patches to address a few very specific edge cases, but it's possible the improvements will have a broader effect with cursors in other situations. +* We caught (and fixed) a few regressions in the _access_ and _properties_ modals that were introduced in the previous release. +* It came to our attention that the script `cryptpad/scripts/evict-inactive.js` was removing inactive blobs after a shorter amount of time than intended. After investigating we found that it was using `retentionTime` instead of `inactiveTime` (both of which are from the server's config file. As such, some files were being archived after 15 days of inactivity instead of 90 (in cases where the files were not stored in anyone's drive). This script must be run manually (or periodically via a `cron`), so unless you've configured your instance to do so this will not have affected you. + # Quagga release (3.16.0) ## Goals From 5b2929a6fca605ac7b18038aa5498e4064525f7a Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 6 May 2020 13:50:48 -0400 Subject: [PATCH 07/18] suppress some useless info from some commonly logged errors --- lib/api.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/api.js b/lib/api.js index f615360c5..cc88aaed7 100644 --- a/lib/api.js +++ b/lib/api.js @@ -14,6 +14,7 @@ module.exports.create = function (config) { var special_errors = {}; ['EPIPE', 'ECONNRESET'].forEach(function (k) { special_errors[k] = noop; }); special_errors.NF_ENOENT = function (error, label, info) { + delete info.stack; log.error(label, { info: info, }); @@ -27,10 +28,11 @@ module.exports.create = function (config) { .on('sessionClose', historyKeeper.sessionClose) .on('error', function (error, label, info) { if (!error) { return; } - if (error && error.code) { + var code = error && (error.code || error.message); + if (code) { /* EPIPE,ECONNERESET, NF_ENOENT */ - if (typeof(special_errors[error.code]) === 'function') { - return void special_errors[error.code](error, label, info); + if (typeof(special_errors[code]) === 'function') { + return void special_errors[code](error, label, info); } } From 0feb4441da38f0091d7b50b7c34793b1a6edaaa6 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 11 May 2020 16:12:52 +0200 Subject: [PATCH 08/18] Fix misisng html flag in tippy --- www/common/sframe-common-codemirror.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index e6ed9ded2..c4d099355 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -525,7 +525,9 @@ define([ : 'background-color: rgba(255,0,0,0.2)'; marks[id] = editor.markText(pos1, pos2, { css: css, - 'data-cptippy-html': true, + attributes: { + 'data-cptippy-html': true, + }, title: makeTippy(cursor), className: 'cp-tippy-html' }); From 091192b69741fa45712adc43bc27b2c66a00a2fb Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 12 May 2020 13:21:56 +0200 Subject: [PATCH 09/18] Fix userID issues with the reload script and add reload modal --- www/common/onlyoffice/inner.js | 46 ++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 18275f414..ed29c58ad 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -76,6 +76,7 @@ define([ var privateData = metadataMgr.getPrivateData(); var readOnly = false; var offline = false; + var ooLoaded = false; var pendingChanges = {}; var config = {}; var content = { @@ -302,6 +303,11 @@ define([ index: ev.index }; oldHashes = JSON.parse(JSON.stringify(content.hashes)); + var hasDrawings = checkDrawings(); + if (hasDrawings) { + content.locks = {}; + content.ids = {}; + } // If this is a migration, set the new version if (APP.migrate) { delete content.migration; @@ -363,6 +369,23 @@ define([ }); }; + var resetData = function (blob, type) { + if (!isLockedModal.modal) { + isLockedModal.modal = UI.openCustomModal(isLockedModal.content); + } + myUniqueOOId = undefined; + setMyId(); + APP.docEditor.destroyEditor(); // Kill the old editor + $('iframe[name="frameEditor"]').after(h('div#cp-app-oo-placeholder')).remove(); + ooLoaded = false; + oldLocks = {}; + Object.keys(pendingChanges).forEach(function (key) { + clearTimeout(pendingChanges[key]); + delete pendingChanges[key]; + }); + startOO(blob, type, true); + }; + var saveToServer = function () { var text = getContent(); var blob = new Blob([text], {type: 'plain/text'}); @@ -378,10 +401,11 @@ var hasDrawings = checkDrawings(); console.log(hasDrawings); if (hasDrawings) { + ooChannel.ready = false; + ooChannel.queue = []; data.callback = function () { console.error('reload'); - $('iframe[name="frameEditor"]').after(h('div#cp-app-oo-placeholder')).remove();// XXX - startOO(blob, file, true); // XXX + resetData(blob, file); }; } @@ -500,6 +524,7 @@ if (hasDrawings) { var getParticipants = function () { var users = metadataMgr.getMetadata().users; var i = 1; + var myIdx = false; var p = Object.keys(content.ids || {}).map(function (id) { var nId = id.slice(0,32); var ooId = content.ids[id].ooid; @@ -870,7 +895,6 @@ if (hasDrawings) { }); }; - var ooLoaded = false; var startOO = function (blob, file, force) { if (APP.ooconfig && !force) { return void console.error('already started'); } var url = URL.createObjectURL(blob); @@ -942,7 +966,6 @@ if (hasDrawings) { } }, "onDocumentReady": function () { - // The doc is ready, fix the worksheets IDs and push the queue fixSheets(); // Push changes since last cp @@ -960,6 +983,12 @@ if (hasDrawings) { // Allow edition setEditable(true); + if (isLockedModal.modal && force) { + isLockedModal.modal.closeModal(); + delete isLockedModal.modal; + $('#cp-app-oo-editor > iframe')[0].contentWindow.focus(); + } + if (APP.migrate && !readOnly) { var div = h('div.cp-oo-x2tXls', [ h('span.fa.fa-spin.fa-spinner'), @@ -1711,9 +1740,7 @@ if (hasDrawings) { loadLastDocument(lastCp, function () { // On error, do nothing }, function (blob, type) { - $('iframe[name="frameEditor"]').after(h('div#cp-app-oo-placeholder')) - .remove();// XXX - startOO(blob, type, true); + resetData(blob, type); }); } }; @@ -1743,6 +1770,11 @@ if (hasDrawings) { var latest = getLastCp(true); var newLatest = getLastCp(); if (newLatest.index > latest.index) { + var hasDrawings = checkDrawings(); + if (hasDrawings) { + ooChannel.ready = false; + ooChannel.queue = []; + } // New checkpoint sframeChan.query('Q_OO_SAVE', { hash: newLatest.hash, From 0018f71175e6363f110fde88f8031d706837387d Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 12 May 2020 13:46:09 +0200 Subject: [PATCH 10/18] Bump cp interval in onlyoffice to 100 --- www/common/onlyoffice/inner.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index ed29c58ad..89c5acf01 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -52,7 +52,7 @@ define([ $: $ }; - var CHECKPOINT_INTERVAL = 50; + var CHECKPOINT_INTERVAL = 100; var DISPLAY_RESTORE_BUTTON = false; var NEW_VERSION = 2; var PENDING_TIMEOUT = 30000; @@ -296,7 +296,13 @@ define([ console.error(err); return void UI.alert(Messages.oo_saveError); } - var i = Math.floor(ev.index / CHECKPOINT_INTERVAL); + // Get the last cp idx + var all = Object.keys(content.hashes || {}).map(Number).sort(); + var current = all[all.length - 1] || 0; + // Get the expected cp idx + var _i = Math.floor(ev.index / CHECKPOINT_INTERVAL); + // Take the max of both + var i = Math.max(_i, current); content.hashes[i] = { file: data.url, hash: ev.hash, From cb5ec4c3d4556f23c013de35721cc9fa60a33604 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 12 May 2020 15:25:17 +0200 Subject: [PATCH 11/18] Fix horizontal scrollbar in teams --- customize.dist/src/less2/include/drive.less | 1 + 1 file changed, 1 insertion(+) diff --git a/customize.dist/src/less2/include/drive.less b/customize.dist/src/less2/include/drive.less index 20aaff649..d8b254c42 100644 --- a/customize.dist/src/less2/include/drive.less +++ b/customize.dist/src/less2/include/drive.less @@ -107,6 +107,7 @@ display: flex; flex-flow: row; min-height: 0; + min-width: 0; @media screen and (max-width: @browser_media-medium-screen) { display: block; overflow-y: auto; From 0036ca88613b4732b5a93bea7724d1792dc01447 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 12 May 2020 15:27:00 +0200 Subject: [PATCH 12/18] Fix view mode in sheets --- www/common/onlyoffice/inner.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 89c5acf01..edd8eec81 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -930,7 +930,7 @@ if (hasDrawings) { "id": String(myOOId), //"c0c3bf82-20d7-4663-bf6d-7fa39c598b1d", "firstname": metadataMgr.getUserData().name || Messages.anonymous, }, - "mode": lock ? "view" : "edit", + "mode": "edit", "lang": (navigator.language || navigator.userLanguage || '').slice(0,2) }, "events": { @@ -987,7 +987,15 @@ if (hasDrawings) { APP.onLocal(); handleNewLocks(oldLocks, content.locks || {}); // Allow edition - setEditable(true); + + if (lock) { + setTimeout(function () { + setEditable(true); + getEditor().setViewModeDisconnect(); + }, 5000); + } else { + setEditable(true); + } if (isLockedModal.modal && force) { isLockedModal.modal.closeModal(); From 2179abe3fe8cd4269a1cd0eb64677681b176e326 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 12 May 2020 16:49:03 +0200 Subject: [PATCH 13/18] Fix label issue in settings --- www/settings/inner.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/www/settings/inner.js b/www/settings/inner.js index 5e0cf5440..ea4b5d1e8 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -942,8 +942,7 @@ define([ create['drive-import-local'] = function() { if (!common.isLoggedIn()) { return; } var $div = $('
', { 'class': 'cp-settings-drive-import-local cp-sidebarlayout-element' }); - $('