diff options
author | Sergey Linnik <sergey.linnik@onlyoffice.com> | 2020-09-01 16:58:34 +0300 |
---|---|---|
committer | Sergey Linnik <sergey.linnik@onlyoffice.com> | 2020-09-01 16:58:40 +0300 |
commit | 73cb9ee2145743b836eaa1fa77f681f6d509b521 (patch) | |
tree | deed911f95be7f5fc59fb96be224b529ec317ca6 /js | |
parent | 0613abe76b7d18cdf9b900db1defff143f79a0ef (diff) |
type of image insertion
Diffstat (limited to 'js')
-rw-r--r-- | js/editor.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/js/editor.js b/js/editor.js index 1f17fc9..81b87ea 100644 --- a/js/editor.js +++ b/js/editor.js @@ -32,7 +32,8 @@ AppName: "onlyoffice", inframe: false, fileId: null, - shareToken: null + shareToken: null, + insertImageType: null }, OCA.Onlyoffice); OCA.Onlyoffice.InitEditor = function () { @@ -293,7 +294,7 @@ }); }; - OCA.Onlyoffice.onRequestInsertImage = function () { + OCA.Onlyoffice.onRequestInsertImage = function (event) { var imageMimes = [ "image/bmp", "image/x-bmp", "image/x-bitmap", "application/bmp", "image/gif", @@ -301,6 +302,8 @@ "image/png", "image/x-png", "application/png", "application/x-png" ]; + OCA.Onlyoffice.insertImageType = event.data.c; + if (OCA.Onlyoffice.inframe) { window.parent.postMessage({ method: "editorRequestInsertImage", @@ -323,6 +326,10 @@ return; } + if (OCA.Onlyoffice.insertImageType) { + response.c = OCA.Onlyoffice.insertImageType; + } + OCA.Onlyoffice.docEditor.insertImage(response); }); }; |