mirror of https://github.com/xwiki-labs/cryptpad
add " (copy)" to copied OpenOffice files
Normally, copied CryptPad files have a " (copy)" suffixed to them but OnlyOffice doesn't because it has different internal architechture. Copied OnlyOffice files can be identified by two attributes: a non-empty title and template data. Since OnlyOffice files cannot be just copy and pasted, I resorted to modifying their metadata through metadataMgr in `./common/onlyoffice/inner.js` Essentially, this commit check if a file is a copied file. If it is, it updates the title. It doesn't actually copy the file but merely modifies the title after it has been copied.
This commit is contained in:
parent
a5d5dba9f2
commit
78957817e2
|
@ -241,6 +241,11 @@ define([
|
|||
type = APP.downloadType;
|
||||
title = "download";
|
||||
}
|
||||
if(title === "" && APP.startWithTemplate) {
|
||||
var copyTitle = Messages._getKey('copy_title', [APP.startWithTemplate.content.metadata.title]);
|
||||
common.getMetadataMgr().updateTitle(copyTitle);
|
||||
title = copyTitle
|
||||
}
|
||||
var file = {};
|
||||
switch(type) {
|
||||
case 'doc':
|
||||
|
|
Loading…
Reference in New Issue