From f370097c98d3648660294d9b57689daa1e60d618 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 3 Dec 2021 12:29:26 +0300 Subject: [PATCH 01/19] The source files have been added --- 3rd-Party.txt | 7 + LICENSE | 201 ++++++++++++++ README.md | 19 ++ config.json | 95 +++++++ index.html | 59 ++++ licenses/drawio.license | 201 ++++++++++++++ resources/dark/icon.png | Bin 0 -> 513 bytes resources/dark/icon@1.25x.png | Bin 0 -> 665 bytes resources/dark/icon@1.5x.png | Bin 0 -> 770 bytes resources/dark/icon@1.75x.png | Bin 0 -> 858 bytes resources/dark/icon@2x.png | Bin 0 -> 1025 bytes resources/light/icon.png | Bin 0 -> 646 bytes resources/light/icon@1.25x.png | Bin 0 -> 776 bytes resources/light/icon@1.5x.png | Bin 0 -> 1023 bytes resources/light/icon@1.75x.png | Bin 0 -> 990 bytes resources/light/icon@2x.png | Bin 0 -> 1328 bytes scripts/code.js | 109 ++++++++ translations/cs-CS.json | 3 + translations/de-DE.json | 3 + translations/es-ES.json | 3 + translations/fr-FR.json | 3 + translations/ru-RU.json | 3 + vendor/drawio/diagram-editor.js | 467 ++++++++++++++++++++++++++++++++ 23 files changed, 1173 insertions(+) create mode 100644 3rd-Party.txt create mode 100644 LICENSE create mode 100644 README.md create mode 100644 config.json create mode 100644 index.html create mode 100644 licenses/drawio.license create mode 100644 resources/dark/icon.png create mode 100644 resources/dark/icon@1.25x.png create mode 100644 resources/dark/icon@1.5x.png create mode 100644 resources/dark/icon@1.75x.png create mode 100644 resources/dark/icon@2x.png create mode 100644 resources/light/icon.png create mode 100644 resources/light/icon@1.25x.png create mode 100644 resources/light/icon@1.5x.png create mode 100644 resources/light/icon@1.75x.png create mode 100644 resources/light/icon@2x.png create mode 100644 scripts/code.js create mode 100644 translations/cs-CS.json create mode 100644 translations/de-DE.json create mode 100644 translations/es-ES.json create mode 100644 translations/fr-FR.json create mode 100644 translations/ru-RU.json create mode 100644 vendor/drawio/diagram-editor.js diff --git a/3rd-Party.txt b/3rd-Party.txt new file mode 100644 index 00000000..0d34b30d --- /dev/null +++ b/3rd-Party.txt @@ -0,0 +1,7 @@ +This plugin uses code from the following 3rd party projects. + + +1. draw.io, this project, is a configurable diagramming/whiteboarding visualization application. draw.io is owned and developed by JGraph Ltd, a UK based software company. (https://github.com/jgraph/drawio) + +License: Apache License 2.0 +License File: drawio.license \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 00000000..dd4b182f --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +## Overview + +Create, edit and paste diagrams into document. + +This plugin uses [draw.io](https://github.com/jgraph/drawio), this project, is a configurable diagramming/whiteboarding visualization application. draw.io is owned and developed by JGraph Ltd, a UK based software company. + +The plugin is compatible with [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) and [desktop](https://github.com/ONLYOFFICE/DesktopEditors) versions of ONLYOFFICE editors. It can be added to ONLYOFFICE instances manually. + +## How to use + +1. Open the Plugins tab and press "draw.io". +2. Create your own diagram or paste it from the available resources. +3. Click "Save & exit" or "Save" and then "Exit". +4. You can see the comleted diagram, if you want to edit it, just click on it. +5. If you want to inser the comleted diagram into the document click button "Ok". + +## How to install + +Detailed instructions can be found in [ONLYOFFICE API documentation](https://api.onlyoffice.com/plugin/installation). diff --git a/config.json b/config.json new file mode 100644 index 00000000..5856eb6e --- /dev/null +++ b/config.json @@ -0,0 +1,95 @@ +{ + "name": "draw.io", + "nameLocale": { + "ru": "draw.io", + "fr": "draw.io", + "es": "draw.io", + "de": "draw.io" + }, + "guid": "asc.{DB38923B-A8C0-4DE9-8AEE-A61BB5C901A5}", + + "variations": [ + { + "description": "draw.io", + "descriptionLocale": { + "ru": "draw.io", + "fr": "draw.io", + "es": "draw.io", + "de": "draw.io" + }, + "url": "index.html", + + "icons": [ "resources/light/icon.png", "resources/light/icon@2x.png" ], + "icons2": [ + { + "style" : "light", + + "100%": { + "normal": "resources/light/icon.png" + }, + "125%": { + "normal": "resources/light/icon@1.25x.png" + }, + "150%": { + "normal": "resources/light/icon@1.5x.png" + }, + "175%": { + "normal": "resources/light/icon@1.75x.png" + }, + "200%": { + "normal": "resources/light/icon@2x.png" + } + }, + { + "style" : "dark", + + "100%": { + "normal": "resources/dark/icon.png" + }, + "125%": { + "normal": "resources/dark/icon@1.25x.png" + }, + "150%": { + "normal": "resources/dark/icon@1.5x.png" + }, + "175%": { + "normal": "resources/dark/icon@1.75x.png" + }, + "200%": { + "normal": "resources/dark/icon@2x.png" + } + } + ], + "isViewer": false, + "EditorsSupport": [ "word", "cell", "slide" ], + + "isVisual": true, + "isModal": true, + "isInsideMode": false, + + "initDataType": "ole", + "initData": "", + + "isUpdateOleOnResize": false, + + "buttons": [ + { + "text": "Ok", + "primary": true + }, + { + "text": "Cancel", + "primary": false, + "textLocale": { + "ru": "Отмена", + "fr": "Annuler", + "es": "Cancelar", + "de": "Abbrechen" + } + } + ], + + "size": [ 1200, 1000 ] + } + ] +} diff --git a/index.html b/index.html new file mode 100644 index 00000000..909fe81b --- /dev/null +++ b/index.html @@ -0,0 +1,59 @@ + + + + + + draw.io + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/licenses/drawio.license b/licenses/drawio.license new file mode 100644 index 00000000..9c8f3ea0 --- /dev/null +++ b/licenses/drawio.license @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/resources/dark/icon.png b/resources/dark/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..dc4bd2d5d2c3e716d4e1016425f515e1c13bc192 GIT binary patch literal 513 zcmV+c0{;DpP)v<3Uq{w5-=SYgF!sIq_lWd>LtTSdrQ@YK9P9wqG8w$ZLChJL~YxeAh3@t z>@w$)AqN^?42O?)g6r+{B8wV_Qy5T#g^P6ZEj2ef9K^FN4r9|3;2EtBGTWfdK`*w{ zVss&Jj`m8;kG4=6y|%`3R!0naPXpQ$TxZf^7HeY|z46tRozGLk=-CDeWCki_POueO z$wfW0I4Q7>VU+QbeZW#6*)xnZ@S34p@jP3V)dUy?ZMk*imFIKYTTOs{H?eb6FuM|H z$>*t!Y!^X~R;V+=hT8>!9q0?B9;NeKh*v+(RDPahpN+6p3^uI#+@n;r(#OkNNN(w! z_}ww=6EaFbyW~W1Pd-ASXqSrrx$&eWOw@1Z|8IQ(f$BZpfs8kv00000NkvXXu0mjf D3QkR0LcIh5T}Pe&;vcBj~8G7GJw;QJGc-dpFU1DRq}uD zo`fx(en`5L4Dc_v5>V=JINV{;N82VzQh3^Sv6!OWRvz!s#@P20Vu8?c2a5rN5YQeS zK0wPbq#N+VNRHPLeY`NFG{P}yrR);~;{xDCbXvP$c$}^k z$O98J?IE&_lZG^^!f?c01?B=M5GKR=hRaY5*tZvkmQG1>t-Wy|XZ~BvHZhvcEPJedadw?^Nm2A+*fKUf zsAtFkqiC8Kj~gY>6e4ATp*`~q4HN}rfg$A#HB~0hv%L2q1q^NAceFP+ZFpDmYzN2z zv!H?Ty&2+asNf}Yz!W%O&QT>rR;F3L&^xsa=9m-_sN{C8gEJ^Ed4W7IweV)BImol+ zh4S60Z7|317E}N4c~}blyvvtHz>snrcxUU&?`&6HCsY~%L(}g33}Ps1Gt)vP0u1c| z+h-1ix9XCQ{+_THSzeFLuU~0~zCd38LJLFUKGGlDgK%F;1qao;Oto{9GwKy>XZX_{ zz&O=Cv<+V+y3kO3RarLjN7=WH&z@`f`C` z12GJRwHdAy00lq+G>`(I0N}n95DEx);7;y=0^m*xpn?oL+hOPPB0@XrtyHhU5q}L<|o7)k>KaCSIY*!s!ZokWI z-WB#Y{Dc?O`)B}p8aZooF(;6?_l#Pc*Fq-w;2Uoy0a-fNbdF&6xXo1pvJKjld=&j8 zlakuh^8GPasrY>CU<++dJX>1wT^~GkZqGv!av&wtA>xtiQ3mqC1G(fNrx<9Tt2=qbNEU;zUKCrGBRYE>-nR3|;uDj#a zJfaH78Lc4iB1p(RvL;Y=fK@#$Kw>Yws+a-nz1UJqJ@sNZHA5mSkEks5*-4q*XYG{^cQwcd%K=Z?K2@4!PYbET9X@{5o*XHg`omZt^r@}# zHWdb*SLkwulS7i`;qzqwH&Z3}yKTsySFW}#JZKIUak>>ErNtBnKj6;#=9Pi{)Cu*tHvx}M1GY0fBkxW0-KkW{WFr|4*&oF07*qoM6N<$g0_NE AUjP6A literal 0 HcmV?d00001 diff --git a/resources/dark/icon@1.75x.png b/resources/dark/icon@1.75x.png new file mode 100644 index 0000000000000000000000000000000000000000..d2509ccc200e23811b08ed241055d31cba34c221 GIT binary patch literal 858 zcmV-g1Eu_lP)=e04QJ^paBX9x##6>3dr8GTR?JO7eEStJ1&5v018+NpnzotkM{{%qnVNP z;Nt(Do>^PA^euTT4*&}b3n440#PN8%#LYF9yVYv-&v9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4`|?g}N>i zKYuhD%`oR+yerIHj4jv(B8m=@=?x|GD%Rk5t^0iZi_+Z4(Rz$pFCRoim89N@G$KzG9g%1vM* zBM-wc{7~&_4$wyw|1p}A2Tc?{jeMk3LOi@PXpRx6Nz1?Uu g&e#vN>iWN}Prm#r*^w}^mjD0&07*qoM6N<$f}x}j`~Uy| literal 0 HcmV?d00001 diff --git a/resources/light/icon@1.25x.png b/resources/light/icon@1.25x.png new file mode 100644 index 0000000000000000000000000000000000000000..2cf2e282ad100dd9aa8cfde627b55a4fe4577028 GIT binary patch literal 776 zcmV+j1NZ!iP)500009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yPG|h(?j%gu zY&Lr`qmB2Q$*^p8&-vwKzugc$NiRn-xYz47>-D;i=JUm35tNM|4u@m>gi7}Wb3@(u zI#~!od-%D<<>P9ePN#c|IU*1%7){U^Ff-wtQV^Ca4SGJGXY2JkmdvpMF~SrCCD(O7 zkXa!KK$1MgFhw97cs`$RNFWQ4un@)sVpD2c>GHT`1F|4&ZTd?fS1=YJUZc_YF&d3_ z+$LG#QV>?w+KvIF36K?>vN&jGPx!ho= z1jth(YvP!6l_OV;^eNQEio`dyT5aVx&Sl-89qsq~#|kA!#WKSa?|BnF0AW(n>`sca zfcFI;u`LLT$MJZcr-|j^fz{JL4+H9-y5OmWNgxvt^iA!^xrrUo?RMLAU7d@CrGk5Y z!C}AgFn5`5?P035Hh^Xspqz!JQud%~r+U@X_g}^PfAj}gx1ReheR@Oy0000?B>k}?%|fj*>5s(5+Lme7$3_y?p+g{d;BLaLM@zaXIsGd#R>>DY8>0H-6} zmdx<3%dZxnvxx$ zj&+?)T^!*mmCDlf^|i-5+^<^L2Vx0HS%D@S0c1b_{QP{&);^&^NUAD^(lkPKJDpA> zZuUlylo4nSB!_)d%wz=_x7k-AXdWbGI_!!}AP3sa1ucSPgC@hS$`+EU+8QKe>|dI? zt=g>G8pLvjjJ2l17PXlIHHAdE)w#L3B{5f^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A4LxfO%!Wx zODt)W0X$XuSt=s+y8AwDuq2GnW_%kMuov=F34LveGJHr{Q<@$Y62uzni+&58TZykE zFqnhVVL8N{o4-acsyQd9YbT6gf=zF1A*tHgF1vL<84lh{O~84^5DtW=#V_PjPp&>_ zbtc;elAPV|>e%Khc>nvw#l^pInFV&QQ)J(*`-orA-VcMp;GKLS;QiN#kvyw7ghQ$9 msf}RZ*JKYx+u+|I&lKnY0000 0) + { + try + { + var msg = JSON.parse(evt.data); + + if (msg != null) + { + self.handleMessage(msg); + } + } + catch (e) + { + console.error(e); + } + } + }; +}; + +/** + * Static method to edit the diagram in the given img or object. + */ +DiagramEditor.editElement = function(arrel, config, ui, done, urlParams, callback, loader) +{ + var elt = arrel[0]; + var div = arrel[1]; + if (!elt.diagramEditorStarting) + { + elt.diagramEditorStarting = true; + + var editor = new DiagramEditor(config, ui, done, function() + { + delete elt.diagramEditorStarting; + div.classList.remove("hidden"); + this.frame.classList.remove("hidden"); + this.hideLoader(); + }, urlParams, callback, loader); + editor.editElement(elt); + return editor; + } +}; + +/** + * Global configuration. + */ +DiagramEditor.prototype.config = null; + +/** + * Protocol and domain to use. + */ +DiagramEditor.prototype.drawDomain = 'https://embed.diagrams.net/'; + +/** + * UI theme to be use. + */ +DiagramEditor.prototype.ui = 'kennedy'; + +/** + * Contains XML for pending image export. + */ +DiagramEditor.prototype.xml = null; + +/** + * Format to use. + */ +DiagramEditor.prototype.format = 'xml'; + +/** + * Specifies if libraries should be enabled. + */ +DiagramEditor.prototype.libraries = true; + +/** + * CSS style for the iframe. + */ +DiagramEditor.prototype.frameStyle = 'position:absolute;border:0;width:100%;height:100%;'; + +/** + * Adds the iframe and starts editing. + */ +DiagramEditor.prototype.editElement = function(elem) +{ + var src = this.getElementData(elem); + this.startElement = elem; + var fmt = this.format; + + if (src.substring(0, 15) === 'data:image/png;') + { + fmt = 'xmlpng'; + } + else if (src.substring(0, 19) === 'data:image/svg+xml;' || + elem.nodeName.toLowerCase() == 'svg') + { + fmt = 'xmlsvg'; + } + + this.startEditing(src, fmt); + + return this; +}; + +/** + * Adds the iframe and starts editing. + */ +DiagramEditor.prototype.getElementData = function(elem) +{ + var name = elem.nodeName.toLowerCase(); + + return elem.getAttribute((name == 'svg') ? 'content' : + ((name == 'img') ? 'src' : 'data')); +}; + +/** + * Adds the iframe and starts editing. + */ +DiagramEditor.prototype.setElementData = function(elem, data) +{ + var name = elem.nodeName.toLowerCase(); + + if (name == 'svg') + { + elem.outerHTML = atob(data.substring(data.indexOf(',') + 1)); + } + else + { + elem.setAttribute((name == 'img') ? 'src' : 'data', data); + } + + return elem; +}; + +/** + * Starts the editor for the given data. + */ +DiagramEditor.prototype.startEditing = function(data, format, title) +{ + if (this.frame == null) + { + window.addEventListener('message', this.handleMessageEvent); + this.format = (format != null) ? format : this.format; + this.title = (title != null) ? title : this.title; + this.data = data; + + this.frame = this.createFrame( + this.getFrameUrl(), + this.getFrameStyle()); + document.body.appendChild(this.frame); + this.setWaiting(true); + } +}; + +/** + * Updates the waiting cursor. + */ +DiagramEditor.prototype.setWaiting = function(waiting) +{ + if (this.startElement != null) + { + // Redirect cursor to parent for SVG and object + var elt = this.startElement; + var name = elt.nodeName.toLowerCase(); + + if (name == 'svg' || name == 'object') + { + elt = elt.parentNode; + } + + if (elt != null) + { + if (waiting) + { + this.frame.style.pointerEvents = 'none'; + this.previousCursor = elt.style.cursor; + elt.style.cursor = 'wait'; + } + else + { + elt.style.cursor = this.previousCursor; + this.frame.style.pointerEvents = ''; + } + } + } +}; + +/** + * Updates the waiting cursor. + */ +DiagramEditor.prototype.setActive = function(active) +{ + if (active) + { + this.previousOverflow = document.body.style.overflow; + document.body.style.overflow = 'hidden'; + } + else + { + document.body.style.overflow = this.previousOverflow; + } +}; + +/** + * Removes the iframe. + */ +DiagramEditor.prototype.stopEditing = function() +{ + if (this.frame != null) + { + window.removeEventListener('message', this.handleMessageEvent); + document.body.removeChild(this.frame); + this.setActive(false); + this.frame = null; + } +}; + +/** + * Send the given message to the iframe. + */ +DiagramEditor.prototype.postMessage = function(msg) +{ + if (this.frame != null) + { + this.frame.contentWindow.postMessage(JSON.stringify(msg), '*'); + } +}; + +/** + * Returns the diagram data. + */ +DiagramEditor.prototype.getData = function() +{ + return this.data; +}; + +/** + * Returns the title for the editor. + */ +DiagramEditor.prototype.getTitle = function() +{ + return this.title; +}; + +/** + * Returns the CSS style for the iframe. + */ +DiagramEditor.prototype.getFrameStyle = function() +{ + return this.frameStyle + ';left:' + + document.body.scrollLeft + 'px;top:' + + document.body.scrollTop + 'px;'; +}; + +/** + * Returns the URL for the iframe. + */ +DiagramEditor.prototype.getFrameUrl = function() +{ + var url = this.drawDomain + '?proto=json&spin=1'; + + if (this.ui != null) + { + url += '&ui=' + this.ui; + } + + if (this.libraries != null) + { + url += '&libraries=1'; + } + + if (this.config != null) + { + url += '&configure=1'; + } + + if (this.urlParams != null) + { + url += '&' + this.urlParams.join('&'); + } + + return url; +}; + +/** + * Creates the iframe. + */ +DiagramEditor.prototype.createFrame = function(url, style) +{ + var frame = document.createElement('iframe'); + frame.setAttribute('frameborder', '0'); + frame.setAttribute('style', style); + frame.setAttribute('src', url); + frame.classList.add("hidden"); + return frame; +}; + +/** + * Sets the status of the editor. + */ +DiagramEditor.prototype.setStatus = function(messageKey, modified) +{ + this.postMessage({action: 'status', messageKey: messageKey, modified: modified}); +}; + +/** + * Handles the given message. + */ +DiagramEditor.prototype.handleMessage = function(msg) +{ + if (msg.event == 'configure') + { + this.configureEditor(); + } + else if (msg.event == 'init') + { + this.initializeEditor(); + } + else if (msg.event == 'autosave') + { + this.isChanged = true; + this.save(msg.xml, true, this.startElement); + } + else if (msg.event == 'export') + { + this.setElementData(this.startElement, msg.data); + this.stopEditing(); + this.xml = null; + if (this.isClosePlugin || !this.isChanged) + { + this.isClosePlugin = false; + this.pluginCallback(this.isChanged); + } + } + else if (msg.event == 'save') + { + this.save(msg.xml, false, this.startElement); + this.xml = msg.xml; + + if (msg.exit) + { + msg.event = 'exit'; + } + else + { + this.setStatus('allChangesSaved', false); + } + } + + if (msg.event == 'exit') + { + if (this.format != 'xml') + { + if (this.xml != null) + { + this.postMessage({action: 'export', format: this.format, + xml: this.xml, spinKey: 'export'}); + } + else + { + this.stopEditing(msg); + if (!this.isChanged) + this.pluginCallback(false); + } + } + else + { + if (msg.modified == null || msg.modified) + { + this.save(msg.xml, false, this.startElement); + } + + this.stopEditing(msg); + } + } +}; + +/** + * Posts configure message to editor. + */ +DiagramEditor.prototype.configureEditor = function() +{ + this.postMessage({action: 'configure', config: this.config}); +}; + +/** + * Posts load message to editor. + */ +DiagramEditor.prototype.initializeEditor = function() +{ + this.postMessage({action: 'load',autosave: 1, saveAndExit: '1', + modified: 'unsavedChanges', xml: this.getData(), + title: this.getTitle()}); + this.setWaiting(false); + this.setActive(true); + this.initialized(); +}; + +/** + * Saves the given data. + */ +DiagramEditor.prototype.save = function(data, draft, elt) +{ + this.done(data, draft, elt); +}; + +/** + * Invoked after save. + */ +DiagramEditor.prototype.done = function(data) +{ + // hook for subclassers + this.xml = data; +}; + +/** + * Invoked after the editor has sent the init message. + */ +DiagramEditor.prototype.initialized = function() +{ + // hook for subclassers +}; + +/** + * Static method to export the diagram when the plugin is closing. + */ +DiagramEditor.prototype.closePlugin = function(callback) +{ + this.isClosePlugin = true; + if (this.isChanged) + this.postMessage({action: 'export', format: this.format, xml: this.xml, spinKey: 'export'}); + else + this.pluginCallback(false); + +}; + +/** + * Static method to hideLoader. + */ + DiagramEditor.prototype.hideLoader = function() + { + this.loader && (this.loader.remove ? this.loader.remove() : $('#loader-container')[0].removeChild(this.loader)); + this.loader = undefined; + }; \ No newline at end of file From d0cc33e7cbb73ad8ecfdfdd8db034421b00308f8 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 6 Dec 2021 12:13:42 +0300 Subject: [PATCH 02/19] Added icons --- resources/dark/icon.png | Bin 513 -> 453 bytes resources/dark/icon@1.25x.png | Bin 665 -> 645 bytes resources/dark/icon@1.5x.png | Bin 770 -> 615 bytes resources/dark/icon@1.75x.png | Bin 858 -> 743 bytes resources/dark/icon@2x.png | Bin 1025 -> 932 bytes resources/light/icon.png | Bin 646 -> 469 bytes resources/light/icon@1.25x.png | Bin 776 -> 659 bytes resources/light/icon@1.5x.png | Bin 1023 -> 617 bytes resources/light/icon@1.75x.png | Bin 990 -> 754 bytes resources/light/icon@2x.png | Bin 1328 -> 941 bytes 10 files changed, 0 insertions(+), 0 deletions(-) diff --git a/resources/dark/icon.png b/resources/dark/icon.png index dc4bd2d5d2c3e716d4e1016425f515e1c13bc192..c5c4e615ccafa417458d5891e31a985dba938172 100644 GIT binary patch delta 376 zcmV-;0f+v91jPf8R)1PaL_t(|0p*pyPQx$|#=nGyeCk?Qt?z9AboS{C%({$l z;@_1&gFzr4ImTI|BqwIX6v$5^oS2xh3hb3fx4_D#KGtagPk$9~#Ltj|jbdGQ0oejm z^xHOB&`jTu1I@f>(x7}`=bH=-+!hJOxWdR1D17v_y3JNuu|(-YtstqwBVpv^%qw$x&DA#jfNO3jb9P#V3q#&T9i40=xk+7n!7 z(qa~CV;H^h)qjF$yW~W1Pd-ASXqSrrx$&eW fOw@1Z|8IQ(f$BZpfs8kv00000NkvXXu0mjf-+9Nm diff --git a/resources/dark/icon@1.25x.png b/resources/dark/icon@1.25x.png index 851f29c86286e2ac3f21f93de52de9ed76b2a8e3..ac179fc8e9a787f70741ce78fb98b8d66743981b 100644 GIT binary patch delta 605 zcmV-j0;2ty1%(A6iBL{Q4GJ0x0000DNk~Le0000Z0000Z2nGNE03O-1S&<<%e;P?d zK~#7F?Uubu!$26upCqNV)ry~kpjZb5(LwwN6gO8zbaNFyz|p_JSqBG4M~4bdItl8m zh$w=KbrLKh^eau;B;EyET6&kSnzllJ5R%+`mwR~gymtq*VI!0tjFYK1a*LtyB!uzVx{)LVn{)RzhRMI6%pW&{rC{NqiG{An51)5)rLB`cyJ+fU`Kw6C^- z@fBcX4(aoK=$RyhU%Lnu!dQ0~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j05B@_Xgaz8TP>LRtC zi8l-a<5X)))>>1lNhktiNPP}M>b{mp6$wRv*i8fo>sm{tSi&Gck*LRdS1^C6RS_vo zo>>HF#eaJa!;(Ylth#7Skv$Ryfqt@FNOiDiM6yQ0ATSH1hS4ChM#Mc5MuAyJ=)s2J zt)3!lM7$Y5P2dztV+T2{vxPKn5l;qC6Cieyz=-l4GU5`kW&kY$Z=nsb&_j zWB{!KuFp-ZPoKA17TqMGWdJP#eL({44-640g?}m{hFGIO@v4+VFMSzaC{@MqD`f!3 z|G%Y(hEgv<=shS^*IZ^u(}}E8olAyNFMOR1q}%MIgoTuM8b3Fsi|%R(1Z~odlX6+f zz|kldjft2;sTbiLQl5F|tlb0WNOMw;Ic>Jp+oSNtQRKs*n+FREAI~dcrtCg9Thj*s P015yANkvXXu0mjf<}qAF diff --git a/resources/dark/icon@2x.png b/resources/dark/icon@2x.png index 8b9a7c31a6ead2fd8ebcbf2bbcb06f64037e0334..173c3ba8a9ef7bd8722e511569c8acd464add560 100644 GIT binary patch delta 859 zcmV-h1Elu9G!nwZKa62YiwVXRVIPDAcv?`vT%@N2lDN!P7-mVGNYA;bRRI@SGSqC%vuPr?t)r0E z(JP+LgZWITXMd5NPxQTt^hG5@B8_clBHa;~T8AuV>SxEF7n$i~Q(jThVN1=XElcc97xNN0r14u=}Wj=GOi5@z&W> zvXMl`F1PfA-NUVp^T<@_-ihYHZtL!UuvVu@Jb!|cjU+uWB4ik`OZTLbyy&_%;sPBs zl0-I68+Kz|o1nApcLITaClKg&0)e}@&`2WeS0&Z!+K3BusgY#7n`ax|fGDEt+KAVp zf8igHBw72ed%veIIIl(RUtpcA*ugUVf+Ld&M=T5uneYRSU34H`K_u>dkv*k}=um}4 zQ&h5-{*UQ755^9Nb(s4_&jK~J0=3aK_1_;*LbE^(%aC2fE6%E6t?^N_K+~Lq)jY8q l9&pxW)&!nGKtO<}_ydu*G6$xRs~7+P002ovPDHLkV1lRPm>>WE delta 953 zcmV;q14jI$2Z0E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IZdT^^3Wzx)!aQT%efjqQ>{ggk&6G+dJcDwyA-q+Q(VT$KU?SE_= zzddyDi+F(H0Bhq&N+Jy(yo@}Wag#a0Ci5Rf4+~8cYi>&{X_NsxRr*;fBK5laK5eih zjL&9#8yK(`@>B_ZZHY2`NLo{x9u^YB8tRLF3!PhuuOu*-gVJF+#GISIMlY&4C#Y*D zj9`LIZ)_o{+Sx9 Date: Fri, 4 Feb 2022 15:31:50 +0300 Subject: [PATCH 03/19] Fix bug #55122 --- scripts/code.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/code.js b/scripts/code.js index 3f30e20f..ff5bbe6c 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -63,10 +63,10 @@ var _param = { guid : _info.guid, - widthPix : (_info.mmToPx * _info.width) >> 0, - heightPix : (_info.mmToPx * _info.height) >> 0, - width : _info.width ? _info.width : 100, - height : _info.height ? _info.height : 70, + widthPix : (_info.mmToPx * (img.width >> 2) ) >> 0, + heightPix : (_info.mmToPx * (img.height >> 2) ) >> 0, + width : img.width ? (img.width >> 2) : _info.width ? _info.width : 100, + height : img.height ? (img.height >> 2) : _info.height ? _info.height : 70, imgSrc : img.getAttribute('src'), data : img.getAttribute('src'), objectId : _info.objectId, From c00f685f954303823ca49ffb329199ea8bea9dfb Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 4 Feb 2022 16:00:41 +0300 Subject: [PATCH 04/19] Fix bug #55132 Hide Language button --- scripts/code.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/code.js b/scripts/code.js index ff5bbe6c..e08a0732 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -33,11 +33,12 @@ data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAMSURBVBhXY/j//z8ABf4C/qc1gYQAAAAASUVORK5CYII="; img.setAttribute('src', data); + config = {css: "body>a {display:none !important}"}; img.onclick = function() { - editor = DiagramEditor.editElement([this, document.getElementById("div_preview")], null, UI, null, ['lang=' + lang], closePlugin, loader); + editor = DiagramEditor.editElement([this, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, loader); editor.isChanged = true; } - editor = DiagramEditor.editElement([img, document.getElementById("div_preview")], null, UI, null, ['lang=' + lang], closePlugin, loader); + editor = DiagramEditor.editElement([img, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, loader); window.Asc.plugin.resizeWindow(1200, 1000, 800, 600, 0, 0); }; From a0bccdf43ab6c16753efd29872b7785a87e0b0be Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 7 Feb 2022 17:36:07 +0300 Subject: [PATCH 05/19] Fix bug #55141 Also fix problem with zero image sizes on adding ole object. --- scripts/code.js | 38 ++++++++++++++++++--------------- vendor/drawio/diagram-editor.js | 6 +++--- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/scripts/code.js b/scripts/code.js index e08a0732..fd9b82ce 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -61,25 +61,29 @@ { var _info = window.Asc.plugin.info; var _method = (_info.objectId === undefined) ? "AddOleObject" : "EditOleObject"; - - var _param = { - guid : _info.guid, - widthPix : (_info.mmToPx * (img.width >> 2) ) >> 0, - heightPix : (_info.mmToPx * (img.height >> 2) ) >> 0, - width : img.width ? (img.width >> 2) : _info.width ? _info.width : 100, - height : img.height ? (img.height >> 2) : _info.height ? _info.height : 70, - imgSrc : img.getAttribute('src'), - data : img.getAttribute('src'), - objectId : _info.objectId, - resize : _info.resize - }; - - window.Asc.plugin.executeMethod(_method, [_param], function() { - window.Asc.plugin.executeCommand("close", ""); - }); + // we should use timeout for image export from diagram editor + setTimeout(() => { + var _param = { + guid : _info.guid, + widthPix : (_info.mmToPx * (img.width >> 2) ) >> 0, + heightPix : (_info.mmToPx * (img.height >> 2) ) >> 0, + width : img.width ? (img.width >> 2) : _info.width ? _info.width : 100, + height : img.height ? (img.height >> 2) : _info.height ? _info.height : 70, + imgSrc : img.getAttribute('src'), + data : img.getAttribute('src'), + objectId : _info.objectId, + resize : _info.resize + }; + + window.Asc.plugin.executeMethod(_method, [_param], function() { + window.Asc.plugin.executeCommand("close", ""); + }); + }, 1); + + } else { + window.Asc.plugin.executeCommand("close", ""); } - window.Asc.plugin.executeCommand("close", ""); }; function makeLoader() { diff --git a/vendor/drawio/diagram-editor.js b/vendor/drawio/diagram-editor.js index fd106d7c..376830e5 100644 --- a/vendor/drawio/diagram-editor.js +++ b/vendor/drawio/diagram-editor.js @@ -270,9 +270,9 @@ DiagramEditor.prototype.getTitle = function() */ DiagramEditor.prototype.getFrameStyle = function() { - return this.frameStyle + ';left:' + - document.body.scrollLeft + 'px;top:' + - document.body.scrollTop + 'px;'; + // if we use left, we have bug 55144 https://bugzilla.onlyoffice.com/show_bug.cgi?id=55141 + return this.frameStyle + //';left:' + document.body.scrollLeft + 'px;' + + 'top:' + document.body.scrollTop + 'px;'; }; /** From 915d041e50a338b64bcda1248f0e9a120d102354 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Wed, 9 Feb 2022 21:07:37 +0300 Subject: [PATCH 06/19] Fix bug #55141 --- vendor/drawio/diagram-editor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor/drawio/diagram-editor.js b/vendor/drawio/diagram-editor.js index 376830e5..24d74188 100644 --- a/vendor/drawio/diagram-editor.js +++ b/vendor/drawio/diagram-editor.js @@ -99,7 +99,7 @@ DiagramEditor.prototype.libraries = true; /** * CSS style for the iframe. */ -DiagramEditor.prototype.frameStyle = 'position:absolute;border:0;width:100%;height:100%;'; +DiagramEditor.prototype.frameStyle = 'position:absolute;border:0;width:calc(100% - 10px);height:100%;'; /** * Adds the iframe and starts editing. @@ -270,8 +270,8 @@ DiagramEditor.prototype.getTitle = function() */ DiagramEditor.prototype.getFrameStyle = function() { - // if we use left, we have bug 55144 https://bugzilla.onlyoffice.com/show_bug.cgi?id=55141 - return this.frameStyle + //';left:' + document.body.scrollLeft + 'px;' + + // if we use document.body.scrollLeft, we have bug 55144 https://bugzilla.onlyoffice.com/show_bug.cgi?id=55141 + return this.frameStyle + ';left:' + 5 /*document.body.scrollLeft*/ + 'px;' + 'top:' + document.body.scrollTop + 'px;'; }; From fdf83c5d5ae4071d753aaa0c76cdb033edde19fc Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Tue, 15 Feb 2022 13:02:50 +0300 Subject: [PATCH 07/19] Fix bug #55515 --- scripts/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/code.js b/scripts/code.js index fd9b82ce..f30b4331 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -33,7 +33,7 @@ data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAMSURBVBhXY/j//z8ABf4C/qc1gYQAAAAASUVORK5CYII="; img.setAttribute('src', data); - config = {css: "body>a {display:none !important}"}; + config = {css: "body>a {display: none !important;} body {-khtml-user-select: none; user-select: none; -moz-user-select: none; -webkit-user-select: none;} div>img { pointer-events: none; }"}; img.onclick = function() { editor = DiagramEditor.editElement([this, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, loader); editor.isChanged = true; From 72e0506f65fb074c08d428054ebe03ec62ed4d26 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 18 Feb 2022 18:27:17 +0300 Subject: [PATCH 08/19] Fix bug #55613 --- scripts/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/code.js b/scripts/code.js index f30b4331..1137ca93 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -33,7 +33,7 @@ data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAMSURBVBhXY/j//z8ABf4C/qc1gYQAAAAASUVORK5CYII="; img.setAttribute('src', data); - config = {css: "body>a {display: none !important;} body {-khtml-user-select: none; user-select: none; -moz-user-select: none; -webkit-user-select: none;} div>img { pointer-events: none; }"}; + var config = {css: "body>a {display: none !important;} body {-khtml-user-select: none; user-select: none; -moz-user-select: none; -webkit-user-select: none;} div>img:not([title]) { pointer-events: none; }"}; img.onclick = function() { editor = DiagramEditor.editElement([this, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, loader); editor.isChanged = true; From 6abb7011d332cf76759532b530dbf7e707662ed0 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Sat, 5 Mar 2022 16:26:35 +0300 Subject: [PATCH 09/19] Fix bug #55908 --- index.html | 2 +- scripts/code.js | 4 +- vendor/drawio/diagram-editor.js | 134 ++++++++++++++++---------------- 3 files changed, 73 insertions(+), 67 deletions(-) diff --git a/index.html b/index.html index 909fe81b..02f66317 100644 --- a/index.html +++ b/index.html @@ -48,7 +48,7 @@ height: 40px; top: 50%; right: 50%; - position: sticky; + position: absolute; } diff --git a/scripts/code.js b/scripts/code.js index 1137ca93..73d30528 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -35,6 +35,7 @@ img.setAttribute('src', data); var config = {css: "body>a {display: none !important;} body {-khtml-user-select: none; user-select: none; -moz-user-select: none; -webkit-user-select: none;} div>img:not([title]) { pointer-events: none; }"}; img.onclick = function() { + makeLoader(); editor = DiagramEditor.editElement([this, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, loader); editor.isChanged = true; } @@ -47,7 +48,7 @@ if (id == 0) { if (editor.frame) { // if editor is opened - editor.closePlugin(); + editor.closePlugin(true); } else { closePlugin(editor.isChanged); } @@ -89,6 +90,7 @@ function makeLoader() { loader && (loader.remove ? loader.remove() : $('#loader-container')[0].removeChild(loader)); loader = showLoader($('#loader-container')[0], window.Asc.plugin.tr('Loading') + '...'); + if (img) img.classList.add('hidden'); }; window.Asc.plugin.onTranslate = function() diff --git a/vendor/drawio/diagram-editor.js b/vendor/drawio/diagram-editor.js index 24d74188..5526ff48 100644 --- a/vendor/drawio/diagram-editor.js +++ b/vendor/drawio/diagram-editor.js @@ -18,6 +18,8 @@ function DiagramEditor(config, ui, done, initialized, urlParams, callback, loade this.isClosePlugin = false; this.pluginCallback = callback; this.loader = loader; + this.unsaved_xml = null; + this.empty_xml = "ddHBDoMgDADQr+GOoIl357bLTh52JtIJCVqDGN2+fhpwjrhdSHktlBTCi3a+WNGrG0owhFE5E34ijGV5uqwrPD2wNEBjtfSU7FDpFwSkQUctYYgKHaJxuo+xxq6D2kUmrMUpLnugibv2ooEDVLUwR71r6ZTXPKO7X0E3auuc0JBpxVYcYFBC4vRFvCS8sIjOR+1cgFlnt83Fnzv/yX4eZqFzPw4swX73sok+iJdv"; var self = this; @@ -53,13 +55,11 @@ DiagramEditor.editElement = function(arrel, config, ui, done, urlParams, callbac if (!elt.diagramEditorStarting) { elt.diagramEditorStarting = true; - var editor = new DiagramEditor(config, ui, done, function() { delete elt.diagramEditorStarting; div.classList.remove("hidden"); this.frame.classList.remove("hidden"); - this.hideLoader(); }, urlParams, callback, loader); editor.editElement(elt); return editor; @@ -331,70 +331,64 @@ DiagramEditor.prototype.setStatus = function(messageKey, modified) */ DiagramEditor.prototype.handleMessage = function(msg) { - if (msg.event == 'configure') - { - this.configureEditor(); - } - else if (msg.event == 'init') - { - this.initializeEditor(); - } - else if (msg.event == 'autosave') - { - this.isChanged = true; - this.save(msg.xml, true, this.startElement); - } - else if (msg.event == 'export') - { - this.setElementData(this.startElement, msg.data); - this.stopEditing(); - this.xml = null; - if (this.isClosePlugin || !this.isChanged) - { - this.isClosePlugin = false; - this.pluginCallback(this.isChanged); - } - } - else if (msg.event == 'save') - { - this.save(msg.xml, false, this.startElement); - this.xml = msg.xml; + switch (msg.event) { + case "configure": + this.configureEditor(); + break; - if (msg.exit) - { - msg.event = 'exit'; - } - else - { - this.setStatus('allChangesSaved', false); - } - } + case "init": + this.initializeEditor(); + break; - if (msg.event == 'exit') - { - if (this.format != 'xml') - { - if (this.xml != null) - { - this.postMessage({action: 'export', format: this.format, - xml: this.xml, spinKey: 'export'}); + case "autosave": + // for normal work when you push exit without save + this.save(msg.xml, true, this.startElement); + break; + + case "export": + this.setElementData(this.startElement, msg.data); + this.stopEditing(); + this.xml = null; + if (this.isClosePlugin || !this.isChanged) { + this.isClosePlugin = false; + this.pluginCallback(this.isChanged); } - else - { - this.stopEditing(msg); - if (!this.isChanged) - this.pluginCallback(false); + break; + + case "save": + // todo: saving if nothing has changed in a non-empty diagram + this.save(msg.xml, false, this.startElement); + if (msg.exit) { + msg.event = 'exit'; + this.handleMessage(msg); } - } - else - { - if (msg.modified == null || msg.modified) - { + else { + this.setStatus('allChangesSaved', false); + } + break; + + case "load": + this.hideLoader(); + break; + + case "exit": + this.startElement.classList.remove("hidden"); + if (this.format != 'xml') { + if (this.xml != null) { + this.postMessage({action: 'export', format: this.format, + xml: this.xml, spinKey: 'export'}); + } else { + this.stopEditing(msg); + if (!this.isChanged) + this.pluginCallback(false); + } + } else { + if (msg.modified == null || msg.modified) this.save(msg.xml, false, this.startElement); - } - this.stopEditing(msg); - } + this.stopEditing(msg); + } + break; } }; @@ -424,16 +418,22 @@ DiagramEditor.prototype.initializeEditor = function() */ DiagramEditor.prototype.save = function(data, draft, elt) { - this.done(data, draft, elt); + if (data.indexOf(this.empty_xml) === -1) + this.done(data, draft, elt); }; /** * Invoked after save. */ -DiagramEditor.prototype.done = function(data) +DiagramEditor.prototype.done = function(data, draft) { // hook for subclassers - this.xml = data; + if (!draft) { + this.isChanged = true; + this.xml = data; + } else { + this.unsaved_xml = data; + } }; /** @@ -447,8 +447,12 @@ DiagramEditor.prototype.initialized = function() /** * Static method to export the diagram when the plugin is closing. */ -DiagramEditor.prototype.closePlugin = function(callback) +DiagramEditor.prototype.closePlugin = function(bUnsaved) { + if (bUnsaved && this.unsaved_xml) { + this.save(this.unsaved_xml, false); + } + this.isClosePlugin = true; if (this.isChanged) this.postMessage({action: 'export', format: this.format, xml: this.xml, spinKey: 'export'}); @@ -463,5 +467,5 @@ DiagramEditor.prototype.closePlugin = function(callback) DiagramEditor.prototype.hideLoader = function() { this.loader && (this.loader.remove ? this.loader.remove() : $('#loader-container')[0].removeChild(this.loader)); - this.loader = undefined; + this.loader = null; }; \ No newline at end of file From d470442de8e8648481f9f7d5b75dce79082a3926 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Wed, 9 Mar 2022 15:49:12 +0300 Subject: [PATCH 10/19] Fix bug #55938 --- scripts/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/code.js b/scripts/code.js index 73d30528..954873bb 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -63,7 +63,7 @@ var _info = window.Asc.plugin.info; var _method = (_info.objectId === undefined) ? "AddOleObject" : "EditOleObject"; // we should use timeout for image export from diagram editor - setTimeout(() => { + setTimeout(function() { var _param = { guid : _info.guid, widthPix : (_info.mmToPx * (img.width >> 2) ) >> 0, From 8318321440b1a03e8c34ae8a2e96fd142565b174 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Thu, 10 Mar 2022 13:44:05 +0300 Subject: [PATCH 11/19] Working with loader has been changed --- scripts/code.js | 9 +++++++-- vendor/drawio/diagram-editor.js | 17 ++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/scripts/code.js b/scripts/code.js index 954873bb..479b93cb 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -36,10 +36,10 @@ var config = {css: "body>a {display: none !important;} body {-khtml-user-select: none; user-select: none; -moz-user-select: none; -webkit-user-select: none;} div>img:not([title]) { pointer-events: none; }"}; img.onclick = function() { makeLoader(); - editor = DiagramEditor.editElement([this, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, loader); + editor = DiagramEditor.editElement([this, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, hideLoader); editor.isChanged = true; } - editor = DiagramEditor.editElement([img, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, loader); + editor = DiagramEditor.editElement([img, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, hideLoader); window.Asc.plugin.resizeWindow(1200, 1000, 800, 600, 0, 0); }; @@ -93,6 +93,11 @@ if (img) img.classList.add('hidden'); }; + function hideLoader() { + loader && (loader.remove ? loader.remove() : $('#loader-container')[0].removeChild(loader)); + loader = undefined; + }; + window.Asc.plugin.onTranslate = function() { makeLoader(); diff --git a/vendor/drawio/diagram-editor.js b/vendor/drawio/diagram-editor.js index 5526ff48..3ea4ac4b 100644 --- a/vendor/drawio/diagram-editor.js +++ b/vendor/drawio/diagram-editor.js @@ -7,7 +7,7 @@ * * See https://jgraph.github.io/drawio-integration/javascript.html */ -function DiagramEditor(config, ui, done, initialized, urlParams, callback, loader) +function DiagramEditor(config, ui, done, initialized, urlParams, callback, hideLoader) { this.config = (config != null) ? config : this.config; this.ui = (ui != null) ? ui : this.ui; @@ -17,7 +17,7 @@ function DiagramEditor(config, ui, done, initialized, urlParams, callback, loade this.isChanged = false; this.isClosePlugin = false; this.pluginCallback = callback; - this.loader = loader; + this.hideLoader = hideLoader; this.unsaved_xml = null; this.empty_xml = "ddHBDoMgDADQr+GOoIl357bLTh52JtIJCVqDGN2+fhpwjrhdSHktlBTCi3a+WNGrG0owhFE5E34ijGV5uqwrPD2wNEBjtfSU7FDpFwSkQUctYYgKHaJxuo+xxq6D2kUmrMUpLnugibv2ooEDVLUwR71r6ZTXPKO7X0E3auuc0JBpxVYcYFBC4vRFvCS8sIjOR+1cgFlnt83Fnzv/yX4eZqFzPw4swX73sok+iJdv"; @@ -48,7 +48,7 @@ function DiagramEditor(config, ui, done, initialized, urlParams, callback, loade /** * Static method to edit the diagram in the given img or object. */ -DiagramEditor.editElement = function(arrel, config, ui, done, urlParams, callback, loader) +DiagramEditor.editElement = function(arrel, config, ui, done, urlParams, callback, hideLoader) { var elt = arrel[0]; var div = arrel[1]; @@ -60,7 +60,7 @@ DiagramEditor.editElement = function(arrel, config, ui, done, urlParams, callbac delete elt.diagramEditorStarting; div.classList.remove("hidden"); this.frame.classList.remove("hidden"); - }, urlParams, callback, loader); + }, urlParams, callback, hideLoader); editor.editElement(elt); return editor; } @@ -460,12 +460,3 @@ DiagramEditor.prototype.closePlugin = function(bUnsaved) this.pluginCallback(false); }; - -/** - * Static method to hideLoader. - */ - DiagramEditor.prototype.hideLoader = function() - { - this.loader && (this.loader.remove ? this.loader.remove() : $('#loader-container')[0].removeChild(this.loader)); - this.loader = null; - }; \ No newline at end of file From b4a9e73504e3df80166f9ed2b56d364d8a07ab8a Mon Sep 17 00:00:00 2001 From: Kseniya Fedoruk <39296259+kseniafedoruk@users.noreply.github.com> Date: Fri, 11 Mar 2022 11:39:15 +0200 Subject: [PATCH 12/19] Update README.md (#1) --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dd4b182f..2b878fb8 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,25 @@ ## Overview -Create, edit and paste diagrams into document. +Create, edit, and insert diagrams into your documents. -This plugin uses [draw.io](https://github.com/jgraph/drawio), this project, is a configurable diagramming/whiteboarding visualization application. draw.io is owned and developed by JGraph Ltd, a UK based software company. +This plugin uses [draw.io](https://github.com/jgraph/drawio), a configurable diagramming/whiteboarding visualization application. draw.io is owned and developed by JGraph Ltd, a UK based software company. The plugin is compatible with [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) and [desktop](https://github.com/ONLYOFFICE/DesktopEditors) versions of ONLYOFFICE editors. It can be added to ONLYOFFICE instances manually. ## How to use -1. Open the Plugins tab and press "draw.io". -2. Create your own diagram or paste it from the available resources. +1. Open the Plugins tab and click on **draw.io**. +2. Create your own diagram in the opened window or paste one from any available resources. 3. Click "Save & exit" or "Save" and then "Exit". -4. You can see the comleted diagram, if you want to edit it, just click on it. -5. If you want to inser the comleted diagram into the document click button "Ok". +4. You will see a ready diagram. If you need to make further changes to this diagram, just click on it. +5. To insert the ready diagram into your document, click the OK button. ## How to install Detailed instructions can be found in [ONLYOFFICE API documentation](https://api.onlyoffice.com/plugin/installation). + +## User feedback and support + +To ask questions and share feedback, use Issues in this repository or visit [our forum](https://forum.onlyoffice.com/c/plugins/38). + +If you need more information about how to use or build your own plugin, please visit our [API documentation](https://api.onlyoffice.com/plugin/basic). \ No newline at end of file From 7c460cadb9867536eb1623ef89cdaf0505c66598 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 11 Mar 2022 15:23:45 +0300 Subject: [PATCH 13/19] Fix bug #55907 --- README.md | 4 ++-- config.json | 18 +++++++++++++----- scripts/code.js | 8 ++++++-- translations/cs-CS.json | 3 ++- translations/de-DE.json | 3 ++- translations/es-ES.json | 3 ++- translations/fr-FR.json | 3 ++- translations/ru-RU.json | 3 ++- vendor/drawio/diagram-editor.js | 7 +++++++ 9 files changed, 38 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 2b878fb8..c7c292be 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ The plugin is compatible with [self-hosted](https://github.com/ONLYOFFICE/Docume 1. Open the Plugins tab and click on **draw.io**. 2. Create your own diagram in the opened window or paste one from any available resources. -3. Click "Save & exit" or "Save" and then "Exit". +3. Click "Save & exit". 4. You will see a ready diagram. If you need to make further changes to this diagram, just click on it. -5. To insert the ready diagram into your document, click the OK button. +5. To insert the ready diagram into your document, click the Insert button. ## How to install diff --git a/config.json b/config.json index 5856eb6e..7a6db919 100644 --- a/config.json +++ b/config.json @@ -74,17 +74,25 @@ "buttons": [ { - "text": "Ok", - "primary": true + "text": "Insert", + "primary": true, + "textLocale": { + "ru": "Вставить", + "fr": "Annuler", + "es": "Cancelar", + "de": "Abbrechen", + "cs": "Vložit" + } }, { "text": "Cancel", "primary": false, "textLocale": { "ru": "Отмена", - "fr": "Annuler", - "es": "Cancelar", - "de": "Abbrechen" + "fr": "Insérer", + "es": "Insertar", + "de": "Einfügen", + "cs": "Zrušit" } } ], diff --git a/scripts/code.js b/scripts/code.js index 479b93cb..7740c909 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -22,18 +22,20 @@ var UI = "kennedy"; var loader; var lang = ""; + var title = "Click on diagram to edit." window.Asc.plugin.init = function(data) { lang = this.info.lang.split('-')[0]; img = document.createElement('img'); + img.setAttribute('title', title) document.getElementById("div_preview").appendChild(img); // create an empti image for editor (if data doesn't set), after export we put the result in it if (!data) data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAMSURBVBhXY/j//z8ABf4C/qc1gYQAAAAASUVORK5CYII="; img.setAttribute('src', data); - var config = {css: "body>a {display: none !important;} body {-khtml-user-select: none; user-select: none; -moz-user-select: none; -webkit-user-select: none;} div>img:not([title]) { pointer-events: none; }"}; + var config = {css: "button.geBigButton, a.geBigButton:nth-of-type(2) {display: none !important;} a.geBigButton:nth-of-type(1) {vertical-align: sub;margin-right: 10px !important;} body>a {display: none !important;} body {-khtml-user-select: none; user-select: none; -moz-user-select: none; -webkit-user-select: none;} div>img:not([title]) { pointer-events: none; }"}; img.onclick = function() { makeLoader(); editor = DiagramEditor.editElement([this, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, hideLoader); @@ -100,8 +102,10 @@ window.Asc.plugin.onTranslate = function() { + title = window.Asc.plugin.tr(title); + if (img) + img.setAttribute("title", title); makeLoader(); - //nothing to translate }; window.Asc.plugin.onExternalMouseUp = function() diff --git a/translations/cs-CS.json b/translations/cs-CS.json index b23681a7..e934a06f 100644 --- a/translations/cs-CS.json +++ b/translations/cs-CS.json @@ -1,3 +1,4 @@ { - "Loading" : "Načítání" + "Loading" : "Načítání", + "Click on diagram to edit." : "Klikněte na diagram pro úpravu." } \ No newline at end of file diff --git a/translations/de-DE.json b/translations/de-DE.json index f0542e04..0622dc8f 100644 --- a/translations/de-DE.json +++ b/translations/de-DE.json @@ -1,3 +1,4 @@ { - "Loading" : "Laden" + "Loading" : "Laden", + "Click on diagram to edit." : "Klicken Sie zum Bearbeiten auf das Diagramm." } \ No newline at end of file diff --git a/translations/es-ES.json b/translations/es-ES.json index 0bb95ddc..f07a99c1 100644 --- a/translations/es-ES.json +++ b/translations/es-ES.json @@ -1,3 +1,4 @@ { - "Loading" : "Carga" + "Loading" : "Carga", + "Click on diagram to edit." : "Haga clic en el diagrama para editar." } \ No newline at end of file diff --git a/translations/fr-FR.json b/translations/fr-FR.json index 728e563b..baaa6f67 100644 --- a/translations/fr-FR.json +++ b/translations/fr-FR.json @@ -1,3 +1,4 @@ { - "Loading" : "Chargement" + "Loading" : "Chargement", + "Click on diagram to edit." : "Cliquez sur le diagramme pour le modifier." } \ No newline at end of file diff --git a/translations/ru-RU.json b/translations/ru-RU.json index 62f5d758..bef8d804 100644 --- a/translations/ru-RU.json +++ b/translations/ru-RU.json @@ -1,3 +1,4 @@ { - "Loading" : "Загрузка" + "Loading" : "Загрузка", + "Click on diagram to edit." : "Нажмите на диаграмму для редактирования." } \ No newline at end of file diff --git a/vendor/drawio/diagram-editor.js b/vendor/drawio/diagram-editor.js index 3ea4ac4b..fc609070 100644 --- a/vendor/drawio/diagram-editor.js +++ b/vendor/drawio/diagram-editor.js @@ -235,6 +235,13 @@ DiagramEditor.prototype.stopEditing = function() document.body.removeChild(this.frame); this.setActive(false); this.frame = null; + var t = this; + var el = this.startElement; + setTimeout(function() { + // check for empy element + if ( (el.height && el.height < 10) || (el.width && el.width < 10) ) + t.pluginCallback(false); + }, 1); } }; From bb9543eee778f8c117d6ff842d1ba1b364a02e1e Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 14 Mar 2022 15:18:30 +0300 Subject: [PATCH 14/19] Fix bug #55988 --- scripts/code.js | 2 +- vendor/drawio/diagram-editor.js | 35 ++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/scripts/code.js b/scripts/code.js index 7740c909..b9dcce2c 100644 --- a/scripts/code.js +++ b/scripts/code.js @@ -35,7 +35,7 @@ data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAMSURBVBhXY/j//z8ABf4C/qc1gYQAAAAASUVORK5CYII="; img.setAttribute('src', data); - var config = {css: "button.geBigButton, a.geBigButton:nth-of-type(2) {display: none !important;} a.geBigButton:nth-of-type(1) {vertical-align: sub;margin-right: 10px !important;} body>a {display: none !important;} body {-khtml-user-select: none; user-select: none; -moz-user-select: none; -webkit-user-select: none;} div>img:not([title]) { pointer-events: none; }"}; + var config = {css: "button.geBigButton:nth-of-type(1) {background-color:transparent !important; color:"+ (UI == 'dark' ? '#ccc' : '#000') +" !important;} body>a {display: none !important;} body {-khtml-user-select: none; user-select: none; -moz-user-select: none; -webkit-user-select: none;} div>img:not([title]) { pointer-events: none; }"}; img.onclick = function() { makeLoader(); editor = DiagramEditor.editElement([this, document.getElementById("div_preview")], config, UI, null, ['lang=' + lang], closePlugin, hideLoader); diff --git a/vendor/drawio/diagram-editor.js b/vendor/drawio/diagram-editor.js index fc609070..15994e93 100644 --- a/vendor/drawio/diagram-editor.js +++ b/vendor/drawio/diagram-editor.js @@ -19,6 +19,7 @@ function DiagramEditor(config, ui, done, initialized, urlParams, callback, hideL this.pluginCallback = callback; this.hideLoader = hideLoader; this.unsaved_xml = null; + this.curPage = 0; this.empty_xml = "ddHBDoMgDADQr+GOoIl357bLTh52JtIJCVqDGN2+fhpwjrhdSHktlBTCi3a+WNGrG0owhFE5E34ijGV5uqwrPD2wNEBjtfSU7FDpFwSkQUctYYgKHaJxuo+xxq6D2kUmrMUpLnugibv2ooEDVLUwR71r6ZTXPKO7X0E3auuc0JBpxVYcYFBC4vRFvCS8sIjOR+1cgFlnt83Fnzv/yX4eZqFzPw4swX73sok+iJdv"; var self = this; @@ -252,6 +253,33 @@ DiagramEditor.prototype.postMessage = function(msg) { if (this.frame != null) { + // if we put id of the current page instead of the first page id, final image will be from curent page + if (this.curPage !== 0) { + var first = {start : 0, id: ""}; + var needed = {start : 0, id: ""}; + var newXml = ""; + var pos = 0; + var i = 0; + while (pos !== -1) { + var str = ' Date: Thu, 17 Mar 2022 10:33:47 +0300 Subject: [PATCH 15/19] Add version in config --- config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/config.json b/config.json index 7a6db919..cfa20fb6 100644 --- a/config.json +++ b/config.json @@ -7,6 +7,7 @@ "de": "draw.io" }, "guid": "asc.{DB38923B-A8C0-4DE9-8AEE-A61BB5C901A5}", + "version": "1.0.0", "variations": [ { From be497dc6521af7c7ad76d3b562584a86f8c478f5 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Thu, 17 Mar 2022 10:48:46 +0300 Subject: [PATCH 16/19] Changed config (margins and translation) --- config.json | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/config.json b/config.json index cfa20fb6..75a16d63 100644 --- a/config.json +++ b/config.json @@ -1,27 +1,27 @@ { - "name": "draw.io", - "nameLocale": { - "ru": "draw.io", - "fr": "draw.io", - "es": "draw.io", - "de": "draw.io" - }, - "guid": "asc.{DB38923B-A8C0-4DE9-8AEE-A61BB5C901A5}", + "name": "draw.io", + "nameLocale": { + "ru": "draw.io", + "fr": "draw.io", + "es": "draw.io", + "de": "draw.io" + }, + "guid": "asc.{DB38923B-A8C0-4DE9-8AEE-A61BB5C901A5}", "version": "1.0.0", - "variations": [ - { - "description": "draw.io", - "descriptionLocale": { - "ru": "draw.io", - "fr": "draw.io", - "es": "draw.io", - "de": "draw.io" - }, - "url": "index.html", + "variations": [ + { + "description": "draw.io", + "descriptionLocale": { + "ru": "draw.io", + "fr": "draw.io", + "es": "draw.io", + "de": "draw.io" + }, + "url": "index.html", - "icons": [ "resources/light/icon.png", "resources/light/icon@2x.png" ], - "icons2": [ + "icons": [ "resources/light/icon.png", "resources/light/icon@2x.png" ], + "icons2": [ { "style" : "light", @@ -79,9 +79,9 @@ "primary": true, "textLocale": { "ru": "Вставить", - "fr": "Annuler", - "es": "Cancelar", - "de": "Abbrechen", + "fr": "Insérer", + "es": "Insertar", + "de": "Einfügen", "cs": "Vložit" } }, @@ -90,15 +90,15 @@ "primary": false, "textLocale": { "ru": "Отмена", - "fr": "Insérer", - "es": "Insertar", - "de": "Einfügen", + "fr": "Annuler", + "es": "Cancelar", + "de": "Abbrechen", "cs": "Zrušit" } } ], - "size": [ 1200, 1000 ] + "size": [ 1200, 1000 ] } ] } From 0d62caa5bf9f0ddba31288170cbc450eb9a7cdac Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Fri, 27 May 2022 13:53:29 +0300 Subject: [PATCH 17/19] Added translation langs map --- translations/langs.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 translations/langs.json diff --git a/translations/langs.json b/translations/langs.json new file mode 100644 index 00000000..1653584d --- /dev/null +++ b/translations/langs.json @@ -0,0 +1,7 @@ +[ + "cs-CS", + "de-DE", + "es-ES", + "fr-FR", + "ru-RU" +] \ No newline at end of file From d14661a0e395d24682ef6b904b30242ffcb45353 Mon Sep 17 00:00:00 2001 From: Danil Titarenko <77471369+danilapog@users.noreply.github.com> Date: Thu, 2 Jun 2022 14:03:22 +0300 Subject: [PATCH 18/19] Add workflow for release (#5) --- .github/workflows/release.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..2bf63320 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,11 @@ +name: Release + +on: + workflow_dispatch: + push: + tags: + - "v*" + +jobs: + release: + uses: ONLYOFFICE/onlyoffice.github.io/.github/workflows/release.yml@master From 0888a2ca0cb3ba50811ff3f380833027dee13d4f Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Fri, 24 Jun 2022 23:23:33 +0300 Subject: [PATCH 19/19] Update version --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 75a16d63..63e533d8 100644 --- a/config.json +++ b/config.json @@ -7,7 +7,7 @@ "de": "draw.io" }, "guid": "asc.{DB38923B-A8C0-4DE9-8AEE-A61BB5C901A5}", - "version": "1.0.0", + "version": "1.0.1", "variations": [ {