Compare commits

..

106 Commits

Author SHA1 Message Date
cadeb19ece Merge branch 'master' into release/v6.0.0
# Conflicts:
#	LICENSE.txt
2020-09-30 18:58:24 +03:00
875dfaaec4 Merge pull request #82 from ONLYOFFICE/hotfix/apache
Apache License
2020-09-03 20:50:34 +03:00
6918016dda Apache License 2020-08-31 15:22:12 +03:00
fb039100e1 Update Readme.md 2020-07-23 18:51:17 +03:00
4a6b549eaa Update Readme.md (#80)
* Update Readme.md

- add API methods for text examples
2020-07-23 18:37:46 +03:00
5cefe5c3b2 Merge pull request #79 from ONLYOFFICE/feature/action-link
Feature/action link
2020-06-30 15:43:33 +03:00
0cf0171721 fixed an issue when creating a second action link 2020-06-18 11:44:21 +03:00
f8a1587109 Merge pull request #74 from ONLYOFFICE/dependabot/bundler/web/documentserver-example/ruby/ffi-1.12.2
build(deps): bump ffi from 1.9.18 to 1.12.2 in /web/documentserver-example/ruby
2020-06-09 12:13:09 +03:00
44142da370 Merge branch 'develop' into dependabot/bundler/web/documentserver-example/ruby/ffi-1.12.2 2020-06-09 12:12:19 +03:00
ecbae22fcc ruby: get link to bookmark 2020-05-21 14:39:10 +03:00
b3a79deef8 python: get link to bookmark 2020-05-21 12:51:07 +03:00
c4f278d58a java: get link to bookmark 2020-05-21 12:51:07 +03:00
b0ea8ed388 csharp-mvc: get link to bookmark 2020-05-21 12:50:48 +03:00
220516c930 csharp: get link to bookmark 2020-05-18 16:31:16 +03:00
3be28877ab fixed header name 2020-05-18 16:30:56 +03:00
b3a96f15ab php: get link to bookmark 2020-05-18 14:19:25 +03:00
14a68befd2 v5.5.2 2020-04-27 17:01:53 +03:00
b1af12a78d v5.5.1r2 2020-04-15 14:18:33 +03:00
83bab147d0 v5.5.1 2020-04-09 12:40:23 +03:00
80670a0d64 Update copyright year 2020-04-06 11:59:41 +03:00
75f137470b nodejs: get link to bookmark 2020-03-19 13:39:29 +03:00
870a3ee799 [run] Platform
Add platform for run

(cherry picked from commit 8b9f07e46e)
2020-03-13 11:29:22 +03:00
c3c1689170 nodejs: fix upload files
(cherry picked from commit af7101844a)
2020-03-13 11:29:09 +03:00
a271b847d5 nodejs: add run-develop
(cherry picked from commit b58bf412fa)
2020-03-13 11:28:52 +03:00
45ea1a8c1d v5.5.0 2020-03-04 18:33:54 +03:00
1b90f16eb5 build(deps): bump ffi in /web/documentserver-example/ruby
Bumps [ffi](https://github.com/ffi/ffi) from 1.9.18 to 1.12.2.
- [Release notes](https://github.com/ffi/ffi/releases)
- [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ffi/ffi/compare/1.9.18...1.12.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-04 15:33:27 +00:00
422429e742 v5.5.0 2020-03-04 18:09:04 +03:00
29072e3d5c bump 2020 2020-03-04 10:13:12 +03:00
b82c2c68d5 Merge pull request #71 from ONLYOFFICE/feature/python
Feature/python
2020-03-04 10:09:03 +03:00
67d6eaa18b python: env vars 2020-03-03 19:03:05 +03:00
cb91ba1620 bump 2020 2020-03-03 14:39:29 +03:00
0e91256847 python: 2020 2020-03-03 14:32:11 +03:00
ce16625091 python: converted filename was not sent to client 2020-03-03 13:27:15 +03:00
4d538fc35d python: footer copyright 2020-03-03 13:26:36 +03:00
36c9583a2c nodejs: remove trade 2020-03-03 11:55:24 +03:00
1bde1f66d3 change name 2020-03-03 11:55:24 +03:00
fddc08c24b csharp: removed c#7 features 2020-03-03 11:40:00 +03:00
06305ee262 python: zip build script 2020-03-03 11:08:30 +03:00
e55e27cee8 python: reload on dialog close 2020-03-03 11:03:57 +03:00
8fa77cb9ba python: copyrights & cleanup 2020-03-03 11:00:23 +03:00
f038327928 python: sorting by date 2020-03-03 10:45:08 +03:00
0adaf8a84b python: lower file extension 2020-03-03 10:35:52 +03:00
85cb88b0fc python: fixed editors language 2020-03-03 10:26:49 +03:00
4c8ac0457f Merge pull request #69 from ONLYOFFICE/feature/ruby-v2.6.5
Feature/ruby v2.6.5
2020-03-02 17:36:46 +03:00
3ba6072b3e Merge pull request #68 from ONLYOFFICE/dependabot/bundler/web/documentserver-example/ruby/nokogiri-1.10.8
build(deps): bump nokogiri from 1.8.1 to 1.10.8 in /web/documentserver-example/ruby
2020-02-27 15:52:34 +03:00
ad966cfc28 Merge branch 'feature/ruby-v2.6.5' into dependabot/bundler/web/documentserver-example/ruby/nokogiri-1.10.8
# Conflicts:
#	web/documentserver-example/ruby/Gemfile.lock
2020-02-27 15:50:48 +03:00
1f9b2b8230 build(deps): bump nokogiri in /web/documentserver-example/ruby
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.8.1 to 1.10.8.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.8.1...v1.10.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-25 08:22:59 +00:00
61826dc813 Merge branch 'feature/pkg' into release/v5.5.0 2020-02-12 12:00:19 +03:00
3dc4a6d6a3 Fix pkg building 2020-02-12 11:37:44 +03:00
4de89aa858 Preparation for pkg
Add abillity setup storage folder outside the repo
2020-02-12 11:37:04 +03:00
8b9f07e46e [run] Platform
Add platform for run
2020-01-14 15:14:10 +03:00
af7101844a nodejs: fix upload files 2020-01-09 14:07:00 +03:00
b58bf412fa nodejs: add run-develop 2019-12-25 18:33:49 +03:00
a1c524df00 python: changed docserv default link 2019-12-25 11:28:12 +03:00
710d4f4059 Fixed displaying mobile version cb5324381e 2019-12-13 13:20:39 +03:00
be25001479 Fixed displaying mobile version cb5324381e 2019-12-13 13:09:28 +03:00
7466aba10f ruby: 'raise_in_transactional_callbacks' deprecated since rails 5.0.0 2019-11-21 14:43:53 +03:00
c4fc8c85e2 ruby: 'render :text' deprecated since rails 5.1.0 2019-11-21 14:41:48 +03:00
007efef742 ruby: rails manifest.js 2019-11-21 14:40:53 +03:00
a4bf9d76f6 ruby: updated dependencies to support ruby v2.6.5 2019-11-21 14:36:56 +03:00
7c5faa7c8a Merge pull request #66 from ONLYOFFICE/dependabot/bundler/web/documentserver-example/ruby/loofah-2.3.1
build(deps): bump loofah from 2.1.1 to 2.3.1 in /web/documentserver-example/ruby
2019-11-21 14:33:02 +03:00
3497eeea9f build(deps): bump loofah in /web/documentserver-example/ruby
Bumps [loofah](https://github.com/flavorjones/loofah) from 2.1.1 to 2.3.1.
- [Release notes](https://github.com/flavorjones/loofah/releases)
- [Changelog](https://github.com/flavorjones/loofah/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flavorjones/loofah/compare/v2.1.1...v2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-08 16:23:59 +00:00
7717cb35f8 python: 3rd party licenses 2019-11-07 18:25:35 +03:00
1c59409ce2 python: blockcontent mode 2019-11-07 17:50:30 +03:00
bd4c3543d7 csharp-mvc: blockcontent mode 2019-11-07 17:40:52 +03:00
8770526316 csharp: blockcontent mode 2019-11-07 17:36:49 +03:00
51ecf3afeb java: blockcontent mode 2019-11-07 17:23:29 +03:00
8887edefb3 ruby: blockcontent mode 2019-11-07 17:09:08 +03:00
7ab292bc13 php: blockcontent mode 2019-11-07 16:41:16 +03:00
6ab006e409 changed favicon 2019-11-06 10:29:09 +03:00
582ed3f61b changed logo 2019-11-06 10:28:24 +03:00
d06cffabfb Merge pull request #65 from ONLYOFFICE/dependabot/npm_and_yarn/web/documentserver-example/nodejs/debug-2.6.9
build(deps): bump debug from 2.2.0 to 2.6.9 in /web/documentserver-example/nodejs
2019-11-05 18:38:22 +03:00
5545568e04 python: readme 2019-11-05 17:57:33 +03:00
6ba9b33606 python: version history 2019-11-05 17:51:22 +03:00
178477f9fb build(deps): bump debug in /web/documentserver-example/nodejs
Bumps [debug](https://github.com/visionmedia/debug) from 2.2.0 to 2.6.9.
- [Release notes](https://github.com/visionmedia/debug/releases)
- [Changelog](https://github.com/visionmedia/debug/blob/2.6.9/CHANGELOG.md)
- [Commits](https://github.com/visionmedia/debug/compare/2.2.0...2.6.9)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-02 01:35:08 +00:00
8d657a0101 python: jwt support 2019-11-01 15:47:59 +03:00
c1454eff13 python: document list 2019-11-01 10:58:20 +03:00
f7867e4bc3 python: document editing 2019-10-28 12:58:31 +03:00
f94e057492 python: upload, convert, create sample 2019-10-25 17:05:20 +03:00
a5371faa27 python: django template 2019-10-25 16:54:23 +03:00
34527f0b3e python: static files 2019-10-25 16:46:45 +03:00
b9dd792672 [all] Rename
Rename web-apps-pro -> web-apps
2019-10-24 12:27:30 +03:00
13c3164ca1 java: header null ref error 2019-10-23 13:22:14 +03:00
ceed4ac712 [img] Change image 2019-10-21 14:01:18 +03:00
6a16a9392a [img] Rename image 2019-10-21 14:00:48 +03:00
48043e5d70 [all] Rename
Rename web-apps -> web-apps-pro
2019-10-18 15:41:55 +03:00
d7809b848e v5.4.1 2019-10-02 12:07:23 +03:00
d5466f1070 v5.4.1 2019-10-02 12:02:38 +03:00
f639971861 object.assign is not available on IE 2019-09-26 15:21:09 +03:00
95ee0bf128 php: save old file version 2019-09-25 19:02:24 +03:00
03efbf468e Merge branch 'develop' of https://github.com/ONLYOFFICE/document-server-integration into develop 2019-09-25 18:50:28 +03:00
60cb77136a ruby: version history 2019-09-25 18:50:11 +03:00
d1d7d1e416 ruby: unique document key for each version 2019-09-25 17:05:32 +03:00
a60e7b9b6b php: comment, fillforms, filter modes 2019-09-25 15:17:33 +03:00
79d5682a02 Fix #63 - backUrl with custom port 2019-09-25 15:09:50 +03:00
96994fd0dc Fix #63 - backUrl with custom port 2019-09-25 15:06:25 +03:00
668a0e323a ruby: document list, different view/edit options 2019-09-25 14:46:30 +03:00
057d38d063 ruby: body overflow style issue 2019-09-25 14:08:25 +03:00
1ecf16085e ruby: jwt support 2019-09-25 11:54:16 +03:00
945c09f5d4 ruby: send POST instead of GET on convert request 2019-09-25 11:53:01 +03:00
b642053bc3 ruby: user and lang selectors 2019-09-25 11:52:12 +03:00
fef0179c7e ruby: create empty sample, new upload style 2019-09-25 09:54:18 +03:00
c0366c0134 Merge remote-tracking branch 'remotes/origin/hotfix/v5.4.1' into develop 2019-09-23 16:32:48 +03:00
584fb155b7 nodejs: fix style with blockcontent mode 2019-09-23 16:32:14 +03:00
1217de89b3 Add 'blockcontent' mode 2019-09-04 18:15:06 +03:00
118a4d74b0 v5.4.0 2019-09-03 14:37:39 +03:00
212 changed files with 15992 additions and 533 deletions

3
.gitignore vendored
View File

@ -5,8 +5,9 @@
/build/deploy
/build/*.log
/web/documentserver-example/nodejs/node_modules
/web/documentserver-example/nodejs/public/files
/web/documentserver-example/nodejs/files
/web/documentserver-example/nodejs/config/local.json
/web/documentserver-example/nodejs/example
**/.vscode/
**/.idea
/web/documentserver-example/java/target/

View File

@ -28,3 +28,17 @@ Steve Matteson
License: Apache License, version 2.0
6. requests - Requests is an elegant and simple HTTP library for Python
License: Apache License, version 2.0
7. pyjwt - JSON Web Token implementation in Python
License: MIT
8. django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design
License: BSD

201
LICENSE Normal file
View File

@ -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.

View File

@ -1,5 +1,5 @@
[![License](https://img.shields.io/badge/License-MIT-green.svg?style=flat)](https://opensource.org/licenses/MIT) ![Release](https://img.shields.io/badge/Release-v4.1.2-blue.svg?style=flat)
[![License](https://img.shields.io/badge/License-MIT-green.svg?style=flat)](https://opensource.org/licenses/MIT) ![Release](https://img.shields.io/badge/Release-v6.0.0-blue.svg?style=flat)
## Document Server integration example
@ -15,6 +15,34 @@ You should change `http://documentserver` to your server address in these files:
More information on how to use these examples can be found here: [http://api.onlyoffice.com/editors/demopreview](http://api.onlyoffice.com/editors/demopreview "http://api.onlyoffice.com/editors/demopreview")
## API methods for test examples
The methods described below are available for all of the test examples.
### POST `/upload`
| | |
| ---------------------- | ------------------------------------------------------------ |
| **Summary** | Upload file to test example via request |
| **URL** | /upload |
| **Method** | POST |
| **Request<br>Headers** | `Content-Type: multipart/form-data` |
| **Request<br>Body** | `uploadedFile=@<filepath>`<br> `filepath` - file for uploading<br />Multipart body with the file binary contents |
| **Response** | **Code:** 200 OK <br />**Content on success:**<br /> `{ "filename": <filename>}`<br />**Content on error:**<br /> `{ "error": "Uploaded file not found"}` <br /> Or <br /> `{ "error": "File size is incorrect"}` |
| **Sample** | `curl -X POST -F uploadedFile=@filename.docx http://localhost/upload` |
### DELETE `/file`
| | |
| ------------------ | ------------------------------------------------------------ |
| **Summary** | Delete one file or all files
| **URL** | /file |
| **Method** | DELETE |
| ****URL Params**** | **Optional:**<br /> `filename=[string]` - file for deleting. <br /> *WARNING! Without this parameter, all files will be deleted* |
| **Response** | **Code:** 200 OK <br /> **Success:**<br /> `{"success":true}` |
| **Sample** | **Delete one file:**<br />`curl -X DELETE http://localhost/file?filename=filename.docx`<br />**Delete all files:**<br />`curl -X DELETE http://localhost/file`<br /> |
## Project Information
Official website: [https://www.onlyoffice.com](https://www.onlyoffice.com/?utm_source=github&utm_medium=cpc&utm_campaign=GitHubIntegrationEx)

View File

@ -16,6 +16,8 @@
<DirPHP>$(RootDir)web\documentserver-example\php\</DirPHP>
<NameRuby>$(To)Ruby Example</NameRuby>
<DirRuby>$(RootDir)web\documentserver-example\ruby\</DirRuby>
<NamePython>$(To)Python Example</NamePython>
<DirPython>$(RootDir)web\documentserver-example\python\</DirPython>
</PropertyGroup>
<Target Name="Build">
@ -56,6 +58,12 @@
</ItemGroup>
<Copy SourceFiles="@(ZipFilesRuby)" DestinationFiles="@(ZipFilesRuby->'$(NameRuby)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameRuby)" WorkingDirectory="$(To)" ZipFileName="$(NameRuby).zip" />
<ItemGroup>
<ZipFilesPython Include="$(DirPython)**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesPython)" DestinationFiles="@(ZipFilesPython->'$(NamePython)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NamePython)" WorkingDirectory="$(To)" ZipFileName="$(NamePython).zip" />
</Target>
</Project>

View File

@ -25,3 +25,18 @@ License: MIT
5. Prime JWT - Prime JWT is intended to be fast and easy to use. Prime JWT has a single external dependency on Jackson.
License: Apache-2.0
6. requests - Requests is an elegant and simple HTTP library for Python
License: Apache License, version 2.0
7. pyjwt - JSON Web Token implementation in Python
License: MIT
8. django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design
License: BSD

27
licences/django.license Normal file
View File

@ -0,0 +1,27 @@
Copyright (c) Django Software Foundation and individual contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of Django nor the names of its contributors may be used
to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019 ONLYOFFICE
Copyright (c) 2015 José Padilla
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

13
licences/requests.license Normal file
View File

@ -0,0 +1,13 @@
Copyright 2019 Kenneth Reitz
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
https://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.

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -52,7 +52,7 @@ namespace OnlineEditorsExampleMVC.Controllers
public ActionResult Sample(string fileExt, bool? sample)
{
var fileName = DocManagerHelper.CreateDemo(fileExt, sample ?? false);
DocManagerHelper.CreateMeta(fileName, Request.Cookies["uid"]?.Value, Request.Cookies["uname"]?.Value);
DocManagerHelper.CreateMeta(fileName, Request.Cookies.GetOrDefault("uid", ""), Request.Cookies.GetOrDefault("uname", ""));
Response.Redirect(Url.Action("Editor", "Home", new { fileName = fileName }));
return null;
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -0,0 +1,21 @@
using System.Web;
namespace OnlineEditorsExampleMVC.Helpers
{
public static class Utils
{
public static string GetOrDefault(this HttpRequest request, string header, string def)
{
var value = request[header];
if (value != null) return value;
return def;
}
public static string GetOrDefault(this HttpCookieCollection cookies, string cookie, string def)
{
var cook = cookies[cookie];
if (cook != null && !string.IsNullOrEmpty(cook.Value)) return cook.Value;
return def;
}
}
}

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019 ONLYOFFICE
Copyright (c) 2020 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -64,12 +64,17 @@ namespace OnlineEditorsExampleMVC.Models
public string GetDocConfig(HttpRequest request, UrlHelper url)
{
var jss = new JavaScriptSerializer();
var ext = Path.GetExtension(FileName);
var editorsMode = Mode ?? "edit";
var canEdit = DocManagerHelper.EditedExts.Contains(ext);
var mode = canEdit && editorsMode != "view" ? "edit" : "view";
var actionLink = request.GetOrDefault("actionLink", null);
var actionData = string.IsNullOrEmpty(actionLink) ? null : jss.DeserializeObject(actionLink);
var config = new Dictionary<string, object>
{
{ "type", Type ?? "desktop" },
@ -91,11 +96,12 @@ namespace OnlineEditorsExampleMVC.Models
{
"permissions", new Dictionary<string, object>
{
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" },
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" && editorsMode != "blockcontent" },
{ "download", true },
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "filter") },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" },
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "filter") || editorsMode == "blockcontent" },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" && editorsMode != "blockcontent" },
{ "modifyFilter", editorsMode != "filter" },
{ "modifyContentControl", editorsMode != "blockcontent" },
{ "review", editorsMode == "edit" || editorsMode == "review" }
}
}
@ -104,14 +110,15 @@ namespace OnlineEditorsExampleMVC.Models
{
"editorConfig", new Dictionary<string, object>
{
{ "actionLink", actionData },
{ "mode", mode },
{ "lang", request.Cookies["ulang"]?.Value ?? "en" },
{ "lang", request.Cookies.GetOrDefault("ulang", "en") },
{ "callbackUrl", CallbackUrl },
{
"user", new Dictionary<string, object>
{
{ "id", request.Cookies["uid"]?.Value ?? "uid-1" },
{ "name", request.Cookies["uname"]?.Value ?? "John Smith" }
{ "id", request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", request.Cookies.GetOrDefault("uname", "John Smith") }
}
},
{
@ -146,7 +153,7 @@ namespace OnlineEditorsExampleMVC.Models
config.Add("token", token);
}
return new JavaScriptSerializer().Serialize(config);
return jss.Serialize(config);
}
public void GetHistory(out string history, out string historyData)

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -137,6 +137,7 @@
<Compile Include="Helpers\DocManagerHelper.cs" />
<Compile Include="Helpers\DocumentConverter.cs" />
<Compile Include="Helpers\JwtManager.cs" />
<Compile Include="Helpers\Utils.cs" />
<Compile Include="Models\FileModel.cs" />
<Compile Include="Models\FileUtility.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@ -147,6 +148,7 @@
<ItemGroup>
<Content Include="Content\editor.css" />
<Content Include="Content\images\alert.png" />
<Content Include="Content\images\block-content-24.png" />
<Content Include="Content\images\close.png" />
<Content Include="Content\images\comment-24.png" />
<Content Include="Content\images\corner.png" />

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ascensio System SIA")]
[assembly: AssemblyProduct("OnlineEditorsExampleMVC")]
[assembly: AssemblyCopyright("Ascensio System SIA 2019")]
[assembly: AssemblyCopyright("Ascensio System SIA 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -35,7 +35,9 @@
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="icon" href="~/favicon.ico" type="image/x-icon" />
<title><%= Model.FileName + " - ONLYOFFICE" %></title>
@ -81,17 +83,40 @@
location.reload(true);
};
var config = {
width: "100%",
height: "100%",
events: {
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
var replaceActionLink = function(href, linkParam) {
var link;
var actionIndex = href.indexOf("&actionLink=");
if (actionIndex != -1) {
var endIndex = href.indexOf("&", actionIndex + "&actionLink=".length);
if (endIndex != -1) {
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&actionLink=" + encodeURIComponent(linkParam);
} else {
link = href.substring(0, actionIndex) + "&actionLink=" + encodeURIComponent(linkParam);
}
} else {
link = href + "&actionLink=" + encodeURIComponent(linkParam);
}
return link;
}
var onMakeActionLink = function (event) {
var actionData = event.data;
var linkParam = JSON.stringify(actionData);
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
};
var config = <%= Model.GetDocConfig(Request, Url) %>;
config.width = "100%";
config.height = "100%";
config.events = {
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
"onMakeActionLink": onMakeActionLink,
};
<% string hist, histData; %>
@ -112,7 +137,7 @@
<% } %>
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", Object.assign(config, <%= Model.GetDocConfig(Request, Url) %>));
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
if (window.addEventListener) {

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -59,7 +59,7 @@
<td width="30%" valign="middle">
<span class="select-user">Username:</span>
<select class="select-user" id="user">
<option value="uid-1">Jonn Smith</option>
<option value="uid-1">John Smith</option>
<option value="uid-2">Mark Pottato</option>
<option value="uid-3">Hamish Mitchell</option>
</select>
@ -139,7 +139,7 @@
<thead>
<tr class="tableHeader">
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td colspan="5" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="6" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="3" class="tableHeaderCell">Viewers</td>
</tr>
</thead>
@ -189,13 +189,20 @@
<img src="content/images/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment"/>
</a>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<td class="contentCells contentCells-icon">
<% if (docType == "text") { %>
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "fillForms" }) %>" target="_blank">
<img src="content/images/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<% if (docType == "text") { %>
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "blockcontent" }) %>" target="_blank">
<img src="content/images/block-content-24.png" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= Url.Action("Editor", "Home", new { fileName = storedFile, editorsType = "desktop", editorsMode = "view" }) %>" target="_blank">

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -95,7 +95,7 @@ namespace OnlineEditorsExampleMVC
var savedFileName = DocManagerHelper.StoragePath(fileName);
httpPostedFile.SaveAs(savedFileName);
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies["uid"]?.Value, context.Request.Cookies["uname"]?.Value);
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies.GetOrDefault("uid", ""), context.Request.Cookies.GetOrDefault("uname", ""));
context.Response.Write("{ \"filename\": \"" + fileName + "\"}");
}
@ -151,7 +151,7 @@ namespace OnlineEditorsExampleMVC
Remove(fileName);
fileName = correctName;
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies["uid"]?.Value, context.Request.Cookies["uname"]?.Value);
DocManagerHelper.CreateMeta(fileName, context.Request.Cookies.GetOrDefault("uid", ""), context.Request.Cookies.GetOrDefault("uname", ""));
}
context.Response.Write("{ \"filename\" : \"" + fileName + "\"}");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -54,7 +54,7 @@
<td width="30%" valign="middle">
<span class="select-user">Username:</span>
<select class="select-user" id="user">
<option value="uid-1">Jonn Smith</option>
<option value="uid-1">John Smith</option>
<option value="uid-2">Mark Pottato</option>
<option value="uid-3">Hamish Mitchell</option>
</select>
@ -134,7 +134,7 @@
<thead>
<tr class="tableHeader">
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td colspan="5" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="6" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="3" class="tableHeaderCell">Viewers</td>
</tr>
</thead>
@ -184,13 +184,20 @@
<img src="app_themes/images/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment"/>
</a>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<td class="contentCells contentCells-icon">
<% if (docType == "text") { %>
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=fillForms" %>" target="_blank">
<img src="app_themes/images/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-icon contentCells-shift">
<% if (docType == "text") { %>
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=blockcontent" %>" target="_blank">
<img src="app_themes/images/block-content-24.png" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-icon">
<a href="<%= editUrl + "&editorsType=desktop&editorsMode=view" %>" target="_blank">

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -241,8 +241,8 @@ namespace OnlineEditorsExample
Directory.CreateDirectory(histDir);
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
{ "created", DateTime.Now.ToString() },
{ "id", context.Request.Cookies["uid"]?.Value ?? "uid-1" },
{ "name", context.Request.Cookies["uname"]?.Value ?? "John Smith" }
{ "id", context.Request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", context.Request.Cookies.GetOrDefault("uname", "John Smith") }
}));
return _fileName;
@ -288,8 +288,8 @@ namespace OnlineEditorsExample
Directory.CreateDirectory(histDir);
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
{ "created", DateTime.Now.ToString() },
{ "id", request.Cookies["uid"]?.Value ?? "uid-1" },
{ "name", request.Cookies["uname"]?.Value ?? "John Smith" }
{ "id", request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", request.Cookies.GetOrDefault("uname", "John Smith") }
}));
}
catch (Exception)
@ -354,8 +354,8 @@ namespace OnlineEditorsExample
Directory.CreateDirectory(histDir);
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
{ "created", DateTime.Now.ToString() },
{ "id", context.Request.Cookies["uid"]?.Value ?? "uid-1" },
{ "name", context.Request.Cookies["uname"]?.Value ?? "John Smith" }
{ "id", context.Request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", context.Request.Cookies.GetOrDefault("uname", "John Smith") }
}));
}

View File

@ -8,6 +8,9 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="icon" href="~/favicon.ico" type="image/x-icon" />
<title>ONLYOFFICE</title>
@ -61,7 +64,7 @@
};
var onRequestEditRights = function () {
location.href = location.href.replace(RegExp("action=view\&?", "i"), "");
location.href = location.href.replace(RegExp("editorsMode=view\&?", "i"), "");
};
var onError = function (event) {
@ -73,17 +76,40 @@
location.reload(true);
};
var config = {
width: "100%",
height: "100%",
events: {
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
var replaceActionLink = function(href, linkParam) {
var link;
var actionIndex = href.indexOf("&actionLink=");
if (actionIndex != -1) {
var endIndex = href.indexOf("&", actionIndex + "&actionLink=".length);
if (endIndex != -1) {
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&actionLink=" + encodeURIComponent(linkParam);
} else {
link = href.substring(0, actionIndex) + "&actionLink=" + encodeURIComponent(linkParam);
}
} else {
link = href + "&actionLink=" + encodeURIComponent(linkParam);
}
return link;
}
var onMakeActionLink = function (event) {
var actionData = event.data;
var linkParam = JSON.stringify(actionData);
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
};
var config = <%= DocConfig %>;
config.width = "100%";
config.height = "100%";
config.events = {
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
'onMakeActionLink': onMakeActionLink,
};
<% if (!string.IsNullOrEmpty(History) && !string.IsNullOrEmpty(HistoryData))
@ -102,7 +128,7 @@
<% } %>
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", Object.assign(config, <%= DocConfig %>));
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
if (window.addEventListener) {

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -101,14 +101,19 @@ namespace OnlineEditorsExample
var ext = Path.GetExtension(FileName);
var editorsMode = Request["editorsMode"] ?? "edit";
var editorsMode = Request.GetOrDefault("editorsMode", "edit");
var canEdit = _Default.EditedExts.Contains(ext);
var mode = canEdit && editorsMode != "view" ? "edit" : "view";
var jss = new JavaScriptSerializer();
var actionLink = Request.GetOrDefault("actionLink", null);
var actionData = string.IsNullOrEmpty(actionLink) ? null : jss.DeserializeObject(actionLink);
var config = new Dictionary<string, object>
{
{ "type", Request["editorsType"] ?? "desktop" },
{ "type", Request.GetOrDefault("editorsType", "desktop") },
{ "documentType", _Default.DocumentType(FileName) },
{
"document", new Dictionary<string, object>
@ -127,11 +132,12 @@ namespace OnlineEditorsExample
{
"permissions", new Dictionary<string, object>
{
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" },
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" && editorsMode != "blockcontent"},
{ "download", true },
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "filter") },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" },
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "filter") || editorsMode == "blockcontent" },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" && editorsMode != "blockcontent" },
{ "modifyFilter", editorsMode != "filter" },
{ "modifyContentControl", editorsMode != "blockcontent" },
{ "review", editorsMode == "edit" || editorsMode == "review" }
}
}
@ -140,14 +146,15 @@ namespace OnlineEditorsExample
{
"editorConfig", new Dictionary<string, object>
{
{ "actionLink", actionData },
{ "mode", mode },
{ "lang", Request.Cookies["ulang"]?.Value ?? "en" },
{ "lang", Request.Cookies.GetOrDefault("ulang", "en") },
{ "callbackUrl", CallbackUrl },
{
"user", new Dictionary<string, object>
{
{ "id", Request.Cookies["uid"]?.Value ?? "uid-1" },
{ "name", Request.Cookies["uname"]?.Value ?? "John Smith" }
{ "id", Request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", Request.Cookies.GetOrDefault("uname", "John Smith") }
}
},
{
@ -182,13 +189,13 @@ namespace OnlineEditorsExample
config.Add("token", token);
}
var jss = new JavaScriptSerializer();
DocConfig = jss.Serialize(config);
try
{
GetHistory(out var hist, out var histData);
Dictionary<string, object> hist;
Dictionary<string, object> histData;
GetHistory(out hist, out histData);
if (hist != null && histData != null)
{
History = jss.Serialize(hist);
@ -304,8 +311,8 @@ namespace OnlineEditorsExample
Directory.CreateDirectory(histDir);
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
{ "created", DateTime.Now.ToString() },
{ "id", request.Cookies["uid"]?.Value ?? "uid-1" },
{ "name", request.Cookies["uname"]?.Value ?? "John Smith" }
{ "id", request.Cookies.GetOrDefault("uid", "uid-1") },
{ "name", request.Cookies.GetOrDefault("uname", "John Smith") }
}));
}
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019 ONLYOFFICE
Copyright (c) 2020 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -52,6 +52,7 @@
<Reference Include="System.Web.Services" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Themes\images\block-content-24.png" />
<Content Include="App_Themes\images\comment-24.png" />
<Content Include="App_Themes\images\delete-24.png" />
<Content Include="App_Themes\images\desktop-24.png" />
@ -91,6 +92,7 @@
<Compile Include="Default.aspx.designer.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>
<Compile Include="Utils.cs" />
<Compile Include="WebEditor.ashx.cs">
<DependentUpon>WebEditor.ashx</DependentUpon>
</Compile>

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ascensio System SIA")]
[assembly: AssemblyProduct("OnlineEditorsExample")]
[assembly: AssemblyCopyright("Ascensio System SIA 2019")]
[assembly: AssemblyCopyright("Ascensio System SIA 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@ -0,0 +1,21 @@
using System.Web;
namespace OnlineEditorsExample
{
public static class Utils
{
public static string GetOrDefault(this HttpRequest request, string header, string def)
{
var value = request[header];
if (value != null) return value;
return def;
}
public static string GetOrDefault(this HttpCookieCollection cookies, string cookie, string def)
{
var cook = cookies[cookie];
if (cook != null && !string.IsNullOrEmpty(cook.Value)) return cook.Value;
return def;
}
}
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 144 KiB

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019 ONLYOFFICE
Copyright (c) 2020 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -69,7 +69,7 @@ public class EditorServlet extends HttpServlet
}
}
FileModel file = new FileModel(fileName, cm.getCookie("ulang"), cm.getCookie("uid"), cm.getCookie("uname"));
FileModel file = new FileModel(fileName, cm.getCookie("ulang"), cm.getCookie("uid"), cm.getCookie("uname"), request.getParameter("actionLink"));
file.changeType(request.getParameter("mode"), request.getParameter("type"));
if (DocumentManager.TokenEnabled())

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -272,14 +272,21 @@ public class IndexServlet extends HttpServlet
String token = (String) jsonObj.get("token");
if (token == null) {
String header = (String) request.getHeader(DocumentJwtHeader == "" ? "Authorization" : DocumentJwtHeader);
token = header.startsWith("Bearer ") ? header.substring(7) : header;
String header = (String) request.getHeader(DocumentJwtHeader == null || DocumentJwtHeader.isEmpty() ? "Authorization" : DocumentJwtHeader);
if (header != null && !header.isEmpty()) {
token = header.startsWith("Bearer ") ? header.substring(7) : header;
}
}
if (token == null || token.isEmpty()) {
writer.write("{\"error\":1,\"message\":\"JWT expected\"}");
return;
}
JWT jwt = DocumentManager.ReadToken(token);
if (jwt == null)
{
writer.write("JWT.parse error");
writer.write("{\"error\":1,\"message\":\"JWT validation failed\"}");
return;
}
@ -291,7 +298,7 @@ public class IndexServlet extends HttpServlet
jwt.claims = payload;
}
catch (Exception ex) {
writer.write("Wrong payload");
writer.write("{\"error\":1,\"message\":\"Wrong payload\"}");
return;
}
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -38,6 +38,7 @@ import helpers.DocumentManager;
import helpers.ServiceConverter;
import helpers.FileUtility;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
@ -52,7 +53,7 @@ public class FileModel
public EditorConfig editorConfig;
public String token;
public FileModel(String fileName, String lang, String uid, String uname)
public FileModel(String fileName, String lang, String uid, String uname, String actionData)
{
if (fileName == null) fileName = "";
fileName = fileName.trim();
@ -65,7 +66,7 @@ public class FileModel
document.fileType = FileUtility.GetFileExtension(fileName).replace(".", "");
document.key = ServiceConverter.GenerateRevisionId(DocumentManager.CurUserHostAddress(null) + "/" + fileName + "/" + Long.toString(new File(DocumentManager.StoragePath(fileName, null)).lastModified()));
editorConfig = new EditorConfig();
editorConfig = new EditorConfig(actionData);
editorConfig.callbackUrl = DocumentManager.GetCallback(fileName);
if (lang != null) editorConfig.lang = lang;
@ -210,21 +211,24 @@ public class FileModel
public Boolean edit;
public Boolean fillForms;
public Boolean modifyFilter;
public Boolean modifyContentControl;
public Boolean review;
public Permissions(String mode, String type, Boolean canEdit)
{
comment = !mode.equals("view") && !mode.equals("fillForms") && !mode.equals("embedded");
comment = !mode.equals("view") && !mode.equals("fillForms") && !mode.equals("embedded") && !mode.equals("blockcontent");
download = true;
edit = canEdit && (mode.equals("edit") || mode.equals("filter"));
fillForms = !mode.equals("view") && !mode.equals("comment") && !mode.equals("embedded");
edit = canEdit && (mode.equals("edit") || mode.equals("filter") || mode.equals("blockcontent"));
fillForms = !mode.equals("view") && !mode.equals("comment") && !mode.equals("embedded") && !mode.equals("blockcontent");
modifyFilter = !mode.equals("filter");
modifyContentControl = !mode.equals("blockcontent");
review = mode.equals("edit") || mode.equals("review");
}
}
public class EditorConfig
{
public HashMap<String, Object> actionLink = null;
public String mode = "edit";
public String callbackUrl;
public String lang = "en";
@ -232,8 +236,12 @@ public class FileModel
public Customization customization;
public Embedded embedded;
public EditorConfig()
public EditorConfig(String actionData)
{
if (actionData != null) {
Gson gson = new Gson();
actionLink = gson.fromJson(actionData, new TypeToken<HashMap<String, Object>>() { }.getType());
}
user = new User();
customization = new Customization();
}

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -31,6 +31,9 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<title>ONLYOFFICE</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/editor.css" />
@ -70,6 +73,28 @@
location.reload(true);
};
var replaceActionLink = function(href, linkParam) {
var link;
var actionIndex = href.indexOf("&actionLink=");
if (actionIndex != -1) {
var endIndex = href.indexOf("&", actionIndex + "&actionLink=".length);
if (endIndex != -1) {
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&actionLink=" + encodeURIComponent(linkParam);
} else {
link = href.substring(0, actionIndex) + "&actionLink=" + encodeURIComponent(linkParam);
}
} else {
link = href + "&actionLink=" + encodeURIComponent(linkParam);
}
return link;
}
var onMakeActionLink = function (event) {
var actionData = event.data;
var linkParam = JSON.stringify(actionData);
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
};
var config = JSON.parse('<%= FileModel.Serialize(Model) %>');
config.width = "100%";
config.height = "100%";
@ -79,6 +104,7 @@
'onRequestEditRights': onRequestEditRights,
"onError": onError,
"onOutdatedVersion": onOutdatedVersion,
"onMakeActionLink": onMakeActionLink,
};
<%

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 144 KiB

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -58,7 +58,7 @@
<td width="30%" valign="middle">
<span class="select-user">Username:</span>
<select class="select-user" id="user">
<option value="uid-1">Jonn Smith</option>
<option value="uid-1">John Smith</option>
<option value="uid-2">Mark Pottato</option>
<option value="uid-3">Hamish Mitchell</option>
</select>
@ -139,7 +139,7 @@
<thead>
<tr class="tableHeader">
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td colspan="5" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="6" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="3" class="tableHeaderCell">Viewers</td>
</tr>
</thead>
@ -185,13 +185,20 @@
<img src="css/img/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment"/>
</a>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<td class="contentCells contentCells-icon">
<% if (docType.equals("text")) { %>
<a href="EditorServlet?fileName=<%= URLEncoder.encode(files[i].getName(), "UTF-8") %>&type=desktop&mode=fillForms" target="_blank">
<img src="css/img/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<% if (docType.equals("text")) { %>
<a href="EditorServlet?fileName=<%= URLEncoder.encode(files[i].getName(), "UTF-8") %>&type=desktop&mode=blockcontent" target="_blank">
<img src="css/img/block-content-24.png" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
</a>
<% } %>
</td>
<td class="contentCells contentCells-icon">
<a href="EditorServlet?fileName=<%= URLEncoder.encode(files[i].getName(), "UTF-8") %>&type=desktop&mode=view" target="_blank">

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019 ONLYOFFICE
Copyright (c) 2020 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019 ONLYOFFICE
Copyright (c) 2020 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,7 +1,7 @@
"use strict";
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -35,6 +35,7 @@ const syncRequest = require("sync-request");
const jwt = require('jsonwebtoken');
const config = require('config');
const configServer = config.get('server');
const storageFolder = configServer.get("storageFolder");
const mime = require("mime");
const docManager = require("./helpers/docManager");
const documentService = require("./helpers/documentService");
@ -99,7 +100,7 @@ app.use(bodyParser.urlencoded({ extended: false }));
app.get("/", function (req, res) {
try {
docManager.init(__dirname, req, res);
docManager.init(storageFolder, req, res);
res.render("index", {
preloaderUrl: siteUrl + configServer.get('preloaderUrl'),
@ -119,7 +120,7 @@ app.get("/", function (req, res) {
});
app.get("/download", function(req, res) {
docManager.init(__dirname, req, res);
docManager.init(storageFolder, req, res);
var fileName = fileUtility.getFileName(req.query.fileName);
var userAddress = docManager.curUserHostAddress();
@ -140,11 +141,11 @@ app.get("/download", function(req, res) {
app.post("/upload", function (req, res) {
docManager.init(__dirname, req, res);
docManager.init(storageFolder, req, res);
docManager.storagePath(""); //mkdir if not exist
const userIp = docManager.curUserHostAddress();
const uploadDir = path.join("./public", configServer.get('storageFolder'), userIp);
const uploadDir = path.join(storageFolder, userIp);
const uploadDirTmp = path.join(uploadDir, 'tmp');
docManager.createDirectory(uploadDirTmp);
@ -201,7 +202,7 @@ app.post("/upload", function (req, res) {
res.write("{ \"filename\": \"" + file.name + "\"}");
const userid = req.query.userid ? req.query.userid : "uid-1";
const name = req.query.name ? req.query.name : "Jonn Smith";
const name = req.query.name ? req.query.name : "John Smith";
docManager.saveFileData(file.name, userid, name);
}
@ -297,7 +298,7 @@ app.get("/convert", function (req, res) {
app.delete("/file", function (req, res) {
try {
docManager.init(__dirname, req, res);
docManager.init(storageFolder, req, res);
let fileName = req.query.filename;
if (fileName) {
fileName = fileUtility.getFileName(fileName);
@ -322,7 +323,7 @@ app.delete("/file", function (req, res) {
app.post("/track", function (req, res) {
docManager.init(__dirname, req, res);
docManager.init(storageFolder, req, res);
var userAddress = req.query.useraddress;
var fileName = fileUtility.getFileName(req.query.filename);
@ -513,14 +514,15 @@ app.post("/track", function (req, res) {
app.get("/editor", function (req, res) {
try {
docManager.init(__dirname, req, res);
docManager.init(storageFolder, req, res);
var fileExt = req.query.fileExt;
var history = [];
var historyData = [];
var lang = docManager.getLang();
var userid = req.query.userid ? req.query.userid : "uid-1";
var name = req.query.name ? req.query.name : "Jonn Smith";
var name = req.query.name ? req.query.name : "John Smith";
var actionData = req.query.action ? req.query.action : "null";
if (fileExt != null) {
var fileName = docManager.createDemo((req.query.sample ? "sample." : "new.") + fileExt, userid, name);
@ -616,20 +618,22 @@ app.get("/editor", function (req, res) {
key: key,
token: "",
callbackUrl: docManager.getCallback(fileName),
isEdit: canEdit && (mode == "edit" || mode == "filter"),
isEdit: canEdit && (mode == "edit" || mode == "filter" || mode == "blockcontent"),
review: mode == "edit" || mode == "review",
comment: mode != "view" && mode != "fillForms" && mode != "embedded",
fillForms: mode != "view" && mode != "comment" && mode != "embedded",
comment: mode != "view" && mode != "fillForms" && mode != "embedded" && mode != "blockcontent",
fillForms: mode != "view" && mode != "comment" && mode != "embedded" && mode != "blockcontent",
modifyFilter: mode != "filter",
modifyContentControl: mode != "blockcontent",
mode: canEdit && mode != "view" ? "edit" : "view",
canBackToFolder: type != "embedded",
backUrl: docManager.getServerUrl(),
backUrl: docManager.getServerUrl() + "/",
curUserHostAddress: docManager.curUserHostAddress(),
lang: lang,
userid: userid,
name: name,
fileChoiceUrl: fileChoiceUrl,
plugins: JSON.stringify(plugins)
plugins: JSON.stringify(plugins),
actionData: actionData
},
history: history,
historyData: historyData

View File

@ -22,13 +22,14 @@
"viewedDocs": [".pdf", ".djvu", ".xps"],
"editedDocs": [".docx", ".xlsx", ".csv", ".pptx", ".txt"],
"convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".rtf", ".mht", ".html", ".htm", ".epub"],
"storageFolder": "files",
"storageFolder": "./files",
"storagePath": "/files",
"maxFileSize": 1073741824,
"mobileRegEx": "android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino",
"static":[
{
"name": "/public",
"path": "public"
"name": "/files",
"path": "./files"
}
],
"token": {

View File

@ -2,7 +2,7 @@
"server": {
"port": 3000,
"siteUrl": "http://127.0.0.1:8080/",
"apiUrl": "web-apps-pro/apps/api/documents/api.js",
"preloaderUrl": "web-apps-pro/apps/api/documents/cache-scripts.html"
"apiUrl": "web-apps/apps/api/documents/api.js",
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html"
}
}

View File

@ -2,7 +2,7 @@
"server": {
"port": 80,
"siteUrl": "http://127.0.0.1:8001/",
"apiUrl": "web-apps-pro/apps/api/documents/api.js",
"preloaderUrl": "web-apps-pro/apps/api/documents/cache-scripts.html"
"apiUrl": "web-apps/apps/api/documents/api.js",
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html"
}
}

View File

@ -1,6 +1,13 @@
{
"server": {
"siteUrl": "/",
"maxFileSize": 104857600
"maxFileSize": 104857600,
"storageFolder": "/var/lib/onlyoffice/documentserver-example/files",
"static":[
{
"name": "/files",
"path": "/var/lib/onlyoffice/documentserver-example/files"
}
]
}
}

View File

@ -4,8 +4,8 @@
"maxFileSize": 104857600,
"static":[
{
"name": "/public",
"path": "public",
"name": "/files",
"path": "./files",
"options": {"maxAge": "7d"}
}
]

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,7 +1,7 @@
"use strict";
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -32,7 +32,6 @@ const documentService = require("./documentService");
const cacheManager = require("./cacheManager");
const guidManager = require("./guidManager");
const configServer = require('config').get('server');
const storageFolder = configServer.get('storageFolder');
const os = require("os");
let docManager = {};
@ -60,8 +59,6 @@ docManager.init = function (dir, req, res) {
docManager.dir = dir;
docManager.req = req;
docManager.res = res;
this.createDirectory(path.join(docManager.dir, "public", storageFolder));
};
docManager.getLang = function () {
@ -113,7 +110,7 @@ docManager.getCorrectName = function (fileName, userAddress) {
docManager.createDemo = function (demoName, userid, username) {
const fileName = docManager.getCorrectName(demoName);
docManager.copyFile(path.join(docManager.dir, "public", "samples", demoName), docManager.storagePath(fileName));
docManager.copyFile(path.join(__dirname, "..","public", "samples", demoName), docManager.storagePath(fileName));
docManager.saveFileData(fileName, userid, username);
@ -149,9 +146,8 @@ docManager.getFileUri = function (fileName) {
docManager.getlocalFileUri = function (fileName, version, forDocumentServer) {
const serverPath = docManager.getServerUrl(forDocumentServer);
const storagePath = storageFolder.length ? storageFolder + "/" : "";
const hostAddress = docManager.curUserHostAddress();
const url = serverPath + "/" + storagePath + hostAddress + "/" + encodeURIComponent(fileName);
const url = serverPath + configServer.get("storagePath") + "/" + hostAddress + "/" + encodeURIComponent(fileName);
if (!version) {
return url;
}
@ -172,13 +168,13 @@ docManager.getCallback = function (fileName) {
docManager.storagePath = function (fileName, userAddress) {
fileName = fileUtility.getFileName(fileName);
const directory = path.join(docManager.dir, "public", storageFolder, docManager.curUserHostAddress(userAddress));
const directory = path.join(docManager.dir, docManager.curUserHostAddress(userAddress));
this.createDirectory(directory);
return path.join(directory, fileName);
};
docManager.forcesavePath = function (fileName, userAddress, create) {
let directory = path.join(docManager.dir, "public", storageFolder, docManager.curUserHostAddress(userAddress));
let directory = path.join(docManager.dir, docManager.curUserHostAddress(userAddress));
if (!this.existsSync(directory)) {
return "";
}
@ -195,7 +191,7 @@ docManager.forcesavePath = function (fileName, userAddress, create) {
};
docManager.historyPath = function (fileName, userAddress, create) {
let directory = path.join(docManager.dir, "public", storageFolder, docManager.curUserHostAddress(userAddress));
let directory = path.join(docManager.dir, docManager.curUserHostAddress(userAddress));
if (!this.existsSync(directory)) {
return "";
}
@ -233,7 +229,7 @@ docManager.changesUser = function (fileName, userAddress, version) {
docManager.getStoredFiles = function () {
const userAddress = docManager.curUserHostAddress();
const directory = path.join(docManager.dir, "public", storageFolder, userAddress);
const directory = path.join(docManager.dir, userAddress);
this.createDirectory(directory);
const result = [];
const storedFiles = fileSystem.readdirSync(directory);

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -187,18 +187,11 @@
"integrity": "sha512-vKQ9DTQPN1FLYiiEEOQ6IBGFqvjCa5rSK3cWMy/Nespm5d/x3dGFT9UBZnkLxCwua/IXBi2TYnwTEpsOvhC4UQ=="
},
"debug": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
"integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=",
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "0.7.1"
},
"dependencies": {
"ms": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
"integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg="
}
"ms": "2.0.0"
}
},
"deep-is": {

View File

@ -5,6 +5,7 @@
"scripts": {
"start": "node ./bin/www"
},
"bin": "bin/www",
"description": "OnlineEditorsExampleNodeJS",
"author": {
"name": "ONLYOFFICE",
@ -16,7 +17,7 @@
"dependencies": {
"body-parser": "^1.16.1",
"config": "^1.21.0",
"debug": "~2.2.0",
"debug": "~2.6.9",
"ejs": "~2.5.1",
"express": "^4.14.1",
"formidable": "^1.1.1",
@ -32,5 +33,11 @@
"repository": {
"type": "git",
"url": "git+https://github.com/ONLYOFFICE/document-server-integration.git"
},
"pkg": {
"assets": [
"public/**/*",
"views/*"
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 144 KiB

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

View File

@ -1,6 +1,6 @@
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -290,7 +290,7 @@ footer {
background-repeat: no-repeat;
display: inline-block;
height: 16px;
max-width: 250px;
max-width: 200px;
margin-bottom: -6px;
overflow: hidden;
padding: 8px 0 1px 34px;

View File

@ -0,0 +1,19 @@
#!/usr/bin/env python
import sys
sys.path.append('../../../../build_tools/scripts')
import os
import base
def install_module():
base.print_info('Install')
base.cmd('npm', ['install'])
def run_integration_example():
install_module()
base.set_env('NODE_CONFIG_DIR', './config')
base.print_info('run integration example')
base.run_nodejs(['bin/www'])
base.set_env('NODE_ENV', 'development-' + base.host_platform())
run_integration_example()

View File

@ -1,18 +0,0 @@
#!/bin/bash
BASEDIR="$(cd "$(dirname "$0")" && pwd)"
cd $BASEDIR
echo "----------------------------------------"
echo "Install nodejs modules "
echo "----------------------------------------"
npm install
echo "----------------------------------------"
echo "Run server "
echo "----------------------------------------"
export NODE_CONFIG_DIR=$BASEDIR/config && export NODE_ENV=development-mac && node bin/www

View File

@ -1,15 +0,0 @@
ECHO OFF
ECHO.
ECHO ----------------------------------------
ECHO Install node.js modules
ECHO ----------------------------------------
call npm install
ECHO.
ECHO ----------------------------------------
ECHO Run server
ECHO ----------------------------------------
SET NODE_CONFIG_DIR=%~dp0\config
SET NODE_ENV=development-windows
start /min /b node bin/www

View File

@ -18,10 +18,12 @@
"edit": <%- editor.isEdit %>,
"fillForms": <%- editor.fillForms %>,
"modifyFilter": <%- editor.modifyFilter %>,
"modifyContentControl": <%- editor.modifyContentControl %>,
"review": <%- editor.review %>
}
},
"editorConfig": {
"actionLink": <%- editor.actionData %>,
"mode": "<%- editor.mode %>",
"lang": "<%- editor.lang %>",
"callbackUrl": "<%- editor.callbackUrl %>",

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -96,6 +96,28 @@
location.reload(true);
};
var replaceActionLink = function(href, linkParam) {
var link;
var actionIndex = href.indexOf("&action=");
if (actionIndex != -1) {
var endIndex = href.indexOf("&", actionIndex + "&action=".length);
if (endIndex != -1) {
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&action=" + encodeURIComponent(linkParam);
} else {
link = href.substring(0, actionIndex) + "&action=" + encodeURIComponent(linkParam);
}
} else {
link = href + "&action=" + encodeURIComponent(linkParam);
}
return link;
}
var onMakeActionLink = function (event) {
var actionData = event.data;
var linkParam = JSON.stringify(actionData);
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
};
var connectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", {<% include config %>,
@ -108,6 +130,7 @@
"onRequestHistoryData": onRequestHistoryData,
"onRequestHistoryClose": onRequestHistoryClose,
"onOutdatedVersion": onOutdatedVersion,
"onMakeActionLink": onMakeActionLink,
}
});

View File

@ -1,6 +1,6 @@
<!--*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*
@ -53,7 +53,7 @@
<td valign="middle" width="30%">
<span class="select-user">Username:</span>
<select class="select-user" id="user">
<option value="uid-1">Jonn Smith</option>
<option value="uid-1">John Smith</option>
<option value="uid-2">Mark Pottato</option>
<option value="uid-3">Hamish Mitchell</option>
</select>
@ -86,7 +86,7 @@
<option value="vi">Vietnamese</option>
</select>
</td>
<td valign="middle" width="70%">Choose the language for ONLYOFFICE&trade; editors interface.</td>
<td valign="middle" width="70%">Choose the language for ONLYOFFICE editors interface.</td>
</tr>
</table>
<br />
@ -143,7 +143,7 @@
<thead>
<tr class="tableHeader">
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td colspan="5" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="6" class="tableHeaderCell contentCells-shift">Editors</td>
<td colspan="3" class="tableHeaderCell">Viewers</td>
</tr>
</thead>
@ -180,12 +180,18 @@
<a href="editor?type=desktop&mode=comment&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment" /></a>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<td class="contentCells contentCells-icon">
<% if (storedFiles[i].documentType == "text") { %>
<a href="editor?type=desktop&mode=fillForms&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/fill-forms-24.png" alt="Open in editor for filling in forms" title="Open in editor for filling in forms" /></a>
<% } %>
</td>
<td class="contentCells contentCells-shift contentCells-icon">
<% if (storedFiles[i].documentType == "text") { %>
<a href="editor?type=desktop&mode=blockcontent&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/block-content-24.png" alt="Open in editor without content control modification" title="Open in editor without content control modification" /></a>
<% } %>
</td>
<% } else { %>
<td class="contentCells contentCells-shift contentCells-icon" colspan="5"></td>
<% } %>
@ -257,7 +263,7 @@
<span id="loadScripts" data-docs="<%= preloaderUrl %>"></span>
<footer>&copy; Ascensio Systems SIA 2019. All rights reserved.</footer>
<footer>&copy; Ascensio Systems SIA 2020. All rights reserved.</footer>
<script type="text/javascript" src="javascripts/jquery-1.8.2.js"></script>
<script type="text/javascript" src="javascripts/jquery-ui.js"></script>

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019 ONLYOFFICE
Copyright (c) 2020 ONLYOFFICE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,7 +1,7 @@
<?php
/*
*
* (c) Copyright Ascensio System SIA 2019
* (c) Copyright Ascensio System SIA 2020
*
* The MIT License (MIT)
*

Some files were not shown because too many files have changed in this diff Show More