From d42011bea66592864f90cb36929786a2663b5942 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 3 Nov 2021 15:19:28 +0100 Subject: [PATCH] Enable 'Make a copy' for OnlyOffice apps --- www/common/drive-ui.js | 2 +- www/common/sframe-common-outer.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 49b7ec628..555301268 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -1331,7 +1331,7 @@ define([ if (metadata.channel && metadata.channel.length < 48) { hide.push('preview'); } - if (!metadata.channel || metadata.channel.length > 32 || metadata.rtChannel) { + if (!metadata.channel || metadata.channel.length > 32) { hide.push('makeacopy'); // Not for blobs } } else if ($element.is('.cp-app-drive-element-sharedf')) { diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 09e8f79b1..c72fcbc1c 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -2049,6 +2049,14 @@ define([ }, cryptputCfg); return; } + if (Cryptpad.fromFileData && isOO && Cryptpad.fromFileData.href) { + var d = Cryptpad.fromFileData; + var _p = Utils.Hash.parsePadUrl(d.href); + if (_p.type === currentPad.app) { + data.template = d.href; + templatePw = d.password; + } + } if (data.template) { // Start OO with a template... // Cryptget and give href, password and content to inner